Skip to content

Commit

Permalink
Remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed May 29, 2024
1 parent e3bee27 commit d71659a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
30 changes: 0 additions & 30 deletions pkg/mls/api/v1/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,29 +519,6 @@ func buildNatsSubjectForWelcomeMessages(installationId []byte) string {
return envelopes.BuildNatsSubject(contentTopic)
}

func buildIdentityUpdate(update mlsstore.IdentityUpdate) *mlsv1.GetIdentityUpdatesResponse_Update {
base := mlsv1.GetIdentityUpdatesResponse_Update{
TimestampNs: update.TimestampNs,
}
switch update.Kind {
case mlsstore.Create:
base.Kind = &mlsv1.GetIdentityUpdatesResponse_Update_NewInstallation{
NewInstallation: &mlsv1.GetIdentityUpdatesResponse_NewInstallationUpdate{
InstallationKey: update.InstallationKey,
CredentialIdentity: update.CredentialIdentity,
},
}
case mlsstore.Revoke:
base.Kind = &mlsv1.GetIdentityUpdatesResponse_Update_RevokedInstallation{
RevokedInstallation: &mlsv1.GetIdentityUpdatesResponse_RevokedInstallationUpdate{
InstallationKey: update.InstallationKey,
},
}
}

return &base
}

func validateSendGroupMessagesRequest(req *mlsv1.SendGroupMessagesRequest) error {
if req == nil || len(req.Messages) == 0 {
return status.Errorf(codes.InvalidArgument, "no group messages to send")
Expand Down Expand Up @@ -585,13 +562,6 @@ func validateUploadKeyPackageRequest(req *mlsv1.UploadKeyPackageRequest) error {
return nil
}

func validateGetIdentityUpdatesRequest(req *mlsv1.GetIdentityUpdatesRequest) error {
if req == nil || len(req.AccountAddresses) == 0 {
return status.Errorf(codes.InvalidArgument, "no wallet addresses to get updates for")
}
return nil
}

func requireReadyToSend(groupId string, message []byte) error {
if len(groupId) == 0 {
return status.Errorf(codes.InvalidArgument, "group id is empty")
Expand Down
4 changes: 1 addition & 3 deletions pkg/mls/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,12 @@ func (s *Store) GetInboxLogs(ctx context.Context, batched_req *identity.GetIdent

filters := make(queries.InboxLogFilterList, len(reqs))
for i, req := range reqs {
s.log.Info("Filtering for inbox_id", zap.Any("inbox_id", req.InboxId))
filters[i] = queries.InboxLogFilter{
InboxId: req.InboxId,
InboxId: req.InboxId, // InboxLogFilters take inbox_id as text and decode it inside Postgres, since the filters are JSON
SequenceId: int64(req.SequenceId),
}
}
filterBytes, err := filters.ToSql()
s.log.Info("Filter bytes", zap.Any("filter_bytes", filterBytes))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit d71659a

Please sign in to comment.