diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index cba1054..3703df9 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -7,12 +7,10 @@ type: Bug --- - + - -* [ ] This is an actual bug, not just a setup issue (see the [troubleshooting docs](https://docs.mau.fi/bridges/general/troubleshooting.html) or ask in the Matrix room for setup help). -* [ ] I am certain that sufficient information is included. Ask in the Matrix room first if not. -* [ ] The bug is still present on the main branch. The `!signal version` command output is: `` +It's always best to ask in the Matrix room first, especially if you aren't sure +what details are needed. Issues with insufficient detail will likely just be +ignored or closed immediately. +--> diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index ebd9186..3913002 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -11,14 +11,14 @@ jobs: strategy: fail-fast: false matrix: - go-version: ["1.25", "1.26"] - name: Lint ${{ matrix.go-version == '1.26' && '(latest)' || '(old)' }} + go-version: ["1.24", "1.25"] + name: Lint ${{ matrix.go-version == '1.25' && '(latest)' || '(old)' }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} cache: true @@ -40,14 +40,14 @@ jobs: strategy: fail-fast: false matrix: - go-version: ["1.25", "1.26"] - name: Test ${{ matrix.go-version == '1.26' && '(latest)' || '(old)' }} + go-version: ["1.24", "1.25"] + name: Test ${{ matrix.go-version == '1.25' && '(latest)' || '(old)' }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v6 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} cache: true diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index c15f2fa..c2003f3 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -17,7 +17,7 @@ jobs: lock-stale: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v6 + - uses: dessant/lock-threads@v5 id: lock with: issue-inactive-days: 90 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9cc6a3..f6b3302 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: check-added-large-files - repo: https://github.com/tekwizely/pre-commit-golang - rev: v1.0.0-rc.4 + rev: v1.0.0-rc.2 hooks: - id: go-imports exclude: "pb\\.go$" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bf9682..4e38aa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,68 +1,8 @@ -# v26.04 +# v25.11 (unreleased) -* Updated libsignal to v0.92.1 -* Added support for admin message deletes from Signal. -* Added support for binary service IDs in storage service. -* Fixed `private_chat_portal_meta` option not setting DM room names correctly. -* Fixed panic if user is logged out during initial chat sync. -* Fixed avatar upload failing when creating new Signal group. - -# v26.03 - -* Switched to sending binary service ID fields in outgoing messages. -* Added support for roundtripping large attachments via disk to avoid keeping - the entire file in memory during en/decryption. - -# v26.02.2 - -* Added support for more new binary service ID fields. - -# v26.02.1 - -* Updated libsignal to v0.87.5. -* Added support for new binary service ID fields that Signal 8.0 switched to. - -# v26.02 - -* Bumped minimum Go version to 1.25. -* Updated libsignal to v0.87.1. -* Added automatic recovery for the session not found error from libsignal. -* Fixed sender key state not being cleared on logout properly. - -# v26.01 - -* Updated libsignal to v0.86.12. -* Changed automatic contact list sync option to only sync every 3 days rather - than on every restart. -* Fixed sending messages to groups with no other registered members. -* Fixed sender key sends failing if some users had changed devices. -* Fixed timestamps of outgoing typing notifications in DMs. - -# v25.12 - -* Updated libsignal to v0.86.8. -* Updated Docker image to Alpine 3.23. -* Added support for dropping incoming DMs from blocked contacts on Signal. -* Added support for sender key encryption when sending to groups, which makes - sending much faster and enables sending typing notifications. -* Added support for encryption retry receipts. -* Fixed bugs with handling poll votes. -* Fixed history transfer option not showing up when pairing with Signal Android. -* Fixed nicknames being cleared not being bridged - (thanks to [@Enzime] in [#623]). - -[#623]: https://github.com/mautrix/signal/pull/623 -[@Enzime]: https://github.com/Enzime - -# v25.11 - -* Updated libsignal to v0.86.4. * Added support for bridging invite state in groups for phone number invites. -* Added support for polls. * Fixed PNI signature not being sent when replying to message requests. * Fixed unnecessary repeating error notices when Signal is down. -* Fixed sticker size metadata on Matrix not matching how native Signal Desktop - renders them. # v25.10 diff --git a/Dockerfile b/Dockerfile index 1acc3d2..9c5e495 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,18 @@ # -- Build libsignal (with Rust) -- -FROM rust:1-alpine AS rust-builder -RUN apk add --no-cache git make cmake protoc musl-dev g++ clang-dev protobuf-dev +FROM rust:1-alpine as rust-builder +RUN apk add --no-cache git make cmake protoc musl-dev g++ clang-dev WORKDIR /build # Copy all files needed for Rust build, and no Go files COPY pkg/libsignalgo/libsignal/. pkg/libsignalgo/libsignal/. COPY build-rust.sh . +ARG DBG=0 RUN ./build-rust.sh # -- Build mautrix-signal (with Go) -- -FROM golang:1-alpine3.23 AS go-builder -RUN apk add --no-cache git ca-certificates build-base olm-dev zlib-dev +FROM golang:1-alpine3.22 AS go-builder +RUN apk add --no-cache git ca-certificates build-base olm-dev WORKDIR /build # Copy all files needed for Go build, and no Rust files @@ -25,14 +26,20 @@ COPY pkg/connector/. pkg/connector/. COPY cmd/. cmd/. COPY .git .git +ARG DBG=0 ENV LIBRARY_PATH=. COPY --from=rust-builder /build/pkg/libsignalgo/libsignal/target/*/libsignal_ffi.a ./ RUN <. - -package connector - -import ( - "errors" - - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/commands" - "maunium.net/go/mautrix/bridgev2/networkid" - - "go.mau.fi/mautrix-signal/pkg/signalid" -) - -var CmdDiscardSenderKey = &commands.FullHandler{ - Func: fnDiscardSenderKey, - Name: "discard-sender-key", - Help: commands.HelpMeta{ - Section: commands.HelpSectionChats, - Description: "Discard the Signal-side sender key in the current group", - Args: "[_login ID_]", - }, - RequiresPortal: true, - RequiresLogin: true, -} - -func fnDiscardSenderKey(ce *commands.Event) { - _, groupID, _ := signalid.ParsePortalID(ce.Portal.ID) - if groupID == "" { - ce.Reply("This command can only be used in group chat portals") - return - } - var login *bridgev2.UserLogin - if len(ce.Args) > 0 { - login = ce.Bridge.GetCachedUserLoginByID(networkid.UserLoginID(ce.Args[0])) - if login == nil || login.UserMXID != ce.User.MXID { - ce.Reply("Login not found") - return - } - } else { - var err error - login, _, err = ce.Portal.FindPreferredLogin(ce.Ctx, ce.User, false) - if errors.Is(err, bridgev2.ErrNotLoggedIn) { - ce.Reply("You're not logged in in this portal") - return - } else if err != nil { - ce.Log.Err(err).Msg("Failed to find preferred login for portal") - ce.Reply("Failed to find preferred login for portal") - return - } - } - distributionID, err := login.Client.(*SignalClient).Client.ResetSenderKey(ce.Ctx, groupID) - if err != nil { - ce.Log.Err(err).Msg("Failed to reset sender key") - ce.Reply("Failed to reset sender key") - } else { - ce.Reply("Reset sender key with distribution ID %s", distributionID) - } -} diff --git a/pkg/connector/config.go b/pkg/connector/config.go index 232571f..4e42186 100644 --- a/pkg/connector/config.go +++ b/pkg/connector/config.go @@ -42,7 +42,6 @@ type SignalConfig struct { NoteToSelfAvatar id.ContentURIString `yaml:"note_to_self_avatar"` LocationFormat string `yaml:"location_format"` DisappearViewOnce bool `yaml:"disappear_view_once"` - ExtEvPolls bool `yaml:"extev_polls"` displaynameTemplate *template.Template `yaml:"-"` } @@ -104,7 +103,6 @@ func upgradeConfig(helper up.Helper) { helper.Copy(up.Str, "note_to_self_avatar") helper.Copy(up.Str, "location_format") helper.Copy(up.Bool, "disappear_view_once") - helper.Copy(up.Bool, "extev_polls") } func (s *SignalConnector) GetConfig() (string, any, up.Upgrader) { diff --git a/pkg/connector/connector.go b/pkg/connector/connector.go index 0343d02..e81ef7a 100644 --- a/pkg/connector/connector.go +++ b/pkg/connector/connector.go @@ -24,19 +24,15 @@ import ( "github.com/google/uuid" "go.mau.fi/util/dbutil" - "go.mau.fi/util/exhttp" "go.mau.fi/util/exsync" "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/commands" "maunium.net/go/mautrix/bridgev2/networkid" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" "go.mau.fi/mautrix-signal/pkg/msgconv" - "go.mau.fi/mautrix-signal/pkg/signalid" "go.mau.fi/mautrix-signal/pkg/signalmeow" "go.mau.fi/mautrix-signal/pkg/signalmeow/store" - "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) type SignalConnector struct { @@ -67,8 +63,6 @@ func (s *SignalConnector) Init(bridge *bridgev2.Bridge) { s.MsgConv = msgconv.NewMessageConverter(bridge) s.MsgConv.LocationFormat = s.Config.LocationFormat s.MsgConv.DisappearViewOnce = s.Config.DisappearViewOnce - s.MsgConv.ExtEvPolls = s.Config.ExtEvPolls - bridge.Commands.(*commands.Processor).AddHandlers(CmdDiscardSenderKey) } func (s *SignalConnector) SetMaxFileSize(maxSize int64) { @@ -76,7 +70,6 @@ func (s *SignalConnector) SetMaxFileSize(maxSize int64) { } func (s *SignalConnector) Start(ctx context.Context) error { - s.ResetHTTPTransport() err := s.Store.Upgrade(ctx) if err != nil { return bridgev2.DBUpgradeError{Err: err, Section: "signalmeow"} @@ -84,26 +77,6 @@ func (s *SignalConnector) Start(ctx context.Context) error { return nil } -func (s *SignalConnector) ResetHTTPTransport() { - settings := exhttp.SensibleClientSettings - hs, ok := s.Bridge.Matrix.(bridgev2.MatrixConnectorWithHTTPSettings) - if ok { - settings = hs.GetHTTPClientSettings() - } - oldClient := web.SignalHTTPClient - web.SignalHTTPClient = settings.WithTLSConfig(web.SignalTLSConfig).Compile() - oldClient.CloseIdleConnections() -} - -func (s *SignalConnector) ResetNetworkConnections() { - for _, login := range s.Bridge.GetAllCachedUserLogins() { - c := login.Client.(*SignalClient) - if c.Client != nil { - c.Client.ForceReconnect() - } - } -} - func (s *SignalConnector) LoadUserLogin(ctx context.Context, login *bridgev2.UserLogin) error { aci, err := uuid.Parse(string(login.ID)) if err != nil { @@ -120,13 +93,13 @@ func (s *SignalConnector) LoadUserLogin(ctx context.Context, login *bridgev2.Use queueEmptyWaiter: exsync.NewEvent(), } if device != nil { - sc.Client = signalmeow.NewClient( - device, - sc.UserLogin.Log.With().Str("component", "signalmeow").Logger(), - sc.handleSignalEvent, - ) - sc.Client.SyncContactsOnConnect = s.Config.SyncContactsOnStartup && - time.Since(login.Metadata.(*signalid.UserLoginMetadata).LastContactSync.Time) > 3*24*time.Hour + sc.Client = &signalmeow.Client{ + Store: device, + Log: sc.UserLogin.Log.With().Str("component", "signalmeow").Logger(), + EventHandler: sc.handleSignalEvent, + + SyncContactsOnConnect: s.Config.SyncContactsOnStartup, + } } login.Client = sc return nil diff --git a/pkg/connector/directmedia.go b/pkg/connector/directmedia.go index 05e2a07..6f31e15 100644 --- a/pkg/connector/directmedia.go +++ b/pkg/connector/directmedia.go @@ -4,7 +4,7 @@ import ( "context" "encoding/base64" "fmt" - "os" + "io" "maunium.net/go/mautrix/bridgev2" "maunium.net/go/mautrix/bridgev2/networkid" @@ -29,7 +29,6 @@ func (s *SignalConnector) Download(ctx context.Context, mediaID networkid.MediaI return nil, fmt.Errorf("failed to parse direct media id: %w", err) } - var rawDataResp []byte switch info := info.(type) { case *signalid.DirectMediaAttachment: log.Info(). @@ -42,15 +41,18 @@ func (s *SignalConnector) Download(ctx context.Context, mediaID networkid.MediaI Uint32("size", info.Size). Msg("Direct downloading attachment") - return &mediaproxy.GetMediaResponseFile{ - Callback: func(w *os.File) (*mediaproxy.FileMeta, error) { - _, err := signalmeow.DownloadAttachment( - ctx, info.CDNID, info.CDNKey, info.CDNNumber, info.Key, info.Digest, info.PlaintextDigest, info.Size, w, + return &mediaproxy.GetMediaResponseCallback{ + Callback: func(w io.Writer) (int64, error) { + data, err := signalmeow.DownloadAttachment( + ctx, info.CDNID, info.CDNKey, info.CDNNumber, info.Key, info.Digest, info.PlaintextDigest, info.Size, ) if err != nil { - return nil, err + log.Err(err).Msg("Direct download failed") + return 0, err } - return &mediaproxy.FileMeta{}, nil + + _, err = w.Write(data) + return int64(info.Size), err }, }, nil case *signalid.DirectMediaGroupAvatar: @@ -76,11 +78,18 @@ func (s *SignalConnector) Download(ctx context.Context, mediaID networkid.MediaI return nil, fmt.Errorf("failed to to get group master key: %w", err) } - rawDataResp, err = client.Client.DownloadGroupAvatar(ctx, info.GroupAvatarPath, groupMasterKey) - if err != nil { - log.Err(err).Msg("Direct download failed") - return nil, err - } + return &mediaproxy.GetMediaResponseCallback{ + Callback: func(w io.Writer) (int64, error) { + data, err := client.Client.DownloadGroupAvatar(ctx, info.GroupAvatarPath, groupMasterKey) + if err != nil { + log.Err(err).Msg("Direct download failed") + return 0, err + } + + _, err = w.Write(data) + return int64(len(data)), err + }, + }, nil case *signalid.DirectMediaProfileAvatar: log.Info(). Stringer("user_id", info.UserID). @@ -104,27 +113,19 @@ func (s *SignalConnector) Download(ctx context.Context, mediaID networkid.MediaI return nil, fmt.Errorf("profile key not found") } - rawDataResp, err = client.Client.DownloadUserAvatar(ctx, info.ProfileAvatarPath, *profileKey) - if err != nil { - log.Err(err).Msg("Direct download failed") - return nil, err - } - case *signalid.DirectMediaSticker: - log.Info(). - Hex("pack_id", info.PackID). - Uint32("sticker_id", info.StickerID). - Msg("Direct downloading sticker") + return &mediaproxy.GetMediaResponseCallback{ + Callback: func(w io.Writer) (int64, error) { + data, err := client.Client.DownloadUserAvatar(ctx, info.ProfileAvatarPath, *profileKey) + if err != nil { + log.Err(err).Msg("Direct download failed") + return 0, err + } - rawDataResp, err = signalmeow.DownloadStickerPackItem(ctx, info.PackID, info.PackKey, info.StickerID) - if err != nil { - log.Err(err).Msg("Direct download failed") - return nil, err - } + _, err = w.Write(data) + return int64(len(data)), err + }, + }, nil default: return nil, fmt.Errorf("no downloader for direct media type: %T", info) } - if rawDataResp == nil { - return nil, fmt.Errorf("unexpected fallthrough with no data") - } - return mediaproxy.GetMediaResponseRawData(rawDataResp), nil } diff --git a/pkg/connector/example-config.yaml b/pkg/connector/example-config.yaml index 25fe035..e9ff6b4 100644 --- a/pkg/connector/example-config.yaml +++ b/pkg/connector/example-config.yaml @@ -24,5 +24,3 @@ note_to_self_avatar: mxc://maunium.net/REBIVrqjZwmaWpssCZpBlmlL location_format: 'https://www.google.com/maps/place/%[1]s,%[2]s' # Should view-once messages disappear shortly after sending a read receipt on Matrix? disappear_view_once: false -# Should polls be sent using unstable MSC3381 event types? -extev_polls: false diff --git a/pkg/connector/groupinfo.go b/pkg/connector/groupinfo.go index d958463..a025fa4 100644 --- a/pkg/connector/groupinfo.go +++ b/pkg/connector/groupinfo.go @@ -98,7 +98,7 @@ func inviteLinkToJoinRule(inviteLinkAccess signalmeow.AccessControl) event.JoinR } func (s *SignalClient) getGroupInfo(ctx context.Context, groupID types.GroupIdentifier, minRevision uint32, backupChat *store.BackupChat) (*bridgev2.ChatInfo, error) { - groupInfo, _, err := s.Client.RetrieveGroupByID(ctx, groupID, minRevision) + groupInfo, err := s.Client.RetrieveGroupByID(ctx, groupID, minRevision) if err != nil { return nil, fmt.Errorf("failed to retrieve group by id: %w", err) } diff --git a/pkg/connector/handlematrix.go b/pkg/connector/handlematrix.go index 7bcb214..dec5341 100644 --- a/pkg/connector/handlematrix.go +++ b/pkg/connector/handlematrix.go @@ -21,7 +21,6 @@ import ( "crypto/sha256" "errors" "fmt" - "slices" "strconv" "time" @@ -43,19 +42,16 @@ import ( ) var ( - _ bridgev2.EditHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.ReactionHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.RedactionHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.ReadReceiptHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.TypingHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.RoomNameHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.RoomAvatarHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.RoomTopicHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.ChatViewingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.DisappearTimerChangingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.DeleteChatHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.PollHandlingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.MessageRequestAcceptingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.EditHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.ReactionHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.RedactionHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.ReadReceiptHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.TypingHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.RoomNameHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.RoomAvatarHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.RoomTopicHandlingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.ChatViewingNetworkAPI = (*SignalClient)(nil) + _ bridgev2.DisappearTimerChangingNetworkAPI = (*SignalClient)(nil) ) func (s *SignalClient) sendMessage(ctx context.Context, portalID networkid.PortalID, content *signalpb.Content) error { @@ -74,17 +70,17 @@ func (s *SignalClient) sendMessage(ctx context.Context, portalID networkid.Porta Int("failed_to_send_to_count", len(result.FailedToSendTo)). Int("successfully_sent_to_count", len(result.SuccessfullySentTo)). Logger() + if len(result.FailedToSendTo) > 0 { + log.Error().Msg("Failed to send event to some members of Signal group") + } if len(result.SuccessfullySentTo) == 0 && len(result.FailedToSendTo) == 0 { log.Debug().Msg("No successes or failures - Probably sent to myself") } else if len(result.SuccessfullySentTo) == 0 { log.Error().Msg("Failed to send event to all members of Signal group") return errors.New("failed to send to any members of Signal group") + } else if len(result.SuccessfullySentTo) < totalRecipients { - if len(result.FailedToSendTo) > 0 { - log.Warn().Msg("Failed to send event to some members of Signal group") - } else { - log.Warn().Msg("Only sent event to some members of Signal group") - } + log.Warn().Msg("Only sent event to some members of Signal group") } else { log.Debug().Msg("Sent event to all members of Signal group") } @@ -113,31 +109,16 @@ func getTimestampForEvent(txnID networkid.RawTransactionID, evt *event.Event, or } func (s *SignalClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.MatrixMessage) (message *bridgev2.MatrixMessageResponse, err error) { + ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) converted, err := s.Main.MsgConv.ToSignal( - ctx, s.Client, msg.Portal, msg.Event, msg.Content, msg.OrigSender != nil, msg.ReplyTo, + ctx, s.Client, msg.Portal, msg.Event, msg.Content, ts, msg.OrigSender != nil, msg.ReplyTo, ) if err != nil { return nil, err } - return s.doSendMessage(ctx, msg, converted, &signalid.MessageMetadata{ - ContainsAttachments: len(converted.Attachments) > 0, - }) -} - -func (s *SignalClient) doSendMessage( - ctx context.Context, - msg *bridgev2.MatrixMessage, - converted *signalpb.DataMessage, - meta *signalid.MessageMetadata, -) (*bridgev2.MatrixMessageResponse, error) { - ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) - converted.Timestamp = &ts - if meta == nil { - meta = &signalid.MessageMetadata{} - } msgID := signalid.MakeMessageID(s.Client.Store.ACI, ts) msg.AddPendingToIgnore(networkid.TransactionID(msgID)) - err := s.sendMessage(ctx, msg.Portal.ID, signalmeow.WrapDataMessage(converted)) + err = s.sendMessage(ctx, msg.Portal.ID, &signalpb.Content{DataMessage: converted}) if err != nil { return nil, bridgev2.WrapErrorInStatus(err).WithSendNotice(true) } @@ -145,7 +126,9 @@ func (s *SignalClient) doSendMessage( ID: msgID, SenderID: signalid.MakeUserID(s.Client.Store.ACI), Timestamp: time.UnixMilli(int64(ts)), - Metadata: meta, + Metadata: &signalid.MessageMetadata{ + ContainsAttachments: len(converted.Attachments) > 0, + }, } return &bridgev2.MatrixMessageResponse{ DB: dbMsg, @@ -167,16 +150,15 @@ func (s *SignalClient) HandleMatrixEdit(ctx context.Context, msg *bridgev2.Matri return fmt.Errorf("failed to get message reply target: %w", err) } } - converted, err := s.Main.MsgConv.ToSignal(ctx, s.Client, msg.Portal, msg.Event, msg.Content, msg.OrigSender != nil, replyTo) + ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) + converted, err := s.Main.MsgConv.ToSignal(ctx, s.Client, msg.Portal, msg.Event, msg.Content, ts, msg.OrigSender != nil, replyTo) if err != nil { return err } - ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) - converted.Timestamp = &ts - err = s.sendMessage(ctx, msg.Portal.ID, signalmeow.WrapEditMessage(&signalpb.EditMessage{ + err = s.sendMessage(ctx, msg.Portal.ID, &signalpb.Content{EditMessage: &signalpb.EditMessage{ TargetSentTimestamp: proto.Uint64(targetSentTimestamp), DataMessage: converted, - })) + }}) if err != nil { return bridgev2.WrapErrorInStatus(err).WithSendNotice(true) } @@ -200,16 +182,19 @@ func (s *SignalClient) HandleMatrixReaction(ctx context.Context, msg *bridgev2.M return nil, fmt.Errorf("failed to parse target message ID: %w", err) } ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) - err = s.sendMessage(ctx, msg.Portal.ID, signalmeow.WrapDataMessage(&signalpb.DataMessage{ - Timestamp: proto.Uint64(ts), - RequiredProtocolVersion: proto.Uint32(uint32(signalpb.DataMessage_REACTIONS)), - Reaction: &signalpb.DataMessage_Reaction{ - Emoji: proto.String(msg.PreHandleResp.Emoji), - Remove: proto.Bool(false), - TargetAuthorAciBinary: targetAuthorACI[:], - TargetSentTimestamp: proto.Uint64(targetSentTimestamp), + wrappedContent := &signalpb.Content{ + DataMessage: &signalpb.DataMessage{ + Timestamp: proto.Uint64(ts), + RequiredProtocolVersion: proto.Uint32(uint32(signalpb.DataMessage_REACTIONS)), + Reaction: &signalpb.DataMessage_Reaction{ + Emoji: proto.String(msg.PreHandleResp.Emoji), + Remove: proto.Bool(false), + TargetAuthorAci: proto.String(targetAuthorACI.String()), + TargetSentTimestamp: proto.Uint64(targetSentTimestamp), + }, }, - })) + } + err = s.sendMessage(ctx, msg.Portal.ID, wrappedContent) if err != nil { return nil, err } @@ -222,16 +207,19 @@ func (s *SignalClient) HandleMatrixReactionRemove(ctx context.Context, msg *brid return fmt.Errorf("failed to parse target message ID: %w", err) } ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) - err = s.sendMessage(ctx, msg.Portal.ID, signalmeow.WrapDataMessage(&signalpb.DataMessage{ - Timestamp: proto.Uint64(ts), - RequiredProtocolVersion: proto.Uint32(uint32(signalpb.DataMessage_REACTIONS)), - Reaction: &signalpb.DataMessage_Reaction{ - Emoji: proto.String(msg.TargetReaction.Emoji), - Remove: proto.Bool(true), - TargetAuthorAciBinary: targetAuthorACI[:], - TargetSentTimestamp: proto.Uint64(targetSentTimestamp), + wrappedContent := &signalpb.Content{ + DataMessage: &signalpb.DataMessage{ + Timestamp: proto.Uint64(ts), + RequiredProtocolVersion: proto.Uint32(uint32(signalpb.DataMessage_REACTIONS)), + Reaction: &signalpb.DataMessage_Reaction{ + Emoji: proto.String(msg.TargetReaction.Emoji), + Remove: proto.Bool(true), + TargetAuthorAci: proto.String(targetAuthorACI.String()), + TargetSentTimestamp: proto.Uint64(targetSentTimestamp), + }, }, - })) + } + err = s.sendMessage(ctx, msg.Portal.ID, wrappedContent) if err != nil { return err } @@ -246,12 +234,15 @@ func (s *SignalClient) HandleMatrixMessageRemove(ctx context.Context, msg *bridg return fmt.Errorf("cannot delete other people's messages") } ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) - err = s.sendMessage(ctx, msg.Portal.ID, signalmeow.WrapDataMessage(&signalpb.DataMessage{ - Timestamp: proto.Uint64(ts), - Delete: &signalpb.DataMessage_Delete{ - TargetSentTimestamp: proto.Uint64(targetSentTimestamp), + wrappedContent := &signalpb.Content{ + DataMessage: &signalpb.DataMessage{ + Timestamp: proto.Uint64(ts), + Delete: &signalpb.DataMessage_Delete{ + TargetSentTimestamp: proto.Uint64(targetSentTimestamp), + }, }, - })) + } + err = s.sendMessage(ctx, msg.Portal.ID, wrappedContent) if err != nil { return err } @@ -311,21 +302,18 @@ func (s *SignalClient) HandleMatrixReadReceipt(ctx context.Context, receipt *bri } func (s *SignalClient) HandleMatrixTyping(ctx context.Context, typing *bridgev2.MatrixTyping) error { - userID, groupID, err := signalid.ParsePortalID(typing.Portal.ID) + userID, _, err := signalid.ParsePortalID(typing.Portal.ID) if err != nil { return err } - typingMessage := signalmeow.TypingMessage(typing.IsTyping) + // Only send typing notifications in DMs for now + // Sending efficiently to groups requires implementing the proper SenderKey stuff first if !userID.IsEmpty() && userID.Type == libsignalgo.ServiceIDTypeACI { + typingMessage := signalmeow.TypingMessage(typing.IsTyping) result := s.Client.SendMessage(ctx, userID, typingMessage) if !result.WasSuccessful { return result.Error } - } else if groupID != "" { - _, err = s.Client.SendGroupMessage(ctx, groupID, typingMessage) - if err != nil { - return err - } } return nil } @@ -378,7 +366,7 @@ func (s *SignalClient) HandleMatrixRoomAvatar(ctx context.Context, msg *bridgev2 return false, fmt.Errorf("failed to download avatar: %w", err) } avatarHash = sha256.Sum256(data) - avatarPath, err = s.Client.UploadGroupAvatar(ctx, data, groupID, "") + avatarPath, err = s.Client.UploadGroupAvatar(ctx, data, groupID) if err != nil { return false, fmt.Errorf("failed to reupload avatar: %w", err) } @@ -397,24 +385,22 @@ func (s *SignalClient) HandleMatrixRoomTopic(ctx context.Context, msg *bridgev2. }, nil) } -func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2.MatrixMembershipChange) (*bridgev2.MatrixMembershipResult, error) { - if msg.Type.IsSelf && msg.OrigSender != nil { - return nil, nil - } +func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2.MatrixMembershipChange) (bool, error) { var targetIntent bridgev2.MatrixAPI var targetSignalID libsignalgo.ServiceID var err error if msg.Portal.RoomType == database.RoomTypeDM { + //TODO: this probably needs to revert some changes and clean up the portal on leaves switch msg.Type { case bridgev2.Invite: - return nil, fmt.Errorf("cannot invite additional user to dm") + return false, fmt.Errorf("cannot invite additional user to dm") default: - return nil, nil + return false, nil } } targetSignalID, err = signalid.ParseGhostOrUserLoginID(msg.Target) if err != nil { - return nil, fmt.Errorf("failed to parse target signal id: %w", err) + return false, fmt.Errorf("failed to parse target signal id: %w", err) } switch target := msg.Target.(type) { case *bridgev2.Ghost: @@ -424,12 +410,12 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 if targetIntent == nil { ghost, err := s.Main.Bridge.GetGhostByID(ctx, networkid.UserID(target.ID)) if err != nil { - return nil, fmt.Errorf("failed to get ghost for user: %w", err) + return false, fmt.Errorf("failed to get ghost for user: %w", err) } targetIntent = ghost.Intent } default: - return nil, fmt.Errorf("cannot get target intent: unknown type: %T", target) + return false, fmt.Errorf("cannot get target intent: unknown type: %T", target) } log := zerolog.Ctx(ctx).With(). Str("From Membership", string(msg.Type.From)). @@ -449,7 +435,7 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 switch msg.Type { case bridgev2.AcceptInvite: if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't accept invite for non-ACI service ID") + return false, fmt.Errorf("can't accept invite for non-ACI service ID") } gc.PromotePendingMembers = []*signalmeow.PromotePendingMember{{ ACI: targetSignalID.UUID, @@ -458,7 +444,7 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 gc.DeletePendingMembers = []*libsignalgo.ServiceID{&targetSignalID} case bridgev2.Leave, bridgev2.Kick: if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't kick non-ACI service ID") + return false, fmt.Errorf("can't kick non-ACI service ID") } gc.DeleteMembers = []*uuid.UUID{&targetSignalID.UUID} case bridgev2.Invite: @@ -494,7 +480,7 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 // }} case bridgev2.AcceptKnock: if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't accept knock from non-ACI service ID") + return false, fmt.Errorf("can't accept knock from non-ACI service ID") } gc.PromoteRequestingMembers = []*signalmeow.RoleMember{{ ACI: targetSignalID.UUID, @@ -502,7 +488,7 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 }} case bridgev2.RetractKnock, bridgev2.RejectKnock: if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't reject knock from non-ACI service ID") + return false, fmt.Errorf("can't reject knock from non-ACI service ID") } gc.DeleteRequestingMembers = []*uuid.UUID{&targetSignalID.UUID} case bridgev2.BanKnocked, bridgev2.BanInvited, bridgev2.BanJoined, bridgev2.BanLeft: @@ -513,39 +499,40 @@ func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2 switch msg.Type { case bridgev2.BanJoined: if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't ban joined non-ACI service ID") + return false, fmt.Errorf("can't ban joined non-ACI service ID") } gc.DeleteMembers = []*uuid.UUID{&targetSignalID.UUID} case bridgev2.BanInvited: gc.DeletePendingMembers = []*libsignalgo.ServiceID{&targetSignalID} case bridgev2.BanKnocked: if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't ban knocked non-ACI service ID") + return false, fmt.Errorf("can't ban knocked non-ACI service ID") } gc.DeleteRequestingMembers = []*uuid.UUID{&targetSignalID.UUID} } case bridgev2.Unban: gc.DeleteBannedMembers = []*libsignalgo.ServiceID{&targetSignalID} default: - return nil, fmt.Errorf("unsupported membership change: %s -> %s", msg.Type.From, msg.Type.To) + log.Debug().Msg("unsupported membership change") + return false, nil } _, groupID, err := signalid.ParsePortalID(msg.Portal.ID) if err != nil || groupID == "" { - return nil, err + return false, err } gc.Revision = msg.Portal.Metadata.(*signalid.PortalMetadata).Revision + 1 revision, err := s.Client.UpdateGroup(ctx, gc, groupID) if err != nil { - return nil, err + return false, err } if msg.Type == bridgev2.Invite && targetSignalID.Type != libsignalgo.ServiceIDTypePNI { err = targetIntent.EnsureJoined(ctx, msg.Portal.MXID) if err != nil { - return nil, err + return false, err } } msg.Portal.Metadata.(*signalid.PortalMetadata).Revision = revision - return nil, nil + return true, nil } func plToRole(pl int) signalmeow.GroupMemberRole { @@ -679,11 +666,13 @@ func (s *SignalClient) HandleMatrixDisappearingTimer(ctx context.Context, msg *b }) } else { ts := getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender) - res := s.Client.SendMessage(ctx, userID, signalmeow.WrapDataMessage(&signalpb.DataMessage{ - Timestamp: ptr.Ptr(ts), - Flags: ptr.Ptr(uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE)), - ExpireTimer: ptr.Ptr(uint32(msg.Content.Timer.Seconds())), - })) + res := s.Client.SendMessage(ctx, userID, &signalpb.Content{ + DataMessage: &signalpb.DataMessage{ + Timestamp: ptr.Ptr(ts), + Flags: ptr.Ptr(uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE)), + ExpireTimer: ptr.Ptr(uint32(msg.Content.Timer.Seconds())), + }, + }) if !res.WasSuccessful { return false, res.Error } @@ -691,222 +680,3 @@ func (s *SignalClient) HandleMatrixDisappearingTimer(ctx context.Context, msg *b return true, nil } } - -func (s *SignalClient) HandleMatrixDeleteChat(ctx context.Context, msg *bridgev2.MatrixDeleteChat) error { - userID, groupID, err := signalid.ParsePortalID(msg.Portal.ID) - if err != nil { - return fmt.Errorf("failed to parse portal ID: %w", err) - } - - if msg.Content.FromMessageRequest { - // TODO block and delete support? - err = s.syncMessageRequestResponse(ctx, msg.Portal, signalpb.SyncMessage_MessageRequestResponse_DELETE) - if err != nil { - return fmt.Errorf("failed to send message request delete sync: %w", err) - } - } - - // Build ConversationIdentifier based on portal type - var conversationID *signalpb.ConversationIdentifier - if groupID == "" { - conversationID = &signalpb.ConversationIdentifier{ - Identifier: &signalpb.ConversationIdentifier_ThreadServiceIdBinary{ - ThreadServiceIdBinary: userID.Bytes(), - }, - } - } else { - gid, err := groupID.Bytes() - if err != nil { - return fmt.Errorf("failed to parse group ID: %w", err) - } - conversationID = &signalpb.ConversationIdentifier{ - Identifier: &signalpb.ConversationIdentifier_ThreadGroupId{ - ThreadGroupId: gid[:], - }, - } - } - - // Retrieve most recent messages from the portal - var mostRecentMessages []*signalpb.AddressableMessage - dbMessages, err := s.Main.Bridge.DB.Message.GetMessagesBetweenTimeQuery( - ctx, - msg.Portal.PortalKey, - time.Now().Add(-30*24*time.Hour), // Last 30 days - time.Now(), - ) - if err != nil { - zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to get recent messages for conversation delete") - } else if len(dbMessages) > 0 { - // Limit to the 5 most recent messages overall - limit := 5 - startIdx := 0 - if len(dbMessages) > limit { - startIdx = len(dbMessages) - limit - } - - // Create AddressableMessage for most recent messages - for _, dbMsg := range dbMessages[startIdx:] { - senderACI, timestamp, err := signalid.ParseMessageID(dbMsg.ID) - if err != nil { - continue - } - - mostRecentMessages = append(mostRecentMessages, &signalpb.AddressableMessage{ - Author: &signalpb.AddressableMessage_AuthorServiceIdBinary{ - AuthorServiceIdBinary: senderACI[:], - }, - SentTimestamp: proto.Uint64(timestamp), - }) - } - } - - recipientID := s.Client.Store.ACIServiceID() - // Send DeleteForMe sync message to self - result := s.Client.SendMessage(ctx, recipientID, signalmeow.WrapSyncMessage(&signalpb.SyncMessage{ - Content: &signalpb.SyncMessage_DeleteForMe_{ - DeleteForMe: &signalpb.SyncMessage_DeleteForMe{ - ConversationDeletes: []*signalpb.SyncMessage_DeleteForMe_ConversationDelete{{ - Conversation: conversationID, - MostRecentMessages: mostRecentMessages, - IsFullDelete: proto.Bool(true), - }}, - }, - }, - })) - - zerolog.Ctx(ctx).Debug(). - Str("portal_id", string(msg.Portal.ID)). - Int("recent_messages_count", len(mostRecentMessages)). - Msg("Sent conversation deletion to Signal") - - if !result.WasSuccessful { - return fmt.Errorf("failed to send delete conversation sync message: %w %s %s", result.Error, userID, groupID) - } - - return nil -} - -func (s *SignalClient) HandleMatrixPollStart(ctx context.Context, msg *bridgev2.MatrixPollStart) (*bridgev2.MatrixMessageResponse, error) { - optionNames := make([]string, len(msg.Content.PollStart.Answers)) - optionIDs := make([]string, len(msg.Content.PollStart.Answers)) - for i, option := range msg.Content.PollStart.Answers { - optionNames[i] = option.Text - optionIDs[i] = option.ID - } - converted := &signalpb.DataMessage{ - PollCreate: &signalpb.DataMessage_PollCreate{ - Question: ptr.Ptr(msg.Content.PollStart.Question.Text), - AllowMultiple: ptr.Ptr(msg.Content.PollStart.MaxSelections != 1), - Options: optionNames, - }, - RequiredProtocolVersion: ptr.Ptr(uint32(signalpb.DataMessage_POLLS)), - } - return s.doSendMessage(ctx, &msg.MatrixMessage, converted, &signalid.MessageMetadata{ - MatrixPollOptionIDs: optionIDs, - }) -} - -func (s *SignalClient) HandleMatrixPollVote(ctx context.Context, msg *bridgev2.MatrixPollVote) (*bridgev2.MatrixMessageResponse, error) { - senderACI, msgTS, err := signalid.ParseMessageID(msg.VoteTo.ID) - if err != nil { - return nil, err - } - mxOptions := msg.VoteTo.Metadata.(*signalid.MessageMetadata).MatrixPollOptionIDs - optionIndexes := make([]uint32, len(msg.Content.Response.Answers)) - for i, answer := range msg.Content.Response.Answers { - if idx := slices.Index(mxOptions, answer); idx >= 0 { - optionIndexes[i] = uint32(idx) - } else if idx, err = strconv.Atoi(answer); err == nil && idx >= 0 { - optionIndexes[i] = uint32(idx) - } else { - return nil, fmt.Errorf("unknown poll answer ID: %s", answer) - } - } - converted := &signalpb.DataMessage{ - PollVote: &signalpb.DataMessage_PollVote{ - TargetAuthorAciBinary: senderACI[:], - TargetSentTimestamp: &msgTS, - OptionIndexes: optionIndexes, - VoteCount: proto.Uint32(1), // TODO - }, - RequiredProtocolVersion: proto.Uint32(0), - } - return s.doSendMessage(ctx, &msg.MatrixMessage, converted, nil) -} - -func (s *SignalClient) syncMessageRequestResponse( - ctx context.Context, - portal *bridgev2.Portal, - respType signalpb.SyncMessage_MessageRequestResponse_Type, -) error { - userID, groupID, err := signalid.ParsePortalID(portal.ID) - if err != nil { - return err - } - accept := &signalpb.SyncMessage_MessageRequestResponse{ - Type: respType.Enum(), - } - if groupID != "" { - gidBytes, err := groupID.Bytes() - if err != nil { - return fmt.Errorf("failed to parse group ID: %w", err) - } - accept.GroupId = gidBytes[:] - } else if userID.Type == libsignalgo.ServiceIDTypeACI { - accept.ThreadAciBinary = userID.UUID[:] - } else { - return fmt.Errorf("invalid portal ID for message request response: %s", portal.ID) - } - res := s.Client.SendMessage(ctx, libsignalgo.NewACIServiceID(s.Client.Store.ACI), signalmeow.WrapSyncMessage(&signalpb.SyncMessage{ - Content: &signalpb.SyncMessage_MessageRequestResponse_{ - MessageRequestResponse: accept, - }, - })) - if !res.WasSuccessful { - return res.Error - } - return nil -} - -func (s *SignalClient) HandleMatrixAcceptMessageRequest(ctx context.Context, msg *bridgev2.MatrixAcceptMessageRequest) error { - userID, _, err := signalid.ParsePortalID(msg.Portal.ID) - if err != nil { - return err - } - err = s.syncMessageRequestResponse(ctx, msg.Portal, signalpb.SyncMessage_MessageRequestResponse_ACCEPT) - if err != nil { - return fmt.Errorf("failed to sync message request acceptance: %w", err) - } - if userID.Type == libsignalgo.ServiceIDTypeACI { - profileKey, err := s.Client.ProfileKeyForSignalID(ctx, s.Client.Store.ACI) - if err != nil { - return fmt.Errorf("failed to get own profile key: %w", err) - } - var pniSig *signalpb.PniSignatureMessage - if s.Client.Store.AccountRecord.GetPhoneNumberSharingMode() == signalpb.AccountRecord_EVERYBODY { - sig, err := s.Client.Store.PNIIdentityKeyPair.SignAlternateIdentity(s.Client.Store.ACIIdentityKeyPair.GetIdentityKey()) - if err != nil { - return fmt.Errorf("failed to generate PNI signature: %w", err) - } - pniSig = &signalpb.PniSignatureMessage{ - Pni: s.Client.Store.PNI[:], - Signature: sig, - } - } - res := s.Client.SendMessage(ctx, userID, &signalpb.Content{ - Content: &signalpb.Content_DataMessage{DataMessage: &signalpb.DataMessage{ - Flags: proto.Uint32(uint32(signalpb.DataMessage_PROFILE_KEY_UPDATE)), - ProfileKey: profileKey.Slice(), - Timestamp: proto.Uint64(getTimestampForEvent(msg.InputTransactionID, msg.Event, msg.OrigSender)), - - RequiredProtocolVersion: proto.Uint32(0), - }}, - PniSignatureMessage: pniSig, - }) - if !res.WasSuccessful { - return fmt.Errorf("failed to share profile key to accept message request: %w", res.Error) - } - // TODO send read receipts too? - } - return nil -} diff --git a/pkg/connector/handlesignal.go b/pkg/connector/handlesignal.go index 329b2cf..d60acc0 100644 --- a/pkg/connector/handlesignal.go +++ b/pkg/connector/handlesignal.go @@ -26,8 +26,6 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" "go.mau.fi/util/exzerolog" - "go.mau.fi/util/jsontime" - "go.mau.fi/util/ptr" "maunium.net/go/mautrix/bridgev2" "maunium.net/go/mautrix/bridgev2/database" "maunium.net/go/mautrix/bridgev2/networkid" @@ -37,7 +35,6 @@ import ( "go.mau.fi/mautrix-signal/pkg/libsignalgo" "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" "go.mau.fi/mautrix-signal/pkg/signalmeow/events" signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/types" @@ -55,8 +52,6 @@ func (s *SignalClient) handleSignalEvent(rawEvt events.SignalEvent) bool { return s.handleSignalReadSelf(evt) case *events.DeleteForMe: return s.handleSignalDeleteForMe(evt) - case *events.MessageRequestResponse: - return s.handleSignalMessageRequestResponse(evt) case *events.Call: return s.Main.Bridge.QueueRemoteEvent(s.UserLogin, s.wrapCallEvent(evt)).Success case *events.ContactList: @@ -103,9 +98,6 @@ func convertCallEvent(ctx context.Context, portal *bridgev2.Portal, intent bridg if userID, _, _ := signalid.ParsePortalID(portal.ID); !userID.IsEmpty() { content.MsgType = event.MsgText } - content.BeeperActionMessage = &event.BeeperActionMessage{ - Type: event.BeeperActionMessageCall, - } } else { content.Body = "Call ended" } @@ -175,7 +167,7 @@ func (evt *Bv2ChatEvent) GetType() bridgev2.RemoteEventType { case *signalpb.DataMessage: switch { case innerEvt.Body != nil, innerEvt.Attachments != nil, innerEvt.Contact != nil, innerEvt.Sticker != nil, - innerEvt.Payment != nil, innerEvt.GiftBadge != nil, innerEvt.PollCreate != nil, innerEvt.PollVote != nil, + innerEvt.Payment != nil, innerEvt.GiftBadge != nil, innerEvt.GetRequiredProtocolVersion() > uint32(signalpb.DataMessage_CURRENT), innerEvt.GetFlags()&uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE) != 0: return bridgev2.RemoteEventMessage @@ -184,7 +176,7 @@ func (evt *Bv2ChatEvent) GetType() bridgev2.RemoteEventType { return bridgev2.RemoteEventReactionRemove } return bridgev2.RemoteEventReaction - case innerEvt.Delete != nil, innerEvt.AdminDelete != nil: + case innerEvt.Delete != nil: return bridgev2.RemoteEventMessageRemove case innerEvt.GetGroupV2().GetGroupChange() != nil: return bridgev2.RemoteEventChatInfoChange @@ -293,21 +285,16 @@ func (evt *Bv2ChatEvent) GetTimestamp() time.Time { } func (evt *Bv2ChatEvent) GetTargetMessage() networkid.MessageID { - var targetAuthorACI uuid.UUID + var targetAuthorACI string var targetSentTS uint64 switch innerEvt := evt.Event.(type) { case *signalpb.DataMessage: switch { case innerEvt.Reaction != nil: - targetAuthorACI, _ = signalmeow.ParseStringOrBinaryUUID(innerEvt.Reaction.GetTargetAuthorAci(), innerEvt.Reaction.GetTargetAuthorAciBinary()) + targetAuthorACI = innerEvt.Reaction.GetTargetAuthorAci() targetSentTS = innerEvt.Reaction.GetTargetSentTimestamp() case innerEvt.Delete != nil: targetSentTS = innerEvt.Delete.GetTargetSentTimestamp() - case innerEvt.AdminDelete != nil: - if len(innerEvt.AdminDelete.GetTargetAuthorAciBinary()) == 16 { - targetAuthorACI = uuid.UUID(innerEvt.AdminDelete.GetTargetAuthorAciBinary()) - } - targetSentTS = innerEvt.AdminDelete.GetTargetSentTimestamp() default: return "" } @@ -316,10 +303,11 @@ func (evt *Bv2ChatEvent) GetTargetMessage() networkid.MessageID { default: return "" } - if targetAuthorACI == uuid.Nil { - targetAuthorACI = evt.Info.Sender + targetAuthorUUID := evt.Info.Sender + if targetAuthorACI != "" { + targetAuthorUUID, _ = uuid.Parse(targetAuthorACI) } - return signalid.MakeMessageID(targetAuthorACI, targetSentTS) + return signalid.MakeMessageID(targetAuthorUUID, targetSentTS) } func (evt *Bv2ChatEvent) GetReactionEmoji() (string, networkid.EmojiID) { @@ -339,7 +327,7 @@ func (evt *Bv2ChatEvent) ConvertMessage(ctx context.Context, portal *bridgev2.Po if !ok { return nil, fmt.Errorf("ConvertMessage() called for non-DataMessage event") } - converted := evt.s.Main.MsgConv.ToMatrix(ctx, evt.s.Client, portal, evt.Info.Sender, intent, dataMsg, nil) + converted := evt.s.Main.MsgConv.ToMatrix(ctx, evt.s.Client, portal, intent, dataMsg, nil) if converted.Disappear.Type != "" { evtTS := evt.GetTimestamp() if !dataMsg.GetIsViewOnce() { @@ -364,7 +352,7 @@ func (evt *Bv2ChatEvent) ConvertEdit(ctx context.Context, portal *bridgev2.Porta return nil, fmt.Errorf("ConvertEdit() called for non-EditMessage event") } // TODO tell converter about existing parts to avoid reupload? - converted := evt.s.Main.MsgConv.ToMatrix(ctx, evt.s.Client, portal, evt.Info.Sender, intent, editMsg.GetDataMessage(), nil) + converted := evt.s.Main.MsgConv.ToMatrix(ctx, evt.s.Client, portal, intent, editMsg.GetDataMessage(), nil) // TODO can anything other than the text be edited? editPart := converted.Parts[len(converted.Parts)-1].ToEditPart(existing[len(existing)-1]) editPart.Part.EditCount++ @@ -426,7 +414,7 @@ func (b *Bv2Receipt) GetReadUpTo() time.Time { return time.Time{} } -var _ bridgev2.RemoteReadReceipt = (*Bv2Receipt)(nil) +var _ bridgev2.RemoteReceipt = (*Bv2Receipt)(nil) func convertReceipts[T any](ctx context.Context, input []T, getMessageFunc func(ctx context.Context, msgID T) (*database.Message, error)) map[networkid.PortalKey]*Bv2Receipt { log := zerolog.Ctx(ctx) @@ -472,7 +460,7 @@ func (s *SignalClient) handleSignalReceipt(evt *events.Receipt) bool { Stringer("sender_id", evt.Sender). Stringer("receipt_type", evt.Content.GetType()). Logger() - ctx := log.WithContext(s.Main.Bridge.BackgroundCtx) + ctx := log.WithContext(context.TODO()) receipts := convertReceipts(ctx, evt.Content.Timestamp, func(ctx context.Context, msgTS uint64) (*database.Message, error) { return s.Main.Bridge.DB.Message.GetFirstPartByID(ctx, s.UserLogin.ID, signalid.MakeMessageID(s.Client.Store.ACI, msgTS)) }) @@ -483,9 +471,9 @@ func (s *SignalClient) handleSignalReadSelf(evt *events.ReadSelf) bool { log := s.UserLogin.Log.With(). Str("action", "handle signal read self"). Logger() - ctx := log.WithContext(s.Main.Bridge.BackgroundCtx) + ctx := log.WithContext(context.TODO()) receipts := convertReceipts(ctx, evt.Messages, func(ctx context.Context, msgInfo *signalpb.SyncMessage_Read) (*database.Message, error) { - aciUUID, err := signalmeow.ParseStringOrBinaryUUID(msgInfo.GetSenderAci(), msgInfo.GetSenderAciBinary()) + aciUUID, err := uuid.Parse(msgInfo.GetSenderAci()) if err != nil { return nil, err } @@ -504,13 +492,6 @@ func (s *SignalClient) conversationIDToPortalKey(ctx context.Context, cid *signa return networkid.PortalKey{}, false } return s.makeDMPortalKey(serviceID), true - case *signalpb.ConversationIdentifier_ThreadServiceIdBinary: - serviceID, err := libsignalgo.ServiceIDFromBytes(ident.ThreadServiceIdBinary) - if err != nil { - log.Err(err).Hex("chat_id", ident.ThreadServiceIdBinary).Msg("Failed to parse delete for me conversation ID") - return networkid.PortalKey{}, false - } - return s.makeDMPortalKey(serviceID), true case *signalpb.ConversationIdentifier_ThreadGroupId: if len(ident.ThreadGroupId) != libsignalgo.GroupIdentifierLength { log.Error(). @@ -549,22 +530,6 @@ func (s *SignalClient) addressableMessageToID(ctx context.Context, portalKey net return "" } return signalid.MakeMessageID(serviceID.UUID, am.GetSentTimestamp()) - case *signalpb.AddressableMessage_AuthorServiceIdBinary: - serviceID, err := libsignalgo.ServiceIDFromBytes(typedAuthor.AuthorServiceIdBinary) - if err != nil { - log.Err(err). - Object("portal_key", portalKey). - Hex("author_service_id_binary", typedAuthor.AuthorServiceIdBinary). - Msg("Failed to parse delete for me message author service ID") - return "" - } else if serviceID.Type != libsignalgo.ServiceIDTypeACI { - log.Warn(). - Object("portal_key", portalKey). - Hex("author_service_id_binary", typedAuthor.AuthorServiceIdBinary). - Msg("Dropping delete for me message with unsupported service ID type") - return "" - } - return signalid.MakeMessageID(serviceID.UUID, am.GetSentTimestamp()) case *signalpb.AddressableMessage_AuthorE164: log.Warn(). Object("portal_key", portalKey). @@ -655,45 +620,13 @@ func (s *SignalClient) handleSignalDeleteForMe(evt *events.DeleteForMe) bool { return true } -func (s *SignalClient) handleSignalMessageRequestResponse(evt *events.MessageRequestResponse) bool { - if evt.Type != signalpb.SyncMessage_MessageRequestResponse_ACCEPT { - // TODO do we need to do anything with blocks/deletes here or are they sent as normal delete events? - return true - } - var portalKey networkid.PortalKey - if evt.GroupID != nil { - portalKey = s.makePortalKey(evt.GroupID.String()) - } else if evt.ThreadACI != uuid.Nil { - portalKey = s.makeDMPortalKey(libsignalgo.NewACIServiceID(evt.ThreadACI)) - } else { - return true - } - res := s.UserLogin.QueueRemoteEvent(&simplevent.ChatInfoChange{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventChatInfoChange, - PortalKey: portalKey, - Timestamp: time.UnixMilli(int64(evt.Timestamp)), - StreamOrder: int64(evt.Timestamp), - LogContext: func(c zerolog.Context) zerolog.Context { - return c.Str("action", "unmark message request").Str("source", "sync message") - }, - }, - ChatInfoChange: &bridgev2.ChatInfoChange{ - ChatInfo: &bridgev2.ChatInfo{ - MessageRequest: ptr.Ptr(false), - }, - }, - }) - return res.Success -} - func (s *SignalClient) handleSignalACIFound(evt *events.ACIFound) { log := s.UserLogin.Log.With(). Str("action", "handle aci found"). Stringer("aci", evt.ACI). Stringer("pni", evt.PNI). Logger() - ctx := log.WithContext(s.Main.Bridge.BackgroundCtx) + ctx := log.WithContext(context.TODO()) pniPortalKey := s.makeDMPortalKey(evt.PNI) aciPortalKey := s.makeDMPortalKey(evt.ACI) result, portal, err := s.Main.Bridge.ReIDPortal(ctx, pniPortalKey, aciPortalKey) @@ -713,7 +646,7 @@ func (s *SignalClient) handleSignalACIFound(evt *events.ACIFound) { func (s *SignalClient) handleSignalContactList(evt *events.ContactList) { log := s.UserLogin.Log.With().Str("action", "handle contact list").Logger() - ctx := log.WithContext(s.Main.Bridge.BackgroundCtx) + ctx := log.WithContext(context.TODO()) for _, contact := range evt.Contacts { if contact.ACI == uuid.Nil { continue @@ -741,33 +674,6 @@ func (s *SignalClient) handleSignalContactList(evt *events.ContactList) { if contact.ACI == s.Client.Store.ACI { s.updateRemoteProfile(ctx, true) } - if ptr.Val(contact.Whitelisted) { - portal, err := s.Main.Bridge.GetExistingPortalByKey(ctx, s.makeDMPortalKey(libsignalgo.NewACIServiceID(contact.ACI))) - if err != nil { - log.Err(err).Msg("Failed to get existing portal to update contact info") - continue - } else if portal != nil && portal.MessageRequest { - s.UserLogin.QueueRemoteEvent(&simplevent.ChatInfoChange{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventChatInfoChange, - LogContext: func(c zerolog.Context) zerolog.Context { - return c.Str("action", "unmark message request").Str("source", "contact list") - }, - PortalKey: portal.PortalKey, - }, - ChatInfoChange: &bridgev2.ChatInfoChange{ - ChatInfo: &bridgev2.ChatInfo{ - MessageRequest: ptr.Ptr(false), - }, - }, - }) - } - } - } - s.UserLogin.Metadata.(*signalid.UserLoginMetadata).LastContactSync = jsontime.UnixMilliNow() - err := s.UserLogin.Save(ctx) - if err != nil { - log.Err(err).Msg("Failed to update last contact sync time") } } diff --git a/pkg/connector/login.go b/pkg/connector/login.go index 9116390..12d548d 100644 --- a/pkg/connector/login.go +++ b/pkg/connector/login.go @@ -52,6 +52,8 @@ type QRLogin struct { cancelChan context.CancelFunc ProvChan chan signalmeow.ProvisioningResponse newQRCount int + + ProvData *store.DeviceData } var _ bridgev2.LoginProcessDisplayAndWait = (*QRLogin)(nil) @@ -75,7 +77,7 @@ func (qr *QRLogin) Start(ctx context.Context) (*bridgev2.LoginStep, error) { Str("action", "login"). Stringer("user_id", qr.User.MXID). Logger() - provCtx, cancel := context.WithCancel(log.WithContext(qr.Main.Bridge.BackgroundCtx)) + provCtx, cancel := context.WithCancel(log.WithContext(context.Background())) qr.cancelChan = cancel // Don't use the start context here: the channel will outlive the start request. qr.ProvChan = signalmeow.PerformProvisioning( @@ -110,6 +112,14 @@ func (qr *QRLogin) Wait(ctx context.Context) (*bridgev2.LoginStep, error) { return nil, fmt.Errorf("login not started") } + if qr.ProvData == nil { + return qr.qrWait(ctx) + } else { + return qr.processingWait(ctx) + } +} + +func (qr *QRLogin) qrWait(ctx context.Context) (*bridgev2.LoginStep, error) { select { case resp := <-qr.ProvChan: if resp.Err != nil { @@ -122,7 +132,15 @@ func (qr *QRLogin) Wait(ctx context.Context) (*bridgev2.LoginStep, error) { qr.cancelChan() return nil, fmt.Errorf("no signal account ID received") } - return qr.loginComplete(ctx, resp.ProvisioningData) + qr.ProvData = resp.ProvisioningData + return &bridgev2.LoginStep{ + Type: bridgev2.LoginStepTypeDisplayAndWait, + StepID: LoginStepProcess, + Instructions: fmt.Sprintf("Processing login as %s...", resp.ProvisioningData.Number), + DisplayAndWaitParams: &bridgev2.LoginDisplayAndWaitParams{ + Type: bridgev2.LoginDisplayTypeNothing, + }, + }, nil // Server will timeout the request after 60 seconds, but Signal Desktop opens // a new socket and gets a new QR code after 45 seconds. We should do the same. @@ -140,13 +158,26 @@ func (qr *QRLogin) Wait(ctx context.Context) (*bridgev2.LoginStep, error) { } } -func (qr *QRLogin) loginComplete(ctx context.Context, provData *store.DeviceData) (*bridgev2.LoginStep, error) { +func (qr *QRLogin) processingWait(ctx context.Context) (*bridgev2.LoginStep, error) { defer qr.cancelChan() + newLoginID := signalid.MakeUserLoginID(qr.ProvData.ACI) + + select { + case resp := <-qr.ProvChan: + if resp.Err != nil { + return nil, resp.Err + } else if resp.State != signalmeow.StateProvisioningPreKeysRegistered { + return nil, fmt.Errorf("unexpected state %v", resp.State) + } + case <-ctx.Done(): + return nil, ctx.Err() + } + ul, err := qr.User.NewLogin(ctx, &database.UserLogin{ - ID: signalid.MakeUserLoginID(provData.ACI), - RemoteName: provData.Number, + ID: newLoginID, + RemoteName: qr.ProvData.Number, RemoteProfile: status.RemoteProfile{ - Phone: provData.Number, + Phone: qr.ProvData.Number, }, Metadata: &signalid.UserLoginMetadata{}, }, &bridgev2.NewLoginParams{ @@ -159,7 +190,7 @@ func (qr *QRLogin) loginComplete(ctx context.Context, provData *store.DeviceData return &bridgev2.LoginStep{ Type: bridgev2.LoginStepTypeComplete, StepID: LoginStepComplete, - Instructions: fmt.Sprintf("Successfully logged in as %s / %s", provData.Number, provData.ACI), + Instructions: fmt.Sprintf("Successfully logged in as %s / %s", qr.ProvData.Number, qr.ProvData.ACI), CompleteParams: &bridgev2.LoginCompleteParams{ UserLoginID: ul.ID, UserLogin: ul, diff --git a/pkg/libsignalgo/buffer.go b/pkg/libsignalgo/buffer.go index 5518656..e6aafdd 100644 --- a/pkg/libsignalgo/buffer.go +++ b/pkg/libsignalgo/buffer.go @@ -21,8 +21,6 @@ package libsignalgo */ import "C" import ( - "fmt" - "runtime" "unsafe" ) @@ -44,22 +42,6 @@ func BytesToBuffer(data []byte) C.SignalBorrowedBuffer { return buf } -func ManyBytesToBuffer[T ~[]byte](datas []T) (C.SignalBorrowedSliceOfBuffers, func()) { - buffers := make([]C.SignalBorrowedBuffer, len(datas)) - var pinner runtime.Pinner - for i, data := range datas { - if len(data) == 0 { - panic(fmt.Errorf("empty slice passed to ManyBytesToBuffer at index %d", i)) - } - pinner.Pin(&data[0]) - buffers[i] = BytesToBuffer(data) - } - return C.SignalBorrowedSliceOfBuffers{ - base: unsafe.SliceData(buffers), - length: C.size_t(len(buffers)), - }, pinner.Unpin -} - func EmptyBorrowedBuffer() C.SignalBorrowedBuffer { return C.SignalBorrowedBuffer{} } diff --git a/pkg/libsignalgo/cflags.go b/pkg/libsignalgo/cflags.go index e1bb7d5..12c1e0c 100644 --- a/pkg/libsignalgo/cflags.go +++ b/pkg/libsignalgo/cflags.go @@ -1,6 +1,6 @@ package libsignalgo /* -#cgo LDFLAGS: -lsignal_ffi -ldl -lm -lz -lstdc++ +#cgo LDFLAGS: -lsignal_ffi -ldl -lm -lz */ import "C" diff --git a/pkg/libsignalgo/conversions.go b/pkg/libsignalgo/conversions.go index 1963687..d17fa28 100644 --- a/pkg/libsignalgo/conversions.go +++ b/pkg/libsignalgo/conversions.go @@ -39,17 +39,3 @@ func CopySignalOwnedBufferToBytes(buffer C.SignalOwnedBuffer) (b []byte) { C.signal_free_buffer(buffer.base, buffer.length) return } - -func CopySignalBytestringArray[T ~[]byte](buffer C.SignalBytestringArray) (b []T) { - concatted := C.GoBytes(unsafe.Pointer(buffer.bytes.base), C.int(buffer.bytes.length)) - b = make([]T, int(buffer.lengths.length)) - sizeTSize := unsafe.Sizeof(C.size_t(0)) - offset := 0 - for i := 0; i < int(buffer.lengths.length); i++ { - length := int(*(*C.size_t)(unsafe.Add(unsafe.Pointer(buffer.lengths.base), uintptr(i)*sizeTSize))) - b[i] = concatted[offset : offset+length] - offset += length - } - C.signal_free_bytestring_array(buffer) - return -} diff --git a/pkg/libsignalgo/decryptionerrormessage.go b/pkg/libsignalgo/decryptionerrormessage.go index 434d40f..105fffc 100644 --- a/pkg/libsignalgo/decryptionerrormessage.go +++ b/pkg/libsignalgo/decryptionerrormessage.go @@ -23,6 +23,7 @@ package libsignalgo import "C" import ( "runtime" + "time" ) type DecryptionErrorMessage struct { @@ -48,7 +49,7 @@ func DeserializeDecryptionErrorMessage(messageBytes []byte) (*DecryptionErrorMes return wrapDecryptionErrorMessage(dem.raw), nil } -func DecryptionErrorMessageForOriginalMessage(originalBytes []byte, originalType CiphertextMessageType, originalTs uint64, originalSenderDeviceID uint) (*DecryptionErrorMessage, error) { +func DecryptionErrorMessageForOriginalMessage(originalBytes []byte, originalType uint8, originalTs uint64, originalSenderDeviceID uint) (*DecryptionErrorMessage, error) { var dem C.SignalMutPointerDecryptionErrorMessage signalFfiError := C.signal_decryption_error_message_for_original_message( &dem, @@ -111,14 +112,14 @@ func (dem *DecryptionErrorMessage) Serialize() ([]byte, error) { return CopySignalOwnedBufferToBytes(serialized), nil } -func (dem *DecryptionErrorMessage) GetTimestamp() (uint64, error) { +func (dem *DecryptionErrorMessage) GetTimestamp() (time.Time, error) { var ts C.uint64_t signalFfiError := C.signal_decryption_error_message_get_timestamp(&ts, dem.constPtr()) runtime.KeepAlive(dem) if signalFfiError != nil { - return 0, wrapError(signalFfiError) + return time.Time{}, wrapError(signalFfiError) } - return uint64(ts), nil + return time.UnixMilli(int64(ts)), nil } func (dem *DecryptionErrorMessage) GetDeviceID() (uint32, error) { diff --git a/pkg/libsignalgo/error.go b/pkg/libsignalgo/error.go index 888f8ea..b0d79c8 100644 --- a/pkg/libsignalgo/error.go +++ b/pkg/libsignalgo/error.go @@ -26,91 +26,34 @@ import ( type ErrorCode int -func (e ErrorCode) Error() string { - return fmt.Sprintf("libsignalgo.ErrorCode(%d)", int(e)) -} - const ( - ErrorCodeUnknownError ErrorCode = 1 - ErrorCodeInvalidState ErrorCode = 2 - ErrorCodeInternalError ErrorCode = 3 - ErrorCodeNullParameter ErrorCode = 4 - ErrorCodeInvalidArgument ErrorCode = 5 - ErrorCodeInvalidType ErrorCode = 6 - ErrorCodeInvalidUtf8String ErrorCode = 7 - ErrorCodeCancelled ErrorCode = 8 - ErrorCodeProtobufError ErrorCode = 10 - ErrorCodeLegacyCiphertextVersion ErrorCode = 21 - ErrorCodeUnknownCiphertextVersion ErrorCode = 22 - ErrorCodeUnrecognizedMessageVersion ErrorCode = 23 - ErrorCodeInvalidMessage ErrorCode = 30 - ErrorCodeSealedSenderSelfSend ErrorCode = 31 - ErrorCodeInvalidKey ErrorCode = 40 - ErrorCodeInvalidSignature ErrorCode = 41 - ErrorCodeInvalidAttestationData ErrorCode = 42 - ErrorCodeFingerprintVersionMismatch ErrorCode = 51 - ErrorCodeFingerprintParsingError ErrorCode = 52 - ErrorCodeUntrustedIdentity ErrorCode = 60 - ErrorCodeInvalidKeyIdentifier ErrorCode = 70 - ErrorCodeSessionNotFound ErrorCode = 80 - ErrorCodeInvalidRegistrationId ErrorCode = 81 - ErrorCodeInvalidSession ErrorCode = 82 - ErrorCodeInvalidSenderKeySession ErrorCode = 83 - ErrorCodeInvalidProtocolAddress ErrorCode = 84 - ErrorCodeDuplicatedMessage ErrorCode = 90 - ErrorCodeCallbackError ErrorCode = 100 - ErrorCodeVerificationFailure ErrorCode = 110 - ErrorCodeUsernameCannotBeEmpty ErrorCode = 120 - ErrorCodeUsernameCannotStartWithDigit ErrorCode = 121 - ErrorCodeUsernameMissingSeparator ErrorCode = 122 - ErrorCodeUsernameBadDiscriminatorCharacter ErrorCode = 123 - ErrorCodeUsernameBadNicknameCharacter ErrorCode = 124 - ErrorCodeUsernameTooShort ErrorCode = 125 - ErrorCodeUsernameTooLong ErrorCode = 126 - ErrorCodeUsernameLinkInvalidEntropyDataLength ErrorCode = 127 - ErrorCodeUsernameLinkInvalid ErrorCode = 128 - ErrorCodeUsernameDiscriminatorCannotBeEmpty ErrorCode = 130 - ErrorCodeUsernameDiscriminatorCannotBeZero ErrorCode = 131 - ErrorCodeUsernameDiscriminatorCannotBeSingleDigit ErrorCode = 132 - ErrorCodeUsernameDiscriminatorCannotHaveLeadingZeros ErrorCode = 133 - ErrorCodeUsernameDiscriminatorTooLarge ErrorCode = 134 - ErrorCodeIoError ErrorCode = 140 - ErrorCodeInvalidMediaInput ErrorCode = 141 - ErrorCodeUnsupportedMediaInput ErrorCode = 142 - ErrorCodeConnectionTimedOut ErrorCode = 143 - ErrorCodeNetworkProtocol ErrorCode = 144 - ErrorCodeRateLimited ErrorCode = 145 - ErrorCodeWebSocket ErrorCode = 146 - ErrorCodeCdsiInvalidToken ErrorCode = 147 - ErrorCodeConnectionFailed ErrorCode = 148 - ErrorCodeChatServiceInactive ErrorCode = 149 - ErrorCodeRequestTimedOut ErrorCode = 150 - ErrorCodeRateLimitChallenge ErrorCode = 151 - ErrorCodePossibleCaptiveNetwork ErrorCode = 152 - ErrorCodeSvrDataMissing ErrorCode = 160 - ErrorCodeSvrRestoreFailed ErrorCode = 161 - ErrorCodeSvrRotationMachineTooManySteps ErrorCode = 162 - ErrorCodeSvrRequestFailed ErrorCode = 163 - ErrorCodeAppExpired ErrorCode = 170 - ErrorCodeDeviceDeregistered ErrorCode = 171 - ErrorCodeConnectionInvalidated ErrorCode = 172 - ErrorCodeConnectedElsewhere ErrorCode = 173 - ErrorCodeBackupValidation ErrorCode = 180 - ErrorCodeRegistrationInvalidSessionId ErrorCode = 190 - ErrorCodeRegistrationUnknown ErrorCode = 192 - ErrorCodeRegistrationSessionNotFound ErrorCode = 193 - ErrorCodeRegistrationNotReadyForVerification ErrorCode = 194 - ErrorCodeRegistrationSendVerificationCodeFailed ErrorCode = 195 - ErrorCodeRegistrationCodeNotDeliverable ErrorCode = 196 - ErrorCodeRegistrationSessionUpdateRejected ErrorCode = 197 - ErrorCodeRegistrationCredentialsCouldNotBeParsed ErrorCode = 198 - ErrorCodeRegistrationDeviceTransferPossible ErrorCode = 199 - ErrorCodeRegistrationRecoveryVerificationFailed ErrorCode = 200 - ErrorCodeRegistrationLock ErrorCode = 201 - ErrorCodeKeyTransparencyError ErrorCode = 210 - ErrorCodeKeyTransparencyVerificationFailed ErrorCode = 211 - ErrorCodeRequestUnauthorized ErrorCode = 220 - ErrorCodeMismatchedDevices ErrorCode = 221 + ErrorCodeUnknownError ErrorCode = 1 + ErrorCodeInvalidState ErrorCode = 2 + ErrorCodeInternalError ErrorCode = 3 + ErrorCodeNullParameter ErrorCode = 4 + ErrorCodeInvalidArgument ErrorCode = 5 + ErrorCodeInvalidType ErrorCode = 6 + ErrorCodeInvalidUtf8String ErrorCode = 7 + ErrorCodeProtobufError ErrorCode = 10 + ErrorCodeLegacyCiphertextVersion ErrorCode = 21 + ErrorCodeUnknownCiphertextVersion ErrorCode = 22 + ErrorCodeUnrecognizedMessageVersion ErrorCode = 23 + ErrorCodeInvalidMessage ErrorCode = 30 + ErrorCodeSealedSenderSelfSend ErrorCode = 31 + ErrorCodeInvalidKey ErrorCode = 40 + ErrorCodeInvalidSignature ErrorCode = 41 + ErrorCodeInvalidAttestationData ErrorCode = 42 + ErrorCodeFingerprintVersionMismatch ErrorCode = 51 + ErrorCodeFingerprintParsingError ErrorCode = 52 + ErrorCodeUntrustedIdentity ErrorCode = 60 + ErrorCodeInvalidKeyIdentifier ErrorCode = 70 + ErrorCodeSessionNotFound ErrorCode = 80 + ErrorCodeInvalidRegistrationId ErrorCode = 81 + ErrorCodeInvalidSession ErrorCode = 82 + ErrorCodeInvalidSenderKeySession ErrorCode = 83 + ErrorCodeDuplicatedMessage ErrorCode = 90 + ErrorCodeCallbackError ErrorCode = 100 + ErrorCodeVerificationFailure ErrorCode = 110 ) type SignalError struct { @@ -122,10 +65,6 @@ func (e *SignalError) Error() string { return fmt.Sprintf("%d: %s", e.Code, e.Message) } -func (e *SignalError) Unwrap() error { - return e.Code -} - func (ctx *CallbackContext) wrapError(signalError *C.SignalFfiError) error { if signalError == nil { return nil diff --git a/pkg/libsignalgo/groupcipher.go b/pkg/libsignalgo/groupcipher.go index 9ec5997..7b58207 100644 --- a/pkg/libsignalgo/groupcipher.go +++ b/pkg/libsignalgo/groupcipher.go @@ -36,7 +36,7 @@ func GroupEncrypt(ctx context.Context, ptext []byte, sender *Address, distributi signalFfiError := C.signal_group_encrypt_message( &ciphertextMessage, sender.constPtr(), - *(*C.SignalUuid)(unsafe.Pointer(&distributionID)), + (*[C.SignalUUID_LEN]C.uchar)(unsafe.Pointer(&distributionID)), BytesToBuffer(ptext), callbackCtx.wrapSenderKeyStore(store)) runtime.KeepAlive(ptext) diff --git a/pkg/libsignalgo/groupsecretparams.go b/pkg/libsignalgo/groupsecretparams.go index a6b370c..5ad11fd 100644 --- a/pkg/libsignalgo/groupsecretparams.go +++ b/pkg/libsignalgo/groupsecretparams.go @@ -76,10 +76,6 @@ func (gmk GroupMasterKey) GroupIdentifier() (*GroupIdentifier, error) { } } -func (gmk GroupMasterKey) SecretParams() (GroupSecretParams, error) { - return DeriveGroupSecretParamsFromMasterKey(gmk) -} - func GenerateGroupSecretParamsWithRandomness(randomness Randomness) (GroupSecretParams, error) { var params [C.SignalGROUP_SECRET_PARAMS_LEN]C.uchar signalFfiError := C.signal_group_secret_params_generate_deterministic(¶ms, (*[C.SignalRANDOMNESS_LEN]C.uint8_t)(unsafe.Pointer(&randomness))) diff --git a/pkg/libsignalgo/groupsendendorsement.go b/pkg/libsignalgo/groupsendendorsement.go deleted file mode 100644 index 73f175e..0000000 --- a/pkg/libsignalgo/groupsendendorsement.go +++ /dev/null @@ -1,215 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2025 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package libsignalgo - -/* -#include "./libsignal-ffi.h" -*/ -import "C" -import ( - "encoding/base64" - "runtime" - "time" - "unsafe" -) - -type GroupSendFullToken []byte - -func (gsft GroupSendFullToken) String() string { - return base64.StdEncoding.EncodeToString(gsft) -} - -func (gsft GroupSendFullToken) CheckValidContents() error { - signalFfiError := C.signal_group_send_full_token_check_valid_contents( - BytesToBuffer(gsft), - ) - runtime.KeepAlive(gsft) - if signalFfiError != nil { - return wrapError(signalFfiError) - } - return nil -} - -func (gsft GroupSendFullToken) GetExpiration() (time.Time, error) { - var expiration C.uint64_t - signalFfiError := C.signal_group_send_full_token_get_expiration( - &expiration, - BytesToBuffer(gsft), - ) - runtime.KeepAlive(gsft) - if signalFfiError != nil { - return time.Time{}, wrapError(signalFfiError) - } - return time.Unix(int64(expiration), 0), nil -} - -type GroupSendToken []byte - -func (gst GroupSendToken) CheckValidContents() error { - signalFfiError := C.signal_group_send_token_check_valid_contents( - BytesToBuffer(gst), - ) - runtime.KeepAlive(gst) - if signalFfiError != nil { - return wrapError(signalFfiError) - } - return nil -} - -func (gst GroupSendToken) ToFullToken(expiration time.Time) (GroupSendFullToken, error) { - var fullToken C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_group_send_token_to_full_token( - &fullToken, - BytesToBuffer(gst), - C.uint64_t(expiration.Unix()), - ) - runtime.KeepAlive(gst) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return CopySignalOwnedBufferToBytes(fullToken), nil -} - -type GroupSendEndorsement []byte - -func (gse GroupSendEndorsement) ToToken(groupSecretParams *GroupSecretParams) (GroupSendToken, error) { - var token C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_group_send_endorsement_to_token( - &token, - BytesToBuffer(gse), - (*[C.SignalGROUP_SECRET_PARAMS_LEN]C.uint8_t)(unsafe.Pointer(groupSecretParams)), - ) - runtime.KeepAlive(gse) - runtime.KeepAlive(groupSecretParams) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return CopySignalOwnedBufferToBytes(token), nil -} - -func (gse GroupSendEndorsement) ToFullToken(params *GroupSecretParams, expiration time.Time) (GroupSendFullToken, error) { - token, err := gse.ToToken(params) - if err != nil { - return nil, err - } - return token.ToFullToken(expiration) -} - -func (gse GroupSendEndorsement) CheckValidContents() error { - signalFfiError := C.signal_group_send_endorsement_check_valid_contents( - BytesToBuffer(gse), - ) - runtime.KeepAlive(gse) - if signalFfiError != nil { - return wrapError(signalFfiError) - } - return nil -} - -func (gse GroupSendEndorsement) Remove(other GroupSendEndorsement) (GroupSendEndorsement, error) { - var result C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_group_send_endorsement_remove( - &result, - BytesToBuffer(gse), - BytesToBuffer(other), - ) - runtime.KeepAlive(gse) - runtime.KeepAlive(other) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return CopySignalOwnedBufferToBytes(result), nil -} - -func GroupSendEndorsementCombine(endorsements ...GroupSendEndorsement) (GroupSendEndorsement, error) { - var result C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - cEndorsements, unpin := ManyBytesToBuffer(endorsements) - defer unpin() - signalFfiError := C.signal_group_send_endorsement_combine( - &result, - cEndorsements, - ) - runtime.KeepAlive(endorsements) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return CopySignalOwnedBufferToBytes(result), nil -} - -type GroupSendEndorsementsResponse []byte - -func (gser GroupSendEndorsementsResponse) GetExpiration() (time.Time, error) { - var expiration C.uint64_t - signalFfiError := C.signal_group_send_endorsements_response_get_expiration( - &expiration, - BytesToBuffer(gser), - ) - runtime.KeepAlive(gser) - if signalFfiError != nil { - return time.Time{}, wrapError(signalFfiError) - } - return time.Unix(int64(expiration), 0), nil -} - -func (gser GroupSendEndorsementsResponse) CheckValidContents() error { - signalFfiError := C.signal_group_send_endorsements_response_check_valid_contents( - BytesToBuffer(gser), - ) - runtime.KeepAlive(gser) - if signalFfiError != nil { - return wrapError(signalFfiError) - } - return nil -} - -func (gser GroupSendEndorsementsResponse) ReceiveWithServiceIDs( - groupMembers []ServiceID, localUser ServiceID, params *GroupSecretParams, spp *ServerPublicParams, -) (GroupSendEndorsement, map[ServiceID]GroupSendEndorsement, error) { - var out C.SignalBytestringArray = C.SignalBytestringArray{} - concatenatedMembers := make([]byte, len(groupMembers)*17) - for i, member := range groupMembers { - copy(concatenatedMembers[i*17:(i+1)*17], member.FixedBytes()[:]) - } - signalFfiError := C.signal_group_send_endorsements_response_receive_and_combine_with_service_ids( - &out, - BytesToBuffer(gser), - BytesToBuffer(concatenatedMembers), - localUser.CFixedBytes(), - C.uint64_t(time.Now().Unix()), - (*[C.SignalGROUP_SECRET_PARAMS_LEN]C.uint8_t)(unsafe.Pointer(params)), - C.SignalConstPointerServerPublicParams{spp}, - ) - runtime.KeepAlive(gser) - runtime.KeepAlive(concatenatedMembers) - runtime.KeepAlive(params) - runtime.KeepAlive(spp) - if signalFfiError != nil { - return nil, nil, wrapError(signalFfiError) - } - endorsements := CopySignalBytestringArray[GroupSendEndorsement](out) - memberEndorsements := make(map[ServiceID]GroupSendEndorsement, len(groupMembers)) - for i, member := range groupMembers { - if len(endorsements) > i && len(endorsements[i]) > 0 { - memberEndorsements[member] = endorsements[i] - } - } - combined, err := GroupSendEndorsementCombine(endorsements...) - if err != nil { - return nil, memberEndorsements, err - } - return combined, memberEndorsements, nil -} diff --git a/pkg/libsignalgo/identitykey.go b/pkg/libsignalgo/identitykey.go index 0226e11..f35d116 100644 --- a/pkg/libsignalgo/identitykey.go +++ b/pkg/libsignalgo/identitykey.go @@ -84,7 +84,8 @@ func (i *IdentityKey) VerifyAlternateIdentity(other *IdentityKey, signature []by } func (i *IdentityKey) Equal(other *IdentityKey) (bool, error) { - return i.publicKey.Equal(other.publicKey) + result, err := i.publicKey.Compare(other.publicKey) + return result == 0, err } type IdentityKeyPair struct { diff --git a/pkg/libsignalgo/identitykeystore.go b/pkg/libsignalgo/identitykeystore.go index ba26f06..c59b660 100644 --- a/pkg/libsignalgo/identitykeystore.go +++ b/pkg/libsignalgo/identitykeystore.go @@ -20,12 +20,14 @@ package libsignalgo /* #include "./libsignal-ffi.h" -extern int signal_get_identity_key_pair_callback(void *store_ctx, SignalPairOfMutPointerPrivateKeyMutPointerPublicKey *keyp); +typedef const SignalProtocolAddress const_address; +typedef const SignalPublicKey const_public_key; + +extern int signal_get_identity_key_pair_callback(void *store_ctx, SignalPrivateKey **keyp); extern int signal_get_local_registration_id_callback(void *store_ctx, uint32_t *idp); -extern int signal_save_identity_key_callback(void *store_ctx, uint8_t *out, SignalMutPointerProtocolAddress address, SignalMutPointerPublicKey public_key); -extern int signal_get_identity_key_callback(void *store_ctx, SignalMutPointerPublicKey *public_keyp, SignalMutPointerProtocolAddress address); -extern int signal_is_trusted_identity_callback(void *store_ctx, bool *out, SignalMutPointerProtocolAddress address, SignalMutPointerPublicKey public_key, uint32_t direction); -extern void signal_destroy_identity_key_store_callback(void *store_ctx); +extern int signal_save_identity_key_callback(void *store_ctx, const_address *address, const_public_key *public_key); +extern int signal_get_identity_key_callback(void *store_ctx, SignalPublicKey **public_keyp, const_address *address); +extern int signal_is_trusted_identity_callback(void *store_ctx, const_address *address, const_public_key *public_key, unsigned int direction); */ import "C" import ( @@ -49,29 +51,22 @@ type IdentityKeyStore interface { } //export signal_get_identity_key_pair_callback -func signal_get_identity_key_pair_callback(storeCtx unsafe.Pointer, keyp *C.SignalPairOfMutPointerPrivateKeyMutPointerPublicKey) C.int { +func signal_get_identity_key_pair_callback(storeCtx unsafe.Pointer, keyp **C.SignalPrivateKey) C.int { return wrapStoreCallback(storeCtx, func(store IdentityKeyStore, ctx context.Context) error { key, err := store.GetIdentityKeyPair(ctx) if err != nil { return err } if key == nil { - keyp.first.raw = nil - keyp.second.raw = nil - return nil + *keyp = nil + } else { + clone, err := key.privateKey.Clone() + if err != nil { + return err + } + clone.CancelFinalizer() + *keyp = clone.ptr } - privClone, err := key.privateKey.Clone() - if err != nil { - return err - } - pubClone, err := key.publicKey.Clone() - if err != nil { - return err - } - privClone.CancelFinalizer() - pubClone.CancelFinalizer() - keyp.first.raw = privClone.ptr - keyp.second.raw = pubClone.ptr return err }) } @@ -88,17 +83,17 @@ func signal_get_local_registration_id_callback(storeCtx unsafe.Pointer, idp *C.u } //export signal_save_identity_key_callback -func signal_save_identity_key_callback(storeCtx unsafe.Pointer, out *C.uint8_t, address C.SignalMutPointerProtocolAddress, publicKey C.SignalMutPointerPublicKey) C.int { - return wrapStoreCallback(storeCtx, func(store IdentityKeyStore, ctx context.Context) error { - publicKeyStruct := PublicKey{ptr: publicKey.raw} +func signal_save_identity_key_callback(storeCtx unsafe.Pointer, address *C.const_address, publicKey *C.const_public_key) C.int { + return wrapStoreCallbackCustomReturn(storeCtx, func(store IdentityKeyStore, ctx context.Context) (int, error) { + publicKeyStruct := PublicKey{ptr: (*C.SignalPublicKey)(unsafe.Pointer(publicKey))} cloned, err := publicKeyStruct.Clone() if err != nil { - return err + return -1, err } - addr := &Address{ptr: address.raw} + addr := &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))} theirServiceID, err := addr.NameServiceID() if err != nil { - return err + return -1, err } replaced, err := store.SaveIdentityKey( ctx, @@ -106,21 +101,20 @@ func signal_save_identity_key_callback(storeCtx unsafe.Pointer, out *C.uint8_t, &IdentityKey{cloned}, ) if err != nil { - return err + return -1, err } if replaced { - *out = 1 + return 1, nil } else { - *out = 0 + return 0, nil } - return nil }) } //export signal_get_identity_key_callback -func signal_get_identity_key_callback(storeCtx unsafe.Pointer, public_keyp *C.SignalMutPointerPublicKey, address C.SignalMutPointerProtocolAddress) C.int { +func signal_get_identity_key_callback(storeCtx unsafe.Pointer, public_keyp **C.SignalPublicKey, address *C.const_address) C.int { return wrapStoreCallback(storeCtx, func(store IdentityKeyStore, ctx context.Context) error { - addr := &Address{ptr: address.raw} + addr := &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))} theirServiceID, err := addr.NameServiceID() if err != nil { return err @@ -128,42 +122,39 @@ func signal_get_identity_key_callback(storeCtx unsafe.Pointer, public_keyp *C.Si key, err := store.GetIdentityKey(ctx, theirServiceID) if err == nil && key != nil { key.publicKey.CancelFinalizer() - public_keyp.raw = key.publicKey.ptr + *public_keyp = key.publicKey.ptr } return err }) } //export signal_is_trusted_identity_callback -func signal_is_trusted_identity_callback(storeCtx unsafe.Pointer, out *C.bool, address C.SignalMutPointerProtocolAddress, public_key C.SignalMutPointerPublicKey, direction C.uint32_t) C.int { - return wrapStoreCallback(storeCtx, func(store IdentityKeyStore, ctx context.Context) error { - addr := &Address{ptr: address.raw} +func signal_is_trusted_identity_callback(storeCtx unsafe.Pointer, address *C.const_address, public_key *C.const_public_key, direction C.uint) C.int { + return wrapStoreCallbackCustomReturn(storeCtx, func(store IdentityKeyStore, ctx context.Context) (int, error) { + addr := &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))} theirServiceID, err := addr.NameServiceID() if err != nil { - return err + return -1, err } - trusted, err := store.IsTrustedIdentity(ctx, theirServiceID, &IdentityKey{&PublicKey{ptr: public_key.raw}}, SignalDirection(direction)) + trusted, err := store.IsTrustedIdentity(ctx, theirServiceID, &IdentityKey{&PublicKey{ptr: (*C.SignalPublicKey)(unsafe.Pointer(public_key))}}, SignalDirection(direction)) if err != nil { - return err + return -1, err + } + if trusted { + return 1, nil + } else { + return 0, nil } - *out = C.bool(trusted) - return nil }) } -//export signal_destroy_identity_key_store_callback -func signal_destroy_identity_key_store_callback(storeCtx unsafe.Pointer) { - // No-op: Go's garbage collector handles cleanup -} - func (ctx *CallbackContext) wrapIdentityKeyStore(store IdentityKeyStore) C.SignalConstPointerFfiIdentityKeyStoreStruct { return C.SignalConstPointerFfiIdentityKeyStoreStruct{&C.SignalIdentityKeyStore{ - ctx: wrapStore(ctx, store), - get_local_identity_key_pair: C.SignalFfiIdentityKeyStoreGetLocalIdentityKeyPair(C.signal_get_identity_key_pair_callback), - get_local_registration_id: C.SignalFfiIdentityKeyStoreGetLocalRegistrationId(C.signal_get_local_registration_id_callback), - get_identity_key: C.SignalFfiIdentityKeyStoreGetIdentityKey(C.signal_get_identity_key_callback), - save_identity_key: C.SignalFfiIdentityKeyStoreSaveIdentityKey(C.signal_save_identity_key_callback), - is_trusted_identity: C.SignalFfiIdentityKeyStoreIsTrustedIdentity(C.signal_is_trusted_identity_callback), - destroy: C.SignalFfiIdentityKeyStoreDestroy(C.signal_destroy_identity_key_store_callback), + ctx: wrapStore(ctx, store), + get_identity_key_pair: C.SignalGetIdentityKeyPair(C.signal_get_identity_key_pair_callback), + get_local_registration_id: C.SignalGetLocalRegistrationId(C.signal_get_local_registration_id_callback), + save_identity: C.SignalSaveIdentityKey(C.signal_save_identity_key_callback), + get_identity: C.SignalGetIdentityKey(C.signal_get_identity_key_callback), + is_trusted_identity: C.SignalIsTrustedIdentity(C.signal_is_trusted_identity_callback), }} } diff --git a/pkg/libsignalgo/kyberprekeystore.go b/pkg/libsignalgo/kyberprekeystore.go index 9deea17..072db99 100644 --- a/pkg/libsignalgo/kyberprekeystore.go +++ b/pkg/libsignalgo/kyberprekeystore.go @@ -20,10 +20,11 @@ package libsignalgo /* #include "./libsignal-ffi.h" -extern int signal_load_kyber_pre_key_callback(void *store_ctx, SignalMutPointerKyberPreKeyRecord *recordp, uint32_t id); -extern int signal_store_kyber_pre_key_callback(void *store_ctx, uint32_t id, SignalMutPointerKyberPreKeyRecord record); -extern int signal_mark_kyber_pre_key_used_callback(void *store_ctx, uint32_t id, uint32_t ec_prekey_id, SignalMutPointerPublicKey base_key); -extern void signal_destroy_kyber_pre_key_store_callback(void *store_ctx); +typedef const SignalKyberPreKeyRecord const_kyber_pre_key_record; + +extern int signal_load_kyber_pre_key_callback(void *store_ctx, SignalKyberPreKeyRecord **recordp, uint32_t id); +extern int signal_store_kyber_pre_key_callback(void *store_ctx, uint32_t id, const_kyber_pre_key_record *record); +extern int signal_mark_kyber_pre_key_used_callback(void *store_ctx, uint32_t id); */ import "C" import ( @@ -38,21 +39,21 @@ type KyberPreKeyStore interface { } //export signal_load_kyber_pre_key_callback -func signal_load_kyber_pre_key_callback(storeCtx unsafe.Pointer, keyp *C.SignalMutPointerKyberPreKeyRecord, id C.uint32_t) C.int { +func signal_load_kyber_pre_key_callback(storeCtx unsafe.Pointer, keyp **C.SignalKyberPreKeyRecord, id C.uint32_t) C.int { return wrapStoreCallback(storeCtx, func(store KyberPreKeyStore, ctx context.Context) error { key, err := store.LoadKyberPreKey(ctx, uint32(id)) if err == nil && key != nil { key.CancelFinalizer() - keyp.raw = key.ptr + *keyp = key.ptr } return err }) } //export signal_store_kyber_pre_key_callback -func signal_store_kyber_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t, preKeyRecord C.SignalMutPointerKyberPreKeyRecord) C.int { +func signal_store_kyber_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t, preKeyRecord *C.const_kyber_pre_key_record) C.int { return wrapStoreCallback(storeCtx, func(store KyberPreKeyStore, ctx context.Context) error { - record := KyberPreKeyRecord{ptr: preKeyRecord.raw} + record := KyberPreKeyRecord{ptr: (*C.SignalKyberPreKeyRecord)(unsafe.Pointer(preKeyRecord))} cloned, err := record.Clone() if err != nil { return err @@ -62,24 +63,18 @@ func signal_store_kyber_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t, } //export signal_mark_kyber_pre_key_used_callback -func signal_mark_kyber_pre_key_used_callback(storeCtx unsafe.Pointer, id C.uint32_t, ecPrekeyID C.uint32_t, baseKey C.SignalMutPointerPublicKey) C.int { +func signal_mark_kyber_pre_key_used_callback(storeCtx unsafe.Pointer, id C.uint32_t) C.int { return wrapStoreCallback(storeCtx, func(store KyberPreKeyStore, ctx context.Context) error { - // TODO use ecPrekeyID and baseKey? - return store.MarkKyberPreKeyUsed(ctx, uint32(id)) + err := store.MarkKyberPreKeyUsed(ctx, uint32(id)) + return err }) } -//export signal_destroy_kyber_pre_key_store_callback -func signal_destroy_kyber_pre_key_store_callback(storeCtx unsafe.Pointer) { - // No-op: Go's garbage collector handles cleanup -} - func (ctx *CallbackContext) wrapKyberPreKeyStore(store KyberPreKeyStore) C.SignalConstPointerFfiKyberPreKeyStoreStruct { return C.SignalConstPointerFfiKyberPreKeyStoreStruct{&C.SignalKyberPreKeyStore{ ctx: wrapStore(ctx, store), - load_kyber_pre_key: C.SignalFfiKyberPreKeyStoreLoadKyberPreKey(C.signal_load_kyber_pre_key_callback), - store_kyber_pre_key: C.SignalFfiKyberPreKeyStoreStoreKyberPreKey(C.signal_store_kyber_pre_key_callback), - mark_kyber_pre_key_used: C.SignalFfiKyberPreKeyStoreMarkKyberPreKeyUsed(C.signal_mark_kyber_pre_key_used_callback), - destroy: C.SignalFfiKyberPreKeyStoreDestroy(C.signal_destroy_kyber_pre_key_store_callback), + load_kyber_pre_key: C.SignalLoadKyberPreKey(C.signal_load_kyber_pre_key_callback), + store_kyber_pre_key: C.SignalStoreKyberPreKey(C.signal_store_kyber_pre_key_callback), + mark_kyber_pre_key_used: C.SignalMarkKyberPreKeyUsed(C.signal_mark_kyber_pre_key_used_callback), }} } diff --git a/pkg/libsignalgo/libsignal b/pkg/libsignalgo/libsignal index bbc1688..c02859f 160000 --- a/pkg/libsignalgo/libsignal +++ b/pkg/libsignalgo/libsignal @@ -1 +1 @@ -Subproject commit bbc16886cae2feab1cd1fe271ccc651e8860ce96 +Subproject commit c02859f57552477680fb7928c3c3426193040313 diff --git a/pkg/libsignalgo/libsignal-ffi.h b/pkg/libsignalgo/libsignal-ffi.h index b75462a..a516a23 100644 --- a/pkg/libsignalgo/libsignal-ffi.h +++ b/pkg/libsignalgo/libsignal-ffi.h @@ -29,8 +29,6 @@ SPDX-License-Identifier: AGPL-3.0-only #define SignalBackupId_LEN 16 -#define SignalCallLinkSecretParams_ROOT_KEY_MAX_BYTES_FOR_SHO 16 - #define SignalNUM_AUTH_CRED_ATTRIBUTES 3 #define SignalNUM_PROFILE_KEY_CRED_ATTRIBUTES 4 @@ -235,7 +233,6 @@ typedef enum { SignalErrorCodeChatServiceInactive = 149, SignalErrorCodeRequestTimedOut = 150, SignalErrorCodeRateLimitChallenge = 151, - SignalErrorCodePossibleCaptiveNetwork = 152, SignalErrorCodeSvrDataMissing = 160, SignalErrorCodeSvrRestoreFailed = 161, SignalErrorCodeSvrRotationMachineTooManySteps = 162, @@ -258,10 +255,6 @@ typedef enum { SignalErrorCodeRegistrationLock = 201, SignalErrorCodeKeyTransparencyError = 210, SignalErrorCodeKeyTransparencyVerificationFailed = 211, - SignalErrorCodeRequestUnauthorized = 220, - SignalErrorCodeMismatchedDevices = 221, - SignalErrorCodeServiceIdNotFound = 222, - SignalErrorCodeUploadTooLarge = 223, } SignalErrorCode; enum SignalSvr2CredentialsResult { @@ -346,8 +339,6 @@ typedef struct SignalPrivateKey SignalPrivateKey; */ typedef struct SignalProtocolAddress SignalProtocolAddress; -typedef struct SignalProvisioningChatConnection SignalProvisioningChatConnection; - typedef struct SignalPublicKey SignalPublicKey; typedef struct SignalRegisterAccountRequest SignalRegisterAccountRequest; @@ -512,59 +503,15 @@ typedef struct { const SignalAuthenticatedChatConnection *raw; } SignalConstPointerAuthenticatedChatConnection; -/** - * A type alias to be used with [`OwnedBufferOf`], so that `OwnedBufferOf` and - * `OwnedBufferOf<*const c_char>` get distinct names. - */ -typedef const char *SignalCStringPtr; - -/** - * A representation of a array allocated on the Rust heap for use in C code. - */ -typedef struct { - SignalCStringPtr *base; - /** - * The number of elements in the buffer (not necessarily the number of bytes). - */ - size_t length; -} SignalOwnedBufferOfCStringPtr; - -typedef struct { - uint32_t cdn; - SignalCStringPtr key; - SignalOwnedBufferOfCStringPtr header_keys; - SignalOwnedBufferOfCStringPtr header_values; - SignalCStringPtr signed_upload_url; -} SignalFfiUploadForm; - -/** - * A C callback used to report the results of Rust futures. - * - * cbindgen will produce independent C types like `SignalCPromisei32` and - * `SignalCPromiseProtocolAddress`. - * - * This derives Copy because it behaves like a C type; nevertheless, a promise should still only be - * completed once. - */ -typedef struct { - void (*complete)(SignalFfiError *error, const SignalFfiUploadForm *result, const void *context); - const void *context; - SignalCancellationId cancellation_id; -} SignalCPromiseFfiUploadForm; - typedef SignalConnectionInfo SignalChatConnectionInfo; typedef struct { SignalChatConnectionInfo *raw; } SignalMutPointerChatConnectionInfo; -typedef struct { - SignalServerMessageAck *raw; -} SignalMutPointerServerMessageAck; +typedef void (*SignalReceivedIncomingMessage)(void *ctx, SignalOwnedBuffer envelope, uint64_t timestamp_millis, SignalServerMessageAck *cleanup); -typedef int (*SignalFfiChatListenerReceivedIncomingMessage)(void *ctx, SignalOwnedBuffer envelope, uint64_t timestamp, SignalMutPointerServerMessageAck ack); - -typedef int (*SignalFfiChatListenerReceivedQueueEmpty)(void *ctx); +typedef void (*SignalReceivedQueueEmpty)(void *ctx); /** * A representation of a array allocated on the Rust heap for use in C code. @@ -584,25 +531,57 @@ typedef struct { typedef SignalBytestringArray SignalStringArray; -typedef int (*SignalFfiChatListenerReceivedAlerts)(void *ctx, SignalStringArray alerts); +typedef void (*SignalReceivedAlerts)(void *ctx, SignalStringArray alerts); -typedef int (*SignalFfiChatListenerConnectionInterrupted)(void *ctx, SignalFfiError *disconnect_cause); +typedef void (*SignalConnectionInterrupted)(void *ctx, SignalFfiError *error); -typedef void (*SignalFfiChatListenerDestroy)(void *ctx); +typedef void (*SignalDestroyChatListener)(void *ctx); +/** + * Callbacks for [`ChatListener`]. + * + * Callbacks will be serialized (i.e. two calls will not come in at the same time), but may not + * always happen on the same thread. Calls should be responded to promptly to avoid blocking later + * messages. + * + * # Safety + * + * This type contains raw pointers. Code that constructs an instance of this type must ensure + * memory safety assuming that + * - the callback function pointer fields are called with `ctx` as an argument; + * - the `destroy` function pointer field is called with `ctx` as an argument; + * - no function pointer fields are called after `destroy` is called. + */ typedef struct { void *ctx; - SignalFfiChatListenerReceivedIncomingMessage received_incoming_message; - SignalFfiChatListenerReceivedQueueEmpty received_queue_empty; - SignalFfiChatListenerReceivedAlerts received_alerts; - SignalFfiChatListenerConnectionInterrupted connection_interrupted; - SignalFfiChatListenerDestroy destroy; + SignalReceivedIncomingMessage received_incoming_message; + SignalReceivedQueueEmpty received_queue_empty; + SignalReceivedAlerts received_alerts; + SignalConnectionInterrupted connection_interrupted; + SignalDestroyChatListener destroy; } SignalFfiChatListenerStruct; typedef struct { const SignalFfiChatListenerStruct *raw; } SignalConstPointerFfiChatListenerStruct; +/** + * A type alias to be used with [`OwnedBufferOf`], so that `OwnedBufferOf` and + * `OwnedBufferOf<*const c_char>` get distinct names. + */ +typedef const char *SignalCStringPtr; + +/** + * A representation of a array allocated on the Rust heap for use in C code. + */ +typedef struct { + SignalCStringPtr *base; + /** + * The number of elements in the buffer (not necessarily the number of bytes). + */ + size_t length; +} SignalOwnedBufferOfCStringPtr; + typedef struct { uint16_t status; const char *message; @@ -636,27 +615,6 @@ typedef struct { */ typedef uint8_t SignalServiceIdFixedWidthBinaryBytes[17]; -typedef struct { - const uint32_t *base; - size_t length; -} SignalBorrowedSliceOfu32; - -typedef struct { - const SignalCiphertextMessage *raw; -} SignalConstPointerCiphertextMessage; - -typedef struct { - const SignalConstPointerCiphertextMessage *base; - size_t length; -} SignalBorrowedSliceOfConstPointerCiphertextMessage; - -/** - * A wrapper type for raw UUIDs, because C treats arrays specially in argument position. - */ -typedef struct { - uint8_t bytes[16]; -} SignalUuid; - typedef struct { SignalPrivateKey *raw; } SignalMutPointerPrivateKey; @@ -768,6 +726,10 @@ typedef struct { const SignalPlaintextContent *raw; } SignalConstPointerPlaintextContent; +typedef struct { + const SignalCiphertextMessage *raw; +} SignalConstPointerCiphertextMessage; + typedef struct { SignalConnectionInfo *raw; } SignalMutPointerConnectionInfo; @@ -792,52 +754,49 @@ typedef struct { SignalSessionRecord *raw; } SignalMutPointerSessionRecord; -typedef int (*SignalFfiSessionStoreLoadSession)(void *ctx, SignalMutPointerSessionRecord *out, SignalMutPointerProtocolAddress address); +typedef int (*SignalLoadSession)(void *store_ctx, SignalMutPointerSessionRecord *recordp, SignalConstPointerProtocolAddress address); -typedef int (*SignalFfiSessionStoreStoreSession)(void *ctx, SignalMutPointerProtocolAddress address, SignalMutPointerSessionRecord record); +typedef struct { + const SignalSessionRecord *raw; +} SignalConstPointerSessionRecord; -typedef void (*SignalFfiSessionStoreDestroy)(void *ctx); +typedef int (*SignalStoreSession)(void *store_ctx, SignalConstPointerProtocolAddress address, SignalConstPointerSessionRecord record); typedef struct { void *ctx; - SignalFfiSessionStoreLoadSession load_session; - SignalFfiSessionStoreStoreSession store_session; - SignalFfiSessionStoreDestroy destroy; + SignalLoadSession load_session; + SignalStoreSession store_session; } SignalSessionStore; typedef struct { const SignalSessionStore *raw; } SignalConstPointerFfiSessionStoreStruct; +typedef int (*SignalGetIdentityKeyPair)(void *store_ctx, SignalMutPointerPrivateKey *keyp); + +typedef int (*SignalGetLocalRegistrationId)(void *store_ctx, uint32_t *idp); + +typedef struct { + const SignalPublicKey *raw; +} SignalConstPointerPublicKey; + +typedef int (*SignalSaveIdentityKey)(void *store_ctx, SignalConstPointerProtocolAddress address, SignalConstPointerPublicKey public_key); + typedef struct { SignalPublicKey *raw; } SignalMutPointerPublicKey; -typedef struct { - SignalMutPointerPrivateKey first; - SignalMutPointerPublicKey second; -} SignalPairOfMutPointerPrivateKeyMutPointerPublicKey; +typedef int (*SignalGetIdentityKey)(void *store_ctx, SignalMutPointerPublicKey *public_keyp, SignalConstPointerProtocolAddress address); -typedef int (*SignalFfiIdentityKeyStoreGetLocalIdentityKeyPair)(void *ctx, SignalPairOfMutPointerPrivateKeyMutPointerPublicKey *out); - -typedef int (*SignalFfiIdentityKeyStoreGetLocalRegistrationId)(void *ctx, uint32_t *out); - -typedef int (*SignalFfiIdentityKeyStoreGetIdentityKey)(void *ctx, SignalMutPointerPublicKey *out, SignalMutPointerProtocolAddress address); - -typedef int (*SignalFfiIdentityKeyStoreSaveIdentityKey)(void *ctx, uint8_t *out, SignalMutPointerProtocolAddress address, SignalMutPointerPublicKey public_key); - -typedef int (*SignalFfiIdentityKeyStoreIsTrustedIdentity)(void *ctx, bool *out, SignalMutPointerProtocolAddress address, SignalMutPointerPublicKey public_key, uint32_t direction); - -typedef void (*SignalFfiIdentityKeyStoreDestroy)(void *ctx); +typedef int (*SignalIsTrustedIdentity)(void *store_ctx, SignalConstPointerProtocolAddress address, SignalConstPointerPublicKey public_key, unsigned int direction); typedef struct { void *ctx; - SignalFfiIdentityKeyStoreGetLocalIdentityKeyPair get_local_identity_key_pair; - SignalFfiIdentityKeyStoreGetLocalRegistrationId get_local_registration_id; - SignalFfiIdentityKeyStoreGetIdentityKey get_identity_key; - SignalFfiIdentityKeyStoreSaveIdentityKey save_identity_key; - SignalFfiIdentityKeyStoreIsTrustedIdentity is_trusted_identity; - SignalFfiIdentityKeyStoreDestroy destroy; + SignalGetIdentityKeyPair get_identity_key_pair; + SignalGetLocalRegistrationId get_local_registration_id; + SignalSaveIdentityKey save_identity; + SignalGetIdentityKey get_identity; + SignalIsTrustedIdentity is_trusted_identity; } SignalIdentityKeyStore; typedef struct { @@ -852,20 +811,21 @@ typedef struct { SignalPreKeyRecord *raw; } SignalMutPointerPreKeyRecord; -typedef int (*SignalFfiPreKeyStoreLoadPreKey)(void *ctx, SignalMutPointerPreKeyRecord *out, uint32_t id); +typedef int (*SignalLoadPreKey)(void *store_ctx, SignalMutPointerPreKeyRecord *recordp, uint32_t id); -typedef int (*SignalFfiPreKeyStoreStorePreKey)(void *ctx, uint32_t id, SignalMutPointerPreKeyRecord record); +typedef struct { + const SignalPreKeyRecord *raw; +} SignalConstPointerPreKeyRecord; -typedef int (*SignalFfiPreKeyStoreRemovePreKey)(void *ctx, uint32_t id); +typedef int (*SignalStorePreKey)(void *store_ctx, uint32_t id, SignalConstPointerPreKeyRecord record); -typedef void (*SignalFfiPreKeyStoreDestroy)(void *ctx); +typedef int (*SignalRemovePreKey)(void *store_ctx, uint32_t id); typedef struct { void *ctx; - SignalFfiPreKeyStoreLoadPreKey load_pre_key; - SignalFfiPreKeyStoreStorePreKey store_pre_key; - SignalFfiPreKeyStoreRemovePreKey remove_pre_key; - SignalFfiPreKeyStoreDestroy destroy; + SignalLoadPreKey load_pre_key; + SignalStorePreKey store_pre_key; + SignalRemovePreKey remove_pre_key; } SignalPreKeyStore; typedef struct { @@ -876,17 +836,18 @@ typedef struct { SignalSignedPreKeyRecord *raw; } SignalMutPointerSignedPreKeyRecord; -typedef int (*SignalFfiSignedPreKeyStoreLoadSignedPreKey)(void *ctx, SignalMutPointerSignedPreKeyRecord *out, uint32_t id); +typedef int (*SignalLoadSignedPreKey)(void *store_ctx, SignalMutPointerSignedPreKeyRecord *recordp, uint32_t id); -typedef int (*SignalFfiSignedPreKeyStoreStoreSignedPreKey)(void *ctx, uint32_t id, SignalMutPointerSignedPreKeyRecord record); +typedef struct { + const SignalSignedPreKeyRecord *raw; +} SignalConstPointerSignedPreKeyRecord; -typedef void (*SignalFfiSignedPreKeyStoreDestroy)(void *ctx); +typedef int (*SignalStoreSignedPreKey)(void *store_ctx, uint32_t id, SignalConstPointerSignedPreKeyRecord record); typedef struct { void *ctx; - SignalFfiSignedPreKeyStoreLoadSignedPreKey load_signed_pre_key; - SignalFfiSignedPreKeyStoreStoreSignedPreKey store_signed_pre_key; - SignalFfiSignedPreKeyStoreDestroy destroy; + SignalLoadSignedPreKey load_signed_pre_key; + SignalStoreSignedPreKey store_signed_pre_key; } SignalSignedPreKeyStore; typedef struct { @@ -897,20 +858,21 @@ typedef struct { SignalKyberPreKeyRecord *raw; } SignalMutPointerKyberPreKeyRecord; -typedef int (*SignalFfiKyberPreKeyStoreLoadKyberPreKey)(void *ctx, SignalMutPointerKyberPreKeyRecord *out, uint32_t id); +typedef int (*SignalLoadKyberPreKey)(void *store_ctx, SignalMutPointerKyberPreKeyRecord *recordp, uint32_t id); -typedef int (*SignalFfiKyberPreKeyStoreStoreKyberPreKey)(void *ctx, uint32_t id, SignalMutPointerKyberPreKeyRecord record); +typedef struct { + const SignalKyberPreKeyRecord *raw; +} SignalConstPointerKyberPreKeyRecord; -typedef int (*SignalFfiKyberPreKeyStoreMarkKyberPreKeyUsed)(void *ctx, uint32_t id, uint32_t ec_prekey_id, SignalMutPointerPublicKey base_key); +typedef int (*SignalStoreKyberPreKey)(void *store_ctx, uint32_t id, SignalConstPointerKyberPreKeyRecord record); -typedef void (*SignalFfiKyberPreKeyStoreDestroy)(void *ctx); +typedef int (*SignalMarkKyberPreKeyUsed)(void *store_ctx, uint32_t id, uint32_t signed_prekey_id, SignalConstPointerPublicKey base_key); typedef struct { void *ctx; - SignalFfiKyberPreKeyStoreLoadKyberPreKey load_kyber_pre_key; - SignalFfiKyberPreKeyStoreStoreKyberPreKey store_kyber_pre_key; - SignalFfiKyberPreKeyStoreMarkKyberPreKeyUsed mark_kyber_pre_key_used; - SignalFfiKyberPreKeyStoreDestroy destroy; + SignalLoadKyberPreKey load_kyber_pre_key; + SignalStoreKyberPreKey store_kyber_pre_key; + SignalMarkKyberPreKeyUsed mark_kyber_pre_key_used; } SignalKyberPreKeyStore; typedef struct { @@ -935,45 +897,11 @@ typedef struct { uint32_t second; } SignalPairOfc_charu32; -/** - * A representation of a array allocated on the Rust heap for use in C code. - */ -typedef struct { - uint32_t *base; - /** - * The number of elements in the buffer (not necessarily the number of bytes). - */ - size_t length; -} SignalOwnedBufferOfu32; - -typedef struct { - SignalServiceIdFixedWidthBinaryBytes account; - SignalOwnedBufferOfu32 missing_devices; - SignalOwnedBufferOfu32 extra_devices; - SignalOwnedBufferOfu32 stale_devices; -} SignalFfiMismatchedDevicesError; - -/** - * A representation of a array allocated on the Rust heap for use in C code. - */ -typedef struct { - SignalFfiMismatchedDevicesError *base; - /** - * The number of elements in the buffer (not necessarily the number of bytes). - */ - size_t length; -} SignalOwnedBufferOfFfiMismatchedDevicesError; - typedef struct { const char *first; SignalOwnedBuffer second; } SignalPairOfc_charOwnedBufferOfc_uchar; -typedef struct { - SignalPairOfc_charOwnedBufferOfc_uchar first; - int64_t second; -} SignalPairOfPairOfc_charOwnedBufferOfc_uchari64; - typedef struct { const char *first; bool second; @@ -987,10 +915,6 @@ typedef struct { const SignalFingerprint *raw; } SignalConstPointerFingerprint; -typedef struct { - const SignalPublicKey *raw; -} SignalConstPointerPublicKey; - typedef struct { /** * The badge ID. @@ -1017,47 +941,22 @@ typedef struct { size_t length; } SignalOwnedBufferOfFfiRegisterResponseBadge; -/** - * A representation of a array allocated on the Rust heap for use in C code. - */ -typedef struct { - SignalServiceIdFixedWidthBinaryBytes *base; - /** - * The number of elements in the buffer (not necessarily the number of bytes). - */ - size_t length; -} SignalOwnedBufferOfServiceIdFixedWidthBinaryBytes; - -typedef struct { - SignalPreKeyBundle *raw; -} SignalMutPointerPreKeyBundle; - -/** - * A representation of a array allocated on the Rust heap for use in C code. - */ -typedef struct { - SignalMutPointerPreKeyBundle *base; - /** - * The number of elements in the buffer (not necessarily the number of bytes). - */ - size_t length; -} SignalOwnedBufferOfMutPointerPreKeyBundle; - typedef struct { SignalSenderKeyRecord *raw; } SignalMutPointerSenderKeyRecord; -typedef int (*SignalFfiSenderKeyStoreLoadSenderKey)(void *ctx, SignalMutPointerSenderKeyRecord *out, SignalMutPointerProtocolAddress sender, SignalUuid distribution_id); +typedef int (*SignalLoadSenderKey)(void *store_ctx, SignalMutPointerSenderKeyRecord*, SignalConstPointerProtocolAddress, const uint8_t (*distribution_id)[16]); -typedef int (*SignalFfiSenderKeyStoreStoreSenderKey)(void *ctx, SignalMutPointerProtocolAddress sender, SignalUuid distribution_id, SignalMutPointerSenderKeyRecord record); +typedef struct { + const SignalSenderKeyRecord *raw; +} SignalConstPointerSenderKeyRecord; -typedef void (*SignalFfiSenderKeyStoreDestroy)(void *ctx); +typedef int (*SignalStoreSenderKey)(void *store_ctx, SignalConstPointerProtocolAddress, const uint8_t (*distribution_id)[16], SignalConstPointerSenderKeyRecord); typedef struct { void *ctx; - SignalFfiSenderKeyStoreLoadSenderKey load_sender_key; - SignalFfiSenderKeyStoreStoreSenderKey store_sender_key; - SignalFfiSenderKeyStoreDestroy destroy; + SignalLoadSenderKey load_sender_key; + SignalStoreSenderKey store_sender_key; } SignalSenderKeyStore; typedef struct { @@ -1102,23 +1001,15 @@ typedef struct { SignalIncrementalMac *raw; } SignalMutPointerIncrementalMac; -typedef int (*SignalFfiLoggerLog)(void *ctx, SignalLogLevel level, const char *file, uint32_t line, const char *message); +typedef void (*SignalLogCallback)(void *ctx, SignalLogLevel level, const char *file, uint32_t line, const char *message); -typedef int (*SignalFfiLoggerFlush)(void *ctx); - -typedef void (*SignalFfiLoggerDestroy)(void *ctx); +typedef void (*SignalLogFlushCallback)(void *ctx); typedef struct { void *ctx; - SignalFfiLoggerLog log; - SignalFfiLoggerFlush flush; - SignalFfiLoggerDestroy destroy; -} SignalFfiLoggerStruct; - -typedef struct { - SignalOwnedBuffer first; - SignalOwnedBuffer second; -} SignalPairOfOwnedBufferOfc_ucharOwnedBufferOfc_uchar; + SignalLogCallback log; + SignalLogFlushCallback flush; +} SignalFfiLogger; /** * A C callback used to report the results of Rust futures. @@ -1130,10 +1021,10 @@ typedef struct { * completed once. */ typedef struct { - void (*complete)(SignalFfiError *error, const SignalPairOfOwnedBufferOfc_ucharOwnedBufferOfc_uchar *result, const void *context); + void (*complete)(SignalFfiError *error, const SignalOwnedBuffer *result, const void *context); const void *context; SignalCancellationId cancellation_id; -} SignalCPromisePairOfOwnedBufferOfc_ucharOwnedBufferOfc_uchar; +} SignalCPromiseOwnedBufferOfc_uchar; typedef struct { const SignalUnauthenticatedChatConnection *raw; @@ -1171,10 +1062,6 @@ typedef struct { SignalKyberSecretKey *raw; } SignalMutPointerKyberSecretKey; -typedef struct { - const SignalKyberPreKeyRecord *raw; -} SignalConstPointerKyberPreKeyRecord; - typedef struct { const SignalKyberPublicKey *raw; } SignalConstPointerKyberPublicKey; @@ -1203,17 +1090,14 @@ typedef struct { const SignalMessageBackupValidationOutcome *raw; } SignalConstPointerMessageBackupValidationOutcome; -typedef int (*SignalFfiInputStreamRead)(void *ctx, size_t *out, SignalBorrowedMutableBuffer buf); +typedef int (*SignalRead)(void *ctx, uint8_t *buf, size_t buf_len, size_t *amount_read); -typedef int (*SignalFfiInputStreamSkip)(void *ctx, uint64_t amount); - -typedef void (*SignalFfiInputStreamDestroy)(void *ctx); +typedef int (*SignalSkip)(void *ctx, uint64_t amount); typedef struct { void *ctx; - SignalFfiInputStreamRead read; - SignalFfiInputStreamSkip skip; - SignalFfiInputStreamDestroy destroy; + SignalRead read; + SignalSkip skip; } SignalInputStream; typedef struct { @@ -1245,12 +1129,12 @@ typedef struct { } SignalMutPointerPlaintextContent; typedef struct { - const SignalPreKeyBundle *raw; -} SignalConstPointerPreKeyBundle; + SignalPreKeyBundle *raw; +} SignalMutPointerPreKeyBundle; typedef struct { - const SignalPreKeyRecord *raw; -} SignalConstPointerPreKeyRecord; + const SignalPreKeyBundle *raw; +} SignalConstPointerPreKeyBundle; typedef struct { SignalPreKeySignalMessage *raw; @@ -1260,49 +1144,6 @@ typedef struct { const SignalSenderKeyDistributionMessage *raw; } SignalConstPointerSenderKeyDistributionMessage; -typedef struct { - SignalProvisioningChatConnection *raw; -} SignalMutPointerProvisioningChatConnection; - -/** - * A C callback used to report the results of Rust futures. - * - * cbindgen will produce independent C types like `SignalCPromisei32` and - * `SignalCPromiseProtocolAddress`. - * - * This derives Copy because it behaves like a C type; nevertheless, a promise should still only be - * completed once. - */ -typedef struct { - void (*complete)(SignalFfiError *error, const SignalMutPointerProvisioningChatConnection *result, const void *context); - const void *context; - SignalCancellationId cancellation_id; -} SignalCPromiseMutPointerProvisioningChatConnection; - -typedef struct { - const SignalProvisioningChatConnection *raw; -} SignalConstPointerProvisioningChatConnection; - -typedef int (*SignalFfiProvisioningListenerReceivedAddress)(void *ctx, const char *address, SignalMutPointerServerMessageAck send_ack); - -typedef int (*SignalFfiProvisioningListenerReceivedEnvelope)(void *ctx, SignalOwnedBuffer envelope, SignalMutPointerServerMessageAck send_ack); - -typedef int (*SignalFfiProvisioningListenerConnectionInterrupted)(void *ctx, SignalFfiError *disconnect_cause); - -typedef void (*SignalFfiProvisioningListenerDestroy)(void *ctx); - -typedef struct { - void *ctx; - SignalFfiProvisioningListenerReceivedAddress received_address; - SignalFfiProvisioningListenerReceivedEnvelope received_envelope; - SignalFfiProvisioningListenerConnectionInterrupted connection_interrupted; - SignalFfiProvisioningListenerDestroy destroy; -} SignalFfiProvisioningListenerStruct; - -typedef struct { - const SignalFfiProvisioningListenerStruct *raw; -} SignalConstPointerFfiProvisioningListenerStruct; - typedef struct { SignalRegisterAccountRequest *raw; } SignalMutPointerRegisterAccountRequest; @@ -1326,10 +1167,7 @@ typedef struct { const SignalRegisterAccountResponse *raw; } SignalConstPointerRegisterAccountResponse; -typedef struct { - bool present; - uint8_t bytes[16]; -} SignalOptionalUuid; +typedef uint8_t SignalOptionalUuid[17]; typedef SignalAccountAttributes SignalRegistrationAccountAttributes; @@ -1444,10 +1282,6 @@ typedef struct { size_t length; } SignalBorrowedSliceOfConstPointerProtocolAddress; -typedef struct { - const SignalSessionRecord *raw; -} SignalConstPointerSessionRecord; - typedef struct { const SignalConstPointerSessionRecord *base; size_t length; @@ -1527,8 +1361,8 @@ typedef struct { } SignalConstPointerSenderKeyMessage; typedef struct { - const SignalSenderKeyRecord *raw; -} SignalConstPointerSenderKeyRecord; + SignalServerMessageAck *raw; +} SignalMutPointerServerMessageAck; typedef struct { const SignalServerMessageAck *raw; @@ -1546,10 +1380,6 @@ typedef struct { const SignalSgxClientState *raw; } SignalConstPointerSgxClientState; -typedef struct { - const SignalSignedPreKeyRecord *raw; -} SignalConstPointerSignedPreKeyRecord; - typedef struct { SignalTokioAsyncContext *raw; } SignalMutPointerTokioAsyncContext; @@ -1573,26 +1403,6 @@ typedef struct { SignalCancellationId cancellation_id; } SignalCPromiseMutPointerUnauthenticatedChatConnection; -typedef struct { - SignalMutPointerPublicKey identity_key; - SignalOwnedBufferOfMutPointerPreKeyBundle pre_key_bundles; -} SignalFfiPreKeysResponse; - -/** - * A C callback used to report the results of Rust futures. - * - * cbindgen will produce independent C types like `SignalCPromisei32` and - * `SignalCPromiseProtocolAddress`. - * - * This derives Copy because it behaves like a C type; nevertheless, a promise should still only be - * completed once. - */ -typedef struct { - void (*complete)(SignalFfiError *error, const SignalFfiPreKeysResponse *result, const void *context); - const void *context; - SignalCancellationId cancellation_id; -} SignalCPromiseFfiPreKeysResponse; - /** * A C callback used to report the results of Rust futures. * @@ -1608,42 +1418,6 @@ typedef struct { SignalCancellationId cancellation_id; } SignalCPromiseOptionalUuid; -typedef struct { - bool present; - const char *first; - uint8_t second[32]; -} SignalOptionalPairOfc_charu832; - -/** - * A C callback used to report the results of Rust futures. - * - * cbindgen will produce independent C types like `SignalCPromisei32` and - * `SignalCPromiseProtocolAddress`. - * - * This derives Copy because it behaves like a C type; nevertheless, a promise should still only be - * completed once. - */ -typedef struct { - void (*complete)(SignalFfiError *error, const SignalOptionalPairOfc_charu832 *result, const void *context); - const void *context; - SignalCancellationId cancellation_id; -} SignalCPromiseOptionalPairOfc_charu832; - -/** - * A C callback used to report the results of Rust futures. - * - * cbindgen will produce independent C types like `SignalCPromisei32` and - * `SignalCPromiseProtocolAddress`. - * - * This derives Copy because it behaves like a C type; nevertheless, a promise should still only be - * completed once. - */ -typedef struct { - void (*complete)(SignalFfiError *error, const SignalOwnedBufferOfServiceIdFixedWidthBinaryBytes *result, const void *context); - const void *context; - SignalCancellationId cancellation_id; -} SignalCPromiseOwnedBufferOfServiceIdFixedWidthBinaryBytes; - typedef struct { SignalValidatingMac *raw; } SignalMutPointerValidatingMac; @@ -1658,8 +1432,6 @@ typedef uint8_t SignalRandomnessBytes[SignalRANDOMNESS_LEN]; typedef uint8_t SignalUnidentifiedAccessKey[SignalACCESS_KEY_LEN]; - - SignalFfiError *signal_account_entropy_pool_derive_backup_key(uint8_t (*out)[SignalBACKUP_KEY_LEN], const char *account_entropy); SignalFfiError *signal_account_entropy_pool_derive_svr_key(uint8_t (*out)[SignalSVR_KEY_LEN], const char *account_entropy); @@ -1726,8 +1498,6 @@ SignalFfiError *signal_authenticated_chat_connection_destroy(SignalMutPointerAut SignalFfiError *signal_authenticated_chat_connection_disconnect(SignalCPromisebool *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerAuthenticatedChatConnection chat); -SignalFfiError *signal_authenticated_chat_connection_get_upload_form(SignalCPromiseFfiUploadForm *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerAuthenticatedChatConnection chat, uint64_t upload_length); - SignalFfiError *signal_authenticated_chat_connection_info(SignalMutPointerChatConnectionInfo *out, SignalConstPointerAuthenticatedChatConnection chat); SignalFfiError *signal_authenticated_chat_connection_init_listener(SignalConstPointerAuthenticatedChatConnection chat, SignalConstPointerFfiChatListenerStruct listener); @@ -1736,10 +1506,6 @@ SignalFfiError *signal_authenticated_chat_connection_preconnect(SignalCPromisebo SignalFfiError *signal_authenticated_chat_connection_send(SignalCPromiseFfiChatResponse *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerAuthenticatedChatConnection chat, SignalConstPointerHttpRequest http_request, uint32_t timeout_millis); -SignalFfiError *signal_authenticated_chat_connection_send_message(SignalCPromisebool *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerAuthenticatedChatConnection chat, const SignalServiceIdFixedWidthBinaryBytes *destination, uint64_t timestamp, SignalBorrowedSliceOfu32 device_ids, SignalBorrowedSliceOfu32 registration_ids, SignalBorrowedSliceOfConstPointerCiphertextMessage contents, bool online_only, bool is_urgent); - -SignalFfiError *signal_authenticated_chat_connection_send_sync_message(SignalCPromisebool *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerAuthenticatedChatConnection chat, uint64_t timestamp, SignalBorrowedSliceOfu32 device_ids, SignalBorrowedSliceOfu32 registration_ids, SignalBorrowedSliceOfConstPointerCiphertextMessage contents, bool is_urgent); - SignalFfiError *signal_backup_auth_credential_check_valid_contents(SignalBorrowedBuffer params_bytes); SignalFfiError *signal_backup_auth_credential_get_backup_id(uint8_t (*out)[16], SignalBorrowedBuffer credential_bytes); @@ -1760,7 +1526,7 @@ SignalFfiError *signal_backup_auth_credential_request_context_check_valid_conten SignalFfiError *signal_backup_auth_credential_request_context_get_request(SignalOwnedBuffer *out, SignalBorrowedBuffer context_bytes); -SignalFfiError *signal_backup_auth_credential_request_context_new(SignalOwnedBuffer *out, const uint8_t (*backup_key)[32], SignalUuid uuid); +SignalFfiError *signal_backup_auth_credential_request_context_new(SignalOwnedBuffer *out, const uint8_t (*backup_key)[32], const uint8_t (*uuid)[16]); SignalFfiError *signal_backup_auth_credential_request_context_receive_response(SignalOwnedBuffer *out, SignalBorrowedBuffer context_bytes, SignalBorrowedBuffer response_bytes, uint64_t expected_redemption_time, SignalBorrowedBuffer params_bytes); @@ -1900,9 +1666,9 @@ SignalFfiError *signal_create_call_link_credential_request_issue_deterministic(S SignalFfiError *signal_create_call_link_credential_response_check_valid_contents(SignalBorrowedBuffer response_bytes); -SignalFfiError *signal_decrypt_message(SignalOwnedBuffer *out, SignalConstPointerSignalMessage message, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerProtocolAddress local_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store); +SignalFfiError *signal_decrypt_message(SignalOwnedBuffer *out, SignalConstPointerSignalMessage message, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store); -SignalFfiError *signal_decrypt_pre_key_message(SignalOwnedBuffer *out, SignalConstPointerPreKeySignalMessage message, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerProtocolAddress local_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store, SignalConstPointerFfiPreKeyStoreStruct prekey_store, SignalConstPointerFfiSignedPreKeyStoreStruct signed_prekey_store, SignalConstPointerFfiKyberPreKeyStoreStruct kyber_prekey_store); +SignalFfiError *signal_decrypt_pre_key_message(SignalOwnedBuffer *out, SignalConstPointerPreKeySignalMessage message, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store, SignalConstPointerFfiPreKeyStoreStruct prekey_store, SignalConstPointerFfiSignedPreKeyStoreStruct signed_prekey_store, SignalConstPointerFfiKyberPreKeyStoreStruct kyber_prekey_store); SignalFfiError *signal_decryption_error_message_clone(SignalMutPointerDecryptionErrorMessage *new_obj, SignalConstPointerDecryptionErrorMessage obj); @@ -1928,7 +1694,7 @@ SignalFfiError *signal_device_transfer_generate_private_key(SignalOwnedBuffer *o SignalFfiError *signal_device_transfer_generate_private_key_with_format(SignalOwnedBuffer *out, uint8_t key_format); -SignalFfiError *signal_encrypt_message(SignalMutPointerCiphertextMessage *out, SignalBorrowedBuffer ptext, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerProtocolAddress local_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store, uint64_t now); +SignalFfiError *signal_encrypt_message(SignalMutPointerCiphertextMessage *out, SignalBorrowedBuffer ptext, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store, uint64_t now); void signal_error_free(SignalFfiError *err); @@ -1938,11 +1704,9 @@ SignalFfiError *signal_error_get_invalid_protocol_address(SignalPairOfc_charu32 SignalFfiError *signal_error_get_message(const char **out, SignalUnwindSafeArgSignalFfiError err); -SignalFfiError *signal_error_get_mismatched_device_errors(SignalOwnedBufferOfFfiMismatchedDevicesError *out, SignalUnwindSafeArgSignalFfiError err); - SignalFfiError *signal_error_get_our_fingerprint_version(uint32_t *out, SignalUnwindSafeArgSignalFfiError err); -SignalFfiError *signal_error_get_rate_limit_challenge(SignalPairOfPairOfc_charOwnedBufferOfc_uchari64 *out, SignalUnwindSafeArgSignalFfiError err); +SignalFfiError *signal_error_get_rate_limit_challenge(SignalPairOfc_charOwnedBufferOfc_uchar *out, SignalUnwindSafeArgSignalFfiError err); SignalFfiError *signal_error_get_registration_error_not_deliverable(SignalPairOfc_charbool *out, SignalUnwindSafeArgSignalFfiError err); @@ -1958,7 +1722,7 @@ uint32_t signal_error_get_type(const SignalFfiError *err); SignalFfiError *signal_error_get_unknown_fields(SignalStringArray *out, SignalUnwindSafeArgSignalFfiError err); -SignalFfiError *signal_error_get_uuid(SignalUuid *out, SignalUnwindSafeArgSignalFfiError err); +SignalFfiError *signal_error_get_uuid(uint8_t (*out)[16], SignalUnwindSafeArgSignalFfiError err); SignalFfiError *signal_expiring_profile_key_credential_check_valid_contents(SignalBorrowedBuffer buffer); @@ -1982,23 +1746,12 @@ void signal_free_buffer(const unsigned char *buf, size_t buf_len); void signal_free_bytestring_array(SignalBytestringArray array); -void signal_free_list_of_mismatched_device_errors(SignalOwnedBufferOfFfiMismatchedDevicesError buffer); - void signal_free_list_of_register_response_badges(SignalOwnedBufferOfFfiRegisterResponseBadge buffer); -void signal_free_list_of_service_ids(SignalOwnedBufferOfServiceIdFixedWidthBinaryBytes buffer); - void signal_free_list_of_strings(SignalOwnedBufferOfCStringPtr buffer); void signal_free_lookup_response_entry_list(SignalOwnedBufferOfFfiCdsiLookupResponseEntry buffer); -/** - * This frees a buffer of PreKeyBundle pointers, and _does not_ free the - * pointers within the buffer. This _only_ frees the buffer containing - * the pointers. - */ -void signal_free_outer_buffer_list_of_prekey_bundles(SignalOwnedBufferOfMutPointerPreKeyBundle buffer); - void signal_free_string(const char *buf); SignalFfiError *signal_generic_server_public_params_check_valid_contents(SignalBorrowedBuffer params_bytes); @@ -2011,7 +1764,7 @@ SignalFfiError *signal_generic_server_secret_params_get_public_params(SignalOwne SignalFfiError *signal_group_decrypt_message(SignalOwnedBuffer *out, SignalConstPointerProtocolAddress sender, SignalBorrowedBuffer message, SignalConstPointerFfiSenderKeyStoreStruct store); -SignalFfiError *signal_group_encrypt_message(SignalMutPointerCiphertextMessage *out, SignalConstPointerProtocolAddress sender, SignalUuid distribution_id, SignalBorrowedBuffer message, SignalConstPointerFfiSenderKeyStoreStruct store); +SignalFfiError *signal_group_encrypt_message(SignalMutPointerCiphertextMessage *out, SignalConstPointerProtocolAddress sender, const uint8_t (*distribution_id)[16], SignalBorrowedBuffer message, SignalConstPointerFfiSenderKeyStoreStruct store); SignalFfiError *signal_group_master_key_check_valid_contents(SignalBorrowedBuffer buffer); @@ -2117,14 +1870,18 @@ SignalFfiError *signal_incremental_mac_initialize(SignalMutPointerIncrementalMac SignalFfiError *signal_incremental_mac_update(SignalOwnedBuffer *out, SignalMutPointerIncrementalMac mac, SignalBorrowedBuffer bytes, uint32_t offset, uint32_t length); -bool signal_init_logger(SignalLogLevel max_level, SignalFfiLoggerStruct logger); +bool signal_init_logger(SignalLogLevel max_level, SignalFfiLogger logger); SignalFfiError *signal_key_transparency_aci_search_key(SignalOwnedBuffer *out, const SignalServiceIdFixedWidthBinaryBytes *aci); -SignalFfiError *signal_key_transparency_check(SignalCPromisePairOfOwnedBufferOfc_ucharOwnedBufferOfc_uchar *promise, SignalConstPointerTokioAsyncContext async_runtime, uint8_t environment, SignalConstPointerUnauthenticatedChatConnection chat_connection, const SignalServiceIdFixedWidthBinaryBytes *aci, SignalConstPointerPublicKey aci_identity_key, const char *e164, SignalOptionalBorrowedSliceOfc_uchar unidentified_access_key, SignalOptionalBorrowedSliceOfc_uchar username_hash, SignalOptionalBorrowedSliceOfc_uchar account_data, SignalOptionalBorrowedSliceOfc_uchar last_distinguished_tree_head, bool is_self_check, bool is_e164_discoverable); +SignalFfiError *signal_key_transparency_distinguished(SignalCPromiseOwnedBufferOfc_uchar *promise, SignalConstPointerTokioAsyncContext async_runtime, uint8_t environment, SignalConstPointerUnauthenticatedChatConnection chat_connection, SignalOptionalBorrowedSliceOfc_uchar last_distinguished_tree_head); SignalFfiError *signal_key_transparency_e164_search_key(SignalOwnedBuffer *out, const char *e164); +SignalFfiError *signal_key_transparency_monitor(SignalCPromiseOwnedBufferOfc_uchar *promise, SignalConstPointerTokioAsyncContext async_runtime, uint8_t environment, SignalConstPointerUnauthenticatedChatConnection chat_connection, const SignalServiceIdFixedWidthBinaryBytes *aci, SignalConstPointerPublicKey aci_identity_key, const char *e164, SignalOptionalBorrowedSliceOfc_uchar unidentified_access_key, SignalOptionalBorrowedSliceOfc_uchar username_hash, SignalOptionalBorrowedSliceOfc_uchar account_data, SignalBorrowedBuffer last_distinguished_tree_head, bool is_self_monitor); + +SignalFfiError *signal_key_transparency_search(SignalCPromiseOwnedBufferOfc_uchar *promise, SignalConstPointerTokioAsyncContext async_runtime, uint8_t environment, SignalConstPointerUnauthenticatedChatConnection chat_connection, const SignalServiceIdFixedWidthBinaryBytes *aci, SignalConstPointerPublicKey aci_identity_key, const char *e164, SignalOptionalBorrowedSliceOfc_uchar unidentified_access_key, SignalOptionalBorrowedSliceOfc_uchar username_hash, SignalOptionalBorrowedSliceOfc_uchar account_data, SignalBorrowedBuffer last_distinguished_tree_head); + SignalFfiError *signal_key_transparency_username_hash_search_key(SignalOwnedBuffer *out, SignalBorrowedBuffer hash); SignalFfiError *signal_kyber_key_pair_clone(SignalMutPointerKyberKeyPair *new_obj, SignalConstPointerKyberKeyPair obj); @@ -2355,7 +2112,7 @@ SignalFfiError *signal_privatekey_serialize(SignalOwnedBuffer *out, SignalConstP SignalFfiError *signal_privatekey_sign(SignalOwnedBuffer *out, SignalConstPointerPrivateKey key, SignalBorrowedBuffer message); -SignalFfiError *signal_process_prekey_bundle(SignalConstPointerPreKeyBundle bundle, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerProtocolAddress local_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store, uint64_t now); +SignalFfiError *signal_process_prekey_bundle(SignalConstPointerPreKeyBundle bundle, SignalConstPointerProtocolAddress protocol_address, SignalConstPointerFfiSessionStoreStruct session_store, SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store, uint64_t now); SignalFfiError *signal_process_sender_key_distribution_message(SignalConstPointerProtocolAddress sender, SignalConstPointerSenderKeyDistributionMessage sender_key_distribution_message, SignalConstPointerFfiSenderKeyStoreStruct store); @@ -2383,18 +2140,10 @@ SignalFfiError *signal_profile_key_get_commitment(unsigned char (*out)[SignalPRO SignalFfiError *signal_profile_key_get_profile_key_version(uint8_t (*out)[SignalPROFILE_KEY_VERSION_ENCODED_LEN], const unsigned char (*profile_key)[SignalPROFILE_KEY_LEN], const SignalServiceIdFixedWidthBinaryBytes *user_id); -SignalFfiError *signal_provisioning_chat_connection_connect(SignalCPromiseMutPointerProvisioningChatConnection *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerConnectionManager connection_manager); - -SignalFfiError *signal_provisioning_chat_connection_destroy(SignalMutPointerProvisioningChatConnection p); - -SignalFfiError *signal_provisioning_chat_connection_disconnect(SignalCPromisebool *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerProvisioningChatConnection chat); - -SignalFfiError *signal_provisioning_chat_connection_info(SignalMutPointerChatConnectionInfo *out, SignalConstPointerProvisioningChatConnection chat); - -SignalFfiError *signal_provisioning_chat_connection_init_listener(SignalConstPointerProvisioningChatConnection chat, SignalConstPointerFfiProvisioningListenerStruct listener); - SignalFfiError *signal_publickey_clone(SignalMutPointerPublicKey *new_obj, SignalConstPointerPublicKey obj); +SignalFfiError *signal_publickey_compare(int32_t *out, SignalConstPointerPublicKey key1, SignalConstPointerPublicKey key2); + SignalFfiError *signal_publickey_deserialize(SignalMutPointerPublicKey *out, SignalBorrowedBuffer data); SignalFfiError *signal_publickey_destroy(SignalMutPointerPublicKey p); @@ -2567,7 +2316,7 @@ SignalFfiError *signal_sender_certificate_validate(bool *out, SignalConstPointer SignalFfiError *signal_sender_key_distribution_message_clone(SignalMutPointerSenderKeyDistributionMessage *new_obj, SignalConstPointerSenderKeyDistributionMessage obj); -SignalFfiError *signal_sender_key_distribution_message_create(SignalMutPointerSenderKeyDistributionMessage *out, SignalConstPointerProtocolAddress sender, SignalUuid distribution_id, SignalConstPointerFfiSenderKeyStoreStruct store); +SignalFfiError *signal_sender_key_distribution_message_create(SignalMutPointerSenderKeyDistributionMessage *out, SignalConstPointerProtocolAddress sender, const uint8_t (*distribution_id)[16], SignalConstPointerFfiSenderKeyStoreStruct store); SignalFfiError *signal_sender_key_distribution_message_deserialize(SignalMutPointerSenderKeyDistributionMessage *out, SignalBorrowedBuffer data); @@ -2577,13 +2326,13 @@ SignalFfiError *signal_sender_key_distribution_message_get_chain_id(uint32_t *ou SignalFfiError *signal_sender_key_distribution_message_get_chain_key(SignalOwnedBuffer *out, SignalConstPointerSenderKeyDistributionMessage obj); -SignalFfiError *signal_sender_key_distribution_message_get_distribution_id(SignalUuid *out, SignalConstPointerSenderKeyDistributionMessage obj); +SignalFfiError *signal_sender_key_distribution_message_get_distribution_id(uint8_t (*out)[16], SignalConstPointerSenderKeyDistributionMessage obj); SignalFfiError *signal_sender_key_distribution_message_get_iteration(uint32_t *out, SignalConstPointerSenderKeyDistributionMessage obj); SignalFfiError *signal_sender_key_distribution_message_get_signature_key(SignalMutPointerPublicKey *out, SignalConstPointerSenderKeyDistributionMessage m); -SignalFfiError *signal_sender_key_distribution_message_new(SignalMutPointerSenderKeyDistributionMessage *out, uint8_t message_version, SignalUuid distribution_id, uint32_t chain_id, uint32_t iteration, SignalBorrowedBuffer chainkey, SignalConstPointerPublicKey pk); +SignalFfiError *signal_sender_key_distribution_message_new(SignalMutPointerSenderKeyDistributionMessage *out, uint8_t message_version, const uint8_t (*distribution_id)[16], uint32_t chain_id, uint32_t iteration, SignalBorrowedBuffer chainkey, SignalConstPointerPublicKey pk); SignalFfiError *signal_sender_key_distribution_message_serialize(SignalOwnedBuffer *out, SignalConstPointerSenderKeyDistributionMessage obj); @@ -2597,11 +2346,11 @@ SignalFfiError *signal_sender_key_message_get_chain_id(uint32_t *out, SignalCons SignalFfiError *signal_sender_key_message_get_cipher_text(SignalOwnedBuffer *out, SignalConstPointerSenderKeyMessage obj); -SignalFfiError *signal_sender_key_message_get_distribution_id(SignalUuid *out, SignalConstPointerSenderKeyMessage obj); +SignalFfiError *signal_sender_key_message_get_distribution_id(uint8_t (*out)[16], SignalConstPointerSenderKeyMessage obj); SignalFfiError *signal_sender_key_message_get_iteration(uint32_t *out, SignalConstPointerSenderKeyMessage obj); -SignalFfiError *signal_sender_key_message_new(SignalMutPointerSenderKeyMessage *out, uint8_t message_version, SignalUuid distribution_id, uint32_t chain_id, uint32_t iteration, SignalBorrowedBuffer ciphertext, SignalConstPointerPrivateKey pk); +SignalFfiError *signal_sender_key_message_new(SignalMutPointerSenderKeyMessage *out, uint8_t message_version, const uint8_t (*distribution_id)[16], uint32_t chain_id, uint32_t iteration, SignalBorrowedBuffer ciphertext, SignalConstPointerPrivateKey pk); SignalFfiError *signal_sender_key_message_serialize(SignalOwnedBuffer *out, SignalConstPointerSenderKeyMessage obj); @@ -2755,38 +2504,20 @@ SignalFfiError *signal_tokio_async_context_destroy(SignalMutPointerTokioAsyncCon SignalFfiError *signal_tokio_async_context_new(SignalMutPointerTokioAsyncContext *out); -SignalFfiError *signal_unauthenticated_chat_connection_account_exists(SignalCPromisebool *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, const SignalServiceIdFixedWidthBinaryBytes *account); - -SignalFfiError *signal_unauthenticated_chat_connection_backup_get_media_upload_form(SignalCPromiseFfiUploadForm *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, SignalBorrowedBuffer credential, SignalBorrowedBuffer server_keys, SignalConstPointerPrivateKey signing_key, uint64_t upload_size, int64_t rng); - -SignalFfiError *signal_unauthenticated_chat_connection_backup_get_upload_form(SignalCPromiseFfiUploadForm *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, SignalBorrowedBuffer credential, SignalBorrowedBuffer server_keys, SignalConstPointerPrivateKey signing_key, uint64_t upload_size, int64_t rng); - SignalFfiError *signal_unauthenticated_chat_connection_connect(SignalCPromiseMutPointerUnauthenticatedChatConnection *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerConnectionManager connection_manager, SignalBorrowedBytestringArray languages); SignalFfiError *signal_unauthenticated_chat_connection_destroy(SignalMutPointerUnauthenticatedChatConnection p); SignalFfiError *signal_unauthenticated_chat_connection_disconnect(SignalCPromisebool *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat); -SignalFfiError *signal_unauthenticated_chat_connection_get_pre_keys_access_key_auth(SignalCPromiseFfiPreKeysResponse *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, const uint8_t (*auth)[16], const SignalServiceIdFixedWidthBinaryBytes *target, int32_t device); - -SignalFfiError *signal_unauthenticated_chat_connection_get_pre_keys_group_auth(SignalCPromiseFfiPreKeysResponse *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, SignalBorrowedBuffer auth, const SignalServiceIdFixedWidthBinaryBytes *target, int32_t device); - -SignalFfiError *signal_unauthenticated_chat_connection_get_pre_keys_unrestricted_auth(SignalCPromiseFfiPreKeysResponse *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, const SignalServiceIdFixedWidthBinaryBytes *target, int32_t device); - SignalFfiError *signal_unauthenticated_chat_connection_info(SignalMutPointerChatConnectionInfo *out, SignalConstPointerUnauthenticatedChatConnection chat); SignalFfiError *signal_unauthenticated_chat_connection_init_listener(SignalConstPointerUnauthenticatedChatConnection chat, SignalConstPointerFfiChatListenerStruct listener); SignalFfiError *signal_unauthenticated_chat_connection_look_up_username_hash(SignalCPromiseOptionalUuid *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, SignalBorrowedBuffer hash); -SignalFfiError *signal_unauthenticated_chat_connection_look_up_username_link(SignalCPromiseOptionalPairOfc_charu832 *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, SignalUuid uuid, SignalBorrowedBuffer entropy); - SignalFfiError *signal_unauthenticated_chat_connection_send(SignalCPromiseFfiChatResponse *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, SignalConstPointerHttpRequest http_request, uint32_t timeout_millis); -SignalFfiError *signal_unauthenticated_chat_connection_send_message(SignalCPromisebool *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, const SignalServiceIdFixedWidthBinaryBytes *destination, uint64_t timestamp, SignalBorrowedSliceOfu32 device_ids, SignalBorrowedSliceOfu32 registration_ids, SignalBorrowedSliceOfBuffers contents, uint8_t auth_kind, SignalOptionalBorrowedSliceOfc_uchar auth_buffer, bool online_only, bool is_urgent); - -SignalFfiError *signal_unauthenticated_chat_connection_send_multi_recipient_message(SignalCPromiseOwnedBufferOfServiceIdFixedWidthBinaryBytes *promise, SignalConstPointerTokioAsyncContext async_runtime, SignalConstPointerUnauthenticatedChatConnection chat, SignalBorrowedBuffer payload, uint64_t timestamp, SignalBorrowedBuffer auth, bool online_only, bool is_urgent); - SignalFfiError *signal_unidentified_sender_message_content_deserialize(SignalMutPointerUnidentifiedSenderMessageContent *out, SignalBorrowedBuffer data); SignalFfiError *signal_unidentified_sender_message_content_destroy(SignalMutPointerUnidentifiedSenderMessageContent p); diff --git a/pkg/libsignalgo/logging.go b/pkg/libsignalgo/logging.go index 1926c23..9d21afa 100644 --- a/pkg/libsignalgo/logging.go +++ b/pkg/libsignalgo/logging.go @@ -21,7 +21,6 @@ package libsignalgo extern void signal_log_callback(void *ctx, SignalLogLevel level, char *file, uint32_t line, char *message); extern void signal_log_flush_callback(void *ctx); -extern void signal_log_destroy_callback(void *ctx); */ import "C" import ( @@ -41,11 +40,6 @@ func signal_log_flush_callback(ctx unsafe.Pointer) { ffiLogger.Flush() } -//export signal_log_destroy_callback -func signal_log_destroy_callback(ctx unsafe.Pointer) { - ffiLogger.Destroy() -} - type LogLevel int const ( @@ -59,14 +53,12 @@ const ( type Logger interface { Log(level LogLevel, file string, line uint, message string) Flush() - Destroy() } func InitLogger(level LogLevel, logger Logger) { ffiLogger = logger - C.signal_init_logger(C.SignalLogLevel(level), C.SignalFfiLoggerStruct{ - log: C.SignalFfiLoggerLog(C.signal_log_callback), - flush: C.SignalFfiLoggerFlush(C.signal_log_flush_callback), - destroy: C.SignalFfiLoggerDestroy(C.signal_log_destroy_callback), + C.signal_init_logger(C.SignalLogLevel(level), C.SignalFfiLogger{ + log: C.SignalLogCallback(C.signal_log_callback), + flush: C.SignalLogFlushCallback(C.signal_log_flush_callback), }) } diff --git a/pkg/libsignalgo/message.go b/pkg/libsignalgo/message.go index 6cba873..f016daa 100644 --- a/pkg/libsignalgo/message.go +++ b/pkg/libsignalgo/message.go @@ -27,7 +27,7 @@ import ( "time" ) -func Encrypt(ctx context.Context, plaintext []byte, forAddress, localAddress *Address, sessionStore SessionStore, identityKeyStore IdentityKeyStore) (*CiphertextMessage, error) { +func Encrypt(ctx context.Context, plaintext []byte, forAddress *Address, sessionStore SessionStore, identityKeyStore IdentityKeyStore) (*CiphertextMessage, error) { var ciphertextMessage C.SignalMutPointerCiphertextMessage var now C.uint64_t = C.uint64_t(time.Now().Unix()) callbackCtx := NewCallbackContext(ctx) @@ -36,7 +36,6 @@ func Encrypt(ctx context.Context, plaintext []byte, forAddress, localAddress *Ad &ciphertextMessage, BytesToBuffer(plaintext), forAddress.constPtr(), - localAddress.constPtr(), callbackCtx.wrapSessionStore(sessionStore), callbackCtx.wrapIdentityKeyStore(identityKeyStore), now, @@ -49,7 +48,7 @@ func Encrypt(ctx context.Context, plaintext []byte, forAddress, localAddress *Ad return wrapCiphertextMessage(ciphertextMessage.raw), nil } -func Decrypt(ctx context.Context, message *Message, fromAddress, localAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore) ([]byte, error) { +func Decrypt(ctx context.Context, message *Message, fromAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore) ([]byte, error) { callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() var decrypted C.SignalOwnedBuffer = C.SignalOwnedBuffer{} @@ -57,7 +56,6 @@ func Decrypt(ctx context.Context, message *Message, fromAddress, localAddress *A &decrypted, message.constPtr(), fromAddress.constPtr(), - localAddress.constPtr(), callbackCtx.wrapSessionStore(sessionStore), callbackCtx.wrapIdentityKeyStore(identityStore), ) diff --git a/pkg/libsignalgo/prekey.go b/pkg/libsignalgo/prekey.go index 29e640e..4d01f89 100644 --- a/pkg/libsignalgo/prekey.go +++ b/pkg/libsignalgo/prekey.go @@ -26,7 +26,7 @@ import ( "runtime" ) -func DecryptPreKey(ctx context.Context, preKeyMessage *PreKeyMessage, fromAddress, localAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore, preKeyStore PreKeyStore, signedPreKeyStore SignedPreKeyStore, kyberPreKeyStore KyberPreKeyStore) ([]byte, error) { +func DecryptPreKey(ctx context.Context, preKeyMessage *PreKeyMessage, fromAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore, preKeyStore PreKeyStore, signedPreKeyStore SignedPreKeyStore, kyberPreKeyStore KyberPreKeyStore) ([]byte, error) { callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() var decrypted C.SignalOwnedBuffer = C.SignalOwnedBuffer{} @@ -34,7 +34,6 @@ func DecryptPreKey(ctx context.Context, preKeyMessage *PreKeyMessage, fromAddres &decrypted, preKeyMessage.constPtr(), fromAddress.constPtr(), - localAddress.constPtr(), callbackCtx.wrapSessionStore(sessionStore), callbackCtx.wrapIdentityKeyStore(identityStore), callbackCtx.wrapPreKeyStore(preKeyStore), diff --git a/pkg/libsignalgo/prekeybundle.go b/pkg/libsignalgo/prekeybundle.go index 8a6fcaa..4cd5547 100644 --- a/pkg/libsignalgo/prekeybundle.go +++ b/pkg/libsignalgo/prekeybundle.go @@ -27,14 +27,13 @@ import ( "time" ) -func ProcessPreKeyBundle(ctx context.Context, bundle *PreKeyBundle, forAddress, localAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore) error { +func ProcessPreKeyBundle(ctx context.Context, bundle *PreKeyBundle, forAddress *Address, sessionStore SessionStore, identityStore IdentityKeyStore) error { callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() var now C.uint64_t = C.uint64_t(time.Now().Unix()) signalFfiError := C.signal_process_prekey_bundle( bundle.constPtr(), forAddress.constPtr(), - localAddress.constPtr(), callbackCtx.wrapSessionStore(sessionStore), callbackCtx.wrapIdentityKeyStore(identityStore), now, diff --git a/pkg/libsignalgo/prekeystore.go b/pkg/libsignalgo/prekeystore.go index 8c3c36f..643e286 100644 --- a/pkg/libsignalgo/prekeystore.go +++ b/pkg/libsignalgo/prekeystore.go @@ -20,10 +20,11 @@ package libsignalgo /* #include "./libsignal-ffi.h" -extern int signal_load_pre_key_callback(void *store_ctx, SignalMutPointerPreKeyRecord *recordp, uint32_t id); -extern int signal_store_pre_key_callback(void *store_ctx, uint32_t id, SignalMutPointerPreKeyRecord record); +typedef const SignalPreKeyRecord const_pre_key_record; + +extern int signal_load_pre_key_callback(void *store_ctx, SignalPreKeyRecord **recordp, uint32_t id); +extern int signal_store_pre_key_callback(void *store_ctx, uint32_t id, const_pre_key_record *record); extern int signal_remove_pre_key_callback(void *store_ctx, uint32_t id); -extern void signal_destroy_pre_key_store_callback(void *store_ctx); */ import "C" import ( @@ -38,21 +39,21 @@ type PreKeyStore interface { } //export signal_load_pre_key_callback -func signal_load_pre_key_callback(storeCtx unsafe.Pointer, keyp *C.SignalMutPointerPreKeyRecord, id C.uint32_t) C.int { +func signal_load_pre_key_callback(storeCtx unsafe.Pointer, keyp **C.SignalPreKeyRecord, id C.uint32_t) C.int { return wrapStoreCallback(storeCtx, func(store PreKeyStore, ctx context.Context) error { key, err := store.LoadPreKey(ctx, uint32(id)) if err == nil && key != nil { key.CancelFinalizer() - keyp.raw = key.ptr + *keyp = key.ptr } return err }) } //export signal_store_pre_key_callback -func signal_store_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t, preKeyRecord C.SignalMutPointerPreKeyRecord) C.int { +func signal_store_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t, preKeyRecord *C.const_pre_key_record) C.int { return wrapStoreCallback(storeCtx, func(store PreKeyStore, ctx context.Context) error { - record := PreKeyRecord{ptr: preKeyRecord.raw} + record := PreKeyRecord{ptr: (*C.SignalPreKeyRecord)(unsafe.Pointer(preKeyRecord))} cloned, err := record.Clone() if err != nil { return err @@ -68,17 +69,11 @@ func signal_remove_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t) C.in }) } -//export signal_destroy_pre_key_store_callback -func signal_destroy_pre_key_store_callback(storeCtx unsafe.Pointer) { - // No-op: Go's garbage collector handles cleanup -} - func (ctx *CallbackContext) wrapPreKeyStore(store PreKeyStore) C.SignalConstPointerFfiPreKeyStoreStruct { return C.SignalConstPointerFfiPreKeyStoreStruct{&C.SignalPreKeyStore{ ctx: wrapStore(ctx, store), - load_pre_key: C.SignalFfiPreKeyStoreLoadPreKey(C.signal_load_pre_key_callback), - store_pre_key: C.SignalFfiPreKeyStoreStorePreKey(C.signal_store_pre_key_callback), - remove_pre_key: C.SignalFfiPreKeyStoreRemovePreKey(C.signal_remove_pre_key_callback), - destroy: C.SignalFfiPreKeyStoreDestroy(C.signal_destroy_pre_key_store_callback), + load_pre_key: C.SignalLoadPreKey(C.signal_load_pre_key_callback), + store_pre_key: C.SignalStorePreKey(C.signal_store_pre_key_callback), + remove_pre_key: C.SignalRemovePreKey(C.signal_remove_pre_key_callback), }} } diff --git a/pkg/libsignalgo/profilekey.go b/pkg/libsignalgo/profilekey.go index e49801a..8d2ae04 100644 --- a/pkg/libsignalgo/profilekey.go +++ b/pkg/libsignalgo/profilekey.go @@ -23,7 +23,6 @@ package libsignalgo */ import "C" import ( - "encoding/base64" "errors" "runtime" "unsafe" @@ -55,6 +54,10 @@ func (pk *ProfileKey) IsEmpty() bool { return pk == nil || *pk == blankProfileKey } +func (ak *AccessKey) String() string { + return string(ak[:]) +} + func (pv *ProfileKeyVersion) String() string { return string(pv[:]) } @@ -66,23 +69,6 @@ func (pk *ProfileKey) Slice() []byte { return pk[:] } -func (ak *AccessKey) Xor(other *AccessKey) *AccessKey { - if ak == nil { - return other - } else if other == nil { - return ak - } - var result AccessKey - for i := 0; i < C.SignalACCESS_KEY_LEN; i++ { - result[i] = ak[i] ^ other[i] - } - return &result -} - -func (ak *AccessKey) String() string { - return base64.StdEncoding.EncodeToString(ak[:]) -} - func (pk *ProfileKey) GetCommitment(u uuid.UUID) (*ProfileKeyCommitment, error) { c_result := [C.SignalPROFILE_KEY_COMMITMENT_LEN]C.uchar{} c_profileKey := (*[C.SignalPROFILE_KEY_LEN]C.uchar)(unsafe.Pointer(pk)) diff --git a/pkg/libsignalgo/publickey.go b/pkg/libsignalgo/publickey.go index fdd76e5..dcf9647 100644 --- a/pkg/libsignalgo/publickey.go +++ b/pkg/libsignalgo/publickey.go @@ -29,9 +29,6 @@ type PublicKey struct { } func wrapPublicKey(ptr *C.SignalPublicKey) *PublicKey { - if ptr == nil { - return nil - } publicKey := &PublicKey{ptr: ptr} runtime.SetFinalizer(publicKey, (*PublicKey).Destroy) return publicKey @@ -84,15 +81,15 @@ func (k *PublicKey) CancelFinalizer() { runtime.SetFinalizer(k, nil) } -func (k *PublicKey) Equal(other *PublicKey) (bool, error) { - var comparison C.bool - signalFfiError := C.signal_publickey_equals(&comparison, k.constPtr(), other.constPtr()) +func (k *PublicKey) Compare(other *PublicKey) (int, error) { + var comparison C.int + signalFfiError := C.signal_publickey_compare(&comparison, k.constPtr(), other.constPtr()) runtime.KeepAlive(k) runtime.KeepAlive(other) if signalFfiError != nil { - return false, wrapError(signalFfiError) + return 0, wrapError(signalFfiError) } - return bool(comparison), nil + return int(comparison), nil } func (k *PublicKey) Bytes() ([]byte, error) { diff --git a/pkg/libsignalgo/sealedsender.go b/pkg/libsignalgo/sealedsender.go index 84ff254..1530183 100644 --- a/pkg/libsignalgo/sealedsender.go +++ b/pkg/libsignalgo/sealedsender.go @@ -23,9 +23,7 @@ package libsignalgo import "C" import ( "context" - "fmt" "runtime" - "unsafe" "github.com/google/uuid" ) @@ -44,17 +42,8 @@ func NewSealedSenderAddress(e164 string, uuid uuid.UUID, deviceID uint32) *Seale } } -func SealedSenderEncryptPlaintext( - ctx context.Context, - message []byte, - contentHint UnidentifiedSenderMessageContentHint, - forAddress, localAddress *Address, - fromSenderCert *SenderCertificate, - sessionStore SessionStore, - identityStore IdentityKeyStore, - groupID *GroupIdentifier, -) ([]byte, error) { - ciphertextMessage, err := Encrypt(ctx, message, forAddress, localAddress, sessionStore, identityStore) +func SealedSenderEncryptPlaintext(ctx context.Context, message []byte, contentHint UnidentifiedSenderMessageContentHint, forAddress *Address, fromSenderCert *SenderCertificate, sessionStore SessionStore, identityStore IdentityKeyStore) ([]byte, error) { + ciphertextMessage, err := Encrypt(ctx, message, forAddress, sessionStore, identityStore) if err != nil { return nil, err } @@ -63,7 +52,7 @@ func SealedSenderEncryptPlaintext( ciphertextMessage, fromSenderCert, contentHint, - groupID, + nil, ) if err != nil { return nil, err @@ -89,51 +78,8 @@ func SealedSenderEncrypt(ctx context.Context, usmc *UnidentifiedSenderMessageCon return CopySignalOwnedBufferToBytes(encrypted), nil } -type SessionAddressTuple struct { - ServiceID ServiceID - DeviceID int - Address *Address - Record *SessionRecord -} - -func SealedSenderMultiRecipientEncrypt( - ctx context.Context, - usmc *UnidentifiedSenderMessageContent, - recipients []SessionAddressTuple, - identityStore IdentityKeyStore, -) ([]byte, error) { - var encrypted C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - callbackCtx := NewCallbackContext(ctx) - defer callbackCtx.Unref() - recipientAddresses := make([]C.SignalConstPointerProtocolAddress, len(recipients)) - recipientSessions := make([]C.SignalConstPointerSessionRecord, len(recipients)) - - for i, recipient := range recipients { - recipientAddresses[i] = recipient.Address.constPtr() - recipientSessions[i] = recipient.Record.constPtr() - } - signalFfiError := C.signal_sealed_sender_multi_recipient_encrypt( - &encrypted, - C.SignalBorrowedSliceOfConstPointerProtocolAddress{ - base: unsafe.SliceData(recipientAddresses), - length: C.size_t(len(recipientAddresses)), - }, - C.SignalBorrowedSliceOfConstPointerSessionRecord{ - base: unsafe.SliceData(recipientSessions), - length: C.size_t(len(recipientSessions)), - }, - BytesToBuffer(nil), - usmc.constPtr(), - callbackCtx.wrapIdentityKeyStore(identityStore), - ) - runtime.KeepAlive(usmc) - runtime.KeepAlive(recipients) - runtime.KeepAlive(recipientAddresses) - runtime.KeepAlive(recipientSessions) - if signalFfiError != nil { - return nil, callbackCtx.wrapError(signalFfiError) - } - return CopySignalOwnedBufferToBytes(encrypted), nil +func SealedSenderMultiRecipientEncrypt(messageContent *UnidentifiedSenderMessageContent, forRecipients []*Address, identityStore IdentityKeyStore, sessionStore SessionStore, ctx *CallbackContext) ([]byte, error) { + panic("not implemented") } type SealedSenderResult struct { @@ -180,22 +126,18 @@ func wrapUnidentifiedSenderMessageContent(ptr *C.SignalUnidentifiedSenderMessage return messageContent } -func NewUnidentifiedSenderMessageContent(message *CiphertextMessage, senderCertificate *SenderCertificate, contentHint UnidentifiedSenderMessageContentHint, groupID *GroupIdentifier) (*UnidentifiedSenderMessageContent, error) { +func NewUnidentifiedSenderMessageContent(message *CiphertextMessage, senderCertificate *SenderCertificate, contentHint UnidentifiedSenderMessageContentHint, groupID []byte) (*UnidentifiedSenderMessageContent, error) { var usmc C.SignalMutPointerUnidentifiedSenderMessageContent - var groupIDBytes []byte - if groupID != nil { - groupIDBytes = groupID[:] - } signalFfiError := C.signal_unidentified_sender_message_content_new( &usmc, message.constPtr(), senderCertificate.constPtr(), C.uint32_t(contentHint), - BytesToBuffer(groupIDBytes), + BytesToBuffer(groupID), ) runtime.KeepAlive(message) runtime.KeepAlive(senderCertificate) - runtime.KeepAlive(groupIDBytes) + runtime.KeepAlive(groupID) if signalFfiError != nil { return nil, wrapError(signalFfiError) } @@ -267,21 +209,18 @@ func (usmc *UnidentifiedSenderMessageContent) GetContents() ([]byte, error) { return CopySignalOwnedBufferToBytes(contents), nil } -func (usmc *UnidentifiedSenderMessageContent) GetGroupID() (*GroupIdentifier, error) { - var contents C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_unidentified_sender_message_content_get_group_id_or_empty(&contents, usmc.constPtr()) - runtime.KeepAlive(usmc) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - bytes := CopySignalOwnedBufferToBytes(contents) - if len(bytes) == 0 { - return nil, nil - } else if len(bytes) != GroupIdentifierLength { - return nil, fmt.Errorf("unexpected group ID length: %d", len(bytes)) - } - return (*GroupIdentifier)(bytes), nil -} +//func (usmc *UnidentifiedSenderMessageContent) GetGroupID() ([]byte, error) { +// var groupID *C.uchar +// var length C.ulong +// signalFfiError := C.signal_unidentified_sender_message_content_get_group_id(&groupID, &length, usmc.ptr) +// if signalFfiError != nil { +// return nil, wrapError(signalFfiError) +// } +// if groupID == nil { +// return nil, nil +// } +// return CopyBufferToBytes(groupID, length), nil +//} func (usmc *UnidentifiedSenderMessageContent) GetSenderCertificate() (*SenderCertificate, error) { var senderCertificate C.SignalMutPointerSenderCertificate diff --git a/pkg/libsignalgo/senderkeydistributionmessage.go b/pkg/libsignalgo/senderkeydistributionmessage.go index c9f6099..d07c558 100644 --- a/pkg/libsignalgo/senderkeydistributionmessage.go +++ b/pkg/libsignalgo/senderkeydistributionmessage.go @@ -60,7 +60,7 @@ func NewSenderKeyDistributionMessage(ctx context.Context, sender *Address, distr signalFfiError := C.signal_sender_key_distribution_message_create( &skdm, sender.constPtr(), - *(*C.SignalUuid)(unsafe.Pointer(&distributionID)), + (*[C.SignalUUID_LEN]C.uchar)(unsafe.Pointer(&distributionID)), callbackCtx.wrapSenderKeyStore(store), ) runtime.KeepAlive(sender) diff --git a/pkg/libsignalgo/senderkeystore.go b/pkg/libsignalgo/senderkeystore.go index 1649216..30df4ad 100644 --- a/pkg/libsignalgo/senderkeystore.go +++ b/pkg/libsignalgo/senderkeystore.go @@ -20,9 +20,13 @@ package libsignalgo /* #include "./libsignal-ffi.h" -extern int signal_load_sender_key_callback(void *store_ctx, SignalMutPointerSenderKeyRecord *out, SignalMutPointerProtocolAddress sender, SignalUuid distribution_id); -extern int signal_store_sender_key_callback(void *store_ctx, SignalMutPointerProtocolAddress sender, SignalUuid distribution_id, SignalMutPointerSenderKeyRecord record); -extern void signal_destroy_sender_key_store_callback(void *store_ctx); +typedef const SignalProtocolAddress const_address; + +typedef const SignalSenderKeyRecord const_sender_key_record; +typedef const uint8_t const_uuid_bytes[16]; + +extern int signal_load_sender_key_callback(void *store_ctx, SignalSenderKeyRecord**, const_address*, const_uuid_bytes*); +extern int signal_store_sender_key_callback(void *store_ctx, const_address*, const_uuid_bytes*, const_sender_key_record*); */ import "C" import ( @@ -38,40 +42,36 @@ type SenderKeyStore interface { } //export signal_load_sender_key_callback -func signal_load_sender_key_callback(storeCtx unsafe.Pointer, recordp *C.SignalMutPointerSenderKeyRecord, address C.SignalMutPointerProtocolAddress, distributionID C.SignalUuid) C.int { +func signal_load_sender_key_callback(storeCtx unsafe.Pointer, recordp **C.SignalSenderKeyRecord, address *C.const_address, distributionIDBytes *C.const_uuid_bytes) C.int { return wrapStoreCallback(storeCtx, func(store SenderKeyStore, ctx context.Context) error { - record, err := store.LoadSenderKey(ctx, &Address{ptr: address.raw}, *(*uuid.UUID)(unsafe.Pointer(&distributionID))) + distributionID := uuid.UUID(*(*[16]byte)(unsafe.Pointer(distributionIDBytes))) + record, err := store.LoadSenderKey(ctx, &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))}, distributionID) if err == nil && record != nil { record.CancelFinalizer() - recordp.raw = record.ptr + *recordp = record.ptr } return err }) } //export signal_store_sender_key_callback -func signal_store_sender_key_callback(storeCtx unsafe.Pointer, address C.SignalMutPointerProtocolAddress, distributionID C.SignalUuid, senderKeyRecord C.SignalMutPointerSenderKeyRecord) C.int { +func signal_store_sender_key_callback(storeCtx unsafe.Pointer, address *C.const_address, distributionIDBytes *C.const_uuid_bytes, senderKeyRecord *C.const_sender_key_record) C.int { return wrapStoreCallback(storeCtx, func(store SenderKeyStore, ctx context.Context) error { - record := SenderKeyRecord{ptr: senderKeyRecord.raw} + distributionID := uuid.UUID(*(*[16]byte)(unsafe.Pointer(distributionIDBytes))) + record := SenderKeyRecord{ptr: (*C.SignalSenderKeyRecord)(unsafe.Pointer(senderKeyRecord))} cloned, err := record.Clone() if err != nil { return err } - return store.StoreSenderKey(ctx, &Address{ptr: address.raw}, *(*uuid.UUID)(unsafe.Pointer(&distributionID)), cloned) + return store.StoreSenderKey(ctx, &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))}, distributionID, cloned) }) } -//export signal_destroy_sender_key_store_callback -func signal_destroy_sender_key_store_callback(storeCtx unsafe.Pointer) { - // No-op: Go's garbage collector handles cleanup -} - func (ctx *CallbackContext) wrapSenderKeyStore(store SenderKeyStore) C.SignalConstPointerFfiSenderKeyStoreStruct { return C.SignalConstPointerFfiSenderKeyStoreStruct{&C.SignalSenderKeyStore{ ctx: wrapStore(ctx, store), - load_sender_key: C.SignalFfiSenderKeyStoreLoadSenderKey(C.signal_load_sender_key_callback), - store_sender_key: C.SignalFfiSenderKeyStoreStoreSenderKey(C.signal_store_sender_key_callback), - destroy: C.SignalFfiSenderKeyStoreDestroy(C.signal_destroy_sender_key_store_callback), + load_sender_key: C.SignalLoadSenderKey(C.signal_load_sender_key_callback), + store_sender_key: C.SignalStoreSenderKey(C.signal_store_sender_key_callback), }} } diff --git a/pkg/libsignalgo/serviceid.go b/pkg/libsignalgo/serviceid.go index 21d64b2..19513de 100644 --- a/pkg/libsignalgo/serviceid.go +++ b/pkg/libsignalgo/serviceid.go @@ -31,6 +31,12 @@ import ( "github.com/rs/zerolog" ) +func init() { + if C.SignalUUID_LEN != 16 { + panic("libsignal-ffi uuid type size mismatch") + } +} + type ServiceIDType byte const ( @@ -87,9 +93,6 @@ func (s ServiceID) IsEmpty() bool { } func (s ServiceID) Address(deviceID uint) (*Address, error) { - if s.IsEmpty() { - return nil, fmt.Errorf("cannot create address from empty ServiceID") - } return newAddress(s.String(), deviceID) } @@ -115,19 +118,6 @@ func (s ServiceID) GoString() string { return fmt.Sprintf(`libsignalgo.ServiceID{Type: %#v, UUID: uuid.MustParse("%s")}`, s.Type, s.UUID) } -func (s ServiceID) MarshalText() ([]byte, error) { - return []byte(s.String()), nil -} - -func (s *ServiceID) UnmarshalText(text []byte) error { - parsed, err := ServiceIDFromString(string(text)) - if err != nil { - return err - } - *s = parsed - return nil -} - func (s ServiceID) MarshalZerologObject(e *zerolog.Event) { e.Stringer("type", s.Type) e.Stringer("uuid", s.UUID) @@ -161,18 +151,6 @@ func ServiceIDFromString(val string) (ServiceID, error) { } } -func ServiceIDFromBytes(bytes []byte) (ServiceID, error) { - if len(bytes) == 16 { - return NewACIServiceID(uuid.UUID(bytes)), nil - } else if len(bytes) == 17 { - return ServiceID{ - Type: ServiceIDType(bytes[0]), - UUID: uuid.UUID(bytes[1:]), - }, nil - } - return EmptyServiceID, fmt.Errorf("invalid ServiceID byte length: %d (expected 16 or 17)", len(bytes)) -} - func ServiceIDFromCFixedBytes(serviceID *C.SignalServiceIdFixedWidthBinaryBytes) ServiceID { var id ServiceID fixedBytes := (*ServiceIDFixedBytes)(unsafe.Pointer(serviceID)) diff --git a/pkg/libsignalgo/session_test.go b/pkg/libsignalgo/session_test.go index dd05718..30af762 100644 --- a/pkg/libsignalgo/session_test.go +++ b/pkg/libsignalgo/session_test.go @@ -30,7 +30,7 @@ import ( "go.mau.fi/mautrix-signal/pkg/libsignalgo" ) -func initializeSessions(t *testing.T, aliceStore, bobStore *InMemorySignalProtocolStore, bobAddress, aliceAddress *libsignalgo.Address) { +func initializeSessions(t *testing.T, aliceStore, bobStore *InMemorySignalProtocolStore, bobAddress *libsignalgo.Address) { ctx := context.TODO() bobPreKey, err := libsignalgo.GeneratePrivateKey() @@ -86,7 +86,7 @@ func initializeSessions(t *testing.T, aliceStore, bobStore *InMemorySignalProtoc assert.NoError(t, err) // Alice processes the bundle - err = libsignalgo.ProcessPreKeyBundle(ctx, bobBundle, bobAddress, aliceAddress, aliceStore, aliceStore) + err = libsignalgo.ProcessPreKeyBundle(ctx, bobBundle, bobAddress, aliceStore, aliceStore) assert.NoError(t, err) record, err := aliceStore.LoadSession(ctx, bobAddress) @@ -132,11 +132,11 @@ func TestSessionCipher(t *testing.T) { aliceStore := NewInMemorySignalProtocolStore() bobStore := NewInMemorySignalProtocolStore() - initializeSessions(t, aliceStore, bobStore, bobAddress, aliceAddress) + initializeSessions(t, aliceStore, bobStore, bobAddress) alicePlaintext := []byte{8, 6, 7, 5, 3, 0, 9} - aliceCiphertext, err := libsignalgo.Encrypt(ctx, alicePlaintext, bobAddress, aliceAddress, aliceStore, aliceStore) + aliceCiphertext, err := libsignalgo.Encrypt(ctx, alicePlaintext, bobAddress, aliceStore, aliceStore) assert.NoError(t, err) aliceCiphertextMessageType, err := aliceCiphertext.MessageType() assert.NoError(t, err) @@ -147,13 +147,13 @@ func TestSessionCipher(t *testing.T) { bobCiphertext, err := libsignalgo.DeserializePreKeyMessage(aliceCiphertextSerialized) assert.NoError(t, err) - bobPlaintext, err := libsignalgo.DecryptPreKey(ctx, bobCiphertext, aliceAddress, bobAddress, bobStore, bobStore, bobStore, bobStore, bobStore) + bobPlaintext, err := libsignalgo.DecryptPreKey(ctx, bobCiphertext, aliceAddress, bobStore, bobStore, bobStore, bobStore, bobStore) assert.NoError(t, err) assert.Equal(t, alicePlaintext, bobPlaintext) bobPlaintext2 := []byte{23} - bobCiphertext2, err := libsignalgo.Encrypt(ctx, bobPlaintext2, aliceAddress, bobAddress, bobStore, bobStore) + bobCiphertext2, err := libsignalgo.Encrypt(ctx, bobPlaintext2, aliceAddress, bobStore, bobStore) assert.NoError(t, err) bobCiphertext2MessageType, err := bobCiphertext2.MessageType() assert.NoError(t, err) @@ -163,7 +163,7 @@ func TestSessionCipher(t *testing.T) { assert.NoError(t, err) aliceCiphertext2, err := libsignalgo.DeserializeMessage(bobCiphertext2Serialized) assert.NoError(t, err) - alicePlaintext2, err := libsignalgo.Decrypt(ctx, aliceCiphertext2, bobAddress, aliceAddress, aliceStore, aliceStore) + alicePlaintext2, err := libsignalgo.Decrypt(ctx, aliceCiphertext2, bobAddress, aliceStore, aliceStore) assert.NoError(t, err) assert.Equal(t, bobPlaintext2, alicePlaintext2) } @@ -183,11 +183,11 @@ func TestSessionCipherWithBadStore(t *testing.T) { aliceStore := NewInMemorySignalProtocolStore() bobStore := &BadInMemorySignalProtocolStore{NewInMemorySignalProtocolStore()} - initializeSessions(t, aliceStore, bobStore.InMemorySignalProtocolStore, bobAddress, aliceAddress) + initializeSessions(t, aliceStore, bobStore.InMemorySignalProtocolStore, bobAddress) alicePlaintext := []byte{8, 6, 7, 5, 3, 0, 9} - aliceCiphertext, err := libsignalgo.Encrypt(ctx, alicePlaintext, bobAddress, aliceAddress, aliceStore, aliceStore) + aliceCiphertext, err := libsignalgo.Encrypt(ctx, alicePlaintext, bobAddress, aliceStore, aliceStore) assert.NoError(t, err) aliceCiphertextMessageType, err := aliceCiphertext.MessageType() assert.NoError(t, err) @@ -198,7 +198,7 @@ func TestSessionCipherWithBadStore(t *testing.T) { bobCiphertext, err := libsignalgo.DeserializePreKeyMessage(aliceCiphertextSerialized) assert.NoError(t, err) t.Skip("This test is broken") // TODO fix - _, err = libsignalgo.DecryptPreKey(ctx, bobCiphertext, aliceAddress, bobAddress, bobStore, bobStore, bobStore, bobStore, bobStore) + _, err = libsignalgo.DecryptPreKey(ctx, bobCiphertext, aliceAddress, bobStore, bobStore, bobStore, bobStore, bobStore) require.Error(t, err) assert.Equal(t, "Test error", err.Error()) } @@ -216,7 +216,7 @@ func TestSealedSenderEncrypt_Repeated(t *testing.T) { aliceStore := NewInMemorySignalProtocolStore() bobStore := NewInMemorySignalProtocolStore() - initializeSessions(t, aliceStore, bobStore, bobAddress, aliceAddress) + initializeSessions(t, aliceStore, bobStore, bobAddress) trustRoot, err := libsignalgo.GenerateIdentityKeyPair() assert.NoError(t, err) @@ -241,7 +241,7 @@ func TestSealedSenderEncrypt_Repeated(t *testing.T) { }() for i := 0; i < 100; i++ { message := []byte(fmt.Sprintf("%04d vision", i)) - ciphertext, err := libsignalgo.SealedSenderEncryptPlaintext(ctx, message, libsignalgo.UnidentifiedSenderMessageContentHintDefault, bobAddress, aliceAddress, senderCert, aliceStore, aliceStore, nil) + ciphertext, err := libsignalgo.SealedSenderEncryptPlaintext(ctx, message, libsignalgo.UnidentifiedSenderMessageContentHintDefault, bobAddress, senderCert, aliceStore, aliceStore) require.NoError(t, err) assert.NotNil(t, ciphertext) } @@ -252,18 +252,15 @@ func TestArchiveSession(t *testing.T) { ctx := context.TODO() setupLogging() - aliceACI := uuid.New() bobACI := uuid.New() - aliceAddress, err := libsignalgo.NewACIServiceID(aliceACI).Address(1) - assert.NoError(t, err) bobAddress, err := libsignalgo.NewACIServiceID(bobACI).Address(1) assert.NoError(t, err) aliceStore := NewInMemorySignalProtocolStore() bobStore := NewInMemorySignalProtocolStore() - initializeSessions(t, aliceStore, bobStore, bobAddress, aliceAddress) + initializeSessions(t, aliceStore, bobStore, bobAddress) session, err := aliceStore.LoadSession(ctx, bobAddress) assert.NoError(t, err) @@ -318,7 +315,7 @@ func TestSealedSenderGroupCipher(t *testing.T) { bobStore := NewInMemorySignalProtocolStore() - initializeSessions(t, aliceStore, bobStore, bobAddress, aliceAddress) + initializeSessions(t, aliceStore, bobStore, bobAddress) trustRoot, err := libsignalgo.GenerateIdentityKeyPair() assert.NoError(t, err) diff --git a/pkg/libsignalgo/sessionrecord.go b/pkg/libsignalgo/sessionrecord.go index b4f2afb..a2ee9dd 100644 --- a/pkg/libsignalgo/sessionrecord.go +++ b/pkg/libsignalgo/sessionrecord.go @@ -83,9 +83,6 @@ func (sr *SessionRecord) ArchiveCurrentState() error { } func (sr *SessionRecord) CurrentRatchetKeyMatches(key *PublicKey) (bool, error) { - if sr == nil || key == nil { - return false, nil - } var result C.bool signalFfiError := C.signal_session_record_current_ratchet_key_matches( &result, diff --git a/pkg/libsignalgo/sessionstore.go b/pkg/libsignalgo/sessionstore.go index 99000e5..da430c1 100644 --- a/pkg/libsignalgo/sessionstore.go +++ b/pkg/libsignalgo/sessionstore.go @@ -20,9 +20,11 @@ package libsignalgo /* #include "./libsignal-ffi.h" -extern int signal_load_session_callback(void *store_ctx, SignalMutPointerSessionRecord *recordp, SignalMutPointerProtocolAddress address); -extern int signal_store_session_callback(void *store_ctx, SignalMutPointerProtocolAddress address, SignalMutPointerSessionRecord record); -extern void signal_destroy_session_store_callback(void *store_ctx); +typedef const SignalSessionRecord const_session_record; +typedef const SignalProtocolAddress const_address; + +extern int signal_load_session_callback(void *store_ctx, SignalSessionRecord **recordp, const_address *address); +extern int signal_store_session_callback(void *store_ctx, const_address *address, const_session_record *record); */ import "C" import ( @@ -36,39 +38,33 @@ type SessionStore interface { } //export signal_load_session_callback -func signal_load_session_callback(storeCtx unsafe.Pointer, recordp *C.SignalMutPointerSessionRecord, address C.SignalMutPointerProtocolAddress) C.int { +func signal_load_session_callback(storeCtx unsafe.Pointer, recordp **C.SignalSessionRecord, address *C.const_address) C.int { return wrapStoreCallback(storeCtx, func(store SessionStore, ctx context.Context) error { - record, err := store.LoadSession(ctx, &Address{ptr: address.raw}) + record, err := store.LoadSession(ctx, &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))}) if err == nil && record != nil { record.CancelFinalizer() - recordp.raw = record.ptr + *recordp = record.ptr } return err }) } //export signal_store_session_callback -func signal_store_session_callback(storeCtx unsafe.Pointer, address C.SignalMutPointerProtocolAddress, sessionRecord C.SignalMutPointerSessionRecord) C.int { +func signal_store_session_callback(storeCtx unsafe.Pointer, address *C.const_address, sessionRecord *C.const_session_record) C.int { return wrapStoreCallback(storeCtx, func(store SessionStore, ctx context.Context) error { - record := SessionRecord{ptr: sessionRecord.raw} + record := SessionRecord{ptr: (*C.SignalSessionRecord)(unsafe.Pointer(sessionRecord))} cloned, err := record.Clone() if err != nil { return err } - return store.StoreSession(ctx, &Address{ptr: address.raw}, cloned) + return store.StoreSession(ctx, &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))}, cloned) }) } -//export signal_destroy_session_store_callback -func signal_destroy_session_store_callback(storeCtx unsafe.Pointer) { - // No-op: Go's garbage collector handles cleanup -} - func (ctx *CallbackContext) wrapSessionStore(store SessionStore) C.SignalConstPointerFfiSessionStoreStruct { return C.SignalConstPointerFfiSessionStoreStruct{&C.SignalSessionStore{ ctx: wrapStore(ctx, store), - load_session: C.SignalFfiSessionStoreLoadSession(C.signal_load_session_callback), - store_session: C.SignalFfiSessionStoreStoreSession(C.signal_store_session_callback), - destroy: C.SignalFfiSessionStoreDestroy(C.signal_destroy_session_store_callback), + load_session: C.SignalLoadSession(C.signal_load_session_callback), + store_session: C.SignalStoreSession(C.signal_store_session_callback), }} } diff --git a/pkg/libsignalgo/setup_test.go b/pkg/libsignalgo/setup_test.go index 47d7d77..c22149d 100644 --- a/pkg/libsignalgo/setup_test.go +++ b/pkg/libsignalgo/setup_test.go @@ -54,8 +54,6 @@ func (FFILogger) Log(level libsignalgo.LogLevel, file string, line uint, message func (FFILogger) Flush() {} -func (FFILogger) Destroy() {} - var loggingSetup = false func setupLogging() { diff --git a/pkg/libsignalgo/signedprekeystore.go b/pkg/libsignalgo/signedprekeystore.go index b1306e2..b595578 100644 --- a/pkg/libsignalgo/signedprekeystore.go +++ b/pkg/libsignalgo/signedprekeystore.go @@ -20,9 +20,10 @@ package libsignalgo /* #include "./libsignal-ffi.h" -extern int signal_load_signed_pre_key_callback(void *store_ctx, SignalMutPointerSignedPreKeyRecord *recordp, uint32_t id); -extern int signal_store_signed_pre_key_callback(void *store_ctx, uint32_t id, SignalMutPointerSignedPreKeyRecord record); -extern void signal_destroy_signed_pre_key_store_callback(void *store_ctx); +typedef const SignalSignedPreKeyRecord const_signed_pre_key_record; + +extern int signal_load_signed_pre_key_callback(void *store_ctx, SignalSignedPreKeyRecord **recordp, uint32_t id); +extern int signal_store_signed_pre_key_callback(void *store_ctx, uint32_t id, const_signed_pre_key_record *record); */ import "C" import ( @@ -36,21 +37,21 @@ type SignedPreKeyStore interface { } //export signal_load_signed_pre_key_callback -func signal_load_signed_pre_key_callback(storeCtx unsafe.Pointer, keyp *C.SignalMutPointerSignedPreKeyRecord, id C.uint32_t) C.int { +func signal_load_signed_pre_key_callback(storeCtx unsafe.Pointer, keyp **C.SignalSignedPreKeyRecord, id C.uint32_t) C.int { return wrapStoreCallback(storeCtx, func(store SignedPreKeyStore, ctx context.Context) error { key, err := store.LoadSignedPreKey(ctx, uint32(id)) if err == nil && key != nil { key.CancelFinalizer() - keyp.raw = key.ptr + *keyp = key.ptr } return err }) } //export signal_store_signed_pre_key_callback -func signal_store_signed_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t, preKeyRecord C.SignalMutPointerSignedPreKeyRecord) C.int { +func signal_store_signed_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t, preKeyRecord *C.const_signed_pre_key_record) C.int { return wrapStoreCallback(storeCtx, func(store SignedPreKeyStore, ctx context.Context) error { - record := SignedPreKeyRecord{ptr: preKeyRecord.raw} + record := SignedPreKeyRecord{ptr: (*C.SignalSignedPreKeyRecord)(unsafe.Pointer(preKeyRecord))} cloned, err := record.Clone() if err != nil { return err @@ -59,16 +60,10 @@ func signal_store_signed_pre_key_callback(storeCtx unsafe.Pointer, id C.uint32_t }) } -//export signal_destroy_signed_pre_key_store_callback -func signal_destroy_signed_pre_key_store_callback(storeCtx unsafe.Pointer) { - // No-op: Go's garbage collector handles cleanup -} - func (ctx *CallbackContext) wrapSignedPreKeyStore(store SignedPreKeyStore) C.SignalConstPointerFfiSignedPreKeyStoreStruct { return C.SignalConstPointerFfiSignedPreKeyStoreStruct{&C.SignalSignedPreKeyStore{ ctx: wrapStore(ctx, store), - load_signed_pre_key: C.SignalFfiSignedPreKeyStoreLoadSignedPreKey(C.signal_load_signed_pre_key_callback), - store_signed_pre_key: C.SignalFfiSignedPreKeyStoreStoreSignedPreKey(C.signal_store_signed_pre_key_callback), - destroy: C.SignalFfiSignedPreKeyStoreDestroy(C.signal_destroy_signed_pre_key_store_callback), + load_signed_pre_key: C.SignalLoadSignedPreKey(C.signal_load_signed_pre_key_callback), + store_signed_pre_key: C.SignalStoreSignedPreKey(C.signal_store_signed_pre_key_callback), }} } diff --git a/pkg/libsignalgo/update-ffi-docker-inner.sh b/pkg/libsignalgo/update-ffi-docker-inner.sh index e343887..7641701 100755 --- a/pkg/libsignalgo/update-ffi-docker-inner.sh +++ b/pkg/libsignalgo/update-ffi-docker-inner.sh @@ -1,7 +1,7 @@ #!/bin/sh cd /data export RUSTFLAGS="-Ctarget-feature=-crt-static" RUSTC_WRAPPER="" -apk add --no-cache git make cmake protobuf-dev musl-dev g++ clang-dev cbindgen +apk add --no-cache git make cmake protoc musl-dev g++ clang-dev cbindgen cd libsignal cargo build -p libsignal-ffi --release cbindgen --profile release rust/bridge/ffi -o libsignal-ffi.h diff --git a/pkg/libsignalgo/version.go b/pkg/libsignalgo/version.go index 1f7e94d..b859d49 100644 --- a/pkg/libsignalgo/version.go +++ b/pkg/libsignalgo/version.go @@ -2,4 +2,4 @@ package libsignalgo -const Version = "v0.93.2" +const Version = "v0.84.0" diff --git a/pkg/msgconv/from-matrix.go b/pkg/msgconv/from-matrix.go index a334afd..9af4dc5 100644 --- a/pkg/msgconv/from-matrix.go +++ b/pkg/msgconv/from-matrix.go @@ -44,6 +44,7 @@ func (mc *MessageConverter) ToSignal( portal *bridgev2.Portal, evt *event.Event, content *event.MessageEventContent, + timestamp uint64, relaybotFormatted bool, replyTo *database.Message, ) (*signalpb.DataMessage, error) { @@ -54,15 +55,16 @@ func (mc *MessageConverter) ToSignal( } dm := &signalpb.DataMessage{ - Preview: mc.convertURLPreviewToSignal(ctx, content), + Timestamp: ×tamp, + Preview: mc.convertURLPreviewToSignal(ctx, content), } if replyTo != nil { authorACI, messageID, err := signalid.ParseMessageID(replyTo.ID) if err == nil { dm.Quote = &signalpb.DataMessage_Quote{ - Id: proto.Uint64(messageID), - AuthorAciBinary: authorACI[:], - Type: signalpb.DataMessage_Quote_NORMAL.Enum(), + Id: proto.Uint64(messageID), + AuthorAci: proto.String(authorACI.String()), + Type: signalpb.DataMessage_Quote_NORMAL.Enum(), } if replyTo.Metadata.(*signalid.MessageMetadata).ContainsAttachments { dm.Quote.Attachments = make([]*signalpb.DataMessage_Quote_QuotedAttachment, 1) @@ -110,24 +112,21 @@ func (mc *MessageConverter) ToSignal( return nil, fmt.Errorf("failed to convert sticker: %w", err) } att.Flags = proto.Uint32(uint32(signalpb.AttachmentPointer_BORDERLESS)) - - dm.Sticker = ParseStickerMeta(content.Info.BridgedSticker) - if dm.Sticker == nil { - var emoji *string - // TODO check for single grapheme cluster? - if len([]rune(content.Body)) == 1 { - emoji = proto.String(variationselector.Remove(content.Body)) - } - dm.Sticker = &signalpb.DataMessage_Sticker{ - // Signal iOS validates that pack id/key are of the correct length. - // Android is fine with any non-nil values (like a zero-length byte string). - PackId: make([]byte, 16), - PackKey: make([]byte, 32), - StickerId: proto.Uint32(0), - Emoji: emoji, - } + var emoji *string + // TODO check for single grapheme cluster? + if len([]rune(content.Body)) == 1 { + emoji = proto.String(variationselector.Remove(content.Body)) + } + dm.Sticker = &signalpb.DataMessage_Sticker{ + // Signal iOS validates that pack id/key are of the correct length. + // Android is fine with any non-nil values (like a zero-length byte string). + PackId: make([]byte, 16), + PackKey: make([]byte, 32), + StickerId: proto.Uint32(0), + + Data: att, + Emoji: emoji, } - dm.Sticker.Data = att case event.MsgLocation: lat, lon, err := parseGeoURI(content.GeoURI) if err != nil { diff --git a/pkg/msgconv/from-signal-backup.go b/pkg/msgconv/from-signal-backup.go index 978c6a6..7e8d4e1 100644 --- a/pkg/msgconv/from-signal-backup.go +++ b/pkg/msgconv/from-signal-backup.go @@ -81,16 +81,6 @@ func BackupToDataMessage(ci *backuppb.ChatItem, attMap AttachmentMap) (*signalpb Emoji: ti.StickerMessage.Sticker.Emoji, Data: backupToSignalAttachment(ti.StickerMessage.Sticker.Data, 0, uuid.New(), attMap), } - case *backuppb.ChatItem_Poll: - dm.PollCreate = &signalpb.DataMessage_PollCreate{ - Question: &ti.Poll.Question, - AllowMultiple: &ti.Poll.AllowMultiple, - Options: exslices.CastFunc(ti.Poll.Options, func(from *backuppb.Poll_PollOption) string { - return from.Option - }), - } - // TODO handle votes - // TODO handle hasEnded somehow? case *backuppb.ChatItem_RemoteDeletedMessage: // TODO handle some other way? (also disappeared view-once messages) return nil, nil @@ -248,7 +238,11 @@ func backupToSignalBodyRange(from *backuppb.BodyRange) *signalpb.BodyRange { out.Length = &from.Length switch av := from.AssociatedValue.(type) { case *backuppb.BodyRange_MentionAci: - out.AssociatedValue = &signalpb.BodyRange_MentionAciBinary{MentionAciBinary: av.MentionAci} + // TODO confirm this is correct + if len(av.MentionAci) != 16 { + return nil + } + out.AssociatedValue = &signalpb.BodyRange_MentionAci{MentionAci: uuid.UUID(av.MentionAci).String()} case *backuppb.BodyRange_Style_: out.AssociatedValue = &signalpb.BodyRange_Style_{Style: signalpb.BodyRange_Style(av.Style)} } diff --git a/pkg/msgconv/from-signal.go b/pkg/msgconv/from-signal.go index defbe44..277e2a5 100644 --- a/pkg/msgconv/from-signal.go +++ b/pkg/msgconv/from-signal.go @@ -22,10 +22,7 @@ import ( "encoding/base64" "errors" "fmt" - "io" "net/http" - "os" - "strconv" "strings" "time" @@ -54,7 +51,7 @@ func calculateLength(dm *signalpb.DataMessage) int { if dm.GetFlags()&uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE) != 0 { return 1 } - if dm.Sticker != nil || dm.PollVote != nil || dm.PollCreate != nil || dm.PollTerminate != nil { + if dm.Sticker != nil { return 1 } length := len(dm.Attachments) + len(dm.Contact) @@ -78,13 +75,11 @@ func CanConvertSignal(dm *signalpb.DataMessage) bool { } const ViewOnceDisappearTimer = 5 * time.Minute -const matrixTextMaxLength = 30000 // approximate value to avoid hitting 64 KiB PDU size limit with HTML duplication func (mc *MessageConverter) ToMatrix( ctx context.Context, client *signalmeow.Client, portal *bridgev2.Portal, - sender uuid.UUID, intent bridgev2.MatrixAPI, dm *signalpb.DataMessage, attMap AttachmentMap, @@ -113,20 +108,8 @@ func (mc *MessageConverter) ToMatrix( // Don't allow any other parts in a sticker message return cm } - if dm.PollVote != nil { - cm.Parts = append(cm.Parts, mc.convertPollVoteToMatrix(ctx, dm.PollVote)) - return cm - } - if dm.PollCreate != nil { - cm.Parts = append(cm.Parts, mc.convertPollCreateToMatrix(dm.PollCreate)) - return cm - } - if dm.PollTerminate != nil { - cm.Parts = append(cm.Parts, mc.convertPollTerminateToMatrix(ctx, sender, dm.PollTerminate)) - return cm - } for i, att := range dm.GetAttachments() { - if att.GetContentType() != "text/x-signal-plain" || att.GetSize() > matrixTextMaxLength { + if att.GetContentType() != "text/x-signal-plain" { cm.Parts = append(cm.Parts, mc.convertAttachmentToMatrix(ctx, i, att, attMap)) } else { longBody, err := mc.downloadSignalLongText(ctx, att, attMap) @@ -177,12 +160,9 @@ func (mc *MessageConverter) ToMatrix( } } if dm.Quote != nil { - authorACI, err := signalmeow.ParseStringOrBinaryUUID(dm.Quote.GetAuthorAci(), dm.Quote.GetAuthorAciBinary()) + authorACI, err := uuid.Parse(dm.Quote.GetAuthorAci()) if err != nil { - zerolog.Ctx(ctx).Err(err). - Str("author_aci", dm.Quote.GetAuthorAci()). - Hex("author_aci_binary", dm.Quote.GetAuthorAciBinary()). - Msg("Failed to parse quote author ACI") + zerolog.Ctx(ctx).Err(err).Str("author_aci", dm.Quote.GetAuthorAci()).Msg("Failed to parse quote author ACI") } else { cm.ReplyTo = &networkid.MessageOptionalPartID{ MessageID: signalid.MakeMessageID(authorACI, dm.Quote.GetId()), @@ -343,7 +323,7 @@ func (mc *MessageConverter) convertContactToVCard(ctx context.Context, contact * card.Add(vcard.FieldTelephone, &field) } if contact.GetAvatar().GetAvatar() != nil { - avatarData, err := mc.downloadAttachment(ctx, contact.GetAvatar().GetAvatar(), attMap, nil) + avatarData, err := mc.downloadAttachment(ctx, contact.GetAvatar().GetAvatar(), attMap) if err != nil { zerolog.Ctx(ctx).Err(err).Msg("Failed to download contact avatar") } else { @@ -461,28 +441,31 @@ func (mc *MessageConverter) convertStickerToMatrix(ctx context.Context, sticker }, } } - // Signal stickers are 512x512, so tell Matrix clients to render them as 200x200 to match Signal - // https://github.com/signalapp/Signal-Desktop/blob/v7.77.0-beta.1/ts/components/conversation/Message.dom.tsx#L135 + // Signal stickers are 512x512, so tell Matrix clients to render them as 256x256 if converted.Content.Info.Width == 512 && converted.Content.Info.Height == 512 { - converted.Content.Info.Width = 200 - converted.Content.Info.Height = 200 + converted.Content.Info.Width = 256 + converted.Content.Info.Height = 256 } converted.Content.Body = sticker.GetEmoji() - if len(sticker.GetPackId()) == PackIDLength && len(sticker.GetPackKey()) == PackKeyLength && !bytes.Equal(sticker.GetPackId(), zeroPackID) { - converted.Content.Info.BridgedSticker = &event.BridgedSticker{ - Network: StickerSourceID, - ID: strconv.FormatUint(uint64(sticker.GetStickerId()), 10), - Emoji: sticker.GetEmoji(), - PackURL: fmt.Sprintf(PackURLFormat, sticker.GetPackId(), sticker.GetPackKey()), - } - } converted.Type = event.EventSticker converted.Content.MsgType = "" + if converted.Extra == nil { + converted.Extra = map[string]any{} + } + // TODO fetch full pack metadata like the old bridge did? + converted.Extra["fi.mau.signal.sticker"] = map[string]any{ + "id": sticker.GetStickerId(), + "emoji": sticker.GetEmoji(), + "pack": map[string]any{ + "id": sticker.GetPackId(), + "key": sticker.GetPackKey(), + }, + } return converted } func (mc *MessageConverter) downloadSignalLongText(ctx context.Context, att *signalpb.AttachmentPointer, attMap AttachmentMap) (*string, error) { - data, err := mc.downloadAttachment(ctx, att, attMap, nil) + data, err := mc.downloadAttachment(ctx, att, attMap) if err != nil { return nil, err } @@ -508,9 +491,7 @@ func checkIfAttachmentExists(att *signalpb.AttachmentPointer, attMap AttachmentM return nil } -func (mc *MessageConverter) downloadAttachment( - ctx context.Context, att *signalpb.AttachmentPointer, attMap AttachmentMap, into *os.File, -) ([]byte, error) { +func (mc *MessageConverter) downloadAttachment(ctx context.Context, att *signalpb.AttachmentPointer, attMap AttachmentMap) ([]byte, error) { if err := checkIfAttachmentExists(att, attMap); err != nil { return nil, err } @@ -521,19 +502,19 @@ func (mc *MessageConverter) downloadAttachment( plaintextHash = target.GetPlaintextHash() } } - return signalmeow.DownloadAttachmentWithPointer(ctx, att, plaintextHash, into) + return signalmeow.DownloadAttachmentWithPointer(ctx, att, plaintextHash) } func (mc *MessageConverter) reuploadAttachment(ctx context.Context, att *signalpb.AttachmentPointer, attMap AttachmentMap) (*bridgev2.ConvertedMessagePart, error) { + fileName := att.GetFileName() content := &event.MessageEventContent{ - Body: att.GetFileName(), Info: &event.FileInfo{ - MimeType: att.GetContentType(), - Width: int(att.GetWidth()), - Height: int(att.GetHeight()), - Size: int(att.GetSize()), + Width: int(att.GetWidth()), + Height: int(att.GetHeight()), + Size: int(att.GetSize()), }, } + mimeType := att.GetContentType() if err := checkIfAttachmentExists(att, attMap); err != nil { return nil, err } else if mc.DirectMedia { @@ -560,7 +541,25 @@ func (mc *MessageConverter) reuploadAttachment(ctx context.Context, att *signalp } content.URL, err = mc.Bridge.Matrix.GenerateContentURI(ctx, mediaID) } else { - err = mc.actuallyReuploadAttachment(ctx, content, att, attMap) + data, err := mc.downloadAttachment(ctx, att, attMap) + if err != nil { + return nil, err + } + if mimeType == "" { + mimeType = http.DetectContentType(data) + } + if att.GetFlags()&uint32(signalpb.AttachmentPointer_VOICE_MESSAGE) != 0 && ffmpeg.Supported() { + data, err = ffmpeg.ConvertBytes(ctx, data, ".ogg", []string{}, []string{"-c:a", "libopus"}, mimeType) + if err != nil { + return nil, fmt.Errorf("failed to convert audio to ogg/opus: %w", err) + } + fileName += ".ogg" + mimeType = "audio/ogg" + content.MSC3245Voice = &event.MSC3245Voice{} + // TODO include duration here (and in info) if there's some easy way to extract it with ffmpeg + //content.MSC1767Audio = &event.MSC1767Audio{} + } + content.URL, content.File, err = getIntent(ctx).UploadMedia(ctx, getPortal(ctx).MXID, data, fileName, mimeType) if err != nil { return nil, err } @@ -569,7 +568,7 @@ func (mc *MessageConverter) reuploadAttachment(ctx context.Context, att *signalp content.Info.Blurhash = att.GetBlurHash() content.Info.AnoaBlurhash = att.GetBlurHash() } - switch strings.Split(content.Info.MimeType, "/")[0] { + switch strings.Split(mimeType, "/")[0] { case "image": content.MsgType = event.MsgImage case "video": @@ -591,8 +590,10 @@ func (mc *MessageConverter) reuploadAttachment(ctx context.Context, att *signalp }, } } + content.Body = fileName + content.Info.MimeType = mimeType if content.Body == "" { - content.Body = strings.TrimPrefix(string(content.MsgType), "m.") + exmime.ExtensionFromMimetype(content.Info.MimeType) + content.Body = strings.TrimPrefix(string(content.MsgType), "m.") + exmime.ExtensionFromMimetype(mimeType) } return &bridgev2.ConvertedMessagePart{ Type: event.EventMessage, @@ -600,186 +601,3 @@ func (mc *MessageConverter) reuploadAttachment(ctx context.Context, att *signalp Extra: extra, }, nil } - -func (mc *MessageConverter) actuallyReuploadAttachment( - ctx context.Context, - content *event.MessageEventContent, - att *signalpb.AttachmentPointer, - attMap AttachmentMap, -) (err error) { - convertVoice := att.GetFlags()&uint32(signalpb.AttachmentPointer_VOICE_MESSAGE) != 0 && ffmpeg.Supported() - requireFile := convertVoice - content.URL, content.File, err = getIntent(ctx).UploadMediaStream(ctx, getPortal(ctx).MXID, int64(att.GetSize()), requireFile, func(file io.Writer) (*bridgev2.FileStreamResult, error) { - osFile, ok := file.(*os.File) - inMemData, err := mc.downloadAttachment(ctx, att, attMap, osFile) - if err != nil { - return nil, err - } else if !ok { - if content.Info.MimeType == "" { - content.Info.MimeType = http.DetectContentType(inMemData) - } - _, err = file.Write(inMemData) - return &bridgev2.FileStreamResult{ - FileName: content.Body, - MimeType: content.Info.MimeType, - }, err - } - if content.Info.MimeType == "" { - header := make([]byte, 512) - _, err = osFile.ReadAt(header, 0) - if err != nil { - return nil, fmt.Errorf("failed to read file header for MIME type detection: %w", err) - } else { - content.Info.MimeType = http.DetectContentType(header) - } - } - var replFile string - if att.GetFlags()&uint32(signalpb.AttachmentPointer_VOICE_MESSAGE) != 0 && ffmpeg.Supported() { - replFile, err = ffmpeg.ConvertPath(ctx, osFile.Name(), ".ogg", []string{}, []string{"-c:a", "libopus"}, true) - if err != nil { - return nil, fmt.Errorf("failed to convert audio to ogg/opus: %w", err) - } - if content.Body == "" { - content.Body = "Voice message.ogg" - } else { - content.Body += ".ogg" - } - content.Info.MimeType = "audio/ogg" - content.MSC3245Voice = &event.MSC3245Voice{} - // TODO include duration here (and in info) if there's some easy way to extract it with ffmpeg - //content.MSC1767Audio = &event.MSC1767Audio{} - } - return &bridgev2.FileStreamResult{ - ReplacementFile: replFile, - FileName: content.Body, - MimeType: content.Info.MimeType, - }, nil - }) - return -} - -func (mc *MessageConverter) convertPollCreateToMatrix(create *signalpb.DataMessage_PollCreate) *bridgev2.ConvertedMessagePart { - evtType := event.EventMessage - if mc.ExtEvPolls { - evtType = event.EventUnstablePollStart - } - maxChoices := 1 - if create.GetAllowMultiple() { - maxChoices = len(create.GetOptions()) - } - msc3381Answers := make([]map[string]any, len(create.GetOptions())) - optionsListText := make([]string, len(create.GetOptions())) - optionsListHTML := make([]string, len(create.GetOptions())) - for i, option := range create.GetOptions() { - msc3381Answers[i] = map[string]any{ - "id": strconv.Itoa(i), - "org.matrix.msc1767.text": option, - } - optionsListText[i] = fmt.Sprintf("%d. %s\n", i+1, option) - optionsListHTML[i] = fmt.Sprintf("
  • %s
  • ", event.TextToHTML(option)) - } - body := fmt.Sprintf("%s\n\n%s\n\n(This message is a poll. Please open Signal to vote.)", create.GetQuestion(), strings.Join(optionsListText, "\n")) - formattedBody := fmt.Sprintf("

    %s

      %s

    (This message is a poll. Please open Signal to vote.)

    ", event.TextToHTML(create.GetQuestion()), strings.Join(optionsListHTML, "")) - return &bridgev2.ConvertedMessagePart{ - Type: evtType, - Content: &event.MessageEventContent{ - MsgType: event.MsgText, - Body: body, - Format: event.FormatHTML, - FormattedBody: formattedBody, - }, - Extra: map[string]any{ - "fi.mau.signal.poll": map[string]any{ - "question": create.GetQuestion(), - "allow_multiple": create.GetAllowMultiple(), - "options": create.GetOptions(), - }, - "org.matrix.msc1767.message": []map[string]any{ - {"mimetype": "text/html", "body": formattedBody}, - {"mimetype": "text/plain", "body": body}, - }, - "org.matrix.msc3381.poll.start": map[string]any{ - "kind": "org.matrix.msc3381.poll.disclosed", - "max_selections": maxChoices, - "question": map[string]any{ - "org.matrix.msc1767.text": create.GetQuestion(), - }, - "answers": msc3381Answers, - }, - }, - DBMetadata: nil, - DontBridge: false, - } -} - -func (mc *MessageConverter) convertPollTerminateToMatrix(ctx context.Context, senderACI uuid.UUID, terminate *signalpb.DataMessage_PollTerminate) *bridgev2.ConvertedMessagePart { - pollMessageID := signalid.MakeMessageID(senderACI, terminate.GetTargetSentTimestamp()) - pollMessage, err := mc.Bridge.DB.Message.GetPartByID(ctx, getPortal(ctx).Receiver, pollMessageID, "") - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get poll terminate target message") - return &bridgev2.ConvertedMessagePart{ - Type: event.EventUnstablePollEnd, - Content: &event.MessageEventContent{}, - DontBridge: true, - } - } - return &bridgev2.ConvertedMessagePart{ - Type: event.EventUnstablePollEnd, - Content: &event.MessageEventContent{ - RelatesTo: &event.RelatesTo{ - Type: event.RelReference, - EventID: pollMessage.MXID, - }, - }, - Extra: map[string]any{ - "org.matrix.msc3381.poll.end": map[string]any{}, - }, - } -} - -var invalidPollVote = &bridgev2.ConvertedMessagePart{ - Type: event.EventUnstablePollResponse, - Content: &event.MessageEventContent{}, - DontBridge: true, -} - -func (mc *MessageConverter) convertPollVoteToMatrix(ctx context.Context, vote *signalpb.DataMessage_PollVote) *bridgev2.ConvertedMessagePart { - if len(vote.GetTargetAuthorAciBinary()) != 16 { - zerolog.Ctx(ctx).Debug(). - Str("author_aci_b64", base64.StdEncoding.EncodeToString(vote.GetTargetAuthorAciBinary())). - Msg("Invalid author ACI in poll vote") - return invalidPollVote - } - pollMessageID := signalid.MakeMessageID(uuid.UUID(vote.GetTargetAuthorAciBinary()), vote.GetTargetSentTimestamp()) - pollMessage, err := mc.Bridge.DB.Message.GetPartByID(ctx, getPortal(ctx).Receiver, pollMessageID, "") - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get poll vote target message") - return invalidPollVote - } else if pollMessage == nil { - zerolog.Ctx(ctx).Warn().Msg("Poll vote target message not found") - return invalidPollVote - } - mxOptionIDs := pollMessage.Metadata.(*signalid.MessageMetadata).MatrixPollOptionIDs - optionIDs := make([]string, len(vote.GetOptionIndexes())) - for i, optionIndex := range vote.GetOptionIndexes() { - if int(optionIndex) < len(mxOptionIDs) { - optionIDs[i] = mxOptionIDs[optionIndex] - } else { - optionIDs[i] = strconv.Itoa(int(optionIndex)) - } - } - return &bridgev2.ConvertedMessagePart{ - Type: event.EventUnstablePollResponse, - Content: &event.MessageEventContent{ - RelatesTo: &event.RelatesTo{ - Type: event.RelReference, - EventID: pollMessage.MXID, - }, - }, - Extra: map[string]any{ - "org.matrix.msc3381.poll.response": map[string]any{ - "answers": optionIDs, - }, - }, - } -} diff --git a/pkg/msgconv/imagepack.go b/pkg/msgconv/imagepack.go deleted file mode 100644 index a2529af..0000000 --- a/pkg/msgconv/imagepack.go +++ /dev/null @@ -1,199 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2026 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package msgconv - -import ( - "bytes" - "context" - "encoding/hex" - "fmt" - "net/url" - "strconv" - "strings" - - "go.mau.fi/util/emojishortcodes" - "google.golang.org/protobuf/proto" - "maunium.net/go/mautrix" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/database" - "maunium.net/go/mautrix/event" - "maunium.net/go/mautrix/id" - - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" -) - -const StickerSourceID = "signal" -const PackURLFormat = "https://signal.art/addstickers/#pack_id=%x&pack_key=%x" - -const PackIDLength = 16 -const PackKeyLength = 32 -const PackURLLength = len(PackURLFormat) - len("%x")*2 + PackIDLength*2 + PackKeyLength*2 - -var zeroPackID = make([]byte, PackIDLength) - -func ParseStickerMeta(info *event.BridgedSticker) *signalpb.DataMessage_Sticker { - if info == nil || info.Network != StickerSourceID || len(info.PackURL) != PackURLLength { - return nil - } - stickerID, err := strconv.ParseUint(info.ID, 10, 32) - if err != nil { - return nil - } - packID, packKey, err := parsePackURL(info.PackURL) - if err != nil || len(packID) != PackIDLength || len(packKey) != PackKeyLength || bytes.Equal(packID, zeroPackID) { - return nil - } - return &signalpb.DataMessage_Sticker{ - PackId: packID, - PackKey: packKey, - StickerId: proto.Uint32(uint32(stickerID)), - Emoji: &info.Emoji, - } -} - -func parsePackURL(rawURL string) (packID, packKey []byte, err error) { - parsed, err := url.Parse(rawURL) - if err != nil { - return nil, nil, fmt.Errorf("invalid URL: %w", err) - } else if parsed.Host != "signal.art" || !strings.HasPrefix(parsed.Path, "/addstickers") { - return nil, nil, fmt.Errorf("invalid host or path in URL") - } - q, err := url.ParseQuery(parsed.Fragment) - if err != nil { - return nil, nil, fmt.Errorf("invalid URL fragment: %w", err) - } - packID, err = hex.DecodeString(q.Get("pack_id")) - if err != nil { - return nil, nil, fmt.Errorf("invalid pack ID in URL: %w", err) - } - packKey, err = hex.DecodeString(q.Get("pack_key")) - if err != nil { - return nil, nil, fmt.Errorf("invalid pack key in URL: %w", err) - } - return -} - -func (mc *MessageConverter) DownloadImagePack(ctx context.Context, url string) (*bridgev2.ImportedImagePack, error) { - packID, packKey, err := parsePackURL(url) - if err != nil { - return nil, bridgev2.WrapRespErr(err, mautrix.MNotFound) - } - manifest, err := signalmeow.DownloadStickerPackManifest(ctx, packID, packKey) - if err != nil { - return nil, fmt.Errorf("failed to download sticker pack manifest: %w", err) - } - topLevelExtra := map[string]any{ - "fi.mau.signal.stickerpack": map[string]any{ - "pack_id": hex.EncodeToString(packID), - "pack_key": hex.EncodeToString(packKey), - }, - } - content := &event.ImagePackEventContent{ - Images: make(map[string]*event.ImagePackImage, len(manifest.Stickers)), - Metadata: event.ImagePackMetadata{ - DisplayName: manifest.GetTitle(), - AvatarURL: "", - Usage: []event.ImagePackUsage{event.ImagePackUsageSticker}, - Attribution: manifest.GetAuthor(), - BridgedPack: &event.BridgedStickerPack{ - Network: StickerSourceID, - URL: fmt.Sprintf(PackURLFormat, packID, packKey), - }, - }, - } - imagesByID := make(map[uint32]id.ContentURIString, len(manifest.Stickers)) - uploadImage := func(sticker *signalpb.Pack_Sticker) (id.ContentURIString, error) { - stickerID := sticker.GetId() - existing, ok := imagesByID[stickerID] - if ok { - return existing, nil - } - var mxc id.ContentURIString - if mc.DirectMedia { - mediaID, err := signalid.DirectMediaSticker{ - PackID: packID, - PackKey: packKey, - StickerID: stickerID, - }.AsMediaID() - if err != nil { - return "", fmt.Errorf("failed to create media ID for sticker %d: %w", stickerID, err) - } - mxc, err = mc.Bridge.Matrix.GenerateContentURI(ctx, mediaID) - if err != nil { - return "", fmt.Errorf("failed to generate content URI for sticker %d: %w", stickerID, err) - } - } else { - dbKey := database.Key(fmt.Sprintf("stickercache:%x:%d", packID, stickerID)) - if cached := mc.Bridge.DB.KV.Get(ctx, dbKey); cached != "" { - mxc = id.ContentURIString(cached) - imagesByID[stickerID] = mxc - return mxc, nil - } - data, err := signalmeow.DownloadStickerPackItem(ctx, packID, packKey, stickerID) - if err != nil { - return "", fmt.Errorf("failed to download sticker %d: %w", stickerID, err) - } - mxc, _, err = mc.Bridge.Bot.UploadMedia(ctx, "", data, "", sticker.GetContentType()) - if err != nil { - return "", fmt.Errorf("failed to upload sticker %d: %w", stickerID, err) - } - mc.Bridge.DB.KV.Set(ctx, dbKey, string(mxc)) - } - imagesByID[stickerID] = mxc - return mxc, nil - } - for _, sticker := range manifest.Stickers { - mxc, err := uploadImage(sticker) - if err != nil { - return nil, err - } - shortcode := emojishortcodes.Get(sticker.GetEmoji()) - realShortcode := shortcode - i := 2 - for _, alreadyExists := content.Images[realShortcode]; alreadyExists; i++ { - realShortcode = fmt.Sprintf("%s_%d", shortcode, i) - } - content.Images[realShortcode] = &event.ImagePackImage{ - URL: mxc, - Body: sticker.GetEmoji(), - Info: &event.FileInfo{ - MimeType: sticker.GetContentType(), - Width: 200, - Height: 200, - BridgedSticker: &event.BridgedSticker{ - Network: StickerSourceID, - ID: strconv.FormatUint(uint64(sticker.GetId()), 10), - Emoji: sticker.GetEmoji(), - PackURL: content.Metadata.BridgedPack.URL, - }, - }, - } - } - if manifest.Cover != nil { - content.Metadata.AvatarURL, err = uploadImage(manifest.Cover) - if err != nil { - return nil, fmt.Errorf("failed to upload sticker pack cover: %w", err) - } - } - return &bridgev2.ImportedImagePack{ - Content: content, - Extra: topLevelExtra, - Shortcode: hex.EncodeToString(packID), - }, nil -} diff --git a/pkg/msgconv/msgconv.go b/pkg/msgconv/msgconv.go index e312a1f..86e7e2d 100644 --- a/pkg/msgconv/msgconv.go +++ b/pkg/msgconv/msgconv.go @@ -48,7 +48,6 @@ type MessageConverter struct { LocationFormat string DisappearViewOnce bool DirectMedia bool - ExtEvPolls bool } func NewMessageConverter(br *bridgev2.Bridge) *MessageConverter { @@ -78,7 +77,7 @@ func NewMessageConverter(br *bridgev2.Bridge) *MessageConverter { GetUUIDFromMXID: func(ctx context.Context, userID id.UserID) uuid.UUID { parsed, ok := br.Matrix.ParseGhostMXID(userID) if ok { - u, _ := signalid.ParseUserID(parsed) + u, _ := uuid.Parse(string(parsed)) return u } user, _ := br.GetExistingUserByMXID(ctx, userID) @@ -86,7 +85,7 @@ func NewMessageConverter(br *bridgev2.Bridge) *MessageConverter { if user != nil { preferredLogin, _, _ := getPortal(ctx).FindPreferredLogin(ctx, user, true) if preferredLogin != nil { - u, _ := signalid.ParseUserLoginID(preferredLogin.ID) + u, _ := uuid.Parse(string(preferredLogin.ID)) return u } } diff --git a/pkg/msgconv/signalfmt/convert.go b/pkg/msgconv/signalfmt/convert.go index 412af36..f950a59 100644 --- a/pkg/msgconv/signalfmt/convert.go +++ b/pkg/msgconv/signalfmt/convert.go @@ -23,7 +23,6 @@ import ( "strings" "github.com/google/uuid" - "github.com/rs/zerolog" "golang.org/x/exp/maps" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" @@ -86,27 +85,15 @@ func Parse(ctx context.Context, message string, ranges []*signalpb.BodyRange, pa Start: int(*r.Start), Length: int(*r.Length), }.TruncateEnd(maxLength) - var mentionACI uuid.UUID switch rv := r.GetAssociatedValue().(type) { case *signalpb.BodyRange_Style_: br.Value = Style(rv.Style) case *signalpb.BodyRange_MentionAci: - var err error - mentionACI, err = uuid.Parse(rv.MentionAci) + parsed, err := uuid.Parse(rv.MentionAci) if err != nil { continue } - case *signalpb.BodyRange_MentionAciBinary: - if len(rv.MentionAciBinary) != 16 { - continue - } - mentionACI = uuid.UUID(rv.MentionAciBinary) - default: - zerolog.Ctx(ctx).Warn().Type("value_type", rv).Msg("Unsupported body range type") - continue - } - if mentionACI != uuid.Nil { - userInfo := params.GetUserInfo(ctx, mentionACI) + userInfo := params.GetUserInfo(ctx, parsed) if userInfo.MXID == "" { continue } @@ -115,7 +102,7 @@ func Parse(ctx context.Context, message string, ranges []*signalpb.BodyRange, pa // Maybe use NewUTF16String and do index replacements for the plaintext body too, // or just replace the plaintext body by parsing the generated HTML. content.Body = strings.Replace(content.Body, "\uFFFC", userInfo.Name, 1) - br.Value = Mention{UserInfo: userInfo, UUID: mentionACI} + br.Value = Mention{UserInfo: userInfo, UUID: parsed} } lrt.Add(br) } diff --git a/pkg/msgconv/signalfmt/tags.go b/pkg/msgconv/signalfmt/tags.go index b273e0e..043bb43 100644 --- a/pkg/msgconv/signalfmt/tags.go +++ b/pkg/msgconv/signalfmt/tags.go @@ -40,8 +40,8 @@ func (m Mention) String() string { } func (m Mention) Proto() signalpb.BodyRangeAssociatedValue { - return &signalpb.BodyRange_MentionAciBinary{ - MentionAciBinary: m.UUID[:], + return &signalpb.BodyRange_MentionAci{ + MentionAci: m.UUID.String(), } } diff --git a/pkg/signalid/dbmeta.go b/pkg/signalid/dbmeta.go index 8f42e6f..72112a8 100644 --- a/pkg/signalid/dbmeta.go +++ b/pkg/signalid/dbmeta.go @@ -28,13 +28,11 @@ type PortalMetadata struct { } type MessageMetadata struct { - ContainsAttachments bool `json:"contains_attachments,omitempty"` - MatrixPollOptionIDs []string `json:"matrix_poll_option_ids,omitempty"` + ContainsAttachments bool `json:"contains_attachments,omitempty"` } type UserLoginMetadata struct { - ChatsSynced bool `json:"chats_synced,omitempty"` - LastContactSync jsontime.UnixMilli `json:"last_contact_sync,omitempty"` + ChatsSynced bool `json:"chats_synced,omitempty"` } type GhostMetadata struct { diff --git a/pkg/signalid/media.go b/pkg/signalid/media.go index a530c22..8c91b6a 100644 --- a/pkg/signalid/media.go +++ b/pkg/signalid/media.go @@ -34,7 +34,6 @@ const ( directMediaTypeGroupAvatar directMediaType = 1 directMediaTypeProfileAvatar directMediaType = 2 directMediaTypePlaintextDigestAttachment directMediaType = 3 - directMediaTypeSticker directMediaType = 4 ) type DirectMediaInfo interface { @@ -45,7 +44,6 @@ var ( _ DirectMediaInfo = (*DirectMediaAttachment)(nil) _ DirectMediaInfo = (*DirectMediaGroupAvatar)(nil) _ DirectMediaInfo = (*DirectMediaProfileAvatar)(nil) - _ DirectMediaInfo = (*DirectMediaSticker)(nil) ) type DirectMediaAttachment struct { @@ -129,30 +127,6 @@ func (m DirectMediaProfileAvatar) AsMediaID() (mediaID networkid.MediaID, err er return networkid.MediaID(buf.Bytes()), nil } -type DirectMediaSticker struct { - PackID []byte - PackKey []byte - StickerID uint32 -} - -const packIDLen = 16 -const packKeyLen = 32 -const directMediaStickerLen = 1 + packIDLen + packKeyLen + 4 - -func (m DirectMediaSticker) AsMediaID() (mediaID networkid.MediaID, err error) { - if len(m.PackID) != packIDLen { - return nil, fmt.Errorf("invalid pack ID length: %d", len(m.PackID)) - } else if len(m.PackKey) != packKeyLen { - return nil, fmt.Errorf("invalid pack key length: %d", len(m.PackKey)) - } - mediaID = make(networkid.MediaID, directMediaStickerLen) - mediaID[0] = byte(directMediaTypeSticker) - copy(mediaID[1:], m.PackID) - copy(mediaID[1+packIDLen:], m.PackKey) - binary.BigEndian.PutUint32(mediaID[1+packIDLen+packKeyLen:], m.StickerID) - return mediaID, nil -} - func ParseDirectMediaInfo(mediaID networkid.MediaID) (_ DirectMediaInfo, err error) { mediaIDLen := len(mediaID) if mediaIDLen == 0 { @@ -226,15 +200,6 @@ func ParseDirectMediaInfo(mediaID networkid.MediaID) (_ DirectMediaInfo, err err info.ProfileAvatarPath = string(profileAvatarPath) } return &info, nil - case directMediaTypeSticker: - var info DirectMediaSticker - if len(mediaID) != directMediaStickerLen { - return info, fmt.Errorf("invalid media ID length for sticker: %d", len(mediaID)) - } - info.PackID = mediaID[1 : 1+packIDLen] - info.PackKey = mediaID[1+packIDLen : 1+packIDLen+packKeyLen] - info.StickerID = binary.BigEndian.Uint32(mediaID[1+packIDLen+packKeyLen:]) - return &info, nil } return nil, fmt.Errorf("invalid direct media type %d", mediaType) diff --git a/pkg/signalmeow/attachments.go b/pkg/signalmeow/attachments.go index c091827..ea03c21 100644 --- a/pkg/signalmeow/attachments.go +++ b/pkg/signalmeow/attachments.go @@ -31,11 +31,8 @@ import ( "math" "mime/multipart" "net/http" - "os" "github.com/rs/zerolog" - "go.mau.fi/util/fallocate" - "go.mau.fi/util/pkcs7" "go.mau.fi/util/random" "google.golang.org/protobuf/proto" @@ -62,54 +59,26 @@ var ErrInvalidMACForAttachment = errors.New("invalid MAC for attachment") var ErrInvalidDigestForAttachment = errors.New("invalid digest for attachment") var ErrAttachmentNotFound = errors.New("attachment not found on server") -func DownloadAttachmentWithPointer(ctx context.Context, a *signalpb.AttachmentPointer, plaintextHash []byte, into *os.File) ([]byte, error) { +func DownloadAttachmentWithPointer(ctx context.Context, a *signalpb.AttachmentPointer, plaintextHash []byte) ([]byte, error) { digest := a.GetDigest() plaintextDigest := false if digest == nil && plaintextHash != nil { digest = plaintextHash plaintextDigest = true } - return DownloadAttachment( - ctx, a.GetCdnId(), a.GetCdnKey(), a.GetCdnNumber(), a.Key, digest, plaintextDigest, a.GetSize(), into, - ) + return DownloadAttachment(ctx, a.GetCdnId(), a.GetCdnKey(), a.GetCdnNumber(), a.Key, digest, plaintextDigest, a.GetSize()) } -func DownloadAttachment( - ctx context.Context, - cdnID uint64, - cdnKey string, - cdnNumber uint32, - key, digest []byte, - plaintextDigest bool, - size uint32, - into *os.File, -) ([]byte, error) { - resp, err := web.GetAttachment(ctx, getAttachmentPath(cdnID, cdnKey), cdnNumber) +func DownloadAttachment(ctx context.Context, cdnID uint64, cdnKey string, cdnNumber uint32, key, digest []byte, plaintextDigest bool, size uint32) ([]byte, error) { + path := getAttachmentPath(cdnID, cdnKey) + resp, err := web.GetAttachment(ctx, path, cdnNumber, nil) if err != nil { return nil, err } - defer func() { - _ = resp.Body.Close() - }() + bodyReader := resp.Body + defer bodyReader.Close() - var body []byte - var downloadedSize int64 - if resp.StatusCode > 400 { - body, err = io.ReadAll(io.LimitReader(resp.Body, 4096)) - } else if into == nil { - if resp.ContentLength > 0 { - body = make([]byte, resp.ContentLength) - _, err = io.ReadFull(resp.Body, body) - } else { - body, err = io.ReadAll(http.MaxBytesReader(nil, resp.Body, max(int64(size), 32*1024)*2)) - } - } else { - err = fallocate.Fallocate(into, int(resp.ContentLength)) - if err != nil { - return nil, fmt.Errorf("failed to pre-allocate file for attachment: %w", err) - } - downloadedSize, err = io.Copy(into, resp.Body) - } + body, err := io.ReadAll(bodyReader) if err != nil { return nil, err } @@ -125,27 +94,12 @@ func DownloadAttachment( return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode) } - if into != nil { - if _, err = into.Seek(0, io.SeekStart); err != nil { - return nil, fmt.Errorf("failed to seek attachment file after downloading: %w", err) - } - return nil, decryptAttachmentFile(into, downloadedSize, key, digest, plaintextDigest, size) - } return decryptAttachment(body, key, digest, plaintextDigest, size) } const MACLength = 32 const IVLength = 16 -func macAndAESDecrypt(body, key []byte) ([]byte, error) { - l := len(body) - MACLength - if !verifyMAC(key[MACLength:], body[:l], body[l:]) { - return nil, ErrInvalidMACForAttachment - } - - return aesDecrypt(key[:MACLength], body[:l]) -} - func decryptAttachment(body, key, digest []byte, plaintextDigest bool, size uint32) ([]byte, error) { if !plaintextDigest { hash := sha256.Sum256(body) @@ -153,7 +107,12 @@ func decryptAttachment(body, key, digest []byte, plaintextDigest bool, size uint return nil, ErrInvalidDigestForAttachment } } - decrypted, err := macAndAESDecrypt(body, key) + l := len(body) - MACLength + if !verifyMAC(key[MACLength:], body[:l], body[l:]) { + return nil, ErrInvalidMACForAttachment + } + + decrypted, err := aesDecrypt(key[:MACLength], body[:l]) if err != nil { return nil, err } @@ -170,59 +129,6 @@ func decryptAttachment(body, key, digest []byte, plaintextDigest bool, size uint return decrypted, nil } -func decryptAttachmentFile(file *os.File, downloadedSize int64, key, digest []byte, plaintextDigest bool, size uint32) error { - if !plaintextDigest { - hasher := sha256.New() - if _, err := io.Copy(hasher, file); err != nil { - return fmt.Errorf("failed to hash attachment file: %w", err) - } else if !hmac.Equal(hasher.Sum(nil), digest) { - return ErrInvalidDigestForAttachment - } else if _, err = file.Seek(0, io.SeekStart); err != nil { - return fmt.Errorf("failed to seek attachment file after hashing: %w", err) - } - } - mac := make([]byte, MACLength) - n, err := file.ReadAt(mac, downloadedSize-MACLength) - if err != nil { - return fmt.Errorf("failed to read MAC from attachment file: %w", err) - } else if n != MACLength { - return fmt.Errorf("unexpected MAC length read from attachment file: %d", n) - } - hasher := hmac.New(sha256.New, key[MACLength:]) - _, err = io.CopyN(hasher, file, downloadedSize-MACLength) - if err != nil { - return fmt.Errorf("failed to hash attachment file for MAC verification: %w", err) - } else if !hmac.Equal(hasher.Sum(nil), mac) { - return ErrInvalidMACForAttachment - } else if _, err = file.Seek(0, io.SeekStart); err != nil { - return fmt.Errorf("failed to seek attachment file after verifying mac: %w", err) - } - - decryptedSize, err := aesDecryptFile(key[:MACLength], file, downloadedSize-MACLength) - if err != nil { - return err - } else if decryptedSize < int64(size) { - return fmt.Errorf("decrypted attachment length %d < expected %d", decryptedSize, size) - } else if _, err = file.Seek(0, io.SeekStart); err != nil { - return fmt.Errorf("failed to seek attachment file after decrypting: %w", err) - } - err = file.Truncate(int64(size)) - if err != nil { - return fmt.Errorf("failed to truncate attachment file to expected size: %w", err) - } - if plaintextDigest { - hasher = sha256.New() - if _, err = io.Copy(hasher, file); err != nil { - return fmt.Errorf("failed to hash decrypted attachment file: %w", err) - } else if !hmac.Equal(hasher.Sum(nil), digest) { - return fmt.Errorf("%w (plaintext hash)", ErrInvalidDigestForAttachment) - } else if _, err = file.Seek(0, io.SeekStart); err != nil { - return fmt.Errorf("failed to seek attachment file after hashing plaintext: %w", err) - } - } - return nil -} - type attachmentV4UploadAttributes struct { Cdn uint32 `json:"cdn"` Key string `json:"key"` @@ -245,14 +151,6 @@ func extend(data []byte, paddedLen int) []byte { } } -func macAndAESEncrypt(keys, plaintext []byte) ([]byte, error) { - encrypted, err := aesEncrypt(keys[:32], plaintext) - if err != nil { - return nil, err - } - return appendMAC(keys[32:], encrypted), nil -} - func (cli *Client) UploadAttachment(ctx context.Context, body []byte) (*signalpb.AttachmentPointer, error) { log := zerolog.Ctx(ctx).With().Str("func", "upload attachment").Logger() keys := random.Bytes(64) // combined AES and MAC keys @@ -268,20 +166,23 @@ func (cli *Client) UploadAttachment(ctx context.Context, body []byte) (*signalpb } body = extend(body, paddedLen) - encryptedWithMAC, err := macAndAESEncrypt(keys, body) + encrypted, err := aesEncrypt(keys[:32], body) if err != nil { return nil, err } + encryptedWithMAC := appendMAC(keys[32:], encrypted) // Get upload attributes from Signal server attributesPath := "/v4/attachments/form/upload" - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, attributesPath, nil, nil) + username, password := cli.Store.BasicAuthCreds() + opts := &web.HTTPReqOpt{Username: &username, Password: &password} + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, attributesPath, opts) if err != nil { log.Err(err).Msg("Failed to request upload attributes") return nil, fmt.Errorf("failed to request upload attributes: %w", err) } var uploadAttributes attachmentV4UploadAttributes - err = web.DecodeWSResponseBody(ctx, &uploadAttributes, resp) + err = web.DecodeHTTPResponseBody(ctx, &uploadAttributes, resp) if err != nil { log.Err(err).Msg("Failed to decode upload attributes") return nil, fmt.Errorf("failed to decode upload attributes: %w", err) @@ -291,7 +192,7 @@ func (cli *Client) UploadAttachment(ctx context.Context, body []byte) (*signalpb err = cli.uploadAttachmentTUS(ctx, uploadAttributes, encryptedWithMAC) } else { log.Trace().Msg("Using legacy upload") - err = cli.uploadAttachmentLegacy(ctx, uploadAttributes, encryptedWithMAC) + err = cli.uploadAttachmentLegacy(ctx, uploadAttributes, encryptedWithMAC, username, password) } if err != nil { log.Err(err).Msg("Failed to upload attachment") @@ -317,17 +218,17 @@ func (cli *Client) uploadAttachmentLegacy( ctx context.Context, uploadAttributes attachmentV4UploadAttributes, encryptedWithMAC []byte, + username string, + password string, ) error { - username, password := cli.Store.BasicAuthCreds() // Allocate attachment on CDN - resp, err := web.SendHTTPRequest(ctx, "", http.MethodPost, "", &web.HTTPReqOpt{ + resp, err := web.SendHTTPRequest(ctx, http.MethodPost, "", &web.HTTPReqOpt{ OverrideURL: uploadAttributes.SignedUploadLocation, ContentType: web.ContentTypeOctetStream, Headers: uploadAttributes.Headers, Username: &username, Password: &password, }) - web.CloseBody(resp) if err != nil { return fmt.Errorf("failed to send allocate request: %w", err) } else if resp.StatusCode < 200 || resp.StatusCode >= 300 { @@ -335,14 +236,13 @@ func (cli *Client) uploadAttachmentLegacy( } // Upload attachment to CDN - resp, err = web.SendHTTPRequest(ctx, "", http.MethodPut, "", &web.HTTPReqOpt{ + resp, err = web.SendHTTPRequest(ctx, http.MethodPut, "", &web.HTTPReqOpt{ OverrideURL: resp.Header.Get("Location"), Body: encryptedWithMAC, ContentType: web.ContentTypeOctetStream, Username: &username, Password: &password, }) - web.CloseBody(resp) if err != nil { return fmt.Errorf("failed to send upload request: %w", err) } else if resp.StatusCode < 200 || resp.StatusCode >= 300 { @@ -360,13 +260,12 @@ func (cli *Client) uploadAttachmentTUS( uploadAttributes.Headers["Upload-Length"] = fmt.Sprintf("%d", len(encryptedWithMAC)) uploadAttributes.Headers["Upload-Metadata"] = "filename " + base64.StdEncoding.EncodeToString([]byte(uploadAttributes.Key)) - resp, err := web.SendHTTPRequest(ctx, "", http.MethodPost, "", &web.HTTPReqOpt{ + resp, err := web.SendHTTPRequest(ctx, http.MethodPost, "", &web.HTTPReqOpt{ OverrideURL: uploadAttributes.SignedUploadLocation, Body: encryptedWithMAC, ContentType: web.ContentTypeOffsetOctetStream, Headers: uploadAttributes.Headers, }) - web.CloseBody(resp) // TODO actually support resuming on error if err != nil { return fmt.Errorf("failed to send upload request: %w", err) @@ -381,17 +280,12 @@ func (cli *Client) uploadAttachmentTUS( return nil } -func (cli *Client) UploadGroupAvatar(ctx context.Context, avatarBytes []byte, gid types.GroupIdentifier, groupMasterKey types.SerializedGroupMasterKey) (string, error) { +func (cli *Client) UploadGroupAvatar(ctx context.Context, avatarBytes []byte, gid types.GroupIdentifier) (string, error) { log := zerolog.Ctx(ctx) - if groupMasterKey == "" { - var err error - groupMasterKey, err = cli.Store.GroupStore.MasterKeyFromGroupIdentifier(ctx, gid) - if err != nil { - log.Err(err).Msg("Could not get master key from group id") - return "", err - } else if groupMasterKey == "" { - return "", fmt.Errorf("no master key found for group %s", gid) - } + groupMasterKey, err := cli.Store.GroupStore.MasterKeyFromGroupIdentifier(ctx, gid) + if err != nil { + log.Err(err).Msg("Could not get master key from group id") + return "", err } groupAuth, err := cli.GetAuthorizationForToday(ctx, masterKeyToBytes(groupMasterKey)) if err != nil { @@ -411,15 +305,14 @@ func (cli *Client) UploadGroupAvatar(ctx context.Context, avatarBytes []byte, gi } // Get upload form from Signal server - formPath := "/v2/groups/avatar/form" - opts := &web.HTTPReqOpt{Username: &groupAuth.Username, Password: &groupAuth.Password, ContentType: web.ContentTypeProtobuf} - resp, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodGet, formPath, opts) + formPath := "/v1/groups/avatar/form" + opts := &web.HTTPReqOpt{Username: &groupAuth.Username, Password: &groupAuth.Password, ContentType: web.ContentTypeProtobuf, Host: web.StorageHostname} + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, formPath, opts) if err != nil { log.Err(err).Msg("Error sending request fetching avatar upload form") return "", err } body, err := io.ReadAll(resp.Body) - web.CloseBody(resp) if err != nil { log.Err(err).Msg("Error decoding response body fetching upload attributes") return "", err @@ -445,11 +338,11 @@ func (cli *Client) UploadGroupAvatar(ctx context.Context, avatarBytes []byte, gi w.Close() // Upload avatar to CDN - resp, err = web.SendHTTPRequest(ctx, web.CDN1Hostname, http.MethodPost, "", &web.HTTPReqOpt{ + resp, err = web.SendHTTPRequest(ctx, http.MethodPost, "", &web.HTTPReqOpt{ Body: requestBody.Bytes(), ContentType: web.ContentType(w.FormDataContentType()), + Host: web.CDN1Hostname, }) - web.CloseBody(resp) if err != nil { log.Err(err).Msg("Error sending request uploading attachment") return "", err @@ -478,56 +371,14 @@ func aesDecrypt(key, ciphertext []byte) ([]byte, error) { return nil, fmt.Errorf("ciphertext not multiple of AES blocksize (%d extra bytes)", len(ciphertext)%aes.BlockSize) } - iv := ciphertext[:IVLength] - ciphertext = ciphertext[IVLength:] + iv := ciphertext[:aes.BlockSize] mode := cipher.NewCBCDecrypter(block, iv) mode.CryptBlocks(ciphertext, ciphertext) - return pkcs7.Unpad(ciphertext) -} - -func aesDecryptFile(key []byte, file *os.File, downloadedSize int64) (int64, error) { - block, err := aes.NewCipher(key) - if err != nil { - return 0, err - } - fileReader := io.LimitReader(file, downloadedSize) - - if downloadedSize%aes.BlockSize != 0 { - return 0, fmt.Errorf("ciphertext not multiple of AES blocksize (%d extra bytes)", downloadedSize%aes.BlockSize) - } - - iv := make([]byte, IVLength) - n, err := fileReader.Read(iv) - if err != nil { - return 0, fmt.Errorf("failed to read IV from attachment file: %w", err) - } else if n != IVLength { - return 0, fmt.Errorf("unexpected IV length read from attachment file: %d", n) - } - mode := cipher.NewCBCDecrypter(block, iv) - buf := make([]byte, 4096) - var offset int64 - var pad byte - for { - n, err = fileReader.Read(buf) - if err != nil && !errors.Is(err, io.EOF) { - return 0, fmt.Errorf("failed to read from attachment file: %w", err) - } - if n > 0 { - mode.CryptBlocks(buf[:n], buf[:n]) - if _, err = file.WriteAt(buf[:n], offset); err != nil { - return 0, fmt.Errorf("failed to write decrypted data to attachment file: %w", err) - } - offset += int64(n) - pad = buf[n-1] - } - if errors.Is(err, io.EOF) { - break - } - } + pad := ciphertext[len(ciphertext)-1] if pad > aes.BlockSize { - return 0, fmt.Errorf("pad value (%d) larger than AES blocksize (%d)", pad, aes.BlockSize) + return nil, fmt.Errorf("pad value (%d) larger than AES blocksize (%d)", pad, aes.BlockSize) } - return downloadedSize - int64(pad), nil + return ciphertext[aes.BlockSize : len(ciphertext)-int(pad)], nil } func appendMAC(key, body []byte) []byte { @@ -542,11 +393,14 @@ func aesEncrypt(key, plaintext []byte) ([]byte, error) { return nil, err } - plaintext = pkcs7.Pad(plaintext, aes.BlockSize) + pad := aes.BlockSize - len(plaintext)%aes.BlockSize + plaintext = append(plaintext, bytes.Repeat([]byte{byte(pad)}, pad)...) + + ciphertext := make([]byte, len(plaintext)) iv := random.Bytes(16) mode := cipher.NewCBCEncrypter(block, iv) - mode.CryptBlocks(plaintext, plaintext) + mode.CryptBlocks(ciphertext, plaintext) - return append(iv, plaintext...), nil + return append(iv, ciphertext...), nil } diff --git a/pkg/signalmeow/backup.go b/pkg/signalmeow/backup.go index f003e19..43c2f78 100644 --- a/pkg/signalmeow/backup.go +++ b/pkg/signalmeow/backup.go @@ -239,7 +239,7 @@ func (cli *Client) deriveTransferKeys() (aesKey, hmacKey [32]byte, err error) { } func downloadTransferArchive(ctx context.Context, meta *TransferArchiveMetadata, writeTo io.Writer) error { - resp, err := web.GetAttachment(ctx, getAttachmentPath(0, meta.Key), meta.CDN) + resp, err := web.GetAttachment(ctx, getAttachmentPath(0, meta.Key), meta.CDN, nil) if err != nil { return fmt.Errorf("failed to download transfer archive: %w", err) } @@ -282,11 +282,7 @@ func (cli *Client) WaitForTransfer(ctx context.Context) (*TransferArchiveMetadat } reqDuration := time.Since(reqStart) if reqDuration < reqTimeout-10*time.Second { - select { - case <-time.After(15 * time.Second): - case <-ctx.Done(): - return nil, ctx.Err() - } + time.Sleep(15 * time.Second) } } } @@ -295,14 +291,21 @@ func (cli *Client) tryRequestTransferArchive(ctx context.Context, timeout time.D reqCtx, cancel := context.WithTimeout(ctx, timeout+15*time.Second) defer cancel() path := "/v1/devices/transfer_archive?timeout=" + strconv.Itoa(int(timeout.Seconds())) - resp, err := cli.AuthedWS.SendRequest(reqCtx, http.MethodGet, path, nil, nil) + username, password := cli.Store.BasicAuthCreds() + opts := &web.HTTPReqOpt{Username: &username, Password: &password} + resp, err := web.SendHTTPRequest(reqCtx, http.MethodGet, path, opts) + defer func() { + if resp != nil && resp.Body != nil { + _ = resp.Body.Close() + } + }() if err != nil { return nil, err - } else if resp.GetStatus() == http.StatusNoContent { + } else if resp.StatusCode == http.StatusNoContent { return nil, nil - } else if resp.GetStatus() != http.StatusOK { - return nil, fmt.Errorf("unexpected status code %d", resp.GetStatus()) - } else if err = json.Unmarshal(resp.Body, &respBody); err != nil { + } else if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode) + } else if err = json.NewDecoder(resp.Body).Decode(&respBody); err != nil { return nil, fmt.Errorf("failed to decode response: %w", err) } else { return respBody, nil diff --git a/pkg/signalmeow/client.go b/pkg/signalmeow/client.go index 57598cd..42979c1 100644 --- a/pkg/signalmeow/client.go +++ b/pkg/signalmeow/client.go @@ -18,21 +18,16 @@ package signalmeow import ( "context" - "encoding/json" "errors" - "net/http" "net/url" "sync" "time" "github.com/rs/zerolog" - "go.mau.fi/util/exsync" "go.mau.fi/mautrix-signal/pkg/libsignalgo" "go.mau.fi/mautrix-signal/pkg/signalmeow/events" - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/store" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) @@ -40,16 +35,14 @@ type Client struct { Store *store.Device Log zerolog.Logger - senderCertificateWithE164 *libsignalgo.SenderCertificate - senderCertificateNoE164 *libsignalgo.SenderCertificate - senderCertificateCache sync.Mutex - - sendCache *exsync.RingBuffer[sendCacheKey, *signalpb.Content] - - GroupCache *GroupCache - ProfileCache *ProfileCache - LastContactRequestTime time.Time - SyncContactsOnConnect bool + SenderCertificateWithE164 *libsignalgo.SenderCertificate + SenderCertificateNoE164 *libsignalgo.SenderCertificate + GroupCredentials *GroupCredentials + GroupCache *GroupCache + ProfileCache *ProfileCache + GroupCallCache *map[string]bool + LastContactRequestTime time.Time + SyncContactsOnConnect bool encryptionLock sync.Mutex @@ -71,26 +64,6 @@ type Client struct { writeCallbackCounter chan time.Time } -// InMemorySendCacheSize specifies how large the cache for sent messages is, which is used to respond to retry receipts. -// The cache is large because every group member will be listed separately. -// 2k entries should hold at least 2 messages in max size groups. -var InMemorySendCacheSize = 2048 - -func NewClient(device *store.Device, log zerolog.Logger, evtHandler func(events.SignalEvent) bool) *Client { - return &Client{ - Store: device, - Log: log, - EventHandler: evtHandler, - GroupCache: NewGroupCache(device.ACIServiceID()), - ProfileCache: &ProfileCache{ - profiles: make(map[string]*types.Profile), - errors: make(map[string]*error), - lastFetched: make(map[string]time.Time), - }, - sendCache: exsync.NewRingBuffer[sendCacheKey, *signalpb.Content](InMemorySendCacheSize), - } -} - func (cli *Client) handleEvent(evt events.SignalEvent) bool { return cli.EventHandler(evt) } @@ -137,11 +110,3 @@ func (cli *Client) connectUnauthedWS(ctx context.Context) (chan web.SignalWebsoc func (cli *Client) IsLoggedIn() bool { return cli.Store != nil && cli.Store.IsDeviceLoggedIn() } - -func (cli *Client) GetRemoteConfig(ctx context.Context) (json.RawMessage, error) { - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, "/v2/config", nil, nil) - if err != nil { - return nil, err - } - return resp.Body, web.DecodeWSResponseBody(ctx, nil, resp) -} diff --git a/pkg/signalmeow/contact.go b/pkg/signalmeow/contact.go index f30f54f..8407b74 100644 --- a/pkg/signalmeow/contact.go +++ b/pkg/signalmeow/contact.go @@ -36,7 +36,7 @@ import ( ) func (cli *Client) StoreContactDetailsAsContact(ctx context.Context, contactDetails *signalpb.ContactDetails, avatar *[]byte) (*types.Recipient, error) { - parsedUUID, err := ParseStringOrBinaryUUID(contactDetails.GetAci(), contactDetails.GetAciBinary()) + parsedUUID, err := uuid.Parse(contactDetails.GetAci()) if err != nil { return nil, err } diff --git a/pkg/signalmeow/devicename.go b/pkg/signalmeow/devicename.go index ceca1e4..c22e94d 100644 --- a/pkg/signalmeow/devicename.go +++ b/pkg/signalmeow/devicename.go @@ -30,6 +30,7 @@ import ( "go.mau.fi/mautrix-signal/pkg/libsignalgo" signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" + "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) func hmacSHA256(key, input []byte) []byte { @@ -62,12 +63,18 @@ func (cli *Client) updateDeviceName(ctx context.Context, encryptedName []byte) e if err != nil { return fmt.Errorf("failed to marshal device name update request: %w", err) } - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodPut, "/v1/accounts/name", reqData, nil) + username, password := cli.Store.BasicAuthCreds() + resp, err := web.SendHTTPRequest(ctx, http.MethodPut, "/v1/accounts/name", &web.HTTPReqOpt{ + Body: reqData, + Username: &username, + Password: &password, + }) if err != nil { return fmt.Errorf("failed to send device name update request: %w", err) } - if resp.GetStatus() < 200 || resp.GetStatus() >= 300 { - return fmt.Errorf("device name update request returned status %d", resp.GetStatus()) + defer resp.Body.Close() + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return fmt.Errorf("device name update request returned status %d", resp.StatusCode) } return nil } diff --git a/pkg/signalmeow/events/message.go b/pkg/signalmeow/events/message.go index 7d3732a..0642c33 100644 --- a/pkg/signalmeow/events/message.go +++ b/pkg/signalmeow/events/message.go @@ -28,17 +28,16 @@ type SignalEvent interface { isSignalEvent() } -func (*ChatEvent) isSignalEvent() {} -func (*DecryptionError) isSignalEvent() {} -func (*Receipt) isSignalEvent() {} -func (*ReadSelf) isSignalEvent() {} -func (*Call) isSignalEvent() {} -func (*ContactList) isSignalEvent() {} -func (*ACIFound) isSignalEvent() {} -func (*DeleteForMe) isSignalEvent() {} -func (*MessageRequestResponse) isSignalEvent() {} -func (*QueueEmpty) isSignalEvent() {} -func (*LoggedOut) isSignalEvent() {} +func (*ChatEvent) isSignalEvent() {} +func (*DecryptionError) isSignalEvent() {} +func (*Receipt) isSignalEvent() {} +func (*ReadSelf) isSignalEvent() {} +func (*Call) isSignalEvent() {} +func (*ContactList) isSignalEvent() {} +func (*ACIFound) isSignalEvent() {} +func (*DeleteForMe) isSignalEvent() {} +func (*QueueEmpty) isSignalEvent() {} +func (*LoggedOut) isSignalEvent() {} type MessageInfo struct { Sender uuid.UUID @@ -90,14 +89,6 @@ type DeleteForMe struct { *signalpb.SyncMessage_DeleteForMe } -type MessageRequestResponse struct { - Timestamp uint64 - ThreadACI uuid.UUID - GroupID *libsignalgo.GroupIdentifier - Type signalpb.SyncMessage_MessageRequestResponse_Type - Raw *signalpb.SyncMessage_MessageRequestResponse -} - type QueueEmpty struct{} type LoggedOut struct{ Error error } diff --git a/pkg/signalmeow/groupcache.go b/pkg/signalmeow/groupcache.go deleted file mode 100644 index ee8259f..0000000 --- a/pkg/signalmeow/groupcache.go +++ /dev/null @@ -1,346 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2025 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package signalmeow - -import ( - "context" - "fmt" - "slices" - "sync" - "time" - - "github.com/google/uuid" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -type SendEndorsementCache struct { - SendEndorsement libsignalgo.GroupSendEndorsement - MemberEndorsements map[libsignalgo.ServiceID]libsignalgo.GroupSendEndorsement - Expiration time.Time - SecretParams *libsignalgo.GroupSecretParams -} - -func (sec *SendEndorsementCache) GetToken() (libsignalgo.GroupSendFullToken, error) { - return sec.GetTokenWith(sec.SendEndorsement) -} - -func (sec *SendEndorsementCache) GetTokenWith(altToken libsignalgo.GroupSendEndorsement) (libsignalgo.GroupSendFullToken, error) { - return altToken.ToFullToken(sec.SecretParams, sec.Expiration) -} - -type cachedGroup struct { - *Group - *SendEndorsementCache - FetchedAt time.Time - UpdatedAt time.Time -} - -type GroupCache struct { - serviceID libsignalgo.ServiceID - - credentials *GroupCredentials - credentialsLock sync.RWMutex - - data map[types.GroupIdentifier]*cachedGroup - lock sync.RWMutex - - activeCalls map[types.GroupIdentifier]string - callsLock sync.RWMutex -} - -func NewGroupCache(serviceID libsignalgo.ServiceID) *GroupCache { - return &GroupCache{ - serviceID: serviceID, - data: make(map[types.GroupIdentifier]*cachedGroup), - activeCalls: make(map[types.GroupIdentifier]string), - } -} - -func (gc *GroupCache) GetCredentials( - ctx context.Context, - fetch func(context.Context, time.Time) (*GroupCredentials, error), -) (*GroupCredential, error) { - today := time.Now().Truncate(24 * time.Hour) - gc.credentialsLock.RLock() - cred := gc.getCachedCredentials(today.Unix()) - gc.credentialsLock.RUnlock() - if cred != nil { - return cred, nil - } - - gc.credentialsLock.Lock() - defer gc.credentialsLock.Unlock() - cred = gc.getCachedCredentials(today.Unix()) - if cred != nil { - return cred, nil - } - creds, err := fetch(ctx, today) - if err != nil { - return nil, err - } - gc.credentials = creds - cred = gc.getCachedCredentials(today.Unix()) - if cred == nil { - return nil, fmt.Errorf("no credentials for today after fetch") - } - return cred, nil -} - -func (gc *GroupCache) getCachedCredentials(today int64) *GroupCredential { - if gc.credentials == nil { - return nil - } - for _, cred := range gc.credentials.Credentials { - if cred.RedemptionTime == today { - return &cred - } - } - return nil -} - -func (gc *GroupCache) UpdateActiveCall(id types.GroupIdentifier, callID string) bool { - gc.callsLock.Lock() - defer gc.callsLock.Unlock() - currentCallID, ok := gc.activeCalls[id] - if ok { - // If we do, then this must be ending the call - if currentCallID == callID { - delete(gc.activeCalls, id) - return false - } - } - gc.activeCalls[id] = callID - return true -} - -func (gc *GroupCache) Get(id types.GroupIdentifier) (*Group, *SendEndorsementCache, bool) { - gc.lock.RLock() - defer gc.lock.RUnlock() - c, ok := gc.data[id] - if !ok || time.Until(c.Expiration) < 5*time.Minute { - return nil, nil, false - } - return c.Group, c.SendEndorsementCache, true -} - -func (gc *GroupCache) Delete(id types.GroupIdentifier) { - gc.lock.Lock() - defer gc.lock.Unlock() - delete(gc.data, id) -} - -func (gc *GroupCache) Put(data *Group, endorsementResponse libsignalgo.GroupSendEndorsementsResponse) error { - gsp, err := masterKeyToBytes(data.GroupMasterKey).SecretParams() - if err != nil { - return fmt.Errorf("failed to get secret params: %w", err) - } - expiration, err := endorsementResponse.GetExpiration() - if err != nil { - return fmt.Errorf("failed to get endorsement expiration: %w", err) - } - endorsement, memberEndorsements, err := endorsementResponse.ReceiveWithServiceIDs(data.getMemberServiceIDs(), gc.serviceID, &gsp, prodServerPublicParams) - if err != nil { - return fmt.Errorf("failed to receive endorsements: %w", err) - } - - gc.lock.Lock() - defer gc.lock.Unlock() - cached, exists := gc.data[data.GroupIdentifier] - if exists && cached.Revision > data.Revision { - return nil - } - gc.data[data.GroupIdentifier] = &cachedGroup{ - Group: data, - FetchedAt: time.Now(), - UpdatedAt: time.Now(), - - SendEndorsementCache: &SendEndorsementCache{ - Expiration: expiration, - SendEndorsement: endorsement, - MemberEndorsements: memberEndorsements, - SecretParams: &gsp, - }, - } - return nil -} - -func (gc *GroupCache) ApplyUpdate(change *GroupChange, endorsementResponse libsignalgo.GroupSendEndorsementsResponse) error { - mkBytes := masterKeyToBytes(change.GroupMasterKey) - rawGroupID, err := mkBytes.GroupIdentifier() - if err != nil { - return fmt.Errorf("failed to get group identifier: %w", err) - } - gsp, err := mkBytes.SecretParams() - if err != nil { - return fmt.Errorf("failed to get secret params: %w", err) - } - id := types.GroupIdentifier(rawGroupID.String()) - - gc.lock.Lock() - defer gc.lock.Unlock() - - cached, exists := gc.data[id] - if !exists || cached.Revision >= change.Revision { - return nil - } else if cached.Revision < change.Revision-1 { - // We missed an update, evict - delete(gc.data, id) - return nil - } - - // Pending member adds, promotes and removes - cached.PendingMembers = append(cached.PendingMembers, change.AddPendingMembers...) - for _, promo := range change.PromotePendingMembers { - cached.PendingMembers = slices.DeleteFunc(cached.PendingMembers, func(p *PendingMember) bool { - return p.ServiceID.Type == libsignalgo.ServiceIDTypeACI && p.ServiceID.UUID == promo.ACI - }) - cached.Members = append(cached.Members, &GroupMember{ - ACI: promo.ACI, - ProfileKey: promo.ProfileKey, - Role: GroupMember_DEFAULT, - JoinedAtRevision: change.Revision, - }) - } - for _, promo := range change.PromotePendingPniAciMembers { - cached.PendingMembers = slices.DeleteFunc(cached.PendingMembers, func(p *PendingMember) bool { - return (p.ServiceID.Type == libsignalgo.ServiceIDTypePNI && p.ServiceID.UUID == promo.PNI) || - (p.ServiceID.Type == libsignalgo.ServiceIDTypeACI && p.ServiceID.UUID == promo.ACI) - }) - cached.Members = append(cached.Members, &GroupMember{ - ACI: promo.ACI, - ProfileKey: promo.ProfileKey, - Role: GroupMember_DEFAULT, - JoinedAtRevision: change.Revision, - }) - } - cached.PendingMembers = slices.DeleteFunc(cached.PendingMembers, func(p *PendingMember) bool { - return slices.ContainsFunc(change.DeletePendingMembers, func(s *libsignalgo.ServiceID) bool { - return s != nil && p.ServiceID == *s - }) - }) - - // Requesting member adds, promotes and removes - cached.RequestingMembers = append(cached.RequestingMembers, change.AddRequestingMembers...) - for _, promo := range change.PromoteRequestingMembers { - var profileKey libsignalgo.ProfileKey - cached.RequestingMembers = slices.DeleteFunc(cached.RequestingMembers, func(r *RequestingMember) bool { - if r.ACI == promo.ACI { - profileKey = r.ProfileKey - return true - } - return false - }) - cached.Members = append(cached.Members, &GroupMember{ - ACI: promo.ACI, - ProfileKey: profileKey, - Role: promo.Role, - JoinedAtRevision: change.Revision, - }) - } - cached.RequestingMembers = slices.DeleteFunc(cached.RequestingMembers, func(r *RequestingMember) bool { - return slices.ContainsFunc(change.DeleteRequestingMembers, func(u *uuid.UUID) bool { - return u != nil && r.ACI == *u - }) - }) - - // Direct member adds, removes and modifications - for _, member := range change.AddMembers { - cached.Members = append(cached.Members, &GroupMember{ - ACI: member.ACI, - Role: member.Role, - ProfileKey: member.ProfileKey, - JoinedAtRevision: member.JoinedAtRevision, - }) - } - for _, rm := range change.ModifyMemberRoles { - cached.findMemberOrEmpty(rm.ACI).Role = rm.Role - } - for _, pk := range change.ModifyMemberProfileKeys { - cached.findMemberOrEmpty(pk.ACI).ProfileKey = pk.ProfileKey - } - cached.Members = slices.DeleteFunc(cached.Members, func(member *GroupMember) bool { - return slices.ContainsFunc(change.DeleteMembers, func(u *uuid.UUID) bool { - return u != nil && *u == member.ACI - }) - }) - - // Banned members - cached.BannedMembers = append(cached.BannedMembers, change.AddBannedMembers...) - cached.BannedMembers = slices.DeleteFunc(cached.BannedMembers, func(b *BannedMember) bool { - return slices.ContainsFunc(change.DeleteBannedMembers, func(s *libsignalgo.ServiceID) bool { - return s != nil && b.ServiceID == *s - }) - }) - - // Non-member modifications - if change.ModifyInviteLinkPassword != nil { - cached.InviteLinkPassword = change.ModifyInviteLinkPassword - } - if change.ModifyTitle != nil { - cached.Title = *change.ModifyTitle - } - if change.ModifyDescription != nil { - cached.Description = *change.ModifyDescription - } - if change.ModifyAvatar != nil { - cached.AvatarPath = *change.ModifyAvatar - } - if change.ModifyAnnouncementsOnly != nil { - cached.AnnouncementsOnly = *change.ModifyAnnouncementsOnly - } - if change.ModifyDisappearingMessagesDuration != nil { - cached.DisappearingMessagesDuration = *change.ModifyDisappearingMessagesDuration - } - if change.ModifyAttributesAccess != nil { - cached.AccessControl.Attributes = *change.ModifyAttributesAccess - } - if change.ModifyMemberAccess != nil { - cached.AccessControl.Members = *change.ModifyMemberAccess - } - if change.ModifyAddFromInviteLinkAccess != nil { - cached.AccessControl.AddFromInviteLink = *change.ModifyAddFromInviteLinkAccess - } - - cached.UpdatedAt = time.Now() - cached.Revision = change.Revision - endorsement, memberEndorsements, err := endorsementResponse.ReceiveWithServiceIDs( - cached.getMemberServiceIDs(), - gc.serviceID, - &gsp, - prodServerPublicParams, - ) - if err != nil { - delete(gc.data, id) - return fmt.Errorf("failed to receive endorsements: %w", err) - } - expiration, err := endorsementResponse.GetExpiration() - if err != nil { - delete(gc.data, id) - return fmt.Errorf("failed to get endorsement expiration: %w", err) - } - // TODO do these responses overwrite the entire thing? - cached.SendEndorsementCache = &SendEndorsementCache{ - SendEndorsement: endorsement, - MemberEndorsements: memberEndorsements, - Expiration: expiration, - SecretParams: &gsp, - } - - return nil -} diff --git a/pkg/signalmeow/groups.go b/pkg/signalmeow/groups.go index 147d63d..d938e10 100644 --- a/pkg/signalmeow/groups.go +++ b/pkg/signalmeow/groups.go @@ -31,7 +31,6 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/util/exslices" "go.mau.fi/util/ptr" "go.mau.fi/util/random" "google.golang.org/protobuf/proto" @@ -91,12 +90,6 @@ type Group struct { //PublicKey *libsignalgo.PublicKey } -func (group *Group) getMemberServiceIDs() []libsignalgo.ServiceID { - return exslices.CastFunc(group.Members, func(from *GroupMember) libsignalgo.ServiceID { - return libsignalgo.NewACIServiceID(from.ACI) - }) -} - func (group *Group) GetInviteLink() (string, error) { if group.InviteLinkPassword == nil { return "", fmt.Errorf("no invite link password set") @@ -106,8 +99,8 @@ func (group *Group) GetInviteLink() (string, error) { if err != nil { return "", fmt.Errorf("couldn't decode invite link password") } - inviteLinkContents := signalpb.GroupInviteLink_ContentsV1{ - ContentsV1: &signalpb.GroupInviteLink_GroupInviteLinkContentsV1{ + inviteLinkContents := signalpb.GroupInviteLink_V1Contents{ + V1Contents: &signalpb.GroupInviteLink_GroupInviteLinkContentsV1{ GroupMasterKey: masterKeyBytes[:], InviteLinkPassword: inviteLinkPasswordBytes, }, @@ -121,15 +114,6 @@ func (group *Group) GetInviteLink() (string, error) { return "https://signal.group/#" + inviteLinkPath, nil } -func (group *Group) findMemberOrEmpty(aci uuid.UUID) *GroupMember { - for _, member := range group.Members { - if member.ACI == aci { - return member - } - } - return &GroupMember{} -} - type GroupAccessControl struct { Members AccessControl AddFromInviteLink AccessControl @@ -226,7 +210,8 @@ func (groupChange *GroupChange) isEmpty() bool { len(groupChange.PromoteRequestingMembers) == 0 && groupChange.ModifyDescription == nil && groupChange.ModifyAnnouncementsOnly == nil && - len(groupChange.AddBannedMembers) == 0 + len(groupChange.AddBannedMembers) == 0 && + len(groupChange.DeleteMembers) == 0 } func (groupChange *GroupChange) resolveConflict(group *Group) { @@ -329,7 +314,8 @@ func (cli *Client) fetchNewGroupCreds(ctx context.Context, today time.Time) (*Gr Logger() sevenDaysOut := today.Add(7 * 24 * time.Hour) path := fmt.Sprintf("/v1/certificate/auth/group?redemptionStartSeconds=%d&redemptionEndSeconds=%d&pniAsServiceId=true", today.Unix(), sevenDaysOut.Unix()) - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, path, nil, nil) + authRequest := web.CreateWSRequest(http.MethodGet, path, nil, nil, nil) + resp, err := cli.AuthedWS.SendRequest(ctx, authRequest) if err != nil { return nil, fmt.Errorf("SendRequest error: %w", err) } @@ -343,22 +329,51 @@ func (cli *Client) fetchNewGroupCreds(ctx context.Context, today time.Time) (*Gr log.Err(err).Msg("json.Unmarshal error") return nil, err } + // make sure pni matches device pni if creds.PNI != cli.Store.PNI { - return nil, fmt.Errorf("mismatching PNI in group credentials: %s != %s", creds.PNI, cli.Store.PNI) + err := fmt.Errorf("creds.PNI != d.PNI") + log.Err(err).Msg("creds.PNI != d.PNI") + return nil, err } return &creds, nil } +func (cli *Client) getCachedAuthorizationForToday(today time.Time) *GroupCredential { + if cli.GroupCredentials == nil { + // No cached credentials + return nil + } + allCreds := cli.GroupCredentials + // Get the credential for today + for _, cred := range allCreds.Credentials { + if cred.RedemptionTime == today.Unix() { + return &cred + } + } + return nil +} + func (cli *Client) GetAuthorizationForToday(ctx context.Context, masterKey libsignalgo.GroupMasterKey) (*GroupAuth, error) { log := zerolog.Ctx(ctx).With(). Str("action", "get authorization for today"). Logger() + // Timestamps for the start of today, and 7 days later + today := time.Now().Truncate(24 * time.Hour) - todayCred, err := cli.GroupCache.GetCredentials(ctx, cli.fetchNewGroupCreds) - if err != nil { - return nil, fmt.Errorf("failed to get group credentials: %w", err) + todayCred := cli.getCachedAuthorizationForToday(today) + if todayCred == nil { + creds, err := cli.fetchNewGroupCreds(ctx, today) + if err != nil { + return nil, fmt.Errorf("fetchNewGroupCreds error: %w", err) + } + cli.GroupCredentials = creds + todayCred = cli.getCachedAuthorizationForToday(today) + } + if todayCred == nil { + return nil, fmt.Errorf("couldn't get credential for today") } + //TODO: cache cred after unmarshalling redemptionTime := uint64(todayCred.RedemptionTime) credential := todayCred.Credential authCredentialResponse, err := libsignalgo.NewAuthCredentialWithPniResponse(credential) @@ -470,7 +485,7 @@ func decryptGroup(ctx context.Context, encryptedGroup *signalpb.Group, groupMast descriptionBlob, err := decryptGroupPropertyIntoBlob(groupSecretParams, encryptedGroup.Description) if err == nil { // treat a failure in obtaining the description as non-fatal - decryptedGroup.Description = cleanupStringProperty(descriptionBlob.GetDescriptionText()) + decryptedGroup.Description = cleanupStringProperty(descriptionBlob.GetDescription()) } if encryptedGroup.DisappearingMessagesTimer != nil && len(encryptedGroup.DisappearingMessagesTimer) > 0 { @@ -482,8 +497,8 @@ func decryptGroup(ctx context.Context, encryptedGroup *signalpb.Group, groupMast } // These aren't encrypted - decryptedGroup.AvatarPath = encryptedGroup.AvatarUrl - decryptedGroup.Revision = encryptedGroup.Version + decryptedGroup.AvatarPath = encryptedGroup.Avatar + decryptedGroup.Revision = encryptedGroup.Revision // Decrypt members for _, member := range encryptedGroup.Members { @@ -497,7 +512,7 @@ func decryptGroup(ctx context.Context, encryptedGroup *signalpb.Group, groupMast decryptedGroup.Members = append(decryptedGroup.Members, decryptedMember) } - for _, pendingMember := range encryptedGroup.MembersPendingProfileKey { + for _, pendingMember := range encryptedGroup.PendingMembers { if pendingMember == nil { continue } @@ -509,7 +524,7 @@ func decryptGroup(ctx context.Context, encryptedGroup *signalpb.Group, groupMast decryptedGroup.PendingMembers = append(decryptedGroup.PendingMembers, decryptedPendingMember) } - for _, requestingMember := range encryptedGroup.MembersPendingAdminApproval { + for _, requestingMember := range encryptedGroup.RequestingMembers { if requestingMember == nil { continue } @@ -520,7 +535,7 @@ func decryptGroup(ctx context.Context, encryptedGroup *signalpb.Group, groupMast decryptedGroup.RequestingMembers = append(decryptedGroup.RequestingMembers, decryptedRequestingMember) } - for _, bannedMember := range encryptedGroup.MembersBanned { + for _, bannedMember := range encryptedGroup.BannedMembers { if bannedMember == nil { continue } @@ -619,7 +634,7 @@ func (cli *Client) fetchGroupByID(ctx context.Context, gid types.GroupIdentifier return nil, fmt.Errorf("failed to get group master key: %w", err) } if groupMasterKey == "" { - return nil, fmt.Errorf("%w for %s", ErrGroupMasterKeyNotFound, gid) + return nil, fmt.Errorf("No group master key found for group identifier %s", gid) } return cli.fetchGroupWithMasterKey(ctx, groupMasterKey) } @@ -634,9 +649,9 @@ func (cli *Client) fetchGroupWithMasterKey(ctx context.Context, groupMasterKey t Username: &groupAuth.Username, Password: &groupAuth.Password, ContentType: web.ContentTypeProtobuf, + Host: web.StorageHostname, } - response, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodGet, "/v2/groups", opts) - defer web.CloseBody(response) + response, err := web.SendHTTPRequest(ctx, http.MethodGet, "/v2/groups", opts) if err != nil { return nil, err } @@ -661,10 +676,6 @@ func (cli *Client) parseGroupResponse(ctx context.Context, response *http.Respon if err != nil { return nil, fmt.Errorf("failed to decrypt group: %w", err) } - err = cli.GroupCache.Put(group, groupResponse.GroupSendEndorsementsResponse) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to cache group response") - } // Store the profile keys in case they're new for _, member := range group.Members { @@ -685,11 +696,11 @@ func (cli *Client) parseGroupResponse(ctx context.Context, response *http.Respon func (cli *Client) DownloadGroupAvatar(ctx context.Context, avatarPath string, groupMasterKey types.SerializedGroupMasterKey) ([]byte, error) { username, password := cli.Store.BasicAuthCreds() opts := &web.HTTPReqOpt{ + Host: web.CDN1Hostname, Username: &username, Password: &password, } - resp, err := web.SendHTTPRequest(ctx, web.CDN1Hostname, http.MethodGet, avatarPath, opts) - defer web.CloseBody(resp) + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, avatarPath, opts) if err != nil { return nil, fmt.Errorf("failed to send request: %w", err) } @@ -708,21 +719,23 @@ func (cli *Client) DownloadGroupAvatar(ctx context.Context, avatarPath string, g return decrypted, nil } -func (cli *Client) RetrieveGroupByID(ctx context.Context, gid types.GroupIdentifier, revision uint32) (*Group, *SendEndorsementCache, error) { - cached, endorsement, ok := cli.GroupCache.Get(gid) - if ok && cached.Revision >= revision { - return cached, endorsement, nil +func (cli *Client) RetrieveGroupByID(ctx context.Context, gid types.GroupIdentifier, revision uint32) (*Group, error) { + cli.initGroupCache() + + lastFetched, ok := cli.GroupCache.lastFetched[gid] + if ok && time.Since(lastFetched) < 1*time.Hour { + group, ok := cli.GroupCache.groups[gid] + if ok && group.Revision >= revision { + return group, nil + } } group, err := cli.fetchGroupByID(ctx, gid) if err != nil { - return nil, nil, err + return nil, err } - cached, endorsement, ok = cli.GroupCache.Get(gid) - if !ok { - zerolog.Ctx(ctx).Warn().Msg("Group not found in cache after fetching") - return group, nil, nil - } - return cached, endorsement, nil + cli.GroupCache.groups[gid] = group + cli.GroupCache.lastFetched[gid] = time.Now() + return group, nil } // We should store the group master key in the group store as soon as we see it, @@ -740,6 +753,40 @@ func (cli *Client) StoreMasterKey(ctx context.Context, groupMasterKey types.Seri return groupIdentifier, nil } +// We need to track active calls so we don't send too many IncomingSignalMessageCalls +// Of course for group calls Signal doesn't tell us *anything* so we're mostly just inferring +// So we just jam a new call ID in, and return true if we *think* this is a new incoming call +func (cli *Client) UpdateActiveCalls(gid types.GroupIdentifier, callID string) (isActive bool) { + cli.initGroupCache() + // Check to see if we currently have an active call for this group + currentCallID, ok := cli.GroupCache.activeCalls[gid] + if ok { + // If we do, then this must be ending the call + if currentCallID == callID { + delete(cli.GroupCache.activeCalls, gid) + return false + } + } + cli.GroupCache.activeCalls[gid] = callID + return true +} + +func (cli *Client) initGroupCache() { + if cli.GroupCache == nil { + cli.GroupCache = &GroupCache{ + groups: make(map[types.GroupIdentifier]*Group), + lastFetched: make(map[types.GroupIdentifier]time.Time), + activeCalls: make(map[types.GroupIdentifier]string), + } + } +} + +type GroupCache struct { + groups map[types.GroupIdentifier]*Group + lastFetched map[types.GroupIdentifier]time.Time + activeCalls map[types.GroupIdentifier]string +} + func (cli *Client) DecryptGroupChange(ctx context.Context, groupContext *signalpb.GroupContextV2) (*GroupChange, error) { masterKeyBytes := libsignalgo.GroupMasterKey(groupContext.MasterKey) groupMasterKey := masterKeyFromBytes(masterKeyBytes) @@ -757,15 +804,6 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange log := zerolog.Ctx(ctx).With().Str("action", "decrypt group change").Logger() serverSignature := encryptedGroupChange.ServerSignature encryptedActionsBytes := encryptedGroupChange.Actions - var success bool - defer func() { - if !success { - rawGroupID, _ := masterKeyToBytes(groupMasterKey).GroupIdentifier() - if rawGroupID != nil { - cli.GroupCache.Delete(types.GroupIdentifier(rawGroupID.String())) - } - } - }() var err error if verifySignature { @@ -788,14 +826,14 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange return nil, err } - sourceServiceID, err := groupSecretParams.DecryptServiceID(libsignalgo.UUIDCiphertext(encryptedActions.SourceUserId)) + sourceServiceID, err := groupSecretParams.DecryptServiceID(libsignalgo.UUIDCiphertext(encryptedActions.SourceServiceId)) if err != nil { log.Err(err).Msg("Couldn't decrypt source serviceID") return nil, err } decryptedGroupChange := &GroupChange{ GroupMasterKey: groupMasterKey, - Revision: encryptedActions.Version, + Revision: encryptedActions.Revision, SourceServiceID: sourceServiceID, } @@ -815,7 +853,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange descriptionBlob, err := decryptGroupPropertyIntoBlob(groupSecretParams, encryptedActions.ModifyDescription.Description) if err == nil { // treat a failure in obtaining the description as non-fatal - newDescription := cleanupStringProperty(descriptionBlob.GetDescriptionText()) + newDescription := cleanupStringProperty(descriptionBlob.GetDescription()) decryptedGroupChange.ModifyDescription = &newDescription } } @@ -890,7 +928,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange } } - for _, addPendingMember := range encryptedActions.AddMembersPendingProfileKey { + for _, addPendingMember := range encryptedActions.AddPendingMembers { if addPendingMember == nil { continue } @@ -903,7 +941,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange decryptedGroupChange.AddPendingMembers = append(decryptedGroupChange.AddPendingMembers, decryptedPendingMember) } - for _, deletePendingMember := range encryptedActions.DeleteMembersPendingProfileKey { + for _, deletePendingMember := range encryptedActions.DeletePendingMembers { if deletePendingMember == nil { continue } @@ -916,7 +954,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange decryptedGroupChange.DeletePendingMembers = append(decryptedGroupChange.DeletePendingMembers, &userID) } - for _, promotePendingMember := range encryptedActions.PromoteMembersPendingProfileKey { + for _, promotePendingMember := range encryptedActions.PromotePendingMembers { if promotePendingMember == nil { continue } @@ -935,7 +973,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange } } - for _, promotePendingPniAciMember := range encryptedActions.PromoteMembersPendingPniAciProfileKey { + for _, promotePendingPniAciMember := range encryptedActions.PromotePendingPniAciMembers { // TODO: pretending this is a PendingMember should do for mautrix-signal, but we probably want to treat them separately at some point if promotePendingPniAciMember == nil { continue @@ -965,7 +1003,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange } } - for _, addRequestingMember := range encryptedActions.AddMembersPendingAdminApproval { + for _, addRequestingMember := range encryptedActions.AddRequestingMembers { if addRequestingMember == nil { continue } @@ -981,7 +1019,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange } } - for _, deleteRequestingMember := range encryptedActions.DeleteMembersPendingAdminApproval { + for _, deleteRequestingMember := range encryptedActions.DeleteRequestingMembers { if deleteRequestingMember == nil { continue } @@ -994,7 +1032,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange decryptedGroupChange.DeleteRequestingMembers = append(decryptedGroupChange.DeleteRequestingMembers, &serviceID.UUID) } - for _, promoteRequestingMember := range encryptedActions.PromoteMembersPendingAdminApproval { + for _, promoteRequestingMember := range encryptedActions.PromoteRequestingMembers { if promoteRequestingMember == nil { continue } @@ -1010,7 +1048,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange }) } - for _, addBannedMember := range encryptedActions.AddMembersBanned { + for _, addBannedMember := range encryptedActions.AddBannedMembers { if addBannedMember == nil { continue } @@ -1027,7 +1065,7 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange }) } - for _, deleteBannedMember := range encryptedActions.DeleteMembersBanned { + for _, deleteBannedMember := range encryptedActions.DeleteBannedMembers { if deleteBannedMember == nil { continue } @@ -1055,8 +1093,8 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange if encryptedActions.ModifyAnnouncementsOnly != nil { decryptedGroupChange.ModifyAnnouncementsOnly = &encryptedActions.ModifyAnnouncementsOnly.AnnouncementsOnly } - if encryptedActions.ModifyDisappearingMessageTimer != nil && len(encryptedActions.ModifyDisappearingMessageTimer.Timer) > 0 { - timerBlob, err := decryptGroupPropertyIntoBlob(groupSecretParams, encryptedActions.ModifyDisappearingMessageTimer.Timer) + if encryptedActions.ModifyDisappearingMessagesTimer != nil && len(encryptedActions.ModifyDisappearingMessagesTimer.Timer) > 0 { + timerBlob, err := decryptGroupPropertyIntoBlob(groupSecretParams, encryptedActions.ModifyDisappearingMessagesTimer.Timer) if err != nil { return nil, err } @@ -1068,12 +1106,6 @@ func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange decryptedGroupChange.ModifyInviteLinkPassword = &inviteLinkPassword } - success = true - err = cli.GroupCache.ApplyUpdate(decryptedGroupChange, nil) - if err != nil { - log.Err(err).Msg("Failed to apply group change to cache") - } - return decryptedGroupChange, nil } @@ -1127,11 +1159,11 @@ func decryptMember(ctx context.Context, member *signalpb.Member, groupSecretPara ACI: *aci, ProfileKey: *profileKey, Role: GroupMemberRole(member.Role), - JoinedAtRevision: member.JoinedAtVersion, + JoinedAtRevision: member.JoinedAtRevision, }, nil } -func decryptPendingMember(ctx context.Context, pendingMember *signalpb.MemberPendingProfileKey, groupSecretParams libsignalgo.GroupSecretParams) (*PendingMember, error) { +func decryptPendingMember(ctx context.Context, pendingMember *signalpb.PendingMember, groupSecretParams libsignalgo.GroupSecretParams) (*PendingMember, error) { log := zerolog.Ctx(ctx) encryptedUserID := libsignalgo.UUIDCiphertext(pendingMember.Member.UserId) userID, err := groupSecretParams.DecryptServiceID(encryptedUserID) @@ -1154,7 +1186,7 @@ func decryptPendingMember(ctx context.Context, pendingMember *signalpb.MemberPen }, nil } -func decryptRequestingMember(ctx context.Context, requestingMember *signalpb.MemberPendingAdminApproval, groupSecretParams libsignalgo.GroupSecretParams) (*RequestingMember, error) { +func decryptRequestingMember(ctx context.Context, requestingMember *signalpb.RequestingMember, groupSecretParams libsignalgo.GroupSecretParams) (*RequestingMember, error) { aci, profileKey, err := decryptPKeyAndIDorPresentation(ctx, requestingMember.UserId, requestingMember.ProfileKey, requestingMember.Presentation, groupSecretParams) if err != nil { return nil, err @@ -1175,7 +1207,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("Could not get groupSecretParams from master key") return nil, err } - groupChangeActions := &signalpb.GroupChange_Actions{Version: decryptedGroupChange.Revision} + groupChangeActions := &signalpb.GroupChange_Actions{Revision: decryptedGroupChange.Revision} if decryptedGroupChange.ModifyTitle != nil { attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_Title{Title: *decryptedGroupChange.ModifyTitle}} encryptedTitle, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) @@ -1186,7 +1218,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup groupChangeActions.ModifyTitle = &signalpb.GroupChange_Actions_ModifyTitleAction{Title: *encryptedTitle} } if decryptedGroupChange.ModifyDescription != nil { - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_DescriptionText{DescriptionText: *decryptedGroupChange.ModifyDescription}} + attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_Description{Description: *decryptedGroupChange.ModifyDescription}} encryptedDescription, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) if err != nil { log.Err(err).Msg("Could not get encrypt description") @@ -1208,7 +1240,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup JoinFromInviteLink: addMember.JoinFromInviteLink, }) } else { - groupChangeActions.AddMembersPendingProfileKey = append(groupChangeActions.AddMembersPendingProfileKey, &signalpb.GroupChange_Actions_AddMemberPendingProfileKeyAction{ + groupChangeActions.AddPendingMembers = append(groupChangeActions.AddPendingMembers, &signalpb.GroupChange_Actions_AddPendingMemberAction{ Added: encryptedPendingMember, }) } @@ -1240,7 +1272,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("Failed to encrypt pendingMember") return nil, err } - groupChangeActions.AddMembersPendingProfileKey = append(groupChangeActions.AddMembersPendingProfileKey, &signalpb.GroupChange_Actions_AddMemberPendingProfileKeyAction{ + groupChangeActions.AddPendingMembers = append(groupChangeActions.AddPendingMembers, &signalpb.GroupChange_Actions_AddPendingMemberAction{ Added: encryptedPendingMember, }) } @@ -1250,7 +1282,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("Encrypt UserId error for deletePendingMember") return nil, err } - groupChangeActions.DeleteMembersPendingProfileKey = append(groupChangeActions.DeleteMembersPendingProfileKey, &signalpb.GroupChange_Actions_DeleteMemberPendingProfileKeyAction{ + groupChangeActions.DeletePendingMembers = append(groupChangeActions.DeletePendingMembers, &signalpb.GroupChange_Actions_DeletePendingMemberAction{ DeletedUserId: encryptedUserID[:], }) } @@ -1268,7 +1300,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("failed creating expiring profile key credential presentation for addMember") return nil, err } - groupChangeActions.PromoteMembersPendingProfileKey = append(groupChangeActions.PromoteMembersPendingProfileKey, &signalpb.GroupChange_Actions_PromoteMemberPendingProfileKeyAction{ + groupChangeActions.PromotePendingMembers = append(groupChangeActions.PromotePendingMembers, &signalpb.GroupChange_Actions_PromotePendingMemberAction{ Presentation: *presentation, }) } @@ -1286,8 +1318,8 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("failed creating expiring profile key credential presentation for addMember") return nil, err } - groupChangeActions.AddMembersPendingAdminApproval = append(groupChangeActions.AddMembersPendingAdminApproval, &signalpb.GroupChange_Actions_AddMemberPendingAdminApprovalAction{ - Added: &signalpb.MemberPendingAdminApproval{ + groupChangeActions.AddRequestingMembers = append(groupChangeActions.AddRequestingMembers, &signalpb.GroupChange_Actions_AddRequestingMemberAction{ + Added: &signalpb.RequestingMember{ Presentation: *presentation, }, }) @@ -1298,7 +1330,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("Encrypt UserId error for deleteRequestingMember") return nil, err } - groupChangeActions.DeleteMembersPendingAdminApproval = append(groupChangeActions.DeleteMembersPendingAdminApproval, &signalpb.GroupChange_Actions_DeleteMemberPendingAdminApprovalAction{ + groupChangeActions.DeleteRequestingMembers = append(groupChangeActions.DeleteRequestingMembers, &signalpb.GroupChange_Actions_DeleteRequestingMemberAction{ DeletedUserId: encryptedUserID[:], }) } @@ -1309,7 +1341,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup return nil, err } - groupChangeActions.PromoteMembersPendingAdminApproval = append(groupChangeActions.PromoteMembersPendingAdminApproval, &signalpb.GroupChange_Actions_PromoteMemberPendingAdminApprovalAction{ + groupChangeActions.PromoteRequestingMembers = append(groupChangeActions.PromoteRequestingMembers, &signalpb.GroupChange_Actions_PromoteRequestingMemberAction{ UserId: encryptedUserID[:], Role: signalpb.Member_Role(promoteRequestingMember.Role), }) @@ -1320,8 +1352,8 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("Encrypt UserId error for promoteRequestingMember") return nil, err } - groupChangeActions.AddMembersBanned = append(groupChangeActions.AddMembersBanned, &signalpb.GroupChange_Actions_AddMemberBannedAction{ - Added: &signalpb.MemberBanned{ + groupChangeActions.AddBannedMembers = append(groupChangeActions.AddBannedMembers, &signalpb.GroupChange_Actions_AddBannedMemberAction{ + Added: &signalpb.BannedMember{ UserId: encryptedUserID[:], Timestamp: addBannedMember.Timestamp, }, @@ -1333,7 +1365,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("Encrypt UserId error for promoteRequestingMember") return nil, err } - groupChangeActions.DeleteMembersBanned = append(groupChangeActions.DeleteMembersBanned, &signalpb.GroupChange_Actions_DeleteMemberBannedAction{ + groupChangeActions.DeleteBannedMembers = append(groupChangeActions.DeleteBannedMembers, &signalpb.GroupChange_Actions_DeleteBannedMemberAction{ DeletedUserId: encryptedUserID[:], }) } @@ -1364,7 +1396,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup log.Err(err).Msg("Could not get encrypt Title") return nil, err } - groupChangeActions.ModifyDisappearingMessageTimer = &signalpb.GroupChange_Actions_ModifyDisappearingMessageTimerAction{Timer: *encryptedTimer} + groupChangeActions.ModifyDisappearingMessagesTimer = &signalpb.GroupChange_Actions_ModifyDisappearingMessagesTimerAction{Timer: *encryptedTimer} } if decryptedGroupChange.ModifyInviteLinkPassword != nil { inviteLinkPasswordBytes, err := inviteLinkPasswordToBytes(*decryptedGroupChange.ModifyInviteLinkPassword) @@ -1379,7 +1411,7 @@ func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroup return cli.patchGroup(ctx, groupChangeActions, groupMasterKey, nil) } -func (cli *Client) encryptMember(ctx context.Context, member *GroupMember, groupSecretParams *libsignalgo.GroupSecretParams) (*signalpb.Member, *signalpb.MemberPendingProfileKey, error) { +func (cli *Client) encryptMember(ctx context.Context, member *GroupMember, groupSecretParams *libsignalgo.GroupSecretParams) (*signalpb.Member, *signalpb.PendingMember, error) { log := zerolog.Ctx(ctx) expiringProfileKeyCredential, err := cli.FetchExpiringProfileKeyCredentialById(ctx, member.ACI) if err != nil { @@ -1407,7 +1439,7 @@ func (cli *Client) encryptMember(ctx context.Context, member *GroupMember, group return &encryptedMember, nil, nil } -func (cli *Client) encryptPendingMember(ctx context.Context, pendingMember *PendingMember, groupSecretParams *libsignalgo.GroupSecretParams) (*signalpb.MemberPendingProfileKey, error) { +func (cli *Client) encryptPendingMember(ctx context.Context, pendingMember *PendingMember, groupSecretParams *libsignalgo.GroupSecretParams) (*signalpb.PendingMember, error) { log := zerolog.Ctx(ctx) encryptedUserID, err := groupSecretParams.EncryptServiceID(pendingMember.ServiceID) if err != nil { @@ -1419,7 +1451,7 @@ func (cli *Client) encryptPendingMember(ctx context.Context, pendingMember *Pend log.Err(err).Msg("Encrypt AddedByUserId error for addPendingMember") return nil, err } - encryptedPendingMember := signalpb.MemberPendingProfileKey{ + encryptedPendingMember := signalpb.PendingMember{ AddedByUserId: encryptedAddedByUserID[:], Member: &signalpb.Member{ UserId: encryptedUserID[:], @@ -1472,9 +1504,9 @@ func (cli *Client) patchGroup(ctx context.Context, groupChange *signalpb.GroupCh Password: &groupAuth.Password, ContentType: web.ContentTypeProtobuf, Body: requestBody, + Host: web.StorageHostname, } - resp, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodPatch, path, opts) - defer web.CloseBody(resp) + resp, err := web.SendHTTPRequest(ctx, http.MethodPatch, path, opts) if err != nil { return nil, fmt.Errorf("SendRequest error: %w", err) } @@ -1513,21 +1545,17 @@ func (cli *Client) patchGroup(ctx context.Context, groupChange *signalpb.GroupCh return &changeResp, nil } -var ErrGroupMasterKeyNotFound = errors.New("group master key not found in store") - func (cli *Client) UpdateGroup(ctx context.Context, groupChange *GroupChange, gid types.GroupIdentifier) (uint32, error) { log := zerolog.Ctx(ctx).With().Str("action", "UpdateGroup").Logger() groupMasterKey, err := cli.Store.GroupStore.MasterKeyFromGroupIdentifier(ctx, gid) if err != nil { return 0, fmt.Errorf("failed to get master key for group: %w", err) - } else if groupMasterKey == "" { - return 0, ErrGroupMasterKeyNotFound } groupChange.GroupMasterKey = groupMasterKey masterKeyBytes := masterKeyToBytes(groupMasterKey) var refetchedAddMemberCredentials bool var signedGroupChange *signalpb.GroupChangeResponse - group, _, err := cli.RetrieveGroupByID(ctx, gid, 0) + group, err := cli.RetrieveGroupByID(ctx, gid, 0) if err != nil { return 0, fmt.Errorf("failed to fetch group info to update: %w", err) } @@ -1550,8 +1578,10 @@ func (cli *Client) UpdateGroup(ctx context.Context, groupChange *GroupChange, gi return 0, fmt.Errorf("failed to update group: %w", err) } } else if errors.Is(err, ConflictError) { - cli.GroupCache.Delete(gid) - group, _, err = cli.RetrieveGroupByID(ctx, gid, 0) + delete(cli.GroupCache.groups, gid) + delete(cli.GroupCache.lastFetched, gid) + delete(cli.GroupCache.activeCalls, gid) + group, err = cli.RetrieveGroupByID(ctx, gid, 0) if err != nil { return 0, fmt.Errorf("failed to fetch group after conflict: %w", err) } @@ -1564,13 +1594,12 @@ func (cli *Client) UpdateGroup(ctx context.Context, groupChange *GroupChange, gi return 0, fmt.Errorf("unknown error encrypting and signing group change: %w", err) } } + delete(cli.GroupCache.groups, gid) + delete(cli.GroupCache.lastFetched, gid) + delete(cli.GroupCache.activeCalls, gid) if signedGroupChange == nil { return 0, fmt.Errorf("no signed group change returned: %w", err) } - err = cli.GroupCache.ApplyUpdate(groupChange, signedGroupChange.GroupSendEndorsementsResponse) - if err != nil { - log.Err(err).Msg("Failed to apply group change to cache") - } groupChangeBytes, err := proto.Marshal(signedGroupChange.GroupChange) if err != nil { return 0, fmt.Errorf("failed to marshal signed group change: %w", err) @@ -1603,12 +1632,12 @@ func (cli *Client) EncryptGroup(ctx context.Context, decryptedGroup *Group, grou encryptedGroup := &signalpb.Group{ PublicKey: groupPublicParams[:], Title: *encryptedTitle, - AvatarUrl: decryptedGroup.AvatarPath, + Avatar: decryptedGroup.AvatarPath, AnnouncementsOnly: decryptedGroup.AnnouncementsOnly, - Version: 0, + Revision: 0, } if decryptedGroup.Description != "" { - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_DescriptionText{DescriptionText: decryptedGroup.Description}} + attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_Description{Description: decryptedGroup.Description}} encryptedDescription, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) if err != nil { log.Err(err).Msg("Could not get encrypt Description") @@ -1634,7 +1663,7 @@ func (cli *Client) EncryptGroup(ctx context.Context, decryptedGroup *Group, grou if encryptedMember != nil { encryptedGroup.Members = append(encryptedGroup.Members, encryptedMember) } else { - encryptedGroup.MembersPendingProfileKey = append(encryptedGroup.MembersPendingProfileKey, encryptedPendingMember) + encryptedGroup.PendingMembers = append(encryptedGroup.PendingMembers, encryptedPendingMember) } } for _, pendingMember := range decryptedGroup.PendingMembers { @@ -1643,7 +1672,7 @@ func (cli *Client) EncryptGroup(ctx context.Context, decryptedGroup *Group, grou log.Err(err).Msg("Failed to encrypt pendingMember") return nil, err } - encryptedGroup.MembersPendingProfileKey = append(encryptedGroup.MembersPendingProfileKey, encryptedPendingMember) + encryptedGroup.PendingMembers = append(encryptedGroup.PendingMembers, encryptedPendingMember) } return encryptedGroup, nil } @@ -1666,7 +1695,7 @@ func PrepareGroupCreation(decryptedGroup *Group) (libsignalgo.GroupMasterKey, er return masterKeyBytes, nil } -func (cli *Client) createGroupOnServer(ctx context.Context, decryptedGroup *Group) (*Group, error) { +func (cli *Client) createGroupOnServer(ctx context.Context, decryptedGroup *Group, avatarBytes []byte) (*Group, error) { log := zerolog.Ctx(ctx).With().Str("action", "CreateGroupOnServer").Logger() masterKeyBytes, err := PrepareGroupCreation(decryptedGroup) if err != nil { @@ -1681,6 +1710,14 @@ func (cli *Client) createGroupOnServer(ctx context.Context, decryptedGroup *Grou log.Err(err).Msg("DeriveGroupSecretParamsFromMasterKey error") return nil, err } + if len(avatarBytes) > 0 { + avatarPath, err := cli.UploadGroupAvatar(ctx, avatarBytes, decryptedGroup.GroupIdentifier) + if err != nil { + log.Err(err).Msg("Failed to upload group avatar") + return nil, err + } + decryptedGroup.AvatarPath = avatarPath + } encryptedGroup, err := cli.EncryptGroup(ctx, decryptedGroup, groupSecretParams) if err != nil { log.Err(err).Msg("Failed to encrypt group") @@ -1702,9 +1739,9 @@ func (cli *Client) createGroupOnServer(ctx context.Context, decryptedGroup *Grou Password: &groupAuth.Password, ContentType: web.ContentTypeProtobuf, Body: requestBody, + Host: web.StorageHostname, } - resp, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodPut, path, opts) - defer web.CloseBody(resp) + resp, err := web.SendHTTPRequest(ctx, http.MethodPut, path, opts) if err != nil { return nil, fmt.Errorf("SendRequest error: %w", err) } @@ -1731,9 +1768,9 @@ func GenerateInviteLinkPassword() types.SerializedInviteLinkPassword { return InviteLinkPasswordFromBytes(random.Bytes(16)) } -func (cli *Client) CreateGroup(ctx context.Context, decryptedGroup *Group) (*Group, error) { +func (cli *Client) CreateGroup(ctx context.Context, decryptedGroup *Group, avatarBytes []byte) (*Group, error) { log := zerolog.Ctx(ctx).With().Str("action", "CreateGroup").Logger() - group, err := cli.createGroupOnServer(ctx, decryptedGroup) + group, err := cli.createGroupOnServer(ctx, decryptedGroup, avatarBytes) if err != nil { log.Err(err).Msg("Error creating group on server") return nil, err @@ -1756,7 +1793,7 @@ func (cli *Client) GetGroupHistoryPage(ctx context.Context, gid types.GroupIdent return nil, err } if groupMasterKey == "" { - return nil, ErrGroupMasterKeyNotFound + return nil, fmt.Errorf("No group master key found for group identifier %s", gid) } masterKeyBytes := masterKeyToBytes(groupMasterKey) groupAuth, err := cli.GetAuthorizationForToday(ctx, masterKeyBytes) @@ -1767,6 +1804,7 @@ func (cli *Client) GetGroupHistoryPage(ctx context.Context, gid types.GroupIdent Username: &groupAuth.Username, Password: &groupAuth.Password, ContentType: web.ContentTypeProtobuf, + Host: web.StorageHostname, Headers: map[string]string{ // TODO actually cache the data and provide real expiry timestamp "Cached-Send-Endorsements": "0", @@ -1774,8 +1812,7 @@ func (cli *Client) GetGroupHistoryPage(ctx context.Context, gid types.GroupIdent } // highest known epoch seems to always be 5, but that may change in the future. includeLastState is always false path := fmt.Sprintf("/v2/groups/logs/%d?maxSupportedChangeEpoch=%d&includeFirstState=%t&includeLastState=false", fromRevision, 5, includeFirstState) - response, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodGet, path, opts) - defer web.CloseBody(response) + response, err := web.SendHTTPRequest(ctx, http.MethodGet, path, opts) if err != nil { return nil, err } diff --git a/pkg/signalmeow/keys.go b/pkg/signalmeow/keys.go index 5439755..a3f2690 100644 --- a/pkg/signalmeow/keys.go +++ b/pkg/signalmeow/keys.go @@ -22,7 +22,7 @@ import ( "encoding/json" "errors" "fmt" - "math/rand/v2" + "math/rand" "net/http" "strings" "time" @@ -43,6 +43,25 @@ type GeneratedPreKeys struct { IdentityKey []uint8 } +func (cli *Client) GenerateAndRegisterPreKeys(ctx context.Context, pks store.PreKeyStore) error { + _, err := cli.GenerateAndSaveNextPreKeyBatch(ctx, pks, 0) + if err != nil { + return fmt.Errorf("failed to generate and save next prekey batch: %w", err) + } + _, err = cli.GenerateAndSaveNextKyberPreKeyBatch(ctx, pks, 0) + if err != nil { + return fmt.Errorf("failed to generate and save next kyber prekey batch: %w", err) + } + + // We need to upload all currently valid prekeys, not just the ones we just generated + err = cli.RegisterAllPreKeys(ctx, pks) + if err != nil { + return fmt.Errorf("failed to register prekey batches: %w", err) + } + + return err +} + func (cli *Client) RegisterAllPreKeys(ctx context.Context, pks store.PreKeyStore) error { var identityKeyPair *libsignalgo.IdentityKeyPair var pni bool @@ -78,11 +97,10 @@ func (cli *Client) RegisterAllPreKeys(ctx context.Context, pks store.PreKeyStore KyberPreKeys: kyberPreKeys, IdentityKey: identityKey, } - zerolog.Ctx(ctx).Debug(). - Int("num_prekeys", len(preKeys)). - Int("num_kyber_prekeys", len(kyberPreKeys)). - Msg("Registering all prekeys") - err = cli.RegisterPreKeys(ctx, &generatedPreKeys, pni) + preKeyUsername := fmt.Sprintf("%s.%d", cli.Store.ACI, cli.Store.DeviceID) + log := zerolog.Ctx(ctx).With().Str("action", "register prekeys").Logger() + log.Debug().Int("num_prekeys", len(preKeys)).Int("num_kyber_prekeys", len(kyberPreKeys)).Msg("Registering prekeys") + err = RegisterPreKeys(ctx, &generatedPreKeys, pni, preKeyUsername, cli.Store.Password) if err != nil { return fmt.Errorf("failed to register prekeys: %w", err) } @@ -328,11 +346,11 @@ func KyberPreKeyToJSON(kyberPreKey *libsignalgo.KyberPreKeyRecord) (map[string]i var errPrekeyUpload422 = errors.New("http 422 while registering prekeys") -func (cli *Client) RegisterPreKeys(ctx context.Context, generatedPreKeys *GeneratedPreKeys, pni bool) error { +func RegisterPreKeys(ctx context.Context, generatedPreKeys *GeneratedPreKeys, pni bool, username string, password string) error { log := zerolog.Ctx(ctx).With().Str("action", "register prekeys").Logger() // Convert generated prekeys to JSON - preKeysJson := []map[string]any{} - kyberPreKeysJson := []map[string]any{} + preKeysJson := []map[string]interface{}{} + kyberPreKeysJson := []map[string]interface{}{} for _, preKey := range generatedPreKeys.PreKeys { preKeyJson, err := PreKeyToJSON(preKey) if err != nil { @@ -349,27 +367,32 @@ func (cli *Client) RegisterPreKeys(ctx context.Context, generatedPreKeys *Genera } identityKey := generatedPreKeys.IdentityKey - registerJSON := map[string]any{ + register_json := map[string]interface{}{ "preKeys": preKeysJson, "pqPreKeys": kyberPreKeysJson, "identityKey": base64.StdEncoding.EncodeToString(identityKey), } // Send request - jsonBytes, err := json.Marshal(registerJSON) + jsonBytes, err := json.Marshal(register_json) if err != nil { log.Err(err).Msg("Error marshalling register JSON") return err } - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodPut, keysPath(pni), jsonBytes, nil) + opts := &web.HTTPReqOpt{Body: jsonBytes, Username: &username, Password: &password} + resp, err := web.SendHTTPRequest(ctx, http.MethodPut, keysPath(pni), opts) if err != nil { log.Err(err).Msg("Error sending request") return err } - if resp.GetStatus() == 422 { + defer resp.Body.Close() + // status code not 2xx + if resp.StatusCode == 422 { return errPrekeyUpload422 + } else if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return fmt.Errorf("error registering prekeys: %v", resp.Status) } - return web.DecodeWSResponseBody(ctx, nil, resp) + return err } type prekeyResponse struct { @@ -404,40 +427,25 @@ func addBase64PaddingAndDecode(data string) ([]byte, error) { return base64.StdEncoding.DecodeString(data) } -var ( - ErrUnregisteredUser = errors.New("user is unregistered") - ErrDevicesChanged = errors.New("device list changed while sending skdm") -) - func (cli *Client) FetchAndProcessPreKey(ctx context.Context, theirServiceID libsignalgo.ServiceID, specificDeviceID int) error { - if cli.Store.RecipientStore.IsUnregistered(ctx, theirServiceID) { - return fmt.Errorf("%w (cached)", ErrUnregisteredUser) - } - localAddress, err := cli.Store.ACIServiceID().Address(uint(cli.Store.DeviceID)) - if err != nil { - return fmt.Errorf("failed to get own address: %w", err) - } // Fetch prekey deviceIDPath := "/*" if specificDeviceID >= 0 { deviceIDPath = "/" + fmt.Sprint(specificDeviceID) } - // TODO this should be done via the unauthed websocket if possible path := "/v2/keys/" + theirServiceID.String() + deviceIDPath + "?pq=true" - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, path, nil, nil) + username, password := cli.Store.BasicAuthCreds() + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, path, &web.HTTPReqOpt{Username: &username, Password: &password}) if err != nil { return fmt.Errorf("error sending request: %w", err) - } else if resp.GetStatus() == 404 { - cli.Store.RecipientStore.MarkUnregistered(ctx, theirServiceID, true) - return fmt.Errorf("%w (404 while querying keys)", ErrUnregisteredUser) } - var respData prekeyResponse - err = web.DecodeWSResponseBody(ctx, &respData, resp) + var prekeyResponse prekeyResponse + err = web.DecodeHTTPResponseBody(ctx, &prekeyResponse, resp) if err != nil { return fmt.Errorf("error decoding response body: %w", err) } - rawIdentityKey, err := addBase64PaddingAndDecode(respData.IdentityKey) + rawIdentityKey, err := addBase64PaddingAndDecode(prekeyResponse.IdentityKey) if err != nil { return fmt.Errorf("error decoding identity key: %w", err) } @@ -450,7 +458,7 @@ func (cli *Client) FetchAndProcessPreKey(ctx context.Context, theirServiceID lib } // Process each prekey in response (should only be one at the moment) - for _, d := range respData.Devices { + for _, d := range prekeyResponse.Devices { var publicKey *libsignalgo.PublicKey var preKeyID uint32 if d.PreKey != nil { @@ -522,7 +530,6 @@ func (cli *Client) FetchAndProcessPreKey(ctx context.Context, theirServiceID lib ctx, preKeyBundle, address, - localAddress, cli.Store.ACISessionStore, cli.Store.ACIIdentityStore, ) @@ -548,18 +555,19 @@ func keysPath(pni bool) string { func (cli *Client) GetMyKeyCounts(ctx context.Context, pni bool) (int, int, error) { log := zerolog.Ctx(ctx).With().Str("action", "get my key counts").Logger() - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, keysPath(pni), nil, nil) + username, password := cli.Store.BasicAuthCreds() + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, keysPath(pni), &web.HTTPReqOpt{Username: &username, Password: &password}) if err != nil { log.Err(err).Msg("Error sending request") return 0, 0, err } - var respData preKeyCountResponse - err = web.DecodeWSResponseBody(ctx, &respData, resp) + var preKeyCountResponse preKeyCountResponse + err = web.DecodeHTTPResponseBody(ctx, &preKeyCountResponse, resp) if err != nil { log.Err(err).Msg("Fetching prekey counts, error with response body") return 0, 0, err } - return respData.Count, respData.PQCount, err + return preKeyCountResponse.Count, preKeyCountResponse.PQCount, err } func (cli *Client) CheckAndUploadNewPreKeys(ctx context.Context, pks store.PreKeyStore) error { @@ -596,29 +604,23 @@ func (cli *Client) keyCheckLoop(ctx context.Context) { log := zerolog.Ctx(ctx).With().Str("action", "start key check loop").Logger() // Do the initial check in 5-10 minutes after starting the loop - windowStart := 0 - windowSize := 1 - firstRun := true + window_start := 0 + window_size := 1 for { - randomMinutesInWindow := rand.IntN(windowSize) + windowStart - checkTime := time.Duration(randomMinutesInWindow) * time.Minute - if firstRun { - checkTime = 0 - firstRun = false - } else { - log.Debug().Dur("check_time", checkTime).Msg("Waiting to check for new prekeys") - } + random_minutes_in_window := rand.Intn(window_size) + window_start + check_time := time.Duration(random_minutes_in_window) * time.Minute + log.Debug().Dur("check_time", check_time).Msg("Waiting to check for new prekeys") select { case <-ctx.Done(): return - case <-time.After(checkTime): + case <-time.After(check_time): err := cli.CheckAndUploadNewPreKeys(ctx, cli.Store.ACIPreKeyStore) if err != nil { log.Err(err).Msg("Error checking and uploading new prekeys for ACI identity") // Retry within half an hour - windowStart = 5 - windowSize = 25 + window_start = 5 + window_size = 25 continue } err = cli.CheckAndUploadNewPreKeys(ctx, cli.Store.PNIPreKeyStore) @@ -634,13 +636,13 @@ func (cli *Client) keyCheckLoop(ctx context.Context) { } log.Err(err).Msg("Error checking and uploading new prekeys for PNI identity") // Retry within half an hour - windowStart = 5 - windowSize = 25 + window_start = 5 + window_size = 25 continue } // After a successful check, check again in 36 to 60 hours - windowStart = 36 * 60 - windowSize = 24 * 60 + window_start = 36 * 60 + window_size = 24 * 60 } } } diff --git a/pkg/signalmeow/misc.go b/pkg/signalmeow/misc.go index 70d3ba5..1bf88a3 100644 --- a/pkg/signalmeow/misc.go +++ b/pkg/signalmeow/misc.go @@ -18,10 +18,7 @@ package signalmeow import ( _ "embed" - "errors" - "fmt" - "github.com/google/uuid" "github.com/rs/zerolog" "go.mau.fi/util/exerrors" @@ -69,8 +66,6 @@ func (l FFILogger) Log(level libsignalgo.LogLevel, file string, line uint, messa func (FFILogger) Flush() {} -func (FFILogger) Destroy() {} - // Ensure FFILogger implements the Logger interface var _ libsignalgo.Logger = FFILogger{} @@ -81,28 +76,3 @@ var prodServerPublicParams *libsignalgo.ServerPublicParams func init() { prodServerPublicParams = exerrors.Must(libsignalgo.DeserializeServerPublicParams(prodServerPublicParamsSlice)) } - -var ErrEmptyUUIDInput = errors.New("both input variables are empty") - -func ParseStringOrBinaryServiceID(str string, bytes []byte) (libsignalgo.ServiceID, error) { - if str != "" { - return libsignalgo.ServiceIDFromString(str) - } - if bytes != nil { - return libsignalgo.ServiceIDFromBytes(bytes) - } - return libsignalgo.EmptyServiceID, ErrEmptyUUIDInput -} - -func ParseStringOrBinaryUUID(str string, bytes []byte) (uuid.UUID, error) { - if str != "" { - return uuid.Parse(str) - } - if bytes != nil { - if len(bytes) != 16 { - return uuid.Nil, fmt.Errorf("invalid UUID length %d (expected 16)", len(bytes)) - } - return uuid.UUID(bytes), nil - } - return uuid.Nil, ErrEmptyUUIDInput -} diff --git a/pkg/signalmeow/profile.go b/pkg/signalmeow/profile.go index a515f5a..81f1ed8 100644 --- a/pkg/signalmeow/profile.go +++ b/pkg/signalmeow/profile.go @@ -134,6 +134,14 @@ func (cli *Client) getCachedProfileByID(signalID uuid.UUID, refreshAfter time.Du } func (cli *Client) RetrieveProfileByID(ctx context.Context, signalID uuid.UUID, refreshAfter time.Duration) (*types.Profile, error) { + if cli.ProfileCache == nil { + cli.ProfileCache = &ProfileCache{ + profiles: make(map[string]*types.Profile), + errors: make(map[string]*error), + lastFetched: make(map[string]time.Time), + } + } + // Check if we have a cached profile that is less than an hour old // or if we have a cached error that is less than an hour old profile, err := cli.getCachedProfileByID(signalID, refreshAfter) @@ -210,18 +218,18 @@ func (cli *Client) fetchProfileWithRequestAndKey(ctx context.Context, signalID u path += "/" + string(credentialRequest) path += "?credentialType=expiringProfileKey" } - headers := http.Header{} + profileRequest := web.CreateWSRequest(http.MethodGet, path, nil, nil, nil) if useUnidentified { - headers.Set("Unidentified-Access-Key", base64AccessKey) - headers.Set("Accept-Language", "en-US") + profileRequest.Headers = append(profileRequest.Headers, "unidentified-access-key:"+base64AccessKey) + profileRequest.Headers = append(profileRequest.Headers, "accept-language:en-CA") } - resp, err := cli.UnauthedWS.SendRequest(ctx, http.MethodGet, path, nil, headers) + resp, err := cli.UnauthedWS.SendRequest(ctx, profileRequest) if err != nil { return nil, fmt.Errorf("error sending request: %w", err) } var profile types.Profile profile.FetchedAt = time.Now() - logEvt := log.Trace().Uint32("status_code", resp.GetStatus()).Str("resp_message", resp.GetMessage()) + logEvt := log.Trace().Uint32("status_code", resp.GetStatus()) if logEvt.Enabled() { if json.Valid(resp.Body) { logEvt.RawJSON("response_data", resp.Body) @@ -280,14 +288,15 @@ func (cli *Client) fetchProfileWithRequestAndKey(ctx context.Context, signalID u func (cli *Client) DownloadUserAvatar(ctx context.Context, avatarPath string, profileKey libsignalgo.ProfileKey) ([]byte, error) { username, password := cli.Store.BasicAuthCreds() opts := &web.HTTPReqOpt{ + Host: web.CDN1Hostname, Username: &username, Password: &password, } - resp, err := web.SendHTTPRequest(ctx, web.CDN1Hostname, http.MethodGet, avatarPath, opts) + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, avatarPath, opts) if err != nil { return nil, fmt.Errorf("failed to send request: %w", err) } - defer web.CloseBody(resp) + defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode >= 300 { return nil, fmt.Errorf("unexpected response status %d", resp.StatusCode) } diff --git a/pkg/signalmeow/protobuf/ContactDiscovery.pb.go b/pkg/signalmeow/protobuf/ContactDiscovery.pb.go index 5cb232c..97ac6b4 100644 --- a/pkg/signalmeow/protobuf/ContactDiscovery.pb.go +++ b/pkg/signalmeow/protobuf/ContactDiscovery.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: ContactDiscovery.proto // Copyright 2021 Signal Messenger, LLC diff --git a/pkg/signalmeow/protobuf/DeviceName.pb.go b/pkg/signalmeow/protobuf/DeviceName.pb.go index 31b5704..e83e374 100644 --- a/pkg/signalmeow/protobuf/DeviceName.pb.go +++ b/pkg/signalmeow/protobuf/DeviceName.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: DeviceName.proto // Copyright 2018 Signal Messenger, LLC diff --git a/pkg/signalmeow/protobuf/Groups.pb.go b/pkg/signalmeow/protobuf/Groups.pb.go index 8d4e2e3..7178760 100644 --- a/pkg/signalmeow/protobuf/Groups.pb.go +++ b/pkg/signalmeow/protobuf/Groups.pb.go @@ -1,11 +1,12 @@ +//* +// Copyright (C) 2019 Open Whisper Systems // -// Copyright 2020 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only +// Licensed according to the LICENSE file in this repository. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: Groups.proto package signalpb @@ -222,16 +223,14 @@ func (x *AvatarUploadAttributes) GetSignature() string { } type Member struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - Role Member_Role `protobuf:"varint,2,opt,name=role,proto3,enum=signal.Member_Role" json:"role,omitempty"` - ProfileKey []byte `protobuf:"bytes,3,opt,name=profileKey,proto3" json:"profileKey,omitempty"` - Presentation []byte `protobuf:"bytes,4,opt,name=presentation,proto3" json:"presentation,omitempty"` - JoinedAtVersion uint32 `protobuf:"varint,5,opt,name=joinedAtVersion,proto3" json:"joinedAtVersion,omitempty"` - LabelEmoji []byte `protobuf:"bytes,6,opt,name=labelEmoji,proto3" json:"labelEmoji,omitempty"` // decrypts to a UTF-8 string - LabelString []byte `protobuf:"bytes,7,opt,name=labelString,proto3" json:"labelString,omitempty"` // decrypts to a UTF-8 string - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Role Member_Role `protobuf:"varint,2,opt,name=role,proto3,enum=Member_Role" json:"role,omitempty"` + ProfileKey []byte `protobuf:"bytes,3,opt,name=profileKey,proto3" json:"profileKey,omitempty"` + Presentation []byte `protobuf:"bytes,4,opt,name=presentation,proto3" json:"presentation,omitempty"` // Only set when sending to server + JoinedAtRevision uint32 `protobuf:"varint,5,opt,name=joinedAtRevision,proto3" json:"joinedAtRevision,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Member) Reset() { @@ -292,50 +291,36 @@ func (x *Member) GetPresentation() []byte { return nil } -func (x *Member) GetJoinedAtVersion() uint32 { +func (x *Member) GetJoinedAtRevision() uint32 { if x != nil { - return x.JoinedAtVersion + return x.JoinedAtRevision } return 0 } -func (x *Member) GetLabelEmoji() []byte { - if x != nil { - return x.LabelEmoji - } - return nil -} - -func (x *Member) GetLabelString() []byte { - if x != nil { - return x.LabelString - } - return nil -} - -type MemberPendingProfileKey struct { +type PendingMember struct { state protoimpl.MessageState `protogen:"open.v1"` Member *Member `protobuf:"bytes,1,opt,name=member,proto3" json:"member,omitempty"` AddedByUserId []byte `protobuf:"bytes,2,opt,name=addedByUserId,proto3" json:"addedByUserId,omitempty"` - Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // ms since epoch + Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *MemberPendingProfileKey) Reset() { - *x = MemberPendingProfileKey{} +func (x *PendingMember) Reset() { + *x = PendingMember{} mi := &file_Groups_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *MemberPendingProfileKey) String() string { +func (x *PendingMember) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MemberPendingProfileKey) ProtoMessage() {} +func (*PendingMember) ProtoMessage() {} -func (x *MemberPendingProfileKey) ProtoReflect() protoreflect.Message { +func (x *PendingMember) ProtoReflect() protoreflect.Message { mi := &file_Groups_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -347,56 +332,56 @@ func (x *MemberPendingProfileKey) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MemberPendingProfileKey.ProtoReflect.Descriptor instead. -func (*MemberPendingProfileKey) Descriptor() ([]byte, []int) { +// Deprecated: Use PendingMember.ProtoReflect.Descriptor instead. +func (*PendingMember) Descriptor() ([]byte, []int) { return file_Groups_proto_rawDescGZIP(), []int{2} } -func (x *MemberPendingProfileKey) GetMember() *Member { +func (x *PendingMember) GetMember() *Member { if x != nil { return x.Member } return nil } -func (x *MemberPendingProfileKey) GetAddedByUserId() []byte { +func (x *PendingMember) GetAddedByUserId() []byte { if x != nil { return x.AddedByUserId } return nil } -func (x *MemberPendingProfileKey) GetTimestamp() uint64 { +func (x *PendingMember) GetTimestamp() uint64 { if x != nil { return x.Timestamp } return 0 } -type MemberPendingAdminApproval struct { +type RequestingMember struct { state protoimpl.MessageState `protogen:"open.v1"` UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` ProfileKey []byte `protobuf:"bytes,2,opt,name=profileKey,proto3" json:"profileKey,omitempty"` - Presentation []byte `protobuf:"bytes,3,opt,name=presentation,proto3" json:"presentation,omitempty"` - Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // ms since epoch + Presentation []byte `protobuf:"bytes,3,opt,name=presentation,proto3" json:"presentation,omitempty"` // Only set when sending to server + Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *MemberPendingAdminApproval) Reset() { - *x = MemberPendingAdminApproval{} +func (x *RequestingMember) Reset() { + *x = RequestingMember{} mi := &file_Groups_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *MemberPendingAdminApproval) String() string { +func (x *RequestingMember) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MemberPendingAdminApproval) ProtoMessage() {} +func (*RequestingMember) ProtoMessage() {} -func (x *MemberPendingAdminApproval) ProtoReflect() protoreflect.Message { +func (x *RequestingMember) ProtoReflect() protoreflect.Message { mi := &file_Groups_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -408,61 +393,61 @@ func (x *MemberPendingAdminApproval) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MemberPendingAdminApproval.ProtoReflect.Descriptor instead. -func (*MemberPendingAdminApproval) Descriptor() ([]byte, []int) { +// Deprecated: Use RequestingMember.ProtoReflect.Descriptor instead. +func (*RequestingMember) Descriptor() ([]byte, []int) { return file_Groups_proto_rawDescGZIP(), []int{3} } -func (x *MemberPendingAdminApproval) GetUserId() []byte { +func (x *RequestingMember) GetUserId() []byte { if x != nil { return x.UserId } return nil } -func (x *MemberPendingAdminApproval) GetProfileKey() []byte { +func (x *RequestingMember) GetProfileKey() []byte { if x != nil { return x.ProfileKey } return nil } -func (x *MemberPendingAdminApproval) GetPresentation() []byte { +func (x *RequestingMember) GetPresentation() []byte { if x != nil { return x.Presentation } return nil } -func (x *MemberPendingAdminApproval) GetTimestamp() uint64 { +func (x *RequestingMember) GetTimestamp() uint64 { if x != nil { return x.Timestamp } return 0 } -type MemberBanned struct { +type BannedMember struct { state protoimpl.MessageState `protogen:"open.v1"` UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // ms since epoch + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *MemberBanned) Reset() { - *x = MemberBanned{} +func (x *BannedMember) Reset() { + *x = BannedMember{} mi := &file_Groups_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *MemberBanned) String() string { +func (x *BannedMember) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MemberBanned) ProtoMessage() {} +func (*BannedMember) ProtoMessage() {} -func (x *MemberBanned) ProtoReflect() protoreflect.Message { +func (x *BannedMember) ProtoReflect() protoreflect.Message { mi := &file_Groups_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -474,19 +459,19 @@ func (x *MemberBanned) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MemberBanned.ProtoReflect.Descriptor instead. -func (*MemberBanned) Descriptor() ([]byte, []int) { +// Deprecated: Use BannedMember.ProtoReflect.Descriptor instead. +func (*BannedMember) Descriptor() ([]byte, []int) { return file_Groups_proto_rawDescGZIP(), []int{4} } -func (x *MemberBanned) GetUserId() []byte { +func (x *BannedMember) GetUserId() []byte { if x != nil { return x.UserId } return nil } -func (x *MemberBanned) GetTimestamp() uint64 { +func (x *BannedMember) GetTimestamp() uint64 { if x != nil { return x.Timestamp } @@ -495,10 +480,9 @@ func (x *MemberBanned) GetTimestamp() uint64 { type AccessControl struct { state protoimpl.MessageState `protogen:"open.v1"` - Attributes AccessControl_AccessRequired `protobuf:"varint,1,opt,name=attributes,proto3,enum=signal.AccessControl_AccessRequired" json:"attributes,omitempty"` - Members AccessControl_AccessRequired `protobuf:"varint,2,opt,name=members,proto3,enum=signal.AccessControl_AccessRequired" json:"members,omitempty"` - AddFromInviteLink AccessControl_AccessRequired `protobuf:"varint,3,opt,name=addFromInviteLink,proto3,enum=signal.AccessControl_AccessRequired" json:"addFromInviteLink,omitempty"` - MemberLabel AccessControl_AccessRequired `protobuf:"varint,4,opt,name=memberLabel,proto3,enum=signal.AccessControl_AccessRequired" json:"memberLabel,omitempty"` + Attributes AccessControl_AccessRequired `protobuf:"varint,1,opt,name=attributes,proto3,enum=AccessControl_AccessRequired" json:"attributes,omitempty"` + Members AccessControl_AccessRequired `protobuf:"varint,2,opt,name=members,proto3,enum=AccessControl_AccessRequired" json:"members,omitempty"` + AddFromInviteLink AccessControl_AccessRequired `protobuf:"varint,3,opt,name=addFromInviteLink,proto3,enum=AccessControl_AccessRequired" json:"addFromInviteLink,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -554,33 +538,23 @@ func (x *AccessControl) GetAddFromInviteLink() AccessControl_AccessRequired { return AccessControl_UNKNOWN } -func (x *AccessControl) GetMemberLabel() AccessControl_AccessRequired { - if x != nil { - return x.MemberLabel - } - return AccessControl_UNKNOWN -} - type Group struct { - state protoimpl.MessageState `protogen:"open.v1"` - PublicKey []byte `protobuf:"bytes,1,opt,name=publicKey,proto3" json:"publicKey,omitempty"` - Title []byte `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Description []byte `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` - // The URL for this group's avatar. The content at this URL can be - // decrypted/deserialized into a `GroupAttributeBlob`. - AvatarUrl string `protobuf:"bytes,3,opt,name=avatarUrl,proto3" json:"avatarUrl,omitempty"` - DisappearingMessagesTimer []byte `protobuf:"bytes,4,opt,name=disappearingMessagesTimer,proto3" json:"disappearingMessagesTimer,omitempty"` - AccessControl *AccessControl `protobuf:"bytes,5,opt,name=accessControl,proto3" json:"accessControl,omitempty"` - Version uint32 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"` - Members []*Member `protobuf:"bytes,7,rep,name=members,proto3" json:"members,omitempty"` - MembersPendingProfileKey []*MemberPendingProfileKey `protobuf:"bytes,8,rep,name=membersPendingProfileKey,proto3" json:"membersPendingProfileKey,omitempty"` - MembersPendingAdminApproval []*MemberPendingAdminApproval `protobuf:"bytes,9,rep,name=membersPendingAdminApproval,proto3" json:"membersPendingAdminApproval,omitempty"` - InviteLinkPassword []byte `protobuf:"bytes,10,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` - AnnouncementsOnly bool `protobuf:"varint,12,opt,name=announcements_only,json=announcementsOnly,proto3" json:"announcements_only,omitempty"` - MembersBanned []*MemberBanned `protobuf:"bytes,13,rep,name=members_banned,json=membersBanned,proto3" json:"members_banned,omitempty"` - Terminated bool `protobuf:"varint,14,opt,name=terminated,proto3" json:"terminated,omitempty"` // next: 15 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PublicKey []byte `protobuf:"bytes,1,opt,name=publicKey,proto3" json:"publicKey,omitempty"` + Title []byte `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` + DisappearingMessagesTimer []byte `protobuf:"bytes,4,opt,name=disappearingMessagesTimer,proto3" json:"disappearingMessagesTimer,omitempty"` + AccessControl *AccessControl `protobuf:"bytes,5,opt,name=accessControl,proto3" json:"accessControl,omitempty"` + Revision uint32 `protobuf:"varint,6,opt,name=revision,proto3" json:"revision,omitempty"` + Members []*Member `protobuf:"bytes,7,rep,name=members,proto3" json:"members,omitempty"` + PendingMembers []*PendingMember `protobuf:"bytes,8,rep,name=pendingMembers,proto3" json:"pendingMembers,omitempty"` + RequestingMembers []*RequestingMember `protobuf:"bytes,9,rep,name=requestingMembers,proto3" json:"requestingMembers,omitempty"` + InviteLinkPassword []byte `protobuf:"bytes,10,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` + Description []byte `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` + AnnouncementsOnly bool `protobuf:"varint,12,opt,name=announcementsOnly,proto3" json:"announcementsOnly,omitempty"` + BannedMembers []*BannedMember `protobuf:"bytes,13,rep,name=bannedMembers,proto3" json:"bannedMembers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Group) Reset() { @@ -627,16 +601,9 @@ func (x *Group) GetTitle() []byte { return nil } -func (x *Group) GetDescription() []byte { +func (x *Group) GetAvatar() string { if x != nil { - return x.Description - } - return nil -} - -func (x *Group) GetAvatarUrl() string { - if x != nil { - return x.AvatarUrl + return x.Avatar } return "" } @@ -655,9 +622,9 @@ func (x *Group) GetAccessControl() *AccessControl { return nil } -func (x *Group) GetVersion() uint32 { +func (x *Group) GetRevision() uint32 { if x != nil { - return x.Version + return x.Revision } return 0 } @@ -669,16 +636,16 @@ func (x *Group) GetMembers() []*Member { return nil } -func (x *Group) GetMembersPendingProfileKey() []*MemberPendingProfileKey { +func (x *Group) GetPendingMembers() []*PendingMember { if x != nil { - return x.MembersPendingProfileKey + return x.PendingMembers } return nil } -func (x *Group) GetMembersPendingAdminApproval() []*MemberPendingAdminApproval { +func (x *Group) GetRequestingMembers() []*RequestingMember { if x != nil { - return x.MembersPendingAdminApproval + return x.RequestingMembers } return nil } @@ -690,6 +657,13 @@ func (x *Group) GetInviteLinkPassword() []byte { return nil } +func (x *Group) GetDescription() []byte { + if x != nil { + return x.Description + } + return nil +} + func (x *Group) GetAnnouncementsOnly() bool { if x != nil { return x.AnnouncementsOnly @@ -697,18 +671,227 @@ func (x *Group) GetAnnouncementsOnly() bool { return false } -func (x *Group) GetMembersBanned() []*MemberBanned { +func (x *Group) GetBannedMembers() []*BannedMember { if x != nil { - return x.MembersBanned + return x.BannedMembers } return nil } -func (x *Group) GetTerminated() bool { +type GroupChange struct { + state protoimpl.MessageState `protogen:"open.v1"` + Actions []byte `protobuf:"bytes,1,opt,name=actions,proto3" json:"actions,omitempty"` + ServerSignature []byte `protobuf:"bytes,2,opt,name=serverSignature,proto3" json:"serverSignature,omitempty"` + ChangeEpoch uint32 `protobuf:"varint,3,opt,name=changeEpoch,proto3" json:"changeEpoch,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupChange) Reset() { + *x = GroupChange{} + mi := &file_Groups_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupChange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange) ProtoMessage() {} + +func (x *GroupChange) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[7] if x != nil { - return x.Terminated + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return false + return mi.MessageOf(x) +} + +// Deprecated: Use GroupChange.ProtoReflect.Descriptor instead. +func (*GroupChange) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7} +} + +func (x *GroupChange) GetActions() []byte { + if x != nil { + return x.Actions + } + return nil +} + +func (x *GroupChange) GetServerSignature() []byte { + if x != nil { + return x.ServerSignature + } + return nil +} + +func (x *GroupChange) GetChangeEpoch() uint32 { + if x != nil { + return x.ChangeEpoch + } + return 0 +} + +type GroupResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + GroupSendEndorsementsResponse []byte `protobuf:"bytes,2,opt,name=groupSendEndorsementsResponse,proto3" json:"groupSendEndorsementsResponse,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupResponse) Reset() { + *x = GroupResponse{} + mi := &file_Groups_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupResponse) ProtoMessage() {} + +func (x *GroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupResponse.ProtoReflect.Descriptor instead. +func (*GroupResponse) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{8} +} + +func (x *GroupResponse) GetGroup() *Group { + if x != nil { + return x.Group + } + return nil +} + +func (x *GroupResponse) GetGroupSendEndorsementsResponse() []byte { + if x != nil { + return x.GroupSendEndorsementsResponse + } + return nil +} + +type GroupChanges struct { + state protoimpl.MessageState `protogen:"open.v1"` + GroupChanges []*GroupChanges_GroupChangeState `protobuf:"bytes,1,rep,name=groupChanges,proto3" json:"groupChanges,omitempty"` + GroupSendEndorsementsResponse []byte `protobuf:"bytes,2,opt,name=groupSendEndorsementsResponse,proto3" json:"groupSendEndorsementsResponse,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupChanges) Reset() { + *x = GroupChanges{} + mi := &file_Groups_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupChanges) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChanges) ProtoMessage() {} + +func (x *GroupChanges) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupChanges.ProtoReflect.Descriptor instead. +func (*GroupChanges) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{9} +} + +func (x *GroupChanges) GetGroupChanges() []*GroupChanges_GroupChangeState { + if x != nil { + return x.GroupChanges + } + return nil +} + +func (x *GroupChanges) GetGroupSendEndorsementsResponse() []byte { + if x != nil { + return x.GroupSendEndorsementsResponse + } + return nil +} + +type GroupChangeResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + GroupChange *GroupChange `protobuf:"bytes,1,opt,name=groupChange,proto3" json:"groupChange,omitempty"` + GroupSendEndorsementsResponse []byte `protobuf:"bytes,2,opt,name=groupSendEndorsementsResponse,proto3" json:"groupSendEndorsementsResponse,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupChangeResponse) Reset() { + *x = GroupChangeResponse{} + mi := &file_Groups_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupChangeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChangeResponse) ProtoMessage() {} + +func (x *GroupChangeResponse) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupChangeResponse.ProtoReflect.Descriptor instead. +func (*GroupChangeResponse) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{10} +} + +func (x *GroupChangeResponse) GetGroupChange() *GroupChange { + if x != nil { + return x.GroupChange + } + return nil +} + +func (x *GroupChangeResponse) GetGroupSendEndorsementsResponse() []byte { + if x != nil { + return x.GroupSendEndorsementsResponse + } + return nil } type GroupAttributeBlob struct { @@ -718,7 +901,7 @@ type GroupAttributeBlob struct { // *GroupAttributeBlob_Title // *GroupAttributeBlob_Avatar // *GroupAttributeBlob_DisappearingMessagesDuration - // *GroupAttributeBlob_DescriptionText + // *GroupAttributeBlob_Description Content isGroupAttributeBlob_Content `protobuf_oneof:"content"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -726,7 +909,7 @@ type GroupAttributeBlob struct { func (x *GroupAttributeBlob) Reset() { *x = GroupAttributeBlob{} - mi := &file_Groups_proto_msgTypes[7] + mi := &file_Groups_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -738,7 +921,7 @@ func (x *GroupAttributeBlob) String() string { func (*GroupAttributeBlob) ProtoMessage() {} func (x *GroupAttributeBlob) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[7] + mi := &file_Groups_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -751,7 +934,7 @@ func (x *GroupAttributeBlob) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupAttributeBlob.ProtoReflect.Descriptor instead. func (*GroupAttributeBlob) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{7} + return file_Groups_proto_rawDescGZIP(), []int{11} } func (x *GroupAttributeBlob) GetContent() isGroupAttributeBlob_Content { @@ -788,10 +971,10 @@ func (x *GroupAttributeBlob) GetDisappearingMessagesDuration() uint32 { return 0 } -func (x *GroupAttributeBlob) GetDescriptionText() string { +func (x *GroupAttributeBlob) GetDescription() string { if x != nil { - if x, ok := x.Content.(*GroupAttributeBlob_DescriptionText); ok { - return x.DescriptionText + if x, ok := x.Content.(*GroupAttributeBlob_Description); ok { + return x.Description } } return "" @@ -813,8 +996,8 @@ type GroupAttributeBlob_DisappearingMessagesDuration struct { DisappearingMessagesDuration uint32 `protobuf:"varint,3,opt,name=disappearingMessagesDuration,proto3,oneof"` } -type GroupAttributeBlob_DescriptionText struct { - DescriptionText string `protobuf:"bytes,4,opt,name=descriptionText,proto3,oneof"` +type GroupAttributeBlob_Description struct { + Description string `protobuf:"bytes,4,opt,name=description,proto3,oneof"` } func (*GroupAttributeBlob_Title) isGroupAttributeBlob_Content() {} @@ -823,13 +1006,13 @@ func (*GroupAttributeBlob_Avatar) isGroupAttributeBlob_Content() {} func (*GroupAttributeBlob_DisappearingMessagesDuration) isGroupAttributeBlob_Content() {} -func (*GroupAttributeBlob_DescriptionText) isGroupAttributeBlob_Content() {} +func (*GroupAttributeBlob_Description) isGroupAttributeBlob_Content() {} type GroupInviteLink struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Contents: // - // *GroupInviteLink_ContentsV1 + // *GroupInviteLink_V1Contents Contents isGroupInviteLink_Contents `protobuf_oneof:"contents"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -837,7 +1020,7 @@ type GroupInviteLink struct { func (x *GroupInviteLink) Reset() { *x = GroupInviteLink{} - mi := &file_Groups_proto_msgTypes[8] + mi := &file_Groups_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -849,7 +1032,7 @@ func (x *GroupInviteLink) String() string { func (*GroupInviteLink) ProtoMessage() {} func (x *GroupInviteLink) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[8] + mi := &file_Groups_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -862,7 +1045,7 @@ func (x *GroupInviteLink) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInviteLink.ProtoReflect.Descriptor instead. func (*GroupInviteLink) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{8} + return file_Groups_proto_rawDescGZIP(), []int{12} } func (x *GroupInviteLink) GetContents() isGroupInviteLink_Contents { @@ -872,10 +1055,10 @@ func (x *GroupInviteLink) GetContents() isGroupInviteLink_Contents { return nil } -func (x *GroupInviteLink) GetContentsV1() *GroupInviteLink_GroupInviteLinkContentsV1 { +func (x *GroupInviteLink) GetV1Contents() *GroupInviteLink_GroupInviteLinkContentsV1 { if x != nil { - if x, ok := x.Contents.(*GroupInviteLink_ContentsV1); ok { - return x.ContentsV1 + if x, ok := x.Contents.(*GroupInviteLink_V1Contents); ok { + return x.V1Contents } } return nil @@ -885,29 +1068,29 @@ type isGroupInviteLink_Contents interface { isGroupInviteLink_Contents() } -type GroupInviteLink_ContentsV1 struct { - ContentsV1 *GroupInviteLink_GroupInviteLinkContentsV1 `protobuf:"bytes,1,opt,name=contentsV1,proto3,oneof"` +type GroupInviteLink_V1Contents struct { + V1Contents *GroupInviteLink_GroupInviteLinkContentsV1 `protobuf:"bytes,1,opt,name=v1Contents,proto3,oneof"` } -func (*GroupInviteLink_ContentsV1) isGroupInviteLink_Contents() {} +func (*GroupInviteLink_V1Contents) isGroupInviteLink_Contents() {} type GroupJoinInfo struct { state protoimpl.MessageState `protogen:"open.v1"` PublicKey []byte `protobuf:"bytes,1,opt,name=publicKey,proto3" json:"publicKey,omitempty"` Title []byte `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Description []byte `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` MemberCount uint32 `protobuf:"varint,4,opt,name=memberCount,proto3" json:"memberCount,omitempty"` - AddFromInviteLink AccessControl_AccessRequired `protobuf:"varint,5,opt,name=addFromInviteLink,proto3,enum=signal.AccessControl_AccessRequired" json:"addFromInviteLink,omitempty"` - Version uint32 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"` + AddFromInviteLink AccessControl_AccessRequired `protobuf:"varint,5,opt,name=addFromInviteLink,proto3,enum=AccessControl_AccessRequired" json:"addFromInviteLink,omitempty"` + Revision uint32 `protobuf:"varint,6,opt,name=revision,proto3" json:"revision,omitempty"` PendingAdminApproval bool `protobuf:"varint,7,opt,name=pendingAdminApproval,proto3" json:"pendingAdminApproval,omitempty"` + Description []byte `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GroupJoinInfo) Reset() { *x = GroupJoinInfo{} - mi := &file_Groups_proto_msgTypes[9] + mi := &file_Groups_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -919,7 +1102,7 @@ func (x *GroupJoinInfo) String() string { func (*GroupJoinInfo) ProtoMessage() {} func (x *GroupJoinInfo) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[9] + mi := &file_Groups_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -932,7 +1115,7 @@ func (x *GroupJoinInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupJoinInfo.ProtoReflect.Descriptor instead. func (*GroupJoinInfo) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{9} + return file_Groups_proto_rawDescGZIP(), []int{13} } func (x *GroupJoinInfo) GetPublicKey() []byte { @@ -949,13 +1132,6 @@ func (x *GroupJoinInfo) GetTitle() []byte { return nil } -func (x *GroupJoinInfo) GetDescription() []byte { - if x != nil { - return x.Description - } - return nil -} - func (x *GroupJoinInfo) GetAvatar() string { if x != nil { return x.Avatar @@ -977,9 +1153,9 @@ func (x *GroupJoinInfo) GetAddFromInviteLink() AccessControl_AccessRequired { return AccessControl_UNKNOWN } -func (x *GroupJoinInfo) GetVersion() uint32 { +func (x *GroupJoinInfo) GetRevision() uint32 { if x != nil { - return x.Version + return x.Revision } return 0 } @@ -991,88 +1167,35 @@ func (x *GroupJoinInfo) GetPendingAdminApproval() bool { return false } -type GroupChange struct { - state protoimpl.MessageState `protogen:"open.v1"` - Actions []byte `protobuf:"bytes,1,opt,name=actions,proto3" json:"actions,omitempty"` - ServerSignature []byte `protobuf:"bytes,2,opt,name=serverSignature,proto3" json:"serverSignature,omitempty"` - ChangeEpoch uint32 `protobuf:"varint,3,opt,name=changeEpoch,proto3" json:"changeEpoch,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange) Reset() { - *x = GroupChange{} - mi := &file_Groups_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange) ProtoMessage() {} - -func (x *GroupChange) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[10] +func (x *GroupJoinInfo) GetDescription() []byte { if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupChange.ProtoReflect.Descriptor instead. -func (*GroupChange) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10} -} - -func (x *GroupChange) GetActions() []byte { - if x != nil { - return x.Actions + return x.Description } return nil } -func (x *GroupChange) GetServerSignature() []byte { - if x != nil { - return x.ServerSignature - } - return nil -} - -func (x *GroupChange) GetChangeEpoch() uint32 { - if x != nil { - return x.ChangeEpoch - } - return 0 -} - -type ExternalGroupCredential struct { +type GroupExternalCredential struct { state protoimpl.MessageState `protogen:"open.v1"` Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *ExternalGroupCredential) Reset() { - *x = ExternalGroupCredential{} - mi := &file_Groups_proto_msgTypes[11] +func (x *GroupExternalCredential) Reset() { + *x = GroupExternalCredential{} + mi := &file_Groups_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *ExternalGroupCredential) String() string { +func (x *GroupExternalCredential) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ExternalGroupCredential) ProtoMessage() {} +func (*GroupExternalCredential) ProtoMessage() {} -func (x *ExternalGroupCredential) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[11] +func (x *GroupExternalCredential) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1083,265 +1206,52 @@ func (x *ExternalGroupCredential) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExternalGroupCredential.ProtoReflect.Descriptor instead. -func (*ExternalGroupCredential) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{11} +// Deprecated: Use GroupExternalCredential.ProtoReflect.Descriptor instead. +func (*GroupExternalCredential) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{14} } -func (x *ExternalGroupCredential) GetToken() string { +func (x *GroupExternalCredential) GetToken() string { if x != nil { return x.Token } return "" } -type GroupResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` - GroupSendEndorsementsResponse []byte `protobuf:"bytes,2,opt,name=group_send_endorsements_response,json=groupSendEndorsementsResponse,proto3" json:"group_send_endorsements_response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupResponse) Reset() { - *x = GroupResponse{} - mi := &file_Groups_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupResponse) ProtoMessage() {} - -func (x *GroupResponse) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupResponse.ProtoReflect.Descriptor instead. -func (*GroupResponse) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{12} -} - -func (x *GroupResponse) GetGroup() *Group { - if x != nil { - return x.Group - } - return nil -} - -func (x *GroupResponse) GetGroupSendEndorsementsResponse() []byte { - if x != nil { - return x.GroupSendEndorsementsResponse - } - return nil -} - -type GroupChanges struct { - state protoimpl.MessageState `protogen:"open.v1"` - GroupChanges []*GroupChanges_GroupChangeState `protobuf:"bytes,1,rep,name=groupChanges,proto3" json:"groupChanges,omitempty"` - GroupSendEndorsementsResponse []byte `protobuf:"bytes,2,opt,name=group_send_endorsements_response,json=groupSendEndorsementsResponse,proto3" json:"group_send_endorsements_response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChanges) Reset() { - *x = GroupChanges{} - mi := &file_Groups_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChanges) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChanges) ProtoMessage() {} - -func (x *GroupChanges) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupChanges.ProtoReflect.Descriptor instead. -func (*GroupChanges) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{13} -} - -func (x *GroupChanges) GetGroupChanges() []*GroupChanges_GroupChangeState { - if x != nil { - return x.GroupChanges - } - return nil -} - -func (x *GroupChanges) GetGroupSendEndorsementsResponse() []byte { - if x != nil { - return x.GroupSendEndorsementsResponse - } - return nil -} - -type GroupChangeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - GroupChange *GroupChange `protobuf:"bytes,1,opt,name=group_change,json=groupChange,proto3" json:"group_change,omitempty"` - GroupSendEndorsementsResponse []byte `protobuf:"bytes,2,opt,name=group_send_endorsements_response,json=groupSendEndorsementsResponse,proto3" json:"group_send_endorsements_response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChangeResponse) Reset() { - *x = GroupChangeResponse{} - mi := &file_Groups_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChangeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChangeResponse) ProtoMessage() {} - -func (x *GroupChangeResponse) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupChangeResponse.ProtoReflect.Descriptor instead. -func (*GroupChangeResponse) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{14} -} - -func (x *GroupChangeResponse) GetGroupChange() *GroupChange { - if x != nil { - return x.GroupChange - } - return nil -} - -func (x *GroupChangeResponse) GetGroupSendEndorsementsResponse() []byte { - if x != nil { - return x.GroupSendEndorsementsResponse - } - return nil -} - -type GroupInviteLink_GroupInviteLinkContentsV1 struct { - state protoimpl.MessageState `protogen:"open.v1"` - GroupMasterKey []byte `protobuf:"bytes,1,opt,name=groupMasterKey,proto3" json:"groupMasterKey,omitempty"` - InviteLinkPassword []byte `protobuf:"bytes,2,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInviteLink_GroupInviteLinkContentsV1) Reset() { - *x = GroupInviteLink_GroupInviteLinkContentsV1{} - mi := &file_Groups_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInviteLink_GroupInviteLinkContentsV1) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInviteLink_GroupInviteLinkContentsV1) ProtoMessage() {} - -func (x *GroupInviteLink_GroupInviteLinkContentsV1) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupInviteLink_GroupInviteLinkContentsV1.ProtoReflect.Descriptor instead. -func (*GroupInviteLink_GroupInviteLinkContentsV1) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{8, 0} -} - -func (x *GroupInviteLink_GroupInviteLinkContentsV1) GetGroupMasterKey() []byte { - if x != nil { - return x.GroupMasterKey - } - return nil -} - -func (x *GroupInviteLink_GroupInviteLinkContentsV1) GetInviteLinkPassword() []byte { - if x != nil { - return x.InviteLinkPassword - } - return nil -} - type GroupChange_Actions struct { - state protoimpl.MessageState `protogen:"open.v1"` - SourceUserId []byte `protobuf:"bytes,1,opt,name=sourceUserId,proto3" json:"sourceUserId,omitempty"` - // clients should not provide this value; the server will provide it in the response buffer to ensure the signature is binding to a particular group - // if clients set it during a request the server will respond with 400. - GroupId []byte `protobuf:"bytes,25,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - Version uint32 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` - AddMembers []*GroupChange_Actions_AddMemberAction `protobuf:"bytes,3,rep,name=addMembers,proto3" json:"addMembers,omitempty"` - DeleteMembers []*GroupChange_Actions_DeleteMemberAction `protobuf:"bytes,4,rep,name=deleteMembers,proto3" json:"deleteMembers,omitempty"` - ModifyMemberRoles []*GroupChange_Actions_ModifyMemberRoleAction `protobuf:"bytes,5,rep,name=modifyMemberRoles,proto3" json:"modifyMemberRoles,omitempty"` - ModifyMemberProfileKeys []*GroupChange_Actions_ModifyMemberProfileKeyAction `protobuf:"bytes,6,rep,name=modifyMemberProfileKeys,proto3" json:"modifyMemberProfileKeys,omitempty"` - AddMembersPendingProfileKey []*GroupChange_Actions_AddMemberPendingProfileKeyAction `protobuf:"bytes,7,rep,name=addMembersPendingProfileKey,proto3" json:"addMembersPendingProfileKey,omitempty"` - DeleteMembersPendingProfileKey []*GroupChange_Actions_DeleteMemberPendingProfileKeyAction `protobuf:"bytes,8,rep,name=deleteMembersPendingProfileKey,proto3" json:"deleteMembersPendingProfileKey,omitempty"` - PromoteMembersPendingProfileKey []*GroupChange_Actions_PromoteMemberPendingProfileKeyAction `protobuf:"bytes,9,rep,name=promoteMembersPendingProfileKey,proto3" json:"promoteMembersPendingProfileKey,omitempty"` - ModifyTitle *GroupChange_Actions_ModifyTitleAction `protobuf:"bytes,10,opt,name=modifyTitle,proto3" json:"modifyTitle,omitempty"` - ModifyAvatar *GroupChange_Actions_ModifyAvatarAction `protobuf:"bytes,11,opt,name=modifyAvatar,proto3" json:"modifyAvatar,omitempty"` - ModifyDisappearingMessageTimer *GroupChange_Actions_ModifyDisappearingMessageTimerAction `protobuf:"bytes,12,opt,name=modifyDisappearingMessageTimer,proto3" json:"modifyDisappearingMessageTimer,omitempty"` - ModifyAttributesAccess *GroupChange_Actions_ModifyAttributesAccessControlAction `protobuf:"bytes,13,opt,name=modifyAttributesAccess,proto3" json:"modifyAttributesAccess,omitempty"` - ModifyMemberAccess *GroupChange_Actions_ModifyMembersAccessControlAction `protobuf:"bytes,14,opt,name=modifyMemberAccess,proto3" json:"modifyMemberAccess,omitempty"` - ModifyAddFromInviteLinkAccess *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction `protobuf:"bytes,15,opt,name=modifyAddFromInviteLinkAccess,proto3" json:"modifyAddFromInviteLinkAccess,omitempty"` // change epoch = 1 - AddMembersPendingAdminApproval []*GroupChange_Actions_AddMemberPendingAdminApprovalAction `protobuf:"bytes,16,rep,name=addMembersPendingAdminApproval,proto3" json:"addMembersPendingAdminApproval,omitempty"` // change epoch = 1 - DeleteMembersPendingAdminApproval []*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction `protobuf:"bytes,17,rep,name=deleteMembersPendingAdminApproval,proto3" json:"deleteMembersPendingAdminApproval,omitempty"` // change epoch = 1 - PromoteMembersPendingAdminApproval []*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction `protobuf:"bytes,18,rep,name=promoteMembersPendingAdminApproval,proto3" json:"promoteMembersPendingAdminApproval,omitempty"` // change epoch = 1 - ModifyInviteLinkPassword *GroupChange_Actions_ModifyInviteLinkPasswordAction `protobuf:"bytes,19,opt,name=modifyInviteLinkPassword,proto3" json:"modifyInviteLinkPassword,omitempty"` // change epoch = 1 - ModifyDescription *GroupChange_Actions_ModifyDescriptionAction `protobuf:"bytes,20,opt,name=modifyDescription,proto3" json:"modifyDescription,omitempty"` // change epoch = 2 - ModifyAnnouncementsOnly *GroupChange_Actions_ModifyAnnouncementsOnlyAction `protobuf:"bytes,21,opt,name=modify_announcements_only,json=modifyAnnouncementsOnly,proto3" json:"modify_announcements_only,omitempty"` // change epoch = 3 - AddMembersBanned []*GroupChange_Actions_AddMemberBannedAction `protobuf:"bytes,22,rep,name=add_members_banned,json=addMembersBanned,proto3" json:"add_members_banned,omitempty"` // change epoch = 4 - DeleteMembersBanned []*GroupChange_Actions_DeleteMemberBannedAction `protobuf:"bytes,23,rep,name=delete_members_banned,json=deleteMembersBanned,proto3" json:"delete_members_banned,omitempty"` // change epoch = 4 - PromoteMembersPendingPniAciProfileKey []*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction `protobuf:"bytes,24,rep,name=promote_members_pending_pni_aci_profile_key,json=promoteMembersPendingPniAciProfileKey,proto3" json:"promote_members_pending_pni_aci_profile_key,omitempty"` // change epoch = 5 - ModifyMemberLabels []*GroupChange_Actions_ModifyMemberLabelAction `protobuf:"bytes,26,rep,name=modifyMemberLabels,proto3" json:"modifyMemberLabels,omitempty"` // change epoch = 6; - ModifyMemberLabelAccess *GroupChange_Actions_ModifyMemberLabelAccessControlAction `protobuf:"bytes,27,opt,name=modifyMemberLabelAccess,proto3" json:"modifyMemberLabelAccess,omitempty"` // change epoch = 6 - TerminateGroup *GroupChange_Actions_TerminateGroupAction `protobuf:"bytes,28,opt,name=terminate_group,json=terminateGroup,proto3" json:"terminate_group,omitempty"` // change epoch = 7 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SourceServiceId []byte `protobuf:"bytes,1,opt,name=sourceServiceId,proto3" json:"sourceServiceId,omitempty"` + GroupId []byte `protobuf:"bytes,25,opt,name=groupId,proto3" json:"groupId,omitempty"` // Only set when receiving from server + Revision uint32 `protobuf:"varint,2,opt,name=revision,proto3" json:"revision,omitempty"` + AddMembers []*GroupChange_Actions_AddMemberAction `protobuf:"bytes,3,rep,name=addMembers,proto3" json:"addMembers,omitempty"` + DeleteMembers []*GroupChange_Actions_DeleteMemberAction `protobuf:"bytes,4,rep,name=deleteMembers,proto3" json:"deleteMembers,omitempty"` + ModifyMemberRoles []*GroupChange_Actions_ModifyMemberRoleAction `protobuf:"bytes,5,rep,name=modifyMemberRoles,proto3" json:"modifyMemberRoles,omitempty"` + ModifyMemberProfileKeys []*GroupChange_Actions_ModifyMemberProfileKeyAction `protobuf:"bytes,6,rep,name=modifyMemberProfileKeys,proto3" json:"modifyMemberProfileKeys,omitempty"` + AddPendingMembers []*GroupChange_Actions_AddPendingMemberAction `protobuf:"bytes,7,rep,name=addPendingMembers,proto3" json:"addPendingMembers,omitempty"` + DeletePendingMembers []*GroupChange_Actions_DeletePendingMemberAction `protobuf:"bytes,8,rep,name=deletePendingMembers,proto3" json:"deletePendingMembers,omitempty"` + PromotePendingMembers []*GroupChange_Actions_PromotePendingMemberAction `protobuf:"bytes,9,rep,name=promotePendingMembers,proto3" json:"promotePendingMembers,omitempty"` + ModifyTitle *GroupChange_Actions_ModifyTitleAction `protobuf:"bytes,10,opt,name=modifyTitle,proto3" json:"modifyTitle,omitempty"` + ModifyAvatar *GroupChange_Actions_ModifyAvatarAction `protobuf:"bytes,11,opt,name=modifyAvatar,proto3" json:"modifyAvatar,omitempty"` + ModifyDisappearingMessagesTimer *GroupChange_Actions_ModifyDisappearingMessagesTimerAction `protobuf:"bytes,12,opt,name=modifyDisappearingMessagesTimer,proto3" json:"modifyDisappearingMessagesTimer,omitempty"` + ModifyAttributesAccess *GroupChange_Actions_ModifyAttributesAccessControlAction `protobuf:"bytes,13,opt,name=modifyAttributesAccess,proto3" json:"modifyAttributesAccess,omitempty"` + ModifyMemberAccess *GroupChange_Actions_ModifyMembersAccessControlAction `protobuf:"bytes,14,opt,name=modifyMemberAccess,proto3" json:"modifyMemberAccess,omitempty"` + ModifyAddFromInviteLinkAccess *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction `protobuf:"bytes,15,opt,name=modifyAddFromInviteLinkAccess,proto3" json:"modifyAddFromInviteLinkAccess,omitempty"` + AddRequestingMembers []*GroupChange_Actions_AddRequestingMemberAction `protobuf:"bytes,16,rep,name=addRequestingMembers,proto3" json:"addRequestingMembers,omitempty"` + DeleteRequestingMembers []*GroupChange_Actions_DeleteRequestingMemberAction `protobuf:"bytes,17,rep,name=deleteRequestingMembers,proto3" json:"deleteRequestingMembers,omitempty"` + PromoteRequestingMembers []*GroupChange_Actions_PromoteRequestingMemberAction `protobuf:"bytes,18,rep,name=promoteRequestingMembers,proto3" json:"promoteRequestingMembers,omitempty"` + ModifyInviteLinkPassword *GroupChange_Actions_ModifyInviteLinkPasswordAction `protobuf:"bytes,19,opt,name=modifyInviteLinkPassword,proto3" json:"modifyInviteLinkPassword,omitempty"` + ModifyDescription *GroupChange_Actions_ModifyDescriptionAction `protobuf:"bytes,20,opt,name=modifyDescription,proto3" json:"modifyDescription,omitempty"` + ModifyAnnouncementsOnly *GroupChange_Actions_ModifyAnnouncementsOnlyAction `protobuf:"bytes,21,opt,name=modifyAnnouncementsOnly,proto3" json:"modifyAnnouncementsOnly,omitempty"` + AddBannedMembers []*GroupChange_Actions_AddBannedMemberAction `protobuf:"bytes,22,rep,name=addBannedMembers,proto3" json:"addBannedMembers,omitempty"` + DeleteBannedMembers []*GroupChange_Actions_DeleteBannedMemberAction `protobuf:"bytes,23,rep,name=deleteBannedMembers,proto3" json:"deleteBannedMembers,omitempty"` + PromotePendingPniAciMembers []*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction `protobuf:"bytes,24,rep,name=promotePendingPniAciMembers,proto3" json:"promotePendingPniAciMembers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GroupChange_Actions) Reset() { *x = GroupChange_Actions{} - mi := &file_Groups_proto_msgTypes[16] + mi := &file_Groups_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1353,7 +1263,7 @@ func (x *GroupChange_Actions) String() string { func (*GroupChange_Actions) ProtoMessage() {} func (x *GroupChange_Actions) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[16] + mi := &file_Groups_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1366,12 +1276,12 @@ func (x *GroupChange_Actions) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupChange_Actions.ProtoReflect.Descriptor instead. func (*GroupChange_Actions) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0} + return file_Groups_proto_rawDescGZIP(), []int{7, 0} } -func (x *GroupChange_Actions) GetSourceUserId() []byte { +func (x *GroupChange_Actions) GetSourceServiceId() []byte { if x != nil { - return x.SourceUserId + return x.SourceServiceId } return nil } @@ -1383,9 +1293,9 @@ func (x *GroupChange_Actions) GetGroupId() []byte { return nil } -func (x *GroupChange_Actions) GetVersion() uint32 { +func (x *GroupChange_Actions) GetRevision() uint32 { if x != nil { - return x.Version + return x.Revision } return 0 } @@ -1418,23 +1328,23 @@ func (x *GroupChange_Actions) GetModifyMemberProfileKeys() []*GroupChange_Action return nil } -func (x *GroupChange_Actions) GetAddMembersPendingProfileKey() []*GroupChange_Actions_AddMemberPendingProfileKeyAction { +func (x *GroupChange_Actions) GetAddPendingMembers() []*GroupChange_Actions_AddPendingMemberAction { if x != nil { - return x.AddMembersPendingProfileKey + return x.AddPendingMembers } return nil } -func (x *GroupChange_Actions) GetDeleteMembersPendingProfileKey() []*GroupChange_Actions_DeleteMemberPendingProfileKeyAction { +func (x *GroupChange_Actions) GetDeletePendingMembers() []*GroupChange_Actions_DeletePendingMemberAction { if x != nil { - return x.DeleteMembersPendingProfileKey + return x.DeletePendingMembers } return nil } -func (x *GroupChange_Actions) GetPromoteMembersPendingProfileKey() []*GroupChange_Actions_PromoteMemberPendingProfileKeyAction { +func (x *GroupChange_Actions) GetPromotePendingMembers() []*GroupChange_Actions_PromotePendingMemberAction { if x != nil { - return x.PromoteMembersPendingProfileKey + return x.PromotePendingMembers } return nil } @@ -1453,9 +1363,9 @@ func (x *GroupChange_Actions) GetModifyAvatar() *GroupChange_Actions_ModifyAvata return nil } -func (x *GroupChange_Actions) GetModifyDisappearingMessageTimer() *GroupChange_Actions_ModifyDisappearingMessageTimerAction { +func (x *GroupChange_Actions) GetModifyDisappearingMessagesTimer() *GroupChange_Actions_ModifyDisappearingMessagesTimerAction { if x != nil { - return x.ModifyDisappearingMessageTimer + return x.ModifyDisappearingMessagesTimer } return nil } @@ -1481,23 +1391,23 @@ func (x *GroupChange_Actions) GetModifyAddFromInviteLinkAccess() *GroupChange_Ac return nil } -func (x *GroupChange_Actions) GetAddMembersPendingAdminApproval() []*GroupChange_Actions_AddMemberPendingAdminApprovalAction { +func (x *GroupChange_Actions) GetAddRequestingMembers() []*GroupChange_Actions_AddRequestingMemberAction { if x != nil { - return x.AddMembersPendingAdminApproval + return x.AddRequestingMembers } return nil } -func (x *GroupChange_Actions) GetDeleteMembersPendingAdminApproval() []*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction { +func (x *GroupChange_Actions) GetDeleteRequestingMembers() []*GroupChange_Actions_DeleteRequestingMemberAction { if x != nil { - return x.DeleteMembersPendingAdminApproval + return x.DeleteRequestingMembers } return nil } -func (x *GroupChange_Actions) GetPromoteMembersPendingAdminApproval() []*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction { +func (x *GroupChange_Actions) GetPromoteRequestingMembers() []*GroupChange_Actions_PromoteRequestingMemberAction { if x != nil { - return x.PromoteMembersPendingAdminApproval + return x.PromoteRequestingMembers } return nil } @@ -1523,44 +1433,23 @@ func (x *GroupChange_Actions) GetModifyAnnouncementsOnly() *GroupChange_Actions_ return nil } -func (x *GroupChange_Actions) GetAddMembersBanned() []*GroupChange_Actions_AddMemberBannedAction { +func (x *GroupChange_Actions) GetAddBannedMembers() []*GroupChange_Actions_AddBannedMemberAction { if x != nil { - return x.AddMembersBanned + return x.AddBannedMembers } return nil } -func (x *GroupChange_Actions) GetDeleteMembersBanned() []*GroupChange_Actions_DeleteMemberBannedAction { +func (x *GroupChange_Actions) GetDeleteBannedMembers() []*GroupChange_Actions_DeleteBannedMemberAction { if x != nil { - return x.DeleteMembersBanned + return x.DeleteBannedMembers } return nil } -func (x *GroupChange_Actions) GetPromoteMembersPendingPniAciProfileKey() []*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction { +func (x *GroupChange_Actions) GetPromotePendingPniAciMembers() []*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction { if x != nil { - return x.PromoteMembersPendingPniAciProfileKey - } - return nil -} - -func (x *GroupChange_Actions) GetModifyMemberLabels() []*GroupChange_Actions_ModifyMemberLabelAction { - if x != nil { - return x.ModifyMemberLabels - } - return nil -} - -func (x *GroupChange_Actions) GetModifyMemberLabelAccess() *GroupChange_Actions_ModifyMemberLabelAccessControlAction { - if x != nil { - return x.ModifyMemberLabelAccess - } - return nil -} - -func (x *GroupChange_Actions) GetTerminateGroup() *GroupChange_Actions_TerminateGroupAction { - if x != nil { - return x.TerminateGroup + return x.PromotePendingPniAciMembers } return nil } @@ -1575,7 +1464,7 @@ type GroupChange_Actions_AddMemberAction struct { func (x *GroupChange_Actions_AddMemberAction) Reset() { *x = GroupChange_Actions_AddMemberAction{} - mi := &file_Groups_proto_msgTypes[17] + mi := &file_Groups_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1587,7 +1476,7 @@ func (x *GroupChange_Actions_AddMemberAction) String() string { func (*GroupChange_Actions_AddMemberAction) ProtoMessage() {} func (x *GroupChange_Actions_AddMemberAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[17] + mi := &file_Groups_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1600,7 +1489,7 @@ func (x *GroupChange_Actions_AddMemberAction) ProtoReflect() protoreflect.Messag // Deprecated: Use GroupChange_Actions_AddMemberAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_AddMemberAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 0} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 0} } func (x *GroupChange_Actions_AddMemberAction) GetAdded() *Member { @@ -1626,7 +1515,7 @@ type GroupChange_Actions_DeleteMemberAction struct { func (x *GroupChange_Actions_DeleteMemberAction) Reset() { *x = GroupChange_Actions_DeleteMemberAction{} - mi := &file_Groups_proto_msgTypes[18] + mi := &file_Groups_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1638,7 +1527,7 @@ func (x *GroupChange_Actions_DeleteMemberAction) String() string { func (*GroupChange_Actions_DeleteMemberAction) ProtoMessage() {} func (x *GroupChange_Actions_DeleteMemberAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[18] + mi := &file_Groups_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1651,7 +1540,7 @@ func (x *GroupChange_Actions_DeleteMemberAction) ProtoReflect() protoreflect.Mes // Deprecated: Use GroupChange_Actions_DeleteMemberAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_DeleteMemberAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 1} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 1} } func (x *GroupChange_Actions_DeleteMemberAction) GetDeletedUserId() []byte { @@ -1664,14 +1553,14 @@ func (x *GroupChange_Actions_DeleteMemberAction) GetDeletedUserId() []byte { type GroupChange_Actions_ModifyMemberRoleAction struct { state protoimpl.MessageState `protogen:"open.v1"` UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - Role Member_Role `protobuf:"varint,2,opt,name=role,proto3,enum=signal.Member_Role" json:"role,omitempty"` + Role Member_Role `protobuf:"varint,2,opt,name=role,proto3,enum=Member_Role" json:"role,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GroupChange_Actions_ModifyMemberRoleAction) Reset() { *x = GroupChange_Actions_ModifyMemberRoleAction{} - mi := &file_Groups_proto_msgTypes[19] + mi := &file_Groups_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1683,7 +1572,7 @@ func (x *GroupChange_Actions_ModifyMemberRoleAction) String() string { func (*GroupChange_Actions_ModifyMemberRoleAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyMemberRoleAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[19] + mi := &file_Groups_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1696,7 +1585,7 @@ func (x *GroupChange_Actions_ModifyMemberRoleAction) ProtoReflect() protoreflect // Deprecated: Use GroupChange_Actions_ModifyMemberRoleAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyMemberRoleAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 2} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 2} } func (x *GroupChange_Actions_ModifyMemberRoleAction) GetUserId() []byte { @@ -1713,78 +1602,18 @@ func (x *GroupChange_Actions_ModifyMemberRoleAction) GetRole() Member_Role { return Member_UNKNOWN } -type GroupChange_Actions_ModifyMemberLabelAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - LabelEmoji []byte `protobuf:"bytes,2,opt,name=labelEmoji,proto3" json:"labelEmoji,omitempty"` // decrypts to a UTF-8 string - LabelString []byte `protobuf:"bytes,3,opt,name=labelString,proto3" json:"labelString,omitempty"` // decrypts to a UTF-8 string - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyMemberLabelAction) Reset() { - *x = GroupChange_Actions_ModifyMemberLabelAction{} - mi := &file_Groups_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyMemberLabelAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyMemberLabelAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyMemberLabelAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupChange_Actions_ModifyMemberLabelAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyMemberLabelAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 3} -} - -func (x *GroupChange_Actions_ModifyMemberLabelAction) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *GroupChange_Actions_ModifyMemberLabelAction) GetLabelEmoji() []byte { - if x != nil { - return x.LabelEmoji - } - return nil -} - -func (x *GroupChange_Actions_ModifyMemberLabelAction) GetLabelString() []byte { - if x != nil { - return x.LabelString - } - return nil -} - type GroupChange_Actions_ModifyMemberProfileKeyAction struct { state protoimpl.MessageState `protogen:"open.v1"` - Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` - UserId []byte `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - ProfileKey []byte `protobuf:"bytes,3,opt,name=profile_key,json=profileKey,proto3" json:"profile_key,omitempty"` + Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` // Only set when sending to server + UserId []byte `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // Only set when receiving from server + ProfileKey []byte `protobuf:"bytes,3,opt,name=profile_key,json=profileKey,proto3" json:"profile_key,omitempty"` // Only set when receiving from server unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) Reset() { *x = GroupChange_Actions_ModifyMemberProfileKeyAction{} - mi := &file_Groups_proto_msgTypes[21] + mi := &file_Groups_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1796,7 +1625,7 @@ func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) String() string { func (*GroupChange_Actions_ModifyMemberProfileKeyAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[21] + mi := &file_Groups_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1809,7 +1638,7 @@ func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) ProtoReflect() protor // Deprecated: Use GroupChange_Actions_ModifyMemberProfileKeyAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyMemberProfileKeyAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 4} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 3} } func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetPresentation() []byte { @@ -1833,28 +1662,28 @@ func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetProfileKey() []byt return nil } -type GroupChange_Actions_AddMemberPendingProfileKeyAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Added *MemberPendingProfileKey `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` +type GroupChange_Actions_AddPendingMemberAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Added *PendingMember `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) Reset() { - *x = GroupChange_Actions_AddMemberPendingProfileKeyAction{} - mi := &file_Groups_proto_msgTypes[22] +func (x *GroupChange_Actions_AddPendingMemberAction) Reset() { + *x = GroupChange_Actions_AddPendingMemberAction{} + mi := &file_Groups_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) String() string { +func (x *GroupChange_Actions_AddPendingMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_AddMemberPendingProfileKeyAction) ProtoMessage() {} +func (*GroupChange_Actions_AddPendingMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[22] +func (x *GroupChange_Actions_AddPendingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1865,40 +1694,40 @@ func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) ProtoReflect() pr return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_AddMemberPendingProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_AddMemberPendingProfileKeyAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 5} +// Deprecated: Use GroupChange_Actions_AddPendingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_AddPendingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 4} } -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) GetAdded() *MemberPendingProfileKey { +func (x *GroupChange_Actions_AddPendingMemberAction) GetAdded() *PendingMember { if x != nil { return x.Added } return nil } -type GroupChange_Actions_DeleteMemberPendingProfileKeyAction struct { +type GroupChange_Actions_DeletePendingMemberAction struct { state protoimpl.MessageState `protogen:"open.v1"` DeletedUserId []byte `protobuf:"bytes,1,opt,name=deletedUserId,proto3" json:"deletedUserId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) Reset() { - *x = GroupChange_Actions_DeleteMemberPendingProfileKeyAction{} - mi := &file_Groups_proto_msgTypes[23] +func (x *GroupChange_Actions_DeletePendingMemberAction) Reset() { + *x = GroupChange_Actions_DeletePendingMemberAction{} + mi := &file_Groups_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) String() string { +func (x *GroupChange_Actions_DeletePendingMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_DeleteMemberPendingProfileKeyAction) ProtoMessage() {} +func (*GroupChange_Actions_DeletePendingMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[23] +func (x *GroupChange_Actions_DeletePendingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1909,42 +1738,42 @@ func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) ProtoReflect() return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_DeleteMemberPendingProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_DeleteMemberPendingProfileKeyAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 6} +// Deprecated: Use GroupChange_Actions_DeletePendingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_DeletePendingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 5} } -func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) GetDeletedUserId() []byte { +func (x *GroupChange_Actions_DeletePendingMemberAction) GetDeletedUserId() []byte { if x != nil { return x.DeletedUserId } return nil } -type GroupChange_Actions_PromoteMemberPendingProfileKeyAction struct { +type GroupChange_Actions_PromotePendingMemberAction struct { state protoimpl.MessageState `protogen:"open.v1"` - Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` - UserId []byte `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - ProfileKey []byte `protobuf:"bytes,3,opt,name=profile_key,json=profileKey,proto3" json:"profile_key,omitempty"` + Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` // Only set when sending to server + UserId []byte `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // Only set when receiving from server + ProfileKey []byte `protobuf:"bytes,3,opt,name=profile_key,json=profileKey,proto3" json:"profile_key,omitempty"` // Only set when receiving from server unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) Reset() { - *x = GroupChange_Actions_PromoteMemberPendingProfileKeyAction{} - mi := &file_Groups_proto_msgTypes[24] +func (x *GroupChange_Actions_PromotePendingMemberAction) Reset() { + *x = GroupChange_Actions_PromotePendingMemberAction{} + mi := &file_Groups_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) String() string { +func (x *GroupChange_Actions_PromotePendingMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_PromoteMemberPendingProfileKeyAction) ProtoMessage() {} +func (*GroupChange_Actions_PromotePendingMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[24] +func (x *GroupChange_Actions_PromotePendingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1955,57 +1784,57 @@ func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) ProtoReflect( return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_PromoteMemberPendingProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_PromoteMemberPendingProfileKeyAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 7} +// Deprecated: Use GroupChange_Actions_PromotePendingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_PromotePendingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 6} } -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) GetPresentation() []byte { +func (x *GroupChange_Actions_PromotePendingMemberAction) GetPresentation() []byte { if x != nil { return x.Presentation } return nil } -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) GetUserId() []byte { +func (x *GroupChange_Actions_PromotePendingMemberAction) GetUserId() []byte { if x != nil { return x.UserId } return nil } -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) GetProfileKey() []byte { +func (x *GroupChange_Actions_PromotePendingMemberAction) GetProfileKey() []byte { if x != nil { return x.ProfileKey } return nil } -type GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction struct { +type GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction struct { state protoimpl.MessageState `protogen:"open.v1"` - Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` - UserId []byte `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Pni []byte `protobuf:"bytes,3,opt,name=pni,proto3" json:"pni,omitempty"` - ProfileKey []byte `protobuf:"bytes,4,opt,name=profile_key,json=profileKey,proto3" json:"profile_key,omitempty"` + Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` // Only set when sending to server + UserId []byte `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` // Only set when receiving from server + Pni []byte `protobuf:"bytes,3,opt,name=pni,proto3" json:"pni,omitempty"` // Only set when receiving from server + ProfileKey []byte `protobuf:"bytes,4,opt,name=profileKey,proto3" json:"profileKey,omitempty"` // Only set when receiving from server unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) Reset() { - *x = GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction{} - mi := &file_Groups_proto_msgTypes[25] +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) Reset() { + *x = GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction{} + mi := &file_Groups_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) String() string { +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) ProtoMessage() {} +func (*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) ProtoMessage() {} -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[25] +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2016,61 +1845,61 @@ func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) ProtoRe return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 8} +// Deprecated: Use GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 7} } -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) GetPresentation() []byte { +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetPresentation() []byte { if x != nil { return x.Presentation } return nil } -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) GetUserId() []byte { +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetUserId() []byte { if x != nil { return x.UserId } return nil } -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) GetPni() []byte { +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetPni() []byte { if x != nil { return x.Pni } return nil } -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) GetProfileKey() []byte { +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetProfileKey() []byte { if x != nil { return x.ProfileKey } return nil } -type GroupChange_Actions_AddMemberPendingAdminApprovalAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Added *MemberPendingAdminApproval `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` +type GroupChange_Actions_AddRequestingMemberAction struct { + state protoimpl.MessageState `protogen:"open.v1"` + Added *RequestingMember `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) Reset() { - *x = GroupChange_Actions_AddMemberPendingAdminApprovalAction{} - mi := &file_Groups_proto_msgTypes[26] +func (x *GroupChange_Actions_AddRequestingMemberAction) Reset() { + *x = GroupChange_Actions_AddRequestingMemberAction{} + mi := &file_Groups_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) String() string { +func (x *GroupChange_Actions_AddRequestingMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_AddMemberPendingAdminApprovalAction) ProtoMessage() {} +func (*GroupChange_Actions_AddRequestingMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[26] +func (x *GroupChange_Actions_AddRequestingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2081,40 +1910,40 @@ func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) ProtoReflect() return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_AddMemberPendingAdminApprovalAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_AddMemberPendingAdminApprovalAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 9} +// Deprecated: Use GroupChange_Actions_AddRequestingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_AddRequestingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 8} } -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) GetAdded() *MemberPendingAdminApproval { +func (x *GroupChange_Actions_AddRequestingMemberAction) GetAdded() *RequestingMember { if x != nil { return x.Added } return nil } -type GroupChange_Actions_DeleteMemberPendingAdminApprovalAction struct { +type GroupChange_Actions_DeleteRequestingMemberAction struct { state protoimpl.MessageState `protogen:"open.v1"` DeletedUserId []byte `protobuf:"bytes,1,opt,name=deletedUserId,proto3" json:"deletedUserId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) Reset() { - *x = GroupChange_Actions_DeleteMemberPendingAdminApprovalAction{} - mi := &file_Groups_proto_msgTypes[27] +func (x *GroupChange_Actions_DeleteRequestingMemberAction) Reset() { + *x = GroupChange_Actions_DeleteRequestingMemberAction{} + mi := &file_Groups_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) String() string { +func (x *GroupChange_Actions_DeleteRequestingMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) ProtoMessage() {} +func (*GroupChange_Actions_DeleteRequestingMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[27] +func (x *GroupChange_Actions_DeleteRequestingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2125,41 +1954,41 @@ func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) ProtoReflec return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_DeleteMemberPendingAdminApprovalAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 10} +// Deprecated: Use GroupChange_Actions_DeleteRequestingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_DeleteRequestingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 9} } -func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) GetDeletedUserId() []byte { +func (x *GroupChange_Actions_DeleteRequestingMemberAction) GetDeletedUserId() []byte { if x != nil { return x.DeletedUserId } return nil } -type GroupChange_Actions_PromoteMemberPendingAdminApprovalAction struct { +type GroupChange_Actions_PromoteRequestingMemberAction struct { state protoimpl.MessageState `protogen:"open.v1"` UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - Role Member_Role `protobuf:"varint,2,opt,name=role,proto3,enum=signal.Member_Role" json:"role,omitempty"` + Role Member_Role `protobuf:"varint,2,opt,name=role,proto3,enum=Member_Role" json:"role,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) Reset() { - *x = GroupChange_Actions_PromoteMemberPendingAdminApprovalAction{} - mi := &file_Groups_proto_msgTypes[28] +func (x *GroupChange_Actions_PromoteRequestingMemberAction) Reset() { + *x = GroupChange_Actions_PromoteRequestingMemberAction{} + mi := &file_Groups_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) String() string { +func (x *GroupChange_Actions_PromoteRequestingMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) ProtoMessage() {} +func (*GroupChange_Actions_PromoteRequestingMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[28] +func (x *GroupChange_Actions_PromoteRequestingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2170,47 +1999,47 @@ func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) ProtoRefle return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_PromoteMemberPendingAdminApprovalAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 11} +// Deprecated: Use GroupChange_Actions_PromoteRequestingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_PromoteRequestingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 10} } -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) GetUserId() []byte { +func (x *GroupChange_Actions_PromoteRequestingMemberAction) GetUserId() []byte { if x != nil { return x.UserId } return nil } -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) GetRole() Member_Role { +func (x *GroupChange_Actions_PromoteRequestingMemberAction) GetRole() Member_Role { if x != nil { return x.Role } return Member_UNKNOWN } -type GroupChange_Actions_AddMemberBannedAction struct { +type GroupChange_Actions_AddBannedMemberAction struct { state protoimpl.MessageState `protogen:"open.v1"` - Added *MemberBanned `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` + Added *BannedMember `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_AddMemberBannedAction) Reset() { - *x = GroupChange_Actions_AddMemberBannedAction{} - mi := &file_Groups_proto_msgTypes[29] +func (x *GroupChange_Actions_AddBannedMemberAction) Reset() { + *x = GroupChange_Actions_AddBannedMemberAction{} + mi := &file_Groups_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_AddMemberBannedAction) String() string { +func (x *GroupChange_Actions_AddBannedMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_AddMemberBannedAction) ProtoMessage() {} +func (*GroupChange_Actions_AddBannedMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_AddMemberBannedAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[29] +func (x *GroupChange_Actions_AddBannedMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2221,40 +2050,40 @@ func (x *GroupChange_Actions_AddMemberBannedAction) ProtoReflect() protoreflect. return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_AddMemberBannedAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_AddMemberBannedAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 12} +// Deprecated: Use GroupChange_Actions_AddBannedMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_AddBannedMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 11} } -func (x *GroupChange_Actions_AddMemberBannedAction) GetAdded() *MemberBanned { +func (x *GroupChange_Actions_AddBannedMemberAction) GetAdded() *BannedMember { if x != nil { return x.Added } return nil } -type GroupChange_Actions_DeleteMemberBannedAction struct { +type GroupChange_Actions_DeleteBannedMemberAction struct { state protoimpl.MessageState `protogen:"open.v1"` DeletedUserId []byte `protobuf:"bytes,1,opt,name=deletedUserId,proto3" json:"deletedUserId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_DeleteMemberBannedAction) Reset() { - *x = GroupChange_Actions_DeleteMemberBannedAction{} - mi := &file_Groups_proto_msgTypes[30] +func (x *GroupChange_Actions_DeleteBannedMemberAction) Reset() { + *x = GroupChange_Actions_DeleteBannedMemberAction{} + mi := &file_Groups_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_DeleteMemberBannedAction) String() string { +func (x *GroupChange_Actions_DeleteBannedMemberAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_DeleteMemberBannedAction) ProtoMessage() {} +func (*GroupChange_Actions_DeleteBannedMemberAction) ProtoMessage() {} -func (x *GroupChange_Actions_DeleteMemberBannedAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[30] +func (x *GroupChange_Actions_DeleteBannedMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2265,12 +2094,12 @@ func (x *GroupChange_Actions_DeleteMemberBannedAction) ProtoReflect() protorefle return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_DeleteMemberBannedAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_DeleteMemberBannedAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 13} +// Deprecated: Use GroupChange_Actions_DeleteBannedMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_DeleteBannedMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 12} } -func (x *GroupChange_Actions_DeleteMemberBannedAction) GetDeletedUserId() []byte { +func (x *GroupChange_Actions_DeleteBannedMemberAction) GetDeletedUserId() []byte { if x != nil { return x.DeletedUserId } @@ -2286,7 +2115,7 @@ type GroupChange_Actions_ModifyTitleAction struct { func (x *GroupChange_Actions_ModifyTitleAction) Reset() { *x = GroupChange_Actions_ModifyTitleAction{} - mi := &file_Groups_proto_msgTypes[31] + mi := &file_Groups_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2298,7 +2127,7 @@ func (x *GroupChange_Actions_ModifyTitleAction) String() string { func (*GroupChange_Actions_ModifyTitleAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyTitleAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[31] + mi := &file_Groups_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2311,7 +2140,7 @@ func (x *GroupChange_Actions_ModifyTitleAction) ProtoReflect() protoreflect.Mess // Deprecated: Use GroupChange_Actions_ModifyTitleAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyTitleAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 14} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 13} } func (x *GroupChange_Actions_ModifyTitleAction) GetTitle() []byte { @@ -2330,7 +2159,7 @@ type GroupChange_Actions_ModifyDescriptionAction struct { func (x *GroupChange_Actions_ModifyDescriptionAction) Reset() { *x = GroupChange_Actions_ModifyDescriptionAction{} - mi := &file_Groups_proto_msgTypes[32] + mi := &file_Groups_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2342,7 +2171,7 @@ func (x *GroupChange_Actions_ModifyDescriptionAction) String() string { func (*GroupChange_Actions_ModifyDescriptionAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyDescriptionAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[32] + mi := &file_Groups_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2355,7 +2184,7 @@ func (x *GroupChange_Actions_ModifyDescriptionAction) ProtoReflect() protoreflec // Deprecated: Use GroupChange_Actions_ModifyDescriptionAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyDescriptionAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 15} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 14} } func (x *GroupChange_Actions_ModifyDescriptionAction) GetDescription() []byte { @@ -2374,7 +2203,7 @@ type GroupChange_Actions_ModifyAvatarAction struct { func (x *GroupChange_Actions_ModifyAvatarAction) Reset() { *x = GroupChange_Actions_ModifyAvatarAction{} - mi := &file_Groups_proto_msgTypes[33] + mi := &file_Groups_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2386,7 +2215,7 @@ func (x *GroupChange_Actions_ModifyAvatarAction) String() string { func (*GroupChange_Actions_ModifyAvatarAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyAvatarAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[33] + mi := &file_Groups_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2399,7 +2228,7 @@ func (x *GroupChange_Actions_ModifyAvatarAction) ProtoReflect() protoreflect.Mes // Deprecated: Use GroupChange_Actions_ModifyAvatarAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyAvatarAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 16} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 15} } func (x *GroupChange_Actions_ModifyAvatarAction) GetAvatar() string { @@ -2409,28 +2238,28 @@ func (x *GroupChange_Actions_ModifyAvatarAction) GetAvatar() string { return "" } -type GroupChange_Actions_ModifyDisappearingMessageTimerAction struct { +type GroupChange_Actions_ModifyDisappearingMessagesTimerAction struct { state protoimpl.MessageState `protogen:"open.v1"` Timer []byte `protobuf:"bytes,1,opt,name=timer,proto3" json:"timer,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) Reset() { - *x = GroupChange_Actions_ModifyDisappearingMessageTimerAction{} - mi := &file_Groups_proto_msgTypes[34] +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) Reset() { + *x = GroupChange_Actions_ModifyDisappearingMessagesTimerAction{} + mi := &file_Groups_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) String() string { +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GroupChange_Actions_ModifyDisappearingMessageTimerAction) ProtoMessage() {} +func (*GroupChange_Actions_ModifyDisappearingMessagesTimerAction) ProtoMessage() {} -func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[34] +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2441,12 +2270,12 @@ func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) ProtoReflect( return mi.MessageOf(x) } -// Deprecated: Use GroupChange_Actions_ModifyDisappearingMessageTimerAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyDisappearingMessageTimerAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 17} +// Deprecated: Use GroupChange_Actions_ModifyDisappearingMessagesTimerAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyDisappearingMessagesTimerAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 16} } -func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) GetTimer() []byte { +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) GetTimer() []byte { if x != nil { return x.Timer } @@ -2455,14 +2284,14 @@ func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) GetTimer() [] type GroupChange_Actions_ModifyAttributesAccessControlAction struct { state protoimpl.MessageState `protogen:"open.v1"` - AttributesAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=attributesAccess,proto3,enum=signal.AccessControl_AccessRequired" json:"attributesAccess,omitempty"` + AttributesAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=attributesAccess,proto3,enum=AccessControl_AccessRequired" json:"attributesAccess,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) Reset() { *x = GroupChange_Actions_ModifyAttributesAccessControlAction{} - mi := &file_Groups_proto_msgTypes[35] + mi := &file_Groups_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2474,7 +2303,7 @@ func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) String() strin func (*GroupChange_Actions_ModifyAttributesAccessControlAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[35] + mi := &file_Groups_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2487,7 +2316,7 @@ func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) ProtoReflect() // Deprecated: Use GroupChange_Actions_ModifyAttributesAccessControlAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyAttributesAccessControlAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 18} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 17} } func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) GetAttributesAccess() AccessControl_AccessRequired { @@ -2499,14 +2328,14 @@ func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) GetAttributesA type GroupChange_Actions_ModifyMembersAccessControlAction struct { state protoimpl.MessageState `protogen:"open.v1"` - MembersAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=membersAccess,proto3,enum=signal.AccessControl_AccessRequired" json:"membersAccess,omitempty"` + MembersAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=membersAccess,proto3,enum=AccessControl_AccessRequired" json:"membersAccess,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GroupChange_Actions_ModifyMembersAccessControlAction) Reset() { *x = GroupChange_Actions_ModifyMembersAccessControlAction{} - mi := &file_Groups_proto_msgTypes[36] + mi := &file_Groups_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2518,7 +2347,7 @@ func (x *GroupChange_Actions_ModifyMembersAccessControlAction) String() string { func (*GroupChange_Actions_ModifyMembersAccessControlAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyMembersAccessControlAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[36] + mi := &file_Groups_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2531,7 +2360,7 @@ func (x *GroupChange_Actions_ModifyMembersAccessControlAction) ProtoReflect() pr // Deprecated: Use GroupChange_Actions_ModifyMembersAccessControlAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyMembersAccessControlAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 19} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 18} } func (x *GroupChange_Actions_ModifyMembersAccessControlAction) GetMembersAccess() AccessControl_AccessRequired { @@ -2543,14 +2372,14 @@ func (x *GroupChange_Actions_ModifyMembersAccessControlAction) GetMembersAccess( type GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction struct { state protoimpl.MessageState `protogen:"open.v1"` - AddFromInviteLinkAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=addFromInviteLinkAccess,proto3,enum=signal.AccessControl_AccessRequired" json:"addFromInviteLinkAccess,omitempty"` + AddFromInviteLinkAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=addFromInviteLinkAccess,proto3,enum=AccessControl_AccessRequired" json:"addFromInviteLinkAccess,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) Reset() { *x = GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction{} - mi := &file_Groups_proto_msgTypes[37] + mi := &file_Groups_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2562,7 +2391,7 @@ func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) String( func (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[37] + mi := &file_Groups_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2575,7 +2404,7 @@ func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) ProtoRe // Deprecated: Use GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 20} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 19} } func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) GetAddFromInviteLinkAccess() AccessControl_AccessRequired { @@ -2585,50 +2414,6 @@ func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) GetAddF return AccessControl_UNKNOWN } -type GroupChange_Actions_ModifyMemberLabelAccessControlAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - MemberLabelAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=memberLabelAccess,proto3,enum=signal.AccessControl_AccessRequired" json:"memberLabelAccess,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyMemberLabelAccessControlAction) Reset() { - *x = GroupChange_Actions_ModifyMemberLabelAccessControlAction{} - mi := &file_Groups_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyMemberLabelAccessControlAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyMemberLabelAccessControlAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyMemberLabelAccessControlAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[38] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupChange_Actions_ModifyMemberLabelAccessControlAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyMemberLabelAccessControlAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 21} -} - -func (x *GroupChange_Actions_ModifyMemberLabelAccessControlAction) GetMemberLabelAccess() AccessControl_AccessRequired { - if x != nil { - return x.MemberLabelAccess - } - return AccessControl_UNKNOWN -} - type GroupChange_Actions_ModifyInviteLinkPasswordAction struct { state protoimpl.MessageState `protogen:"open.v1"` InviteLinkPassword []byte `protobuf:"bytes,1,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` @@ -2638,7 +2423,7 @@ type GroupChange_Actions_ModifyInviteLinkPasswordAction struct { func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) Reset() { *x = GroupChange_Actions_ModifyInviteLinkPasswordAction{} - mi := &file_Groups_proto_msgTypes[39] + mi := &file_Groups_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2650,7 +2435,7 @@ func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) String() string { func (*GroupChange_Actions_ModifyInviteLinkPasswordAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[39] + mi := &file_Groups_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2663,7 +2448,7 @@ func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) ProtoReflect() prot // Deprecated: Use GroupChange_Actions_ModifyInviteLinkPasswordAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyInviteLinkPasswordAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 22} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 20} } func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) GetInviteLinkPassword() []byte { @@ -2675,14 +2460,14 @@ func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) GetInviteLinkPasswo type GroupChange_Actions_ModifyAnnouncementsOnlyAction struct { state protoimpl.MessageState `protogen:"open.v1"` - AnnouncementsOnly bool `protobuf:"varint,1,opt,name=announcements_only,json=announcementsOnly,proto3" json:"announcements_only,omitempty"` + AnnouncementsOnly bool `protobuf:"varint,1,opt,name=announcementsOnly,proto3" json:"announcementsOnly,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) Reset() { *x = GroupChange_Actions_ModifyAnnouncementsOnlyAction{} - mi := &file_Groups_proto_msgTypes[40] + mi := &file_Groups_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2694,7 +2479,7 @@ func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) String() string { func (*GroupChange_Actions_ModifyAnnouncementsOnlyAction) ProtoMessage() {} func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[40] + mi := &file_Groups_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2707,7 +2492,7 @@ func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) ProtoReflect() proto // Deprecated: Use GroupChange_Actions_ModifyAnnouncementsOnlyAction.ProtoReflect.Descriptor instead. func (*GroupChange_Actions_ModifyAnnouncementsOnlyAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 23} + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 21} } func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) GetAnnouncementsOnly() bool { @@ -2717,42 +2502,6 @@ func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) GetAnnouncementsOnly return false } -type GroupChange_Actions_TerminateGroupAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_TerminateGroupAction) Reset() { - *x = GroupChange_Actions_TerminateGroupAction{} - mi := &file_Groups_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_TerminateGroupAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_TerminateGroupAction) ProtoMessage() {} - -func (x *GroupChange_Actions_TerminateGroupAction) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[41] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupChange_Actions_TerminateGroupAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_TerminateGroupAction) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{10, 0, 24} -} - type GroupChanges_GroupChangeState struct { state protoimpl.MessageState `protogen:"open.v1"` GroupChange *GroupChange `protobuf:"bytes,1,opt,name=groupChange,proto3" json:"groupChange,omitempty"` @@ -2763,7 +2512,7 @@ type GroupChanges_GroupChangeState struct { func (x *GroupChanges_GroupChangeState) Reset() { *x = GroupChanges_GroupChangeState{} - mi := &file_Groups_proto_msgTypes[42] + mi := &file_Groups_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2775,7 +2524,7 @@ func (x *GroupChanges_GroupChangeState) String() string { func (*GroupChanges_GroupChangeState) ProtoMessage() {} func (x *GroupChanges_GroupChangeState) ProtoReflect() protoreflect.Message { - mi := &file_Groups_proto_msgTypes[42] + mi := &file_Groups_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2788,7 +2537,7 @@ func (x *GroupChanges_GroupChangeState) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupChanges_GroupChangeState.ProtoReflect.Descriptor instead. func (*GroupChanges_GroupChangeState) Descriptor() ([]byte, []int) { - return file_Groups_proto_rawDescGZIP(), []int{13, 0} + return file_Groups_proto_rawDescGZIP(), []int{9, 0} } func (x *GroupChanges_GroupChangeState) GetGroupChange() *GroupChange { @@ -2805,11 +2554,63 @@ func (x *GroupChanges_GroupChangeState) GetGroupState() *Group { return nil } +type GroupInviteLink_GroupInviteLinkContentsV1 struct { + state protoimpl.MessageState `protogen:"open.v1"` + GroupMasterKey []byte `protobuf:"bytes,1,opt,name=groupMasterKey,proto3" json:"groupMasterKey,omitempty"` + InviteLinkPassword []byte `protobuf:"bytes,2,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GroupInviteLink_GroupInviteLinkContentsV1) Reset() { + *x = GroupInviteLink_GroupInviteLinkContentsV1{} + mi := &file_Groups_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GroupInviteLink_GroupInviteLinkContentsV1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupInviteLink_GroupInviteLinkContentsV1) ProtoMessage() {} + +func (x *GroupInviteLink_GroupInviteLinkContentsV1) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[39] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupInviteLink_GroupInviteLinkContentsV1.ProtoReflect.Descriptor instead. +func (*GroupInviteLink_GroupInviteLinkContentsV1) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *GroupInviteLink_GroupInviteLinkContentsV1) GetGroupMasterKey() []byte { + if x != nil { + return x.GroupMasterKey + } + return nil +} + +func (x *GroupInviteLink_GroupInviteLinkContentsV1) GetInviteLinkPassword() []byte { + if x != nil { + return x.InviteLinkPassword + } + return nil +} + var File_Groups_proto protoreflect.FileDescriptor const file_Groups_proto_rawDesc = "" + "\n" + - "\fGroups.proto\x12\x06signal\"\xc4\x01\n" + + "\fGroups.proto\"\xc4\x01\n" + "\x16AvatarUploadAttributes\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x1e\n" + "\n" + @@ -2819,212 +2620,193 @@ const file_Groups_proto_rawDesc = "" + "\talgorithm\x18\x04 \x01(\tR\talgorithm\x12\x12\n" + "\x04date\x18\x05 \x01(\tR\x04date\x12\x16\n" + "\x06policy\x18\x06 \x01(\tR\x06policy\x12\x1c\n" + - "\tsignature\x18\a \x01(\tR\tsignature\"\xae\x02\n" + + "\tsignature\x18\a \x01(\tR\tsignature\"\xe7\x01\n" + "\x06Member\x12\x16\n" + - "\x06userId\x18\x01 \x01(\fR\x06userId\x12'\n" + - "\x04role\x18\x02 \x01(\x0e2\x13.signal.Member.RoleR\x04role\x12\x1e\n" + + "\x06userId\x18\x01 \x01(\fR\x06userId\x12 \n" + + "\x04role\x18\x02 \x01(\x0e2\f.Member.RoleR\x04role\x12\x1e\n" + "\n" + "profileKey\x18\x03 \x01(\fR\n" + "profileKey\x12\"\n" + - "\fpresentation\x18\x04 \x01(\fR\fpresentation\x12(\n" + - "\x0fjoinedAtVersion\x18\x05 \x01(\rR\x0fjoinedAtVersion\x12\x1e\n" + - "\n" + - "labelEmoji\x18\x06 \x01(\fR\n" + - "labelEmoji\x12 \n" + - "\vlabelString\x18\a \x01(\fR\vlabelString\"3\n" + + "\fpresentation\x18\x04 \x01(\fR\fpresentation\x12*\n" + + "\x10joinedAtRevision\x18\x05 \x01(\rR\x10joinedAtRevision\"3\n" + "\x04Role\x12\v\n" + "\aUNKNOWN\x10\x00\x12\v\n" + "\aDEFAULT\x10\x01\x12\x11\n" + - "\rADMINISTRATOR\x10\x02\"\x85\x01\n" + - "\x17MemberPendingProfileKey\x12&\n" + - "\x06member\x18\x01 \x01(\v2\x0e.signal.MemberR\x06member\x12$\n" + + "\rADMINISTRATOR\x10\x02\"t\n" + + "\rPendingMember\x12\x1f\n" + + "\x06member\x18\x01 \x01(\v2\a.MemberR\x06member\x12$\n" + "\raddedByUserId\x18\x02 \x01(\fR\raddedByUserId\x12\x1c\n" + - "\ttimestamp\x18\x03 \x01(\x04R\ttimestamp\"\x96\x01\n" + - "\x1aMemberPendingAdminApproval\x12\x16\n" + + "\ttimestamp\x18\x03 \x01(\x04R\ttimestamp\"\x8c\x01\n" + + "\x10RequestingMember\x12\x16\n" + "\x06userId\x18\x01 \x01(\fR\x06userId\x12\x1e\n" + "\n" + "profileKey\x18\x02 \x01(\fR\n" + "profileKey\x12\"\n" + "\fpresentation\x18\x03 \x01(\fR\fpresentation\x12\x1c\n" + "\ttimestamp\x18\x04 \x01(\x04R\ttimestamp\"D\n" + - "\fMemberBanned\x12\x16\n" + + "\fBannedMember\x12\x16\n" + "\x06userId\x18\x01 \x01(\fR\x06userId\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\"\x8b\x03\n" + - "\rAccessControl\x12D\n" + + "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\"\xae\x02\n" + + "\rAccessControl\x12=\n" + "\n" + - "attributes\x18\x01 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\n" + - "attributes\x12>\n" + - "\amembers\x18\x02 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\amembers\x12R\n" + - "\x11addFromInviteLink\x18\x03 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\x11addFromInviteLink\x12F\n" + - "\vmemberLabel\x18\x04 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\vmemberLabel\"X\n" + + "attributes\x18\x01 \x01(\x0e2\x1d.AccessControl.AccessRequiredR\n" + + "attributes\x127\n" + + "\amembers\x18\x02 \x01(\x0e2\x1d.AccessControl.AccessRequiredR\amembers\x12K\n" + + "\x11addFromInviteLink\x18\x03 \x01(\x0e2\x1d.AccessControl.AccessRequiredR\x11addFromInviteLink\"X\n" + "\x0eAccessRequired\x12\v\n" + "\aUNKNOWN\x10\x00\x12\a\n" + "\x03ANY\x10\x01\x12\n" + "\n" + "\x06MEMBER\x10\x02\x12\x11\n" + "\rADMINISTRATOR\x10\x03\x12\x11\n" + - "\rUNSATISFIABLE\x10\x04\"\xb9\x05\n" + + "\rUNSATISFIABLE\x10\x04\"\xb4\x04\n" + "\x05Group\x12\x1c\n" + "\tpublicKey\x18\x01 \x01(\fR\tpublicKey\x12\x14\n" + - "\x05title\x18\x02 \x01(\fR\x05title\x12 \n" + - "\vdescription\x18\v \x01(\fR\vdescription\x12\x1c\n" + - "\tavatarUrl\x18\x03 \x01(\tR\tavatarUrl\x12<\n" + - "\x19disappearingMessagesTimer\x18\x04 \x01(\fR\x19disappearingMessagesTimer\x12;\n" + - "\raccessControl\x18\x05 \x01(\v2\x15.signal.AccessControlR\raccessControl\x12\x18\n" + - "\aversion\x18\x06 \x01(\rR\aversion\x12(\n" + - "\amembers\x18\a \x03(\v2\x0e.signal.MemberR\amembers\x12[\n" + - "\x18membersPendingProfileKey\x18\b \x03(\v2\x1f.signal.MemberPendingProfileKeyR\x18membersPendingProfileKey\x12d\n" + - "\x1bmembersPendingAdminApproval\x18\t \x03(\v2\".signal.MemberPendingAdminApprovalR\x1bmembersPendingAdminApproval\x12.\n" + + "\x05title\x18\x02 \x01(\fR\x05title\x12\x16\n" + + "\x06avatar\x18\x03 \x01(\tR\x06avatar\x12<\n" + + "\x19disappearingMessagesTimer\x18\x04 \x01(\fR\x19disappearingMessagesTimer\x124\n" + + "\raccessControl\x18\x05 \x01(\v2\x0e.AccessControlR\raccessControl\x12\x1a\n" + + "\brevision\x18\x06 \x01(\rR\brevision\x12!\n" + + "\amembers\x18\a \x03(\v2\a.MemberR\amembers\x126\n" + + "\x0ependingMembers\x18\b \x03(\v2\x0e.PendingMemberR\x0ependingMembers\x12?\n" + + "\x11requestingMembers\x18\t \x03(\v2\x11.RequestingMemberR\x11requestingMembers\x12.\n" + "\x12inviteLinkPassword\x18\n" + - " \x01(\fR\x12inviteLinkPassword\x12-\n" + - "\x12announcements_only\x18\f \x01(\bR\x11announcementsOnly\x12;\n" + - "\x0emembers_banned\x18\r \x03(\v2\x14.signal.MemberBannedR\rmembersBanned\x12\x1e\n" + - "\n" + - "terminated\x18\x0e \x01(\bR\n" + - "terminated\"\xc3\x01\n" + - "\x12GroupAttributeBlob\x12\x16\n" + - "\x05title\x18\x01 \x01(\tH\x00R\x05title\x12\x18\n" + - "\x06avatar\x18\x02 \x01(\fH\x00R\x06avatar\x12D\n" + - "\x1cdisappearingMessagesDuration\x18\x03 \x01(\rH\x00R\x1cdisappearingMessagesDuration\x12*\n" + - "\x0fdescriptionText\x18\x04 \x01(\tH\x00R\x0fdescriptionTextB\t\n" + - "\acontent\"\xe7\x01\n" + - "\x0fGroupInviteLink\x12S\n" + - "\n" + - "contentsV1\x18\x01 \x01(\v21.signal.GroupInviteLink.GroupInviteLinkContentsV1H\x00R\n" + - "contentsV1\x1as\n" + - "\x19GroupInviteLinkContentsV1\x12&\n" + - "\x0egroupMasterKey\x18\x01 \x01(\fR\x0egroupMasterKey\x12.\n" + - "\x12inviteLinkPassword\x18\x02 \x01(\fR\x12inviteLinkPasswordB\n" + - "\n" + - "\bcontents\"\xc1\x02\n" + - "\rGroupJoinInfo\x12\x1c\n" + - "\tpublicKey\x18\x01 \x01(\fR\tpublicKey\x12\x14\n" + - "\x05title\x18\x02 \x01(\fR\x05title\x12 \n" + - "\vdescription\x18\b \x01(\fR\vdescription\x12\x16\n" + - "\x06avatar\x18\x03 \x01(\tR\x06avatar\x12 \n" + - "\vmemberCount\x18\x04 \x01(\rR\vmemberCount\x12R\n" + - "\x11addFromInviteLink\x18\x05 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\x11addFromInviteLink\x12\x18\n" + - "\aversion\x18\x06 \x01(\rR\aversion\x122\n" + - "\x14pendingAdminApproval\x18\a \x01(\bR\x14pendingAdminApproval\"\xa6*\n" + + " \x01(\fR\x12inviteLinkPassword\x12 \n" + + "\vdescription\x18\v \x01(\fR\vdescription\x12,\n" + + "\x11announcementsOnly\x18\f \x01(\bR\x11announcementsOnly\x123\n" + + "\rbannedMembers\x18\r \x03(\v2\r.BannedMemberR\rbannedMembers\"\xe6!\n" + "\vGroupChange\x12\x18\n" + "\aactions\x18\x01 \x01(\fR\aactions\x12(\n" + "\x0fserverSignature\x18\x02 \x01(\fR\x0fserverSignature\x12 \n" + - "\vchangeEpoch\x18\x03 \x01(\rR\vchangeEpoch\x1a\xb0)\n" + - "\aActions\x12\"\n" + - "\fsourceUserId\x18\x01 \x01(\fR\fsourceUserId\x12\x19\n" + - "\bgroup_id\x18\x19 \x01(\fR\agroupId\x12\x18\n" + - "\aversion\x18\x02 \x01(\rR\aversion\x12K\n" + + "\vchangeEpoch\x18\x03 \x01(\rR\vchangeEpoch\x1a\xf0 \n" + + "\aActions\x12(\n" + + "\x0fsourceServiceId\x18\x01 \x01(\fR\x0fsourceServiceId\x12\x18\n" + + "\agroupId\x18\x19 \x01(\fR\agroupId\x12\x1a\n" + + "\brevision\x18\x02 \x01(\rR\brevision\x12D\n" + "\n" + - "addMembers\x18\x03 \x03(\v2+.signal.GroupChange.Actions.AddMemberActionR\n" + - "addMembers\x12T\n" + - "\rdeleteMembers\x18\x04 \x03(\v2..signal.GroupChange.Actions.DeleteMemberActionR\rdeleteMembers\x12`\n" + - "\x11modifyMemberRoles\x18\x05 \x03(\v22.signal.GroupChange.Actions.ModifyMemberRoleActionR\x11modifyMemberRoles\x12r\n" + - "\x17modifyMemberProfileKeys\x18\x06 \x03(\v28.signal.GroupChange.Actions.ModifyMemberProfileKeyActionR\x17modifyMemberProfileKeys\x12~\n" + - "\x1baddMembersPendingProfileKey\x18\a \x03(\v2<.signal.GroupChange.Actions.AddMemberPendingProfileKeyActionR\x1baddMembersPendingProfileKey\x12\x87\x01\n" + - "\x1edeleteMembersPendingProfileKey\x18\b \x03(\v2?.signal.GroupChange.Actions.DeleteMemberPendingProfileKeyActionR\x1edeleteMembersPendingProfileKey\x12\x8a\x01\n" + - "\x1fpromoteMembersPendingProfileKey\x18\t \x03(\v2@.signal.GroupChange.Actions.PromoteMemberPendingProfileKeyActionR\x1fpromoteMembersPendingProfileKey\x12O\n" + + "addMembers\x18\x03 \x03(\v2$.GroupChange.Actions.AddMemberActionR\n" + + "addMembers\x12M\n" + + "\rdeleteMembers\x18\x04 \x03(\v2'.GroupChange.Actions.DeleteMemberActionR\rdeleteMembers\x12Y\n" + + "\x11modifyMemberRoles\x18\x05 \x03(\v2+.GroupChange.Actions.ModifyMemberRoleActionR\x11modifyMemberRoles\x12k\n" + + "\x17modifyMemberProfileKeys\x18\x06 \x03(\v21.GroupChange.Actions.ModifyMemberProfileKeyActionR\x17modifyMemberProfileKeys\x12Y\n" + + "\x11addPendingMembers\x18\a \x03(\v2+.GroupChange.Actions.AddPendingMemberActionR\x11addPendingMembers\x12b\n" + + "\x14deletePendingMembers\x18\b \x03(\v2..GroupChange.Actions.DeletePendingMemberActionR\x14deletePendingMembers\x12e\n" + + "\x15promotePendingMembers\x18\t \x03(\v2/.GroupChange.Actions.PromotePendingMemberActionR\x15promotePendingMembers\x12H\n" + "\vmodifyTitle\x18\n" + - " \x01(\v2-.signal.GroupChange.Actions.ModifyTitleActionR\vmodifyTitle\x12R\n" + - "\fmodifyAvatar\x18\v \x01(\v2..signal.GroupChange.Actions.ModifyAvatarActionR\fmodifyAvatar\x12\x88\x01\n" + - "\x1emodifyDisappearingMessageTimer\x18\f \x01(\v2@.signal.GroupChange.Actions.ModifyDisappearingMessageTimerActionR\x1emodifyDisappearingMessageTimer\x12w\n" + - "\x16modifyAttributesAccess\x18\r \x01(\v2?.signal.GroupChange.Actions.ModifyAttributesAccessControlActionR\x16modifyAttributesAccess\x12l\n" + - "\x12modifyMemberAccess\x18\x0e \x01(\v2<.signal.GroupChange.Actions.ModifyMembersAccessControlActionR\x12modifyMemberAccess\x12\x8c\x01\n" + - "\x1dmodifyAddFromInviteLinkAccess\x18\x0f \x01(\v2F.signal.GroupChange.Actions.ModifyAddFromInviteLinkAccessControlActionR\x1dmodifyAddFromInviteLinkAccess\x12\x87\x01\n" + - "\x1eaddMembersPendingAdminApproval\x18\x10 \x03(\v2?.signal.GroupChange.Actions.AddMemberPendingAdminApprovalActionR\x1eaddMembersPendingAdminApproval\x12\x90\x01\n" + - "!deleteMembersPendingAdminApproval\x18\x11 \x03(\v2B.signal.GroupChange.Actions.DeleteMemberPendingAdminApprovalActionR!deleteMembersPendingAdminApproval\x12\x93\x01\n" + - "\"promoteMembersPendingAdminApproval\x18\x12 \x03(\v2C.signal.GroupChange.Actions.PromoteMemberPendingAdminApprovalActionR\"promoteMembersPendingAdminApproval\x12v\n" + - "\x18modifyInviteLinkPassword\x18\x13 \x01(\v2:.signal.GroupChange.Actions.ModifyInviteLinkPasswordActionR\x18modifyInviteLinkPassword\x12a\n" + - "\x11modifyDescription\x18\x14 \x01(\v23.signal.GroupChange.Actions.ModifyDescriptionActionR\x11modifyDescription\x12u\n" + - "\x19modify_announcements_only\x18\x15 \x01(\v29.signal.GroupChange.Actions.ModifyAnnouncementsOnlyActionR\x17modifyAnnouncementsOnly\x12_\n" + - "\x12add_members_banned\x18\x16 \x03(\v21.signal.GroupChange.Actions.AddMemberBannedActionR\x10addMembersBanned\x12h\n" + - "\x15delete_members_banned\x18\x17 \x03(\v24.signal.GroupChange.Actions.DeleteMemberBannedActionR\x13deleteMembersBanned\x12\xa2\x01\n" + - "+promote_members_pending_pni_aci_profile_key\x18\x18 \x03(\v2F.signal.GroupChange.Actions.PromoteMemberPendingPniAciProfileKeyActionR%promoteMembersPendingPniAciProfileKey\x12c\n" + - "\x12modifyMemberLabels\x18\x1a \x03(\v23.signal.GroupChange.Actions.ModifyMemberLabelActionR\x12modifyMemberLabels\x12z\n" + - "\x17modifyMemberLabelAccess\x18\x1b \x01(\v2@.signal.GroupChange.Actions.ModifyMemberLabelAccessControlActionR\x17modifyMemberLabelAccess\x12Y\n" + - "\x0fterminate_group\x18\x1c \x01(\v20.signal.GroupChange.Actions.TerminateGroupActionR\x0eterminateGroup\x1ag\n" + - "\x0fAddMemberAction\x12$\n" + - "\x05added\x18\x01 \x01(\v2\x0e.signal.MemberR\x05added\x12.\n" + + " \x01(\v2&.GroupChange.Actions.ModifyTitleActionR\vmodifyTitle\x12K\n" + + "\fmodifyAvatar\x18\v \x01(\v2'.GroupChange.Actions.ModifyAvatarActionR\fmodifyAvatar\x12\x84\x01\n" + + "\x1fmodifyDisappearingMessagesTimer\x18\f \x01(\v2:.GroupChange.Actions.ModifyDisappearingMessagesTimerActionR\x1fmodifyDisappearingMessagesTimer\x12p\n" + + "\x16modifyAttributesAccess\x18\r \x01(\v28.GroupChange.Actions.ModifyAttributesAccessControlActionR\x16modifyAttributesAccess\x12e\n" + + "\x12modifyMemberAccess\x18\x0e \x01(\v25.GroupChange.Actions.ModifyMembersAccessControlActionR\x12modifyMemberAccess\x12\x85\x01\n" + + "\x1dmodifyAddFromInviteLinkAccess\x18\x0f \x01(\v2?.GroupChange.Actions.ModifyAddFromInviteLinkAccessControlActionR\x1dmodifyAddFromInviteLinkAccess\x12b\n" + + "\x14addRequestingMembers\x18\x10 \x03(\v2..GroupChange.Actions.AddRequestingMemberActionR\x14addRequestingMembers\x12k\n" + + "\x17deleteRequestingMembers\x18\x11 \x03(\v21.GroupChange.Actions.DeleteRequestingMemberActionR\x17deleteRequestingMembers\x12n\n" + + "\x18promoteRequestingMembers\x18\x12 \x03(\v22.GroupChange.Actions.PromoteRequestingMemberActionR\x18promoteRequestingMembers\x12o\n" + + "\x18modifyInviteLinkPassword\x18\x13 \x01(\v23.GroupChange.Actions.ModifyInviteLinkPasswordActionR\x18modifyInviteLinkPassword\x12Z\n" + + "\x11modifyDescription\x18\x14 \x01(\v2,.GroupChange.Actions.ModifyDescriptionActionR\x11modifyDescription\x12l\n" + + "\x17modifyAnnouncementsOnly\x18\x15 \x01(\v22.GroupChange.Actions.ModifyAnnouncementsOnlyActionR\x17modifyAnnouncementsOnly\x12V\n" + + "\x10addBannedMembers\x18\x16 \x03(\v2*.GroupChange.Actions.AddBannedMemberActionR\x10addBannedMembers\x12_\n" + + "\x13deleteBannedMembers\x18\x17 \x03(\v2-.GroupChange.Actions.DeleteBannedMemberActionR\x13deleteBannedMembers\x12\x81\x01\n" + + "\x1bpromotePendingPniAciMembers\x18\x18 \x03(\v2?.GroupChange.Actions.PromotePendingPniAciMemberProfileKeyActionR\x1bpromotePendingPniAciMembers\x1a`\n" + + "\x0fAddMemberAction\x12\x1d\n" + + "\x05added\x18\x01 \x01(\v2\a.MemberR\x05added\x12.\n" + "\x12joinFromInviteLink\x18\x02 \x01(\bR\x12joinFromInviteLink\x1a:\n" + "\x12DeleteMemberAction\x12$\n" + - "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1aY\n" + + "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1aR\n" + "\x16ModifyMemberRoleAction\x12\x16\n" + - "\x06userId\x18\x01 \x01(\fR\x06userId\x12'\n" + - "\x04role\x18\x02 \x01(\x0e2\x13.signal.Member.RoleR\x04role\x1as\n" + - "\x17ModifyMemberLabelAction\x12\x16\n" + - "\x06userId\x18\x01 \x01(\fR\x06userId\x12\x1e\n" + - "\n" + - "labelEmoji\x18\x02 \x01(\fR\n" + - "labelEmoji\x12 \n" + - "\vlabelString\x18\x03 \x01(\fR\vlabelString\x1a|\n" + + "\x06userId\x18\x01 \x01(\fR\x06userId\x12 \n" + + "\x04role\x18\x02 \x01(\x0e2\f.Member.RoleR\x04role\x1a|\n" + "\x1cModifyMemberProfileKeyAction\x12\"\n" + "\fpresentation\x18\x01 \x01(\fR\fpresentation\x12\x17\n" + "\auser_id\x18\x02 \x01(\fR\x06userId\x12\x1f\n" + "\vprofile_key\x18\x03 \x01(\fR\n" + - "profileKey\x1aY\n" + - " AddMemberPendingProfileKeyAction\x125\n" + - "\x05added\x18\x01 \x01(\v2\x1f.signal.MemberPendingProfileKeyR\x05added\x1aK\n" + - "#DeleteMemberPendingProfileKeyAction\x12$\n" + - "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1a\x84\x01\n" + - "$PromoteMemberPendingProfileKeyAction\x12\"\n" + + "profileKey\x1a>\n" + + "\x16AddPendingMemberAction\x12$\n" + + "\x05added\x18\x01 \x01(\v2\x0e.PendingMemberR\x05added\x1aA\n" + + "\x19DeletePendingMemberAction\x12$\n" + + "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1az\n" + + "\x1aPromotePendingMemberAction\x12\"\n" + "\fpresentation\x18\x01 \x01(\fR\fpresentation\x12\x17\n" + "\auser_id\x18\x02 \x01(\fR\x06userId\x12\x1f\n" + "\vprofile_key\x18\x03 \x01(\fR\n" + - "profileKey\x1a\x9c\x01\n" + - "*PromoteMemberPendingPniAciProfileKeyAction\x12\"\n" + - "\fpresentation\x18\x01 \x01(\fR\fpresentation\x12\x17\n" + - "\auser_id\x18\x02 \x01(\fR\x06userId\x12\x10\n" + - "\x03pni\x18\x03 \x01(\fR\x03pni\x12\x1f\n" + - "\vprofile_key\x18\x04 \x01(\fR\n" + - "profileKey\x1a_\n" + - "#AddMemberPendingAdminApprovalAction\x128\n" + - "\x05added\x18\x01 \x01(\v2\".signal.MemberPendingAdminApprovalR\x05added\x1aN\n" + - "&DeleteMemberPendingAdminApprovalAction\x12$\n" + - "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1aj\n" + - "'PromoteMemberPendingAdminApprovalAction\x12\x16\n" + - "\x06userId\x18\x01 \x01(\fR\x06userId\x12'\n" + - "\x04role\x18\x02 \x01(\x0e2\x13.signal.Member.RoleR\x04role\x1aC\n" + - "\x15AddMemberBannedAction\x12*\n" + - "\x05added\x18\x01 \x01(\v2\x14.signal.MemberBannedR\x05added\x1a@\n" + - "\x18DeleteMemberBannedAction\x12$\n" + + "profileKey\x1a\x9a\x01\n" + + "*PromotePendingPniAciMemberProfileKeyAction\x12\"\n" + + "\fpresentation\x18\x01 \x01(\fR\fpresentation\x12\x16\n" + + "\x06userId\x18\x02 \x01(\fR\x06userId\x12\x10\n" + + "\x03pni\x18\x03 \x01(\fR\x03pni\x12\x1e\n" + + "\n" + + "profileKey\x18\x04 \x01(\fR\n" + + "profileKey\x1aD\n" + + "\x19AddRequestingMemberAction\x12'\n" + + "\x05added\x18\x01 \x01(\v2\x11.RequestingMemberR\x05added\x1aD\n" + + "\x1cDeleteRequestingMemberAction\x12$\n" + + "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1aY\n" + + "\x1dPromoteRequestingMemberAction\x12\x16\n" + + "\x06userId\x18\x01 \x01(\fR\x06userId\x12 \n" + + "\x04role\x18\x02 \x01(\x0e2\f.Member.RoleR\x04role\x1a<\n" + + "\x15AddBannedMemberAction\x12#\n" + + "\x05added\x18\x01 \x01(\v2\r.BannedMemberR\x05added\x1a@\n" + + "\x18DeleteBannedMemberAction\x12$\n" + "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1a)\n" + "\x11ModifyTitleAction\x12\x14\n" + "\x05title\x18\x01 \x01(\fR\x05title\x1a;\n" + "\x17ModifyDescriptionAction\x12 \n" + "\vdescription\x18\x01 \x01(\fR\vdescription\x1a,\n" + "\x12ModifyAvatarAction\x12\x16\n" + - "\x06avatar\x18\x01 \x01(\tR\x06avatar\x1a<\n" + - "$ModifyDisappearingMessageTimerAction\x12\x14\n" + - "\x05timer\x18\x01 \x01(\fR\x05timer\x1aw\n" + - "#ModifyAttributesAccessControlAction\x12P\n" + - "\x10attributesAccess\x18\x01 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\x10attributesAccess\x1an\n" + - " ModifyMembersAccessControlAction\x12J\n" + - "\rmembersAccess\x18\x01 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\rmembersAccess\x1a\x8c\x01\n" + - "*ModifyAddFromInviteLinkAccessControlAction\x12^\n" + - "\x17addFromInviteLinkAccess\x18\x01 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\x17addFromInviteLinkAccess\x1az\n" + - "$ModifyMemberLabelAccessControlAction\x12R\n" + - "\x11memberLabelAccess\x18\x01 \x01(\x0e2$.signal.AccessControl.AccessRequiredR\x11memberLabelAccess\x1aP\n" + + "\x06avatar\x18\x01 \x01(\tR\x06avatar\x1a=\n" + + "%ModifyDisappearingMessagesTimerAction\x12\x14\n" + + "\x05timer\x18\x01 \x01(\fR\x05timer\x1ap\n" + + "#ModifyAttributesAccessControlAction\x12I\n" + + "\x10attributesAccess\x18\x01 \x01(\x0e2\x1d.AccessControl.AccessRequiredR\x10attributesAccess\x1ag\n" + + " ModifyMembersAccessControlAction\x12C\n" + + "\rmembersAccess\x18\x01 \x01(\x0e2\x1d.AccessControl.AccessRequiredR\rmembersAccess\x1a\x85\x01\n" + + "*ModifyAddFromInviteLinkAccessControlAction\x12W\n" + + "\x17addFromInviteLinkAccess\x18\x01 \x01(\x0e2\x1d.AccessControl.AccessRequiredR\x17addFromInviteLinkAccess\x1aP\n" + "\x1eModifyInviteLinkPasswordAction\x12.\n" + - "\x12inviteLinkPassword\x18\x01 \x01(\fR\x12inviteLinkPassword\x1aN\n" + - "\x1dModifyAnnouncementsOnlyAction\x12-\n" + - "\x12announcements_only\x18\x01 \x01(\bR\x11announcementsOnly\x1a\x16\n" + - "\x14TerminateGroupAction\"/\n" + - "\x17ExternalGroupCredential\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\"}\n" + - "\rGroupResponse\x12#\n" + - "\x05group\x18\x01 \x01(\v2\r.signal.GroupR\x05group\x12G\n" + - " group_send_endorsements_response\x18\x02 \x01(\fR\x1dgroupSendEndorsementsResponse\"\x9c\x02\n" + - "\fGroupChanges\x12I\n" + - "\fgroupChanges\x18\x01 \x03(\v2%.signal.GroupChanges.GroupChangeStateR\fgroupChanges\x12G\n" + - " group_send_endorsements_response\x18\x02 \x01(\fR\x1dgroupSendEndorsementsResponse\x1ax\n" + - "\x10GroupChangeState\x125\n" + - "\vgroupChange\x18\x01 \x01(\v2\x13.signal.GroupChangeR\vgroupChange\x12-\n" + + "\x12inviteLinkPassword\x18\x01 \x01(\fR\x12inviteLinkPassword\x1aM\n" + + "\x1dModifyAnnouncementsOnlyAction\x12,\n" + + "\x11announcementsOnly\x18\x01 \x01(\bR\x11announcementsOnly\"s\n" + + "\rGroupResponse\x12\x1c\n" + + "\x05group\x18\x01 \x01(\v2\x06.GroupR\x05group\x12D\n" + + "\x1dgroupSendEndorsementsResponse\x18\x02 \x01(\fR\x1dgroupSendEndorsementsResponse\"\x84\x02\n" + + "\fGroupChanges\x12B\n" + + "\fgroupChanges\x18\x01 \x03(\v2\x1e.GroupChanges.GroupChangeStateR\fgroupChanges\x12D\n" + + "\x1dgroupSendEndorsementsResponse\x18\x02 \x01(\fR\x1dgroupSendEndorsementsResponse\x1aj\n" + + "\x10GroupChangeState\x12.\n" + + "\vgroupChange\x18\x01 \x01(\v2\f.GroupChangeR\vgroupChange\x12&\n" + "\n" + - "groupState\x18\x02 \x01(\v2\r.signal.GroupR\n" + - "groupState\"\x96\x01\n" + - "\x13GroupChangeResponse\x126\n" + - "\fgroup_change\x18\x01 \x01(\v2\x13.signal.GroupChangeR\vgroupChange\x12G\n" + - " group_send_endorsements_response\x18\x02 \x01(\fR\x1dgroupSendEndorsementsResponseB@\n" + - "/org.signal.storageservice.storage.protos.groupsB\vGroupProtosP\x01b\x06proto3" + "groupState\x18\x02 \x01(\v2\x06.GroupR\n" + + "groupState\"\x8b\x01\n" + + "\x13GroupChangeResponse\x12.\n" + + "\vgroupChange\x18\x01 \x01(\v2\f.GroupChangeR\vgroupChange\x12D\n" + + "\x1dgroupSendEndorsementsResponse\x18\x02 \x01(\fR\x1dgroupSendEndorsementsResponse\"\xbb\x01\n" + + "\x12GroupAttributeBlob\x12\x16\n" + + "\x05title\x18\x01 \x01(\tH\x00R\x05title\x12\x18\n" + + "\x06avatar\x18\x02 \x01(\fH\x00R\x06avatar\x12D\n" + + "\x1cdisappearingMessagesDuration\x18\x03 \x01(\rH\x00R\x1cdisappearingMessagesDuration\x12\"\n" + + "\vdescription\x18\x04 \x01(\tH\x00R\vdescriptionB\t\n" + + "\acontent\"\xe0\x01\n" + + "\x0fGroupInviteLink\x12L\n" + + "\n" + + "v1Contents\x18\x01 \x01(\v2*.GroupInviteLink.GroupInviteLinkContentsV1H\x00R\n" + + "v1Contents\x1as\n" + + "\x19GroupInviteLinkContentsV1\x12&\n" + + "\x0egroupMasterKey\x18\x01 \x01(\fR\x0egroupMasterKey\x12.\n" + + "\x12inviteLinkPassword\x18\x02 \x01(\fR\x12inviteLinkPasswordB\n" + + "\n" + + "\bcontents\"\xbc\x02\n" + + "\rGroupJoinInfo\x12\x1c\n" + + "\tpublicKey\x18\x01 \x01(\fR\tpublicKey\x12\x14\n" + + "\x05title\x18\x02 \x01(\fR\x05title\x12\x16\n" + + "\x06avatar\x18\x03 \x01(\tR\x06avatar\x12 \n" + + "\vmemberCount\x18\x04 \x01(\rR\vmemberCount\x12K\n" + + "\x11addFromInviteLink\x18\x05 \x01(\x0e2\x1d.AccessControl.AccessRequiredR\x11addFromInviteLink\x12\x1a\n" + + "\brevision\x18\x06 \x01(\rR\brevision\x122\n" + + "\x14pendingAdminApproval\x18\a \x01(\bR\x14pendingAdminApproval\x12 \n" + + "\vdescription\x18\b \x01(\fR\vdescription\"/\n" + + "\x17GroupExternalCredential\x12\x14\n" + + "\x05token\x18\x01 \x01(\tR\x05tokenB+\n" + + "'org.signal.storageservice.protos.groupsP\x01b\x06proto3" var ( file_Groups_proto_rawDescOnce sync.Once @@ -3039,113 +2821,105 @@ func file_Groups_proto_rawDescGZIP() []byte { } var file_Groups_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_Groups_proto_msgTypes = make([]protoimpl.MessageInfo, 43) +var file_Groups_proto_msgTypes = make([]protoimpl.MessageInfo, 40) var file_Groups_proto_goTypes = []any{ - (Member_Role)(0), // 0: signal.Member.Role - (AccessControl_AccessRequired)(0), // 1: signal.AccessControl.AccessRequired - (*AvatarUploadAttributes)(nil), // 2: signal.AvatarUploadAttributes - (*Member)(nil), // 3: signal.Member - (*MemberPendingProfileKey)(nil), // 4: signal.MemberPendingProfileKey - (*MemberPendingAdminApproval)(nil), // 5: signal.MemberPendingAdminApproval - (*MemberBanned)(nil), // 6: signal.MemberBanned - (*AccessControl)(nil), // 7: signal.AccessControl - (*Group)(nil), // 8: signal.Group - (*GroupAttributeBlob)(nil), // 9: signal.GroupAttributeBlob - (*GroupInviteLink)(nil), // 10: signal.GroupInviteLink - (*GroupJoinInfo)(nil), // 11: signal.GroupJoinInfo - (*GroupChange)(nil), // 12: signal.GroupChange - (*ExternalGroupCredential)(nil), // 13: signal.ExternalGroupCredential - (*GroupResponse)(nil), // 14: signal.GroupResponse - (*GroupChanges)(nil), // 15: signal.GroupChanges - (*GroupChangeResponse)(nil), // 16: signal.GroupChangeResponse - (*GroupInviteLink_GroupInviteLinkContentsV1)(nil), // 17: signal.GroupInviteLink.GroupInviteLinkContentsV1 - (*GroupChange_Actions)(nil), // 18: signal.GroupChange.Actions - (*GroupChange_Actions_AddMemberAction)(nil), // 19: signal.GroupChange.Actions.AddMemberAction - (*GroupChange_Actions_DeleteMemberAction)(nil), // 20: signal.GroupChange.Actions.DeleteMemberAction - (*GroupChange_Actions_ModifyMemberRoleAction)(nil), // 21: signal.GroupChange.Actions.ModifyMemberRoleAction - (*GroupChange_Actions_ModifyMemberLabelAction)(nil), // 22: signal.GroupChange.Actions.ModifyMemberLabelAction - (*GroupChange_Actions_ModifyMemberProfileKeyAction)(nil), // 23: signal.GroupChange.Actions.ModifyMemberProfileKeyAction - (*GroupChange_Actions_AddMemberPendingProfileKeyAction)(nil), // 24: signal.GroupChange.Actions.AddMemberPendingProfileKeyAction - (*GroupChange_Actions_DeleteMemberPendingProfileKeyAction)(nil), // 25: signal.GroupChange.Actions.DeleteMemberPendingProfileKeyAction - (*GroupChange_Actions_PromoteMemberPendingProfileKeyAction)(nil), // 26: signal.GroupChange.Actions.PromoteMemberPendingProfileKeyAction - (*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction)(nil), // 27: signal.GroupChange.Actions.PromoteMemberPendingPniAciProfileKeyAction - (*GroupChange_Actions_AddMemberPendingAdminApprovalAction)(nil), // 28: signal.GroupChange.Actions.AddMemberPendingAdminApprovalAction - (*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction)(nil), // 29: signal.GroupChange.Actions.DeleteMemberPendingAdminApprovalAction - (*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction)(nil), // 30: signal.GroupChange.Actions.PromoteMemberPendingAdminApprovalAction - (*GroupChange_Actions_AddMemberBannedAction)(nil), // 31: signal.GroupChange.Actions.AddMemberBannedAction - (*GroupChange_Actions_DeleteMemberBannedAction)(nil), // 32: signal.GroupChange.Actions.DeleteMemberBannedAction - (*GroupChange_Actions_ModifyTitleAction)(nil), // 33: signal.GroupChange.Actions.ModifyTitleAction - (*GroupChange_Actions_ModifyDescriptionAction)(nil), // 34: signal.GroupChange.Actions.ModifyDescriptionAction - (*GroupChange_Actions_ModifyAvatarAction)(nil), // 35: signal.GroupChange.Actions.ModifyAvatarAction - (*GroupChange_Actions_ModifyDisappearingMessageTimerAction)(nil), // 36: signal.GroupChange.Actions.ModifyDisappearingMessageTimerAction - (*GroupChange_Actions_ModifyAttributesAccessControlAction)(nil), // 37: signal.GroupChange.Actions.ModifyAttributesAccessControlAction - (*GroupChange_Actions_ModifyMembersAccessControlAction)(nil), // 38: signal.GroupChange.Actions.ModifyMembersAccessControlAction - (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction)(nil), // 39: signal.GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction - (*GroupChange_Actions_ModifyMemberLabelAccessControlAction)(nil), // 40: signal.GroupChange.Actions.ModifyMemberLabelAccessControlAction - (*GroupChange_Actions_ModifyInviteLinkPasswordAction)(nil), // 41: signal.GroupChange.Actions.ModifyInviteLinkPasswordAction - (*GroupChange_Actions_ModifyAnnouncementsOnlyAction)(nil), // 42: signal.GroupChange.Actions.ModifyAnnouncementsOnlyAction - (*GroupChange_Actions_TerminateGroupAction)(nil), // 43: signal.GroupChange.Actions.TerminateGroupAction - (*GroupChanges_GroupChangeState)(nil), // 44: signal.GroupChanges.GroupChangeState + (Member_Role)(0), // 0: Member.Role + (AccessControl_AccessRequired)(0), // 1: AccessControl.AccessRequired + (*AvatarUploadAttributes)(nil), // 2: AvatarUploadAttributes + (*Member)(nil), // 3: Member + (*PendingMember)(nil), // 4: PendingMember + (*RequestingMember)(nil), // 5: RequestingMember + (*BannedMember)(nil), // 6: BannedMember + (*AccessControl)(nil), // 7: AccessControl + (*Group)(nil), // 8: Group + (*GroupChange)(nil), // 9: GroupChange + (*GroupResponse)(nil), // 10: GroupResponse + (*GroupChanges)(nil), // 11: GroupChanges + (*GroupChangeResponse)(nil), // 12: GroupChangeResponse + (*GroupAttributeBlob)(nil), // 13: GroupAttributeBlob + (*GroupInviteLink)(nil), // 14: GroupInviteLink + (*GroupJoinInfo)(nil), // 15: GroupJoinInfo + (*GroupExternalCredential)(nil), // 16: GroupExternalCredential + (*GroupChange_Actions)(nil), // 17: GroupChange.Actions + (*GroupChange_Actions_AddMemberAction)(nil), // 18: GroupChange.Actions.AddMemberAction + (*GroupChange_Actions_DeleteMemberAction)(nil), // 19: GroupChange.Actions.DeleteMemberAction + (*GroupChange_Actions_ModifyMemberRoleAction)(nil), // 20: GroupChange.Actions.ModifyMemberRoleAction + (*GroupChange_Actions_ModifyMemberProfileKeyAction)(nil), // 21: GroupChange.Actions.ModifyMemberProfileKeyAction + (*GroupChange_Actions_AddPendingMemberAction)(nil), // 22: GroupChange.Actions.AddPendingMemberAction + (*GroupChange_Actions_DeletePendingMemberAction)(nil), // 23: GroupChange.Actions.DeletePendingMemberAction + (*GroupChange_Actions_PromotePendingMemberAction)(nil), // 24: GroupChange.Actions.PromotePendingMemberAction + (*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction)(nil), // 25: GroupChange.Actions.PromotePendingPniAciMemberProfileKeyAction + (*GroupChange_Actions_AddRequestingMemberAction)(nil), // 26: GroupChange.Actions.AddRequestingMemberAction + (*GroupChange_Actions_DeleteRequestingMemberAction)(nil), // 27: GroupChange.Actions.DeleteRequestingMemberAction + (*GroupChange_Actions_PromoteRequestingMemberAction)(nil), // 28: GroupChange.Actions.PromoteRequestingMemberAction + (*GroupChange_Actions_AddBannedMemberAction)(nil), // 29: GroupChange.Actions.AddBannedMemberAction + (*GroupChange_Actions_DeleteBannedMemberAction)(nil), // 30: GroupChange.Actions.DeleteBannedMemberAction + (*GroupChange_Actions_ModifyTitleAction)(nil), // 31: GroupChange.Actions.ModifyTitleAction + (*GroupChange_Actions_ModifyDescriptionAction)(nil), // 32: GroupChange.Actions.ModifyDescriptionAction + (*GroupChange_Actions_ModifyAvatarAction)(nil), // 33: GroupChange.Actions.ModifyAvatarAction + (*GroupChange_Actions_ModifyDisappearingMessagesTimerAction)(nil), // 34: GroupChange.Actions.ModifyDisappearingMessagesTimerAction + (*GroupChange_Actions_ModifyAttributesAccessControlAction)(nil), // 35: GroupChange.Actions.ModifyAttributesAccessControlAction + (*GroupChange_Actions_ModifyMembersAccessControlAction)(nil), // 36: GroupChange.Actions.ModifyMembersAccessControlAction + (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction)(nil), // 37: GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction + (*GroupChange_Actions_ModifyInviteLinkPasswordAction)(nil), // 38: GroupChange.Actions.ModifyInviteLinkPasswordAction + (*GroupChange_Actions_ModifyAnnouncementsOnlyAction)(nil), // 39: GroupChange.Actions.ModifyAnnouncementsOnlyAction + (*GroupChanges_GroupChangeState)(nil), // 40: GroupChanges.GroupChangeState + (*GroupInviteLink_GroupInviteLinkContentsV1)(nil), // 41: GroupInviteLink.GroupInviteLinkContentsV1 } var file_Groups_proto_depIdxs = []int32{ - 0, // 0: signal.Member.role:type_name -> signal.Member.Role - 3, // 1: signal.MemberPendingProfileKey.member:type_name -> signal.Member - 1, // 2: signal.AccessControl.attributes:type_name -> signal.AccessControl.AccessRequired - 1, // 3: signal.AccessControl.members:type_name -> signal.AccessControl.AccessRequired - 1, // 4: signal.AccessControl.addFromInviteLink:type_name -> signal.AccessControl.AccessRequired - 1, // 5: signal.AccessControl.memberLabel:type_name -> signal.AccessControl.AccessRequired - 7, // 6: signal.Group.accessControl:type_name -> signal.AccessControl - 3, // 7: signal.Group.members:type_name -> signal.Member - 4, // 8: signal.Group.membersPendingProfileKey:type_name -> signal.MemberPendingProfileKey - 5, // 9: signal.Group.membersPendingAdminApproval:type_name -> signal.MemberPendingAdminApproval - 6, // 10: signal.Group.members_banned:type_name -> signal.MemberBanned - 17, // 11: signal.GroupInviteLink.contentsV1:type_name -> signal.GroupInviteLink.GroupInviteLinkContentsV1 - 1, // 12: signal.GroupJoinInfo.addFromInviteLink:type_name -> signal.AccessControl.AccessRequired - 8, // 13: signal.GroupResponse.group:type_name -> signal.Group - 44, // 14: signal.GroupChanges.groupChanges:type_name -> signal.GroupChanges.GroupChangeState - 12, // 15: signal.GroupChangeResponse.group_change:type_name -> signal.GroupChange - 19, // 16: signal.GroupChange.Actions.addMembers:type_name -> signal.GroupChange.Actions.AddMemberAction - 20, // 17: signal.GroupChange.Actions.deleteMembers:type_name -> signal.GroupChange.Actions.DeleteMemberAction - 21, // 18: signal.GroupChange.Actions.modifyMemberRoles:type_name -> signal.GroupChange.Actions.ModifyMemberRoleAction - 23, // 19: signal.GroupChange.Actions.modifyMemberProfileKeys:type_name -> signal.GroupChange.Actions.ModifyMemberProfileKeyAction - 24, // 20: signal.GroupChange.Actions.addMembersPendingProfileKey:type_name -> signal.GroupChange.Actions.AddMemberPendingProfileKeyAction - 25, // 21: signal.GroupChange.Actions.deleteMembersPendingProfileKey:type_name -> signal.GroupChange.Actions.DeleteMemberPendingProfileKeyAction - 26, // 22: signal.GroupChange.Actions.promoteMembersPendingProfileKey:type_name -> signal.GroupChange.Actions.PromoteMemberPendingProfileKeyAction - 33, // 23: signal.GroupChange.Actions.modifyTitle:type_name -> signal.GroupChange.Actions.ModifyTitleAction - 35, // 24: signal.GroupChange.Actions.modifyAvatar:type_name -> signal.GroupChange.Actions.ModifyAvatarAction - 36, // 25: signal.GroupChange.Actions.modifyDisappearingMessageTimer:type_name -> signal.GroupChange.Actions.ModifyDisappearingMessageTimerAction - 37, // 26: signal.GroupChange.Actions.modifyAttributesAccess:type_name -> signal.GroupChange.Actions.ModifyAttributesAccessControlAction - 38, // 27: signal.GroupChange.Actions.modifyMemberAccess:type_name -> signal.GroupChange.Actions.ModifyMembersAccessControlAction - 39, // 28: signal.GroupChange.Actions.modifyAddFromInviteLinkAccess:type_name -> signal.GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction - 28, // 29: signal.GroupChange.Actions.addMembersPendingAdminApproval:type_name -> signal.GroupChange.Actions.AddMemberPendingAdminApprovalAction - 29, // 30: signal.GroupChange.Actions.deleteMembersPendingAdminApproval:type_name -> signal.GroupChange.Actions.DeleteMemberPendingAdminApprovalAction - 30, // 31: signal.GroupChange.Actions.promoteMembersPendingAdminApproval:type_name -> signal.GroupChange.Actions.PromoteMemberPendingAdminApprovalAction - 41, // 32: signal.GroupChange.Actions.modifyInviteLinkPassword:type_name -> signal.GroupChange.Actions.ModifyInviteLinkPasswordAction - 34, // 33: signal.GroupChange.Actions.modifyDescription:type_name -> signal.GroupChange.Actions.ModifyDescriptionAction - 42, // 34: signal.GroupChange.Actions.modify_announcements_only:type_name -> signal.GroupChange.Actions.ModifyAnnouncementsOnlyAction - 31, // 35: signal.GroupChange.Actions.add_members_banned:type_name -> signal.GroupChange.Actions.AddMemberBannedAction - 32, // 36: signal.GroupChange.Actions.delete_members_banned:type_name -> signal.GroupChange.Actions.DeleteMemberBannedAction - 27, // 37: signal.GroupChange.Actions.promote_members_pending_pni_aci_profile_key:type_name -> signal.GroupChange.Actions.PromoteMemberPendingPniAciProfileKeyAction - 22, // 38: signal.GroupChange.Actions.modifyMemberLabels:type_name -> signal.GroupChange.Actions.ModifyMemberLabelAction - 40, // 39: signal.GroupChange.Actions.modifyMemberLabelAccess:type_name -> signal.GroupChange.Actions.ModifyMemberLabelAccessControlAction - 43, // 40: signal.GroupChange.Actions.terminate_group:type_name -> signal.GroupChange.Actions.TerminateGroupAction - 3, // 41: signal.GroupChange.Actions.AddMemberAction.added:type_name -> signal.Member - 0, // 42: signal.GroupChange.Actions.ModifyMemberRoleAction.role:type_name -> signal.Member.Role - 4, // 43: signal.GroupChange.Actions.AddMemberPendingProfileKeyAction.added:type_name -> signal.MemberPendingProfileKey - 5, // 44: signal.GroupChange.Actions.AddMemberPendingAdminApprovalAction.added:type_name -> signal.MemberPendingAdminApproval - 0, // 45: signal.GroupChange.Actions.PromoteMemberPendingAdminApprovalAction.role:type_name -> signal.Member.Role - 6, // 46: signal.GroupChange.Actions.AddMemberBannedAction.added:type_name -> signal.MemberBanned - 1, // 47: signal.GroupChange.Actions.ModifyAttributesAccessControlAction.attributesAccess:type_name -> signal.AccessControl.AccessRequired - 1, // 48: signal.GroupChange.Actions.ModifyMembersAccessControlAction.membersAccess:type_name -> signal.AccessControl.AccessRequired - 1, // 49: signal.GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction.addFromInviteLinkAccess:type_name -> signal.AccessControl.AccessRequired - 1, // 50: signal.GroupChange.Actions.ModifyMemberLabelAccessControlAction.memberLabelAccess:type_name -> signal.AccessControl.AccessRequired - 12, // 51: signal.GroupChanges.GroupChangeState.groupChange:type_name -> signal.GroupChange - 8, // 52: signal.GroupChanges.GroupChangeState.groupState:type_name -> signal.Group - 53, // [53:53] is the sub-list for method output_type - 53, // [53:53] is the sub-list for method input_type - 53, // [53:53] is the sub-list for extension type_name - 53, // [53:53] is the sub-list for extension extendee - 0, // [0:53] is the sub-list for field type_name + 0, // 0: Member.role:type_name -> Member.Role + 3, // 1: PendingMember.member:type_name -> Member + 1, // 2: AccessControl.attributes:type_name -> AccessControl.AccessRequired + 1, // 3: AccessControl.members:type_name -> AccessControl.AccessRequired + 1, // 4: AccessControl.addFromInviteLink:type_name -> AccessControl.AccessRequired + 7, // 5: Group.accessControl:type_name -> AccessControl + 3, // 6: Group.members:type_name -> Member + 4, // 7: Group.pendingMembers:type_name -> PendingMember + 5, // 8: Group.requestingMembers:type_name -> RequestingMember + 6, // 9: Group.bannedMembers:type_name -> BannedMember + 8, // 10: GroupResponse.group:type_name -> Group + 40, // 11: GroupChanges.groupChanges:type_name -> GroupChanges.GroupChangeState + 9, // 12: GroupChangeResponse.groupChange:type_name -> GroupChange + 41, // 13: GroupInviteLink.v1Contents:type_name -> GroupInviteLink.GroupInviteLinkContentsV1 + 1, // 14: GroupJoinInfo.addFromInviteLink:type_name -> AccessControl.AccessRequired + 18, // 15: GroupChange.Actions.addMembers:type_name -> GroupChange.Actions.AddMemberAction + 19, // 16: GroupChange.Actions.deleteMembers:type_name -> GroupChange.Actions.DeleteMemberAction + 20, // 17: GroupChange.Actions.modifyMemberRoles:type_name -> GroupChange.Actions.ModifyMemberRoleAction + 21, // 18: GroupChange.Actions.modifyMemberProfileKeys:type_name -> GroupChange.Actions.ModifyMemberProfileKeyAction + 22, // 19: GroupChange.Actions.addPendingMembers:type_name -> GroupChange.Actions.AddPendingMemberAction + 23, // 20: GroupChange.Actions.deletePendingMembers:type_name -> GroupChange.Actions.DeletePendingMemberAction + 24, // 21: GroupChange.Actions.promotePendingMembers:type_name -> GroupChange.Actions.PromotePendingMemberAction + 31, // 22: GroupChange.Actions.modifyTitle:type_name -> GroupChange.Actions.ModifyTitleAction + 33, // 23: GroupChange.Actions.modifyAvatar:type_name -> GroupChange.Actions.ModifyAvatarAction + 34, // 24: GroupChange.Actions.modifyDisappearingMessagesTimer:type_name -> GroupChange.Actions.ModifyDisappearingMessagesTimerAction + 35, // 25: GroupChange.Actions.modifyAttributesAccess:type_name -> GroupChange.Actions.ModifyAttributesAccessControlAction + 36, // 26: GroupChange.Actions.modifyMemberAccess:type_name -> GroupChange.Actions.ModifyMembersAccessControlAction + 37, // 27: GroupChange.Actions.modifyAddFromInviteLinkAccess:type_name -> GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction + 26, // 28: GroupChange.Actions.addRequestingMembers:type_name -> GroupChange.Actions.AddRequestingMemberAction + 27, // 29: GroupChange.Actions.deleteRequestingMembers:type_name -> GroupChange.Actions.DeleteRequestingMemberAction + 28, // 30: GroupChange.Actions.promoteRequestingMembers:type_name -> GroupChange.Actions.PromoteRequestingMemberAction + 38, // 31: GroupChange.Actions.modifyInviteLinkPassword:type_name -> GroupChange.Actions.ModifyInviteLinkPasswordAction + 32, // 32: GroupChange.Actions.modifyDescription:type_name -> GroupChange.Actions.ModifyDescriptionAction + 39, // 33: GroupChange.Actions.modifyAnnouncementsOnly:type_name -> GroupChange.Actions.ModifyAnnouncementsOnlyAction + 29, // 34: GroupChange.Actions.addBannedMembers:type_name -> GroupChange.Actions.AddBannedMemberAction + 30, // 35: GroupChange.Actions.deleteBannedMembers:type_name -> GroupChange.Actions.DeleteBannedMemberAction + 25, // 36: GroupChange.Actions.promotePendingPniAciMembers:type_name -> GroupChange.Actions.PromotePendingPniAciMemberProfileKeyAction + 3, // 37: GroupChange.Actions.AddMemberAction.added:type_name -> Member + 0, // 38: GroupChange.Actions.ModifyMemberRoleAction.role:type_name -> Member.Role + 4, // 39: GroupChange.Actions.AddPendingMemberAction.added:type_name -> PendingMember + 5, // 40: GroupChange.Actions.AddRequestingMemberAction.added:type_name -> RequestingMember + 0, // 41: GroupChange.Actions.PromoteRequestingMemberAction.role:type_name -> Member.Role + 6, // 42: GroupChange.Actions.AddBannedMemberAction.added:type_name -> BannedMember + 1, // 43: GroupChange.Actions.ModifyAttributesAccessControlAction.attributesAccess:type_name -> AccessControl.AccessRequired + 1, // 44: GroupChange.Actions.ModifyMembersAccessControlAction.membersAccess:type_name -> AccessControl.AccessRequired + 1, // 45: GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction.addFromInviteLinkAccess:type_name -> AccessControl.AccessRequired + 9, // 46: GroupChanges.GroupChangeState.groupChange:type_name -> GroupChange + 8, // 47: GroupChanges.GroupChangeState.groupState:type_name -> Group + 48, // [48:48] is the sub-list for method output_type + 48, // [48:48] is the sub-list for method input_type + 48, // [48:48] is the sub-list for extension type_name + 48, // [48:48] is the sub-list for extension extendee + 0, // [0:48] is the sub-list for field type_name } func init() { file_Groups_proto_init() } @@ -3153,14 +2927,14 @@ func file_Groups_proto_init() { if File_Groups_proto != nil { return } - file_Groups_proto_msgTypes[7].OneofWrappers = []any{ + file_Groups_proto_msgTypes[11].OneofWrappers = []any{ (*GroupAttributeBlob_Title)(nil), (*GroupAttributeBlob_Avatar)(nil), (*GroupAttributeBlob_DisappearingMessagesDuration)(nil), - (*GroupAttributeBlob_DescriptionText)(nil), + (*GroupAttributeBlob_Description)(nil), } - file_Groups_proto_msgTypes[8].OneofWrappers = []any{ - (*GroupInviteLink_ContentsV1)(nil), + file_Groups_proto_msgTypes[12].OneofWrappers = []any{ + (*GroupInviteLink_V1Contents)(nil), } type x struct{} out := protoimpl.TypeBuilder{ @@ -3168,7 +2942,7 @@ func file_Groups_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_Groups_proto_rawDesc), len(file_Groups_proto_rawDesc)), NumEnums: 2, - NumMessages: 43, + NumMessages: 40, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/signalmeow/protobuf/Groups.proto b/pkg/signalmeow/protobuf/Groups.proto index 9843d1c..e202eb2 100644 --- a/pkg/signalmeow/protobuf/Groups.proto +++ b/pkg/signalmeow/protobuf/Groups.proto @@ -1,139 +1,92 @@ -/* - * Copyright 2020 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only +/** + * Copyright (C) 2019 Open Whisper Systems + * + * Licensed according to the LICENSE file in this repository. */ - syntax = "proto3"; -package signal; - -option java_package = "org.signal.storageservice.storage.protos.groups"; -option java_outer_classname = "GroupProtos"; +option java_package = "org.signal.storageservice.protos.groups"; option java_multiple_files = true; message AvatarUploadAttributes { - string key = 1; + string key = 1; string credential = 2; - string acl = 3; - string algorithm = 4; - string date = 5; - string policy = 6; - string signature = 7; + string acl = 3; + string algorithm = 4; + string date = 5; + string policy = 6; + string signature = 7; } -// Stored data - message Member { enum Role { - UNKNOWN = 0; - DEFAULT = 1; + UNKNOWN = 0; + DEFAULT = 1; ADMINISTRATOR = 2; } - bytes userId = 1; - Role role = 2; - bytes profileKey = 3; - bytes presentation = 4; - uint32 joinedAtVersion = 5; - bytes labelEmoji = 6; // decrypts to a UTF-8 string - bytes labelString = 7; // decrypts to a UTF-8 string + bytes userId = 1; + Role role = 2; + bytes profileKey = 3; + bytes presentation = 4; // Only set when sending to server + uint32 joinedAtRevision = 5; } -message MemberPendingProfileKey { - Member member = 1; - bytes addedByUserId = 2; - uint64 timestamp = 3; // ms since epoch +message PendingMember { + Member member = 1; + bytes addedByUserId = 2; + uint64 timestamp = 3; } -message MemberPendingAdminApproval { - bytes userId = 1; - bytes profileKey = 2; - bytes presentation = 3; - uint64 timestamp = 4; // ms since epoch +message RequestingMember { + bytes userId = 1; + bytes profileKey = 2; + bytes presentation = 3; // Only set when sending to server + uint64 timestamp = 4; } -message MemberBanned { - bytes userId = 1; - uint64 timestamp = 2; // ms since epoch +message BannedMember { + bytes userId = 1; + uint64 timestamp = 2; } message AccessControl { enum AccessRequired { - UNKNOWN = 0; - ANY = 1; - MEMBER = 2; + UNKNOWN = 0; + ANY = 1; + MEMBER = 2; ADMINISTRATOR = 3; UNSATISFIABLE = 4; } - AccessRequired attributes = 1; - AccessRequired members = 2; + AccessRequired attributes = 1; + AccessRequired members = 2; AccessRequired addFromInviteLink = 3; - AccessRequired memberLabel = 4; } message Group { - bytes publicKey = 1; - bytes title = 2; - bytes description = 11; - // The URL for this group's avatar. The content at this URL can be - // decrypted/deserialized into a `GroupAttributeBlob`. - string avatarUrl = 3; - bytes disappearingMessagesTimer = 4; - AccessControl accessControl = 5; - uint32 version = 6; - repeated Member members = 7; - repeated MemberPendingProfileKey membersPendingProfileKey = 8; - repeated MemberPendingAdminApproval membersPendingAdminApproval = 9; - bytes inviteLinkPassword = 10; - bool announcements_only = 12; - repeated MemberBanned members_banned = 13; - bool terminated = 14; - // next: 15 + bytes publicKey = 1; + bytes title = 2; + string avatar = 3; + bytes disappearingMessagesTimer = 4; + AccessControl accessControl = 5; + uint32 revision = 6; + repeated Member members = 7; + repeated PendingMember pendingMembers = 8; + repeated RequestingMember requestingMembers = 9; + bytes inviteLinkPassword = 10; + bytes description = 11; + bool announcementsOnly = 12; + repeated BannedMember bannedMembers = 13; } -message GroupAttributeBlob { - oneof content { - string title = 1; - bytes avatar = 2; - uint32 disappearingMessagesDuration = 3; - string descriptionText = 4; - } -} - -message GroupInviteLink { - message GroupInviteLinkContentsV1 { - bytes groupMasterKey = 1; - bytes inviteLinkPassword = 2; - } - - oneof contents { - GroupInviteLinkContentsV1 contentsV1 = 1; - } -} - -message GroupJoinInfo { - bytes publicKey = 1; - bytes title = 2; - bytes description = 8; - string avatar = 3; - uint32 memberCount = 4; - AccessControl.AccessRequired addFromInviteLink = 5; - uint32 version = 6; - bool pendingAdminApproval = 7; - // bool pendingAdminApprovalFull = 9; - // next: 10 -} - -// Deltas - message GroupChange { message Actions { message AddMemberAction { - Member added = 1; - bool joinFromInviteLink = 2; + Member added = 1; + bool joinFromInviteLink = 2; } message DeleteMemberAction { @@ -141,61 +94,55 @@ message GroupChange { } message ModifyMemberRoleAction { - bytes userId = 1; - Member.Role role = 2; - } - - message ModifyMemberLabelAction { - bytes userId = 1; - bytes labelEmoji = 2; // decrypts to a UTF-8 string - bytes labelString = 3; // decrypts to a UTF-8 string + bytes userId = 1; + Member.Role role = 2; } message ModifyMemberProfileKeyAction { - bytes presentation = 1; - bytes user_id = 2; - bytes profile_key = 3; + bytes presentation = 1; // Only set when sending to server + bytes user_id = 2; // Only set when receiving from server + bytes profile_key = 3; // Only set when receiving from server } - message AddMemberPendingProfileKeyAction { - MemberPendingProfileKey added = 1; + message AddPendingMemberAction { + PendingMember added = 1; } - message DeleteMemberPendingProfileKeyAction { + message DeletePendingMemberAction { bytes deletedUserId = 1; } - message PromoteMemberPendingProfileKeyAction { - bytes presentation = 1; - bytes user_id = 2; - bytes profile_key = 3; + message PromotePendingMemberAction { + bytes presentation = 1; // Only set when sending to server + bytes user_id = 2; // Only set when receiving from server + bytes profile_key = 3; // Only set when receiving from server } - message PromoteMemberPendingPniAciProfileKeyAction { - bytes presentation = 1; - bytes user_id = 2; - bytes pni = 3; - bytes profile_key = 4; + message PromotePendingPniAciMemberProfileKeyAction { + bytes presentation = 1; // Only set when sending to server + bytes userId = 2; // Only set when receiving from server + bytes pni = 3; // Only set when receiving from server + bytes profileKey = 4; // Only set when receiving from server } - message AddMemberPendingAdminApprovalAction { - MemberPendingAdminApproval added = 1; + message AddRequestingMemberAction { + RequestingMember added = 1; } - message DeleteMemberPendingAdminApprovalAction { + message DeleteRequestingMemberAction { bytes deletedUserId = 1; } - message PromoteMemberPendingAdminApprovalAction { - bytes userId = 1; - Member.Role role = 2; + message PromoteRequestingMemberAction { + bytes userId = 1; + Member.Role role = 2; } - message AddMemberBannedAction { - MemberBanned added = 1; + message AddBannedMemberAction { + BannedMember added = 1; } - message DeleteMemberBannedAction { + message DeleteBannedMemberAction { bytes deletedUserId = 1; } @@ -211,7 +158,7 @@ message GroupChange { string avatar = 1; } - message ModifyDisappearingMessageTimerAction { + message ModifyDisappearingMessagesTimerAction { bytes timer = 1; } @@ -227,83 +174,97 @@ message GroupChange { AccessControl.AccessRequired addFromInviteLinkAccess = 1; } - message ModifyMemberLabelAccessControlAction { - AccessControl.AccessRequired memberLabelAccess = 1; - } - message ModifyInviteLinkPasswordAction { bytes inviteLinkPassword = 1; } message ModifyAnnouncementsOnlyAction { - bool announcements_only = 1; + bool announcementsOnly = 1; } - message TerminateGroupAction {} - - bytes sourceUserId = 1; - // clients should not provide this value; the server will provide it in the response buffer to ensure the signature is binding to a particular group - // if clients set it during a request the server will respond with 400. - bytes group_id = 25; - uint32 version = 2; - - repeated AddMemberAction addMembers = 3; - repeated DeleteMemberAction deleteMembers = 4; - repeated ModifyMemberRoleAction modifyMemberRoles = 5; - repeated ModifyMemberProfileKeyAction modifyMemberProfileKeys = 6; - repeated AddMemberPendingProfileKeyAction addMembersPendingProfileKey = 7; - repeated DeleteMemberPendingProfileKeyAction deleteMembersPendingProfileKey = 8; - repeated PromoteMemberPendingProfileKeyAction promoteMembersPendingProfileKey = 9; - ModifyTitleAction modifyTitle = 10; - ModifyAvatarAction modifyAvatar = 11; - ModifyDisappearingMessageTimerAction modifyDisappearingMessageTimer = 12; - ModifyAttributesAccessControlAction modifyAttributesAccess = 13; - ModifyMembersAccessControlAction modifyMemberAccess = 14; - ModifyAddFromInviteLinkAccessControlAction modifyAddFromInviteLinkAccess = 15; // change epoch = 1 - repeated AddMemberPendingAdminApprovalAction addMembersPendingAdminApproval = 16; // change epoch = 1 - repeated DeleteMemberPendingAdminApprovalAction deleteMembersPendingAdminApproval = 17; // change epoch = 1 - repeated PromoteMemberPendingAdminApprovalAction promoteMembersPendingAdminApproval = 18; // change epoch = 1 - ModifyInviteLinkPasswordAction modifyInviteLinkPassword = 19; // change epoch = 1 - ModifyDescriptionAction modifyDescription = 20; // change epoch = 2 - ModifyAnnouncementsOnlyAction modify_announcements_only = 21; // change epoch = 3 - repeated AddMemberBannedAction add_members_banned = 22; // change epoch = 4 - repeated DeleteMemberBannedAction delete_members_banned = 23; // change epoch = 4 - repeated PromoteMemberPendingPniAciProfileKeyAction promote_members_pending_pni_aci_profile_key = 24; // change epoch = 5 - repeated ModifyMemberLabelAction modifyMemberLabels = 26; // change epoch = 6; - ModifyMemberLabelAccessControlAction modifyMemberLabelAccess = 27; // change epoch = 6 - TerminateGroupAction terminate_group = 28; // change epoch = 7 - // next: 29 + bytes sourceServiceId = 1; + bytes groupId = 25; // Only set when receiving from server + uint32 revision = 2; + repeated AddMemberAction addMembers = 3; + repeated DeleteMemberAction deleteMembers = 4; + repeated ModifyMemberRoleAction modifyMemberRoles = 5; + repeated ModifyMemberProfileKeyAction modifyMemberProfileKeys = 6; + repeated AddPendingMemberAction addPendingMembers = 7; + repeated DeletePendingMemberAction deletePendingMembers = 8; + repeated PromotePendingMemberAction promotePendingMembers = 9; + ModifyTitleAction modifyTitle = 10; + ModifyAvatarAction modifyAvatar = 11; + ModifyDisappearingMessagesTimerAction modifyDisappearingMessagesTimer = 12; + ModifyAttributesAccessControlAction modifyAttributesAccess = 13; + ModifyMembersAccessControlAction modifyMemberAccess = 14; + ModifyAddFromInviteLinkAccessControlAction modifyAddFromInviteLinkAccess = 15; + repeated AddRequestingMemberAction addRequestingMembers = 16; + repeated DeleteRequestingMemberAction deleteRequestingMembers = 17; + repeated PromoteRequestingMemberAction promoteRequestingMembers = 18; + ModifyInviteLinkPasswordAction modifyInviteLinkPassword = 19; + ModifyDescriptionAction modifyDescription = 20; + ModifyAnnouncementsOnlyAction modifyAnnouncementsOnly = 21; + repeated AddBannedMemberAction addBannedMembers = 22; + repeated DeleteBannedMemberAction deleteBannedMembers = 23; + repeated PromotePendingPniAciMemberProfileKeyAction promotePendingPniAciMembers = 24; } - bytes actions = 1; - bytes serverSignature = 2; - uint32 changeEpoch = 3; + bytes actions = 1; + bytes serverSignature = 2; + uint32 changeEpoch = 3; } -// External credentials - -message ExternalGroupCredential { - string token = 1; -} - -// API responses - message GroupResponse { - Group group = 1; - bytes group_send_endorsements_response = 2; + Group group = 1; + bytes groupSendEndorsementsResponse = 2; } message GroupChanges { message GroupChangeState { GroupChange groupChange = 1; - Group groupState = 2; + Group groupState = 2; } - repeated GroupChangeState groupChanges = 1; - bytes group_send_endorsements_response = 2; + repeated GroupChangeState groupChanges = 1; + bytes groupSendEndorsementsResponse = 2; } message GroupChangeResponse { - GroupChange group_change = 1; - bytes group_send_endorsements_response = 2; + GroupChange groupChange = 1; + bytes groupSendEndorsementsResponse = 2; +} + +message GroupAttributeBlob { + oneof content { + string title = 1; + bytes avatar = 2; + uint32 disappearingMessagesDuration = 3; + string description = 4; + } +} + +message GroupInviteLink { + message GroupInviteLinkContentsV1 { + bytes groupMasterKey = 1; + bytes inviteLinkPassword = 2; + } + + oneof contents { + GroupInviteLinkContentsV1 v1Contents = 1; + } +} + +message GroupJoinInfo { + bytes publicKey = 1; + bytes title = 2; + string avatar = 3; + uint32 memberCount = 4; + AccessControl.AccessRequired addFromInviteLink = 5; + uint32 revision = 6; + bool pendingAdminApproval = 7; + bytes description = 8; +} + +message GroupExternalCredential { + string token = 1; } diff --git a/pkg/signalmeow/protobuf/Provisioning.pb.go b/pkg/signalmeow/protobuf/Provisioning.pb.go index 88ebe90..9e75ec2 100644 --- a/pkg/signalmeow/protobuf/Provisioning.pb.go +++ b/pkg/signalmeow/protobuf/Provisioning.pb.go @@ -4,8 +4,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: Provisioning.proto package signalpb @@ -199,6 +199,7 @@ type ProvisionMessage struct { ProfileKey []byte `protobuf:"bytes,6,opt,name=profileKey" json:"profileKey,omitempty"` ReadReceipts *bool `protobuf:"varint,7,opt,name=readReceipts" json:"readReceipts,omitempty"` ProvisioningVersion *uint32 `protobuf:"varint,9,opt,name=provisioningVersion" json:"provisioningVersion,omitempty"` + MasterKey []byte `protobuf:"bytes,13,opt,name=masterKey" json:"masterKey,omitempty"` // Deprecated, but required by linked devices EphemeralBackupKey []byte `protobuf:"bytes,14,opt,name=ephemeralBackupKey" json:"ephemeralBackupKey,omitempty"` // 32 bytes AccountEntropyPool *string `protobuf:"bytes,15,opt,name=accountEntropyPool" json:"accountEntropyPool,omitempty"` MediaRootBackupKey []byte `protobuf:"bytes,16,opt,name=mediaRootBackupKey" json:"mediaRootBackupKey,omitempty"` // 32-bytes @@ -322,6 +323,13 @@ func (x *ProvisionMessage) GetProvisioningVersion() uint32 { return 0 } +func (x *ProvisionMessage) GetMasterKey() []byte { + if x != nil { + return x.MasterKey + } + return nil +} + func (x *ProvisionMessage) GetEphemeralBackupKey() []byte { if x != nil { return x.EphemeralBackupKey @@ -366,7 +374,7 @@ const file_Provisioning_proto_rawDesc = "" + "\aaddress\x18\x01 \x01(\tR\aaddress\"E\n" + "\x11ProvisionEnvelope\x12\x1c\n" + "\tpublicKey\x18\x01 \x01(\fR\tpublicKey\x12\x12\n" + - "\x04body\x18\x02 \x01(\fR\x04body\"\xb4\x05\n" + + "\x04body\x18\x02 \x01(\fR\x04body\"\xcc\x05\n" + "\x10ProvisionMessage\x122\n" + "\x14aciIdentityKeyPublic\x18\x01 \x01(\fR\x14aciIdentityKeyPublic\x124\n" + "\x15aciIdentityKeyPrivate\x18\x02 \x01(\fR\x15aciIdentityKeyPrivate\x122\n" + @@ -382,12 +390,13 @@ const file_Provisioning_proto_rawDesc = "" + "profileKey\x18\x06 \x01(\fR\n" + "profileKey\x12\"\n" + "\freadReceipts\x18\a \x01(\bR\freadReceipts\x120\n" + - "\x13provisioningVersion\x18\t \x01(\rR\x13provisioningVersion\x12.\n" + + "\x13provisioningVersion\x18\t \x01(\rR\x13provisioningVersion\x12\x1c\n" + + "\tmasterKey\x18\r \x01(\fR\tmasterKey\x12.\n" + "\x12ephemeralBackupKey\x18\x0e \x01(\fR\x12ephemeralBackupKey\x12.\n" + "\x12accountEntropyPool\x18\x0f \x01(\tR\x12accountEntropyPool\x12.\n" + "\x12mediaRootBackupKey\x18\x10 \x01(\fR\x12mediaRootBackupKey\x12\x1c\n" + "\taciBinary\x18\x11 \x01(\fR\taciBinary\x12\x1c\n" + - "\tpniBinary\x18\x12 \x01(\fR\tpniBinaryJ\x04\b\r\x10\x0e*G\n" + + "\tpniBinary\x18\x12 \x01(\fR\tpniBinary*G\n" + "\x13ProvisioningVersion\x12\v\n" + "\aINITIAL\x10\x00\x12\x12\n" + "\x0eTABLET_SUPPORT\x10\x01\x12\v\n" + diff --git a/pkg/signalmeow/protobuf/Provisioning.proto b/pkg/signalmeow/protobuf/Provisioning.proto index b5eeaf6..2fde938 100644 --- a/pkg/signalmeow/protobuf/Provisioning.proto +++ b/pkg/signalmeow/protobuf/Provisioning.proto @@ -38,7 +38,7 @@ message ProvisionMessage { optional bytes profileKey = 6; optional bool readReceipts = 7; optional uint32 provisioningVersion = 9; - reserved /*masterKey*/ 13; // Deprecated in favor of accountEntropyPool + optional bytes masterKey = 13; // Deprecated, but required by linked devices optional bytes ephemeralBackupKey = 14; // 32 bytes optional string accountEntropyPool = 15; optional bytes mediaRootBackupKey = 16; // 32-bytes diff --git a/pkg/signalmeow/protobuf/SignalService.pb.go b/pkg/signalmeow/protobuf/SignalService.pb.go index c4268dd..fd875ac 100644 --- a/pkg/signalmeow/protobuf/SignalService.pb.go +++ b/pkg/signalmeow/protobuf/SignalService.pb.go @@ -4,8 +4,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: SignalService.proto package signalpb @@ -28,71 +28,33 @@ const ( type Envelope_Type int32 const ( - Envelope_UNKNOWN Envelope_Type = 0 - // * - // A double-ratchet message represents a "normal," "unsealed-sender" message - // encrypted using the Double Ratchet within an established Signal session. - // Double-ratchet messages include sender information in the plaintext - // portion of the `Envelope`. - Envelope_DOUBLE_RATCHET Envelope_Type = 1 // content => (version byte | SignalMessage{Content}) - // * - // A prekey message begins a new Signal session. The `content` of a prekey - // message is a superset of a double-ratchet message's `content` and - // contains the sender's identity public key and information identifying the - // pre-keys used in the message's ciphertext. Like double-ratchet messages, - // prekey messages contain sender information in the plaintext portion of - // the `Envelope`. - Envelope_PREKEY_MESSAGE Envelope_Type = 3 // content => (version byte | PreKeySignalMessage{Content}) - // * - // Server delivery receipts are generated by the server when - // "unsealed-sender" messages are delivered to and acknowledged by the - // destination device. Server delivery receipts identify the sender in the - // plaintext portion of the `Envelope` and have no `content`. Note that - // receipts for sealed-sender messages are generated by clients as - // `UNIDENTIFIED_SENDER` messages. - // - // Note that, with server delivery receipts, the "client timestamp" on - // the envelope refers to the timestamp of the original message (i.e. the - // message the server just delivered) and not to the time of delivery. The - // "server timestamp" refers to the time of delivery. - Envelope_SERVER_DELIVERY_RECEIPT Envelope_Type = 5 // content => [] - // * - // An unidentified sender message represents a message with no sender - // information in the plaintext portion of the `Envelope`. Unidentified - // sender messages always contain an additional `subtype` in their - // `content`. They may or may not be part of an existing Signal session - // (i.e. an unidentified sender message may have a "prekey message" - // subtype or may indicate an encryption error). - Envelope_UNIDENTIFIED_SENDER Envelope_Type = 6 // content => ((version byte | UnidentifiedSenderMessage) OR (version byte | Multi-Recipient Sealed Sender Format)) - // * - // A plaintext message is used solely to convey encryption error receipts - // and never contains encrypted message content. Encryption error receipts - // must be delivered in plaintext because, encryption/decryption of a prior - // message failed and there is no reason to believe that - // encryption/decryption of subsequent messages with the same key material - // would succeed. - // - // Critically, plaintext messages never have "real" message content - // generated by users. Plaintext messages include sender information. - Envelope_PLAINTEXT_CONTENT Envelope_Type = 8 // content => (marker byte | Content) + Envelope_UNKNOWN Envelope_Type = 0 + Envelope_CIPHERTEXT Envelope_Type = 1 // content => (version byte | SignalMessage{Content}) + Envelope_PREKEY_BUNDLE Envelope_Type = 3 // content => (version byte | PreKeySignalMessage{Content}) + Envelope_SERVER_DELIVERY_RECEIPT Envelope_Type = 5 // legacyMessage => [] AND content => [] + Envelope_UNIDENTIFIED_SENDER Envelope_Type = 6 // legacyMessage => [] AND content => ((version byte | UnidentifiedSenderMessage) OR (version byte | Multi-Recipient Sealed Sender Format)) + Envelope_SENDERKEY_MESSAGE Envelope_Type = 7 // legacyMessage => [] AND content => (version byte | SenderKeyMessage) + Envelope_PLAINTEXT_CONTENT Envelope_Type = 8 // legacyMessage => [] AND content => (marker byte | Content) ) // Enum value maps for Envelope_Type. var ( Envelope_Type_name = map[int32]string{ 0: "UNKNOWN", - 1: "DOUBLE_RATCHET", - 3: "PREKEY_MESSAGE", + 1: "CIPHERTEXT", + 3: "PREKEY_BUNDLE", 5: "SERVER_DELIVERY_RECEIPT", 6: "UNIDENTIFIED_SENDER", + 7: "SENDERKEY_MESSAGE", 8: "PLAINTEXT_CONTENT", } Envelope_Type_value = map[string]int32{ "UNKNOWN": 0, - "DOUBLE_RATCHET": 1, - "PREKEY_MESSAGE": 3, + "CIPHERTEXT": 1, + "PREKEY_BUNDLE": 3, "SERVER_DELIVERY_RECEIPT": 5, "UNIDENTIFIED_SENDER": 6, + "SENDERKEY_MESSAGE": 7, "PLAINTEXT_CONTENT": 8, } ) @@ -384,8 +346,7 @@ const ( DataMessage_CDN_SELECTOR_ATTACHMENTS DataMessage_ProtocolVersion = 5 DataMessage_MENTIONS DataMessage_ProtocolVersion = 6 DataMessage_PAYMENTS DataMessage_ProtocolVersion = 7 - DataMessage_POLLS DataMessage_ProtocolVersion = 8 - DataMessage_CURRENT DataMessage_ProtocolVersion = 8 + DataMessage_CURRENT DataMessage_ProtocolVersion = 7 ) // Enum value maps for DataMessage_ProtocolVersion. @@ -399,8 +360,7 @@ var ( 5: "CDN_SELECTOR_ATTACHMENTS", 6: "MENTIONS", 7: "PAYMENTS", - 8: "POLLS", - // Duplicate value: 8: "CURRENT", + // Duplicate value: 7: "CURRENT", } DataMessage_ProtocolVersion_value = map[string]int32{ "INITIAL": 0, @@ -411,8 +371,7 @@ var ( "CDN_SELECTOR_ATTACHMENTS": 5, "MENTIONS": 6, "PAYMENTS": 7, - "POLLS": 8, - "CURRENT": 8, + "CURRENT": 7, } ) @@ -514,7 +473,6 @@ type DataMessage_Quote_Type int32 const ( DataMessage_Quote_NORMAL DataMessage_Quote_Type = 0 DataMessage_Quote_GIFT_BADGE DataMessage_Quote_Type = 1 - DataMessage_Quote_POLL DataMessage_Quote_Type = 2 ) // Enum value maps for DataMessage_Quote_Type. @@ -522,12 +480,10 @@ var ( DataMessage_Quote_Type_name = map[int32]string{ 0: "NORMAL", 1: "GIFT_BADGE", - 2: "POLL", } DataMessage_Quote_Type_value = map[string]int32{ "NORMAL": 0, "GIFT_BADGE": 1, - "POLL": 2, } ) @@ -1788,26 +1744,22 @@ func (BodyRange_Style) EnumDescriptor() ([]byte, []int) { } type Envelope struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type *Envelope_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.Envelope_Type" json:"type,omitempty"` - SourceServiceId *string `protobuf:"bytes,11,opt,name=sourceServiceId" json:"sourceServiceId,omitempty"` - SourceDeviceId *uint32 `protobuf:"varint,7,opt,name=sourceDeviceId" json:"sourceDeviceId,omitempty"` - DestinationServiceId *string `protobuf:"bytes,13,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` - ClientTimestamp *uint64 `protobuf:"varint,5,opt,name=clientTimestamp" json:"clientTimestamp,omitempty"` - Content []byte `protobuf:"bytes,8,opt,name=content" json:"content,omitempty"` // Contains an encrypted Content - ServerGuid *string `protobuf:"bytes,9,opt,name=serverGuid" json:"serverGuid,omitempty"` - ServerTimestamp *uint64 `protobuf:"varint,10,opt,name=serverTimestamp" json:"serverTimestamp,omitempty"` - Ephemeral *bool `protobuf:"varint,12,opt,name=ephemeral" json:"ephemeral,omitempty"` // indicates that the message should not be persisted if the recipient is offline - Urgent *bool `protobuf:"varint,14,opt,name=urgent,def=1" json:"urgent,omitempty"` // indicates that the content is considered timely by the sender; defaults to true so senders have to opt-out to say something isn't time critical - UpdatedPni *string `protobuf:"bytes,15,opt,name=updatedPni" json:"updatedPni,omitempty"` // for number-change synchronization messages, provides the new server-assigned phone number identifier associated with the changed number - Story *bool `protobuf:"varint,16,opt,name=story" json:"story,omitempty"` // indicates that the content is a story. - ReportSpamToken []byte `protobuf:"bytes,17,opt,name=report_spam_token,json=reportSpamToken" json:"report_spam_token,omitempty"` // token sent when reporting spam - SourceServiceIdBinary []byte `protobuf:"bytes,19,opt,name=sourceServiceIdBinary" json:"sourceServiceIdBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - DestinationServiceIdBinary []byte `protobuf:"bytes,20,opt,name=destinationServiceIdBinary" json:"destinationServiceIdBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - ServerGuidBinary []byte `protobuf:"bytes,21,opt,name=serverGuidBinary" json:"serverGuidBinary,omitempty"` // 16-byte UUID - UpdatedPniBinary []byte `protobuf:"bytes,22,opt,name=updatedPniBinary" json:"updatedPniBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Type *Envelope_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.Envelope_Type" json:"type,omitempty"` + SourceServiceId *string `protobuf:"bytes,11,opt,name=sourceServiceId" json:"sourceServiceId,omitempty"` + SourceDevice *uint32 `protobuf:"varint,7,opt,name=sourceDevice" json:"sourceDevice,omitempty"` + DestinationServiceId *string `protobuf:"bytes,13,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` + Timestamp *uint64 `protobuf:"varint,5,opt,name=timestamp" json:"timestamp,omitempty"` + Content []byte `protobuf:"bytes,8,opt,name=content" json:"content,omitempty"` // Contains an encrypted Content + ServerGuid *string `protobuf:"bytes,9,opt,name=serverGuid" json:"serverGuid,omitempty"` + ServerTimestamp *uint64 `protobuf:"varint,10,opt,name=serverTimestamp" json:"serverTimestamp,omitempty"` + Ephemeral *bool `protobuf:"varint,12,opt,name=ephemeral" json:"ephemeral,omitempty"` // indicates that the message should not be persisted if the recipient is offline + Urgent *bool `protobuf:"varint,14,opt,name=urgent,def=1" json:"urgent,omitempty"` // indicates that the content is considered timely by the sender; defaults to true so senders have to opt-out to say something isn't time critical + UpdatedPni *string `protobuf:"bytes,15,opt,name=updatedPni" json:"updatedPni,omitempty"` // for number-change synchronization messages, provides the new server-assigned phone number identifier associated with the changed number + Story *bool `protobuf:"varint,16,opt,name=story" json:"story,omitempty"` // indicates that the content is a story. + ReportSpamToken []byte `protobuf:"bytes,17,opt,name=report_spam_token,json=reportSpamToken" json:"report_spam_token,omitempty"` // token sent when reporting spam + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } // Default values for Envelope fields. @@ -1859,9 +1811,9 @@ func (x *Envelope) GetSourceServiceId() string { return "" } -func (x *Envelope) GetSourceDeviceId() uint32 { - if x != nil && x.SourceDeviceId != nil { - return *x.SourceDeviceId +func (x *Envelope) GetSourceDevice() uint32 { + if x != nil && x.SourceDevice != nil { + return *x.SourceDevice } return 0 } @@ -1873,9 +1825,9 @@ func (x *Envelope) GetDestinationServiceId() string { return "" } -func (x *Envelope) GetClientTimestamp() uint64 { - if x != nil && x.ClientTimestamp != nil { - return *x.ClientTimestamp +func (x *Envelope) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp } return 0 } @@ -1936,50 +1888,19 @@ func (x *Envelope) GetReportSpamToken() []byte { return nil } -func (x *Envelope) GetSourceServiceIdBinary() []byte { - if x != nil { - return x.SourceServiceIdBinary - } - return nil -} - -func (x *Envelope) GetDestinationServiceIdBinary() []byte { - if x != nil { - return x.DestinationServiceIdBinary - } - return nil -} - -func (x *Envelope) GetServerGuidBinary() []byte { - if x != nil { - return x.ServerGuidBinary - } - return nil -} - -func (x *Envelope) GetUpdatedPniBinary() []byte { - if x != nil { - return x.UpdatedPniBinary - } - return nil -} - type Content struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Content: - // - // *Content_DataMessage - // *Content_SyncMessage - // *Content_CallMessage - // *Content_NullMessage - // *Content_ReceiptMessage - // *Content_TypingMessage - // *Content_DecryptionErrorMessage - // *Content_StoryMessage - // *Content_EditMessage - Content isContent_Content `protobuf_oneof:"content"` - SenderKeyDistributionMessage []byte `protobuf:"bytes,7,opt,name=senderKeyDistributionMessage" json:"senderKeyDistributionMessage,omitempty"` - PniSignatureMessage *PniSignatureMessage `protobuf:"bytes,10,opt,name=pniSignatureMessage" json:"pniSignatureMessage,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + DataMessage *DataMessage `protobuf:"bytes,1,opt,name=dataMessage" json:"dataMessage,omitempty"` + SyncMessage *SyncMessage `protobuf:"bytes,2,opt,name=syncMessage" json:"syncMessage,omitempty"` + CallMessage *CallMessage `protobuf:"bytes,3,opt,name=callMessage" json:"callMessage,omitempty"` + NullMessage *NullMessage `protobuf:"bytes,4,opt,name=nullMessage" json:"nullMessage,omitempty"` + ReceiptMessage *ReceiptMessage `protobuf:"bytes,5,opt,name=receiptMessage" json:"receiptMessage,omitempty"` + TypingMessage *TypingMessage `protobuf:"bytes,6,opt,name=typingMessage" json:"typingMessage,omitempty"` + SenderKeyDistributionMessage []byte `protobuf:"bytes,7,opt,name=senderKeyDistributionMessage" json:"senderKeyDistributionMessage,omitempty"` + DecryptionErrorMessage []byte `protobuf:"bytes,8,opt,name=decryptionErrorMessage" json:"decryptionErrorMessage,omitempty"` + StoryMessage *StoryMessage `protobuf:"bytes,9,opt,name=storyMessage" json:"storyMessage,omitempty"` + PniSignatureMessage *PniSignatureMessage `protobuf:"bytes,10,opt,name=pniSignatureMessage" json:"pniSignatureMessage,omitempty"` + EditMessage *EditMessage `protobuf:"bytes,11,opt,name=editMessage" json:"editMessage,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2014,90 +1935,44 @@ func (*Content) Descriptor() ([]byte, []int) { return file_SignalService_proto_rawDescGZIP(), []int{1} } -func (x *Content) GetContent() isContent_Content { - if x != nil { - return x.Content - } - return nil -} - func (x *Content) GetDataMessage() *DataMessage { if x != nil { - if x, ok := x.Content.(*Content_DataMessage); ok { - return x.DataMessage - } + return x.DataMessage } return nil } func (x *Content) GetSyncMessage() *SyncMessage { if x != nil { - if x, ok := x.Content.(*Content_SyncMessage); ok { - return x.SyncMessage - } + return x.SyncMessage } return nil } func (x *Content) GetCallMessage() *CallMessage { if x != nil { - if x, ok := x.Content.(*Content_CallMessage); ok { - return x.CallMessage - } + return x.CallMessage } return nil } func (x *Content) GetNullMessage() *NullMessage { if x != nil { - if x, ok := x.Content.(*Content_NullMessage); ok { - return x.NullMessage - } + return x.NullMessage } return nil } func (x *Content) GetReceiptMessage() *ReceiptMessage { if x != nil { - if x, ok := x.Content.(*Content_ReceiptMessage); ok { - return x.ReceiptMessage - } + return x.ReceiptMessage } return nil } func (x *Content) GetTypingMessage() *TypingMessage { if x != nil { - if x, ok := x.Content.(*Content_TypingMessage); ok { - return x.TypingMessage - } - } - return nil -} - -func (x *Content) GetDecryptionErrorMessage() []byte { - if x != nil { - if x, ok := x.Content.(*Content_DecryptionErrorMessage); ok { - return x.DecryptionErrorMessage - } - } - return nil -} - -func (x *Content) GetStoryMessage() *StoryMessage { - if x != nil { - if x, ok := x.Content.(*Content_StoryMessage); ok { - return x.StoryMessage - } - } - return nil -} - -func (x *Content) GetEditMessage() *EditMessage { - if x != nil { - if x, ok := x.Content.(*Content_EditMessage); ok { - return x.EditMessage - } + return x.TypingMessage } return nil } @@ -2109,6 +1984,20 @@ func (x *Content) GetSenderKeyDistributionMessage() []byte { return nil } +func (x *Content) GetDecryptionErrorMessage() []byte { + if x != nil { + return x.DecryptionErrorMessage + } + return nil +} + +func (x *Content) GetStoryMessage() *StoryMessage { + if x != nil { + return x.StoryMessage + } + return nil +} + func (x *Content) GetPniSignatureMessage() *PniSignatureMessage { if x != nil { return x.PniSignatureMessage @@ -2116,64 +2005,13 @@ func (x *Content) GetPniSignatureMessage() *PniSignatureMessage { return nil } -type isContent_Content interface { - isContent_Content() +func (x *Content) GetEditMessage() *EditMessage { + if x != nil { + return x.EditMessage + } + return nil } -type Content_DataMessage struct { - DataMessage *DataMessage `protobuf:"bytes,1,opt,name=dataMessage,oneof"` -} - -type Content_SyncMessage struct { - SyncMessage *SyncMessage `protobuf:"bytes,2,opt,name=syncMessage,oneof"` -} - -type Content_CallMessage struct { - CallMessage *CallMessage `protobuf:"bytes,3,opt,name=callMessage,oneof"` -} - -type Content_NullMessage struct { - NullMessage *NullMessage `protobuf:"bytes,4,opt,name=nullMessage,oneof"` -} - -type Content_ReceiptMessage struct { - ReceiptMessage *ReceiptMessage `protobuf:"bytes,5,opt,name=receiptMessage,oneof"` -} - -type Content_TypingMessage struct { - TypingMessage *TypingMessage `protobuf:"bytes,6,opt,name=typingMessage,oneof"` -} - -type Content_DecryptionErrorMessage struct { - DecryptionErrorMessage []byte `protobuf:"bytes,8,opt,name=decryptionErrorMessage,oneof"` -} - -type Content_StoryMessage struct { - StoryMessage *StoryMessage `protobuf:"bytes,9,opt,name=storyMessage,oneof"` -} - -type Content_EditMessage struct { - EditMessage *EditMessage `protobuf:"bytes,11,opt,name=editMessage,oneof"` -} - -func (*Content_DataMessage) isContent_Content() {} - -func (*Content_SyncMessage) isContent_Content() {} - -func (*Content_CallMessage) isContent_Content() {} - -func (*Content_NullMessage) isContent_Content() {} - -func (*Content_ReceiptMessage) isContent_Content() {} - -func (*Content_TypingMessage) isContent_Content() {} - -func (*Content_DecryptionErrorMessage) isContent_Content() {} - -func (*Content_StoryMessage) isContent_Content() {} - -func (*Content_EditMessage) isContent_Content() {} - type CallMessage struct { state protoimpl.MessageState `protogen:"open.v1"` Offer *CallMessage_Offer `protobuf:"bytes,1,opt,name=offer" json:"offer,omitempty"` @@ -2288,13 +2126,7 @@ type DataMessage struct { GroupCallUpdate *DataMessage_GroupCallUpdate `protobuf:"bytes,19,opt,name=groupCallUpdate" json:"groupCallUpdate,omitempty"` Payment *DataMessage_Payment `protobuf:"bytes,20,opt,name=payment" json:"payment,omitempty"` StoryContext *DataMessage_StoryContext `protobuf:"bytes,21,opt,name=storyContext" json:"storyContext,omitempty"` - GiftBadge *DataMessage_GiftBadge `protobuf:"bytes,22,opt,name=giftBadge" json:"giftBadge,omitempty"` - PollCreate *DataMessage_PollCreate `protobuf:"bytes,24,opt,name=pollCreate" json:"pollCreate,omitempty"` - PollTerminate *DataMessage_PollTerminate `protobuf:"bytes,25,opt,name=pollTerminate" json:"pollTerminate,omitempty"` - PollVote *DataMessage_PollVote `protobuf:"bytes,26,opt,name=pollVote" json:"pollVote,omitempty"` - PinMessage *DataMessage_PinMessage `protobuf:"bytes,27,opt,name=pinMessage" json:"pinMessage,omitempty"` - UnpinMessage *DataMessage_UnpinMessage `protobuf:"bytes,28,opt,name=unpinMessage" json:"unpinMessage,omitempty"` - AdminDelete *DataMessage_AdminDelete `protobuf:"bytes,29,opt,name=adminDelete" json:"adminDelete,omitempty"` // NEXT ID: 30 + GiftBadge *DataMessage_GiftBadge `protobuf:"bytes,22,opt,name=giftBadge" json:"giftBadge,omitempty"` // NEXT ID: 24 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2476,48 +2308,6 @@ func (x *DataMessage) GetGiftBadge() *DataMessage_GiftBadge { return nil } -func (x *DataMessage) GetPollCreate() *DataMessage_PollCreate { - if x != nil { - return x.PollCreate - } - return nil -} - -func (x *DataMessage) GetPollTerminate() *DataMessage_PollTerminate { - if x != nil { - return x.PollTerminate - } - return nil -} - -func (x *DataMessage) GetPollVote() *DataMessage_PollVote { - if x != nil { - return x.PollVote - } - return nil -} - -func (x *DataMessage) GetPinMessage() *DataMessage_PinMessage { - if x != nil { - return x.PinMessage - } - return nil -} - -func (x *DataMessage) GetUnpinMessage() *DataMessage_UnpinMessage { - if x != nil { - return x.UnpinMessage - } - return nil -} - -func (x *DataMessage) GetAdminDelete() *DataMessage_AdminDelete { - if x != nil { - return x.AdminDelete - } - return nil -} - type NullMessage struct { state protoimpl.MessageState `protogen:"open.v1"` Padding []byte `protobuf:"bytes,1,opt,name=padding" json:"padding,omitempty"` @@ -2987,14 +2777,13 @@ func (*TextAttachment_Gradient_) isTextAttachment_Background() {} func (*TextAttachment_Color) isTextAttachment_Background() {} type Verified struct { - state protoimpl.MessageState `protogen:"open.v1"` - DestinationAci *string `protobuf:"bytes,5,opt,name=destinationAci" json:"destinationAci,omitempty"` - IdentityKey []byte `protobuf:"bytes,2,opt,name=identityKey" json:"identityKey,omitempty"` - State *Verified_State `protobuf:"varint,3,opt,name=state,enum=signalservice.Verified_State" json:"state,omitempty"` - NullMessage []byte `protobuf:"bytes,4,opt,name=nullMessage" json:"nullMessage,omitempty"` - DestinationAciBinary []byte `protobuf:"bytes,6,opt,name=destinationAciBinary" json:"destinationAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + DestinationAci *string `protobuf:"bytes,5,opt,name=destinationAci" json:"destinationAci,omitempty"` + IdentityKey []byte `protobuf:"bytes,2,opt,name=identityKey" json:"identityKey,omitempty"` + State *Verified_State `protobuf:"varint,3,opt,name=state,enum=signalservice.Verified_State" json:"state,omitempty"` + NullMessage []byte `protobuf:"bytes,4,opt,name=nullMessage" json:"nullMessage,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Verified) Reset() { @@ -3055,46 +2844,33 @@ func (x *Verified) GetNullMessage() []byte { return nil } -func (x *Verified) GetDestinationAciBinary() []byte { - if x != nil { - return x.DestinationAciBinary - } - return nil -} - type SyncMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Content: - // - // *SyncMessage_Sent_ - // *SyncMessage_Contacts_ - // *SyncMessage_Request_ - // *SyncMessage_Blocked_ - // *SyncMessage_Verified - // *SyncMessage_Configuration_ - // *SyncMessage_ViewOnceOpen_ - // *SyncMessage_FetchLatest_ - // *SyncMessage_Keys_ - // *SyncMessage_MessageRequestResponse_ - // *SyncMessage_OutgoingPayment_ - // *SyncMessage_PniChangeNumber_ - // *SyncMessage_CallEvent_ - // *SyncMessage_CallLinkUpdate_ - // *SyncMessage_CallLogEvent_ - // *SyncMessage_DeleteForMe_ - // *SyncMessage_DeviceNameChange_ - // *SyncMessage_AttachmentBackfillRequest_ - // *SyncMessage_AttachmentBackfillResponse_ - Content isSyncMessage_Content `protobuf_oneof:"content"` - // Protobufs don't allow `repeated` fields to be inside of `oneof` so while - // the fields below are mutually exclusive with the rest of the values above - // we have to place them outside of `oneof`. - Read []*SyncMessage_Read `protobuf:"bytes,5,rep,name=read" json:"read,omitempty"` - StickerPackOperation []*SyncMessage_StickerPackOperation `protobuf:"bytes,10,rep,name=stickerPackOperation" json:"stickerPackOperation,omitempty"` - Viewed []*SyncMessage_Viewed `protobuf:"bytes,16,rep,name=viewed" json:"viewed,omitempty"` - Padding []byte `protobuf:"bytes,8,opt,name=padding" json:"padding,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Sent *SyncMessage_Sent `protobuf:"bytes,1,opt,name=sent" json:"sent,omitempty"` + Contacts *SyncMessage_Contacts `protobuf:"bytes,2,opt,name=contacts" json:"contacts,omitempty"` + Request *SyncMessage_Request `protobuf:"bytes,4,opt,name=request" json:"request,omitempty"` + Read []*SyncMessage_Read `protobuf:"bytes,5,rep,name=read" json:"read,omitempty"` + Blocked *SyncMessage_Blocked `protobuf:"bytes,6,opt,name=blocked" json:"blocked,omitempty"` + Verified *Verified `protobuf:"bytes,7,opt,name=verified" json:"verified,omitempty"` + Configuration *SyncMessage_Configuration `protobuf:"bytes,9,opt,name=configuration" json:"configuration,omitempty"` + Padding []byte `protobuf:"bytes,8,opt,name=padding" json:"padding,omitempty"` + StickerPackOperation []*SyncMessage_StickerPackOperation `protobuf:"bytes,10,rep,name=stickerPackOperation" json:"stickerPackOperation,omitempty"` + ViewOnceOpen *SyncMessage_ViewOnceOpen `protobuf:"bytes,11,opt,name=viewOnceOpen" json:"viewOnceOpen,omitempty"` + FetchLatest *SyncMessage_FetchLatest `protobuf:"bytes,12,opt,name=fetchLatest" json:"fetchLatest,omitempty"` + Keys *SyncMessage_Keys `protobuf:"bytes,13,opt,name=keys" json:"keys,omitempty"` + MessageRequestResponse *SyncMessage_MessageRequestResponse `protobuf:"bytes,14,opt,name=messageRequestResponse" json:"messageRequestResponse,omitempty"` + OutgoingPayment *SyncMessage_OutgoingPayment `protobuf:"bytes,15,opt,name=outgoingPayment" json:"outgoingPayment,omitempty"` + Viewed []*SyncMessage_Viewed `protobuf:"bytes,16,rep,name=viewed" json:"viewed,omitempty"` + PniChangeNumber *SyncMessage_PniChangeNumber `protobuf:"bytes,18,opt,name=pniChangeNumber" json:"pniChangeNumber,omitempty"` + CallEvent *SyncMessage_CallEvent `protobuf:"bytes,19,opt,name=callEvent" json:"callEvent,omitempty"` + CallLinkUpdate *SyncMessage_CallLinkUpdate `protobuf:"bytes,20,opt,name=callLinkUpdate" json:"callLinkUpdate,omitempty"` + CallLogEvent *SyncMessage_CallLogEvent `protobuf:"bytes,21,opt,name=callLogEvent" json:"callLogEvent,omitempty"` + DeleteForMe *SyncMessage_DeleteForMe `protobuf:"bytes,22,opt,name=deleteForMe" json:"deleteForMe,omitempty"` + DeviceNameChange *SyncMessage_DeviceNameChange `protobuf:"bytes,23,opt,name=deviceNameChange" json:"deviceNameChange,omitempty"` + AttachmentBackfillRequest *SyncMessage_AttachmentBackfillRequest `protobuf:"bytes,24,opt,name=attachmentBackfillRequest" json:"attachmentBackfillRequest,omitempty"` + AttachmentBackfillResponse *SyncMessage_AttachmentBackfillResponse `protobuf:"bytes,25,opt,name=attachmentBackfillResponse" json:"attachmentBackfillResponse,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncMessage) Reset() { @@ -3127,180 +2903,23 @@ func (*SyncMessage) Descriptor() ([]byte, []int) { return file_SignalService_proto_rawDescGZIP(), []int{11} } -func (x *SyncMessage) GetContent() isSyncMessage_Content { - if x != nil { - return x.Content - } - return nil -} - func (x *SyncMessage) GetSent() *SyncMessage_Sent { if x != nil { - if x, ok := x.Content.(*SyncMessage_Sent_); ok { - return x.Sent - } + return x.Sent } return nil } func (x *SyncMessage) GetContacts() *SyncMessage_Contacts { if x != nil { - if x, ok := x.Content.(*SyncMessage_Contacts_); ok { - return x.Contacts - } + return x.Contacts } return nil } func (x *SyncMessage) GetRequest() *SyncMessage_Request { if x != nil { - if x, ok := x.Content.(*SyncMessage_Request_); ok { - return x.Request - } - } - return nil -} - -func (x *SyncMessage) GetBlocked() *SyncMessage_Blocked { - if x != nil { - if x, ok := x.Content.(*SyncMessage_Blocked_); ok { - return x.Blocked - } - } - return nil -} - -func (x *SyncMessage) GetVerified() *Verified { - if x != nil { - if x, ok := x.Content.(*SyncMessage_Verified); ok { - return x.Verified - } - } - return nil -} - -func (x *SyncMessage) GetConfiguration() *SyncMessage_Configuration { - if x != nil { - if x, ok := x.Content.(*SyncMessage_Configuration_); ok { - return x.Configuration - } - } - return nil -} - -func (x *SyncMessage) GetViewOnceOpen() *SyncMessage_ViewOnceOpen { - if x != nil { - if x, ok := x.Content.(*SyncMessage_ViewOnceOpen_); ok { - return x.ViewOnceOpen - } - } - return nil -} - -func (x *SyncMessage) GetFetchLatest() *SyncMessage_FetchLatest { - if x != nil { - if x, ok := x.Content.(*SyncMessage_FetchLatest_); ok { - return x.FetchLatest - } - } - return nil -} - -func (x *SyncMessage) GetKeys() *SyncMessage_Keys { - if x != nil { - if x, ok := x.Content.(*SyncMessage_Keys_); ok { - return x.Keys - } - } - return nil -} - -func (x *SyncMessage) GetMessageRequestResponse() *SyncMessage_MessageRequestResponse { - if x != nil { - if x, ok := x.Content.(*SyncMessage_MessageRequestResponse_); ok { - return x.MessageRequestResponse - } - } - return nil -} - -func (x *SyncMessage) GetOutgoingPayment() *SyncMessage_OutgoingPayment { - if x != nil { - if x, ok := x.Content.(*SyncMessage_OutgoingPayment_); ok { - return x.OutgoingPayment - } - } - return nil -} - -func (x *SyncMessage) GetPniChangeNumber() *SyncMessage_PniChangeNumber { - if x != nil { - if x, ok := x.Content.(*SyncMessage_PniChangeNumber_); ok { - return x.PniChangeNumber - } - } - return nil -} - -func (x *SyncMessage) GetCallEvent() *SyncMessage_CallEvent { - if x != nil { - if x, ok := x.Content.(*SyncMessage_CallEvent_); ok { - return x.CallEvent - } - } - return nil -} - -func (x *SyncMessage) GetCallLinkUpdate() *SyncMessage_CallLinkUpdate { - if x != nil { - if x, ok := x.Content.(*SyncMessage_CallLinkUpdate_); ok { - return x.CallLinkUpdate - } - } - return nil -} - -func (x *SyncMessage) GetCallLogEvent() *SyncMessage_CallLogEvent { - if x != nil { - if x, ok := x.Content.(*SyncMessage_CallLogEvent_); ok { - return x.CallLogEvent - } - } - return nil -} - -func (x *SyncMessage) GetDeleteForMe() *SyncMessage_DeleteForMe { - if x != nil { - if x, ok := x.Content.(*SyncMessage_DeleteForMe_); ok { - return x.DeleteForMe - } - } - return nil -} - -func (x *SyncMessage) GetDeviceNameChange() *SyncMessage_DeviceNameChange { - if x != nil { - if x, ok := x.Content.(*SyncMessage_DeviceNameChange_); ok { - return x.DeviceNameChange - } - } - return nil -} - -func (x *SyncMessage) GetAttachmentBackfillRequest() *SyncMessage_AttachmentBackfillRequest { - if x != nil { - if x, ok := x.Content.(*SyncMessage_AttachmentBackfillRequest_); ok { - return x.AttachmentBackfillRequest - } - } - return nil -} - -func (x *SyncMessage) GetAttachmentBackfillResponse() *SyncMessage_AttachmentBackfillResponse { - if x != nil { - if x, ok := x.Content.(*SyncMessage_AttachmentBackfillResponse_); ok { - return x.AttachmentBackfillResponse - } + return x.Request } return nil } @@ -3312,16 +2931,23 @@ func (x *SyncMessage) GetRead() []*SyncMessage_Read { return nil } -func (x *SyncMessage) GetStickerPackOperation() []*SyncMessage_StickerPackOperation { +func (x *SyncMessage) GetBlocked() *SyncMessage_Blocked { if x != nil { - return x.StickerPackOperation + return x.Blocked } return nil } -func (x *SyncMessage) GetViewed() []*SyncMessage_Viewed { +func (x *SyncMessage) GetVerified() *Verified { if x != nil { - return x.Viewed + return x.Verified + } + return nil +} + +func (x *SyncMessage) GetConfiguration() *SyncMessage_Configuration { + if x != nil { + return x.Configuration } return nil } @@ -3333,124 +2959,111 @@ func (x *SyncMessage) GetPadding() []byte { return nil } -type isSyncMessage_Content interface { - isSyncMessage_Content() +func (x *SyncMessage) GetStickerPackOperation() []*SyncMessage_StickerPackOperation { + if x != nil { + return x.StickerPackOperation + } + return nil } -type SyncMessage_Sent_ struct { - Sent *SyncMessage_Sent `protobuf:"bytes,1,opt,name=sent,oneof"` +func (x *SyncMessage) GetViewOnceOpen() *SyncMessage_ViewOnceOpen { + if x != nil { + return x.ViewOnceOpen + } + return nil } -type SyncMessage_Contacts_ struct { - Contacts *SyncMessage_Contacts `protobuf:"bytes,2,opt,name=contacts,oneof"` +func (x *SyncMessage) GetFetchLatest() *SyncMessage_FetchLatest { + if x != nil { + return x.FetchLatest + } + return nil } -type SyncMessage_Request_ struct { - Request *SyncMessage_Request `protobuf:"bytes,4,opt,name=request,oneof"` +func (x *SyncMessage) GetKeys() *SyncMessage_Keys { + if x != nil { + return x.Keys + } + return nil } -type SyncMessage_Blocked_ struct { - Blocked *SyncMessage_Blocked `protobuf:"bytes,6,opt,name=blocked,oneof"` +func (x *SyncMessage) GetMessageRequestResponse() *SyncMessage_MessageRequestResponse { + if x != nil { + return x.MessageRequestResponse + } + return nil } -type SyncMessage_Verified struct { - Verified *Verified `protobuf:"bytes,7,opt,name=verified,oneof"` +func (x *SyncMessage) GetOutgoingPayment() *SyncMessage_OutgoingPayment { + if x != nil { + return x.OutgoingPayment + } + return nil } -type SyncMessage_Configuration_ struct { - Configuration *SyncMessage_Configuration `protobuf:"bytes,9,opt,name=configuration,oneof"` +func (x *SyncMessage) GetViewed() []*SyncMessage_Viewed { + if x != nil { + return x.Viewed + } + return nil } -type SyncMessage_ViewOnceOpen_ struct { - ViewOnceOpen *SyncMessage_ViewOnceOpen `protobuf:"bytes,11,opt,name=viewOnceOpen,oneof"` +func (x *SyncMessage) GetPniChangeNumber() *SyncMessage_PniChangeNumber { + if x != nil { + return x.PniChangeNumber + } + return nil } -type SyncMessage_FetchLatest_ struct { - FetchLatest *SyncMessage_FetchLatest `protobuf:"bytes,12,opt,name=fetchLatest,oneof"` +func (x *SyncMessage) GetCallEvent() *SyncMessage_CallEvent { + if x != nil { + return x.CallEvent + } + return nil } -type SyncMessage_Keys_ struct { - Keys *SyncMessage_Keys `protobuf:"bytes,13,opt,name=keys,oneof"` +func (x *SyncMessage) GetCallLinkUpdate() *SyncMessage_CallLinkUpdate { + if x != nil { + return x.CallLinkUpdate + } + return nil } -type SyncMessage_MessageRequestResponse_ struct { - MessageRequestResponse *SyncMessage_MessageRequestResponse `protobuf:"bytes,14,opt,name=messageRequestResponse,oneof"` +func (x *SyncMessage) GetCallLogEvent() *SyncMessage_CallLogEvent { + if x != nil { + return x.CallLogEvent + } + return nil } -type SyncMessage_OutgoingPayment_ struct { - OutgoingPayment *SyncMessage_OutgoingPayment `protobuf:"bytes,15,opt,name=outgoingPayment,oneof"` +func (x *SyncMessage) GetDeleteForMe() *SyncMessage_DeleteForMe { + if x != nil { + return x.DeleteForMe + } + return nil } -type SyncMessage_PniChangeNumber_ struct { - PniChangeNumber *SyncMessage_PniChangeNumber `protobuf:"bytes,18,opt,name=pniChangeNumber,oneof"` +func (x *SyncMessage) GetDeviceNameChange() *SyncMessage_DeviceNameChange { + if x != nil { + return x.DeviceNameChange + } + return nil } -type SyncMessage_CallEvent_ struct { - CallEvent *SyncMessage_CallEvent `protobuf:"bytes,19,opt,name=callEvent,oneof"` +func (x *SyncMessage) GetAttachmentBackfillRequest() *SyncMessage_AttachmentBackfillRequest { + if x != nil { + return x.AttachmentBackfillRequest + } + return nil } -type SyncMessage_CallLinkUpdate_ struct { - CallLinkUpdate *SyncMessage_CallLinkUpdate `protobuf:"bytes,20,opt,name=callLinkUpdate,oneof"` +func (x *SyncMessage) GetAttachmentBackfillResponse() *SyncMessage_AttachmentBackfillResponse { + if x != nil { + return x.AttachmentBackfillResponse + } + return nil } -type SyncMessage_CallLogEvent_ struct { - CallLogEvent *SyncMessage_CallLogEvent `protobuf:"bytes,21,opt,name=callLogEvent,oneof"` -} - -type SyncMessage_DeleteForMe_ struct { - DeleteForMe *SyncMessage_DeleteForMe `protobuf:"bytes,22,opt,name=deleteForMe,oneof"` -} - -type SyncMessage_DeviceNameChange_ struct { - DeviceNameChange *SyncMessage_DeviceNameChange `protobuf:"bytes,23,opt,name=deviceNameChange,oneof"` -} - -type SyncMessage_AttachmentBackfillRequest_ struct { - AttachmentBackfillRequest *SyncMessage_AttachmentBackfillRequest `protobuf:"bytes,24,opt,name=attachmentBackfillRequest,oneof"` -} - -type SyncMessage_AttachmentBackfillResponse_ struct { - AttachmentBackfillResponse *SyncMessage_AttachmentBackfillResponse `protobuf:"bytes,25,opt,name=attachmentBackfillResponse,oneof"` -} - -func (*SyncMessage_Sent_) isSyncMessage_Content() {} - -func (*SyncMessage_Contacts_) isSyncMessage_Content() {} - -func (*SyncMessage_Request_) isSyncMessage_Content() {} - -func (*SyncMessage_Blocked_) isSyncMessage_Content() {} - -func (*SyncMessage_Verified) isSyncMessage_Content() {} - -func (*SyncMessage_Configuration_) isSyncMessage_Content() {} - -func (*SyncMessage_ViewOnceOpen_) isSyncMessage_Content() {} - -func (*SyncMessage_FetchLatest_) isSyncMessage_Content() {} - -func (*SyncMessage_Keys_) isSyncMessage_Content() {} - -func (*SyncMessage_MessageRequestResponse_) isSyncMessage_Content() {} - -func (*SyncMessage_OutgoingPayment_) isSyncMessage_Content() {} - -func (*SyncMessage_PniChangeNumber_) isSyncMessage_Content() {} - -func (*SyncMessage_CallEvent_) isSyncMessage_Content() {} - -func (*SyncMessage_CallLinkUpdate_) isSyncMessage_Content() {} - -func (*SyncMessage_CallLogEvent_) isSyncMessage_Content() {} - -func (*SyncMessage_DeleteForMe_) isSyncMessage_Content() {} - -func (*SyncMessage_DeviceNameChange_) isSyncMessage_Content() {} - -func (*SyncMessage_AttachmentBackfillRequest_) isSyncMessage_Content() {} - -func (*SyncMessage_AttachmentBackfillResponse_) isSyncMessage_Content() {} - type AttachmentPointer struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to AttachmentIdentifier: @@ -3727,7 +3340,6 @@ type ContactDetails struct { state protoimpl.MessageState `protogen:"open.v1"` Number *string `protobuf:"bytes,1,opt,name=number" json:"number,omitempty"` Aci *string `protobuf:"bytes,9,opt,name=aci" json:"aci,omitempty"` - AciBinary []byte `protobuf:"bytes,13,opt,name=aciBinary" json:"aciBinary,omitempty"` // 16-byte UUID Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` Avatar *ContactDetails_Avatar `protobuf:"bytes,3,opt,name=avatar" json:"avatar,omitempty"` ExpireTimer *uint32 `protobuf:"varint,8,opt,name=expireTimer" json:"expireTimer,omitempty"` @@ -3781,13 +3393,6 @@ func (x *ContactDetails) GetAci() string { return "" } -func (x *ContactDetails) GetAciBinary() []byte { - if x != nil { - return x.AciBinary - } - return nil -} - func (x *ContactDetails) GetName() string { if x != nil && x.Name != nil { return *x.Name @@ -4062,7 +3667,6 @@ type BodyRange struct { // // *BodyRange_MentionAci // *BodyRange_Style_ - // *BodyRange_MentionAciBinary AssociatedValue isBodyRange_AssociatedValue `protobuf_oneof:"associatedValue"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -4137,15 +3741,6 @@ func (x *BodyRange) GetStyle() BodyRange_Style { return BodyRange_NONE } -func (x *BodyRange) GetMentionAciBinary() []byte { - if x != nil { - if x, ok := x.AssociatedValue.(*BodyRange_MentionAciBinary); ok { - return x.MentionAciBinary - } - } - return nil -} - type isBodyRange_AssociatedValue interface { isBodyRange_AssociatedValue() } @@ -4158,23 +3753,16 @@ type BodyRange_Style_ struct { Style BodyRange_Style `protobuf:"varint,4,opt,name=style,enum=signalservice.BodyRange_Style,oneof"` } -type BodyRange_MentionAciBinary struct { - MentionAciBinary []byte `protobuf:"bytes,5,opt,name=mentionAciBinary,oneof"` // 16-byte UUID -} - func (*BodyRange_MentionAci) isBodyRange_AssociatedValue() {} func (*BodyRange_Style_) isBodyRange_AssociatedValue() {} -func (*BodyRange_MentionAciBinary) isBodyRange_AssociatedValue() {} - type AddressableMessage struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Author: // // *AddressableMessage_AuthorServiceId // *AddressableMessage_AuthorE164 - // *AddressableMessage_AuthorServiceIdBinary Author isAddressableMessage_Author `protobuf_oneof:"author"` SentTimestamp *uint64 `protobuf:"varint,3,opt,name=sentTimestamp" json:"sentTimestamp,omitempty"` unknownFields protoimpl.UnknownFields @@ -4236,15 +3824,6 @@ func (x *AddressableMessage) GetAuthorE164() string { return "" } -func (x *AddressableMessage) GetAuthorServiceIdBinary() []byte { - if x != nil { - if x, ok := x.Author.(*AddressableMessage_AuthorServiceIdBinary); ok { - return x.AuthorServiceIdBinary - } - } - return nil -} - func (x *AddressableMessage) GetSentTimestamp() uint64 { if x != nil && x.SentTimestamp != nil { return *x.SentTimestamp @@ -4264,16 +3843,10 @@ type AddressableMessage_AuthorE164 struct { AuthorE164 string `protobuf:"bytes,2,opt,name=authorE164,oneof"` } -type AddressableMessage_AuthorServiceIdBinary struct { - AuthorServiceIdBinary []byte `protobuf:"bytes,4,opt,name=authorServiceIdBinary,oneof"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) -} - func (*AddressableMessage_AuthorServiceId) isAddressableMessage_Author() {} func (*AddressableMessage_AuthorE164) isAddressableMessage_Author() {} -func (*AddressableMessage_AuthorServiceIdBinary) isAddressableMessage_Author() {} - type ConversationIdentifier struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Identifier: @@ -4281,7 +3854,6 @@ type ConversationIdentifier struct { // *ConversationIdentifier_ThreadServiceId // *ConversationIdentifier_ThreadGroupId // *ConversationIdentifier_ThreadE164 - // *ConversationIdentifier_ThreadServiceIdBinary Identifier isConversationIdentifier_Identifier `protobuf_oneof:"identifier"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -4351,15 +3923,6 @@ func (x *ConversationIdentifier) GetThreadE164() string { return "" } -func (x *ConversationIdentifier) GetThreadServiceIdBinary() []byte { - if x != nil { - if x, ok := x.Identifier.(*ConversationIdentifier_ThreadServiceIdBinary); ok { - return x.ThreadServiceIdBinary - } - } - return nil -} - type isConversationIdentifier_Identifier interface { isConversationIdentifier_Identifier() } @@ -4376,18 +3939,12 @@ type ConversationIdentifier_ThreadE164 struct { ThreadE164 string `protobuf:"bytes,3,opt,name=threadE164,oneof"` } -type ConversationIdentifier_ThreadServiceIdBinary struct { - ThreadServiceIdBinary []byte `protobuf:"bytes,4,opt,name=threadServiceIdBinary,oneof"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) -} - func (*ConversationIdentifier_ThreadServiceId) isConversationIdentifier_Identifier() {} func (*ConversationIdentifier_ThreadGroupId) isConversationIdentifier_Identifier() {} func (*ConversationIdentifier_ThreadE164) isConversationIdentifier_Identifier() {} -func (*ConversationIdentifier_ThreadServiceIdBinary) isConversationIdentifier_Identifier() {} - type CallMessage_Offer struct { state protoimpl.MessageState `protogen:"open.v1"` Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` @@ -4791,16 +4348,15 @@ func (*DataMessage_Payment_Notification_) isDataMessage_Payment_Item() {} func (*DataMessage_Payment_Activation_) isDataMessage_Payment_Item() {} type DataMessage_Quote struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - AuthorAci *string `protobuf:"bytes,5,opt,name=authorAci" json:"authorAci,omitempty"` - Text *string `protobuf:"bytes,3,opt,name=text" json:"text,omitempty"` - Attachments []*DataMessage_Quote_QuotedAttachment `protobuf:"bytes,4,rep,name=attachments" json:"attachments,omitempty"` - BodyRanges []*BodyRange `protobuf:"bytes,6,rep,name=bodyRanges" json:"bodyRanges,omitempty"` - Type *DataMessage_Quote_Type `protobuf:"varint,7,opt,name=type,enum=signalservice.DataMessage_Quote_Type" json:"type,omitempty"` - AuthorAciBinary []byte `protobuf:"bytes,8,opt,name=authorAciBinary" json:"authorAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + AuthorAci *string `protobuf:"bytes,5,opt,name=authorAci" json:"authorAci,omitempty"` + Text *string `protobuf:"bytes,3,opt,name=text" json:"text,omitempty"` + Attachments []*DataMessage_Quote_QuotedAttachment `protobuf:"bytes,4,rep,name=attachments" json:"attachments,omitempty"` + BodyRanges []*BodyRange `protobuf:"bytes,6,rep,name=bodyRanges" json:"bodyRanges,omitempty"` + Type *DataMessage_Quote_Type `protobuf:"varint,7,opt,name=type,enum=signalservice.DataMessage_Quote_Type" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DataMessage_Quote) Reset() { @@ -4875,13 +4431,6 @@ func (x *DataMessage_Quote) GetType() DataMessage_Quote_Type { return DataMessage_Quote_NORMAL } -func (x *DataMessage_Quote) GetAuthorAciBinary() []byte { - if x != nil { - return x.AuthorAciBinary - } - return nil -} - type DataMessage_Contact struct { state protoimpl.MessageState `protogen:"open.v1"` Name *DataMessage_Contact_Name `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` @@ -5043,14 +4592,13 @@ func (x *DataMessage_Sticker) GetEmoji() string { } type DataMessage_Reaction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Emoji *string `protobuf:"bytes,1,opt,name=emoji" json:"emoji,omitempty"` - Remove *bool `protobuf:"varint,2,opt,name=remove" json:"remove,omitempty"` - TargetAuthorAci *string `protobuf:"bytes,4,opt,name=targetAuthorAci" json:"targetAuthorAci,omitempty"` - TargetSentTimestamp *uint64 `protobuf:"varint,5,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` - TargetAuthorAciBinary []byte `protobuf:"bytes,6,opt,name=targetAuthorAciBinary" json:"targetAuthorAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Emoji *string `protobuf:"bytes,1,opt,name=emoji" json:"emoji,omitempty"` + Remove *bool `protobuf:"varint,2,opt,name=remove" json:"remove,omitempty"` + TargetAuthorAci *string `protobuf:"bytes,4,opt,name=targetAuthorAci" json:"targetAuthorAci,omitempty"` + TargetSentTimestamp *uint64 `protobuf:"varint,5,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DataMessage_Reaction) Reset() { @@ -5111,13 +4659,6 @@ func (x *DataMessage_Reaction) GetTargetSentTimestamp() uint64 { return 0 } -func (x *DataMessage_Reaction) GetTargetAuthorAciBinary() []byte { - if x != nil { - return x.TargetAuthorAciBinary - } - return nil -} - type DataMessage_Delete struct { state protoimpl.MessageState `protogen:"open.v1"` TargetSentTimestamp *uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` @@ -5207,12 +4748,11 @@ func (x *DataMessage_GroupCallUpdate) GetEraId() string { } type DataMessage_StoryContext struct { - state protoimpl.MessageState `protogen:"open.v1"` - AuthorAci *string `protobuf:"bytes,1,opt,name=authorAci" json:"authorAci,omitempty"` - SentTimestamp *uint64 `protobuf:"varint,2,opt,name=sentTimestamp" json:"sentTimestamp,omitempty"` - AuthorAciBinary []byte `protobuf:"bytes,3,opt,name=authorAciBinary" json:"authorAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + AuthorAci *string `protobuf:"bytes,1,opt,name=authorAci" json:"authorAci,omitempty"` + SentTimestamp *uint64 `protobuf:"varint,2,opt,name=sentTimestamp" json:"sentTimestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DataMessage_StoryContext) Reset() { @@ -5259,13 +4799,6 @@ func (x *DataMessage_StoryContext) GetSentTimestamp() uint64 { return 0 } -func (x *DataMessage_StoryContext) GetAuthorAciBinary() []byte { - if x != nil { - return x.AuthorAciBinary - } - return nil -} - type DataMessage_GiftBadge struct { state protoimpl.MessageState `protogen:"open.v1"` ReceiptCredentialPresentation []byte `protobuf:"bytes,1,opt,name=receiptCredentialPresentation" json:"receiptCredentialPresentation,omitempty"` @@ -5310,380 +4843,6 @@ func (x *DataMessage_GiftBadge) GetReceiptCredentialPresentation() []byte { return nil } -type DataMessage_PollCreate struct { - state protoimpl.MessageState `protogen:"open.v1"` - Question *string `protobuf:"bytes,1,opt,name=question" json:"question,omitempty"` - AllowMultiple *bool `protobuf:"varint,2,opt,name=allowMultiple" json:"allowMultiple,omitempty"` - Options []string `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_PollCreate) Reset() { - *x = DataMessage_PollCreate{} - mi := &file_SignalService_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_PollCreate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_PollCreate) ProtoMessage() {} - -func (x *DataMessage_PollCreate) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[37] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataMessage_PollCreate.ProtoReflect.Descriptor instead. -func (*DataMessage_PollCreate) Descriptor() ([]byte, []int) { - return file_SignalService_proto_rawDescGZIP(), []int{3, 9} -} - -func (x *DataMessage_PollCreate) GetQuestion() string { - if x != nil && x.Question != nil { - return *x.Question - } - return "" -} - -func (x *DataMessage_PollCreate) GetAllowMultiple() bool { - if x != nil && x.AllowMultiple != nil { - return *x.AllowMultiple - } - return false -} - -func (x *DataMessage_PollCreate) GetOptions() []string { - if x != nil { - return x.Options - } - return nil -} - -type DataMessage_PollTerminate struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetSentTimestamp *uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_PollTerminate) Reset() { - *x = DataMessage_PollTerminate{} - mi := &file_SignalService_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_PollTerminate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_PollTerminate) ProtoMessage() {} - -func (x *DataMessage_PollTerminate) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[38] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataMessage_PollTerminate.ProtoReflect.Descriptor instead. -func (*DataMessage_PollTerminate) Descriptor() ([]byte, []int) { - return file_SignalService_proto_rawDescGZIP(), []int{3, 10} -} - -func (x *DataMessage_PollTerminate) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - -type DataMessage_PollVote struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetAuthorAciBinary []byte `protobuf:"bytes,1,opt,name=targetAuthorAciBinary" json:"targetAuthorAciBinary,omitempty"` - TargetSentTimestamp *uint64 `protobuf:"varint,2,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` - OptionIndexes []uint32 `protobuf:"varint,3,rep,name=optionIndexes" json:"optionIndexes,omitempty"` - VoteCount *uint32 `protobuf:"varint,4,opt,name=voteCount" json:"voteCount,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_PollVote) Reset() { - *x = DataMessage_PollVote{} - mi := &file_SignalService_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_PollVote) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_PollVote) ProtoMessage() {} - -func (x *DataMessage_PollVote) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[39] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataMessage_PollVote.ProtoReflect.Descriptor instead. -func (*DataMessage_PollVote) Descriptor() ([]byte, []int) { - return file_SignalService_proto_rawDescGZIP(), []int{3, 11} -} - -func (x *DataMessage_PollVote) GetTargetAuthorAciBinary() []byte { - if x != nil { - return x.TargetAuthorAciBinary - } - return nil -} - -func (x *DataMessage_PollVote) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - -func (x *DataMessage_PollVote) GetOptionIndexes() []uint32 { - if x != nil { - return x.OptionIndexes - } - return nil -} - -func (x *DataMessage_PollVote) GetVoteCount() uint32 { - if x != nil && x.VoteCount != nil { - return *x.VoteCount - } - return 0 -} - -type DataMessage_PinMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetAuthorAciBinary []byte `protobuf:"bytes,1,opt,name=targetAuthorAciBinary" json:"targetAuthorAciBinary,omitempty"` // 16-byte UUID - TargetSentTimestamp *uint64 `protobuf:"varint,2,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` - // Types that are valid to be assigned to PinDuration: - // - // *DataMessage_PinMessage_PinDurationSeconds - // *DataMessage_PinMessage_PinDurationForever - PinDuration isDataMessage_PinMessage_PinDuration `protobuf_oneof:"pinDuration"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_PinMessage) Reset() { - *x = DataMessage_PinMessage{} - mi := &file_SignalService_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_PinMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_PinMessage) ProtoMessage() {} - -func (x *DataMessage_PinMessage) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[40] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataMessage_PinMessage.ProtoReflect.Descriptor instead. -func (*DataMessage_PinMessage) Descriptor() ([]byte, []int) { - return file_SignalService_proto_rawDescGZIP(), []int{3, 12} -} - -func (x *DataMessage_PinMessage) GetTargetAuthorAciBinary() []byte { - if x != nil { - return x.TargetAuthorAciBinary - } - return nil -} - -func (x *DataMessage_PinMessage) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - -func (x *DataMessage_PinMessage) GetPinDuration() isDataMessage_PinMessage_PinDuration { - if x != nil { - return x.PinDuration - } - return nil -} - -func (x *DataMessage_PinMessage) GetPinDurationSeconds() uint32 { - if x != nil { - if x, ok := x.PinDuration.(*DataMessage_PinMessage_PinDurationSeconds); ok { - return x.PinDurationSeconds - } - } - return 0 -} - -func (x *DataMessage_PinMessage) GetPinDurationForever() bool { - if x != nil { - if x, ok := x.PinDuration.(*DataMessage_PinMessage_PinDurationForever); ok { - return x.PinDurationForever - } - } - return false -} - -type isDataMessage_PinMessage_PinDuration interface { - isDataMessage_PinMessage_PinDuration() -} - -type DataMessage_PinMessage_PinDurationSeconds struct { - PinDurationSeconds uint32 `protobuf:"varint,3,opt,name=pinDurationSeconds,oneof"` -} - -type DataMessage_PinMessage_PinDurationForever struct { - PinDurationForever bool `protobuf:"varint,4,opt,name=pinDurationForever,oneof"` -} - -func (*DataMessage_PinMessage_PinDurationSeconds) isDataMessage_PinMessage_PinDuration() {} - -func (*DataMessage_PinMessage_PinDurationForever) isDataMessage_PinMessage_PinDuration() {} - -type DataMessage_UnpinMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetAuthorAciBinary []byte `protobuf:"bytes,1,opt,name=targetAuthorAciBinary" json:"targetAuthorAciBinary,omitempty"` // 16-byte UUID - TargetSentTimestamp *uint64 `protobuf:"varint,2,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_UnpinMessage) Reset() { - *x = DataMessage_UnpinMessage{} - mi := &file_SignalService_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_UnpinMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_UnpinMessage) ProtoMessage() {} - -func (x *DataMessage_UnpinMessage) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[41] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataMessage_UnpinMessage.ProtoReflect.Descriptor instead. -func (*DataMessage_UnpinMessage) Descriptor() ([]byte, []int) { - return file_SignalService_proto_rawDescGZIP(), []int{3, 13} -} - -func (x *DataMessage_UnpinMessage) GetTargetAuthorAciBinary() []byte { - if x != nil { - return x.TargetAuthorAciBinary - } - return nil -} - -func (x *DataMessage_UnpinMessage) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - -type DataMessage_AdminDelete struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetAuthorAciBinary []byte `protobuf:"bytes,1,opt,name=targetAuthorAciBinary" json:"targetAuthorAciBinary,omitempty"` // 16-byte UUID - TargetSentTimestamp *uint64 `protobuf:"varint,2,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_AdminDelete) Reset() { - *x = DataMessage_AdminDelete{} - mi := &file_SignalService_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_AdminDelete) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_AdminDelete) ProtoMessage() {} - -func (x *DataMessage_AdminDelete) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[42] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DataMessage_AdminDelete.ProtoReflect.Descriptor instead. -func (*DataMessage_AdminDelete) Descriptor() ([]byte, []int) { - return file_SignalService_proto_rawDescGZIP(), []int{3, 14} -} - -func (x *DataMessage_AdminDelete) GetTargetAuthorAciBinary() []byte { - if x != nil { - return x.TargetAuthorAciBinary - } - return nil -} - -func (x *DataMessage_AdminDelete) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - type DataMessage_Payment_Amount struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Amount: @@ -5696,7 +4855,7 @@ type DataMessage_Payment_Amount struct { func (x *DataMessage_Payment_Amount) Reset() { *x = DataMessage_Payment_Amount{} - mi := &file_SignalService_proto_msgTypes[43] + mi := &file_SignalService_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5708,7 +4867,7 @@ func (x *DataMessage_Payment_Amount) String() string { func (*DataMessage_Payment_Amount) ProtoMessage() {} func (x *DataMessage_Payment_Amount) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[43] + mi := &file_SignalService_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5764,7 +4923,7 @@ type DataMessage_Payment_Notification struct { func (x *DataMessage_Payment_Notification) Reset() { *x = DataMessage_Payment_Notification{} - mi := &file_SignalService_proto_msgTypes[44] + mi := &file_SignalService_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5776,7 +4935,7 @@ func (x *DataMessage_Payment_Notification) String() string { func (*DataMessage_Payment_Notification) ProtoMessage() {} func (x *DataMessage_Payment_Notification) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[44] + mi := &file_SignalService_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5835,7 +4994,7 @@ type DataMessage_Payment_Activation struct { func (x *DataMessage_Payment_Activation) Reset() { *x = DataMessage_Payment_Activation{} - mi := &file_SignalService_proto_msgTypes[45] + mi := &file_SignalService_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5847,7 +5006,7 @@ func (x *DataMessage_Payment_Activation) String() string { func (*DataMessage_Payment_Activation) ProtoMessage() {} func (x *DataMessage_Payment_Activation) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[45] + mi := &file_SignalService_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5879,7 +5038,7 @@ type DataMessage_Payment_Amount_MobileCoin struct { func (x *DataMessage_Payment_Amount_MobileCoin) Reset() { *x = DataMessage_Payment_Amount_MobileCoin{} - mi := &file_SignalService_proto_msgTypes[46] + mi := &file_SignalService_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5891,7 +5050,7 @@ func (x *DataMessage_Payment_Amount_MobileCoin) String() string { func (*DataMessage_Payment_Amount_MobileCoin) ProtoMessage() {} func (x *DataMessage_Payment_Amount_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[46] + mi := &file_SignalService_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5923,7 +5082,7 @@ type DataMessage_Payment_Notification_MobileCoin struct { func (x *DataMessage_Payment_Notification_MobileCoin) Reset() { *x = DataMessage_Payment_Notification_MobileCoin{} - mi := &file_SignalService_proto_msgTypes[47] + mi := &file_SignalService_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5935,7 +5094,7 @@ func (x *DataMessage_Payment_Notification_MobileCoin) String() string { func (*DataMessage_Payment_Notification_MobileCoin) ProtoMessage() {} func (x *DataMessage_Payment_Notification_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[47] + mi := &file_SignalService_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5969,7 +5128,7 @@ type DataMessage_Quote_QuotedAttachment struct { func (x *DataMessage_Quote_QuotedAttachment) Reset() { *x = DataMessage_Quote_QuotedAttachment{} - mi := &file_SignalService_proto_msgTypes[48] + mi := &file_SignalService_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5981,7 +5140,7 @@ func (x *DataMessage_Quote_QuotedAttachment) String() string { func (*DataMessage_Quote_QuotedAttachment) ProtoMessage() {} func (x *DataMessage_Quote_QuotedAttachment) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[48] + mi := &file_SignalService_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6032,7 +5191,7 @@ type DataMessage_Contact_Name struct { func (x *DataMessage_Contact_Name) Reset() { *x = DataMessage_Contact_Name{} - mi := &file_SignalService_proto_msgTypes[49] + mi := &file_SignalService_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6044,7 +5203,7 @@ func (x *DataMessage_Contact_Name) String() string { func (*DataMessage_Contact_Name) ProtoMessage() {} func (x *DataMessage_Contact_Name) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[49] + mi := &file_SignalService_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6113,7 +5272,7 @@ type DataMessage_Contact_Phone struct { func (x *DataMessage_Contact_Phone) Reset() { *x = DataMessage_Contact_Phone{} - mi := &file_SignalService_proto_msgTypes[50] + mi := &file_SignalService_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6125,7 +5284,7 @@ func (x *DataMessage_Contact_Phone) String() string { func (*DataMessage_Contact_Phone) ProtoMessage() {} func (x *DataMessage_Contact_Phone) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[50] + mi := &file_SignalService_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6173,7 +5332,7 @@ type DataMessage_Contact_Email struct { func (x *DataMessage_Contact_Email) Reset() { *x = DataMessage_Contact_Email{} - mi := &file_SignalService_proto_msgTypes[51] + mi := &file_SignalService_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6185,7 +5344,7 @@ func (x *DataMessage_Contact_Email) String() string { func (*DataMessage_Contact_Email) ProtoMessage() {} func (x *DataMessage_Contact_Email) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[51] + mi := &file_SignalService_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6239,7 +5398,7 @@ type DataMessage_Contact_PostalAddress struct { func (x *DataMessage_Contact_PostalAddress) Reset() { *x = DataMessage_Contact_PostalAddress{} - mi := &file_SignalService_proto_msgTypes[52] + mi := &file_SignalService_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6251,7 +5410,7 @@ func (x *DataMessage_Contact_PostalAddress) String() string { func (*DataMessage_Contact_PostalAddress) ProtoMessage() {} func (x *DataMessage_Contact_PostalAddress) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[52] + mi := &file_SignalService_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6340,7 +5499,7 @@ type DataMessage_Contact_Avatar struct { func (x *DataMessage_Contact_Avatar) Reset() { *x = DataMessage_Contact_Avatar{} - mi := &file_SignalService_proto_msgTypes[53] + mi := &file_SignalService_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6352,7 +5511,7 @@ func (x *DataMessage_Contact_Avatar) String() string { func (*DataMessage_Contact_Avatar) ProtoMessage() {} func (x *DataMessage_Contact_Avatar) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[53] + mi := &file_SignalService_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6395,7 +5554,7 @@ type TextAttachment_Gradient struct { func (x *TextAttachment_Gradient) Reset() { *x = TextAttachment_Gradient{} - mi := &file_SignalService_proto_msgTypes[54] + mi := &file_SignalService_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6407,7 +5566,7 @@ func (x *TextAttachment_Gradient) String() string { func (*TextAttachment_Gradient) ProtoMessage() {} func (x *TextAttachment_Gradient) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[54] + mi := &file_SignalService_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6459,20 +5618,19 @@ func (x *TextAttachment_Gradient) GetPositions() []float32 { } type SyncMessage_Sent struct { - state protoimpl.MessageState `protogen:"open.v1"` - DestinationE164 *string `protobuf:"bytes,1,opt,name=destinationE164" json:"destinationE164,omitempty"` - DestinationServiceId *string `protobuf:"bytes,7,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - Message *DataMessage `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` - ExpirationStartTimestamp *uint64 `protobuf:"varint,4,opt,name=expirationStartTimestamp" json:"expirationStartTimestamp,omitempty"` - UnidentifiedStatus []*SyncMessage_Sent_UnidentifiedDeliveryStatus `protobuf:"bytes,5,rep,name=unidentifiedStatus" json:"unidentifiedStatus,omitempty"` - IsRecipientUpdate *bool `protobuf:"varint,6,opt,name=isRecipientUpdate,def=0" json:"isRecipientUpdate,omitempty"` - StoryMessage *StoryMessage `protobuf:"bytes,8,opt,name=storyMessage" json:"storyMessage,omitempty"` - StoryMessageRecipients []*SyncMessage_Sent_StoryMessageRecipient `protobuf:"bytes,9,rep,name=storyMessageRecipients" json:"storyMessageRecipients,omitempty"` - EditMessage *EditMessage `protobuf:"bytes,10,opt,name=editMessage" json:"editMessage,omitempty"` - DestinationServiceIdBinary []byte `protobuf:"bytes,12,opt,name=destinationServiceIdBinary" json:"destinationServiceIdBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + DestinationE164 *string `protobuf:"bytes,1,opt,name=destinationE164" json:"destinationE164,omitempty"` + DestinationServiceId *string `protobuf:"bytes,7,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + Message *DataMessage `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` + ExpirationStartTimestamp *uint64 `protobuf:"varint,4,opt,name=expirationStartTimestamp" json:"expirationStartTimestamp,omitempty"` + UnidentifiedStatus []*SyncMessage_Sent_UnidentifiedDeliveryStatus `protobuf:"bytes,5,rep,name=unidentifiedStatus" json:"unidentifiedStatus,omitempty"` + IsRecipientUpdate *bool `protobuf:"varint,6,opt,name=isRecipientUpdate,def=0" json:"isRecipientUpdate,omitempty"` + StoryMessage *StoryMessage `protobuf:"bytes,8,opt,name=storyMessage" json:"storyMessage,omitempty"` + StoryMessageRecipients []*SyncMessage_Sent_StoryMessageRecipient `protobuf:"bytes,9,rep,name=storyMessageRecipients" json:"storyMessageRecipients,omitempty"` + EditMessage *EditMessage `protobuf:"bytes,10,opt,name=editMessage" json:"editMessage,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } // Default values for SyncMessage_Sent fields. @@ -6482,7 +5640,7 @@ const ( func (x *SyncMessage_Sent) Reset() { *x = SyncMessage_Sent{} - mi := &file_SignalService_proto_msgTypes[55] + mi := &file_SignalService_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6494,7 +5652,7 @@ func (x *SyncMessage_Sent) String() string { func (*SyncMessage_Sent) ProtoMessage() {} func (x *SyncMessage_Sent) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[55] + mi := &file_SignalService_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6580,13 +5738,6 @@ func (x *SyncMessage_Sent) GetEditMessage() *EditMessage { return nil } -func (x *SyncMessage_Sent) GetDestinationServiceIdBinary() []byte { - if x != nil { - return x.DestinationServiceIdBinary - } - return nil -} - type SyncMessage_Contacts struct { state protoimpl.MessageState `protogen:"open.v1"` Blob *AttachmentPointer `protobuf:"bytes,1,opt,name=blob" json:"blob,omitempty"` @@ -6602,7 +5753,7 @@ const ( func (x *SyncMessage_Contacts) Reset() { *x = SyncMessage_Contacts{} - mi := &file_SignalService_proto_msgTypes[56] + mi := &file_SignalService_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6614,7 +5765,7 @@ func (x *SyncMessage_Contacts) String() string { func (*SyncMessage_Contacts) ProtoMessage() {} func (x *SyncMessage_Contacts) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[56] + mi := &file_SignalService_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6649,14 +5800,13 @@ type SyncMessage_Blocked struct { Numbers []string `protobuf:"bytes,1,rep,name=numbers" json:"numbers,omitempty"` Acis []string `protobuf:"bytes,3,rep,name=acis" json:"acis,omitempty"` GroupIds [][]byte `protobuf:"bytes,2,rep,name=groupIds" json:"groupIds,omitempty"` - AcisBinary [][]byte `protobuf:"bytes,4,rep,name=acisBinary" json:"acisBinary,omitempty"` // 16-byte UUID unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SyncMessage_Blocked) Reset() { *x = SyncMessage_Blocked{} - mi := &file_SignalService_proto_msgTypes[57] + mi := &file_SignalService_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6668,7 +5818,7 @@ func (x *SyncMessage_Blocked) String() string { func (*SyncMessage_Blocked) ProtoMessage() {} func (x *SyncMessage_Blocked) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[57] + mi := &file_SignalService_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6705,13 +5855,6 @@ func (x *SyncMessage_Blocked) GetGroupIds() [][]byte { return nil } -func (x *SyncMessage_Blocked) GetAcisBinary() [][]byte { - if x != nil { - return x.AcisBinary - } - return nil -} - type SyncMessage_Request struct { state protoimpl.MessageState `protogen:"open.v1"` Type *SyncMessage_Request_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.SyncMessage_Request_Type" json:"type,omitempty"` @@ -6721,7 +5864,7 @@ type SyncMessage_Request struct { func (x *SyncMessage_Request) Reset() { *x = SyncMessage_Request{} - mi := &file_SignalService_proto_msgTypes[58] + mi := &file_SignalService_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6733,7 +5876,7 @@ func (x *SyncMessage_Request) String() string { func (*SyncMessage_Request) ProtoMessage() {} func (x *SyncMessage_Request) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[58] + mi := &file_SignalService_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6757,17 +5900,16 @@ func (x *SyncMessage_Request) GetType() SyncMessage_Request_Type { } type SyncMessage_Read struct { - state protoimpl.MessageState `protogen:"open.v1"` - SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - SenderAciBinary []byte `protobuf:"bytes,4,opt,name=senderAciBinary" json:"senderAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncMessage_Read) Reset() { *x = SyncMessage_Read{} - mi := &file_SignalService_proto_msgTypes[59] + mi := &file_SignalService_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6779,7 +5921,7 @@ func (x *SyncMessage_Read) String() string { func (*SyncMessage_Read) ProtoMessage() {} func (x *SyncMessage_Read) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[59] + mi := &file_SignalService_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6809,25 +5951,17 @@ func (x *SyncMessage_Read) GetTimestamp() uint64 { return 0 } -func (x *SyncMessage_Read) GetSenderAciBinary() []byte { - if x != nil { - return x.SenderAciBinary - } - return nil -} - type SyncMessage_Viewed struct { - state protoimpl.MessageState `protogen:"open.v1"` - SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - SenderAciBinary []byte `protobuf:"bytes,4,opt,name=senderAciBinary" json:"senderAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncMessage_Viewed) Reset() { *x = SyncMessage_Viewed{} - mi := &file_SignalService_proto_msgTypes[60] + mi := &file_SignalService_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6839,7 +5973,7 @@ func (x *SyncMessage_Viewed) String() string { func (*SyncMessage_Viewed) ProtoMessage() {} func (x *SyncMessage_Viewed) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[60] + mi := &file_SignalService_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6869,18 +6003,12 @@ func (x *SyncMessage_Viewed) GetTimestamp() uint64 { return 0 } -func (x *SyncMessage_Viewed) GetSenderAciBinary() []byte { - if x != nil { - return x.SenderAciBinary - } - return nil -} - type SyncMessage_Configuration struct { state protoimpl.MessageState `protogen:"open.v1"` ReadReceipts *bool `protobuf:"varint,1,opt,name=readReceipts" json:"readReceipts,omitempty"` UnidentifiedDeliveryIndicators *bool `protobuf:"varint,2,opt,name=unidentifiedDeliveryIndicators" json:"unidentifiedDeliveryIndicators,omitempty"` TypingIndicators *bool `protobuf:"varint,3,opt,name=typingIndicators" json:"typingIndicators,omitempty"` + ProvisioningVersion *uint32 `protobuf:"varint,5,opt,name=provisioningVersion" json:"provisioningVersion,omitempty"` LinkPreviews *bool `protobuf:"varint,6,opt,name=linkPreviews" json:"linkPreviews,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -6888,7 +6016,7 @@ type SyncMessage_Configuration struct { func (x *SyncMessage_Configuration) Reset() { *x = SyncMessage_Configuration{} - mi := &file_SignalService_proto_msgTypes[61] + mi := &file_SignalService_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6900,7 +6028,7 @@ func (x *SyncMessage_Configuration) String() string { func (*SyncMessage_Configuration) ProtoMessage() {} func (x *SyncMessage_Configuration) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[61] + mi := &file_SignalService_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6937,6 +6065,13 @@ func (x *SyncMessage_Configuration) GetTypingIndicators() bool { return false } +func (x *SyncMessage_Configuration) GetProvisioningVersion() uint32 { + if x != nil && x.ProvisioningVersion != nil { + return *x.ProvisioningVersion + } + return 0 +} + func (x *SyncMessage_Configuration) GetLinkPreviews() bool { if x != nil && x.LinkPreviews != nil { return *x.LinkPreviews @@ -6955,7 +6090,7 @@ type SyncMessage_StickerPackOperation struct { func (x *SyncMessage_StickerPackOperation) Reset() { *x = SyncMessage_StickerPackOperation{} - mi := &file_SignalService_proto_msgTypes[62] + mi := &file_SignalService_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6967,7 +6102,7 @@ func (x *SyncMessage_StickerPackOperation) String() string { func (*SyncMessage_StickerPackOperation) ProtoMessage() {} func (x *SyncMessage_StickerPackOperation) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[62] + mi := &file_SignalService_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7005,17 +6140,16 @@ func (x *SyncMessage_StickerPackOperation) GetType() SyncMessage_StickerPackOper } type SyncMessage_ViewOnceOpen struct { - state protoimpl.MessageState `protogen:"open.v1"` - SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - SenderAciBinary []byte `protobuf:"bytes,4,opt,name=senderAciBinary" json:"senderAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncMessage_ViewOnceOpen) Reset() { *x = SyncMessage_ViewOnceOpen{} - mi := &file_SignalService_proto_msgTypes[63] + mi := &file_SignalService_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7027,7 +6161,7 @@ func (x *SyncMessage_ViewOnceOpen) String() string { func (*SyncMessage_ViewOnceOpen) ProtoMessage() {} func (x *SyncMessage_ViewOnceOpen) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[63] + mi := &file_SignalService_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7057,13 +6191,6 @@ func (x *SyncMessage_ViewOnceOpen) GetTimestamp() uint64 { return 0 } -func (x *SyncMessage_ViewOnceOpen) GetSenderAciBinary() []byte { - if x != nil { - return x.SenderAciBinary - } - return nil -} - type SyncMessage_FetchLatest struct { state protoimpl.MessageState `protogen:"open.v1"` Type *SyncMessage_FetchLatest_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.SyncMessage_FetchLatest_Type" json:"type,omitempty"` @@ -7073,7 +6200,7 @@ type SyncMessage_FetchLatest struct { func (x *SyncMessage_FetchLatest) Reset() { *x = SyncMessage_FetchLatest{} - mi := &file_SignalService_proto_msgTypes[64] + mi := &file_SignalService_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7085,7 +6212,7 @@ func (x *SyncMessage_FetchLatest) String() string { func (*SyncMessage_FetchLatest) ProtoMessage() {} func (x *SyncMessage_FetchLatest) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[64] + mi := &file_SignalService_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7110,6 +6237,7 @@ func (x *SyncMessage_FetchLatest) GetType() SyncMessage_FetchLatest_Type { type SyncMessage_Keys struct { state protoimpl.MessageState `protogen:"open.v1"` + Master []byte `protobuf:"bytes,2,opt,name=master" json:"master,omitempty"` // deprecated: this field will be removed in a future release. AccountEntropyPool *string `protobuf:"bytes,3,opt,name=accountEntropyPool" json:"accountEntropyPool,omitempty"` MediaRootBackupKey []byte `protobuf:"bytes,4,opt,name=mediaRootBackupKey" json:"mediaRootBackupKey,omitempty"` unknownFields protoimpl.UnknownFields @@ -7118,7 +6246,7 @@ type SyncMessage_Keys struct { func (x *SyncMessage_Keys) Reset() { *x = SyncMessage_Keys{} - mi := &file_SignalService_proto_msgTypes[65] + mi := &file_SignalService_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7130,7 +6258,7 @@ func (x *SyncMessage_Keys) String() string { func (*SyncMessage_Keys) ProtoMessage() {} func (x *SyncMessage_Keys) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[65] + mi := &file_SignalService_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7146,6 +6274,13 @@ func (*SyncMessage_Keys) Descriptor() ([]byte, []int) { return file_SignalService_proto_rawDescGZIP(), []int{11, 10} } +func (x *SyncMessage_Keys) GetMaster() []byte { + if x != nil { + return x.Master + } + return nil +} + func (x *SyncMessage_Keys) GetAccountEntropyPool() string { if x != nil && x.AccountEntropyPool != nil { return *x.AccountEntropyPool @@ -7170,7 +6305,7 @@ type SyncMessage_PniIdentity struct { func (x *SyncMessage_PniIdentity) Reset() { *x = SyncMessage_PniIdentity{} - mi := &file_SignalService_proto_msgTypes[66] + mi := &file_SignalService_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7182,7 +6317,7 @@ func (x *SyncMessage_PniIdentity) String() string { func (*SyncMessage_PniIdentity) ProtoMessage() {} func (x *SyncMessage_PniIdentity) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[66] + mi := &file_SignalService_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7213,18 +6348,17 @@ func (x *SyncMessage_PniIdentity) GetPrivateKey() []byte { } type SyncMessage_MessageRequestResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - ThreadAci *string `protobuf:"bytes,2,opt,name=threadAci" json:"threadAci,omitempty"` - GroupId []byte `protobuf:"bytes,3,opt,name=groupId" json:"groupId,omitempty"` - Type *SyncMessage_MessageRequestResponse_Type `protobuf:"varint,4,opt,name=type,enum=signalservice.SyncMessage_MessageRequestResponse_Type" json:"type,omitempty"` - ThreadAciBinary []byte `protobuf:"bytes,5,opt,name=threadAciBinary" json:"threadAciBinary,omitempty"` // 16-byte UUID - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ThreadAci *string `protobuf:"bytes,2,opt,name=threadAci" json:"threadAci,omitempty"` + GroupId []byte `protobuf:"bytes,3,opt,name=groupId" json:"groupId,omitempty"` + Type *SyncMessage_MessageRequestResponse_Type `protobuf:"varint,4,opt,name=type,enum=signalservice.SyncMessage_MessageRequestResponse_Type" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncMessage_MessageRequestResponse) Reset() { *x = SyncMessage_MessageRequestResponse{} - mi := &file_SignalService_proto_msgTypes[67] + mi := &file_SignalService_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7236,7 +6370,7 @@ func (x *SyncMessage_MessageRequestResponse) String() string { func (*SyncMessage_MessageRequestResponse) ProtoMessage() {} func (x *SyncMessage_MessageRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[67] + mi := &file_SignalService_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7273,13 +6407,6 @@ func (x *SyncMessage_MessageRequestResponse) GetType() SyncMessage_MessageReques return SyncMessage_MessageRequestResponse_UNKNOWN } -func (x *SyncMessage_MessageRequestResponse) GetThreadAciBinary() []byte { - if x != nil { - return x.ThreadAciBinary - } - return nil -} - type SyncMessage_OutgoingPayment struct { state protoimpl.MessageState `protogen:"open.v1"` RecipientServiceId *string `protobuf:"bytes,1,opt,name=recipientServiceId" json:"recipientServiceId,omitempty"` @@ -7294,7 +6421,7 @@ type SyncMessage_OutgoingPayment struct { func (x *SyncMessage_OutgoingPayment) Reset() { *x = SyncMessage_OutgoingPayment{} - mi := &file_SignalService_proto_msgTypes[68] + mi := &file_SignalService_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7306,7 +6433,7 @@ func (x *SyncMessage_OutgoingPayment) String() string { func (*SyncMessage_OutgoingPayment) ProtoMessage() {} func (x *SyncMessage_OutgoingPayment) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[68] + mi := &file_SignalService_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7376,7 +6503,7 @@ type SyncMessage_PniChangeNumber struct { func (x *SyncMessage_PniChangeNumber) Reset() { *x = SyncMessage_PniChangeNumber{} - mi := &file_SignalService_proto_msgTypes[69] + mi := &file_SignalService_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7388,7 +6515,7 @@ func (x *SyncMessage_PniChangeNumber) String() string { func (*SyncMessage_PniChangeNumber) ProtoMessage() {} func (x *SyncMessage_PniChangeNumber) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[69] + mi := &file_SignalService_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7458,7 +6585,7 @@ type SyncMessage_CallEvent struct { func (x *SyncMessage_CallEvent) Reset() { *x = SyncMessage_CallEvent{} - mi := &file_SignalService_proto_msgTypes[70] + mi := &file_SignalService_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7470,7 +6597,7 @@ func (x *SyncMessage_CallEvent) String() string { func (*SyncMessage_CallEvent) ProtoMessage() {} func (x *SyncMessage_CallEvent) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[70] + mi := &file_SignalService_proto_msgTypes[64] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7533,13 +6660,14 @@ type SyncMessage_CallLinkUpdate struct { RootKey []byte `protobuf:"bytes,1,opt,name=rootKey" json:"rootKey,omitempty"` AdminPasskey []byte `protobuf:"bytes,2,opt,name=adminPasskey" json:"adminPasskey,omitempty"` Type *SyncMessage_CallLinkUpdate_Type `protobuf:"varint,3,opt,name=type,enum=signalservice.SyncMessage_CallLinkUpdate_Type" json:"type,omitempty"` // defaults to UPDATE + Epoch []byte `protobuf:"bytes,4,opt,name=epoch" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SyncMessage_CallLinkUpdate) Reset() { *x = SyncMessage_CallLinkUpdate{} - mi := &file_SignalService_proto_msgTypes[71] + mi := &file_SignalService_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7551,7 +6679,7 @@ func (x *SyncMessage_CallLinkUpdate) String() string { func (*SyncMessage_CallLinkUpdate) ProtoMessage() {} func (x *SyncMessage_CallLinkUpdate) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[71] + mi := &file_SignalService_proto_msgTypes[65] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7588,6 +6716,13 @@ func (x *SyncMessage_CallLinkUpdate) GetType() SyncMessage_CallLinkUpdate_Type { return SyncMessage_CallLinkUpdate_UPDATE } +func (x *SyncMessage_CallLinkUpdate) GetEpoch() []byte { + if x != nil { + return x.Epoch + } + return nil +} + type SyncMessage_CallLogEvent struct { state protoimpl.MessageState `protogen:"open.v1"` Type *SyncMessage_CallLogEvent_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.SyncMessage_CallLogEvent_Type" json:"type,omitempty"` @@ -7605,7 +6740,7 @@ type SyncMessage_CallLogEvent struct { func (x *SyncMessage_CallLogEvent) Reset() { *x = SyncMessage_CallLogEvent{} - mi := &file_SignalService_proto_msgTypes[72] + mi := &file_SignalService_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7617,7 +6752,7 @@ func (x *SyncMessage_CallLogEvent) String() string { func (*SyncMessage_CallLogEvent) ProtoMessage() {} func (x *SyncMessage_CallLogEvent) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[72] + mi := &file_SignalService_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7673,7 +6808,7 @@ type SyncMessage_DeleteForMe struct { func (x *SyncMessage_DeleteForMe) Reset() { *x = SyncMessage_DeleteForMe{} - mi := &file_SignalService_proto_msgTypes[73] + mi := &file_SignalService_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7685,7 +6820,7 @@ func (x *SyncMessage_DeleteForMe) String() string { func (*SyncMessage_DeleteForMe) ProtoMessage() {} func (x *SyncMessage_DeleteForMe) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[73] + mi := &file_SignalService_proto_msgTypes[67] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7738,7 +6873,7 @@ type SyncMessage_DeviceNameChange struct { func (x *SyncMessage_DeviceNameChange) Reset() { *x = SyncMessage_DeviceNameChange{} - mi := &file_SignalService_proto_msgTypes[74] + mi := &file_SignalService_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7750,7 +6885,7 @@ func (x *SyncMessage_DeviceNameChange) String() string { func (*SyncMessage_DeviceNameChange) ProtoMessage() {} func (x *SyncMessage_DeviceNameChange) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[74] + mi := &file_SignalService_proto_msgTypes[68] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7783,7 +6918,7 @@ type SyncMessage_AttachmentBackfillRequest struct { func (x *SyncMessage_AttachmentBackfillRequest) Reset() { *x = SyncMessage_AttachmentBackfillRequest{} - mi := &file_SignalService_proto_msgTypes[75] + mi := &file_SignalService_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7795,7 +6930,7 @@ func (x *SyncMessage_AttachmentBackfillRequest) String() string { func (*SyncMessage_AttachmentBackfillRequest) ProtoMessage() {} func (x *SyncMessage_AttachmentBackfillRequest) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[75] + mi := &file_SignalService_proto_msgTypes[69] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7840,7 +6975,7 @@ type SyncMessage_AttachmentBackfillResponse struct { func (x *SyncMessage_AttachmentBackfillResponse) Reset() { *x = SyncMessage_AttachmentBackfillResponse{} - mi := &file_SignalService_proto_msgTypes[76] + mi := &file_SignalService_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7852,7 +6987,7 @@ func (x *SyncMessage_AttachmentBackfillResponse) String() string { func (*SyncMessage_AttachmentBackfillResponse) ProtoMessage() {} func (x *SyncMessage_AttachmentBackfillResponse) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[76] + mi := &file_SignalService_proto_msgTypes[70] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7926,18 +7061,17 @@ func (*SyncMessage_AttachmentBackfillResponse_Error_) isSyncMessage_AttachmentBa } type SyncMessage_Sent_UnidentifiedDeliveryStatus struct { - state protoimpl.MessageState `protogen:"open.v1"` - DestinationServiceId *string `protobuf:"bytes,3,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` - Unidentified *bool `protobuf:"varint,2,opt,name=unidentified" json:"unidentified,omitempty"` - DestinationPniIdentityKey []byte `protobuf:"bytes,5,opt,name=destinationPniIdentityKey" json:"destinationPniIdentityKey,omitempty"` // Only set for PNI destinations - DestinationServiceIdBinary []byte `protobuf:"bytes,6,opt,name=destinationServiceIdBinary" json:"destinationServiceIdBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + DestinationServiceId *string `protobuf:"bytes,3,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` + Unidentified *bool `protobuf:"varint,2,opt,name=unidentified" json:"unidentified,omitempty"` + DestinationPniIdentityKey []byte `protobuf:"bytes,5,opt,name=destinationPniIdentityKey" json:"destinationPniIdentityKey,omitempty"` // Only set for PNI destinations + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) Reset() { *x = SyncMessage_Sent_UnidentifiedDeliveryStatus{} - mi := &file_SignalService_proto_msgTypes[77] + mi := &file_SignalService_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7949,7 +7083,7 @@ func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) String() string { func (*SyncMessage_Sent_UnidentifiedDeliveryStatus) ProtoMessage() {} func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[77] + mi := &file_SignalService_proto_msgTypes[71] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7986,26 +7120,18 @@ func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) GetDestinationPniIdentityK return nil } -func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) GetDestinationServiceIdBinary() []byte { - if x != nil { - return x.DestinationServiceIdBinary - } - return nil -} - type SyncMessage_Sent_StoryMessageRecipient struct { - state protoimpl.MessageState `protogen:"open.v1"` - DestinationServiceId *string `protobuf:"bytes,1,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` - DistributionListIds []string `protobuf:"bytes,2,rep,name=distributionListIds" json:"distributionListIds,omitempty"` - IsAllowedToReply *bool `protobuf:"varint,3,opt,name=isAllowedToReply" json:"isAllowedToReply,omitempty"` - DestinationServiceIdBinary []byte `protobuf:"bytes,5,opt,name=destinationServiceIdBinary" json:"destinationServiceIdBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + DestinationServiceId *string `protobuf:"bytes,1,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` + DistributionListIds []string `protobuf:"bytes,2,rep,name=distributionListIds" json:"distributionListIds,omitempty"` + IsAllowedToReply *bool `protobuf:"varint,3,opt,name=isAllowedToReply" json:"isAllowedToReply,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *SyncMessage_Sent_StoryMessageRecipient) Reset() { *x = SyncMessage_Sent_StoryMessageRecipient{} - mi := &file_SignalService_proto_msgTypes[78] + mi := &file_SignalService_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8017,7 +7143,7 @@ func (x *SyncMessage_Sent_StoryMessageRecipient) String() string { func (*SyncMessage_Sent_StoryMessageRecipient) ProtoMessage() {} func (x *SyncMessage_Sent_StoryMessageRecipient) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[78] + mi := &file_SignalService_proto_msgTypes[72] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8054,13 +7180,6 @@ func (x *SyncMessage_Sent_StoryMessageRecipient) GetIsAllowedToReply() bool { return false } -func (x *SyncMessage_Sent_StoryMessageRecipient) GetDestinationServiceIdBinary() []byte { - if x != nil { - return x.DestinationServiceIdBinary - } - return nil -} - type SyncMessage_OutgoingPayment_MobileCoin struct { state protoimpl.MessageState `protogen:"open.v1"` RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipientAddress" json:"recipientAddress,omitempty"` @@ -8077,7 +7196,7 @@ type SyncMessage_OutgoingPayment_MobileCoin struct { func (x *SyncMessage_OutgoingPayment_MobileCoin) Reset() { *x = SyncMessage_OutgoingPayment_MobileCoin{} - mi := &file_SignalService_proto_msgTypes[79] + mi := &file_SignalService_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8089,7 +7208,7 @@ func (x *SyncMessage_OutgoingPayment_MobileCoin) String() string { func (*SyncMessage_OutgoingPayment_MobileCoin) ProtoMessage() {} func (x *SyncMessage_OutgoingPayment_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[79] + mi := &file_SignalService_proto_msgTypes[73] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8171,7 +7290,7 @@ type SyncMessage_DeleteForMe_MessageDeletes struct { func (x *SyncMessage_DeleteForMe_MessageDeletes) Reset() { *x = SyncMessage_DeleteForMe_MessageDeletes{} - mi := &file_SignalService_proto_msgTypes[80] + mi := &file_SignalService_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8183,7 +7302,7 @@ func (x *SyncMessage_DeleteForMe_MessageDeletes) String() string { func (*SyncMessage_DeleteForMe_MessageDeletes) ProtoMessage() {} func (x *SyncMessage_DeleteForMe_MessageDeletes) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[80] + mi := &file_SignalService_proto_msgTypes[74] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8229,7 +7348,7 @@ type SyncMessage_DeleteForMe_AttachmentDelete struct { func (x *SyncMessage_DeleteForMe_AttachmentDelete) Reset() { *x = SyncMessage_DeleteForMe_AttachmentDelete{} - mi := &file_SignalService_proto_msgTypes[81] + mi := &file_SignalService_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8241,7 +7360,7 @@ func (x *SyncMessage_DeleteForMe_AttachmentDelete) String() string { func (*SyncMessage_DeleteForMe_AttachmentDelete) ProtoMessage() {} func (x *SyncMessage_DeleteForMe_AttachmentDelete) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[81] + mi := &file_SignalService_proto_msgTypes[75] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8304,7 +7423,7 @@ type SyncMessage_DeleteForMe_ConversationDelete struct { func (x *SyncMessage_DeleteForMe_ConversationDelete) Reset() { *x = SyncMessage_DeleteForMe_ConversationDelete{} - mi := &file_SignalService_proto_msgTypes[82] + mi := &file_SignalService_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8316,7 +7435,7 @@ func (x *SyncMessage_DeleteForMe_ConversationDelete) String() string { func (*SyncMessage_DeleteForMe_ConversationDelete) ProtoMessage() {} func (x *SyncMessage_DeleteForMe_ConversationDelete) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[82] + mi := &file_SignalService_proto_msgTypes[76] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8369,7 +7488,7 @@ type SyncMessage_DeleteForMe_LocalOnlyConversationDelete struct { func (x *SyncMessage_DeleteForMe_LocalOnlyConversationDelete) Reset() { *x = SyncMessage_DeleteForMe_LocalOnlyConversationDelete{} - mi := &file_SignalService_proto_msgTypes[83] + mi := &file_SignalService_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8381,7 +7500,7 @@ func (x *SyncMessage_DeleteForMe_LocalOnlyConversationDelete) String() string { func (*SyncMessage_DeleteForMe_LocalOnlyConversationDelete) ProtoMessage() {} func (x *SyncMessage_DeleteForMe_LocalOnlyConversationDelete) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[83] + mi := &file_SignalService_proto_msgTypes[77] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8417,7 +7536,7 @@ type SyncMessage_AttachmentBackfillResponse_AttachmentData struct { func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) Reset() { *x = SyncMessage_AttachmentBackfillResponse_AttachmentData{} - mi := &file_SignalService_proto_msgTypes[84] + mi := &file_SignalService_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8429,7 +7548,7 @@ func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) String() string func (*SyncMessage_AttachmentBackfillResponse_AttachmentData) ProtoMessage() {} func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[84] + mi := &file_SignalService_proto_msgTypes[78] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8498,7 +7617,7 @@ type SyncMessage_AttachmentBackfillResponse_AttachmentDataList struct { func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) Reset() { *x = SyncMessage_AttachmentBackfillResponse_AttachmentDataList{} - mi := &file_SignalService_proto_msgTypes[85] + mi := &file_SignalService_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8510,7 +7629,7 @@ func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) String() str func (*SyncMessage_AttachmentBackfillResponse_AttachmentDataList) ProtoMessage() {} func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[85] + mi := &file_SignalService_proto_msgTypes[79] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8550,7 +7669,7 @@ type ContactDetails_Avatar struct { func (x *ContactDetails_Avatar) Reset() { *x = ContactDetails_Avatar{} - mi := &file_SignalService_proto_msgTypes[86] + mi := &file_SignalService_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8562,7 +7681,7 @@ func (x *ContactDetails_Avatar) String() string { func (*ContactDetails_Avatar) ProtoMessage() {} func (x *ContactDetails_Avatar) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[86] + mi := &file_SignalService_proto_msgTypes[80] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8602,7 +7721,7 @@ type PaymentAddress_MobileCoin struct { func (x *PaymentAddress_MobileCoin) Reset() { *x = PaymentAddress_MobileCoin{} - mi := &file_SignalService_proto_msgTypes[87] + mi := &file_SignalService_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8614,7 +7733,7 @@ func (x *PaymentAddress_MobileCoin) String() string { func (*PaymentAddress_MobileCoin) ProtoMessage() {} func (x *PaymentAddress_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_SignalService_proto_msgTypes[87] + mi := &file_SignalService_proto_msgTypes[81] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8648,13 +7767,13 @@ var File_SignalService_proto protoreflect.FileDescriptor const file_SignalService_proto_rawDesc = "" + "\n" + - "\x13SignalService.proto\x12\rsignalservice\"\x8c\a\n" + + "\x13SignalService.proto\x12\rsignalservice\"\xa7\x05\n" + "\bEnvelope\x120\n" + "\x04type\x18\x01 \x01(\x0e2\x1c.signalservice.Envelope.TypeR\x04type\x12(\n" + - "\x0fsourceServiceId\x18\v \x01(\tR\x0fsourceServiceId\x12&\n" + - "\x0esourceDeviceId\x18\a \x01(\rR\x0esourceDeviceId\x122\n" + - "\x14destinationServiceId\x18\r \x01(\tR\x14destinationServiceId\x12(\n" + - "\x0fclientTimestamp\x18\x05 \x01(\x04R\x0fclientTimestamp\x12\x18\n" + + "\x0fsourceServiceId\x18\v \x01(\tR\x0fsourceServiceId\x12\"\n" + + "\fsourceDevice\x18\a \x01(\rR\fsourceDevice\x122\n" + + "\x14destinationServiceId\x18\r \x01(\tR\x14destinationServiceId\x12\x1c\n" + + "\ttimestamp\x18\x05 \x01(\x04R\ttimestamp\x12\x18\n" + "\acontent\x18\b \x01(\fR\acontent\x12\x1e\n" + "\n" + "serverGuid\x18\t \x01(\tR\n" + @@ -8667,32 +7786,29 @@ const file_SignalService_proto_rawDesc = "" + "updatedPni\x18\x0f \x01(\tR\n" + "updatedPni\x12\x14\n" + "\x05story\x18\x10 \x01(\bR\x05story\x12*\n" + - "\x11report_spam_token\x18\x11 \x01(\fR\x0freportSpamToken\x124\n" + - "\x15sourceServiceIdBinary\x18\x13 \x01(\fR\x15sourceServiceIdBinary\x12>\n" + - "\x1adestinationServiceIdBinary\x18\x14 \x01(\fR\x1adestinationServiceIdBinary\x12*\n" + - "\x10serverGuidBinary\x18\x15 \x01(\fR\x10serverGuidBinary\x12*\n" + - "\x10updatedPniBinary\x18\x16 \x01(\fR\x10updatedPniBinary\"\xb5\x01\n" + + "\x11report_spam_token\x18\x11 \x01(\fR\x0freportSpamToken\"\xae\x01\n" + "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\x12\n" + - "\x0eDOUBLE_RATCHET\x10\x01\x12\x12\n" + - "\x0ePREKEY_MESSAGE\x10\x03\x12\x1b\n" + + "\aUNKNOWN\x10\x00\x12\x0e\n" + + "\n" + + "CIPHERTEXT\x10\x01\x12\x11\n" + + "\rPREKEY_BUNDLE\x10\x03\x12\x1b\n" + "\x17SERVER_DELIVERY_RECEIPT\x10\x05\x12\x17\n" + "\x13UNIDENTIFIED_SENDER\x10\x06\x12\x15\n" + - "\x11PLAINTEXT_CONTENT\x10\b\"\x04\b\x02\x10\x02\"\x04\b\a\x10\a*\fKEY_EXCHANGE*\x11SENDERKEY_MESSAGEJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\x06\x10\aJ\x04\b\x12\x10\x13\"\xfa\x05\n" + - "\aContent\x12>\n" + - "\vdataMessage\x18\x01 \x01(\v2\x1a.signalservice.DataMessageH\x00R\vdataMessage\x12>\n" + - "\vsyncMessage\x18\x02 \x01(\v2\x1a.signalservice.SyncMessageH\x00R\vsyncMessage\x12>\n" + - "\vcallMessage\x18\x03 \x01(\v2\x1a.signalservice.CallMessageH\x00R\vcallMessage\x12>\n" + - "\vnullMessage\x18\x04 \x01(\v2\x1a.signalservice.NullMessageH\x00R\vnullMessage\x12G\n" + - "\x0ereceiptMessage\x18\x05 \x01(\v2\x1d.signalservice.ReceiptMessageH\x00R\x0ereceiptMessage\x12D\n" + - "\rtypingMessage\x18\x06 \x01(\v2\x1c.signalservice.TypingMessageH\x00R\rtypingMessage\x128\n" + - "\x16decryptionErrorMessage\x18\b \x01(\fH\x00R\x16decryptionErrorMessage\x12A\n" + - "\fstoryMessage\x18\t \x01(\v2\x1b.signalservice.StoryMessageH\x00R\fstoryMessage\x12>\n" + - "\veditMessage\x18\v \x01(\v2\x1a.signalservice.EditMessageH\x00R\veditMessage\x12B\n" + - "\x1csenderKeyDistributionMessage\x18\a \x01(\fR\x1csenderKeyDistributionMessage\x12T\n" + + "\x11SENDERKEY_MESSAGE\x10\a\x12\x15\n" + + "\x11PLAINTEXT_CONTENT\x10\b\"\x04\b\x02\x10\x02*\fKEY_EXCHANGEJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\x06\x10\aJ\x04\b\x12\x10\x13\"\xdd\x05\n" + + "\aContent\x12<\n" + + "\vdataMessage\x18\x01 \x01(\v2\x1a.signalservice.DataMessageR\vdataMessage\x12<\n" + + "\vsyncMessage\x18\x02 \x01(\v2\x1a.signalservice.SyncMessageR\vsyncMessage\x12<\n" + + "\vcallMessage\x18\x03 \x01(\v2\x1a.signalservice.CallMessageR\vcallMessage\x12<\n" + + "\vnullMessage\x18\x04 \x01(\v2\x1a.signalservice.NullMessageR\vnullMessage\x12E\n" + + "\x0ereceiptMessage\x18\x05 \x01(\v2\x1d.signalservice.ReceiptMessageR\x0ereceiptMessage\x12B\n" + + "\rtypingMessage\x18\x06 \x01(\v2\x1c.signalservice.TypingMessageR\rtypingMessage\x12B\n" + + "\x1csenderKeyDistributionMessage\x18\a \x01(\fR\x1csenderKeyDistributionMessage\x126\n" + + "\x16decryptionErrorMessage\x18\b \x01(\fR\x16decryptionErrorMessage\x12?\n" + + "\fstoryMessage\x18\t \x01(\v2\x1b.signalservice.StoryMessageR\fstoryMessage\x12T\n" + "\x13pniSignatureMessage\x18\n" + - " \x01(\v2\".signalservice.PniSignatureMessageR\x13pniSignatureMessageB\t\n" + - "\acontent\"\xf2\b\n" + + " \x01(\v2\".signalservice.PniSignatureMessageR\x13pniSignatureMessage\x12<\n" + + "\veditMessage\x18\v \x01(\v2\x1a.signalservice.EditMessageR\veditMessage\"\xf2\b\n" + "\vCallMessage\x126\n" + "\x05offer\x18\x01 \x01(\v2 .signalservice.CallMessage.OfferR\x05offer\x129\n" + "\x06answer\x18\x02 \x01(\v2!.signalservice.CallMessage.AnswerR\x06answer\x12B\n" + @@ -8732,7 +7848,7 @@ const file_SignalService_proto_rawDesc = "" + "\aurgency\x18\x02 \x01(\x0e2).signalservice.CallMessage.Opaque.UrgencyR\aurgency\"0\n" + "\aUrgency\x12\r\n" + "\tDROPPABLE\x10\x00\x12\x16\n" + - "\x12HANDLE_IMMEDIATELY\x10\x01J\x04\b\x04\x10\x05J\x04\b\x06\x10\aJ\x04\b\b\x10\t\"\x8b.\n" + + "\x12HANDLE_IMMEDIATELY\x10\x01J\x04\b\x04\x10\x05J\x04\b\x06\x10\aJ\x04\b\b\x10\t\"\xf7\"\n" + "\vDataMessage\x12\x12\n" + "\x04body\x18\x01 \x01(\tR\x04body\x12B\n" + "\vattachments\x18\x02 \x03(\v2 .signalservice.AttachmentPointerR\vattachments\x127\n" + @@ -8761,17 +7877,7 @@ const file_SignalService_proto_rawDesc = "" + "\x0fgroupCallUpdate\x18\x13 \x01(\v2*.signalservice.DataMessage.GroupCallUpdateR\x0fgroupCallUpdate\x12<\n" + "\apayment\x18\x14 \x01(\v2\".signalservice.DataMessage.PaymentR\apayment\x12K\n" + "\fstoryContext\x18\x15 \x01(\v2'.signalservice.DataMessage.StoryContextR\fstoryContext\x12B\n" + - "\tgiftBadge\x18\x16 \x01(\v2$.signalservice.DataMessage.GiftBadgeR\tgiftBadge\x12E\n" + - "\n" + - "pollCreate\x18\x18 \x01(\v2%.signalservice.DataMessage.PollCreateR\n" + - "pollCreate\x12N\n" + - "\rpollTerminate\x18\x19 \x01(\v2(.signalservice.DataMessage.PollTerminateR\rpollTerminate\x12?\n" + - "\bpollVote\x18\x1a \x01(\v2#.signalservice.DataMessage.PollVoteR\bpollVote\x12E\n" + - "\n" + - "pinMessage\x18\x1b \x01(\v2%.signalservice.DataMessage.PinMessageR\n" + - "pinMessage\x12K\n" + - "\funpinMessage\x18\x1c \x01(\v2'.signalservice.DataMessage.UnpinMessageR\funpinMessage\x12H\n" + - "\vadminDelete\x18\x1d \x01(\v2&.signalservice.DataMessage.AdminDeleteR\vadminDelete\x1a\x9a\x05\n" + + "\tgiftBadge\x18\x16 \x01(\v2$.signalservice.DataMessage.GiftBadgeR\tgiftBadge\x1a\x9a\x05\n" + "\aPayment\x12U\n" + "\fnotification\x18\x01 \x01(\v2/.signalservice.DataMessage.Payment.NotificationH\x00R\fnotification\x12O\n" + "\n" + @@ -8800,7 +7906,7 @@ const file_SignalService_proto_rawDesc = "" + "\x04Type\x12\v\n" + "\aREQUEST\x10\x00\x12\r\n" + "\tACTIVATED\x10\x01B\x06\n" + - "\x04ItemJ\x06\b\xea\a\x10\xeb\aJ\x06\b\xeb\a\x10\xec\a\x1a\x84\x04\n" + + "\x04ItemJ\x06\b\xea\a\x10\xeb\aJ\x06\b\xeb\a\x10\xec\a\x1a\xd0\x03\n" + "\x05Quote\x12\x0e\n" + "\x02id\x18\x01 \x01(\x04R\x02id\x12\x1c\n" + "\tauthorAci\x18\x05 \x01(\tR\tauthorAci\x12\x12\n" + @@ -8809,18 +7915,16 @@ const file_SignalService_proto_rawDesc = "" + "\n" + "bodyRanges\x18\x06 \x03(\v2\x18.signalservice.BodyRangeR\n" + "bodyRanges\x129\n" + - "\x04type\x18\a \x01(\x0e2%.signalservice.DataMessage.Quote.TypeR\x04type\x12(\n" + - "\x0fauthorAciBinary\x18\b \x01(\fR\x0fauthorAciBinary\x1a\x90\x01\n" + + "\x04type\x18\a \x01(\x0e2%.signalservice.DataMessage.Quote.TypeR\x04type\x1a\x90\x01\n" + "\x10QuotedAttachment\x12 \n" + "\vcontentType\x18\x01 \x01(\tR\vcontentType\x12\x1a\n" + "\bfileName\x18\x02 \x01(\tR\bfileName\x12>\n" + - "\tthumbnail\x18\x03 \x01(\v2 .signalservice.AttachmentPointerR\tthumbnail\",\n" + + "\tthumbnail\x18\x03 \x01(\v2 .signalservice.AttachmentPointerR\tthumbnail\"\"\n" + "\x04Type\x12\n" + "\n" + "\x06NORMAL\x10\x00\x12\x0e\n" + "\n" + - "GIFT_BADGE\x10\x01\x12\b\n" + - "\x04POLL\x10\x02J\x04\b\x02\x10\x03\x1a\xbf\n" + + "GIFT_BADGE\x10\x01J\x04\b\x02\x10\x03\x1a\xbf\n" + "\n" + "\aContact\x12;\n" + "\x04name\x18\x01 \x01(\v2'.signalservice.DataMessage.Contact.NameR\x04name\x12@\n" + @@ -8885,53 +7989,26 @@ const file_SignalService_proto_rawDesc = "" + "\apackKey\x18\x02 \x01(\fR\apackKey\x12\x1c\n" + "\tstickerId\x18\x03 \x01(\rR\tstickerId\x124\n" + "\x04data\x18\x04 \x01(\v2 .signalservice.AttachmentPointerR\x04data\x12\x14\n" + - "\x05emoji\x18\x05 \x01(\tR\x05emoji\x1a\xd0\x01\n" + + "\x05emoji\x18\x05 \x01(\tR\x05emoji\x1a\x9a\x01\n" + "\bReaction\x12\x14\n" + "\x05emoji\x18\x01 \x01(\tR\x05emoji\x12\x16\n" + "\x06remove\x18\x02 \x01(\bR\x06remove\x12(\n" + "\x0ftargetAuthorAci\x18\x04 \x01(\tR\x0ftargetAuthorAci\x120\n" + - "\x13targetSentTimestamp\x18\x05 \x01(\x04R\x13targetSentTimestamp\x124\n" + - "\x15targetAuthorAciBinary\x18\x06 \x01(\fR\x15targetAuthorAciBinaryJ\x04\b\x03\x10\x04\x1a:\n" + + "\x13targetSentTimestamp\x18\x05 \x01(\x04R\x13targetSentTimestampJ\x04\b\x03\x10\x04\x1a:\n" + "\x06Delete\x120\n" + "\x13targetSentTimestamp\x18\x01 \x01(\x04R\x13targetSentTimestamp\x1a'\n" + "\x0fGroupCallUpdate\x12\x14\n" + - "\x05eraId\x18\x01 \x01(\tR\x05eraId\x1a|\n" + + "\x05eraId\x18\x01 \x01(\tR\x05eraId\x1aR\n" + "\fStoryContext\x12\x1c\n" + "\tauthorAci\x18\x01 \x01(\tR\tauthorAci\x12$\n" + - "\rsentTimestamp\x18\x02 \x01(\x04R\rsentTimestamp\x12(\n" + - "\x0fauthorAciBinary\x18\x03 \x01(\fR\x0fauthorAciBinary\x1aQ\n" + + "\rsentTimestamp\x18\x02 \x01(\x04R\rsentTimestamp\x1aQ\n" + "\tGiftBadge\x12D\n" + - "\x1dreceiptCredentialPresentation\x18\x01 \x01(\fR\x1dreceiptCredentialPresentation\x1ah\n" + - "\n" + - "PollCreate\x12\x1a\n" + - "\bquestion\x18\x01 \x01(\tR\bquestion\x12$\n" + - "\rallowMultiple\x18\x02 \x01(\bR\rallowMultiple\x12\x18\n" + - "\aoptions\x18\x03 \x03(\tR\aoptions\x1aA\n" + - "\rPollTerminate\x120\n" + - "\x13targetSentTimestamp\x18\x01 \x01(\x04R\x13targetSentTimestamp\x1a\xb6\x01\n" + - "\bPollVote\x124\n" + - "\x15targetAuthorAciBinary\x18\x01 \x01(\fR\x15targetAuthorAciBinary\x120\n" + - "\x13targetSentTimestamp\x18\x02 \x01(\x04R\x13targetSentTimestamp\x12$\n" + - "\roptionIndexes\x18\x03 \x03(\rR\roptionIndexes\x12\x1c\n" + - "\tvoteCount\x18\x04 \x01(\rR\tvoteCount\x1a\xe7\x01\n" + - "\n" + - "PinMessage\x124\n" + - "\x15targetAuthorAciBinary\x18\x01 \x01(\fR\x15targetAuthorAciBinary\x120\n" + - "\x13targetSentTimestamp\x18\x02 \x01(\x04R\x13targetSentTimestamp\x120\n" + - "\x12pinDurationSeconds\x18\x03 \x01(\rH\x00R\x12pinDurationSeconds\x120\n" + - "\x12pinDurationForever\x18\x04 \x01(\bH\x00R\x12pinDurationForeverB\r\n" + - "\vpinDuration\x1av\n" + - "\fUnpinMessage\x124\n" + - "\x15targetAuthorAciBinary\x18\x01 \x01(\fR\x15targetAuthorAciBinary\x120\n" + - "\x13targetSentTimestamp\x18\x02 \x01(\x04R\x13targetSentTimestamp\x1au\n" + - "\vAdminDelete\x124\n" + - "\x15targetAuthorAciBinary\x18\x01 \x01(\fR\x15targetAuthorAciBinary\x120\n" + - "\x13targetSentTimestamp\x18\x02 \x01(\x04R\x13targetSentTimestamp\"Z\n" + + "\x1dreceiptCredentialPresentation\x18\x01 \x01(\fR\x1dreceiptCredentialPresentation\"Z\n" + "\x05Flags\x12\x0f\n" + "\vEND_SESSION\x10\x01\x12\x1b\n" + "\x17EXPIRATION_TIMER_UPDATE\x10\x02\x12\x16\n" + "\x12PROFILE_KEY_UPDATE\x10\x04\x12\v\n" + - "\aFORWARD\x10\b\"\xbb\x01\n" + + "\aFORWARD\x10\b\"\xb0\x01\n" + "\x0fProtocolVersion\x12\v\n" + "\aINITIAL\x10\x00\x12\x12\n" + "\x0eMESSAGE_TIMERS\x10\x01\x12\r\n" + @@ -8940,9 +8017,8 @@ const file_SignalService_proto_rawDesc = "" + "\tREACTIONS\x10\x04\x12\x1c\n" + "\x18CDN_SELECTOR_ATTACHMENTS\x10\x05\x12\f\n" + "\bMENTIONS\x10\x06\x12\f\n" + - "\bPAYMENTS\x10\a\x12\t\n" + - "\x05POLLS\x10\b\x12\v\n" + - "\aCURRENT\x10\b\x1a\x02\x10\x01J\x04\b\x03\x10\x04\"'\n" + + "\bPAYMENTS\x10\a\x12\v\n" + + "\aCURRENT\x10\a\x1a\x02\x10\x01J\x04\b\x03\x10\x04\"'\n" + "\vNullMessage\x12\x18\n" + "\apadding\x18\x01 \x01(\fR\apadding\"\x92\x01\n" + "\x0eReceiptMessage\x126\n" + @@ -9004,43 +8080,42 @@ const file_SignalService_proto_rawDesc = "" + "\x06SCRIPT\x10\x04\x12\r\n" + "\tCONDENSED\x10\x05B\f\n" + "\n" + - "background\"\x99\x02\n" + + "background\"\xe5\x01\n" + "\bVerified\x12&\n" + "\x0edestinationAci\x18\x05 \x01(\tR\x0edestinationAci\x12 \n" + "\videntityKey\x18\x02 \x01(\fR\videntityKey\x123\n" + "\x05state\x18\x03 \x01(\x0e2\x1d.signalservice.Verified.StateR\x05state\x12 \n" + - "\vnullMessage\x18\x04 \x01(\fR\vnullMessage\x122\n" + - "\x14destinationAciBinary\x18\x06 \x01(\fR\x14destinationAciBinary\"2\n" + + "\vnullMessage\x18\x04 \x01(\fR\vnullMessage\"2\n" + "\x05State\x12\v\n" + "\aDEFAULT\x10\x00\x12\f\n" + "\bVERIFIED\x10\x01\x12\x0e\n" + "\n" + - "UNVERIFIED\x10\x02J\x04\b\x01\x10\x02\"\xf1F\n" + - "\vSyncMessage\x125\n" + - "\x04sent\x18\x01 \x01(\v2\x1f.signalservice.SyncMessage.SentH\x00R\x04sent\x12A\n" + - "\bcontacts\x18\x02 \x01(\v2#.signalservice.SyncMessage.ContactsH\x00R\bcontacts\x12>\n" + - "\arequest\x18\x04 \x01(\v2\".signalservice.SyncMessage.RequestH\x00R\arequest\x12>\n" + - "\ablocked\x18\x06 \x01(\v2\".signalservice.SyncMessage.BlockedH\x00R\ablocked\x125\n" + - "\bverified\x18\a \x01(\v2\x17.signalservice.VerifiedH\x00R\bverified\x12P\n" + - "\rconfiguration\x18\t \x01(\v2(.signalservice.SyncMessage.ConfigurationH\x00R\rconfiguration\x12M\n" + - "\fviewOnceOpen\x18\v \x01(\v2'.signalservice.SyncMessage.ViewOnceOpenH\x00R\fviewOnceOpen\x12J\n" + - "\vfetchLatest\x18\f \x01(\v2&.signalservice.SyncMessage.FetchLatestH\x00R\vfetchLatest\x125\n" + - "\x04keys\x18\r \x01(\v2\x1f.signalservice.SyncMessage.KeysH\x00R\x04keys\x12k\n" + - "\x16messageRequestResponse\x18\x0e \x01(\v21.signalservice.SyncMessage.MessageRequestResponseH\x00R\x16messageRequestResponse\x12V\n" + - "\x0foutgoingPayment\x18\x0f \x01(\v2*.signalservice.SyncMessage.OutgoingPaymentH\x00R\x0foutgoingPayment\x12V\n" + - "\x0fpniChangeNumber\x18\x12 \x01(\v2*.signalservice.SyncMessage.PniChangeNumberH\x00R\x0fpniChangeNumber\x12D\n" + - "\tcallEvent\x18\x13 \x01(\v2$.signalservice.SyncMessage.CallEventH\x00R\tcallEvent\x12S\n" + - "\x0ecallLinkUpdate\x18\x14 \x01(\v2).signalservice.SyncMessage.CallLinkUpdateH\x00R\x0ecallLinkUpdate\x12M\n" + - "\fcallLogEvent\x18\x15 \x01(\v2'.signalservice.SyncMessage.CallLogEventH\x00R\fcallLogEvent\x12J\n" + - "\vdeleteForMe\x18\x16 \x01(\v2&.signalservice.SyncMessage.DeleteForMeH\x00R\vdeleteForMe\x12Y\n" + - "\x10deviceNameChange\x18\x17 \x01(\v2+.signalservice.SyncMessage.DeviceNameChangeH\x00R\x10deviceNameChange\x12t\n" + - "\x19attachmentBackfillRequest\x18\x18 \x01(\v24.signalservice.SyncMessage.AttachmentBackfillRequestH\x00R\x19attachmentBackfillRequest\x12w\n" + - "\x1aattachmentBackfillResponse\x18\x19 \x01(\v25.signalservice.SyncMessage.AttachmentBackfillResponseH\x00R\x1aattachmentBackfillResponse\x123\n" + - "\x04read\x18\x05 \x03(\v2\x1f.signalservice.SyncMessage.ReadR\x04read\x12c\n" + + "UNVERIFIED\x10\x02J\x04\b\x01\x10\x02\"\x87D\n" + + "\vSyncMessage\x123\n" + + "\x04sent\x18\x01 \x01(\v2\x1f.signalservice.SyncMessage.SentR\x04sent\x12?\n" + + "\bcontacts\x18\x02 \x01(\v2#.signalservice.SyncMessage.ContactsR\bcontacts\x12<\n" + + "\arequest\x18\x04 \x01(\v2\".signalservice.SyncMessage.RequestR\arequest\x123\n" + + "\x04read\x18\x05 \x03(\v2\x1f.signalservice.SyncMessage.ReadR\x04read\x12<\n" + + "\ablocked\x18\x06 \x01(\v2\".signalservice.SyncMessage.BlockedR\ablocked\x123\n" + + "\bverified\x18\a \x01(\v2\x17.signalservice.VerifiedR\bverified\x12N\n" + + "\rconfiguration\x18\t \x01(\v2(.signalservice.SyncMessage.ConfigurationR\rconfiguration\x12\x18\n" + + "\apadding\x18\b \x01(\fR\apadding\x12c\n" + "\x14stickerPackOperation\x18\n" + - " \x03(\v2/.signalservice.SyncMessage.StickerPackOperationR\x14stickerPackOperation\x129\n" + - "\x06viewed\x18\x10 \x03(\v2!.signalservice.SyncMessage.ViewedR\x06viewed\x12\x18\n" + - "\apadding\x18\b \x01(\fR\apadding\x1a\xbc\t\n" + + " \x03(\v2/.signalservice.SyncMessage.StickerPackOperationR\x14stickerPackOperation\x12K\n" + + "\fviewOnceOpen\x18\v \x01(\v2'.signalservice.SyncMessage.ViewOnceOpenR\fviewOnceOpen\x12H\n" + + "\vfetchLatest\x18\f \x01(\v2&.signalservice.SyncMessage.FetchLatestR\vfetchLatest\x123\n" + + "\x04keys\x18\r \x01(\v2\x1f.signalservice.SyncMessage.KeysR\x04keys\x12i\n" + + "\x16messageRequestResponse\x18\x0e \x01(\v21.signalservice.SyncMessage.MessageRequestResponseR\x16messageRequestResponse\x12T\n" + + "\x0foutgoingPayment\x18\x0f \x01(\v2*.signalservice.SyncMessage.OutgoingPaymentR\x0foutgoingPayment\x129\n" + + "\x06viewed\x18\x10 \x03(\v2!.signalservice.SyncMessage.ViewedR\x06viewed\x12T\n" + + "\x0fpniChangeNumber\x18\x12 \x01(\v2*.signalservice.SyncMessage.PniChangeNumberR\x0fpniChangeNumber\x12B\n" + + "\tcallEvent\x18\x13 \x01(\v2$.signalservice.SyncMessage.CallEventR\tcallEvent\x12Q\n" + + "\x0ecallLinkUpdate\x18\x14 \x01(\v2).signalservice.SyncMessage.CallLinkUpdateR\x0ecallLinkUpdate\x12K\n" + + "\fcallLogEvent\x18\x15 \x01(\v2'.signalservice.SyncMessage.CallLogEventR\fcallLogEvent\x12H\n" + + "\vdeleteForMe\x18\x16 \x01(\v2&.signalservice.SyncMessage.DeleteForMeR\vdeleteForMe\x12W\n" + + "\x10deviceNameChange\x18\x17 \x01(\v2+.signalservice.SyncMessage.DeviceNameChangeR\x10deviceNameChange\x12r\n" + + "\x19attachmentBackfillRequest\x18\x18 \x01(\v24.signalservice.SyncMessage.AttachmentBackfillRequestR\x19attachmentBackfillRequest\x12u\n" + + "\x1aattachmentBackfillResponse\x18\x19 \x01(\v25.signalservice.SyncMessage.AttachmentBackfillResponseR\x1aattachmentBackfillResponse\x1a\xfc\a\n" + "\x04Sent\x12(\n" + "\x0fdestinationE164\x18\x01 \x01(\tR\x0fdestinationE164\x122\n" + "\x14destinationServiceId\x18\a \x01(\tR\x14destinationServiceId\x12\x1c\n" + @@ -9052,28 +8127,22 @@ const file_SignalService_proto_rawDesc = "" + "\fstoryMessage\x18\b \x01(\v2\x1b.signalservice.StoryMessageR\fstoryMessage\x12m\n" + "\x16storyMessageRecipients\x18\t \x03(\v25.signalservice.SyncMessage.Sent.StoryMessageRecipientR\x16storyMessageRecipients\x12<\n" + "\veditMessage\x18\n" + - " \x01(\v2\x1a.signalservice.EditMessageR\veditMessage\x12>\n" + - "\x1adestinationServiceIdBinary\x18\f \x01(\fR\x1adestinationServiceIdBinary\x1a\xfe\x01\n" + + " \x01(\v2\x1a.signalservice.EditMessageR\veditMessage\x1a\xbe\x01\n" + "\x1aUnidentifiedDeliveryStatus\x122\n" + "\x14destinationServiceId\x18\x03 \x01(\tR\x14destinationServiceId\x12\"\n" + "\funidentified\x18\x02 \x01(\bR\funidentified\x12<\n" + - "\x19destinationPniIdentityKey\x18\x05 \x01(\fR\x19destinationPniIdentityKey\x12>\n" + - "\x1adestinationServiceIdBinary\x18\x06 \x01(\fR\x1adestinationServiceIdBinaryJ\x04\b\x01\x10\x02J\x04\b\x04\x10\x05\x1a\xef\x01\n" + + "\x19destinationPniIdentityKey\x18\x05 \x01(\fR\x19destinationPniIdentityKeyJ\x04\b\x01\x10\x02J\x04\b\x04\x10\x05\x1a\xaf\x01\n" + "\x15StoryMessageRecipient\x122\n" + "\x14destinationServiceId\x18\x01 \x01(\tR\x14destinationServiceId\x120\n" + "\x13distributionListIds\x18\x02 \x03(\tR\x13distributionListIds\x12*\n" + - "\x10isAllowedToReply\x18\x03 \x01(\bR\x10isAllowedToReply\x12>\n" + - "\x1adestinationServiceIdBinary\x18\x05 \x01(\fR\x1adestinationServiceIdBinaryJ\x04\b\x04\x10\x05J\x04\b\v\x10\f\x1ac\n" + + "\x10isAllowedToReply\x18\x03 \x01(\bR\x10isAllowedToReplyJ\x04\b\x04\x10\x05J\x04\b\v\x10\f\x1ac\n" + "\bContacts\x124\n" + "\x04blob\x18\x01 \x01(\v2 .signalservice.AttachmentPointerR\x04blob\x12!\n" + - "\bcomplete\x18\x02 \x01(\b:\x05falseR\bcomplete\x1as\n" + + "\bcomplete\x18\x02 \x01(\b:\x05falseR\bcomplete\x1aS\n" + "\aBlocked\x12\x18\n" + "\anumbers\x18\x01 \x03(\tR\anumbers\x12\x12\n" + "\x04acis\x18\x03 \x03(\tR\x04acis\x12\x1a\n" + - "\bgroupIds\x18\x02 \x03(\fR\bgroupIds\x12\x1e\n" + - "\n" + - "acisBinary\x18\x04 \x03(\fR\n" + - "acisBinary\x1a\x9f\x01\n" + + "\bgroupIds\x18\x02 \x03(\fR\bgroupIds\x1a\x9f\x01\n" + "\aRequest\x12;\n" + "\x04type\x18\x01 \x01(\x0e2'.signalservice.SyncMessage.Request.TypeR\x04type\"W\n" + "\x04Type\x12\v\n" + @@ -9081,20 +8150,19 @@ const file_SignalService_proto_rawDesc = "" + "\bCONTACTS\x10\x01\x12\v\n" + "\aBLOCKED\x10\x03\x12\x11\n" + "\rCONFIGURATION\x10\x04\x12\b\n" + - "\x04KEYS\x10\x05\"\x04\b\x02\x10\x02\"\x04\b\x06\x10\x06\x1ar\n" + + "\x04KEYS\x10\x05\"\x04\b\x02\x10\x02\"\x04\b\x06\x10\x06\x1aH\n" + "\x04Read\x12\x1c\n" + "\tsenderAci\x18\x03 \x01(\tR\tsenderAci\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x12(\n" + - "\x0fsenderAciBinary\x18\x04 \x01(\fR\x0fsenderAciBinaryJ\x04\b\x01\x10\x02\x1at\n" + + "\ttimestamp\x18\x02 \x01(\x04R\ttimestampJ\x04\b\x01\x10\x02\x1aJ\n" + "\x06Viewed\x12\x1c\n" + "\tsenderAci\x18\x03 \x01(\tR\tsenderAci\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x12(\n" + - "\x0fsenderAciBinary\x18\x04 \x01(\fR\x0fsenderAciBinaryJ\x04\b\x01\x10\x02\x1a\xd7\x01\n" + + "\ttimestamp\x18\x02 \x01(\x04R\ttimestampJ\x04\b\x01\x10\x02\x1a\x83\x02\n" + "\rConfiguration\x12\"\n" + "\freadReceipts\x18\x01 \x01(\bR\freadReceipts\x12F\n" + "\x1eunidentifiedDeliveryIndicators\x18\x02 \x01(\bR\x1eunidentifiedDeliveryIndicators\x12*\n" + - "\x10typingIndicators\x18\x03 \x01(\bR\x10typingIndicators\x12\"\n" + - "\flinkPreviews\x18\x06 \x01(\bR\flinkPreviewsJ\x04\b\x04\x10\x05J\x04\b\x05\x10\x06\x1a\xb3\x01\n" + + "\x10typingIndicators\x18\x03 \x01(\bR\x10typingIndicators\x120\n" + + "\x13provisioningVersion\x18\x05 \x01(\rR\x13provisioningVersion\x12\"\n" + + "\flinkPreviews\x18\x06 \x01(\bR\flinkPreviewsJ\x04\b\x04\x10\x05\x1a\xb3\x01\n" + "\x14StickerPackOperation\x12\x16\n" + "\x06packId\x18\x01 \x01(\fR\x06packId\x12\x18\n" + "\apackKey\x18\x02 \x01(\fR\apackKey\x12H\n" + @@ -9102,31 +8170,30 @@ const file_SignalService_proto_rawDesc = "" + "\x04Type\x12\v\n" + "\aINSTALL\x10\x00\x12\n" + "\n" + - "\x06REMOVE\x10\x01\x1az\n" + + "\x06REMOVE\x10\x01\x1aP\n" + "\fViewOnceOpen\x12\x1c\n" + "\tsenderAci\x18\x03 \x01(\tR\tsenderAci\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x12(\n" + - "\x0fsenderAciBinary\x18\x04 \x01(\fR\x0fsenderAciBinaryJ\x04\b\x01\x10\x02\x1a\xa5\x01\n" + + "\ttimestamp\x18\x02 \x01(\x04R\ttimestampJ\x04\b\x01\x10\x02\x1a\xa5\x01\n" + "\vFetchLatest\x12?\n" + "\x04type\x18\x01 \x01(\x0e2+.signalservice.SyncMessage.FetchLatest.TypeR\x04type\"U\n" + "\x04Type\x12\v\n" + "\aUNKNOWN\x10\x00\x12\x11\n" + "\rLOCAL_PROFILE\x10\x01\x12\x14\n" + "\x10STORAGE_MANIFEST\x10\x02\x12\x17\n" + - "\x13SUBSCRIPTION_STATUS\x10\x03\x1ar\n" + - "\x04Keys\x12.\n" + + "\x13SUBSCRIPTION_STATUS\x10\x03\x1a\x84\x01\n" + + "\x04Keys\x12\x16\n" + + "\x06master\x18\x02 \x01(\fR\x06master\x12.\n" + "\x12accountEntropyPool\x18\x03 \x01(\tR\x12accountEntropyPool\x12.\n" + - "\x12mediaRootBackupKey\x18\x04 \x01(\fR\x12mediaRootBackupKeyJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03\x1aK\n" + + "\x12mediaRootBackupKey\x18\x04 \x01(\fR\x12mediaRootBackupKeyJ\x04\b\x01\x10\x02\x1aK\n" + "\vPniIdentity\x12\x1c\n" + "\tpublicKey\x18\x01 \x01(\fR\tpublicKey\x12\x1e\n" + "\n" + "privateKey\x18\x02 \x01(\fR\n" + - "privateKey\x1a\xb8\x02\n" + + "privateKey\x1a\x8e\x02\n" + "\x16MessageRequestResponse\x12\x1c\n" + "\tthreadAci\x18\x02 \x01(\tR\tthreadAci\x12\x18\n" + "\agroupId\x18\x03 \x01(\fR\agroupId\x12J\n" + - "\x04type\x18\x04 \x01(\x0e26.signalservice.SyncMessage.MessageRequestResponse.TypeR\x04type\x12(\n" + - "\x0fthreadAciBinary\x18\x05 \x01(\fR\x0fthreadAciBinary\"j\n" + + "\x04type\x18\x04 \x01(\x0e26.signalservice.SyncMessage.MessageRequestResponse.TypeR\x04type\"j\n" + "\x04Type\x12\v\n" + "\aUNKNOWN\x10\x00\x12\n" + "\n" + @@ -9188,14 +8255,15 @@ const file_SignalService_proto_rawDesc = "" + "\fNOT_ACCEPTED\x10\x02\x12\n" + "\n" + "\x06DELETE\x10\x03\x12\f\n" + - "\bOBSERVED\x10\x04\x1a\xb2\x01\n" + + "\bOBSERVED\x10\x04\x1a\xc2\x01\n" + "\x0eCallLinkUpdate\x12\x18\n" + "\arootKey\x18\x01 \x01(\fR\arootKey\x12\"\n" + "\fadminPasskey\x18\x02 \x01(\fR\fadminPasskey\x12B\n" + - "\x04type\x18\x03 \x01(\x0e2..signalservice.SyncMessage.CallLinkUpdate.TypeR\x04type\"\x18\n" + + "\x04type\x18\x03 \x01(\x0e2..signalservice.SyncMessage.CallLinkUpdate.TypeR\x04type\x12\x14\n" + + "\x05epoch\x18\x04 \x01(\fR\x05epoch\"\x18\n" + "\x04Type\x12\n" + "\n" + - "\x06UPDATE\x10\x00\"\x04\b\x01\x10\x01J\x04\b\x04\x10\x05\x1a\x94\x02\n" + + "\x06UPDATE\x10\x00\"\x04\b\x01\x10\x01\x1a\x94\x02\n" + "\fCallLogEvent\x12@\n" + "\x04type\x18\x01 \x01(\x0e2,.signalservice.SyncMessage.CallLogEvent.TypeR\x04type\x12\x1c\n" + "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x12&\n" + @@ -9254,8 +8322,7 @@ const file_SignalService_proto_rawDesc = "" + "\blongText\x18\x02 \x01(\v2D.signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataR\blongText\"\x1e\n" + "\x05Error\x12\x15\n" + "\x11MESSAGE_NOT_FOUND\x10\x00B\x06\n" + - "\x04dataB\t\n" + - "\acontentJ\x04\b\x03\x10\x04J\x04\b\x11\x10\x12\"\xe7\x04\n" + + "\x04dataJ\x04\b\x03\x10\x04J\x04\b\x11\x10\x12\"\xe7\x04\n" + "\x11AttachmentPointer\x12\x16\n" + "\x05cdnId\x18\x01 \x01(\x06H\x00R\x05cdnId\x12\x18\n" + "\x06cdnKey\x18\x0f \x01(\tH\x00R\x06cdnKey\x12\x1e\n" + @@ -9287,11 +8354,10 @@ const file_SignalService_proto_rawDesc = "" + "\x0eGroupContextV2\x12\x1c\n" + "\tmasterKey\x18\x01 \x01(\fR\tmasterKey\x12\x1a\n" + "\brevision\x18\x02 \x01(\rR\brevision\x12 \n" + - "\vgroupChange\x18\x03 \x01(\fR\vgroupChange\"\x84\x03\n" + + "\vgroupChange\x18\x03 \x01(\fR\vgroupChange\"\xe6\x02\n" + "\x0eContactDetails\x12\x16\n" + "\x06number\x18\x01 \x01(\tR\x06number\x12\x10\n" + - "\x03aci\x18\t \x01(\tR\x03aci\x12\x1c\n" + - "\taciBinary\x18\r \x01(\fR\taciBinary\x12\x12\n" + + "\x03aci\x18\t \x01(\tR\x03aci\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12<\n" + "\x06avatar\x18\x03 \x01(\v2$.signalservice.ContactDetails.AvatarR\x06avatar\x12 \n" + "\vexpireTimer\x18\b \x01(\rR\vexpireTimer\x12.\n" + @@ -9321,15 +8387,14 @@ const file_SignalService_proto_rawDesc = "" + "\tsignature\x18\x02 \x01(\fR\tsignature\"}\n" + "\vEditMessage\x120\n" + "\x13targetSentTimestamp\x18\x01 \x01(\x04R\x13targetSentTimestamp\x12<\n" + - "\vdataMessage\x18\x02 \x01(\v2\x1a.signalservice.DataMessageR\vdataMessage\"\xac\x02\n" + + "\vdataMessage\x18\x02 \x01(\v2\x1a.signalservice.DataMessageR\vdataMessage\"\xfe\x01\n" + "\tBodyRange\x12\x14\n" + "\x05start\x18\x01 \x01(\rR\x05start\x12\x16\n" + "\x06length\x18\x02 \x01(\rR\x06length\x12 \n" + "\n" + "mentionAci\x18\x03 \x01(\tH\x00R\n" + "mentionAci\x126\n" + - "\x05style\x18\x04 \x01(\x0e2\x1e.signalservice.BodyRange.StyleH\x00R\x05style\x12,\n" + - "\x10mentionAciBinary\x18\x05 \x01(\fH\x00R\x10mentionAciBinary\"V\n" + + "\x05style\x18\x04 \x01(\x0e2\x1e.signalservice.BodyRange.StyleH\x00R\x05style\"V\n" + "\x05Style\x12\b\n" + "\x04NONE\x10\x00\x12\b\n" + "\x04BOLD\x10\x01\x12\n" + @@ -9338,22 +8403,20 @@ const file_SignalService_proto_rawDesc = "" + "\aSPOILER\x10\x03\x12\x11\n" + "\rSTRIKETHROUGH\x10\x04\x12\r\n" + "\tMONOSPACE\x10\x05B\x11\n" + - "\x0fassociatedValue\"\xca\x01\n" + + "\x0fassociatedValue\"\x92\x01\n" + "\x12AddressableMessage\x12*\n" + "\x0fauthorServiceId\x18\x01 \x01(\tH\x00R\x0fauthorServiceId\x12 \n" + "\n" + "authorE164\x18\x02 \x01(\tH\x00R\n" + - "authorE164\x126\n" + - "\x15authorServiceIdBinary\x18\x04 \x01(\fH\x00R\x15authorServiceIdBinary\x12$\n" + + "authorE164\x12$\n" + "\rsentTimestamp\x18\x03 \x01(\x04R\rsentTimestampB\b\n" + - "\x06author\"\xd4\x01\n" + + "\x06author\"\x9c\x01\n" + "\x16ConversationIdentifier\x12*\n" + "\x0fthreadServiceId\x18\x01 \x01(\tH\x00R\x0fthreadServiceId\x12&\n" + "\rthreadGroupId\x18\x02 \x01(\fH\x00R\rthreadGroupId\x12 \n" + "\n" + "threadE164\x18\x03 \x01(\tH\x00R\n" + - "threadE164\x126\n" + - "\x15threadServiceIdBinary\x18\x04 \x01(\fH\x00R\x15threadServiceIdBinaryB\f\n" + + "threadE164B\f\n" + "\n" + "identifierBE\n" + ".org.whispersystems.signalservice.internal.pushB\x13SignalServiceProtos" @@ -9371,7 +8434,7 @@ func file_SignalService_proto_rawDescGZIP() []byte { } var file_SignalService_proto_enumTypes = make([]protoimpl.EnumInfo, 28) -var file_SignalService_proto_msgTypes = make([]protoimpl.MessageInfo, 88) +var file_SignalService_proto_msgTypes = make([]protoimpl.MessageInfo, 82) var file_SignalService_proto_goTypes = []any{ (Envelope_Type)(0), // 0: signalservice.Envelope.Type (CallMessage_Offer_Type)(0), // 1: signalservice.CallMessage.Offer.Type @@ -9438,57 +8501,51 @@ var file_SignalService_proto_goTypes = []any{ (*DataMessage_GroupCallUpdate)(nil), // 62: signalservice.DataMessage.GroupCallUpdate (*DataMessage_StoryContext)(nil), // 63: signalservice.DataMessage.StoryContext (*DataMessage_GiftBadge)(nil), // 64: signalservice.DataMessage.GiftBadge - (*DataMessage_PollCreate)(nil), // 65: signalservice.DataMessage.PollCreate - (*DataMessage_PollTerminate)(nil), // 66: signalservice.DataMessage.PollTerminate - (*DataMessage_PollVote)(nil), // 67: signalservice.DataMessage.PollVote - (*DataMessage_PinMessage)(nil), // 68: signalservice.DataMessage.PinMessage - (*DataMessage_UnpinMessage)(nil), // 69: signalservice.DataMessage.UnpinMessage - (*DataMessage_AdminDelete)(nil), // 70: signalservice.DataMessage.AdminDelete - (*DataMessage_Payment_Amount)(nil), // 71: signalservice.DataMessage.Payment.Amount - (*DataMessage_Payment_Notification)(nil), // 72: signalservice.DataMessage.Payment.Notification - (*DataMessage_Payment_Activation)(nil), // 73: signalservice.DataMessage.Payment.Activation - (*DataMessage_Payment_Amount_MobileCoin)(nil), // 74: signalservice.DataMessage.Payment.Amount.MobileCoin - (*DataMessage_Payment_Notification_MobileCoin)(nil), // 75: signalservice.DataMessage.Payment.Notification.MobileCoin - (*DataMessage_Quote_QuotedAttachment)(nil), // 76: signalservice.DataMessage.Quote.QuotedAttachment - (*DataMessage_Contact_Name)(nil), // 77: signalservice.DataMessage.Contact.Name - (*DataMessage_Contact_Phone)(nil), // 78: signalservice.DataMessage.Contact.Phone - (*DataMessage_Contact_Email)(nil), // 79: signalservice.DataMessage.Contact.Email - (*DataMessage_Contact_PostalAddress)(nil), // 80: signalservice.DataMessage.Contact.PostalAddress - (*DataMessage_Contact_Avatar)(nil), // 81: signalservice.DataMessage.Contact.Avatar - (*TextAttachment_Gradient)(nil), // 82: signalservice.TextAttachment.Gradient - (*SyncMessage_Sent)(nil), // 83: signalservice.SyncMessage.Sent - (*SyncMessage_Contacts)(nil), // 84: signalservice.SyncMessage.Contacts - (*SyncMessage_Blocked)(nil), // 85: signalservice.SyncMessage.Blocked - (*SyncMessage_Request)(nil), // 86: signalservice.SyncMessage.Request - (*SyncMessage_Read)(nil), // 87: signalservice.SyncMessage.Read - (*SyncMessage_Viewed)(nil), // 88: signalservice.SyncMessage.Viewed - (*SyncMessage_Configuration)(nil), // 89: signalservice.SyncMessage.Configuration - (*SyncMessage_StickerPackOperation)(nil), // 90: signalservice.SyncMessage.StickerPackOperation - (*SyncMessage_ViewOnceOpen)(nil), // 91: signalservice.SyncMessage.ViewOnceOpen - (*SyncMessage_FetchLatest)(nil), // 92: signalservice.SyncMessage.FetchLatest - (*SyncMessage_Keys)(nil), // 93: signalservice.SyncMessage.Keys - (*SyncMessage_PniIdentity)(nil), // 94: signalservice.SyncMessage.PniIdentity - (*SyncMessage_MessageRequestResponse)(nil), // 95: signalservice.SyncMessage.MessageRequestResponse - (*SyncMessage_OutgoingPayment)(nil), // 96: signalservice.SyncMessage.OutgoingPayment - (*SyncMessage_PniChangeNumber)(nil), // 97: signalservice.SyncMessage.PniChangeNumber - (*SyncMessage_CallEvent)(nil), // 98: signalservice.SyncMessage.CallEvent - (*SyncMessage_CallLinkUpdate)(nil), // 99: signalservice.SyncMessage.CallLinkUpdate - (*SyncMessage_CallLogEvent)(nil), // 100: signalservice.SyncMessage.CallLogEvent - (*SyncMessage_DeleteForMe)(nil), // 101: signalservice.SyncMessage.DeleteForMe - (*SyncMessage_DeviceNameChange)(nil), // 102: signalservice.SyncMessage.DeviceNameChange - (*SyncMessage_AttachmentBackfillRequest)(nil), // 103: signalservice.SyncMessage.AttachmentBackfillRequest - (*SyncMessage_AttachmentBackfillResponse)(nil), // 104: signalservice.SyncMessage.AttachmentBackfillResponse - (*SyncMessage_Sent_UnidentifiedDeliveryStatus)(nil), // 105: signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus - (*SyncMessage_Sent_StoryMessageRecipient)(nil), // 106: signalservice.SyncMessage.Sent.StoryMessageRecipient - (*SyncMessage_OutgoingPayment_MobileCoin)(nil), // 107: signalservice.SyncMessage.OutgoingPayment.MobileCoin - (*SyncMessage_DeleteForMe_MessageDeletes)(nil), // 108: signalservice.SyncMessage.DeleteForMe.MessageDeletes - (*SyncMessage_DeleteForMe_AttachmentDelete)(nil), // 109: signalservice.SyncMessage.DeleteForMe.AttachmentDelete - (*SyncMessage_DeleteForMe_ConversationDelete)(nil), // 110: signalservice.SyncMessage.DeleteForMe.ConversationDelete - (*SyncMessage_DeleteForMe_LocalOnlyConversationDelete)(nil), // 111: signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete - (*SyncMessage_AttachmentBackfillResponse_AttachmentData)(nil), // 112: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData - (*SyncMessage_AttachmentBackfillResponse_AttachmentDataList)(nil), // 113: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList - (*ContactDetails_Avatar)(nil), // 114: signalservice.ContactDetails.Avatar - (*PaymentAddress_MobileCoin)(nil), // 115: signalservice.PaymentAddress.MobileCoin + (*DataMessage_Payment_Amount)(nil), // 65: signalservice.DataMessage.Payment.Amount + (*DataMessage_Payment_Notification)(nil), // 66: signalservice.DataMessage.Payment.Notification + (*DataMessage_Payment_Activation)(nil), // 67: signalservice.DataMessage.Payment.Activation + (*DataMessage_Payment_Amount_MobileCoin)(nil), // 68: signalservice.DataMessage.Payment.Amount.MobileCoin + (*DataMessage_Payment_Notification_MobileCoin)(nil), // 69: signalservice.DataMessage.Payment.Notification.MobileCoin + (*DataMessage_Quote_QuotedAttachment)(nil), // 70: signalservice.DataMessage.Quote.QuotedAttachment + (*DataMessage_Contact_Name)(nil), // 71: signalservice.DataMessage.Contact.Name + (*DataMessage_Contact_Phone)(nil), // 72: signalservice.DataMessage.Contact.Phone + (*DataMessage_Contact_Email)(nil), // 73: signalservice.DataMessage.Contact.Email + (*DataMessage_Contact_PostalAddress)(nil), // 74: signalservice.DataMessage.Contact.PostalAddress + (*DataMessage_Contact_Avatar)(nil), // 75: signalservice.DataMessage.Contact.Avatar + (*TextAttachment_Gradient)(nil), // 76: signalservice.TextAttachment.Gradient + (*SyncMessage_Sent)(nil), // 77: signalservice.SyncMessage.Sent + (*SyncMessage_Contacts)(nil), // 78: signalservice.SyncMessage.Contacts + (*SyncMessage_Blocked)(nil), // 79: signalservice.SyncMessage.Blocked + (*SyncMessage_Request)(nil), // 80: signalservice.SyncMessage.Request + (*SyncMessage_Read)(nil), // 81: signalservice.SyncMessage.Read + (*SyncMessage_Viewed)(nil), // 82: signalservice.SyncMessage.Viewed + (*SyncMessage_Configuration)(nil), // 83: signalservice.SyncMessage.Configuration + (*SyncMessage_StickerPackOperation)(nil), // 84: signalservice.SyncMessage.StickerPackOperation + (*SyncMessage_ViewOnceOpen)(nil), // 85: signalservice.SyncMessage.ViewOnceOpen + (*SyncMessage_FetchLatest)(nil), // 86: signalservice.SyncMessage.FetchLatest + (*SyncMessage_Keys)(nil), // 87: signalservice.SyncMessage.Keys + (*SyncMessage_PniIdentity)(nil), // 88: signalservice.SyncMessage.PniIdentity + (*SyncMessage_MessageRequestResponse)(nil), // 89: signalservice.SyncMessage.MessageRequestResponse + (*SyncMessage_OutgoingPayment)(nil), // 90: signalservice.SyncMessage.OutgoingPayment + (*SyncMessage_PniChangeNumber)(nil), // 91: signalservice.SyncMessage.PniChangeNumber + (*SyncMessage_CallEvent)(nil), // 92: signalservice.SyncMessage.CallEvent + (*SyncMessage_CallLinkUpdate)(nil), // 93: signalservice.SyncMessage.CallLinkUpdate + (*SyncMessage_CallLogEvent)(nil), // 94: signalservice.SyncMessage.CallLogEvent + (*SyncMessage_DeleteForMe)(nil), // 95: signalservice.SyncMessage.DeleteForMe + (*SyncMessage_DeviceNameChange)(nil), // 96: signalservice.SyncMessage.DeviceNameChange + (*SyncMessage_AttachmentBackfillRequest)(nil), // 97: signalservice.SyncMessage.AttachmentBackfillRequest + (*SyncMessage_AttachmentBackfillResponse)(nil), // 98: signalservice.SyncMessage.AttachmentBackfillResponse + (*SyncMessage_Sent_UnidentifiedDeliveryStatus)(nil), // 99: signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus + (*SyncMessage_Sent_StoryMessageRecipient)(nil), // 100: signalservice.SyncMessage.Sent.StoryMessageRecipient + (*SyncMessage_OutgoingPayment_MobileCoin)(nil), // 101: signalservice.SyncMessage.OutgoingPayment.MobileCoin + (*SyncMessage_DeleteForMe_MessageDeletes)(nil), // 102: signalservice.SyncMessage.DeleteForMe.MessageDeletes + (*SyncMessage_DeleteForMe_AttachmentDelete)(nil), // 103: signalservice.SyncMessage.DeleteForMe.AttachmentDelete + (*SyncMessage_DeleteForMe_ConversationDelete)(nil), // 104: signalservice.SyncMessage.DeleteForMe.ConversationDelete + (*SyncMessage_DeleteForMe_LocalOnlyConversationDelete)(nil), // 105: signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete + (*SyncMessage_AttachmentBackfillResponse_AttachmentData)(nil), // 106: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData + (*SyncMessage_AttachmentBackfillResponse_AttachmentDataList)(nil), // 107: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList + (*ContactDetails_Avatar)(nil), // 108: signalservice.ContactDetails.Avatar + (*PaymentAddress_MobileCoin)(nil), // 109: signalservice.PaymentAddress.MobileCoin } var file_SignalService_proto_depIdxs = []int32{ 0, // 0: signalservice.Envelope.type:type_name -> signalservice.Envelope.Type @@ -9499,8 +8556,8 @@ var file_SignalService_proto_depIdxs = []int32{ 33, // 5: signalservice.Content.receiptMessage:type_name -> signalservice.ReceiptMessage 34, // 6: signalservice.Content.typingMessage:type_name -> signalservice.TypingMessage 35, // 7: signalservice.Content.storyMessage:type_name -> signalservice.StoryMessage - 46, // 8: signalservice.Content.editMessage:type_name -> signalservice.EditMessage - 45, // 9: signalservice.Content.pniSignatureMessage:type_name -> signalservice.PniSignatureMessage + 45, // 8: signalservice.Content.pniSignatureMessage:type_name -> signalservice.PniSignatureMessage + 46, // 9: signalservice.Content.editMessage:type_name -> signalservice.EditMessage 50, // 10: signalservice.CallMessage.offer:type_name -> signalservice.CallMessage.Offer 51, // 11: signalservice.CallMessage.answer:type_name -> signalservice.CallMessage.Answer 52, // 12: signalservice.CallMessage.iceUpdate:type_name -> signalservice.CallMessage.IceUpdate @@ -9520,114 +8577,108 @@ var file_SignalService_proto_depIdxs = []int32{ 56, // 26: signalservice.DataMessage.payment:type_name -> signalservice.DataMessage.Payment 63, // 27: signalservice.DataMessage.storyContext:type_name -> signalservice.DataMessage.StoryContext 64, // 28: signalservice.DataMessage.giftBadge:type_name -> signalservice.DataMessage.GiftBadge - 65, // 29: signalservice.DataMessage.pollCreate:type_name -> signalservice.DataMessage.PollCreate - 66, // 30: signalservice.DataMessage.pollTerminate:type_name -> signalservice.DataMessage.PollTerminate - 67, // 31: signalservice.DataMessage.pollVote:type_name -> signalservice.DataMessage.PollVote - 68, // 32: signalservice.DataMessage.pinMessage:type_name -> signalservice.DataMessage.PinMessage - 69, // 33: signalservice.DataMessage.unpinMessage:type_name -> signalservice.DataMessage.UnpinMessage - 70, // 34: signalservice.DataMessage.adminDelete:type_name -> signalservice.DataMessage.AdminDelete - 11, // 35: signalservice.ReceiptMessage.type:type_name -> signalservice.ReceiptMessage.Type - 12, // 36: signalservice.TypingMessage.action:type_name -> signalservice.TypingMessage.Action - 41, // 37: signalservice.StoryMessage.group:type_name -> signalservice.GroupContextV2 - 40, // 38: signalservice.StoryMessage.fileAttachment:type_name -> signalservice.AttachmentPointer - 37, // 39: signalservice.StoryMessage.textAttachment:type_name -> signalservice.TextAttachment - 47, // 40: signalservice.StoryMessage.bodyRanges:type_name -> signalservice.BodyRange - 40, // 41: signalservice.Preview.image:type_name -> signalservice.AttachmentPointer - 13, // 42: signalservice.TextAttachment.textStyle:type_name -> signalservice.TextAttachment.Style - 36, // 43: signalservice.TextAttachment.preview:type_name -> signalservice.Preview - 82, // 44: signalservice.TextAttachment.gradient:type_name -> signalservice.TextAttachment.Gradient - 14, // 45: signalservice.Verified.state:type_name -> signalservice.Verified.State - 83, // 46: signalservice.SyncMessage.sent:type_name -> signalservice.SyncMessage.Sent - 84, // 47: signalservice.SyncMessage.contacts:type_name -> signalservice.SyncMessage.Contacts - 86, // 48: signalservice.SyncMessage.request:type_name -> signalservice.SyncMessage.Request - 85, // 49: signalservice.SyncMessage.blocked:type_name -> signalservice.SyncMessage.Blocked - 38, // 50: signalservice.SyncMessage.verified:type_name -> signalservice.Verified - 89, // 51: signalservice.SyncMessage.configuration:type_name -> signalservice.SyncMessage.Configuration - 91, // 52: signalservice.SyncMessage.viewOnceOpen:type_name -> signalservice.SyncMessage.ViewOnceOpen - 92, // 53: signalservice.SyncMessage.fetchLatest:type_name -> signalservice.SyncMessage.FetchLatest - 93, // 54: signalservice.SyncMessage.keys:type_name -> signalservice.SyncMessage.Keys - 95, // 55: signalservice.SyncMessage.messageRequestResponse:type_name -> signalservice.SyncMessage.MessageRequestResponse - 96, // 56: signalservice.SyncMessage.outgoingPayment:type_name -> signalservice.SyncMessage.OutgoingPayment - 97, // 57: signalservice.SyncMessage.pniChangeNumber:type_name -> signalservice.SyncMessage.PniChangeNumber - 98, // 58: signalservice.SyncMessage.callEvent:type_name -> signalservice.SyncMessage.CallEvent - 99, // 59: signalservice.SyncMessage.callLinkUpdate:type_name -> signalservice.SyncMessage.CallLinkUpdate - 100, // 60: signalservice.SyncMessage.callLogEvent:type_name -> signalservice.SyncMessage.CallLogEvent - 101, // 61: signalservice.SyncMessage.deleteForMe:type_name -> signalservice.SyncMessage.DeleteForMe - 102, // 62: signalservice.SyncMessage.deviceNameChange:type_name -> signalservice.SyncMessage.DeviceNameChange - 103, // 63: signalservice.SyncMessage.attachmentBackfillRequest:type_name -> signalservice.SyncMessage.AttachmentBackfillRequest - 104, // 64: signalservice.SyncMessage.attachmentBackfillResponse:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse - 87, // 65: signalservice.SyncMessage.read:type_name -> signalservice.SyncMessage.Read - 90, // 66: signalservice.SyncMessage.stickerPackOperation:type_name -> signalservice.SyncMessage.StickerPackOperation - 88, // 67: signalservice.SyncMessage.viewed:type_name -> signalservice.SyncMessage.Viewed - 114, // 68: signalservice.ContactDetails.avatar:type_name -> signalservice.ContactDetails.Avatar - 115, // 69: signalservice.PaymentAddress.mobileCoin:type_name -> signalservice.PaymentAddress.MobileCoin - 31, // 70: signalservice.EditMessage.dataMessage:type_name -> signalservice.DataMessage - 27, // 71: signalservice.BodyRange.style:type_name -> signalservice.BodyRange.Style - 1, // 72: signalservice.CallMessage.Offer.type:type_name -> signalservice.CallMessage.Offer.Type - 2, // 73: signalservice.CallMessage.Hangup.type:type_name -> signalservice.CallMessage.Hangup.Type - 3, // 74: signalservice.CallMessage.Opaque.urgency:type_name -> signalservice.CallMessage.Opaque.Urgency - 72, // 75: signalservice.DataMessage.Payment.notification:type_name -> signalservice.DataMessage.Payment.Notification - 73, // 76: signalservice.DataMessage.Payment.activation:type_name -> signalservice.DataMessage.Payment.Activation - 76, // 77: signalservice.DataMessage.Quote.attachments:type_name -> signalservice.DataMessage.Quote.QuotedAttachment - 47, // 78: signalservice.DataMessage.Quote.bodyRanges:type_name -> signalservice.BodyRange - 7, // 79: signalservice.DataMessage.Quote.type:type_name -> signalservice.DataMessage.Quote.Type - 77, // 80: signalservice.DataMessage.Contact.name:type_name -> signalservice.DataMessage.Contact.Name - 78, // 81: signalservice.DataMessage.Contact.number:type_name -> signalservice.DataMessage.Contact.Phone - 79, // 82: signalservice.DataMessage.Contact.email:type_name -> signalservice.DataMessage.Contact.Email - 80, // 83: signalservice.DataMessage.Contact.address:type_name -> signalservice.DataMessage.Contact.PostalAddress - 81, // 84: signalservice.DataMessage.Contact.avatar:type_name -> signalservice.DataMessage.Contact.Avatar - 40, // 85: signalservice.DataMessage.Sticker.data:type_name -> signalservice.AttachmentPointer - 74, // 86: signalservice.DataMessage.Payment.Amount.mobileCoin:type_name -> signalservice.DataMessage.Payment.Amount.MobileCoin - 75, // 87: signalservice.DataMessage.Payment.Notification.mobileCoin:type_name -> signalservice.DataMessage.Payment.Notification.MobileCoin - 6, // 88: signalservice.DataMessage.Payment.Activation.type:type_name -> signalservice.DataMessage.Payment.Activation.Type - 40, // 89: signalservice.DataMessage.Quote.QuotedAttachment.thumbnail:type_name -> signalservice.AttachmentPointer - 8, // 90: signalservice.DataMessage.Contact.Phone.type:type_name -> signalservice.DataMessage.Contact.Phone.Type - 9, // 91: signalservice.DataMessage.Contact.Email.type:type_name -> signalservice.DataMessage.Contact.Email.Type - 10, // 92: signalservice.DataMessage.Contact.PostalAddress.type:type_name -> signalservice.DataMessage.Contact.PostalAddress.Type - 40, // 93: signalservice.DataMessage.Contact.Avatar.avatar:type_name -> signalservice.AttachmentPointer - 31, // 94: signalservice.SyncMessage.Sent.message:type_name -> signalservice.DataMessage - 105, // 95: signalservice.SyncMessage.Sent.unidentifiedStatus:type_name -> signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus - 35, // 96: signalservice.SyncMessage.Sent.storyMessage:type_name -> signalservice.StoryMessage - 106, // 97: signalservice.SyncMessage.Sent.storyMessageRecipients:type_name -> signalservice.SyncMessage.Sent.StoryMessageRecipient - 46, // 98: signalservice.SyncMessage.Sent.editMessage:type_name -> signalservice.EditMessage - 40, // 99: signalservice.SyncMessage.Contacts.blob:type_name -> signalservice.AttachmentPointer - 15, // 100: signalservice.SyncMessage.Request.type:type_name -> signalservice.SyncMessage.Request.Type - 16, // 101: signalservice.SyncMessage.StickerPackOperation.type:type_name -> signalservice.SyncMessage.StickerPackOperation.Type - 17, // 102: signalservice.SyncMessage.FetchLatest.type:type_name -> signalservice.SyncMessage.FetchLatest.Type - 18, // 103: signalservice.SyncMessage.MessageRequestResponse.type:type_name -> signalservice.SyncMessage.MessageRequestResponse.Type - 107, // 104: signalservice.SyncMessage.OutgoingPayment.mobileCoin:type_name -> signalservice.SyncMessage.OutgoingPayment.MobileCoin - 19, // 105: signalservice.SyncMessage.CallEvent.type:type_name -> signalservice.SyncMessage.CallEvent.Type - 20, // 106: signalservice.SyncMessage.CallEvent.direction:type_name -> signalservice.SyncMessage.CallEvent.Direction - 21, // 107: signalservice.SyncMessage.CallEvent.event:type_name -> signalservice.SyncMessage.CallEvent.Event - 22, // 108: signalservice.SyncMessage.CallLinkUpdate.type:type_name -> signalservice.SyncMessage.CallLinkUpdate.Type - 23, // 109: signalservice.SyncMessage.CallLogEvent.type:type_name -> signalservice.SyncMessage.CallLogEvent.Type - 108, // 110: signalservice.SyncMessage.DeleteForMe.messageDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.MessageDeletes - 110, // 111: signalservice.SyncMessage.DeleteForMe.conversationDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.ConversationDelete - 111, // 112: signalservice.SyncMessage.DeleteForMe.localOnlyConversationDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete - 109, // 113: signalservice.SyncMessage.DeleteForMe.attachmentDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.AttachmentDelete - 48, // 114: signalservice.SyncMessage.AttachmentBackfillRequest.targetMessage:type_name -> signalservice.AddressableMessage - 49, // 115: signalservice.SyncMessage.AttachmentBackfillRequest.targetConversation:type_name -> signalservice.ConversationIdentifier - 48, // 116: signalservice.SyncMessage.AttachmentBackfillResponse.targetMessage:type_name -> signalservice.AddressableMessage - 49, // 117: signalservice.SyncMessage.AttachmentBackfillResponse.targetConversation:type_name -> signalservice.ConversationIdentifier - 113, // 118: signalservice.SyncMessage.AttachmentBackfillResponse.attachments:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList - 24, // 119: signalservice.SyncMessage.AttachmentBackfillResponse.error:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.Error - 49, // 120: signalservice.SyncMessage.DeleteForMe.MessageDeletes.conversation:type_name -> signalservice.ConversationIdentifier - 48, // 121: signalservice.SyncMessage.DeleteForMe.MessageDeletes.messages:type_name -> signalservice.AddressableMessage - 49, // 122: signalservice.SyncMessage.DeleteForMe.AttachmentDelete.conversation:type_name -> signalservice.ConversationIdentifier - 48, // 123: signalservice.SyncMessage.DeleteForMe.AttachmentDelete.targetMessage:type_name -> signalservice.AddressableMessage - 49, // 124: signalservice.SyncMessage.DeleteForMe.ConversationDelete.conversation:type_name -> signalservice.ConversationIdentifier - 48, // 125: signalservice.SyncMessage.DeleteForMe.ConversationDelete.mostRecentMessages:type_name -> signalservice.AddressableMessage - 48, // 126: signalservice.SyncMessage.DeleteForMe.ConversationDelete.mostRecentNonExpiringMessages:type_name -> signalservice.AddressableMessage - 49, // 127: signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete.conversation:type_name -> signalservice.ConversationIdentifier - 40, // 128: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.attachment:type_name -> signalservice.AttachmentPointer - 25, // 129: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.status:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.Status - 112, // 130: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList.attachments:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData - 112, // 131: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList.longText:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData - 132, // [132:132] is the sub-list for method output_type - 132, // [132:132] is the sub-list for method input_type - 132, // [132:132] is the sub-list for extension type_name - 132, // [132:132] is the sub-list for extension extendee - 0, // [0:132] is the sub-list for field type_name + 11, // 29: signalservice.ReceiptMessage.type:type_name -> signalservice.ReceiptMessage.Type + 12, // 30: signalservice.TypingMessage.action:type_name -> signalservice.TypingMessage.Action + 41, // 31: signalservice.StoryMessage.group:type_name -> signalservice.GroupContextV2 + 40, // 32: signalservice.StoryMessage.fileAttachment:type_name -> signalservice.AttachmentPointer + 37, // 33: signalservice.StoryMessage.textAttachment:type_name -> signalservice.TextAttachment + 47, // 34: signalservice.StoryMessage.bodyRanges:type_name -> signalservice.BodyRange + 40, // 35: signalservice.Preview.image:type_name -> signalservice.AttachmentPointer + 13, // 36: signalservice.TextAttachment.textStyle:type_name -> signalservice.TextAttachment.Style + 36, // 37: signalservice.TextAttachment.preview:type_name -> signalservice.Preview + 76, // 38: signalservice.TextAttachment.gradient:type_name -> signalservice.TextAttachment.Gradient + 14, // 39: signalservice.Verified.state:type_name -> signalservice.Verified.State + 77, // 40: signalservice.SyncMessage.sent:type_name -> signalservice.SyncMessage.Sent + 78, // 41: signalservice.SyncMessage.contacts:type_name -> signalservice.SyncMessage.Contacts + 80, // 42: signalservice.SyncMessage.request:type_name -> signalservice.SyncMessage.Request + 81, // 43: signalservice.SyncMessage.read:type_name -> signalservice.SyncMessage.Read + 79, // 44: signalservice.SyncMessage.blocked:type_name -> signalservice.SyncMessage.Blocked + 38, // 45: signalservice.SyncMessage.verified:type_name -> signalservice.Verified + 83, // 46: signalservice.SyncMessage.configuration:type_name -> signalservice.SyncMessage.Configuration + 84, // 47: signalservice.SyncMessage.stickerPackOperation:type_name -> signalservice.SyncMessage.StickerPackOperation + 85, // 48: signalservice.SyncMessage.viewOnceOpen:type_name -> signalservice.SyncMessage.ViewOnceOpen + 86, // 49: signalservice.SyncMessage.fetchLatest:type_name -> signalservice.SyncMessage.FetchLatest + 87, // 50: signalservice.SyncMessage.keys:type_name -> signalservice.SyncMessage.Keys + 89, // 51: signalservice.SyncMessage.messageRequestResponse:type_name -> signalservice.SyncMessage.MessageRequestResponse + 90, // 52: signalservice.SyncMessage.outgoingPayment:type_name -> signalservice.SyncMessage.OutgoingPayment + 82, // 53: signalservice.SyncMessage.viewed:type_name -> signalservice.SyncMessage.Viewed + 91, // 54: signalservice.SyncMessage.pniChangeNumber:type_name -> signalservice.SyncMessage.PniChangeNumber + 92, // 55: signalservice.SyncMessage.callEvent:type_name -> signalservice.SyncMessage.CallEvent + 93, // 56: signalservice.SyncMessage.callLinkUpdate:type_name -> signalservice.SyncMessage.CallLinkUpdate + 94, // 57: signalservice.SyncMessage.callLogEvent:type_name -> signalservice.SyncMessage.CallLogEvent + 95, // 58: signalservice.SyncMessage.deleteForMe:type_name -> signalservice.SyncMessage.DeleteForMe + 96, // 59: signalservice.SyncMessage.deviceNameChange:type_name -> signalservice.SyncMessage.DeviceNameChange + 97, // 60: signalservice.SyncMessage.attachmentBackfillRequest:type_name -> signalservice.SyncMessage.AttachmentBackfillRequest + 98, // 61: signalservice.SyncMessage.attachmentBackfillResponse:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse + 108, // 62: signalservice.ContactDetails.avatar:type_name -> signalservice.ContactDetails.Avatar + 109, // 63: signalservice.PaymentAddress.mobileCoin:type_name -> signalservice.PaymentAddress.MobileCoin + 31, // 64: signalservice.EditMessage.dataMessage:type_name -> signalservice.DataMessage + 27, // 65: signalservice.BodyRange.style:type_name -> signalservice.BodyRange.Style + 1, // 66: signalservice.CallMessage.Offer.type:type_name -> signalservice.CallMessage.Offer.Type + 2, // 67: signalservice.CallMessage.Hangup.type:type_name -> signalservice.CallMessage.Hangup.Type + 3, // 68: signalservice.CallMessage.Opaque.urgency:type_name -> signalservice.CallMessage.Opaque.Urgency + 66, // 69: signalservice.DataMessage.Payment.notification:type_name -> signalservice.DataMessage.Payment.Notification + 67, // 70: signalservice.DataMessage.Payment.activation:type_name -> signalservice.DataMessage.Payment.Activation + 70, // 71: signalservice.DataMessage.Quote.attachments:type_name -> signalservice.DataMessage.Quote.QuotedAttachment + 47, // 72: signalservice.DataMessage.Quote.bodyRanges:type_name -> signalservice.BodyRange + 7, // 73: signalservice.DataMessage.Quote.type:type_name -> signalservice.DataMessage.Quote.Type + 71, // 74: signalservice.DataMessage.Contact.name:type_name -> signalservice.DataMessage.Contact.Name + 72, // 75: signalservice.DataMessage.Contact.number:type_name -> signalservice.DataMessage.Contact.Phone + 73, // 76: signalservice.DataMessage.Contact.email:type_name -> signalservice.DataMessage.Contact.Email + 74, // 77: signalservice.DataMessage.Contact.address:type_name -> signalservice.DataMessage.Contact.PostalAddress + 75, // 78: signalservice.DataMessage.Contact.avatar:type_name -> signalservice.DataMessage.Contact.Avatar + 40, // 79: signalservice.DataMessage.Sticker.data:type_name -> signalservice.AttachmentPointer + 68, // 80: signalservice.DataMessage.Payment.Amount.mobileCoin:type_name -> signalservice.DataMessage.Payment.Amount.MobileCoin + 69, // 81: signalservice.DataMessage.Payment.Notification.mobileCoin:type_name -> signalservice.DataMessage.Payment.Notification.MobileCoin + 6, // 82: signalservice.DataMessage.Payment.Activation.type:type_name -> signalservice.DataMessage.Payment.Activation.Type + 40, // 83: signalservice.DataMessage.Quote.QuotedAttachment.thumbnail:type_name -> signalservice.AttachmentPointer + 8, // 84: signalservice.DataMessage.Contact.Phone.type:type_name -> signalservice.DataMessage.Contact.Phone.Type + 9, // 85: signalservice.DataMessage.Contact.Email.type:type_name -> signalservice.DataMessage.Contact.Email.Type + 10, // 86: signalservice.DataMessage.Contact.PostalAddress.type:type_name -> signalservice.DataMessage.Contact.PostalAddress.Type + 40, // 87: signalservice.DataMessage.Contact.Avatar.avatar:type_name -> signalservice.AttachmentPointer + 31, // 88: signalservice.SyncMessage.Sent.message:type_name -> signalservice.DataMessage + 99, // 89: signalservice.SyncMessage.Sent.unidentifiedStatus:type_name -> signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus + 35, // 90: signalservice.SyncMessage.Sent.storyMessage:type_name -> signalservice.StoryMessage + 100, // 91: signalservice.SyncMessage.Sent.storyMessageRecipients:type_name -> signalservice.SyncMessage.Sent.StoryMessageRecipient + 46, // 92: signalservice.SyncMessage.Sent.editMessage:type_name -> signalservice.EditMessage + 40, // 93: signalservice.SyncMessage.Contacts.blob:type_name -> signalservice.AttachmentPointer + 15, // 94: signalservice.SyncMessage.Request.type:type_name -> signalservice.SyncMessage.Request.Type + 16, // 95: signalservice.SyncMessage.StickerPackOperation.type:type_name -> signalservice.SyncMessage.StickerPackOperation.Type + 17, // 96: signalservice.SyncMessage.FetchLatest.type:type_name -> signalservice.SyncMessage.FetchLatest.Type + 18, // 97: signalservice.SyncMessage.MessageRequestResponse.type:type_name -> signalservice.SyncMessage.MessageRequestResponse.Type + 101, // 98: signalservice.SyncMessage.OutgoingPayment.mobileCoin:type_name -> signalservice.SyncMessage.OutgoingPayment.MobileCoin + 19, // 99: signalservice.SyncMessage.CallEvent.type:type_name -> signalservice.SyncMessage.CallEvent.Type + 20, // 100: signalservice.SyncMessage.CallEvent.direction:type_name -> signalservice.SyncMessage.CallEvent.Direction + 21, // 101: signalservice.SyncMessage.CallEvent.event:type_name -> signalservice.SyncMessage.CallEvent.Event + 22, // 102: signalservice.SyncMessage.CallLinkUpdate.type:type_name -> signalservice.SyncMessage.CallLinkUpdate.Type + 23, // 103: signalservice.SyncMessage.CallLogEvent.type:type_name -> signalservice.SyncMessage.CallLogEvent.Type + 102, // 104: signalservice.SyncMessage.DeleteForMe.messageDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.MessageDeletes + 104, // 105: signalservice.SyncMessage.DeleteForMe.conversationDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.ConversationDelete + 105, // 106: signalservice.SyncMessage.DeleteForMe.localOnlyConversationDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete + 103, // 107: signalservice.SyncMessage.DeleteForMe.attachmentDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.AttachmentDelete + 48, // 108: signalservice.SyncMessage.AttachmentBackfillRequest.targetMessage:type_name -> signalservice.AddressableMessage + 49, // 109: signalservice.SyncMessage.AttachmentBackfillRequest.targetConversation:type_name -> signalservice.ConversationIdentifier + 48, // 110: signalservice.SyncMessage.AttachmentBackfillResponse.targetMessage:type_name -> signalservice.AddressableMessage + 49, // 111: signalservice.SyncMessage.AttachmentBackfillResponse.targetConversation:type_name -> signalservice.ConversationIdentifier + 107, // 112: signalservice.SyncMessage.AttachmentBackfillResponse.attachments:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList + 24, // 113: signalservice.SyncMessage.AttachmentBackfillResponse.error:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.Error + 49, // 114: signalservice.SyncMessage.DeleteForMe.MessageDeletes.conversation:type_name -> signalservice.ConversationIdentifier + 48, // 115: signalservice.SyncMessage.DeleteForMe.MessageDeletes.messages:type_name -> signalservice.AddressableMessage + 49, // 116: signalservice.SyncMessage.DeleteForMe.AttachmentDelete.conversation:type_name -> signalservice.ConversationIdentifier + 48, // 117: signalservice.SyncMessage.DeleteForMe.AttachmentDelete.targetMessage:type_name -> signalservice.AddressableMessage + 49, // 118: signalservice.SyncMessage.DeleteForMe.ConversationDelete.conversation:type_name -> signalservice.ConversationIdentifier + 48, // 119: signalservice.SyncMessage.DeleteForMe.ConversationDelete.mostRecentMessages:type_name -> signalservice.AddressableMessage + 48, // 120: signalservice.SyncMessage.DeleteForMe.ConversationDelete.mostRecentNonExpiringMessages:type_name -> signalservice.AddressableMessage + 49, // 121: signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete.conversation:type_name -> signalservice.ConversationIdentifier + 40, // 122: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.attachment:type_name -> signalservice.AttachmentPointer + 25, // 123: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.status:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.Status + 106, // 124: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList.attachments:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData + 106, // 125: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList.longText:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData + 126, // [126:126] is the sub-list for method output_type + 126, // [126:126] is the sub-list for method input_type + 126, // [126:126] is the sub-list for extension type_name + 126, // [126:126] is the sub-list for extension extendee + 0, // [0:126] is the sub-list for field type_name } func init() { file_SignalService_proto_init() } @@ -9635,17 +8686,6 @@ func file_SignalService_proto_init() { if File_SignalService_proto != nil { return } - file_SignalService_proto_msgTypes[1].OneofWrappers = []any{ - (*Content_DataMessage)(nil), - (*Content_SyncMessage)(nil), - (*Content_CallMessage)(nil), - (*Content_NullMessage)(nil), - (*Content_ReceiptMessage)(nil), - (*Content_TypingMessage)(nil), - (*Content_DecryptionErrorMessage)(nil), - (*Content_StoryMessage)(nil), - (*Content_EditMessage)(nil), - } file_SignalService_proto_msgTypes[7].OneofWrappers = []any{ (*StoryMessage_FileAttachment)(nil), (*StoryMessage_TextAttachment)(nil), @@ -9654,27 +8694,6 @@ func file_SignalService_proto_init() { (*TextAttachment_Gradient_)(nil), (*TextAttachment_Color)(nil), } - file_SignalService_proto_msgTypes[11].OneofWrappers = []any{ - (*SyncMessage_Sent_)(nil), - (*SyncMessage_Contacts_)(nil), - (*SyncMessage_Request_)(nil), - (*SyncMessage_Blocked_)(nil), - (*SyncMessage_Verified)(nil), - (*SyncMessage_Configuration_)(nil), - (*SyncMessage_ViewOnceOpen_)(nil), - (*SyncMessage_FetchLatest_)(nil), - (*SyncMessage_Keys_)(nil), - (*SyncMessage_MessageRequestResponse_)(nil), - (*SyncMessage_OutgoingPayment_)(nil), - (*SyncMessage_PniChangeNumber_)(nil), - (*SyncMessage_CallEvent_)(nil), - (*SyncMessage_CallLinkUpdate_)(nil), - (*SyncMessage_CallLogEvent_)(nil), - (*SyncMessage_DeleteForMe_)(nil), - (*SyncMessage_DeviceNameChange_)(nil), - (*SyncMessage_AttachmentBackfillRequest_)(nil), - (*SyncMessage_AttachmentBackfillResponse_)(nil), - } file_SignalService_proto_msgTypes[12].OneofWrappers = []any{ (*AttachmentPointer_CdnId)(nil), (*AttachmentPointer_CdnKey)(nil), @@ -9685,41 +8704,34 @@ func file_SignalService_proto_init() { file_SignalService_proto_msgTypes[19].OneofWrappers = []any{ (*BodyRange_MentionAci)(nil), (*BodyRange_Style_)(nil), - (*BodyRange_MentionAciBinary)(nil), } file_SignalService_proto_msgTypes[20].OneofWrappers = []any{ (*AddressableMessage_AuthorServiceId)(nil), (*AddressableMessage_AuthorE164)(nil), - (*AddressableMessage_AuthorServiceIdBinary)(nil), } file_SignalService_proto_msgTypes[21].OneofWrappers = []any{ (*ConversationIdentifier_ThreadServiceId)(nil), (*ConversationIdentifier_ThreadGroupId)(nil), (*ConversationIdentifier_ThreadE164)(nil), - (*ConversationIdentifier_ThreadServiceIdBinary)(nil), } file_SignalService_proto_msgTypes[28].OneofWrappers = []any{ (*DataMessage_Payment_Notification_)(nil), (*DataMessage_Payment_Activation_)(nil), } - file_SignalService_proto_msgTypes[40].OneofWrappers = []any{ - (*DataMessage_PinMessage_PinDurationSeconds)(nil), - (*DataMessage_PinMessage_PinDurationForever)(nil), - } - file_SignalService_proto_msgTypes[43].OneofWrappers = []any{ + file_SignalService_proto_msgTypes[37].OneofWrappers = []any{ (*DataMessage_Payment_Amount_MobileCoin_)(nil), } - file_SignalService_proto_msgTypes[44].OneofWrappers = []any{ + file_SignalService_proto_msgTypes[38].OneofWrappers = []any{ (*DataMessage_Payment_Notification_MobileCoin_)(nil), } - file_SignalService_proto_msgTypes[68].OneofWrappers = []any{ + file_SignalService_proto_msgTypes[62].OneofWrappers = []any{ (*SyncMessage_OutgoingPayment_MobileCoin_)(nil), } - file_SignalService_proto_msgTypes[76].OneofWrappers = []any{ + file_SignalService_proto_msgTypes[70].OneofWrappers = []any{ (*SyncMessage_AttachmentBackfillResponse_Attachments)(nil), (*SyncMessage_AttachmentBackfillResponse_Error_)(nil), } - file_SignalService_proto_msgTypes[84].OneofWrappers = []any{ + file_SignalService_proto_msgTypes[78].OneofWrappers = []any{ (*SyncMessage_AttachmentBackfillResponse_AttachmentData_Attachment)(nil), (*SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_)(nil), } @@ -9729,7 +8741,7 @@ func file_SignalService_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_SignalService_proto_rawDesc), len(file_SignalService_proto_rawDesc)), NumEnums: 28, - NumMessages: 88, + NumMessages: 82, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/signalmeow/protobuf/SignalService.proto b/pkg/signalmeow/protobuf/SignalService.proto index 0089a16..a1fa8f9 100644 --- a/pkg/signalmeow/protobuf/SignalService.proto +++ b/pkg/signalmeow/protobuf/SignalService.proto @@ -13,79 +13,23 @@ option java_outer_classname = "SignalServiceProtos"; message Envelope { enum Type { UNKNOWN = 0; - - /** - * A double-ratchet message represents a "normal," "unsealed-sender" message - * encrypted using the Double Ratchet within an established Signal session. - * Double-ratchet messages include sender information in the plaintext - * portion of the `Envelope`. - */ - DOUBLE_RATCHET = 1; // content => (version byte | SignalMessage{Content}) - + CIPHERTEXT = 1; // content => (version byte | SignalMessage{Content}) reserved 2; reserved "KEY_EXCHANGE"; - - /** - * A prekey message begins a new Signal session. The `content` of a prekey - * message is a superset of a double-ratchet message's `content` and - * contains the sender's identity public key and information identifying the - * pre-keys used in the message's ciphertext. Like double-ratchet messages, - * prekey messages contain sender information in the plaintext portion of - * the `Envelope`. - */ - PREKEY_MESSAGE = 3; // content => (version byte | PreKeySignalMessage{Content}) - - /** - * Server delivery receipts are generated by the server when - * "unsealed-sender" messages are delivered to and acknowledged by the - * destination device. Server delivery receipts identify the sender in the - * plaintext portion of the `Envelope` and have no `content`. Note that - * receipts for sealed-sender messages are generated by clients as - * `UNIDENTIFIED_SENDER` messages. - * - * Note that, with server delivery receipts, the "client timestamp" on - * the envelope refers to the timestamp of the original message (i.e. the - * message the server just delivered) and not to the time of delivery. The - * "server timestamp" refers to the time of delivery. - */ - SERVER_DELIVERY_RECEIPT = 5; // content => [] - - /** - * An unidentified sender message represents a message with no sender - * information in the plaintext portion of the `Envelope`. Unidentified - * sender messages always contain an additional `subtype` in their - * `content`. They may or may not be part of an existing Signal session - * (i.e. an unidentified sender message may have a "prekey message" - * subtype or may indicate an encryption error). - */ - UNIDENTIFIED_SENDER = 6; // content => ((version byte | UnidentifiedSenderMessage) OR (version byte | Multi-Recipient Sealed Sender Format)) - - reserved 7; - reserved "SENDERKEY_MESSAGE"; - - /** - * A plaintext message is used solely to convey encryption error receipts - * and never contains encrypted message content. Encryption error receipts - * must be delivered in plaintext because, encryption/decryption of a prior - * message failed and there is no reason to believe that - * encryption/decryption of subsequent messages with the same key material - * would succeed. - * - * Critically, plaintext messages never have "real" message content - * generated by users. Plaintext messages include sender information. - */ - PLAINTEXT_CONTENT = 8; // content => (marker byte | Content) - - // next: 9 + PREKEY_BUNDLE = 3; // content => (version byte | PreKeySignalMessage{Content}) + SERVER_DELIVERY_RECEIPT = 5; // legacyMessage => [] AND content => [] + UNIDENTIFIED_SENDER = 6; // legacyMessage => [] AND content => ((version byte | UnidentifiedSenderMessage) OR (version byte | Multi-Recipient Sealed Sender Format)) + SENDERKEY_MESSAGE = 7; // legacyMessage => [] AND content => (version byte | SenderKeyMessage) + PLAINTEXT_CONTENT = 8; // legacyMessage => [] AND content => (marker byte | Content) } optional Type type = 1; reserved 2; // formerly optional string sourceE164 = 2; optional string sourceServiceId = 11; - optional uint32 sourceDeviceId = 7; + optional uint32 sourceDevice = 7; optional string destinationServiceId = 13; reserved 3; // formerly optional string relay = 3; - optional uint64 clientTimestamp = 5; + optional uint64 timestamp = 5; reserved 6; // formerly optional bytes legacyMessage = 6; // Contains an encrypted DataMessage; this field could have been set historically for type 1 or 3 messages; no longer in use optional bytes content = 8; // Contains an encrypted Content optional string serverGuid = 9; @@ -96,28 +40,21 @@ message Envelope { optional bool story = 16; // indicates that the content is a story. optional bytes report_spam_token = 17; // token sent when reporting spam reserved 18; // internal server use - optional bytes sourceServiceIdBinary = 19; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - optional bytes destinationServiceIdBinary = 20; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - optional bytes serverGuidBinary = 21; // 16-byte UUID - optional bytes updatedPniBinary = 22; // 16-byte UUID - // next: 22 + // next: 19 } message Content { - oneof content { - DataMessage dataMessage = 1; - SyncMessage syncMessage = 2; - CallMessage callMessage = 3; - NullMessage nullMessage = 4; - ReceiptMessage receiptMessage = 5; - TypingMessage typingMessage = 6; - bytes /* DecryptionErrorMessage */ decryptionErrorMessage = 8; - StoryMessage storyMessage = 9; - EditMessage editMessage = 11; - } - + optional DataMessage dataMessage = 1; + optional SyncMessage syncMessage = 2; + optional CallMessage callMessage = 3; + optional NullMessage nullMessage = 4; + optional ReceiptMessage receiptMessage = 5; + optional TypingMessage typingMessage = 6; optional bytes /* SenderKeyDistributionMessage */ senderKeyDistributionMessage = 7; + optional bytes /* DecryptionErrorMessage */ decryptionErrorMessage = 8; + optional StoryMessage storyMessage = 9; optional PniSignatureMessage pniSignatureMessage = 10; + optional EditMessage editMessage = 11; } message CallMessage { @@ -240,7 +177,6 @@ message DataMessage { enum Type { NORMAL = 0; GIFT_BADGE = 1; - POLL = 2; } message QuotedAttachment { @@ -256,7 +192,6 @@ message DataMessage { repeated QuotedAttachment attachments = 4; repeated BodyRange bodyRanges = 6; optional Type type = 7; - optional bytes authorAciBinary = 8; // 16-byte UUID } message Contact { @@ -341,7 +276,6 @@ message DataMessage { reserved /* targetAuthorE164 */ 3; optional string targetAuthorAci = 4; optional uint64 targetSentTimestamp = 5; - optional bytes targetAuthorAciBinary = 6; // 16-byte UUID } message Delete { @@ -355,7 +289,6 @@ message DataMessage { message StoryContext { optional string authorAci = 1; optional uint64 sentTimestamp = 2; - optional bytes authorAciBinary = 3; // 16-byte UUID } enum ProtocolVersion { @@ -369,50 +302,13 @@ message DataMessage { CDN_SELECTOR_ATTACHMENTS = 5; MENTIONS = 6; PAYMENTS = 7; - POLLS = 8; - CURRENT = 8; + CURRENT = 7; } message GiftBadge { optional bytes receiptCredentialPresentation = 1; } - message PollCreate { - optional string question = 1; - optional bool allowMultiple = 2; - repeated string options = 3; - } - - message PollTerminate { - optional uint64 targetSentTimestamp = 1; - } - - message PollVote { - optional bytes targetAuthorAciBinary = 1; - optional uint64 targetSentTimestamp = 2; - repeated uint32 optionIndexes = 3; - optional uint32 voteCount = 4; - } - - message PinMessage { - optional bytes targetAuthorAciBinary = 1; // 16-byte UUID - optional uint64 targetSentTimestamp = 2; - oneof pinDuration { - uint32 pinDurationSeconds = 3; - bool pinDurationForever = 4; - } - } - - message UnpinMessage { - optional bytes targetAuthorAciBinary = 1; // 16-byte UUID - optional uint64 targetSentTimestamp = 2; - } - - message AdminDelete { - optional bytes targetAuthorAciBinary = 1; // 16-byte UUID - optional uint64 targetSentTimestamp = 2; - } - optional string body = 1; repeated AttachmentPointer attachments = 2; reserved /*groupV1*/ 3; @@ -435,13 +331,7 @@ message DataMessage { optional Payment payment = 20; optional StoryContext storyContext = 21; optional GiftBadge giftBadge = 22; - optional PollCreate pollCreate = 24; - optional PollTerminate pollTerminate = 25; - optional PollVote pollVote = 26; - optional PinMessage pinMessage = 27; - optional UnpinMessage unpinMessage = 28; - optional AdminDelete adminDelete = 29; - // NEXT ID: 30 + // NEXT ID: 24 } message NullMessage { @@ -500,12 +390,6 @@ message TextAttachment { } message Gradient { - // Color ordering: - // 0 degrees: bottom-to-top - // 90 degrees: left-to-right - // 180 degrees: top-to-bottom - // 270 degrees: right-to-left - optional uint32 startColor = 1; // deprecated: this field will be removed in a future release. optional uint32 endColor = 2; // deprecated: this field will be removed in a future release. optional uint32 angle = 3; // degrees @@ -536,7 +420,6 @@ message Verified { optional bytes identityKey = 2; optional State state = 3; optional bytes nullMessage = 4; - optional bytes destinationAciBinary = 6; // 16-byte UUID } message SyncMessage { @@ -547,7 +430,6 @@ message SyncMessage { optional bool unidentified = 2; reserved /*destinationPni */ 4; optional bytes destinationPniIdentityKey = 5; // Only set for PNI destinations - optional bytes destinationServiceIdBinary = 6; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) } message StoryMessageRecipient { @@ -555,7 +437,6 @@ message SyncMessage { repeated string distributionListIds = 2; optional bool isAllowedToReply = 3; reserved /*destinationPni */ 4; - optional bytes destinationServiceIdBinary = 5; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) } optional string destinationE164 = 1; @@ -569,8 +450,7 @@ message SyncMessage { repeated StoryMessageRecipient storyMessageRecipients = 9; optional EditMessage editMessage = 10; reserved /*destinationPni */ 11; - optional bytes destinationServiceIdBinary = 12; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - // Next ID: 13 + // Next ID: 12 } message Contacts { @@ -582,7 +462,6 @@ message SyncMessage { repeated string numbers = 1; repeated string acis = 3; repeated bytes groupIds = 2; - repeated bytes acisBinary = 4; // 16-byte UUID } message Request { @@ -603,14 +482,12 @@ message SyncMessage { reserved /*senderE164*/ 1; optional string senderAci = 3; optional uint64 timestamp = 2; - optional bytes senderAciBinary = 4; // 16-byte UUID } message Viewed { reserved /*senderE164*/ 1; optional string senderAci = 3; optional uint64 timestamp = 2; - optional bytes senderAciBinary = 4; // 16-byte UUID } message Configuration { @@ -618,7 +495,7 @@ message SyncMessage { optional bool unidentifiedDeliveryIndicators = 2; optional bool typingIndicators = 3; reserved /* linkPreviews */ 4; - reserved /* provisioningVersion */ 5; + optional uint32 provisioningVersion = 5; optional bool linkPreviews = 6; } @@ -637,7 +514,6 @@ message SyncMessage { reserved /*senderE164*/ 1; optional string senderAci = 3; optional uint64 timestamp = 2; - optional bytes senderAciBinary = 4; // 16-byte UUID } message FetchLatest { @@ -653,7 +529,7 @@ message SyncMessage { message Keys { reserved /* storageService */ 1; - reserved /* master */ 2; + optional bytes master = 2; // deprecated: this field will be removed in a future release. optional string accountEntropyPool = 3; optional bytes mediaRootBackupKey = 4; } @@ -678,7 +554,6 @@ message SyncMessage { optional string threadAci = 2; optional bytes groupId = 3; optional Type type = 4; - optional bytes threadAciBinary = 5; // 16-byte UUID } message OutgoingPayment { @@ -753,7 +628,7 @@ message SyncMessage { optional bytes rootKey = 1; optional bytes adminPasskey = 2; optional Type type = 3; // defaults to UPDATE - reserved /*epoch*/ 4; + optional bytes epoch = 4; } message CallLogEvent { @@ -850,40 +725,31 @@ message SyncMessage { } } - oneof content { - Sent sent = 1; - Contacts contacts = 2; - Request request = 4; - Blocked blocked = 6; - Verified verified = 7; - Configuration configuration = 9; - ViewOnceOpen viewOnceOpen = 11; - FetchLatest fetchLatest = 12; - Keys keys = 13; - MessageRequestResponse messageRequestResponse = 14; - OutgoingPayment outgoingPayment = 15; - PniChangeNumber pniChangeNumber = 18; - CallEvent callEvent = 19; - CallLinkUpdate callLinkUpdate = 20; - CallLogEvent callLogEvent = 21; - DeleteForMe deleteForMe = 22; - DeviceNameChange deviceNameChange = 23; - AttachmentBackfillRequest attachmentBackfillRequest = 24; - AttachmentBackfillResponse attachmentBackfillResponse = 25; - } - + optional Sent sent = 1; + optional Contacts contacts = 2; reserved /*groups*/ 3; - - // Protobufs don't allow `repeated` fields to be inside of `oneof` so while - // the fields below are mutually exclusive with the rest of the values above - // we have to place them outside of `oneof`. + optional Request request = 4; repeated Read read = 5; - repeated StickerPackOperation stickerPackOperation = 10; - repeated Viewed viewed = 16; - - reserved /*pniIdentity*/ 17; - + optional Blocked blocked = 6; + optional Verified verified = 7; + optional Configuration configuration = 9; optional bytes padding = 8; + repeated StickerPackOperation stickerPackOperation = 10; + optional ViewOnceOpen viewOnceOpen = 11; + optional FetchLatest fetchLatest = 12; + optional Keys keys = 13; + optional MessageRequestResponse messageRequestResponse = 14; + optional OutgoingPayment outgoingPayment = 15; + repeated Viewed viewed = 16; + reserved /*pniIdentity*/ 17; + optional PniChangeNumber pniChangeNumber = 18; + optional CallEvent callEvent = 19; + optional CallLinkUpdate callLinkUpdate = 20; + optional CallLogEvent callLogEvent = 21; + optional DeleteForMe deleteForMe = 22; + optional DeviceNameChange deviceNameChange = 23; + optional AttachmentBackfillRequest attachmentBackfillRequest = 24; + optional AttachmentBackfillResponse attachmentBackfillResponse = 25; } message AttachmentPointer { @@ -935,7 +801,6 @@ message ContactDetails { optional string number = 1; optional string aci = 9; - optional bytes aciBinary = 13; // 16-byte UUID optional string name = 2; optional Avatar avatar = 3; reserved /* color */ 4; @@ -946,7 +811,7 @@ message ContactDetails { optional uint32 expireTimerVersion = 12; optional uint32 inboxPosition = 10; reserved /* archived */ 11; - // NEXT ID: 14 + // NEXT ID: 13 } message PaymentAddress { @@ -993,7 +858,6 @@ message BodyRange { oneof associatedValue { string mentionAci = 3; Style style = 4; - bytes mentionAciBinary = 5; // 16-byte UUID } } @@ -1001,7 +865,6 @@ message AddressableMessage { oneof author { string authorServiceId = 1; string authorE164 = 2; - bytes authorServiceIdBinary = 4; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) } optional uint64 sentTimestamp = 3; } @@ -1011,6 +874,5 @@ message ConversationIdentifier { string threadServiceId = 1; bytes threadGroupId = 2; string threadE164 = 3; - bytes threadServiceIdBinary = 4; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) } } diff --git a/pkg/signalmeow/protobuf/StickerResources.pb.go b/pkg/signalmeow/protobuf/StickerResources.pb.go index f8194aa..b1969bc 100644 --- a/pkg/signalmeow/protobuf/StickerResources.pb.go +++ b/pkg/signalmeow/protobuf/StickerResources.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: StickerResources.proto package signalpb diff --git a/pkg/signalmeow/protobuf/StorageService.pb.go b/pkg/signalmeow/protobuf/StorageService.pb.go index bbe88ef..33804f6 100644 --- a/pkg/signalmeow/protobuf/StorageService.pb.go +++ b/pkg/signalmeow/protobuf/StorageService.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: StorageService.proto package signalpb @@ -1086,9 +1086,7 @@ type ContactRecord struct { PniSignatureVerified bool `protobuf:"varint,21,opt,name=pniSignatureVerified,proto3" json:"pniSignatureVerified,omitempty"` Nickname *ContactRecord_Name `protobuf:"bytes,22,opt,name=nickname,proto3" json:"nickname,omitempty"` Note string `protobuf:"bytes,23,opt,name=note,proto3" json:"note,omitempty"` - AvatarColor *AvatarColor `protobuf:"varint,24,opt,name=avatarColor,proto3,enum=signalservice.AvatarColor,oneof" json:"avatarColor,omitempty"` - AciBinary []byte `protobuf:"bytes,25,opt,name=aciBinary,proto3" json:"aciBinary,omitempty"` // 16-byte UUID - PniBinary []byte `protobuf:"bytes,26,opt,name=pniBinary,proto3" json:"pniBinary,omitempty"` // 16-byte UUID + AvatarColor *AvatarColor `protobuf:"varint,24,opt,name=avatarColor,proto3,enum=signalservice.AvatarColor,oneof" json:"avatarColor,omitempty"` // Next ID: 25 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1291,20 +1289,6 @@ func (x *ContactRecord) GetAvatarColor() AvatarColor { return AvatarColor_A100 } -func (x *ContactRecord) GetAciBinary() []byte { - if x != nil { - return x.AciBinary - } - return nil -} - -func (x *ContactRecord) GetPniBinary() []byte { - if x != nil { - return x.PniBinary - } - return nil -} - type GroupV1Record struct { state protoimpl.MessageState `protogen:"open.v1"` Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -1401,7 +1385,6 @@ type GroupV2Record struct { HideStory bool `protobuf:"varint,8,opt,name=hideStory,proto3" json:"hideStory,omitempty"` StorySendMode GroupV2Record_StorySendMode `protobuf:"varint,10,opt,name=storySendMode,proto3,enum=signalservice.GroupV2Record_StorySendMode" json:"storySendMode,omitempty"` AvatarColor *AvatarColor `protobuf:"varint,11,opt,name=avatarColor,proto3,enum=signalservice.AvatarColor,oneof" json:"avatarColor,omitempty"` - VerifiedNameHash []byte `protobuf:"bytes,12,opt,name=verifiedNameHash,proto3" json:"verifiedNameHash,omitempty"` // SHA-256 of UTF-8 encoded decrypted group title that was last verified unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1506,13 +1489,6 @@ func (x *GroupV2Record) GetAvatarColor() AvatarColor { return AvatarColor_A100 } -func (x *GroupV2Record) GetVerifiedNameHash() []byte { - if x != nil { - return x.VerifiedNameHash - } - return nil -} - type Payments struct { state protoimpl.MessageState `protogen:"open.v1"` Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` @@ -1604,9 +1580,6 @@ type AccountRecord struct { AvatarColor *AvatarColor `protobuf:"varint,42,opt,name=avatarColor,proto3,enum=signalservice.AvatarColor,oneof" json:"avatarColor,omitempty"` BackupTierHistory *AccountRecord_BackupTierHistory `protobuf:"bytes,43,opt,name=backupTierHistory,proto3" json:"backupTierHistory,omitempty"` NotificationProfileManualOverride *AccountRecord_NotificationProfileManualOverride `protobuf:"bytes,44,opt,name=notificationProfileManualOverride,proto3" json:"notificationProfileManualOverride,omitempty"` - NotificationProfileSyncDisabled bool `protobuf:"varint,45,opt,name=notificationProfileSyncDisabled,proto3" json:"notificationProfileSyncDisabled,omitempty"` - AutomaticKeyVerificationDisabled bool `protobuf:"varint,46,opt,name=automaticKeyVerificationDisabled,proto3" json:"automaticKeyVerificationDisabled,omitempty"` - HasSeenAdminDeleteEducationDialog bool `protobuf:"varint,47,opt,name=hasSeenAdminDeleteEducationDialog,proto3" json:"hasSeenAdminDeleteEducationDialog,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1900,38 +1873,16 @@ func (x *AccountRecord) GetNotificationProfileManualOverride() *AccountRecord_No return nil } -func (x *AccountRecord) GetNotificationProfileSyncDisabled() bool { - if x != nil { - return x.NotificationProfileSyncDisabled - } - return false -} - -func (x *AccountRecord) GetAutomaticKeyVerificationDisabled() bool { - if x != nil { - return x.AutomaticKeyVerificationDisabled - } - return false -} - -func (x *AccountRecord) GetHasSeenAdminDeleteEducationDialog() bool { - if x != nil { - return x.HasSeenAdminDeleteEducationDialog - } - return false -} - type StoryDistributionListRecord struct { - state protoimpl.MessageState `protogen:"open.v1"` - Identifier []byte `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - RecipientServiceIds []string `protobuf:"bytes,3,rep,name=recipientServiceIds,proto3" json:"recipientServiceIds,omitempty"` - DeletedAtTimestamp uint64 `protobuf:"varint,4,opt,name=deletedAtTimestamp,proto3" json:"deletedAtTimestamp,omitempty"` - AllowsReplies bool `protobuf:"varint,5,opt,name=allowsReplies,proto3" json:"allowsReplies,omitempty"` - IsBlockList bool `protobuf:"varint,6,opt,name=isBlockList,proto3" json:"isBlockList,omitempty"` - RecipientServiceIdsBinary [][]byte `protobuf:"bytes,7,rep,name=recipientServiceIdsBinary,proto3" json:"recipientServiceIdsBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Identifier []byte `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + RecipientServiceIds []string `protobuf:"bytes,3,rep,name=recipientServiceIds,proto3" json:"recipientServiceIds,omitempty"` + DeletedAtTimestamp uint64 `protobuf:"varint,4,opt,name=deletedAtTimestamp,proto3" json:"deletedAtTimestamp,omitempty"` + AllowsReplies bool `protobuf:"varint,5,opt,name=allowsReplies,proto3" json:"allowsReplies,omitempty"` + IsBlockList bool `protobuf:"varint,6,opt,name=isBlockList,proto3" json:"isBlockList,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *StoryDistributionListRecord) Reset() { @@ -2006,18 +1957,12 @@ func (x *StoryDistributionListRecord) GetIsBlockList() bool { return false } -func (x *StoryDistributionListRecord) GetRecipientServiceIdsBinary() [][]byte { - if x != nil { - return x.RecipientServiceIdsBinary - } - return nil -} - type CallLinkRecord struct { state protoimpl.MessageState `protogen:"open.v1"` RootKey []byte `protobuf:"bytes,1,opt,name=rootKey,proto3" json:"rootKey,omitempty"` AdminPasskey []byte `protobuf:"bytes,2,opt,name=adminPasskey,proto3" json:"adminPasskey,omitempty"` DeletedAtTimestampMs uint64 `protobuf:"varint,3,opt,name=deletedAtTimestampMs,proto3" json:"deletedAtTimestampMs,omitempty"` + Epoch []byte `protobuf:"bytes,4,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2073,6 +2018,13 @@ func (x *CallLinkRecord) GetDeletedAtTimestampMs() uint64 { return 0 } +func (x *CallLinkRecord) GetEpoch() []byte { + if x != nil { + return x.Epoch + } + return nil +} + type Recipient struct { state protoimpl.MessageState `protogen:"open.v1"` // Types that are valid to be assigned to Identifier: @@ -2931,12 +2883,11 @@ func (*AccountRecord_NotificationProfileManualOverride_Enabled) isAccountRecord_ } type AccountRecord_PinnedConversation_Contact struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` - E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` - ServiceIdBinary []byte `protobuf:"bytes,3,opt,name=serviceIdBinary,proto3" json:"serviceIdBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` + E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AccountRecord_PinnedConversation_Contact) Reset() { @@ -2983,13 +2934,6 @@ func (x *AccountRecord_PinnedConversation_Contact) GetE164() string { return "" } -func (x *AccountRecord_PinnedConversation_Contact) GetServiceIdBinary() []byte { - if x != nil { - return x.ServiceIdBinary - } - return nil -} - type AccountRecord_NotificationProfileManualOverride_ManuallyEnabled struct { state protoimpl.MessageState `protogen:"open.v1"` Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -3044,12 +2988,11 @@ func (x *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) GetEnd } type Recipient_Contact struct { - state protoimpl.MessageState `protogen:"open.v1"` - ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` - E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` - ServiceIdBinary []byte `protobuf:"bytes,3,opt,name=serviceIdBinary,proto3" json:"serviceIdBinary,omitempty"` // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` + E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Recipient_Contact) Reset() { @@ -3096,13 +3039,6 @@ func (x *Recipient_Contact) GetE164() string { return "" } -func (x *Recipient_Contact) GetServiceIdBinary() []byte { - if x != nil { - return x.ServiceIdBinary - } - return nil -} - var File_StorageService_proto protoreflect.FileDescriptor const file_StorageService_proto_rawDesc = "" + @@ -3155,7 +3091,7 @@ const file_StorageService_proto_rawDesc = "" + "chatFolder\x18\b \x01(\v2\x1f.signalservice.ChatFolderRecordH\x00R\n" + "chatFolder\x12V\n" + "\x13notificationProfile\x18\t \x01(\v2\".signalservice.NotificationProfileH\x00R\x13notificationProfileB\b\n" + - "\x06record\"\xd9\b\n" + + "\x06record\"\x9d\b\n" + "\rContactRecord\x12\x10\n" + "\x03aci\x18\x01 \x01(\tR\x03aci\x12\x12\n" + "\x04e164\x18\x02 \x01(\tR\x04e164\x12\x10\n" + @@ -3185,9 +3121,7 @@ const file_StorageService_proto_rawDesc = "" + "\x14pniSignatureVerified\x18\x15 \x01(\bR\x14pniSignatureVerified\x12=\n" + "\bnickname\x18\x16 \x01(\v2!.signalservice.ContactRecord.NameR\bnickname\x12\x12\n" + "\x04note\x18\x17 \x01(\tR\x04note\x12A\n" + - "\vavatarColor\x18\x18 \x01(\x0e2\x1a.signalservice.AvatarColorH\x00R\vavatarColor\x88\x01\x01\x12\x1c\n" + - "\taciBinary\x18\x19 \x01(\fR\taciBinary\x12\x1c\n" + - "\tpniBinary\x18\x1a \x01(\fR\tpniBinary\x1a4\n" + + "\vavatarColor\x18\x18 \x01(\x0e2\x1a.signalservice.AvatarColorH\x00R\vavatarColor\x88\x01\x01\x1a4\n" + "\x04Name\x12\x14\n" + "\x05given\x18\x01 \x01(\tR\x05given\x12\x16\n" + "\x06family\x18\x02 \x01(\tR\x06family\":\n" + @@ -3203,7 +3137,7 @@ const file_StorageService_proto_rawDesc = "" + "\vwhitelisted\x18\x03 \x01(\bR\vwhitelisted\x12\x1a\n" + "\barchived\x18\x04 \x01(\bR\barchived\x12\"\n" + "\fmarkedUnread\x18\x05 \x01(\bR\fmarkedUnread\x120\n" + - "\x13mutedUntilTimestamp\x18\x06 \x01(\x04R\x13mutedUntilTimestamp\"\xcd\x04\n" + + "\x13mutedUntilTimestamp\x18\x06 \x01(\x04R\x13mutedUntilTimestamp\"\xa1\x04\n" + "\rGroupV2Record\x12\x1c\n" + "\tmasterKey\x18\x01 \x01(\fR\tmasterKey\x12\x18\n" + "\ablocked\x18\x02 \x01(\bR\ablocked\x12 \n" + @@ -3215,8 +3149,7 @@ const file_StorageService_proto_rawDesc = "" + "\thideStory\x18\b \x01(\bR\thideStory\x12P\n" + "\rstorySendMode\x18\n" + " \x01(\x0e2*.signalservice.GroupV2Record.StorySendModeR\rstorySendMode\x12A\n" + - "\vavatarColor\x18\v \x01(\x0e2\x1a.signalservice.AvatarColorH\x00R\vavatarColor\x88\x01\x01\x12*\n" + - "\x10verifiedNameHash\x18\f \x01(\fR\x10verifiedNameHash\"7\n" + + "\vavatarColor\x18\v \x01(\x0e2\x1a.signalservice.AvatarColorH\x00R\vavatarColor\x88\x01\x01\"7\n" + "\rStorySendMode\x12\v\n" + "\aDEFAULT\x10\x00\x12\f\n" + "\bDISABLED\x10\x01\x12\v\n" + @@ -3225,7 +3158,7 @@ const file_StorageService_proto_rawDesc = "" + "\">\n" + "\bPayments\x12\x18\n" + "\aenabled\x18\x01 \x01(\bR\aenabled\x12\x18\n" + - "\aentropy\x18\x02 \x01(\fR\aentropy\"\x99\x1d\n" + + "\aentropy\x18\x02 \x01(\fR\aentropy\"\x8b\x1b\n" + "\rAccountRecord\x12\x1e\n" + "\n" + "profileKey\x18\x01 \x01(\fR\n" + @@ -3270,18 +3203,14 @@ const file_StorageService_proto_rawDesc = "" + "\x14backupSubscriberData\x18) \x01(\v2..signalservice.AccountRecord.IAPSubscriberDataR\x14backupSubscriberData\x12A\n" + "\vavatarColor\x18* \x01(\x0e2\x1a.signalservice.AvatarColorH\x02R\vavatarColor\x88\x01\x01\x12\\\n" + "\x11backupTierHistory\x18+ \x01(\v2..signalservice.AccountRecord.BackupTierHistoryR\x11backupTierHistory\x12\x8c\x01\n" + - "!notificationProfileManualOverride\x18, \x01(\v2>.signalservice.AccountRecord.NotificationProfileManualOverrideR!notificationProfileManualOverride\x12H\n" + - "\x1fnotificationProfileSyncDisabled\x18- \x01(\bR\x1fnotificationProfileSyncDisabled\x12J\n" + - " automaticKeyVerificationDisabled\x18. \x01(\bR automaticKeyVerificationDisabled\x12L\n" + - "!hasSeenAdminDeleteEducationDialog\x18/ \x01(\bR!hasSeenAdminDeleteEducationDialog\x1a\xb0\x02\n" + + "!notificationProfileManualOverride\x18, \x01(\v2>.signalservice.AccountRecord.NotificationProfileManualOverrideR!notificationProfileManualOverride\x1a\x86\x02\n" + "\x12PinnedConversation\x12S\n" + "\acontact\x18\x01 \x01(\v27.signalservice.AccountRecord.PinnedConversation.ContactH\x00R\acontact\x12&\n" + "\rlegacyGroupId\x18\x03 \x01(\fH\x00R\rlegacyGroupId\x12(\n" + - "\x0egroupMasterKey\x18\x04 \x01(\fH\x00R\x0egroupMasterKey\x1ae\n" + + "\x0egroupMasterKey\x18\x04 \x01(\fH\x00R\x0egroupMasterKey\x1a;\n" + "\aContact\x12\x1c\n" + "\tserviceId\x18\x01 \x01(\tR\tserviceId\x12\x12\n" + - "\x04e164\x18\x02 \x01(\tR\x04e164\x12(\n" + - "\x0fserviceIdBinary\x18\x03 \x01(\fR\x0fserviceIdBinaryB\f\n" + + "\x04e164\x18\x02 \x01(\tR\x04e164B\f\n" + "\n" + "identifier\x1a\xf8\x01\n" + "\fUsernameLink\x12\x18\n" + @@ -3329,7 +3258,7 @@ const file_StorageService_proto_rawDesc = "" + "_hasBackupB\r\n" + "\v_backupTierB\x0e\n" + "\f_avatarColorJ\x04\b\t\x10\n" + - "J\x04\b\x13\x10\x14J\x04\b\x1c\x10\x1dJ\x04\b\x1f\x10 J\x04\b$\x10%J\x04\b%\x10&J\x04\b&\x10'\"\xb9\x02\n" + + "J\x04\b\x13\x10\x14J\x04\b\x1c\x10\x1dJ\x04\b\x1f\x10 J\x04\b$\x10%J\x04\b%\x10&J\x04\b&\x10'\"\xfb\x01\n" + "\x1bStoryDistributionListRecord\x12\x1e\n" + "\n" + "identifier\x18\x01 \x01(\fR\n" + @@ -3338,20 +3267,20 @@ const file_StorageService_proto_rawDesc = "" + "\x13recipientServiceIds\x18\x03 \x03(\tR\x13recipientServiceIds\x12.\n" + "\x12deletedAtTimestamp\x18\x04 \x01(\x04R\x12deletedAtTimestamp\x12$\n" + "\rallowsReplies\x18\x05 \x01(\bR\rallowsReplies\x12 \n" + - "\visBlockList\x18\x06 \x01(\bR\visBlockList\x12<\n" + - "\x19recipientServiceIdsBinary\x18\a \x03(\fR\x19recipientServiceIdsBinary\"\x88\x01\n" + + "\visBlockList\x18\x06 \x01(\bR\visBlockList\"\xa7\x01\n" + "\x0eCallLinkRecord\x12\x18\n" + "\arootKey\x18\x01 \x01(\fR\arootKey\x12\"\n" + "\fadminPasskey\x18\x02 \x01(\fR\fadminPasskey\x122\n" + - "\x14deletedAtTimestampMs\x18\x03 \x01(\x04R\x14deletedAtTimestampMsJ\x04\b\x04\x10\x05\"\x90\x02\n" + + "\x14deletedAtTimestampMs\x18\x03 \x01(\x04R\x14deletedAtTimestampMs\x12\x19\n" + + "\x05epoch\x18\x04 \x01(\fH\x00R\x05epoch\x88\x01\x01B\b\n" + + "\x06_epoch\"\xe6\x01\n" + "\tRecipient\x12<\n" + "\acontact\x18\x01 \x01(\v2 .signalservice.Recipient.ContactH\x00R\acontact\x12&\n" + "\rlegacyGroupId\x18\x02 \x01(\fH\x00R\rlegacyGroupId\x12(\n" + - "\x0egroupMasterKey\x18\x03 \x01(\fH\x00R\x0egroupMasterKey\x1ae\n" + + "\x0egroupMasterKey\x18\x03 \x01(\fH\x00R\x0egroupMasterKey\x1a;\n" + "\aContact\x12\x1c\n" + "\tserviceId\x18\x01 \x01(\tR\tserviceId\x12\x12\n" + - "\x04e164\x18\x02 \x01(\tR\x04e164\x12(\n" + - "\x0fserviceIdBinary\x18\x03 \x01(\fR\x0fserviceIdBinaryB\f\n" + + "\x04e164\x18\x02 \x01(\tR\x04e164B\f\n" + "\n" + "identifier\"\xe8\x04\n" + "\x10ChatFolderRecord\x12\x1e\n" + @@ -3539,6 +3468,7 @@ func file_StorageService_proto_init() { file_StorageService_proto_msgTypes[7].OneofWrappers = []any{} file_StorageService_proto_msgTypes[9].OneofWrappers = []any{} file_StorageService_proto_msgTypes[11].OneofWrappers = []any{} + file_StorageService_proto_msgTypes[13].OneofWrappers = []any{} file_StorageService_proto_msgTypes[14].OneofWrappers = []any{ (*Recipient_Contact_)(nil), (*Recipient_LegacyGroupId)(nil), diff --git a/pkg/signalmeow/protobuf/StorageService.proto b/pkg/signalmeow/protobuf/StorageService.proto index dd232ca..4258fba 100644 --- a/pkg/signalmeow/protobuf/StorageService.proto +++ b/pkg/signalmeow/protobuf/StorageService.proto @@ -140,9 +140,7 @@ message ContactRecord { Name nickname = 22; string note = 23; optional AvatarColor avatarColor = 24; - bytes aciBinary = 25; // 16-byte UUID - bytes pniBinary = 26; // 16-byte UUID - // Next ID: 27 + // Next ID: 25 } message GroupV1Record { @@ -172,7 +170,6 @@ message GroupV2Record { reserved /* storySendEnabled */ 9; StorySendMode storySendMode = 10; optional AvatarColor avatarColor = 11; - bytes verifiedNameHash = 12; // SHA-256 of UTF-8 encoded decrypted group title that was last verified } message Payments { @@ -190,9 +187,8 @@ message AccountRecord { message PinnedConversation { message Contact { - string serviceId = 1; - string e164 = 2; - bytes serviceIdBinary = 3; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) + string serviceId = 1; + string e164 = 2; } oneof identifier { @@ -295,33 +291,28 @@ message AccountRecord { optional AvatarColor avatarColor = 42; BackupTierHistory backupTierHistory = 43; NotificationProfileManualOverride notificationProfileManualOverride = 44; - bool notificationProfileSyncDisabled = 45; - bool automaticKeyVerificationDisabled = 46; - bool hasSeenAdminDeleteEducationDialog = 47; } message StoryDistributionListRecord { - bytes identifier = 1; - string name = 2; - repeated string recipientServiceIds = 3; - uint64 deletedAtTimestamp = 4; - bool allowsReplies = 5; - bool isBlockList = 6; - repeated bytes recipientServiceIdsBinary = 7; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) + bytes identifier = 1; + string name = 2; + repeated string recipientServiceIds = 3; + uint64 deletedAtTimestamp = 4; + bool allowsReplies = 5; + bool isBlockList = 6; } message CallLinkRecord { bytes rootKey = 1; bytes adminPasskey = 2; uint64 deletedAtTimestampMs = 3; - reserved 4; // was epoch field, never used + optional bytes epoch = 4; } message Recipient { message Contact { - string serviceId = 1; - string e164 = 2; - bytes serviceIdBinary = 3; // service ID binary (i.e. 16 byte UUID for ACI, 1 byte prefix + 16 byte UUID for PNI) + string serviceId = 1; + string e164 = 2; } oneof identifier { diff --git a/pkg/signalmeow/protobuf/UnidentifiedDelivery.pb.go b/pkg/signalmeow/protobuf/UnidentifiedDelivery.pb.go index 5979a4c..bb5b256 100644 --- a/pkg/signalmeow/protobuf/UnidentifiedDelivery.pb.go +++ b/pkg/signalmeow/protobuf/UnidentifiedDelivery.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: UnidentifiedDelivery.proto // Copyright 2018 Signal Messenger, LLC diff --git a/pkg/signalmeow/protobuf/WebSocketResources.pb.go b/pkg/signalmeow/protobuf/WebSocketResources.pb.go index 66520eb..ff48cda 100644 --- a/pkg/signalmeow/protobuf/WebSocketResources.pb.go +++ b/pkg/signalmeow/protobuf/WebSocketResources.pb.go @@ -5,8 +5,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: WebSocketResources.proto package signalpb diff --git a/pkg/signalmeow/protobuf/backuppb/Backup.pb.go b/pkg/signalmeow/protobuf/backuppb/Backup.pb.go index bc488e7..3eaaed0 100644 --- a/pkg/signalmeow/protobuf/backuppb/Backup.pb.go +++ b/pkg/signalmeow/protobuf/backuppb/Backup.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 +// protoc-gen-go v1.36.6 +// protoc v3.21.12 // source: backuppb/Backup.proto package backuppb @@ -210,159 +210,6 @@ func (AccountData_PhoneNumberSharingMode) EnumDescriptor() ([]byte, []int) { return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 0} } -type AccountData_SentMediaQuality int32 - -const ( - AccountData_UNKNOWN_QUALITY AccountData_SentMediaQuality = 0 // Interpret as "Standard" - AccountData_STANDARD AccountData_SentMediaQuality = 1 - AccountData_HIGH AccountData_SentMediaQuality = 2 -) - -// Enum value maps for AccountData_SentMediaQuality. -var ( - AccountData_SentMediaQuality_name = map[int32]string{ - 0: "UNKNOWN_QUALITY", - 1: "STANDARD", - 2: "HIGH", - } - AccountData_SentMediaQuality_value = map[string]int32{ - "UNKNOWN_QUALITY": 0, - "STANDARD": 1, - "HIGH": 2, - } -) - -func (x AccountData_SentMediaQuality) Enum() *AccountData_SentMediaQuality { - p := new(AccountData_SentMediaQuality) - *p = x - return p -} - -func (x AccountData_SentMediaQuality) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_SentMediaQuality) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[3].Descriptor() -} - -func (AccountData_SentMediaQuality) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[3] -} - -func (x AccountData_SentMediaQuality) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_SentMediaQuality.Descriptor instead. -func (AccountData_SentMediaQuality) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 1} -} - -type AccountData_AppTheme int32 - -const ( - AccountData_UNKNOWN_APP_THEME AccountData_AppTheme = 0 // Interpret as "System" - AccountData_SYSTEM AccountData_AppTheme = 1 - AccountData_LIGHT AccountData_AppTheme = 2 - AccountData_DARK AccountData_AppTheme = 3 -) - -// Enum value maps for AccountData_AppTheme. -var ( - AccountData_AppTheme_name = map[int32]string{ - 0: "UNKNOWN_APP_THEME", - 1: "SYSTEM", - 2: "LIGHT", - 3: "DARK", - } - AccountData_AppTheme_value = map[string]int32{ - "UNKNOWN_APP_THEME": 0, - "SYSTEM": 1, - "LIGHT": 2, - "DARK": 3, - } -) - -func (x AccountData_AppTheme) Enum() *AccountData_AppTheme { - p := new(AccountData_AppTheme) - *p = x - return p -} - -func (x AccountData_AppTheme) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_AppTheme) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[4].Descriptor() -} - -func (AccountData_AppTheme) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[4] -} - -func (x AccountData_AppTheme) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_AppTheme.Descriptor instead. -func (AccountData_AppTheme) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 2} -} - -type AccountData_CallsUseLessDataSetting int32 - -const ( - AccountData_UNKNOWN_CALL_DATA_SETTING AccountData_CallsUseLessDataSetting = 0 // Interpret as "Never" - AccountData_NEVER AccountData_CallsUseLessDataSetting = 1 - AccountData_MOBILE_DATA_ONLY AccountData_CallsUseLessDataSetting = 2 - AccountData_WIFI_AND_MOBILE_DATA AccountData_CallsUseLessDataSetting = 3 -) - -// Enum value maps for AccountData_CallsUseLessDataSetting. -var ( - AccountData_CallsUseLessDataSetting_name = map[int32]string{ - 0: "UNKNOWN_CALL_DATA_SETTING", - 1: "NEVER", - 2: "MOBILE_DATA_ONLY", - 3: "WIFI_AND_MOBILE_DATA", - } - AccountData_CallsUseLessDataSetting_value = map[string]int32{ - "UNKNOWN_CALL_DATA_SETTING": 0, - "NEVER": 1, - "MOBILE_DATA_ONLY": 2, - "WIFI_AND_MOBILE_DATA": 3, - } -) - -func (x AccountData_CallsUseLessDataSetting) Enum() *AccountData_CallsUseLessDataSetting { - p := new(AccountData_CallsUseLessDataSetting) - *p = x - return p -} - -func (x AccountData_CallsUseLessDataSetting) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_CallsUseLessDataSetting) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[5].Descriptor() -} - -func (AccountData_CallsUseLessDataSetting) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[5] -} - -func (x AccountData_CallsUseLessDataSetting) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_CallsUseLessDataSetting.Descriptor instead. -func (AccountData_CallsUseLessDataSetting) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 3} -} - type AccountData_UsernameLink_Color int32 const ( @@ -414,11 +261,11 @@ func (x AccountData_UsernameLink_Color) String() string { } func (AccountData_UsernameLink_Color) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[6].Descriptor() + return file_backuppb_Backup_proto_enumTypes[3].Descriptor() } func (AccountData_UsernameLink_Color) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[6] + return &file_backuppb_Backup_proto_enumTypes[3] } func (x AccountData_UsernameLink_Color) Number() protoreflect.EnumNumber { @@ -430,107 +277,6 @@ func (AccountData_UsernameLink_Color) EnumDescriptor() ([]byte, []int) { return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 0, 0} } -type AccountData_AutoDownloadSettings_AutoDownloadOption int32 - -const ( - AccountData_AutoDownloadSettings_UNKNOWN AccountData_AutoDownloadSettings_AutoDownloadOption = 0 // Interpret as "Never" - AccountData_AutoDownloadSettings_NEVER AccountData_AutoDownloadSettings_AutoDownloadOption = 1 - AccountData_AutoDownloadSettings_WIFI AccountData_AutoDownloadSettings_AutoDownloadOption = 2 - AccountData_AutoDownloadSettings_WIFI_AND_CELLULAR AccountData_AutoDownloadSettings_AutoDownloadOption = 3 -) - -// Enum value maps for AccountData_AutoDownloadSettings_AutoDownloadOption. -var ( - AccountData_AutoDownloadSettings_AutoDownloadOption_name = map[int32]string{ - 0: "UNKNOWN", - 1: "NEVER", - 2: "WIFI", - 3: "WIFI_AND_CELLULAR", - } - AccountData_AutoDownloadSettings_AutoDownloadOption_value = map[string]int32{ - "UNKNOWN": 0, - "NEVER": 1, - "WIFI": 2, - "WIFI_AND_CELLULAR": 3, - } -) - -func (x AccountData_AutoDownloadSettings_AutoDownloadOption) Enum() *AccountData_AutoDownloadSettings_AutoDownloadOption { - p := new(AccountData_AutoDownloadSettings_AutoDownloadOption) - *p = x - return p -} - -func (x AccountData_AutoDownloadSettings_AutoDownloadOption) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_AutoDownloadSettings_AutoDownloadOption) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[7].Descriptor() -} - -func (AccountData_AutoDownloadSettings_AutoDownloadOption) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[7] -} - -func (x AccountData_AutoDownloadSettings_AutoDownloadOption) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_AutoDownloadSettings_AutoDownloadOption.Descriptor instead. -func (AccountData_AutoDownloadSettings_AutoDownloadOption) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 1, 0} -} - -type AccountData_AndroidSpecificSettings_NavigationBarSize int32 - -const ( - AccountData_AndroidSpecificSettings_UNKNOWN_BAR_SIZE AccountData_AndroidSpecificSettings_NavigationBarSize = 0 // Intepret as "Normal" - AccountData_AndroidSpecificSettings_NORMAL AccountData_AndroidSpecificSettings_NavigationBarSize = 1 - AccountData_AndroidSpecificSettings_COMPACT AccountData_AndroidSpecificSettings_NavigationBarSize = 2 -) - -// Enum value maps for AccountData_AndroidSpecificSettings_NavigationBarSize. -var ( - AccountData_AndroidSpecificSettings_NavigationBarSize_name = map[int32]string{ - 0: "UNKNOWN_BAR_SIZE", - 1: "NORMAL", - 2: "COMPACT", - } - AccountData_AndroidSpecificSettings_NavigationBarSize_value = map[string]int32{ - "UNKNOWN_BAR_SIZE": 0, - "NORMAL": 1, - "COMPACT": 2, - } -) - -func (x AccountData_AndroidSpecificSettings_NavigationBarSize) Enum() *AccountData_AndroidSpecificSettings_NavigationBarSize { - p := new(AccountData_AndroidSpecificSettings_NavigationBarSize) - *p = x - return p -} - -func (x AccountData_AndroidSpecificSettings_NavigationBarSize) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_AndroidSpecificSettings_NavigationBarSize) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[8].Descriptor() -} - -func (AccountData_AndroidSpecificSettings_NavigationBarSize) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[8] -} - -func (x AccountData_AndroidSpecificSettings_NavigationBarSize) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_AndroidSpecificSettings_NavigationBarSize.Descriptor instead. -func (AccountData_AndroidSpecificSettings_NavigationBarSize) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 5, 0} -} - type Contact_IdentityState int32 const ( @@ -564,11 +310,11 @@ func (x Contact_IdentityState) String() string { } func (Contact_IdentityState) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[9].Descriptor() + return file_backuppb_Backup_proto_enumTypes[4].Descriptor() } func (Contact_IdentityState) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[9] + return &file_backuppb_Backup_proto_enumTypes[4] } func (x Contact_IdentityState) Number() protoreflect.EnumNumber { @@ -613,11 +359,11 @@ func (x Contact_Visibility) String() string { } func (Contact_Visibility) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[10].Descriptor() + return file_backuppb_Backup_proto_enumTypes[5].Descriptor() } func (Contact_Visibility) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[10] + return &file_backuppb_Backup_proto_enumTypes[5] } func (x Contact_Visibility) Number() protoreflect.EnumNumber { @@ -662,11 +408,11 @@ func (x Group_StorySendMode) String() string { } func (Group_StorySendMode) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[11].Descriptor() + return file_backuppb_Backup_proto_enumTypes[6].Descriptor() } func (Group_StorySendMode) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[11] + return &file_backuppb_Backup_proto_enumTypes[6] } func (x Group_StorySendMode) Number() protoreflect.EnumNumber { @@ -711,11 +457,11 @@ func (x Group_Member_Role) String() string { } func (Group_Member_Role) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[12].Descriptor() + return file_backuppb_Backup_proto_enumTypes[7].Descriptor() } func (Group_Member_Role) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[12] + return &file_backuppb_Backup_proto_enumTypes[7] } func (x Group_Member_Role) Number() protoreflect.EnumNumber { @@ -766,11 +512,11 @@ func (x Group_AccessControl_AccessRequired) String() string { } func (Group_AccessControl_AccessRequired) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[13].Descriptor() + return file_backuppb_Backup_proto_enumTypes[8].Descriptor() } func (Group_AccessControl_AccessRequired) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[13] + return &file_backuppb_Backup_proto_enumTypes[8] } func (x Group_AccessControl_AccessRequired) Number() protoreflect.EnumNumber { @@ -815,11 +561,11 @@ func (x CallLink_Restrictions) String() string { } func (CallLink_Restrictions) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[14].Descriptor() + return file_backuppb_Backup_proto_enumTypes[9].Descriptor() } func (CallLink_Restrictions) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[14] + return &file_backuppb_Backup_proto_enumTypes[9] } func (x CallLink_Restrictions) Number() protoreflect.EnumNumber { @@ -861,11 +607,11 @@ func (x AdHocCall_State) String() string { } func (AdHocCall_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[15].Descriptor() + return file_backuppb_Backup_proto_enumTypes[10].Descriptor() } func (AdHocCall_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[15] + return &file_backuppb_Backup_proto_enumTypes[10] } func (x AdHocCall_State) Number() protoreflect.EnumNumber { @@ -913,11 +659,11 @@ func (x DistributionList_PrivacyMode) String() string { } func (DistributionList_PrivacyMode) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[16].Descriptor() + return file_backuppb_Backup_proto_enumTypes[11].Descriptor() } func (DistributionList_PrivacyMode) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[16] + return &file_backuppb_Backup_proto_enumTypes[11] } func (x DistributionList_PrivacyMode) Number() protoreflect.EnumNumber { @@ -962,11 +708,11 @@ func (x SendStatus_Failed_FailureReason) String() string { } func (SendStatus_Failed_FailureReason) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[17].Descriptor() + return file_backuppb_Backup_proto_enumTypes[12].Descriptor() } func (SendStatus_Failed_FailureReason) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[17] + return &file_backuppb_Backup_proto_enumTypes[12] } func (x SendStatus_Failed_FailureReason) Number() protoreflect.EnumNumber { @@ -1011,11 +757,11 @@ func (x PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) } func (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[18].Descriptor() + return file_backuppb_Backup_proto_enumTypes[13].Descriptor() } func (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[18] + return &file_backuppb_Backup_proto_enumTypes[13] } func (x PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) Number() protoreflect.EnumNumber { @@ -1060,11 +806,11 @@ func (x PaymentNotification_TransactionDetails_Transaction_Status) String() stri } func (PaymentNotification_TransactionDetails_Transaction_Status) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[19].Descriptor() + return file_backuppb_Backup_proto_enumTypes[14].Descriptor() } func (PaymentNotification_TransactionDetails_Transaction_Status) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[19] + return &file_backuppb_Backup_proto_enumTypes[14] } func (x PaymentNotification_TransactionDetails_Transaction_Status) Number() protoreflect.EnumNumber { @@ -1112,11 +858,11 @@ func (x GiftBadge_State) String() string { } func (GiftBadge_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[20].Descriptor() + return file_backuppb_Backup_proto_enumTypes[15].Descriptor() } func (GiftBadge_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[20] + return &file_backuppb_Backup_proto_enumTypes[15] } func (x GiftBadge_State) Number() protoreflect.EnumNumber { @@ -1167,11 +913,11 @@ func (x ContactAttachment_Phone_Type) String() string { } func (ContactAttachment_Phone_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[21].Descriptor() + return file_backuppb_Backup_proto_enumTypes[16].Descriptor() } func (ContactAttachment_Phone_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[21] + return &file_backuppb_Backup_proto_enumTypes[16] } func (x ContactAttachment_Phone_Type) Number() protoreflect.EnumNumber { @@ -1222,11 +968,11 @@ func (x ContactAttachment_Email_Type) String() string { } func (ContactAttachment_Email_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[22].Descriptor() + return file_backuppb_Backup_proto_enumTypes[17].Descriptor() } func (ContactAttachment_Email_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[22] + return &file_backuppb_Backup_proto_enumTypes[17] } func (x ContactAttachment_Email_Type) Number() protoreflect.EnumNumber { @@ -1274,11 +1020,11 @@ func (x ContactAttachment_PostalAddress_Type) String() string { } func (ContactAttachment_PostalAddress_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[23].Descriptor() + return file_backuppb_Backup_proto_enumTypes[18].Descriptor() } func (ContactAttachment_PostalAddress_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[23] + return &file_backuppb_Backup_proto_enumTypes[18] } func (x ContactAttachment_PostalAddress_Type) Number() protoreflect.EnumNumber { @@ -1329,11 +1075,11 @@ func (x MessageAttachment_Flag) String() string { } func (MessageAttachment_Flag) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[24].Descriptor() + return file_backuppb_Backup_proto_enumTypes[19].Descriptor() } func (MessageAttachment_Flag) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[24] + return &file_backuppb_Backup_proto_enumTypes[19] } func (x MessageAttachment_Flag) Number() protoreflect.EnumNumber { @@ -1352,7 +1098,6 @@ const ( Quote_NORMAL Quote_Type = 1 Quote_GIFT_BADGE Quote_Type = 2 Quote_VIEW_ONCE Quote_Type = 3 - Quote_POLL Quote_Type = 4 ) // Enum value maps for Quote_Type. @@ -1362,14 +1107,12 @@ var ( 1: "NORMAL", 2: "GIFT_BADGE", 3: "VIEW_ONCE", - 4: "POLL", } Quote_Type_value = map[string]int32{ "UNKNOWN": 0, "NORMAL": 1, "GIFT_BADGE": 2, "VIEW_ONCE": 3, - "POLL": 4, } ) @@ -1384,11 +1127,11 @@ func (x Quote_Type) String() string { } func (Quote_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[25].Descriptor() + return file_backuppb_Backup_proto_enumTypes[20].Descriptor() } func (Quote_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[25] + return &file_backuppb_Backup_proto_enumTypes[20] } func (x Quote_Type) Number() protoreflect.EnumNumber { @@ -1442,11 +1185,11 @@ func (x BodyRange_Style) String() string { } func (BodyRange_Style) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[26].Descriptor() + return file_backuppb_Backup_proto_enumTypes[21].Descriptor() } func (BodyRange_Style) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[26] + return &file_backuppb_Backup_proto_enumTypes[21] } func (x BodyRange_Style) Number() protoreflect.EnumNumber { @@ -1491,11 +1234,11 @@ func (x IndividualCall_Type) String() string { } func (IndividualCall_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[27].Descriptor() + return file_backuppb_Backup_proto_enumTypes[22].Descriptor() } func (IndividualCall_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[27] + return &file_backuppb_Backup_proto_enumTypes[22] } func (x IndividualCall_Type) Number() protoreflect.EnumNumber { @@ -1504,7 +1247,7 @@ func (x IndividualCall_Type) Number() protoreflect.EnumNumber { // Deprecated: Use IndividualCall_Type.Descriptor instead. func (IndividualCall_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{33, 0} } type IndividualCall_Direction int32 @@ -1540,11 +1283,11 @@ func (x IndividualCall_Direction) String() string { } func (IndividualCall_Direction) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[28].Descriptor() + return file_backuppb_Backup_proto_enumTypes[23].Descriptor() } func (IndividualCall_Direction) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[28] + return &file_backuppb_Backup_proto_enumTypes[23] } func (x IndividualCall_Direction) Number() protoreflect.EnumNumber { @@ -1553,7 +1296,7 @@ func (x IndividualCall_Direction) Number() protoreflect.EnumNumber { // Deprecated: Use IndividualCall_Direction.Descriptor instead. func (IndividualCall_Direction) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35, 1} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{33, 1} } type IndividualCall_State int32 @@ -1599,11 +1342,11 @@ func (x IndividualCall_State) String() string { } func (IndividualCall_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[29].Descriptor() + return file_backuppb_Backup_proto_enumTypes[24].Descriptor() } func (IndividualCall_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[29] + return &file_backuppb_Backup_proto_enumTypes[24] } func (x IndividualCall_State) Number() protoreflect.EnumNumber { @@ -1612,7 +1355,7 @@ func (x IndividualCall_State) Number() protoreflect.EnumNumber { // Deprecated: Use IndividualCall_State.Descriptor instead. func (IndividualCall_State) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35, 2} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{33, 2} } type GroupCall_State int32 @@ -1675,11 +1418,11 @@ func (x GroupCall_State) String() string { } func (GroupCall_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[30].Descriptor() + return file_backuppb_Backup_proto_enumTypes[25].Descriptor() } func (GroupCall_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[30] + return &file_backuppb_Backup_proto_enumTypes[25] } func (x GroupCall_State) Number() protoreflect.EnumNumber { @@ -1688,7 +1431,7 @@ func (x GroupCall_State) Number() protoreflect.EnumNumber { // Deprecated: Use GroupCall_State.Descriptor instead. func (GroupCall_State) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{36, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{34, 0} } type SimpleChatUpdate_Type int32 @@ -1766,11 +1509,11 @@ func (x SimpleChatUpdate_Type) String() string { } func (SimpleChatUpdate_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[31].Descriptor() + return file_backuppb_Backup_proto_enumTypes[26].Descriptor() } func (SimpleChatUpdate_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[31] + return &file_backuppb_Backup_proto_enumTypes[26] } func (x SimpleChatUpdate_Type) Number() protoreflect.EnumNumber { @@ -1779,7 +1522,7 @@ func (x SimpleChatUpdate_Type) Number() protoreflect.EnumNumber { // Deprecated: Use SimpleChatUpdate_Type.Descriptor instead. func (SimpleChatUpdate_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{37, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{35, 0} } type ChatStyle_WallpaperPreset int32 @@ -1872,11 +1615,11 @@ func (x ChatStyle_WallpaperPreset) String() string { } func (ChatStyle_WallpaperPreset) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[32].Descriptor() + return file_backuppb_Backup_proto_enumTypes[27].Descriptor() } func (ChatStyle_WallpaperPreset) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[32] + return &file_backuppb_Backup_proto_enumTypes[27] } func (x ChatStyle_WallpaperPreset) Number() protoreflect.EnumNumber { @@ -1885,7 +1628,7 @@ func (x ChatStyle_WallpaperPreset) Number() protoreflect.EnumNumber { // Deprecated: Use ChatStyle_WallpaperPreset.Descriptor instead. func (ChatStyle_WallpaperPreset) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{77, 0} } type ChatStyle_BubbleColorPreset int32 @@ -1981,11 +1724,11 @@ func (x ChatStyle_BubbleColorPreset) String() string { } func (ChatStyle_BubbleColorPreset) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[33].Descriptor() + return file_backuppb_Backup_proto_enumTypes[28].Descriptor() } func (ChatStyle_BubbleColorPreset) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[33] + return &file_backuppb_Backup_proto_enumTypes[28] } func (x ChatStyle_BubbleColorPreset) Number() protoreflect.EnumNumber { @@ -1994,7 +1737,7 @@ func (x ChatStyle_BubbleColorPreset) Number() protoreflect.EnumNumber { // Deprecated: Use ChatStyle_BubbleColorPreset.Descriptor instead. func (ChatStyle_BubbleColorPreset) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 1} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{77, 1} } type NotificationProfile_DayOfWeek int32 @@ -2045,11 +1788,11 @@ func (x NotificationProfile_DayOfWeek) String() string { } func (NotificationProfile_DayOfWeek) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[34].Descriptor() + return file_backuppb_Backup_proto_enumTypes[29].Descriptor() } func (NotificationProfile_DayOfWeek) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[34] + return &file_backuppb_Backup_proto_enumTypes[29] } func (x NotificationProfile_DayOfWeek) Number() protoreflect.EnumNumber { @@ -2058,7 +1801,7 @@ func (x NotificationProfile_DayOfWeek) Number() protoreflect.EnumNumber { // Deprecated: Use NotificationProfile_DayOfWeek.Descriptor instead. func (NotificationProfile_DayOfWeek) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{84, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{78, 0} } // Represents the default "All chats" folder record vs all other custom folders @@ -2095,11 +1838,11 @@ func (x ChatFolder_FolderType) String() string { } func (ChatFolder_FolderType) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[35].Descriptor() + return file_backuppb_Backup_proto_enumTypes[30].Descriptor() } func (ChatFolder_FolderType) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[35] + return &file_backuppb_Backup_proto_enumTypes[30] } func (x ChatFolder_FolderType) Number() protoreflect.EnumNumber { @@ -2108,7 +1851,7 @@ func (x ChatFolder_FolderType) Number() protoreflect.EnumNumber { // Deprecated: Use ChatFolder_FolderType.Descriptor instead. func (ChatFolder_FolderType) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{85, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{79, 0} } type BackupInfo struct { @@ -2392,23 +2135,19 @@ func (*Frame_NotificationProfile) isFrame_Item() {} func (*Frame_ChatFolder) isFrame_Item() {} type AccountData struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProfileKey []byte `protobuf:"bytes,1,opt,name=profileKey,proto3" json:"profileKey,omitempty"` - Username *string `protobuf:"bytes,2,opt,name=username,proto3,oneof" json:"username,omitempty"` - UsernameLink *AccountData_UsernameLink `protobuf:"bytes,3,opt,name=usernameLink,proto3" json:"usernameLink,omitempty"` - GivenName string `protobuf:"bytes,4,opt,name=givenName,proto3" json:"givenName,omitempty"` - FamilyName string `protobuf:"bytes,5,opt,name=familyName,proto3" json:"familyName,omitempty"` - AvatarUrlPath string `protobuf:"bytes,6,opt,name=avatarUrlPath,proto3" json:"avatarUrlPath,omitempty"` - DonationSubscriberData *AccountData_SubscriberData `protobuf:"bytes,7,opt,name=donationSubscriberData,proto3" json:"donationSubscriberData,omitempty"` - AccountSettings *AccountData_AccountSettings `protobuf:"bytes,9,opt,name=accountSettings,proto3" json:"accountSettings,omitempty"` - BackupsSubscriberData *AccountData_IAPSubscriberData `protobuf:"bytes,10,opt,name=backupsSubscriberData,proto3" json:"backupsSubscriberData,omitempty"` - SvrPin string `protobuf:"bytes,11,opt,name=svrPin,proto3" json:"svrPin,omitempty"` - AndroidSpecificSettings *AccountData_AndroidSpecificSettings `protobuf:"bytes,12,opt,name=androidSpecificSettings,proto3" json:"androidSpecificSettings,omitempty"` - BioText string `protobuf:"bytes,13,opt,name=bioText,proto3" json:"bioText,omitempty"` - BioEmoji string `protobuf:"bytes,14,opt,name=bioEmoji,proto3" json:"bioEmoji,omitempty"` - KeyTransparencyData []byte `protobuf:"bytes,15,opt,name=keyTransparencyData,proto3,oneof" json:"keyTransparencyData,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + ProfileKey []byte `protobuf:"bytes,1,opt,name=profileKey,proto3" json:"profileKey,omitempty"` + Username *string `protobuf:"bytes,2,opt,name=username,proto3,oneof" json:"username,omitempty"` + UsernameLink *AccountData_UsernameLink `protobuf:"bytes,3,opt,name=usernameLink,proto3" json:"usernameLink,omitempty"` + GivenName string `protobuf:"bytes,4,opt,name=givenName,proto3" json:"givenName,omitempty"` + FamilyName string `protobuf:"bytes,5,opt,name=familyName,proto3" json:"familyName,omitempty"` + AvatarUrlPath string `protobuf:"bytes,6,opt,name=avatarUrlPath,proto3" json:"avatarUrlPath,omitempty"` + DonationSubscriberData *AccountData_SubscriberData `protobuf:"bytes,7,opt,name=donationSubscriberData,proto3" json:"donationSubscriberData,omitempty"` + AccountSettings *AccountData_AccountSettings `protobuf:"bytes,9,opt,name=accountSettings,proto3" json:"accountSettings,omitempty"` + BackupsSubscriberData *AccountData_IAPSubscriberData `protobuf:"bytes,10,opt,name=backupsSubscriberData,proto3" json:"backupsSubscriberData,omitempty"` + SvrPin string `protobuf:"bytes,11,opt,name=svrPin,proto3" json:"svrPin,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AccountData) Reset() { @@ -2511,34 +2250,6 @@ func (x *AccountData) GetSvrPin() string { return "" } -func (x *AccountData) GetAndroidSpecificSettings() *AccountData_AndroidSpecificSettings { - if x != nil { - return x.AndroidSpecificSettings - } - return nil -} - -func (x *AccountData) GetBioText() string { - if x != nil { - return x.BioText - } - return "" -} - -func (x *AccountData) GetBioEmoji() string { - if x != nil { - return x.BioEmoji - } - return "" -} - -func (x *AccountData) GetKeyTransparencyData() []byte { - if x != nil { - return x.KeyTransparencyData - } - return nil -} - type Recipient struct { state protoimpl.MessageState `protogen:"open.v1"` Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // generated id for reference only within this file @@ -2709,23 +2420,22 @@ type Contact struct { // // *Contact_Registered_ // *Contact_NotRegistered_ - Registration isContact_Registration `protobuf_oneof:"registration"` - ProfileKey []byte `protobuf:"bytes,9,opt,name=profileKey,proto3,oneof" json:"profileKey,omitempty"` - ProfileSharing bool `protobuf:"varint,10,opt,name=profileSharing,proto3" json:"profileSharing,omitempty"` - ProfileGivenName *string `protobuf:"bytes,11,opt,name=profileGivenName,proto3,oneof" json:"profileGivenName,omitempty"` - ProfileFamilyName *string `protobuf:"bytes,12,opt,name=profileFamilyName,proto3,oneof" json:"profileFamilyName,omitempty"` - HideStory bool `protobuf:"varint,13,opt,name=hideStory,proto3" json:"hideStory,omitempty"` - IdentityKey []byte `protobuf:"bytes,14,opt,name=identityKey,proto3,oneof" json:"identityKey,omitempty"` - IdentityState Contact_IdentityState `protobuf:"varint,15,opt,name=identityState,proto3,enum=signal.backup.Contact_IdentityState" json:"identityState,omitempty"` - Nickname *Contact_Name `protobuf:"bytes,16,opt,name=nickname,proto3" json:"nickname,omitempty"` // absent iff both `given` and `family` are empty - Note string `protobuf:"bytes,17,opt,name=note,proto3" json:"note,omitempty"` - SystemGivenName string `protobuf:"bytes,18,opt,name=systemGivenName,proto3" json:"systemGivenName,omitempty"` - SystemFamilyName string `protobuf:"bytes,19,opt,name=systemFamilyName,proto3" json:"systemFamilyName,omitempty"` - SystemNickname string `protobuf:"bytes,20,opt,name=systemNickname,proto3" json:"systemNickname,omitempty"` - AvatarColor *AvatarColor `protobuf:"varint,21,opt,name=avatarColor,proto3,enum=signal.backup.AvatarColor,oneof" json:"avatarColor,omitempty"` - KeyTransparencyData []byte `protobuf:"bytes,22,opt,name=keyTransparencyData,proto3,oneof" json:"keyTransparencyData,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Registration isContact_Registration `protobuf_oneof:"registration"` + ProfileKey []byte `protobuf:"bytes,9,opt,name=profileKey,proto3,oneof" json:"profileKey,omitempty"` + ProfileSharing bool `protobuf:"varint,10,opt,name=profileSharing,proto3" json:"profileSharing,omitempty"` + ProfileGivenName *string `protobuf:"bytes,11,opt,name=profileGivenName,proto3,oneof" json:"profileGivenName,omitempty"` + ProfileFamilyName *string `protobuf:"bytes,12,opt,name=profileFamilyName,proto3,oneof" json:"profileFamilyName,omitempty"` + HideStory bool `protobuf:"varint,13,opt,name=hideStory,proto3" json:"hideStory,omitempty"` + IdentityKey []byte `protobuf:"bytes,14,opt,name=identityKey,proto3,oneof" json:"identityKey,omitempty"` + IdentityState Contact_IdentityState `protobuf:"varint,15,opt,name=identityState,proto3,enum=signal.backup.Contact_IdentityState" json:"identityState,omitempty"` + Nickname *Contact_Name `protobuf:"bytes,16,opt,name=nickname,proto3" json:"nickname,omitempty"` // absent iff both `given` and `family` are empty + Note string `protobuf:"bytes,17,opt,name=note,proto3" json:"note,omitempty"` + SystemGivenName string `protobuf:"bytes,18,opt,name=systemGivenName,proto3" json:"systemGivenName,omitempty"` + SystemFamilyName string `protobuf:"bytes,19,opt,name=systemFamilyName,proto3" json:"systemFamilyName,omitempty"` + SystemNickname string `protobuf:"bytes,20,opt,name=systemNickname,proto3" json:"systemNickname,omitempty"` + AvatarColor *AvatarColor `protobuf:"varint,21,opt,name=avatarColor,proto3,enum=signal.backup.AvatarColor,oneof" json:"avatarColor,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Contact) Reset() { @@ -2916,13 +2626,6 @@ func (x *Contact) GetAvatarColor() AvatarColor { return AvatarColor_A100 } -func (x *Contact) GetKeyTransparencyData() []byte { - if x != nil { - return x.KeyTransparencyData - } - return nil -} - type isContact_Registration interface { isContact_Registration() } @@ -3241,6 +2944,7 @@ type CallLink struct { Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Restrictions CallLink_Restrictions `protobuf:"varint,4,opt,name=restrictions,proto3,enum=signal.backup.CallLink_Restrictions" json:"restrictions,omitempty"` ExpirationMs uint64 `protobuf:"varint,5,opt,name=expirationMs,proto3" json:"expirationMs,omitempty"` + Epoch []byte `protobuf:"bytes,6,opt,name=epoch,proto3,oneof" json:"epoch,omitempty"` // May be absent/empty for older links unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -3310,6 +3014,13 @@ func (x *CallLink) GetExpirationMs() uint64 { return 0 } +func (x *CallLink) GetEpoch() []byte { + if x != nil { + return x.Epoch + } + return nil +} + type AdHocCall struct { state protoimpl.MessageState `protogen:"open.v1"` CallId uint64 `protobuf:"varint,1,opt,name=callId,proto3" json:"callId,omitempty"` @@ -3571,10 +3282,7 @@ type ChatItem struct { // *ChatItem_GiftBadge // *ChatItem_ViewOnceMessage // *ChatItem_DirectStoryReplyMessage - // *ChatItem_Poll - // *ChatItem_AdminDeletedMessage - Item isChatItem_Item `protobuf_oneof:"item"` - PinDetails *ChatItem_PinDetails `protobuf:"bytes,21,opt,name=pinDetails,proto3" json:"pinDetails,omitempty"` // only set if message is pinned + Item isChatItem_Item `protobuf_oneof:"item"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -3780,31 +3488,6 @@ func (x *ChatItem) GetDirectStoryReplyMessage() *DirectStoryReplyMessage { return nil } -func (x *ChatItem) GetPoll() *Poll { - if x != nil { - if x, ok := x.Item.(*ChatItem_Poll); ok { - return x.Poll - } - } - return nil -} - -func (x *ChatItem) GetAdminDeletedMessage() *AdminDeletedMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_AdminDeletedMessage); ok { - return x.AdminDeletedMessage - } - } - return nil -} - -func (x *ChatItem) GetPinDetails() *ChatItem_PinDetails { - if x != nil { - return x.PinDetails - } - return nil -} - type isChatItem_DirectionalDetails interface { isChatItem_DirectionalDetails() } @@ -3867,14 +3550,6 @@ type ChatItem_DirectStoryReplyMessage struct { DirectStoryReplyMessage *DirectStoryReplyMessage `protobuf:"bytes,19,opt,name=directStoryReplyMessage,proto3,oneof"` // group story reply messages are not backed up } -type ChatItem_Poll struct { - Poll *Poll `protobuf:"bytes,20,opt,name=poll,proto3,oneof"` -} - -type ChatItem_AdminDeletedMessage struct { - AdminDeletedMessage *AdminDeletedMessage `protobuf:"bytes,22,opt,name=adminDeletedMessage,proto3,oneof"` -} - func (*ChatItem_StandardMessage) isChatItem_Item() {} func (*ChatItem_ContactMessage) isChatItem_Item() {} @@ -3893,10 +3568,6 @@ func (*ChatItem_ViewOnceMessage) isChatItem_Item() {} func (*ChatItem_DirectStoryReplyMessage) isChatItem_Item() {} -func (*ChatItem_Poll) isChatItem_Item() {} - -func (*ChatItem_AdminDeletedMessage) isChatItem_Item() {} - type SendStatus struct { state protoimpl.MessageState `protogen:"open.v1"` RecipientId uint64 `protobuf:"varint,1,opt,name=recipientId,proto3" json:"recipientId,omitempty"` @@ -5287,126 +4958,6 @@ func (x *Reaction) GetSortOrder() uint64 { return 0 } -type Poll struct { - state protoimpl.MessageState `protogen:"open.v1"` - Question string `protobuf:"bytes,1,opt,name=question,proto3" json:"question,omitempty"` // Between 1-100 characters - AllowMultiple bool `protobuf:"varint,2,opt,name=allowMultiple,proto3" json:"allowMultiple,omitempty"` - Options []*Poll_PollOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` // At least two - HasEnded bool `protobuf:"varint,4,opt,name=hasEnded,proto3" json:"hasEnded,omitempty"` - Reactions []*Reaction `protobuf:"bytes,5,rep,name=reactions,proto3" json:"reactions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Poll) Reset() { - *x = Poll{} - mi := &file_backuppb_Backup_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Poll) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Poll) ProtoMessage() {} - -func (x *Poll) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[32] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Poll.ProtoReflect.Descriptor instead. -func (*Poll) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{32} -} - -func (x *Poll) GetQuestion() string { - if x != nil { - return x.Question - } - return "" -} - -func (x *Poll) GetAllowMultiple() bool { - if x != nil { - return x.AllowMultiple - } - return false -} - -func (x *Poll) GetOptions() []*Poll_PollOption { - if x != nil { - return x.Options - } - return nil -} - -func (x *Poll) GetHasEnded() bool { - if x != nil { - return x.HasEnded - } - return false -} - -func (x *Poll) GetReactions() []*Reaction { - if x != nil { - return x.Reactions - } - return nil -} - -type AdminDeletedMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - AdminId uint64 `protobuf:"varint,1,opt,name=adminId,proto3" json:"adminId,omitempty"` // id of the admin that deleted the message - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AdminDeletedMessage) Reset() { - *x = AdminDeletedMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AdminDeletedMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdminDeletedMessage) ProtoMessage() {} - -func (x *AdminDeletedMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[33] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AdminDeletedMessage.ProtoReflect.Descriptor instead. -func (*AdminDeletedMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{33} -} - -func (x *AdminDeletedMessage) GetAdminId() uint64 { - if x != nil { - return x.AdminId - } - return 0 -} - type ChatUpdateMessage struct { state protoimpl.MessageState `protogen:"open.v1"` // If unset, importers should ignore the update message without throwing an error. @@ -5422,8 +4973,6 @@ type ChatUpdateMessage struct { // *ChatUpdateMessage_IndividualCall // *ChatUpdateMessage_GroupCall // *ChatUpdateMessage_LearnedProfileChange - // *ChatUpdateMessage_PollTerminate - // *ChatUpdateMessage_PinMessage Update isChatUpdateMessage_Update `protobuf_oneof:"update"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -5431,7 +4980,7 @@ type ChatUpdateMessage struct { func (x *ChatUpdateMessage) Reset() { *x = ChatUpdateMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[34] + mi := &file_backuppb_Backup_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5443,7 +4992,7 @@ func (x *ChatUpdateMessage) String() string { func (*ChatUpdateMessage) ProtoMessage() {} func (x *ChatUpdateMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[34] + mi := &file_backuppb_Backup_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5456,7 +5005,7 @@ func (x *ChatUpdateMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatUpdateMessage.ProtoReflect.Descriptor instead. func (*ChatUpdateMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{34} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{32} } func (x *ChatUpdateMessage) GetUpdate() isChatUpdateMessage_Update { @@ -5547,24 +5096,6 @@ func (x *ChatUpdateMessage) GetLearnedProfileChange() *LearnedProfileChatUpdate return nil } -func (x *ChatUpdateMessage) GetPollTerminate() *PollTerminateUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_PollTerminate); ok { - return x.PollTerminate - } - } - return nil -} - -func (x *ChatUpdateMessage) GetPinMessage() *PinMessageUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_PinMessage); ok { - return x.PinMessage - } - } - return nil -} - type isChatUpdateMessage_Update interface { isChatUpdateMessage_Update() } @@ -5605,14 +5136,6 @@ type ChatUpdateMessage_LearnedProfileChange struct { LearnedProfileChange *LearnedProfileChatUpdate `protobuf:"bytes,9,opt,name=learnedProfileChange,proto3,oneof"` } -type ChatUpdateMessage_PollTerminate struct { - PollTerminate *PollTerminateUpdate `protobuf:"bytes,10,opt,name=pollTerminate,proto3,oneof"` -} - -type ChatUpdateMessage_PinMessage struct { - PinMessage *PinMessageUpdate `protobuf:"bytes,11,opt,name=pinMessage,proto3,oneof"` -} - func (*ChatUpdateMessage_SimpleUpdate) isChatUpdateMessage_Update() {} func (*ChatUpdateMessage_GroupChange) isChatUpdateMessage_Update() {} @@ -5631,10 +5154,6 @@ func (*ChatUpdateMessage_GroupCall) isChatUpdateMessage_Update() {} func (*ChatUpdateMessage_LearnedProfileChange) isChatUpdateMessage_Update() {} -func (*ChatUpdateMessage_PollTerminate) isChatUpdateMessage_Update() {} - -func (*ChatUpdateMessage_PinMessage) isChatUpdateMessage_Update() {} - type IndividualCall struct { state protoimpl.MessageState `protogen:"open.v1"` CallId *uint64 `protobuf:"varint,1,opt,name=callId,proto3,oneof" json:"callId,omitempty"` @@ -5649,7 +5168,7 @@ type IndividualCall struct { func (x *IndividualCall) Reset() { *x = IndividualCall{} - mi := &file_backuppb_Backup_proto_msgTypes[35] + mi := &file_backuppb_Backup_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5661,7 +5180,7 @@ func (x *IndividualCall) String() string { func (*IndividualCall) ProtoMessage() {} func (x *IndividualCall) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[35] + mi := &file_backuppb_Backup_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5674,7 +5193,7 @@ func (x *IndividualCall) ProtoReflect() protoreflect.Message { // Deprecated: Use IndividualCall.ProtoReflect.Descriptor instead. func (*IndividualCall) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{33} } func (x *IndividualCall) GetCallId() uint64 { @@ -5734,7 +5253,7 @@ type GroupCall struct { func (x *GroupCall) Reset() { *x = GroupCall{} - mi := &file_backuppb_Backup_proto_msgTypes[36] + mi := &file_backuppb_Backup_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5746,7 +5265,7 @@ func (x *GroupCall) String() string { func (*GroupCall) ProtoMessage() {} func (x *GroupCall) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[36] + mi := &file_backuppb_Backup_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5759,7 +5278,7 @@ func (x *GroupCall) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupCall.ProtoReflect.Descriptor instead. func (*GroupCall) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{36} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{34} } func (x *GroupCall) GetCallId() uint64 { @@ -5820,7 +5339,7 @@ type SimpleChatUpdate struct { func (x *SimpleChatUpdate) Reset() { *x = SimpleChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[37] + mi := &file_backuppb_Backup_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5832,7 +5351,7 @@ func (x *SimpleChatUpdate) String() string { func (*SimpleChatUpdate) ProtoMessage() {} func (x *SimpleChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[37] + mi := &file_backuppb_Backup_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5845,7 +5364,7 @@ func (x *SimpleChatUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use SimpleChatUpdate.ProtoReflect.Descriptor instead. func (*SimpleChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{37} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{35} } func (x *SimpleChatUpdate) GetType() SimpleChatUpdate_Type { @@ -5866,7 +5385,7 @@ type ExpirationTimerChatUpdate struct { func (x *ExpirationTimerChatUpdate) Reset() { *x = ExpirationTimerChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[38] + mi := &file_backuppb_Backup_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5878,7 +5397,7 @@ func (x *ExpirationTimerChatUpdate) String() string { func (*ExpirationTimerChatUpdate) ProtoMessage() {} func (x *ExpirationTimerChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[38] + mi := &file_backuppb_Backup_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5891,7 +5410,7 @@ func (x *ExpirationTimerChatUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use ExpirationTimerChatUpdate.ProtoReflect.Descriptor instead. func (*ExpirationTimerChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{38} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{36} } func (x *ExpirationTimerChatUpdate) GetExpiresInMs() uint64 { @@ -5911,7 +5430,7 @@ type ProfileChangeChatUpdate struct { func (x *ProfileChangeChatUpdate) Reset() { *x = ProfileChangeChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[39] + mi := &file_backuppb_Backup_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5923,7 +5442,7 @@ func (x *ProfileChangeChatUpdate) String() string { func (*ProfileChangeChatUpdate) ProtoMessage() {} func (x *ProfileChangeChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[39] + mi := &file_backuppb_Backup_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5936,7 +5455,7 @@ func (x *ProfileChangeChatUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use ProfileChangeChatUpdate.ProtoReflect.Descriptor instead. func (*ProfileChangeChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{39} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{37} } func (x *ProfileChangeChatUpdate) GetPreviousName() string { @@ -5968,7 +5487,7 @@ type LearnedProfileChatUpdate struct { func (x *LearnedProfileChatUpdate) Reset() { *x = LearnedProfileChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[40] + mi := &file_backuppb_Backup_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5980,7 +5499,7 @@ func (x *LearnedProfileChatUpdate) String() string { func (*LearnedProfileChatUpdate) ProtoMessage() {} func (x *LearnedProfileChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[40] + mi := &file_backuppb_Backup_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5993,7 +5512,7 @@ func (x *LearnedProfileChatUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use LearnedProfileChatUpdate.ProtoReflect.Descriptor instead. func (*LearnedProfileChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{40} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{38} } func (x *LearnedProfileChatUpdate) GetPreviousName() isLearnedProfileChatUpdate_PreviousName { @@ -6046,7 +5565,7 @@ type ThreadMergeChatUpdate struct { func (x *ThreadMergeChatUpdate) Reset() { *x = ThreadMergeChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[41] + mi := &file_backuppb_Backup_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6058,7 +5577,7 @@ func (x *ThreadMergeChatUpdate) String() string { func (*ThreadMergeChatUpdate) ProtoMessage() {} func (x *ThreadMergeChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[41] + mi := &file_backuppb_Backup_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6071,7 +5590,7 @@ func (x *ThreadMergeChatUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use ThreadMergeChatUpdate.ProtoReflect.Descriptor instead. func (*ThreadMergeChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{41} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{39} } func (x *ThreadMergeChatUpdate) GetPreviousE164() uint64 { @@ -6090,7 +5609,7 @@ type SessionSwitchoverChatUpdate struct { func (x *SessionSwitchoverChatUpdate) Reset() { *x = SessionSwitchoverChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[42] + mi := &file_backuppb_Backup_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6102,7 +5621,7 @@ func (x *SessionSwitchoverChatUpdate) String() string { func (*SessionSwitchoverChatUpdate) ProtoMessage() {} func (x *SessionSwitchoverChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[42] + mi := &file_backuppb_Backup_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6115,7 +5634,7 @@ func (x *SessionSwitchoverChatUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use SessionSwitchoverChatUpdate.ProtoReflect.Descriptor instead. func (*SessionSwitchoverChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{42} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{40} } func (x *SessionSwitchoverChatUpdate) GetE164() uint64 { @@ -6136,7 +5655,7 @@ type GroupChangeChatUpdate struct { func (x *GroupChangeChatUpdate) Reset() { *x = GroupChangeChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[43] + mi := &file_backuppb_Backup_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6148,7 +5667,7 @@ func (x *GroupChangeChatUpdate) String() string { func (*GroupChangeChatUpdate) ProtoMessage() {} func (x *GroupChangeChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[43] + mi := &file_backuppb_Backup_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6161,7 +5680,7 @@ func (x *GroupChangeChatUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupChangeChatUpdate.ProtoReflect.Descriptor instead. func (*GroupChangeChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{43} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{41} } func (x *GroupChangeChatUpdate) GetUpdates() []*GroupChangeChatUpdate_Update { @@ -6180,7 +5699,7 @@ type GenericGroupUpdate struct { func (x *GenericGroupUpdate) Reset() { *x = GenericGroupUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[44] + mi := &file_backuppb_Backup_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6192,7 +5711,7 @@ func (x *GenericGroupUpdate) String() string { func (*GenericGroupUpdate) ProtoMessage() {} func (x *GenericGroupUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[44] + mi := &file_backuppb_Backup_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6205,7 +5724,7 @@ func (x *GenericGroupUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GenericGroupUpdate.ProtoReflect.Descriptor instead. func (*GenericGroupUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{44} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{42} } func (x *GenericGroupUpdate) GetUpdaterAci() []byte { @@ -6224,7 +5743,7 @@ type GroupCreationUpdate struct { func (x *GroupCreationUpdate) Reset() { *x = GroupCreationUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[45] + mi := &file_backuppb_Backup_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6236,7 +5755,7 @@ func (x *GroupCreationUpdate) String() string { func (*GroupCreationUpdate) ProtoMessage() {} func (x *GroupCreationUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[45] + mi := &file_backuppb_Backup_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6249,7 +5768,7 @@ func (x *GroupCreationUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupCreationUpdate.ProtoReflect.Descriptor instead. func (*GroupCreationUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{45} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{43} } func (x *GroupCreationUpdate) GetUpdaterAci() []byte { @@ -6270,7 +5789,7 @@ type GroupNameUpdate struct { func (x *GroupNameUpdate) Reset() { *x = GroupNameUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[46] + mi := &file_backuppb_Backup_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6282,7 +5801,7 @@ func (x *GroupNameUpdate) String() string { func (*GroupNameUpdate) ProtoMessage() {} func (x *GroupNameUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[46] + mi := &file_backuppb_Backup_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6295,7 +5814,7 @@ func (x *GroupNameUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupNameUpdate.ProtoReflect.Descriptor instead. func (*GroupNameUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{46} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{44} } func (x *GroupNameUpdate) GetUpdaterAci() []byte { @@ -6322,7 +5841,7 @@ type GroupAvatarUpdate struct { func (x *GroupAvatarUpdate) Reset() { *x = GroupAvatarUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[47] + mi := &file_backuppb_Backup_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6334,7 +5853,7 @@ func (x *GroupAvatarUpdate) String() string { func (*GroupAvatarUpdate) ProtoMessage() {} func (x *GroupAvatarUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[47] + mi := &file_backuppb_Backup_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6347,7 +5866,7 @@ func (x *GroupAvatarUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupAvatarUpdate.ProtoReflect.Descriptor instead. func (*GroupAvatarUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{47} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{45} } func (x *GroupAvatarUpdate) GetUpdaterAci() []byte { @@ -6375,7 +5894,7 @@ type GroupDescriptionUpdate struct { func (x *GroupDescriptionUpdate) Reset() { *x = GroupDescriptionUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[48] + mi := &file_backuppb_Backup_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6387,7 +5906,7 @@ func (x *GroupDescriptionUpdate) String() string { func (*GroupDescriptionUpdate) ProtoMessage() {} func (x *GroupDescriptionUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[48] + mi := &file_backuppb_Backup_proto_msgTypes[46] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6400,7 +5919,7 @@ func (x *GroupDescriptionUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupDescriptionUpdate.ProtoReflect.Descriptor instead. func (*GroupDescriptionUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{48} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{46} } func (x *GroupDescriptionUpdate) GetUpdaterAci() []byte { @@ -6427,7 +5946,7 @@ type GroupMembershipAccessLevelChangeUpdate struct { func (x *GroupMembershipAccessLevelChangeUpdate) Reset() { *x = GroupMembershipAccessLevelChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[49] + mi := &file_backuppb_Backup_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6439,7 +5958,7 @@ func (x *GroupMembershipAccessLevelChangeUpdate) String() string { func (*GroupMembershipAccessLevelChangeUpdate) ProtoMessage() {} func (x *GroupMembershipAccessLevelChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[49] + mi := &file_backuppb_Backup_proto_msgTypes[47] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6452,7 +5971,7 @@ func (x *GroupMembershipAccessLevelChangeUpdate) ProtoReflect() protoreflect.Mes // Deprecated: Use GroupMembershipAccessLevelChangeUpdate.ProtoReflect.Descriptor instead. func (*GroupMembershipAccessLevelChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{49} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{47} } func (x *GroupMembershipAccessLevelChangeUpdate) GetUpdaterAci() []byte { @@ -6479,7 +5998,7 @@ type GroupAttributesAccessLevelChangeUpdate struct { func (x *GroupAttributesAccessLevelChangeUpdate) Reset() { *x = GroupAttributesAccessLevelChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[50] + mi := &file_backuppb_Backup_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6491,7 +6010,7 @@ func (x *GroupAttributesAccessLevelChangeUpdate) String() string { func (*GroupAttributesAccessLevelChangeUpdate) ProtoMessage() {} func (x *GroupAttributesAccessLevelChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[50] + mi := &file_backuppb_Backup_proto_msgTypes[48] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6504,7 +6023,7 @@ func (x *GroupAttributesAccessLevelChangeUpdate) ProtoReflect() protoreflect.Mes // Deprecated: Use GroupAttributesAccessLevelChangeUpdate.ProtoReflect.Descriptor instead. func (*GroupAttributesAccessLevelChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{50} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{48} } func (x *GroupAttributesAccessLevelChangeUpdate) GetUpdaterAci() []byte { @@ -6521,102 +6040,6 @@ func (x *GroupAttributesAccessLevelChangeUpdate) GetAccessLevel() GroupV2AccessL return GroupV2AccessLevel_UNKNOWN } -type GroupMemberLabelAccessLevelChangeUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - AccessLevel GroupV2AccessLevel `protobuf:"varint,2,opt,name=accessLevel,proto3,enum=signal.backup.GroupV2AccessLevel" json:"accessLevel,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupMemberLabelAccessLevelChangeUpdate) Reset() { - *x = GroupMemberLabelAccessLevelChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMemberLabelAccessLevelChangeUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberLabelAccessLevelChangeUpdate) ProtoMessage() {} - -func (x *GroupMemberLabelAccessLevelChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[51] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupMemberLabelAccessLevelChangeUpdate.ProtoReflect.Descriptor instead. -func (*GroupMemberLabelAccessLevelChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{51} -} - -func (x *GroupMemberLabelAccessLevelChangeUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupMemberLabelAccessLevelChangeUpdate) GetAccessLevel() GroupV2AccessLevel { - if x != nil { - return x.AccessLevel - } - return GroupV2AccessLevel_UNKNOWN -} - -type GroupTerminateChangeUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupTerminateChangeUpdate) Reset() { - *x = GroupTerminateChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupTerminateChangeUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupTerminateChangeUpdate) ProtoMessage() {} - -func (x *GroupTerminateChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[52] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GroupTerminateChangeUpdate.ProtoReflect.Descriptor instead. -func (*GroupTerminateChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{52} -} - -func (x *GroupTerminateChangeUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - type GroupAnnouncementOnlyChangeUpdate struct { state protoimpl.MessageState `protogen:"open.v1"` UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` @@ -6627,7 +6050,7 @@ type GroupAnnouncementOnlyChangeUpdate struct { func (x *GroupAnnouncementOnlyChangeUpdate) Reset() { *x = GroupAnnouncementOnlyChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[53] + mi := &file_backuppb_Backup_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6639,7 +6062,7 @@ func (x *GroupAnnouncementOnlyChangeUpdate) String() string { func (*GroupAnnouncementOnlyChangeUpdate) ProtoMessage() {} func (x *GroupAnnouncementOnlyChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[53] + mi := &file_backuppb_Backup_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6652,7 +6075,7 @@ func (x *GroupAnnouncementOnlyChangeUpdate) ProtoReflect() protoreflect.Message // Deprecated: Use GroupAnnouncementOnlyChangeUpdate.ProtoReflect.Descriptor instead. func (*GroupAnnouncementOnlyChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{53} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{49} } func (x *GroupAnnouncementOnlyChangeUpdate) GetUpdaterAci() []byte { @@ -6681,7 +6104,7 @@ type GroupAdminStatusUpdate struct { func (x *GroupAdminStatusUpdate) Reset() { *x = GroupAdminStatusUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[54] + mi := &file_backuppb_Backup_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6693,7 +6116,7 @@ func (x *GroupAdminStatusUpdate) String() string { func (*GroupAdminStatusUpdate) ProtoMessage() {} func (x *GroupAdminStatusUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[54] + mi := &file_backuppb_Backup_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6706,7 +6129,7 @@ func (x *GroupAdminStatusUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupAdminStatusUpdate.ProtoReflect.Descriptor instead. func (*GroupAdminStatusUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{54} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{50} } func (x *GroupAdminStatusUpdate) GetUpdaterAci() []byte { @@ -6739,7 +6162,7 @@ type GroupMemberLeftUpdate struct { func (x *GroupMemberLeftUpdate) Reset() { *x = GroupMemberLeftUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[55] + mi := &file_backuppb_Backup_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6751,7 +6174,7 @@ func (x *GroupMemberLeftUpdate) String() string { func (*GroupMemberLeftUpdate) ProtoMessage() {} func (x *GroupMemberLeftUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[55] + mi := &file_backuppb_Backup_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6764,7 +6187,7 @@ func (x *GroupMemberLeftUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupMemberLeftUpdate.ProtoReflect.Descriptor instead. func (*GroupMemberLeftUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{55} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{51} } func (x *GroupMemberLeftUpdate) GetAci() []byte { @@ -6784,7 +6207,7 @@ type GroupMemberRemovedUpdate struct { func (x *GroupMemberRemovedUpdate) Reset() { *x = GroupMemberRemovedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[56] + mi := &file_backuppb_Backup_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6796,7 +6219,7 @@ func (x *GroupMemberRemovedUpdate) String() string { func (*GroupMemberRemovedUpdate) ProtoMessage() {} func (x *GroupMemberRemovedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[56] + mi := &file_backuppb_Backup_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6809,7 +6232,7 @@ func (x *GroupMemberRemovedUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupMemberRemovedUpdate.ProtoReflect.Descriptor instead. func (*GroupMemberRemovedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{56} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{52} } func (x *GroupMemberRemovedUpdate) GetRemoverAci() []byte { @@ -6835,7 +6258,7 @@ type SelfInvitedToGroupUpdate struct { func (x *SelfInvitedToGroupUpdate) Reset() { *x = SelfInvitedToGroupUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[57] + mi := &file_backuppb_Backup_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6847,7 +6270,7 @@ func (x *SelfInvitedToGroupUpdate) String() string { func (*SelfInvitedToGroupUpdate) ProtoMessage() {} func (x *SelfInvitedToGroupUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[57] + mi := &file_backuppb_Backup_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6860,7 +6283,7 @@ func (x *SelfInvitedToGroupUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use SelfInvitedToGroupUpdate.ProtoReflect.Descriptor instead. func (*SelfInvitedToGroupUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{57} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{53} } func (x *SelfInvitedToGroupUpdate) GetInviterAci() []byte { @@ -6880,7 +6303,7 @@ type SelfInvitedOtherUserToGroupUpdate struct { func (x *SelfInvitedOtherUserToGroupUpdate) Reset() { *x = SelfInvitedOtherUserToGroupUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[58] + mi := &file_backuppb_Backup_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6892,7 +6315,7 @@ func (x *SelfInvitedOtherUserToGroupUpdate) String() string { func (*SelfInvitedOtherUserToGroupUpdate) ProtoMessage() {} func (x *SelfInvitedOtherUserToGroupUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[58] + mi := &file_backuppb_Backup_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6905,7 +6328,7 @@ func (x *SelfInvitedOtherUserToGroupUpdate) ProtoReflect() protoreflect.Message // Deprecated: Use SelfInvitedOtherUserToGroupUpdate.ProtoReflect.Descriptor instead. func (*SelfInvitedOtherUserToGroupUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{58} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{54} } func (x *SelfInvitedOtherUserToGroupUpdate) GetInviteeServiceId() []byte { @@ -6926,7 +6349,7 @@ type GroupUnknownInviteeUpdate struct { func (x *GroupUnknownInviteeUpdate) Reset() { *x = GroupUnknownInviteeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[59] + mi := &file_backuppb_Backup_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6938,7 +6361,7 @@ func (x *GroupUnknownInviteeUpdate) String() string { func (*GroupUnknownInviteeUpdate) ProtoMessage() {} func (x *GroupUnknownInviteeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[59] + mi := &file_backuppb_Backup_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6951,7 +6374,7 @@ func (x *GroupUnknownInviteeUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupUnknownInviteeUpdate.ProtoReflect.Descriptor instead. func (*GroupUnknownInviteeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{59} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{55} } func (x *GroupUnknownInviteeUpdate) GetInviterAci() []byte { @@ -6978,7 +6401,7 @@ type GroupInvitationAcceptedUpdate struct { func (x *GroupInvitationAcceptedUpdate) Reset() { *x = GroupInvitationAcceptedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[60] + mi := &file_backuppb_Backup_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6990,7 +6413,7 @@ func (x *GroupInvitationAcceptedUpdate) String() string { func (*GroupInvitationAcceptedUpdate) ProtoMessage() {} func (x *GroupInvitationAcceptedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[60] + mi := &file_backuppb_Backup_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7003,7 +6426,7 @@ func (x *GroupInvitationAcceptedUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInvitationAcceptedUpdate.ProtoReflect.Descriptor instead. func (*GroupInvitationAcceptedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{60} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{56} } func (x *GroupInvitationAcceptedUpdate) GetInviterAci() []byte { @@ -7031,7 +6454,7 @@ type GroupInvitationDeclinedUpdate struct { func (x *GroupInvitationDeclinedUpdate) Reset() { *x = GroupInvitationDeclinedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[61] + mi := &file_backuppb_Backup_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7043,7 +6466,7 @@ func (x *GroupInvitationDeclinedUpdate) String() string { func (*GroupInvitationDeclinedUpdate) ProtoMessage() {} func (x *GroupInvitationDeclinedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[61] + mi := &file_backuppb_Backup_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7056,7 +6479,7 @@ func (x *GroupInvitationDeclinedUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInvitationDeclinedUpdate.ProtoReflect.Descriptor instead. func (*GroupInvitationDeclinedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{61} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{57} } func (x *GroupInvitationDeclinedUpdate) GetInviterAci() []byte { @@ -7082,7 +6505,7 @@ type GroupMemberJoinedUpdate struct { func (x *GroupMemberJoinedUpdate) Reset() { *x = GroupMemberJoinedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[62] + mi := &file_backuppb_Backup_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7094,7 +6517,7 @@ func (x *GroupMemberJoinedUpdate) String() string { func (*GroupMemberJoinedUpdate) ProtoMessage() {} func (x *GroupMemberJoinedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[62] + mi := &file_backuppb_Backup_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7107,7 +6530,7 @@ func (x *GroupMemberJoinedUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupMemberJoinedUpdate.ProtoReflect.Descriptor instead. func (*GroupMemberJoinedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{62} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{58} } func (x *GroupMemberJoinedUpdate) GetNewMemberAci() []byte { @@ -7130,7 +6553,7 @@ type GroupMemberAddedUpdate struct { func (x *GroupMemberAddedUpdate) Reset() { *x = GroupMemberAddedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[63] + mi := &file_backuppb_Backup_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7142,7 +6565,7 @@ func (x *GroupMemberAddedUpdate) String() string { func (*GroupMemberAddedUpdate) ProtoMessage() {} func (x *GroupMemberAddedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[63] + mi := &file_backuppb_Backup_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7155,7 +6578,7 @@ func (x *GroupMemberAddedUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupMemberAddedUpdate.ProtoReflect.Descriptor instead. func (*GroupMemberAddedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{63} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{59} } func (x *GroupMemberAddedUpdate) GetUpdaterAci() []byte { @@ -7196,7 +6619,7 @@ type GroupSelfInvitationRevokedUpdate struct { func (x *GroupSelfInvitationRevokedUpdate) Reset() { *x = GroupSelfInvitationRevokedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[64] + mi := &file_backuppb_Backup_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7208,7 +6631,7 @@ func (x *GroupSelfInvitationRevokedUpdate) String() string { func (*GroupSelfInvitationRevokedUpdate) ProtoMessage() {} func (x *GroupSelfInvitationRevokedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[64] + mi := &file_backuppb_Backup_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7221,7 +6644,7 @@ func (x *GroupSelfInvitationRevokedUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupSelfInvitationRevokedUpdate.ProtoReflect.Descriptor instead. func (*GroupSelfInvitationRevokedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{64} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{60} } func (x *GroupSelfInvitationRevokedUpdate) GetRevokerAci() []byte { @@ -7247,7 +6670,7 @@ type GroupInvitationRevokedUpdate struct { func (x *GroupInvitationRevokedUpdate) Reset() { *x = GroupInvitationRevokedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[65] + mi := &file_backuppb_Backup_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7259,7 +6682,7 @@ func (x *GroupInvitationRevokedUpdate) String() string { func (*GroupInvitationRevokedUpdate) ProtoMessage() {} func (x *GroupInvitationRevokedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[65] + mi := &file_backuppb_Backup_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7272,7 +6695,7 @@ func (x *GroupInvitationRevokedUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInvitationRevokedUpdate.ProtoReflect.Descriptor instead. func (*GroupInvitationRevokedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{65} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{61} } func (x *GroupInvitationRevokedUpdate) GetUpdaterAci() []byte { @@ -7298,7 +6721,7 @@ type GroupJoinRequestUpdate struct { func (x *GroupJoinRequestUpdate) Reset() { *x = GroupJoinRequestUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[66] + mi := &file_backuppb_Backup_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7310,7 +6733,7 @@ func (x *GroupJoinRequestUpdate) String() string { func (*GroupJoinRequestUpdate) ProtoMessage() {} func (x *GroupJoinRequestUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[66] + mi := &file_backuppb_Backup_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7323,7 +6746,7 @@ func (x *GroupJoinRequestUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupJoinRequestUpdate.ProtoReflect.Descriptor instead. func (*GroupJoinRequestUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{66} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{62} } func (x *GroupJoinRequestUpdate) GetRequestorAci() []byte { @@ -7345,7 +6768,7 @@ type GroupJoinRequestApprovalUpdate struct { func (x *GroupJoinRequestApprovalUpdate) Reset() { *x = GroupJoinRequestApprovalUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[67] + mi := &file_backuppb_Backup_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7357,7 +6780,7 @@ func (x *GroupJoinRequestApprovalUpdate) String() string { func (*GroupJoinRequestApprovalUpdate) ProtoMessage() {} func (x *GroupJoinRequestApprovalUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[67] + mi := &file_backuppb_Backup_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7370,7 +6793,7 @@ func (x *GroupJoinRequestApprovalUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupJoinRequestApprovalUpdate.ProtoReflect.Descriptor instead. func (*GroupJoinRequestApprovalUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{67} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{63} } func (x *GroupJoinRequestApprovalUpdate) GetRequestorAci() []byte { @@ -7403,7 +6826,7 @@ type GroupJoinRequestCanceledUpdate struct { func (x *GroupJoinRequestCanceledUpdate) Reset() { *x = GroupJoinRequestCanceledUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[68] + mi := &file_backuppb_Backup_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7415,7 +6838,7 @@ func (x *GroupJoinRequestCanceledUpdate) String() string { func (*GroupJoinRequestCanceledUpdate) ProtoMessage() {} func (x *GroupJoinRequestCanceledUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[68] + mi := &file_backuppb_Backup_proto_msgTypes[64] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7428,7 +6851,7 @@ func (x *GroupJoinRequestCanceledUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupJoinRequestCanceledUpdate.ProtoReflect.Descriptor instead. func (*GroupJoinRequestCanceledUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{68} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{64} } func (x *GroupJoinRequestCanceledUpdate) GetRequestorAci() []byte { @@ -7454,7 +6877,7 @@ type GroupSequenceOfRequestsAndCancelsUpdate struct { func (x *GroupSequenceOfRequestsAndCancelsUpdate) Reset() { *x = GroupSequenceOfRequestsAndCancelsUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[69] + mi := &file_backuppb_Backup_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7466,7 +6889,7 @@ func (x *GroupSequenceOfRequestsAndCancelsUpdate) String() string { func (*GroupSequenceOfRequestsAndCancelsUpdate) ProtoMessage() {} func (x *GroupSequenceOfRequestsAndCancelsUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[69] + mi := &file_backuppb_Backup_proto_msgTypes[65] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7479,7 +6902,7 @@ func (x *GroupSequenceOfRequestsAndCancelsUpdate) ProtoReflect() protoreflect.Me // Deprecated: Use GroupSequenceOfRequestsAndCancelsUpdate.ProtoReflect.Descriptor instead. func (*GroupSequenceOfRequestsAndCancelsUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{69} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{65} } func (x *GroupSequenceOfRequestsAndCancelsUpdate) GetRequestorAci() []byte { @@ -7505,7 +6928,7 @@ type GroupInviteLinkResetUpdate struct { func (x *GroupInviteLinkResetUpdate) Reset() { *x = GroupInviteLinkResetUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[70] + mi := &file_backuppb_Backup_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7517,7 +6940,7 @@ func (x *GroupInviteLinkResetUpdate) String() string { func (*GroupInviteLinkResetUpdate) ProtoMessage() {} func (x *GroupInviteLinkResetUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[70] + mi := &file_backuppb_Backup_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7530,7 +6953,7 @@ func (x *GroupInviteLinkResetUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInviteLinkResetUpdate.ProtoReflect.Descriptor instead. func (*GroupInviteLinkResetUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{70} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{66} } func (x *GroupInviteLinkResetUpdate) GetUpdaterAci() []byte { @@ -7550,7 +6973,7 @@ type GroupInviteLinkEnabledUpdate struct { func (x *GroupInviteLinkEnabledUpdate) Reset() { *x = GroupInviteLinkEnabledUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[71] + mi := &file_backuppb_Backup_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7562,7 +6985,7 @@ func (x *GroupInviteLinkEnabledUpdate) String() string { func (*GroupInviteLinkEnabledUpdate) ProtoMessage() {} func (x *GroupInviteLinkEnabledUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[71] + mi := &file_backuppb_Backup_proto_msgTypes[67] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7575,7 +6998,7 @@ func (x *GroupInviteLinkEnabledUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInviteLinkEnabledUpdate.ProtoReflect.Descriptor instead. func (*GroupInviteLinkEnabledUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{71} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{67} } func (x *GroupInviteLinkEnabledUpdate) GetUpdaterAci() []byte { @@ -7602,7 +7025,7 @@ type GroupInviteLinkAdminApprovalUpdate struct { func (x *GroupInviteLinkAdminApprovalUpdate) Reset() { *x = GroupInviteLinkAdminApprovalUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[72] + mi := &file_backuppb_Backup_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7614,7 +7037,7 @@ func (x *GroupInviteLinkAdminApprovalUpdate) String() string { func (*GroupInviteLinkAdminApprovalUpdate) ProtoMessage() {} func (x *GroupInviteLinkAdminApprovalUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[72] + mi := &file_backuppb_Backup_proto_msgTypes[68] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7627,7 +7050,7 @@ func (x *GroupInviteLinkAdminApprovalUpdate) ProtoReflect() protoreflect.Message // Deprecated: Use GroupInviteLinkAdminApprovalUpdate.ProtoReflect.Descriptor instead. func (*GroupInviteLinkAdminApprovalUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{72} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{68} } func (x *GroupInviteLinkAdminApprovalUpdate) GetUpdaterAci() []byte { @@ -7653,7 +7076,7 @@ type GroupInviteLinkDisabledUpdate struct { func (x *GroupInviteLinkDisabledUpdate) Reset() { *x = GroupInviteLinkDisabledUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[73] + mi := &file_backuppb_Backup_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7665,7 +7088,7 @@ func (x *GroupInviteLinkDisabledUpdate) String() string { func (*GroupInviteLinkDisabledUpdate) ProtoMessage() {} func (x *GroupInviteLinkDisabledUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[73] + mi := &file_backuppb_Backup_proto_msgTypes[69] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7678,7 +7101,7 @@ func (x *GroupInviteLinkDisabledUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupInviteLinkDisabledUpdate.ProtoReflect.Descriptor instead. func (*GroupInviteLinkDisabledUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{73} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{69} } func (x *GroupInviteLinkDisabledUpdate) GetUpdaterAci() []byte { @@ -7697,7 +7120,7 @@ type GroupMemberJoinedByLinkUpdate struct { func (x *GroupMemberJoinedByLinkUpdate) Reset() { *x = GroupMemberJoinedByLinkUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[74] + mi := &file_backuppb_Backup_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7709,7 +7132,7 @@ func (x *GroupMemberJoinedByLinkUpdate) String() string { func (*GroupMemberJoinedByLinkUpdate) ProtoMessage() {} func (x *GroupMemberJoinedByLinkUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[74] + mi := &file_backuppb_Backup_proto_msgTypes[70] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7722,7 +7145,7 @@ func (x *GroupMemberJoinedByLinkUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupMemberJoinedByLinkUpdate.ProtoReflect.Descriptor instead. func (*GroupMemberJoinedByLinkUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{74} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{70} } func (x *GroupMemberJoinedByLinkUpdate) GetNewMemberAci() []byte { @@ -7741,7 +7164,7 @@ type GroupV2MigrationUpdate struct { func (x *GroupV2MigrationUpdate) Reset() { *x = GroupV2MigrationUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[75] + mi := &file_backuppb_Backup_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7753,7 +7176,7 @@ func (x *GroupV2MigrationUpdate) String() string { func (*GroupV2MigrationUpdate) ProtoMessage() {} func (x *GroupV2MigrationUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[75] + mi := &file_backuppb_Backup_proto_msgTypes[71] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7766,7 +7189,7 @@ func (x *GroupV2MigrationUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupV2MigrationUpdate.ProtoReflect.Descriptor instead. func (*GroupV2MigrationUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{75} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{71} } // Another user migrated gv1->gv2 but was unable to add @@ -7779,7 +7202,7 @@ type GroupV2MigrationSelfInvitedUpdate struct { func (x *GroupV2MigrationSelfInvitedUpdate) Reset() { *x = GroupV2MigrationSelfInvitedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[76] + mi := &file_backuppb_Backup_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7791,7 +7214,7 @@ func (x *GroupV2MigrationSelfInvitedUpdate) String() string { func (*GroupV2MigrationSelfInvitedUpdate) ProtoMessage() {} func (x *GroupV2MigrationSelfInvitedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[76] + mi := &file_backuppb_Backup_proto_msgTypes[72] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7804,7 +7227,7 @@ func (x *GroupV2MigrationSelfInvitedUpdate) ProtoReflect() protoreflect.Message // Deprecated: Use GroupV2MigrationSelfInvitedUpdate.ProtoReflect.Descriptor instead. func (*GroupV2MigrationSelfInvitedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{76} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{72} } // The local user migrated gv1->gv2 but was unable to @@ -7819,7 +7242,7 @@ type GroupV2MigrationInvitedMembersUpdate struct { func (x *GroupV2MigrationInvitedMembersUpdate) Reset() { *x = GroupV2MigrationInvitedMembersUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[77] + mi := &file_backuppb_Backup_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7831,7 +7254,7 @@ func (x *GroupV2MigrationInvitedMembersUpdate) String() string { func (*GroupV2MigrationInvitedMembersUpdate) ProtoMessage() {} func (x *GroupV2MigrationInvitedMembersUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[77] + mi := &file_backuppb_Backup_proto_msgTypes[73] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7844,7 +7267,7 @@ func (x *GroupV2MigrationInvitedMembersUpdate) ProtoReflect() protoreflect.Messa // Deprecated: Use GroupV2MigrationInvitedMembersUpdate.ProtoReflect.Descriptor instead. func (*GroupV2MigrationInvitedMembersUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{77} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{73} } func (x *GroupV2MigrationInvitedMembersUpdate) GetInvitedMembersCount() uint32 { @@ -7866,7 +7289,7 @@ type GroupV2MigrationDroppedMembersUpdate struct { func (x *GroupV2MigrationDroppedMembersUpdate) Reset() { *x = GroupV2MigrationDroppedMembersUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[78] + mi := &file_backuppb_Backup_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7878,7 +7301,7 @@ func (x *GroupV2MigrationDroppedMembersUpdate) String() string { func (*GroupV2MigrationDroppedMembersUpdate) ProtoMessage() {} func (x *GroupV2MigrationDroppedMembersUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[78] + mi := &file_backuppb_Backup_proto_msgTypes[74] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7891,7 +7314,7 @@ func (x *GroupV2MigrationDroppedMembersUpdate) ProtoReflect() protoreflect.Messa // Deprecated: Use GroupV2MigrationDroppedMembersUpdate.ProtoReflect.Descriptor instead. func (*GroupV2MigrationDroppedMembersUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{78} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{74} } func (x *GroupV2MigrationDroppedMembersUpdate) GetDroppedMembersCount() uint32 { @@ -7912,7 +7335,7 @@ type GroupExpirationTimerUpdate struct { func (x *GroupExpirationTimerUpdate) Reset() { *x = GroupExpirationTimerUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[79] + mi := &file_backuppb_Backup_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7924,7 +7347,7 @@ func (x *GroupExpirationTimerUpdate) String() string { func (*GroupExpirationTimerUpdate) ProtoMessage() {} func (x *GroupExpirationTimerUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[79] + mi := &file_backuppb_Backup_proto_msgTypes[75] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7937,7 +7360,7 @@ func (x *GroupExpirationTimerUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupExpirationTimerUpdate.ProtoReflect.Descriptor instead. func (*GroupExpirationTimerUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{79} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{75} } func (x *GroupExpirationTimerUpdate) GetExpiresInMs() uint64 { @@ -7954,110 +7377,6 @@ func (x *GroupExpirationTimerUpdate) GetUpdaterAci() []byte { return nil } -type PollTerminateUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetSentTimestamp uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp,proto3" json:"targetSentTimestamp,omitempty"` - Question string `protobuf:"bytes,2,opt,name=question,proto3" json:"question,omitempty"` // Between 1-100 characters - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PollTerminateUpdate) Reset() { - *x = PollTerminateUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[80] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PollTerminateUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PollTerminateUpdate) ProtoMessage() {} - -func (x *PollTerminateUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[80] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PollTerminateUpdate.ProtoReflect.Descriptor instead. -func (*PollTerminateUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{80} -} - -func (x *PollTerminateUpdate) GetTargetSentTimestamp() uint64 { - if x != nil { - return x.TargetSentTimestamp - } - return 0 -} - -func (x *PollTerminateUpdate) GetQuestion() string { - if x != nil { - return x.Question - } - return "" -} - -type PinMessageUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetSentTimestamp uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp,proto3" json:"targetSentTimestamp,omitempty"` - AuthorId uint64 `protobuf:"varint,2,opt,name=authorId,proto3" json:"authorId,omitempty"` // recipient id - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PinMessageUpdate) Reset() { - *x = PinMessageUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[81] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PinMessageUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PinMessageUpdate) ProtoMessage() {} - -func (x *PinMessageUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[81] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PinMessageUpdate.ProtoReflect.Descriptor instead. -func (*PinMessageUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{81} -} - -func (x *PinMessageUpdate) GetTargetSentTimestamp() uint64 { - if x != nil { - return x.TargetSentTimestamp - } - return 0 -} - -func (x *PinMessageUpdate) GetAuthorId() uint64 { - if x != nil { - return x.AuthorId - } - return 0 -} - type StickerPack struct { state protoimpl.MessageState `protogen:"open.v1"` PackId []byte `protobuf:"bytes,1,opt,name=packId,proto3" json:"packId,omitempty"` @@ -8068,7 +7387,7 @@ type StickerPack struct { func (x *StickerPack) Reset() { *x = StickerPack{} - mi := &file_backuppb_Backup_proto_msgTypes[82] + mi := &file_backuppb_Backup_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8080,7 +7399,7 @@ func (x *StickerPack) String() string { func (*StickerPack) ProtoMessage() {} func (x *StickerPack) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[82] + mi := &file_backuppb_Backup_proto_msgTypes[76] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8093,7 +7412,7 @@ func (x *StickerPack) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerPack.ProtoReflect.Descriptor instead. func (*StickerPack) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{82} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{76} } func (x *StickerPack) GetPackId() []byte { @@ -8134,7 +7453,7 @@ type ChatStyle struct { func (x *ChatStyle) Reset() { *x = ChatStyle{} - mi := &file_backuppb_Backup_proto_msgTypes[83] + mi := &file_backuppb_Backup_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8146,7 +7465,7 @@ func (x *ChatStyle) String() string { func (*ChatStyle) ProtoMessage() {} func (x *ChatStyle) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[83] + mi := &file_backuppb_Backup_proto_msgTypes[77] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8159,7 +7478,7 @@ func (x *ChatStyle) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatStyle.ProtoReflect.Descriptor instead. func (*ChatStyle) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{77} } func (x *ChatStyle) GetWallpaper() isChatStyle_Wallpaper { @@ -8291,7 +7610,7 @@ type NotificationProfile struct { func (x *NotificationProfile) Reset() { *x = NotificationProfile{} - mi := &file_backuppb_Backup_proto_msgTypes[84] + mi := &file_backuppb_Backup_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8303,7 +7622,7 @@ func (x *NotificationProfile) String() string { func (*NotificationProfile) ProtoMessage() {} func (x *NotificationProfile) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[84] + mi := &file_backuppb_Backup_proto_msgTypes[78] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8316,7 +7635,7 @@ func (x *NotificationProfile) ProtoReflect() protoreflect.Message { // Deprecated: Use NotificationProfile.ProtoReflect.Descriptor instead. func (*NotificationProfile) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{84} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{78} } func (x *NotificationProfile) GetName() string { @@ -8422,7 +7741,7 @@ type ChatFolder struct { func (x *ChatFolder) Reset() { *x = ChatFolder{} - mi := &file_backuppb_Backup_proto_msgTypes[85] + mi := &file_backuppb_Backup_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8434,7 +7753,7 @@ func (x *ChatFolder) String() string { func (*ChatFolder) ProtoMessage() {} func (x *ChatFolder) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[85] + mi := &file_backuppb_Backup_proto_msgTypes[79] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8447,7 +7766,7 @@ func (x *ChatFolder) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatFolder.ProtoReflect.Descriptor instead. func (*ChatFolder) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{85} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{79} } func (x *ChatFolder) GetName() string { @@ -8524,7 +7843,7 @@ type AccountData_UsernameLink struct { func (x *AccountData_UsernameLink) Reset() { *x = AccountData_UsernameLink{} - mi := &file_backuppb_Backup_proto_msgTypes[86] + mi := &file_backuppb_Backup_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8536,7 +7855,7 @@ func (x *AccountData_UsernameLink) String() string { func (*AccountData_UsernameLink) ProtoMessage() {} func (x *AccountData_UsernameLink) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[86] + mi := &file_backuppb_Backup_proto_msgTypes[80] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8573,74 +7892,6 @@ func (x *AccountData_UsernameLink) GetColor() AccountData_UsernameLink_Color { return AccountData_UsernameLink_UNKNOWN } -type AccountData_AutoDownloadSettings struct { - state protoimpl.MessageState `protogen:"open.v1"` - Images AccountData_AutoDownloadSettings_AutoDownloadOption `protobuf:"varint,1,opt,name=images,proto3,enum=signal.backup.AccountData_AutoDownloadSettings_AutoDownloadOption" json:"images,omitempty"` - Audio AccountData_AutoDownloadSettings_AutoDownloadOption `protobuf:"varint,2,opt,name=audio,proto3,enum=signal.backup.AccountData_AutoDownloadSettings_AutoDownloadOption" json:"audio,omitempty"` - Video AccountData_AutoDownloadSettings_AutoDownloadOption `protobuf:"varint,3,opt,name=video,proto3,enum=signal.backup.AccountData_AutoDownloadSettings_AutoDownloadOption" json:"video,omitempty"` - Documents AccountData_AutoDownloadSettings_AutoDownloadOption `protobuf:"varint,4,opt,name=documents,proto3,enum=signal.backup.AccountData_AutoDownloadSettings_AutoDownloadOption" json:"documents,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountData_AutoDownloadSettings) Reset() { - *x = AccountData_AutoDownloadSettings{} - mi := &file_backuppb_Backup_proto_msgTypes[87] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountData_AutoDownloadSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountData_AutoDownloadSettings) ProtoMessage() {} - -func (x *AccountData_AutoDownloadSettings) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[87] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AccountData_AutoDownloadSettings.ProtoReflect.Descriptor instead. -func (*AccountData_AutoDownloadSettings) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *AccountData_AutoDownloadSettings) GetImages() AccountData_AutoDownloadSettings_AutoDownloadOption { - if x != nil { - return x.Images - } - return AccountData_AutoDownloadSettings_UNKNOWN -} - -func (x *AccountData_AutoDownloadSettings) GetAudio() AccountData_AutoDownloadSettings_AutoDownloadOption { - if x != nil { - return x.Audio - } - return AccountData_AutoDownloadSettings_UNKNOWN -} - -func (x *AccountData_AutoDownloadSettings) GetVideo() AccountData_AutoDownloadSettings_AutoDownloadOption { - if x != nil { - return x.Video - } - return AccountData_AutoDownloadSettings_UNKNOWN -} - -func (x *AccountData_AutoDownloadSettings) GetDocuments() AccountData_AutoDownloadSettings_AutoDownloadOption { - if x != nil { - return x.Documents - } - return AccountData_AutoDownloadSettings_UNKNOWN -} - type AccountData_AccountSettings struct { state protoimpl.MessageState `protogen:"open.v1"` ReadReceipts bool `protobuf:"varint,1,opt,name=readReceipts,proto3" json:"readReceipts,omitempty"` @@ -8664,23 +7915,14 @@ type AccountData_AccountSettings struct { CustomChatColors []*ChatStyle_CustomChatColor `protobuf:"bytes,19,rep,name=customChatColors,proto3" json:"customChatColors,omitempty"` OptimizeOnDeviceStorage bool `protobuf:"varint,20,opt,name=optimizeOnDeviceStorage,proto3" json:"optimizeOnDeviceStorage,omitempty"` // See zkgroup for integer particular values. Unset if backups are not enabled. - BackupTier *uint64 `protobuf:"varint,21,opt,name=backupTier,proto3,oneof" json:"backupTier,omitempty"` - DefaultSentMediaQuality AccountData_SentMediaQuality `protobuf:"varint,23,opt,name=defaultSentMediaQuality,proto3,enum=signal.backup.AccountData_SentMediaQuality" json:"defaultSentMediaQuality,omitempty"` - AutoDownloadSettings *AccountData_AutoDownloadSettings `protobuf:"bytes,24,opt,name=autoDownloadSettings,proto3" json:"autoDownloadSettings,omitempty"` - ScreenLockTimeoutMinutes *uint32 `protobuf:"varint,26,opt,name=screenLockTimeoutMinutes,proto3,oneof" json:"screenLockTimeoutMinutes,omitempty"` // If unset, consider screen lock to be disabled. - PinReminders *bool `protobuf:"varint,27,opt,name=pinReminders,proto3,oneof" json:"pinReminders,omitempty"` // If unset, consider pin reminders to be enabled. - AppTheme AccountData_AppTheme `protobuf:"varint,28,opt,name=appTheme,proto3,enum=signal.backup.AccountData_AppTheme" json:"appTheme,omitempty"` // If unset, treat the same as "Unknown" case - CallsUseLessDataSetting AccountData_CallsUseLessDataSetting `protobuf:"varint,29,opt,name=callsUseLessDataSetting,proto3,enum=signal.backup.AccountData_CallsUseLessDataSetting" json:"callsUseLessDataSetting,omitempty"` // If unset, treat the same as "Unknown" case - AllowSealedSenderFromAnyone bool `protobuf:"varint,30,opt,name=allowSealedSenderFromAnyone,proto3" json:"allowSealedSenderFromAnyone,omitempty"` - AllowAutomaticKeyVerification bool `protobuf:"varint,31,opt,name=allowAutomaticKeyVerification,proto3" json:"allowAutomaticKeyVerification,omitempty"` - HasSeenAdminDeleteEducationDialog bool `protobuf:"varint,32,opt,name=hasSeenAdminDeleteEducationDialog,proto3" json:"hasSeenAdminDeleteEducationDialog,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + BackupTier *uint64 `protobuf:"varint,21,opt,name=backupTier,proto3,oneof" json:"backupTier,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AccountData_AccountSettings) Reset() { *x = AccountData_AccountSettings{} - mi := &file_backuppb_Backup_proto_msgTypes[88] + mi := &file_backuppb_Backup_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8692,7 +7934,7 @@ func (x *AccountData_AccountSettings) String() string { func (*AccountData_AccountSettings) ProtoMessage() {} func (x *AccountData_AccountSettings) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[88] + mi := &file_backuppb_Backup_proto_msgTypes[81] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8705,7 +7947,7 @@ func (x *AccountData_AccountSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use AccountData_AccountSettings.ProtoReflect.Descriptor instead. func (*AccountData_AccountSettings) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 2} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 1} } func (x *AccountData_AccountSettings) GetReadReceipts() bool { @@ -8855,69 +8097,6 @@ func (x *AccountData_AccountSettings) GetBackupTier() uint64 { return 0 } -func (x *AccountData_AccountSettings) GetDefaultSentMediaQuality() AccountData_SentMediaQuality { - if x != nil { - return x.DefaultSentMediaQuality - } - return AccountData_UNKNOWN_QUALITY -} - -func (x *AccountData_AccountSettings) GetAutoDownloadSettings() *AccountData_AutoDownloadSettings { - if x != nil { - return x.AutoDownloadSettings - } - return nil -} - -func (x *AccountData_AccountSettings) GetScreenLockTimeoutMinutes() uint32 { - if x != nil && x.ScreenLockTimeoutMinutes != nil { - return *x.ScreenLockTimeoutMinutes - } - return 0 -} - -func (x *AccountData_AccountSettings) GetPinReminders() bool { - if x != nil && x.PinReminders != nil { - return *x.PinReminders - } - return false -} - -func (x *AccountData_AccountSettings) GetAppTheme() AccountData_AppTheme { - if x != nil { - return x.AppTheme - } - return AccountData_UNKNOWN_APP_THEME -} - -func (x *AccountData_AccountSettings) GetCallsUseLessDataSetting() AccountData_CallsUseLessDataSetting { - if x != nil { - return x.CallsUseLessDataSetting - } - return AccountData_UNKNOWN_CALL_DATA_SETTING -} - -func (x *AccountData_AccountSettings) GetAllowSealedSenderFromAnyone() bool { - if x != nil { - return x.AllowSealedSenderFromAnyone - } - return false -} - -func (x *AccountData_AccountSettings) GetAllowAutomaticKeyVerification() bool { - if x != nil { - return x.AllowAutomaticKeyVerification - } - return false -} - -func (x *AccountData_AccountSettings) GetHasSeenAdminDeleteEducationDialog() bool { - if x != nil { - return x.HasSeenAdminDeleteEducationDialog - } - return false -} - type AccountData_SubscriberData struct { state protoimpl.MessageState `protogen:"open.v1"` SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` @@ -8929,7 +8108,7 @@ type AccountData_SubscriberData struct { func (x *AccountData_SubscriberData) Reset() { *x = AccountData_SubscriberData{} - mi := &file_backuppb_Backup_proto_msgTypes[89] + mi := &file_backuppb_Backup_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8941,7 +8120,7 @@ func (x *AccountData_SubscriberData) String() string { func (*AccountData_SubscriberData) ProtoMessage() {} func (x *AccountData_SubscriberData) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[89] + mi := &file_backuppb_Backup_proto_msgTypes[82] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -8954,7 +8133,7 @@ func (x *AccountData_SubscriberData) ProtoReflect() protoreflect.Message { // Deprecated: Use AccountData_SubscriberData.ProtoReflect.Descriptor instead. func (*AccountData_SubscriberData) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 3} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 2} } func (x *AccountData_SubscriberData) GetSubscriberId() []byte { @@ -8994,7 +8173,7 @@ type AccountData_IAPSubscriberData struct { func (x *AccountData_IAPSubscriberData) Reset() { *x = AccountData_IAPSubscriberData{} - mi := &file_backuppb_Backup_proto_msgTypes[90] + mi := &file_backuppb_Backup_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9006,7 +8185,7 @@ func (x *AccountData_IAPSubscriberData) String() string { func (*AccountData_IAPSubscriberData) ProtoMessage() {} func (x *AccountData_IAPSubscriberData) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[90] + mi := &file_backuppb_Backup_proto_msgTypes[83] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9019,7 +8198,7 @@ func (x *AccountData_IAPSubscriberData) ProtoReflect() protoreflect.Message { // Deprecated: Use AccountData_IAPSubscriberData.ProtoReflect.Descriptor instead. func (*AccountData_IAPSubscriberData) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 4} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 3} } func (x *AccountData_IAPSubscriberData) GetSubscriberId() []byte { @@ -9074,66 +8253,6 @@ func (*AccountData_IAPSubscriberData_PurchaseToken) isAccountData_IAPSubscriberD func (*AccountData_IAPSubscriberData_OriginalTransactionId) isAccountData_IAPSubscriberData_IapSubscriptionId() { } -type AccountData_AndroidSpecificSettings struct { - state protoimpl.MessageState `protogen:"open.v1"` - UseSystemEmoji bool `protobuf:"varint,1,opt,name=useSystemEmoji,proto3" json:"useSystemEmoji,omitempty"` - ScreenshotSecurity bool `protobuf:"varint,2,opt,name=screenshotSecurity,proto3" json:"screenshotSecurity,omitempty"` - NavigationBarSize AccountData_AndroidSpecificSettings_NavigationBarSize `protobuf:"varint,3,opt,name=navigationBarSize,proto3,enum=signal.backup.AccountData_AndroidSpecificSettings_NavigationBarSize" json:"navigationBarSize,omitempty"` // If unset, treat the same as "Unknown" case - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountData_AndroidSpecificSettings) Reset() { - *x = AccountData_AndroidSpecificSettings{} - mi := &file_backuppb_Backup_proto_msgTypes[91] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountData_AndroidSpecificSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountData_AndroidSpecificSettings) ProtoMessage() {} - -func (x *AccountData_AndroidSpecificSettings) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[91] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AccountData_AndroidSpecificSettings.ProtoReflect.Descriptor instead. -func (*AccountData_AndroidSpecificSettings) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 5} -} - -func (x *AccountData_AndroidSpecificSettings) GetUseSystemEmoji() bool { - if x != nil { - return x.UseSystemEmoji - } - return false -} - -func (x *AccountData_AndroidSpecificSettings) GetScreenshotSecurity() bool { - if x != nil { - return x.ScreenshotSecurity - } - return false -} - -func (x *AccountData_AndroidSpecificSettings) GetNavigationBarSize() AccountData_AndroidSpecificSettings_NavigationBarSize { - if x != nil { - return x.NavigationBarSize - } - return AccountData_AndroidSpecificSettings_UNKNOWN_BAR_SIZE -} - type Contact_Registered struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -9142,7 +8261,7 @@ type Contact_Registered struct { func (x *Contact_Registered) Reset() { *x = Contact_Registered{} - mi := &file_backuppb_Backup_proto_msgTypes[92] + mi := &file_backuppb_Backup_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9154,7 +8273,7 @@ func (x *Contact_Registered) String() string { func (*Contact_Registered) ProtoMessage() {} func (x *Contact_Registered) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[92] + mi := &file_backuppb_Backup_proto_msgTypes[84] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9179,7 +8298,7 @@ type Contact_NotRegistered struct { func (x *Contact_NotRegistered) Reset() { *x = Contact_NotRegistered{} - mi := &file_backuppb_Backup_proto_msgTypes[93] + mi := &file_backuppb_Backup_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9191,7 +8310,7 @@ func (x *Contact_NotRegistered) String() string { func (*Contact_NotRegistered) ProtoMessage() {} func (x *Contact_NotRegistered) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[93] + mi := &file_backuppb_Backup_proto_msgTypes[85] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9224,7 +8343,7 @@ type Contact_Name struct { func (x *Contact_Name) Reset() { *x = Contact_Name{} - mi := &file_backuppb_Backup_proto_msgTypes[94] + mi := &file_backuppb_Backup_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9236,7 +8355,7 @@ func (x *Contact_Name) String() string { func (*Contact_Name) ProtoMessage() {} func (x *Contact_Name) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[94] + mi := &file_backuppb_Backup_proto_msgTypes[86] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9285,14 +8404,13 @@ type Group_GroupSnapshot struct { InviteLinkPassword []byte `protobuf:"bytes,10,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` AnnouncementsOnly bool `protobuf:"varint,12,opt,name=announcements_only,json=announcementsOnly,proto3" json:"announcements_only,omitempty"` MembersBanned []*Group_MemberBanned `protobuf:"bytes,13,rep,name=members_banned,json=membersBanned,proto3" json:"members_banned,omitempty"` - Terminated bool `protobuf:"varint,14,opt,name=terminated,proto3" json:"terminated,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Group_GroupSnapshot) Reset() { *x = Group_GroupSnapshot{} - mi := &file_backuppb_Backup_proto_msgTypes[95] + mi := &file_backuppb_Backup_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9304,7 +8422,7 @@ func (x *Group_GroupSnapshot) String() string { func (*Group_GroupSnapshot) ProtoMessage() {} func (x *Group_GroupSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[95] + mi := &file_backuppb_Backup_proto_msgTypes[87] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9404,13 +8522,6 @@ func (x *Group_GroupSnapshot) GetMembersBanned() []*Group_MemberBanned { return nil } -func (x *Group_GroupSnapshot) GetTerminated() bool { - if x != nil { - return x.Terminated - } - return false -} - type Group_GroupAttributeBlob struct { state protoimpl.MessageState `protogen:"open.v1"` // If unset, consider the field it represents to not be present @@ -9428,7 +8539,7 @@ type Group_GroupAttributeBlob struct { func (x *Group_GroupAttributeBlob) Reset() { *x = Group_GroupAttributeBlob{} - mi := &file_backuppb_Backup_proto_msgTypes[96] + mi := &file_backuppb_Backup_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9440,7 +8551,7 @@ func (x *Group_GroupAttributeBlob) String() string { func (*Group_GroupAttributeBlob) ProtoMessage() {} func (x *Group_GroupAttributeBlob) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[96] + mi := &file_backuppb_Backup_proto_msgTypes[88] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9532,15 +8643,13 @@ type Group_Member struct { UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` Role Group_Member_Role `protobuf:"varint,2,opt,name=role,proto3,enum=signal.backup.Group_Member_Role" json:"role,omitempty"` JoinedAtVersion uint32 `protobuf:"varint,5,opt,name=joinedAtVersion,proto3" json:"joinedAtVersion,omitempty"` - LabelEmoji string `protobuf:"bytes,6,opt,name=labelEmoji,proto3" json:"labelEmoji,omitempty"` - LabelString string `protobuf:"bytes,7,opt,name=labelString,proto3" json:"labelString,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Group_Member) Reset() { *x = Group_Member{} - mi := &file_backuppb_Backup_proto_msgTypes[97] + mi := &file_backuppb_Backup_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9552,7 +8661,7 @@ func (x *Group_Member) String() string { func (*Group_Member) ProtoMessage() {} func (x *Group_Member) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[97] + mi := &file_backuppb_Backup_proto_msgTypes[89] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9589,20 +8698,6 @@ func (x *Group_Member) GetJoinedAtVersion() uint32 { return 0 } -func (x *Group_Member) GetLabelEmoji() string { - if x != nil { - return x.LabelEmoji - } - return "" -} - -func (x *Group_Member) GetLabelString() string { - if x != nil { - return x.LabelString - } - return "" -} - type Group_MemberPendingProfileKey struct { state protoimpl.MessageState `protogen:"open.v1"` Member *Group_Member `protobuf:"bytes,1,opt,name=member,proto3" json:"member,omitempty"` @@ -9614,7 +8709,7 @@ type Group_MemberPendingProfileKey struct { func (x *Group_MemberPendingProfileKey) Reset() { *x = Group_MemberPendingProfileKey{} - mi := &file_backuppb_Backup_proto_msgTypes[98] + mi := &file_backuppb_Backup_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9626,7 +8721,7 @@ func (x *Group_MemberPendingProfileKey) String() string { func (*Group_MemberPendingProfileKey) ProtoMessage() {} func (x *Group_MemberPendingProfileKey) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[98] + mi := &file_backuppb_Backup_proto_msgTypes[90] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9673,7 +8768,7 @@ type Group_MemberPendingAdminApproval struct { func (x *Group_MemberPendingAdminApproval) Reset() { *x = Group_MemberPendingAdminApproval{} - mi := &file_backuppb_Backup_proto_msgTypes[99] + mi := &file_backuppb_Backup_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9685,7 +8780,7 @@ func (x *Group_MemberPendingAdminApproval) String() string { func (*Group_MemberPendingAdminApproval) ProtoMessage() {} func (x *Group_MemberPendingAdminApproval) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[99] + mi := &file_backuppb_Backup_proto_msgTypes[91] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9725,7 +8820,7 @@ type Group_MemberBanned struct { func (x *Group_MemberBanned) Reset() { *x = Group_MemberBanned{} - mi := &file_backuppb_Backup_proto_msgTypes[100] + mi := &file_backuppb_Backup_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9737,7 +8832,7 @@ func (x *Group_MemberBanned) String() string { func (*Group_MemberBanned) ProtoMessage() {} func (x *Group_MemberBanned) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[100] + mi := &file_backuppb_Backup_proto_msgTypes[92] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9772,14 +8867,13 @@ type Group_AccessControl struct { Attributes Group_AccessControl_AccessRequired `protobuf:"varint,1,opt,name=attributes,proto3,enum=signal.backup.Group_AccessControl_AccessRequired" json:"attributes,omitempty"` Members Group_AccessControl_AccessRequired `protobuf:"varint,2,opt,name=members,proto3,enum=signal.backup.Group_AccessControl_AccessRequired" json:"members,omitempty"` AddFromInviteLink Group_AccessControl_AccessRequired `protobuf:"varint,3,opt,name=addFromInviteLink,proto3,enum=signal.backup.Group_AccessControl_AccessRequired" json:"addFromInviteLink,omitempty"` - MemberLabel Group_AccessControl_AccessRequired `protobuf:"varint,4,opt,name=memberLabel,proto3,enum=signal.backup.Group_AccessControl_AccessRequired" json:"memberLabel,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *Group_AccessControl) Reset() { *x = Group_AccessControl{} - mi := &file_backuppb_Backup_proto_msgTypes[101] + mi := &file_backuppb_Backup_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9791,7 +8885,7 @@ func (x *Group_AccessControl) String() string { func (*Group_AccessControl) ProtoMessage() {} func (x *Group_AccessControl) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[101] + mi := &file_backuppb_Backup_proto_msgTypes[93] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9828,13 +8922,6 @@ func (x *Group_AccessControl) GetAddFromInviteLink() Group_AccessControl_AccessR return Group_AccessControl_UNKNOWN } -func (x *Group_AccessControl) GetMemberLabel() Group_AccessControl_AccessRequired { - if x != nil { - return x.MemberLabel - } - return Group_AccessControl_UNKNOWN -} - type ChatItem_IncomingMessageDetails struct { state protoimpl.MessageState `protogen:"open.v1"` DateReceived uint64 `protobuf:"varint,1,opt,name=dateReceived,proto3" json:"dateReceived,omitempty"` @@ -9847,7 +8934,7 @@ type ChatItem_IncomingMessageDetails struct { func (x *ChatItem_IncomingMessageDetails) Reset() { *x = ChatItem_IncomingMessageDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[102] + mi := &file_backuppb_Backup_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9859,7 +8946,7 @@ func (x *ChatItem_IncomingMessageDetails) String() string { func (*ChatItem_IncomingMessageDetails) ProtoMessage() {} func (x *ChatItem_IncomingMessageDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[102] + mi := &file_backuppb_Backup_proto_msgTypes[94] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9913,7 +9000,7 @@ type ChatItem_OutgoingMessageDetails struct { func (x *ChatItem_OutgoingMessageDetails) Reset() { *x = ChatItem_OutgoingMessageDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[103] + mi := &file_backuppb_Backup_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9925,7 +9012,7 @@ func (x *ChatItem_OutgoingMessageDetails) String() string { func (*ChatItem_OutgoingMessageDetails) ProtoMessage() {} func (x *ChatItem_OutgoingMessageDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[103] + mi := &file_backuppb_Backup_proto_msgTypes[95] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9963,7 +9050,7 @@ type ChatItem_DirectionlessMessageDetails struct { func (x *ChatItem_DirectionlessMessageDetails) Reset() { *x = ChatItem_DirectionlessMessageDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[104] + mi := &file_backuppb_Backup_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -9975,7 +9062,7 @@ func (x *ChatItem_DirectionlessMessageDetails) String() string { func (*ChatItem_DirectionlessMessageDetails) ProtoMessage() {} func (x *ChatItem_DirectionlessMessageDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[104] + mi := &file_backuppb_Backup_proto_msgTypes[96] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -9991,96 +9078,6 @@ func (*ChatItem_DirectionlessMessageDetails) Descriptor() ([]byte, []int) { return file_backuppb_Backup_proto_rawDescGZIP(), []int{13, 2} } -type ChatItem_PinDetails struct { - state protoimpl.MessageState `protogen:"open.v1"` - PinnedAtTimestamp uint64 `protobuf:"varint,1,opt,name=pinnedAtTimestamp,proto3" json:"pinnedAtTimestamp,omitempty"` - // Types that are valid to be assigned to PinExpiry: - // - // *ChatItem_PinDetails_PinExpiresAtTimestamp - // *ChatItem_PinDetails_PinNeverExpires - PinExpiry isChatItem_PinDetails_PinExpiry `protobuf_oneof:"pinExpiry"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatItem_PinDetails) Reset() { - *x = ChatItem_PinDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[105] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatItem_PinDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatItem_PinDetails) ProtoMessage() {} - -func (x *ChatItem_PinDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[105] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChatItem_PinDetails.ProtoReflect.Descriptor instead. -func (*ChatItem_PinDetails) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{13, 3} -} - -func (x *ChatItem_PinDetails) GetPinnedAtTimestamp() uint64 { - if x != nil { - return x.PinnedAtTimestamp - } - return 0 -} - -func (x *ChatItem_PinDetails) GetPinExpiry() isChatItem_PinDetails_PinExpiry { - if x != nil { - return x.PinExpiry - } - return nil -} - -func (x *ChatItem_PinDetails) GetPinExpiresAtTimestamp() uint64 { - if x != nil { - if x, ok := x.PinExpiry.(*ChatItem_PinDetails_PinExpiresAtTimestamp); ok { - return x.PinExpiresAtTimestamp - } - } - return 0 -} - -func (x *ChatItem_PinDetails) GetPinNeverExpires() bool { - if x != nil { - if x, ok := x.PinExpiry.(*ChatItem_PinDetails_PinNeverExpires); ok { - return x.PinNeverExpires - } - } - return false -} - -type isChatItem_PinDetails_PinExpiry interface { - isChatItem_PinDetails_PinExpiry() -} - -type ChatItem_PinDetails_PinExpiresAtTimestamp struct { - PinExpiresAtTimestamp uint64 `protobuf:"varint,2,opt,name=pinExpiresAtTimestamp,proto3,oneof"` // timestamp when the pin should expire -} - -type ChatItem_PinDetails_PinNeverExpires struct { - PinNeverExpires bool `protobuf:"varint,3,opt,name=pinNeverExpires,proto3,oneof"` -} - -func (*ChatItem_PinDetails_PinExpiresAtTimestamp) isChatItem_PinDetails_PinExpiry() {} - -func (*ChatItem_PinDetails_PinNeverExpires) isChatItem_PinDetails_PinExpiry() {} - type SendStatus_Pending struct { state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields @@ -10089,7 +9086,7 @@ type SendStatus_Pending struct { func (x *SendStatus_Pending) Reset() { *x = SendStatus_Pending{} - mi := &file_backuppb_Backup_proto_msgTypes[106] + mi := &file_backuppb_Backup_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10101,7 +9098,7 @@ func (x *SendStatus_Pending) String() string { func (*SendStatus_Pending) ProtoMessage() {} func (x *SendStatus_Pending) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[106] + mi := &file_backuppb_Backup_proto_msgTypes[97] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10126,7 +9123,7 @@ type SendStatus_Sent struct { func (x *SendStatus_Sent) Reset() { *x = SendStatus_Sent{} - mi := &file_backuppb_Backup_proto_msgTypes[107] + mi := &file_backuppb_Backup_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10138,7 +9135,7 @@ func (x *SendStatus_Sent) String() string { func (*SendStatus_Sent) ProtoMessage() {} func (x *SendStatus_Sent) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[107] + mi := &file_backuppb_Backup_proto_msgTypes[98] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10170,7 +9167,7 @@ type SendStatus_Delivered struct { func (x *SendStatus_Delivered) Reset() { *x = SendStatus_Delivered{} - mi := &file_backuppb_Backup_proto_msgTypes[108] + mi := &file_backuppb_Backup_proto_msgTypes[99] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10182,7 +9179,7 @@ func (x *SendStatus_Delivered) String() string { func (*SendStatus_Delivered) ProtoMessage() {} func (x *SendStatus_Delivered) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[108] + mi := &file_backuppb_Backup_proto_msgTypes[99] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10214,7 +9211,7 @@ type SendStatus_Read struct { func (x *SendStatus_Read) Reset() { *x = SendStatus_Read{} - mi := &file_backuppb_Backup_proto_msgTypes[109] + mi := &file_backuppb_Backup_proto_msgTypes[100] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10226,7 +9223,7 @@ func (x *SendStatus_Read) String() string { func (*SendStatus_Read) ProtoMessage() {} func (x *SendStatus_Read) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[109] + mi := &file_backuppb_Backup_proto_msgTypes[100] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10258,7 +9255,7 @@ type SendStatus_Viewed struct { func (x *SendStatus_Viewed) Reset() { *x = SendStatus_Viewed{} - mi := &file_backuppb_Backup_proto_msgTypes[110] + mi := &file_backuppb_Backup_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10270,7 +9267,7 @@ func (x *SendStatus_Viewed) String() string { func (*SendStatus_Viewed) ProtoMessage() {} func (x *SendStatus_Viewed) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[110] + mi := &file_backuppb_Backup_proto_msgTypes[101] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10302,7 +9299,7 @@ type SendStatus_Skipped struct { func (x *SendStatus_Skipped) Reset() { *x = SendStatus_Skipped{} - mi := &file_backuppb_Backup_proto_msgTypes[111] + mi := &file_backuppb_Backup_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10314,7 +9311,7 @@ func (x *SendStatus_Skipped) String() string { func (*SendStatus_Skipped) ProtoMessage() {} func (x *SendStatus_Skipped) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[111] + mi := &file_backuppb_Backup_proto_msgTypes[102] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10339,7 +9336,7 @@ type SendStatus_Failed struct { func (x *SendStatus_Failed) Reset() { *x = SendStatus_Failed{} - mi := &file_backuppb_Backup_proto_msgTypes[112] + mi := &file_backuppb_Backup_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10351,7 +9348,7 @@ func (x *SendStatus_Failed) String() string { func (*SendStatus_Failed) ProtoMessage() {} func (x *SendStatus_Failed) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[112] + mi := &file_backuppb_Backup_proto_msgTypes[103] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10384,7 +9381,7 @@ type DirectStoryReplyMessage_TextReply struct { func (x *DirectStoryReplyMessage_TextReply) Reset() { *x = DirectStoryReplyMessage_TextReply{} - mi := &file_backuppb_Backup_proto_msgTypes[113] + mi := &file_backuppb_Backup_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10396,7 +9393,7 @@ func (x *DirectStoryReplyMessage_TextReply) String() string { func (*DirectStoryReplyMessage_TextReply) ProtoMessage() {} func (x *DirectStoryReplyMessage_TextReply) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[113] + mi := &file_backuppb_Backup_proto_msgTypes[104] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10441,7 +9438,7 @@ type PaymentNotification_TransactionDetails struct { func (x *PaymentNotification_TransactionDetails) Reset() { *x = PaymentNotification_TransactionDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[114] + mi := &file_backuppb_Backup_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10453,7 +9450,7 @@ func (x *PaymentNotification_TransactionDetails) String() string { func (*PaymentNotification_TransactionDetails) ProtoMessage() {} func (x *PaymentNotification_TransactionDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[114] + mi := &file_backuppb_Backup_proto_msgTypes[105] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10522,7 +9519,7 @@ type PaymentNotification_TransactionDetails_MobileCoinTxoIdentification struct { func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) Reset() { *x = PaymentNotification_TransactionDetails_MobileCoinTxoIdentification{} - mi := &file_backuppb_Backup_proto_msgTypes[115] + mi := &file_backuppb_Backup_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10534,7 +9531,7 @@ func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) Str func (*PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) ProtoMessage() {} func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[115] + mi := &file_backuppb_Backup_proto_msgTypes[106] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10573,7 +9570,7 @@ type PaymentNotification_TransactionDetails_FailedTransaction struct { func (x *PaymentNotification_TransactionDetails_FailedTransaction) Reset() { *x = PaymentNotification_TransactionDetails_FailedTransaction{} - mi := &file_backuppb_Backup_proto_msgTypes[116] + mi := &file_backuppb_Backup_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10585,7 +9582,7 @@ func (x *PaymentNotification_TransactionDetails_FailedTransaction) String() stri func (*PaymentNotification_TransactionDetails_FailedTransaction) ProtoMessage() {} func (x *PaymentNotification_TransactionDetails_FailedTransaction) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[116] + mi := &file_backuppb_Backup_proto_msgTypes[107] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10626,7 +9623,7 @@ type PaymentNotification_TransactionDetails_Transaction struct { func (x *PaymentNotification_TransactionDetails_Transaction) Reset() { *x = PaymentNotification_TransactionDetails_Transaction{} - mi := &file_backuppb_Backup_proto_msgTypes[117] + mi := &file_backuppb_Backup_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10638,7 +9635,7 @@ func (x *PaymentNotification_TransactionDetails_Transaction) String() string { func (*PaymentNotification_TransactionDetails_Transaction) ProtoMessage() {} func (x *PaymentNotification_TransactionDetails_Transaction) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[117] + mi := &file_backuppb_Backup_proto_msgTypes[108] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10717,7 +9714,7 @@ type ContactAttachment_Name struct { func (x *ContactAttachment_Name) Reset() { *x = ContactAttachment_Name{} - mi := &file_backuppb_Backup_proto_msgTypes[118] + mi := &file_backuppb_Backup_proto_msgTypes[109] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10729,7 +9726,7 @@ func (x *ContactAttachment_Name) String() string { func (*ContactAttachment_Name) ProtoMessage() {} func (x *ContactAttachment_Name) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[118] + mi := &file_backuppb_Backup_proto_msgTypes[109] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10798,7 +9795,7 @@ type ContactAttachment_Phone struct { func (x *ContactAttachment_Phone) Reset() { *x = ContactAttachment_Phone{} - mi := &file_backuppb_Backup_proto_msgTypes[119] + mi := &file_backuppb_Backup_proto_msgTypes[110] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10810,7 +9807,7 @@ func (x *ContactAttachment_Phone) String() string { func (*ContactAttachment_Phone) ProtoMessage() {} func (x *ContactAttachment_Phone) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[119] + mi := &file_backuppb_Backup_proto_msgTypes[110] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10858,7 +9855,7 @@ type ContactAttachment_Email struct { func (x *ContactAttachment_Email) Reset() { *x = ContactAttachment_Email{} - mi := &file_backuppb_Backup_proto_msgTypes[120] + mi := &file_backuppb_Backup_proto_msgTypes[111] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10870,7 +9867,7 @@ func (x *ContactAttachment_Email) String() string { func (*ContactAttachment_Email) ProtoMessage() {} func (x *ContactAttachment_Email) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[120] + mi := &file_backuppb_Backup_proto_msgTypes[111] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10924,7 +9921,7 @@ type ContactAttachment_PostalAddress struct { func (x *ContactAttachment_PostalAddress) Reset() { *x = ContactAttachment_PostalAddress{} - mi := &file_backuppb_Backup_proto_msgTypes[121] + mi := &file_backuppb_Backup_proto_msgTypes[112] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10936,7 +9933,7 @@ func (x *ContactAttachment_PostalAddress) String() string { func (*ContactAttachment_PostalAddress) ProtoMessage() {} func (x *ContactAttachment_PostalAddress) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[121] + mi := &file_backuppb_Backup_proto_msgTypes[112] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11051,7 +10048,7 @@ type FilePointer_LocatorInfo struct { func (x *FilePointer_LocatorInfo) Reset() { *x = FilePointer_LocatorInfo{} - mi := &file_backuppb_Backup_proto_msgTypes[122] + mi := &file_backuppb_Backup_proto_msgTypes[113] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11063,7 +10060,7 @@ func (x *FilePointer_LocatorInfo) String() string { func (*FilePointer_LocatorInfo) ProtoMessage() {} func (x *FilePointer_LocatorInfo) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[122] + mi := &file_backuppb_Backup_proto_msgTypes[113] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11183,7 +10180,7 @@ type Quote_QuotedAttachment struct { func (x *Quote_QuotedAttachment) Reset() { *x = Quote_QuotedAttachment{} - mi := &file_backuppb_Backup_proto_msgTypes[123] + mi := &file_backuppb_Backup_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11195,7 +10192,7 @@ func (x *Quote_QuotedAttachment) String() string { func (*Quote_QuotedAttachment) ProtoMessage() {} func (x *Quote_QuotedAttachment) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[123] + mi := &file_backuppb_Backup_proto_msgTypes[114] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11232,110 +10229,6 @@ func (x *Quote_QuotedAttachment) GetThumbnail() *MessageAttachment { return nil } -type Poll_PollOption struct { - state protoimpl.MessageState `protogen:"open.v1"` - Option string `protobuf:"bytes,1,opt,name=option,proto3" json:"option,omitempty"` // Between 1-100 characters - Votes []*Poll_PollOption_PollVote `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Poll_PollOption) Reset() { - *x = Poll_PollOption{} - mi := &file_backuppb_Backup_proto_msgTypes[124] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Poll_PollOption) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Poll_PollOption) ProtoMessage() {} - -func (x *Poll_PollOption) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[124] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Poll_PollOption.ProtoReflect.Descriptor instead. -func (*Poll_PollOption) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{32, 0} -} - -func (x *Poll_PollOption) GetOption() string { - if x != nil { - return x.Option - } - return "" -} - -func (x *Poll_PollOption) GetVotes() []*Poll_PollOption_PollVote { - if x != nil { - return x.Votes - } - return nil -} - -type Poll_PollOption_PollVote struct { - state protoimpl.MessageState `protogen:"open.v1"` - VoterId uint64 `protobuf:"varint,1,opt,name=voterId,proto3" json:"voterId,omitempty"` // A direct reference to Recipient proto id. Must be self or contact. - VoteCount uint32 `protobuf:"varint,2,opt,name=voteCount,proto3" json:"voteCount,omitempty"` // Tracks how many times you voted. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Poll_PollOption_PollVote) Reset() { - *x = Poll_PollOption_PollVote{} - mi := &file_backuppb_Backup_proto_msgTypes[125] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Poll_PollOption_PollVote) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Poll_PollOption_PollVote) ProtoMessage() {} - -func (x *Poll_PollOption_PollVote) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[125] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Poll_PollOption_PollVote.ProtoReflect.Descriptor instead. -func (*Poll_PollOption_PollVote) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{32, 0, 0} -} - -func (x *Poll_PollOption_PollVote) GetVoterId() uint64 { - if x != nil { - return x.VoterId - } - return 0 -} - -func (x *Poll_PollOption_PollVote) GetVoteCount() uint32 { - if x != nil { - return x.VoteCount - } - return 0 -} - type GroupChangeChatUpdate_Update struct { state protoimpl.MessageState `protogen:"open.v1"` // If unset, importers should consider it to be a GenericGroupUpdate with unset updaterAci @@ -11376,8 +10269,6 @@ type GroupChangeChatUpdate_Update struct { // *GroupChangeChatUpdate_Update_GroupV2MigrationDroppedMembersUpdate // *GroupChangeChatUpdate_Update_GroupSequenceOfRequestsAndCancelsUpdate // *GroupChangeChatUpdate_Update_GroupExpirationTimerUpdate - // *GroupChangeChatUpdate_Update_GroupMemberLabelAccessLevelChangeUpdate - // *GroupChangeChatUpdate_Update_GroupTerminateChangeUpdate Update isGroupChangeChatUpdate_Update_Update `protobuf_oneof:"update"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache @@ -11385,7 +10276,7 @@ type GroupChangeChatUpdate_Update struct { func (x *GroupChangeChatUpdate_Update) Reset() { *x = GroupChangeChatUpdate_Update{} - mi := &file_backuppb_Backup_proto_msgTypes[126] + mi := &file_backuppb_Backup_proto_msgTypes[115] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11397,7 +10288,7 @@ func (x *GroupChangeChatUpdate_Update) String() string { func (*GroupChangeChatUpdate_Update) ProtoMessage() {} func (x *GroupChangeChatUpdate_Update) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[126] + mi := &file_backuppb_Backup_proto_msgTypes[115] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11410,7 +10301,7 @@ func (x *GroupChangeChatUpdate_Update) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupChangeChatUpdate_Update.ProtoReflect.Descriptor instead. func (*GroupChangeChatUpdate_Update) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{43, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{41, 0} } func (x *GroupChangeChatUpdate_Update) GetUpdate() isGroupChangeChatUpdate_Update_Update { @@ -11726,24 +10617,6 @@ func (x *GroupChangeChatUpdate_Update) GetGroupExpirationTimerUpdate() *GroupExp return nil } -func (x *GroupChangeChatUpdate_Update) GetGroupMemberLabelAccessLevelChangeUpdate() *GroupMemberLabelAccessLevelChangeUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupMemberLabelAccessLevelChangeUpdate); ok { - return x.GroupMemberLabelAccessLevelChangeUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupTerminateChangeUpdate() *GroupTerminateChangeUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupTerminateChangeUpdate); ok { - return x.GroupTerminateChangeUpdate - } - } - return nil -} - type isGroupChangeChatUpdate_Update_Update interface { isGroupChangeChatUpdate_Update_Update() } @@ -11884,14 +10757,6 @@ type GroupChangeChatUpdate_Update_GroupExpirationTimerUpdate struct { GroupExpirationTimerUpdate *GroupExpirationTimerUpdate `protobuf:"bytes,34,opt,name=groupExpirationTimerUpdate,proto3,oneof"` } -type GroupChangeChatUpdate_Update_GroupMemberLabelAccessLevelChangeUpdate struct { - GroupMemberLabelAccessLevelChangeUpdate *GroupMemberLabelAccessLevelChangeUpdate `protobuf:"bytes,35,opt,name=groupMemberLabelAccessLevelChangeUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupTerminateChangeUpdate struct { - GroupTerminateChangeUpdate *GroupTerminateChangeUpdate `protobuf:"bytes,36,opt,name=groupTerminateChangeUpdate,proto3,oneof"` -} - func (*GroupChangeChatUpdate_Update_GenericGroupUpdate) isGroupChangeChatUpdate_Update_Update() {} func (*GroupChangeChatUpdate_Update_GroupCreationUpdate) isGroupChangeChatUpdate_Update_Update() {} @@ -11984,12 +10849,6 @@ func (*GroupChangeChatUpdate_Update_GroupSequenceOfRequestsAndCancelsUpdate) isG func (*GroupChangeChatUpdate_Update_GroupExpirationTimerUpdate) isGroupChangeChatUpdate_Update_Update() { } -func (*GroupChangeChatUpdate_Update_GroupMemberLabelAccessLevelChangeUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupTerminateChangeUpdate) isGroupChangeChatUpdate_Update_Update() { -} - type GroupInvitationRevokedUpdate_Invitee struct { state protoimpl.MessageState `protogen:"open.v1"` InviterAci []byte `protobuf:"bytes,1,opt,name=inviterAci,proto3,oneof" json:"inviterAci,omitempty"` @@ -12003,7 +10862,7 @@ type GroupInvitationRevokedUpdate_Invitee struct { func (x *GroupInvitationRevokedUpdate_Invitee) Reset() { *x = GroupInvitationRevokedUpdate_Invitee{} - mi := &file_backuppb_Backup_proto_msgTypes[127] + mi := &file_backuppb_Backup_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12015,7 +10874,7 @@ func (x *GroupInvitationRevokedUpdate_Invitee) String() string { func (*GroupInvitationRevokedUpdate_Invitee) ProtoMessage() {} func (x *GroupInvitationRevokedUpdate_Invitee) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[127] + mi := &file_backuppb_Backup_proto_msgTypes[116] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12028,7 +10887,7 @@ func (x *GroupInvitationRevokedUpdate_Invitee) ProtoReflect() protoreflect.Messa // Deprecated: Use GroupInvitationRevokedUpdate_Invitee.ProtoReflect.Descriptor instead. func (*GroupInvitationRevokedUpdate_Invitee) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{65, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{61, 0} } func (x *GroupInvitationRevokedUpdate_Invitee) GetInviterAci() []byte { @@ -12063,7 +10922,7 @@ type ChatStyle_Gradient struct { func (x *ChatStyle_Gradient) Reset() { *x = ChatStyle_Gradient{} - mi := &file_backuppb_Backup_proto_msgTypes[128] + mi := &file_backuppb_Backup_proto_msgTypes[117] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12075,7 +10934,7 @@ func (x *ChatStyle_Gradient) String() string { func (*ChatStyle_Gradient) ProtoMessage() {} func (x *ChatStyle_Gradient) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[128] + mi := &file_backuppb_Backup_proto_msgTypes[117] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12088,7 +10947,7 @@ func (x *ChatStyle_Gradient) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatStyle_Gradient.ProtoReflect.Descriptor instead. func (*ChatStyle_Gradient) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 0} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{77, 0} } func (x *ChatStyle_Gradient) GetAngle() uint32 { @@ -12128,7 +10987,7 @@ type ChatStyle_CustomChatColor struct { func (x *ChatStyle_CustomChatColor) Reset() { *x = ChatStyle_CustomChatColor{} - mi := &file_backuppb_Backup_proto_msgTypes[129] + mi := &file_backuppb_Backup_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12140,7 +10999,7 @@ func (x *ChatStyle_CustomChatColor) String() string { func (*ChatStyle_CustomChatColor) ProtoMessage() {} func (x *ChatStyle_CustomChatColor) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[129] + mi := &file_backuppb_Backup_proto_msgTypes[118] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12153,7 +11012,7 @@ func (x *ChatStyle_CustomChatColor) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatStyle_CustomChatColor.ProtoReflect.Descriptor instead. func (*ChatStyle_CustomChatColor) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 1} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{77, 1} } func (x *ChatStyle_CustomChatColor) GetId() uint64 { @@ -12212,7 +11071,7 @@ type ChatStyle_AutomaticBubbleColor struct { func (x *ChatStyle_AutomaticBubbleColor) Reset() { *x = ChatStyle_AutomaticBubbleColor{} - mi := &file_backuppb_Backup_proto_msgTypes[130] + mi := &file_backuppb_Backup_proto_msgTypes[119] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12224,7 +11083,7 @@ func (x *ChatStyle_AutomaticBubbleColor) String() string { func (*ChatStyle_AutomaticBubbleColor) ProtoMessage() {} func (x *ChatStyle_AutomaticBubbleColor) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[130] + mi := &file_backuppb_Backup_proto_msgTypes[119] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12237,7 +11096,7 @@ func (x *ChatStyle_AutomaticBubbleColor) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatStyle_AutomaticBubbleColor.ProtoReflect.Descriptor instead. func (*ChatStyle_AutomaticBubbleColor) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 2} + return file_backuppb_Backup_proto_rawDescGZIP(), []int{77, 2} } var File_backuppb_Backup_proto protoreflect.FileDescriptor @@ -12264,7 +11123,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\n" + "chatFolder\x18\b \x01(\v2\x19.signal.backup.ChatFolderH\x00R\n" + "chatFolderB\x06\n" + - "\x04item\"\xc7#\n" + + "\x04item\"\xdf\x13\n" + "\vAccountData\x12\x1e\n" + "\n" + "profileKey\x18\x01 \x01(\fR\n" + @@ -12280,11 +11139,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x0faccountSettings\x18\t \x01(\v2*.signal.backup.AccountData.AccountSettingsR\x0faccountSettings\x12b\n" + "\x15backupsSubscriberData\x18\n" + " \x01(\v2,.signal.backup.AccountData.IAPSubscriberDataR\x15backupsSubscriberData\x12\x16\n" + - "\x06svrPin\x18\v \x01(\tR\x06svrPin\x12l\n" + - "\x17androidSpecificSettings\x18\f \x01(\v22.signal.backup.AccountData.AndroidSpecificSettingsR\x17androidSpecificSettings\x12\x18\n" + - "\abioText\x18\r \x01(\tR\abioText\x12\x1a\n" + - "\bbioEmoji\x18\x0e \x01(\tR\bbioEmoji\x125\n" + - "\x13keyTransparencyData\x18\x0f \x01(\fH\x01R\x13keyTransparencyData\x88\x01\x01\x1a\xf6\x01\n" + + "\x06svrPin\x18\v \x01(\tR\x06svrPin\x1a\xf6\x01\n" + "\fUsernameLink\x12\x18\n" + "\aentropy\x18\x01 \x01(\fR\aentropy\x12\x1a\n" + "\bserverId\x18\x02 \x01(\fR\bserverId\x12C\n" + @@ -12300,17 +11155,8 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x06ORANGE\x10\x06\x12\b\n" + "\x04PINK\x10\a\x12\n" + "\n" + - "\x06PURPLE\x10\b\x1a\xd7\x03\n" + - "\x14AutoDownloadSettings\x12Z\n" + - "\x06images\x18\x01 \x01(\x0e2B.signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOptionR\x06images\x12X\n" + - "\x05audio\x18\x02 \x01(\x0e2B.signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOptionR\x05audio\x12X\n" + - "\x05video\x18\x03 \x01(\x0e2B.signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOptionR\x05video\x12`\n" + - "\tdocuments\x18\x04 \x01(\x0e2B.signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOptionR\tdocuments\"M\n" + - "\x12AutoDownloadOption\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\t\n" + - "\x05NEVER\x10\x01\x12\b\n" + - "\x04WIFI\x10\x02\x12\x15\n" + - "\x11WIFI_AND_CELLULAR\x10\x03\x1a\x97\x10\n" + + "\x06PURPLE\x10\b\x1a\xa2\n" + + "\n" + "\x0fAccountSettings\x12\"\n" + "\freadReceipts\x18\x01 \x01(\bR\freadReceipts\x126\n" + "\x16sealedSenderIndicators\x18\x02 \x01(\bR\x16sealedSenderIndicators\x12*\n" + @@ -12335,20 +11181,9 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x17optimizeOnDeviceStorage\x18\x14 \x01(\bR\x17optimizeOnDeviceStorage\x12#\n" + "\n" + "backupTier\x18\x15 \x01(\x04H\x01R\n" + - "backupTier\x88\x01\x01\x12e\n" + - "\x17defaultSentMediaQuality\x18\x17 \x01(\x0e2+.signal.backup.AccountData.SentMediaQualityR\x17defaultSentMediaQuality\x12c\n" + - "\x14autoDownloadSettings\x18\x18 \x01(\v2/.signal.backup.AccountData.AutoDownloadSettingsR\x14autoDownloadSettings\x12?\n" + - "\x18screenLockTimeoutMinutes\x18\x1a \x01(\rH\x02R\x18screenLockTimeoutMinutes\x88\x01\x01\x12'\n" + - "\fpinReminders\x18\x1b \x01(\bH\x03R\fpinReminders\x88\x01\x01\x12?\n" + - "\bappTheme\x18\x1c \x01(\x0e2#.signal.backup.AccountData.AppThemeR\bappTheme\x12l\n" + - "\x17callsUseLessDataSetting\x18\x1d \x01(\x0e22.signal.backup.AccountData.CallsUseLessDataSettingR\x17callsUseLessDataSetting\x12@\n" + - "\x1ballowSealedSenderFromAnyone\x18\x1e \x01(\bR\x1ballowSealedSenderFromAnyone\x12D\n" + - "\x1dallowAutomaticKeyVerification\x18\x1f \x01(\bR\x1dallowAutomaticKeyVerification\x12L\n" + - "!hasSeenAdminDeleteEducationDialog\x18 \x01(\bR!hasSeenAdminDeleteEducationDialogB\x1b\n" + + "backupTier\x88\x01\x01B\x1b\n" + "\x19_storyViewReceiptsEnabledB\r\n" + - "\v_backupTierB\x1b\n" + - "\x19_screenLockTimeoutMinutesB\x0f\n" + - "\r_pinRemindersJ\x04\b\x16\x10\x17J\x04\b\x19\x10\x1a\x1a\x86\x01\n" + + "\v_backupTier\x1a\x86\x01\n" + "\x0eSubscriberData\x12\"\n" + "\fsubscriberId\x18\x01 \x01(\fR\fsubscriberId\x12\"\n" + "\fcurrencyCode\x18\x02 \x01(\tR\fcurrencyCode\x12,\n" + @@ -12357,38 +11192,13 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\fsubscriberId\x18\x01 \x01(\fR\fsubscriberId\x12&\n" + "\rpurchaseToken\x18\x02 \x01(\tH\x00R\rpurchaseToken\x126\n" + "\x15originalTransactionId\x18\x03 \x01(\x04H\x00R\x15originalTransactionIdB\x13\n" + - "\x11iapSubscriptionId\x1a\xa9\x02\n" + - "\x17AndroidSpecificSettings\x12&\n" + - "\x0euseSystemEmoji\x18\x01 \x01(\bR\x0euseSystemEmoji\x12.\n" + - "\x12screenshotSecurity\x18\x02 \x01(\bR\x12screenshotSecurity\x12r\n" + - "\x11navigationBarSize\x18\x03 \x01(\x0e2D.signal.backup.AccountData.AndroidSpecificSettings.NavigationBarSizeR\x11navigationBarSize\"B\n" + - "\x11NavigationBarSize\x12\x14\n" + - "\x10UNKNOWN_BAR_SIZE\x10\x00\x12\n" + - "\n" + - "\x06NORMAL\x10\x01\x12\v\n" + - "\aCOMPACT\x10\x02\"@\n" + + "\x11iapSubscriptionId\"@\n" + "\x16PhoneNumberSharingMode\x12\v\n" + "\aUNKNOWN\x10\x00\x12\r\n" + "\tEVERYBODY\x10\x01\x12\n" + "\n" + - "\x06NOBODY\x10\x02\"?\n" + - "\x10SentMediaQuality\x12\x13\n" + - "\x0fUNKNOWN_QUALITY\x10\x00\x12\f\n" + - "\bSTANDARD\x10\x01\x12\b\n" + - "\x04HIGH\x10\x02\"B\n" + - "\bAppTheme\x12\x15\n" + - "\x11UNKNOWN_APP_THEME\x10\x00\x12\n" + - "\n" + - "\x06SYSTEM\x10\x01\x12\t\n" + - "\x05LIGHT\x10\x02\x12\b\n" + - "\x04DARK\x10\x03\"s\n" + - "\x17CallsUseLessDataSetting\x12\x1d\n" + - "\x19UNKNOWN_CALL_DATA_SETTING\x10\x00\x12\t\n" + - "\x05NEVER\x10\x01\x12\x14\n" + - "\x10MOBILE_DATA_ONLY\x10\x02\x12\x18\n" + - "\x14WIFI_AND_MOBILE_DATA\x10\x03B\v\n" + - "\t_usernameB\x16\n" + - "\x14_keyTransparencyDataJ\x04\b\b\x10\t\"\x84\x03\n" + + "\x06NOBODY\x10\x02B\v\n" + + "\t_usernameJ\x04\b\b\x10\t\"\x84\x03\n" + "\tRecipient\x12\x0e\n" + "\x02id\x18\x01 \x01(\x04R\x02id\x122\n" + "\acontact\x18\x02 \x01(\v2\x16.signal.backup.ContactH\x00R\acontact\x12,\n" + @@ -12397,7 +11207,8 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x04self\x18\x05 \x01(\v2\x13.signal.backup.SelfH\x00R\x04self\x12A\n" + "\freleaseNotes\x18\x06 \x01(\v2\x1b.signal.backup.ReleaseNotesH\x00R\freleaseNotes\x125\n" + "\bcallLink\x18\a \x01(\v2\x17.signal.backup.CallLinkH\x00R\bcallLinkB\r\n" + - "\vdestination\"\x9a\v\n" + + "\vdestination\"\xcb\n" + + "\n" + "\aContact\x12\x15\n" + "\x03aci\x18\x01 \x01(\fH\x01R\x03aci\x88\x01\x01\x12\x15\n" + "\x03pni\x18\x02 \x01(\fH\x02R\x03pni\x88\x01\x01\x12\x1f\n" + @@ -12426,9 +11237,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x0fsystemGivenName\x18\x12 \x01(\tR\x0fsystemGivenName\x12*\n" + "\x10systemFamilyName\x18\x13 \x01(\tR\x10systemFamilyName\x12&\n" + "\x0esystemNickname\x18\x14 \x01(\tR\x0esystemNickname\x12A\n" + - "\vavatarColor\x18\x15 \x01(\x0e2\x1a.signal.backup.AvatarColorH\tR\vavatarColor\x88\x01\x01\x125\n" + - "\x13keyTransparencyData\x18\x16 \x01(\fH\n" + - "R\x13keyTransparencyData\x88\x01\x01\x1a\f\n" + + "\vavatarColor\x18\x15 \x01(\x0e2\x1a.signal.backup.AvatarColorH\tR\vavatarColor\x88\x01\x01\x1a\f\n" + "\n" + "Registered\x1aE\n" + "\rNotRegistered\x124\n" + @@ -12456,8 +11265,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x11_profileGivenNameB\x14\n" + "\x12_profileFamilyNameB\x0e\n" + "\f_identityKeyB\x0e\n" + - "\f_avatarColorB\x16\n" + - "\x14_keyTransparencyData\"\xc6\x13\n" + + "\f_avatarColor\"\x8f\x12\n" + "\x05Group\x12\x1c\n" + "\tmasterKey\x18\x01 \x01(\fR\tmasterKey\x12 \n" + "\vwhitelisted\x18\x02 \x01(\bR\vwhitelisted\x12\x1c\n" + @@ -12465,7 +11273,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\rstorySendMode\x18\x04 \x01(\x0e2\".signal.backup.Group.StorySendModeR\rstorySendMode\x12>\n" + "\bsnapshot\x18\x05 \x01(\v2\".signal.backup.Group.GroupSnapshotR\bsnapshot\x12\x18\n" + "\ablocked\x18\x06 \x01(\bR\ablocked\x12A\n" + - "\vavatarColor\x18\a \x01(\x0e2\x1a.signal.backup.AvatarColorH\x00R\vavatarColor\x88\x01\x01\x1a\xe5\x06\n" + + "\vavatarColor\x18\a \x01(\x0e2\x1a.signal.backup.AvatarColorH\x00R\vavatarColor\x88\x01\x01\x1a\xc5\x06\n" + "\rGroupSnapshot\x12=\n" + "\x05title\x18\x02 \x01(\v2'.signal.backup.Group.GroupAttributeBlobR\x05title\x12I\n" + "\vdescription\x18\v \x01(\v2'.signal.backup.Group.GroupAttributeBlobR\vdescription\x12\x1c\n" + @@ -12479,24 +11287,17 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x12inviteLinkPassword\x18\n" + " \x01(\fR\x12inviteLinkPassword\x12-\n" + "\x12announcements_only\x18\f \x01(\bR\x11announcementsOnly\x12H\n" + - "\x0emembers_banned\x18\r \x03(\v2!.signal.backup.Group.MemberBannedR\rmembersBanned\x12\x1e\n" + - "\n" + - "terminated\x18\x0e \x01(\bR\n" + - "terminatedJ\x04\b\x01\x10\x02\x1a\xc3\x01\n" + + "\x0emembers_banned\x18\r \x03(\v2!.signal.backup.Group.MemberBannedR\rmembersBannedJ\x04\b\x01\x10\x02\x1a\xc3\x01\n" + "\x12GroupAttributeBlob\x12\x16\n" + "\x05title\x18\x01 \x01(\tH\x00R\x05title\x12\x18\n" + "\x06avatar\x18\x02 \x01(\fH\x00R\x06avatar\x12D\n" + "\x1cdisappearingMessagesDuration\x18\x03 \x01(\rH\x00R\x1cdisappearingMessagesDuration\x12*\n" + "\x0fdescriptionText\x18\x04 \x01(\tH\x00R\x0fdescriptionTextB\t\n" + - "\acontent\x1a\x83\x02\n" + + "\acontent\x1a\xc1\x01\n" + "\x06Member\x12\x16\n" + "\x06userId\x18\x01 \x01(\fR\x06userId\x124\n" + "\x04role\x18\x02 \x01(\x0e2 .signal.backup.Group.Member.RoleR\x04role\x12(\n" + - "\x0fjoinedAtVersion\x18\x05 \x01(\rR\x0fjoinedAtVersion\x12\x1e\n" + - "\n" + - "labelEmoji\x18\x06 \x01(\tR\n" + - "labelEmoji\x12 \n" + - "\vlabelString\x18\a \x01(\tR\vlabelString\"3\n" + + "\x0fjoinedAtVersion\x18\x05 \x01(\rR\x0fjoinedAtVersion\"3\n" + "\x04Role\x12\v\n" + "\aUNKNOWN\x10\x00\x12\v\n" + "\aDEFAULT\x10\x01\x12\x11\n" + @@ -12510,14 +11311,13 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\ttimestamp\x18\x04 \x01(\x04R\ttimestampJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04\x1aD\n" + "\fMemberBanned\x12\x16\n" + "\x06userId\x18\x01 \x01(\fR\x06userId\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x1a\xbf\x03\n" + + "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x1a\xea\x02\n" + "\rAccessControl\x12Q\n" + "\n" + "attributes\x18\x01 \x01(\x0e21.signal.backup.Group.AccessControl.AccessRequiredR\n" + "attributes\x12K\n" + "\amembers\x18\x02 \x01(\x0e21.signal.backup.Group.AccessControl.AccessRequiredR\amembers\x12_\n" + - "\x11addFromInviteLink\x18\x03 \x01(\x0e21.signal.backup.Group.AccessControl.AccessRequiredR\x11addFromInviteLink\x12S\n" + - "\vmemberLabel\x18\x04 \x01(\x0e21.signal.backup.Group.AccessControl.AccessRequiredR\vmemberLabel\"X\n" + + "\x11addFromInviteLink\x18\x03 \x01(\x0e21.signal.backup.Group.AccessControl.AccessRequiredR\x11addFromInviteLink\"X\n" + "\x0eAccessRequired\x12\v\n" + "\aUNKNOWN\x10\x00\x12\a\n" + "\x03ANY\x10\x01\x12\n" + @@ -12548,18 +11348,20 @@ const file_backuppb_Backup_proto_rawDesc = "" + " \x01(\rR\x12expireTimerVersionB\x0e\n" + "\f_pinnedOrderB\x14\n" + "\x12_expirationTimerMsB\x0e\n" + - "\f_muteUntilMs\"\x95\x02\n" + + "\f_muteUntilMs\"\xb4\x02\n" + "\bCallLink\x12\x18\n" + "\arootKey\x18\x01 \x01(\fR\arootKey\x12\x1f\n" + "\badminKey\x18\x02 \x01(\fH\x00R\badminKey\x88\x01\x01\x12\x12\n" + "\x04name\x18\x03 \x01(\tR\x04name\x12H\n" + "\frestrictions\x18\x04 \x01(\x0e2$.signal.backup.CallLink.RestrictionsR\frestrictions\x12\"\n" + - "\fexpirationMs\x18\x05 \x01(\x04R\fexpirationMs\"9\n" + + "\fexpirationMs\x18\x05 \x01(\x04R\fexpirationMs\x12\x19\n" + + "\x05epoch\x18\x06 \x01(\fH\x01R\x05epoch\x88\x01\x01\"9\n" + "\fRestrictions\x12\v\n" + "\aUNKNOWN\x10\x00\x12\b\n" + "\x04NONE\x10\x01\x12\x12\n" + "\x0eADMIN_APPROVAL\x10\x02B\v\n" + - "\t_adminKeyJ\x04\b\x06\x10\a\"\xca\x01\n" + + "\t_adminKeyB\b\n" + + "\x06_epoch\"\xca\x01\n" + "\tAdHocCall\x12\x16\n" + "\x06callId\x18\x01 \x01(\x04R\x06callId\x12 \n" + "\vrecipientId\x18\x02 \x01(\x04R\vrecipientId\x124\n" + @@ -12583,7 +11385,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\tONLY_WITH\x10\x01\x12\x0e\n" + "\n" + "ALL_EXCEPT\x10\x02\x12\a\n" + - "\x03ALL\x10\x03\"\xbd\x0f\n" + + "\x03ALL\x10\x03\"\xc8\f\n" + "\bChatItem\x12\x16\n" + "\x06chatId\x18\x01 \x01(\x04R\x06chatId\x12\x1a\n" + "\bauthorId\x18\x02 \x01(\x04R\bauthorId\x12\x1a\n" + @@ -12604,12 +11406,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x13paymentNotification\x18\x10 \x01(\v2\".signal.backup.PaymentNotificationH\x01R\x13paymentNotification\x128\n" + "\tgiftBadge\x18\x11 \x01(\v2\x18.signal.backup.GiftBadgeH\x01R\tgiftBadge\x12J\n" + "\x0fviewOnceMessage\x18\x12 \x01(\v2\x1e.signal.backup.ViewOnceMessageH\x01R\x0fviewOnceMessage\x12b\n" + - "\x17directStoryReplyMessage\x18\x13 \x01(\v2&.signal.backup.DirectStoryReplyMessageH\x01R\x17directStoryReplyMessage\x12)\n" + - "\x04poll\x18\x14 \x01(\v2\x13.signal.backup.PollH\x01R\x04poll\x12V\n" + - "\x13adminDeletedMessage\x18\x16 \x01(\v2\".signal.backup.AdminDeletedMessageH\x01R\x13adminDeletedMessage\x12B\n" + - "\n" + - "pinDetails\x18\x15 \x01(\v2\".signal.backup.ChatItem.PinDetailsR\n" + - "pinDetails\x1a\xb4\x01\n" + + "\x17directStoryReplyMessage\x18\x13 \x01(\v2&.signal.backup.DirectStoryReplyMessageH\x01R\x17directStoryReplyMessage\x1a\xb4\x01\n" + "\x16IncomingMessageDetails\x12\"\n" + "\fdateReceived\x18\x01 \x01(\x04R\fdateReceived\x12+\n" + "\x0edateServerSent\x18\x02 \x01(\x04H\x00R\x0edateServerSent\x88\x01\x01\x12\x12\n" + @@ -12621,13 +11418,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "sendStatus\x18\x01 \x03(\v2\x19.signal.backup.SendStatusR\n" + "sendStatus\x12\"\n" + "\fdateReceived\x18\x02 \x01(\x04R\fdateReceived\x1a\x1d\n" + - "\x1bDirectionlessMessageDetails\x1a\xab\x01\n" + - "\n" + - "PinDetails\x12,\n" + - "\x11pinnedAtTimestamp\x18\x01 \x01(\x04R\x11pinnedAtTimestamp\x126\n" + - "\x15pinExpiresAtTimestamp\x18\x02 \x01(\x04H\x00R\x15pinExpiresAtTimestamp\x12*\n" + - "\x0fpinNeverExpires\x18\x03 \x01(\bH\x00R\x0fpinNeverExpiresB\v\n" + - "\tpinExpiryB\x14\n" + + "\x1bDirectionlessMessageDetailsB\x14\n" + "\x12directionalDetailsB\x06\n" + "\x04itemB\x12\n" + "\x10_expireStartDateB\x0e\n" + @@ -12878,7 +11669,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\a_heightB\n" + "\n" + "\b_captionB\v\n" + - "\t_blurHashJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\f\x10\r\"\xb8\x04\n" + + "\t_blurHashJ\x04\b\x01\x10\x02J\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\f\x10\r\"\xae\x04\n" + "\x05Quote\x125\n" + "\x13targetSentTimestamp\x18\x01 \x01(\x04H\x00R\x13targetSentTimestamp\x88\x01\x01\x12\x1a\n" + "\bauthorId\x18\x02 \x01(\x04R\bauthorId\x12,\n" + @@ -12892,15 +11683,14 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\f_contentTypeB\v\n" + "\t_fileNameB\f\n" + "\n" + - "_thumbnail\"H\n" + + "_thumbnail\">\n" + "\x04Type\x12\v\n" + "\aUNKNOWN\x10\x00\x12\n" + "\n" + "\x06NORMAL\x10\x01\x12\x0e\n" + "\n" + "GIFT_BADGE\x10\x02\x12\r\n" + - "\tVIEW_ONCE\x10\x03\x12\b\n" + - "\x04POLL\x10\x04B\x16\n" + + "\tVIEW_ONCE\x10\x03B\x16\n" + "\x14_targetSentTimestampB\a\n" + "\x05_text\"\xfe\x01\n" + "\tBodyRange\x12\x14\n" + @@ -12923,22 +11713,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x05emoji\x18\x01 \x01(\tR\x05emoji\x12\x1a\n" + "\bauthorId\x18\x02 \x01(\x04R\bauthorId\x12$\n" + "\rsentTimestamp\x18\x03 \x01(\x04R\rsentTimestamp\x12\x1c\n" + - "\tsortOrder\x18\x04 \x01(\x04R\tsortOrder\"\xff\x02\n" + - "\x04Poll\x12\x1a\n" + - "\bquestion\x18\x01 \x01(\tR\bquestion\x12$\n" + - "\rallowMultiple\x18\x02 \x01(\bR\rallowMultiple\x128\n" + - "\aoptions\x18\x03 \x03(\v2\x1e.signal.backup.Poll.PollOptionR\aoptions\x12\x1a\n" + - "\bhasEnded\x18\x04 \x01(\bR\bhasEnded\x125\n" + - "\treactions\x18\x05 \x03(\v2\x17.signal.backup.ReactionR\treactions\x1a\xa7\x01\n" + - "\n" + - "PollOption\x12\x16\n" + - "\x06option\x18\x01 \x01(\tR\x06option\x12=\n" + - "\x05votes\x18\x02 \x03(\v2'.signal.backup.Poll.PollOption.PollVoteR\x05votes\x1aB\n" + - "\bPollVote\x12\x18\n" + - "\avoterId\x18\x01 \x01(\x04R\avoterId\x12\x1c\n" + - "\tvoteCount\x18\x02 \x01(\rR\tvoteCount\"/\n" + - "\x13AdminDeletedMessage\x12\x18\n" + - "\aadminId\x18\x01 \x01(\x04R\aadminId\"\xf7\x06\n" + + "\tsortOrder\x18\x04 \x01(\x04R\tsortOrder\"\xe8\x05\n" + "\x11ChatUpdateMessage\x12E\n" + "\fsimpleUpdate\x18\x01 \x01(\v2\x1f.signal.backup.SimpleChatUpdateH\x00R\fsimpleUpdate\x12H\n" + "\vgroupChange\x18\x02 \x01(\v2$.signal.backup.GroupChangeChatUpdateH\x00R\vgroupChange\x12`\n" + @@ -12948,12 +11723,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x11sessionSwitchover\x18\x06 \x01(\v2*.signal.backup.SessionSwitchoverChatUpdateH\x00R\x11sessionSwitchover\x12G\n" + "\x0eindividualCall\x18\a \x01(\v2\x1d.signal.backup.IndividualCallH\x00R\x0eindividualCall\x128\n" + "\tgroupCall\x18\b \x01(\v2\x18.signal.backup.GroupCallH\x00R\tgroupCall\x12]\n" + - "\x14learnedProfileChange\x18\t \x01(\v2'.signal.backup.LearnedProfileChatUpdateH\x00R\x14learnedProfileChange\x12J\n" + - "\rpollTerminate\x18\n" + - " \x01(\v2\".signal.backup.PollTerminateUpdateH\x00R\rpollTerminate\x12A\n" + - "\n" + - "pinMessage\x18\v \x01(\v2\x1f.signal.backup.PinMessageUpdateH\x00R\n" + - "pinMessageB\b\n" + + "\x14learnedProfileChange\x18\t \x01(\v2'.signal.backup.LearnedProfileChatUpdateH\x00R\x14learnedProfileChangeB\b\n" + "\x06update\"\x9d\x04\n" + "\x0eIndividualCall\x12\x1b\n" + "\x06callId\x18\x01 \x01(\x04H\x00R\x06callId\x88\x01\x01\x126\n" + @@ -13037,9 +11807,9 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\x15ThreadMergeChatUpdate\x12\"\n" + "\fpreviousE164\x18\x01 \x01(\x04R\fpreviousE164\"1\n" + "\x1bSessionSwitchoverChatUpdate\x12\x12\n" + - "\x04e164\x18\x01 \x01(\x04R\x04e164\"\x88!\n" + + "\x04e164\x18\x01 \x01(\x04R\x04e164\"\x86\x1f\n" + "\x15GroupChangeChatUpdate\x12E\n" + - "\aupdates\x18\x01 \x03(\v2+.signal.backup.GroupChangeChatUpdate.UpdateR\aupdates\x1a\xa7 \n" + + "\aupdates\x18\x01 \x03(\v2+.signal.backup.GroupChangeChatUpdate.UpdateR\aupdates\x1a\xa5\x1e\n" + "\x06Update\x12S\n" + "\x12genericGroupUpdate\x18\x01 \x01(\v2!.signal.backup.GenericGroupUpdateH\x00R\x12genericGroupUpdate\x12V\n" + "\x13groupCreationUpdate\x18\x02 \x01(\v2\".signal.backup.GroupCreationUpdateH\x00R\x13groupCreationUpdate\x12J\n" + @@ -13075,9 +11845,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "$groupV2MigrationInvitedMembersUpdate\x18\x1f \x01(\v23.signal.backup.GroupV2MigrationInvitedMembersUpdateH\x00R$groupV2MigrationInvitedMembersUpdate\x12\x89\x01\n" + "$groupV2MigrationDroppedMembersUpdate\x18 \x01(\v23.signal.backup.GroupV2MigrationDroppedMembersUpdateH\x00R$groupV2MigrationDroppedMembersUpdate\x12\x92\x01\n" + "'groupSequenceOfRequestsAndCancelsUpdate\x18! \x01(\v26.signal.backup.GroupSequenceOfRequestsAndCancelsUpdateH\x00R'groupSequenceOfRequestsAndCancelsUpdate\x12k\n" + - "\x1agroupExpirationTimerUpdate\x18\" \x01(\v2).signal.backup.GroupExpirationTimerUpdateH\x00R\x1agroupExpirationTimerUpdate\x12\x92\x01\n" + - "'groupMemberLabelAccessLevelChangeUpdate\x18# \x01(\v26.signal.backup.GroupMemberLabelAccessLevelChangeUpdateH\x00R'groupMemberLabelAccessLevelChangeUpdate\x12k\n" + - "\x1agroupTerminateChangeUpdate\x18$ \x01(\v2).signal.backup.GroupTerminateChangeUpdateH\x00R\x1agroupTerminateChangeUpdateB\b\n" + + "\x1agroupExpirationTimerUpdate\x18\" \x01(\v2).signal.backup.GroupExpirationTimerUpdateH\x00R\x1agroupExpirationTimerUpdateB\b\n" + "\x06update\"H\n" + "\x12GenericGroupUpdate\x12#\n" + "\n" + @@ -13122,17 +11890,6 @@ const file_backuppb_Backup_proto_rawDesc = "" + "updaterAci\x18\x01 \x01(\fH\x00R\n" + "updaterAci\x88\x01\x01\x12C\n" + "\vaccessLevel\x18\x02 \x01(\x0e2!.signal.backup.GroupV2AccessLevelR\vaccessLevelB\r\n" + - "\v_updaterAci\"\xa2\x01\n" + - "'GroupMemberLabelAccessLevelChangeUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12C\n" + - "\vaccessLevel\x18\x02 \x01(\x0e2!.signal.backup.GroupV2AccessLevelR\vaccessLevelB\r\n" + - "\v_updaterAci\"P\n" + - "\x1aGroupTerminateChangeUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01B\r\n" + "\v_updaterAci\"\x87\x01\n" + "!GroupAnnouncementOnlyChangeUpdate\x12#\n" + "\n" + @@ -13271,13 +12028,7 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\n" + "updaterAci\x18\x02 \x01(\fH\x00R\n" + "updaterAci\x88\x01\x01B\r\n" + - "\v_updaterAci\"c\n" + - "\x13PollTerminateUpdate\x120\n" + - "\x13targetSentTimestamp\x18\x01 \x01(\x04R\x13targetSentTimestamp\x12\x1a\n" + - "\bquestion\x18\x02 \x01(\tR\bquestion\"`\n" + - "\x10PinMessageUpdate\x120\n" + - "\x13targetSentTimestamp\x18\x01 \x01(\x04R\x13targetSentTimestamp\x12\x1a\n" + - "\bauthorId\x18\x02 \x01(\x04R\bauthorId\"?\n" + + "\v_updaterAci\"?\n" + "\vStickerPack\x12\x16\n" + "\x06packId\x18\x01 \x01(\fR\x06packId\x12\x18\n" + "\apackKey\x18\x02 \x01(\fR\apackKey\"\x80\r\n" + @@ -13421,8 +12172,8 @@ const file_backuppb_Backup_proto_rawDesc = "" + "\n" + "\x06MEMBER\x10\x02\x12\x11\n" + "\rADMINISTRATOR\x10\x03\x12\x11\n" + - "\rUNSATISFIABLE\x10\x04B)\n" + - "\x18org.signal.archive.proto\xba\x02\fBackupProto_b\x06proto3" + "\rUNSATISFIABLE\x10\x04B;\n" + + "*org.thoughtcrime.securesms.backup.v2.proto\xba\x02\fBackupProto_b\x06proto3" var ( file_backuppb_Backup_proto_rawDescOnce sync.Once @@ -13436,378 +12187,340 @@ func file_backuppb_Backup_proto_rawDescGZIP() []byte { return file_backuppb_Backup_proto_rawDescData } -var file_backuppb_Backup_proto_enumTypes = make([]protoimpl.EnumInfo, 36) -var file_backuppb_Backup_proto_msgTypes = make([]protoimpl.MessageInfo, 131) +var file_backuppb_Backup_proto_enumTypes = make([]protoimpl.EnumInfo, 31) +var file_backuppb_Backup_proto_msgTypes = make([]protoimpl.MessageInfo, 120) var file_backuppb_Backup_proto_goTypes = []any{ - (AvatarColor)(0), // 0: signal.backup.AvatarColor - (GroupV2AccessLevel)(0), // 1: signal.backup.GroupV2AccessLevel - (AccountData_PhoneNumberSharingMode)(0), // 2: signal.backup.AccountData.PhoneNumberSharingMode - (AccountData_SentMediaQuality)(0), // 3: signal.backup.AccountData.SentMediaQuality - (AccountData_AppTheme)(0), // 4: signal.backup.AccountData.AppTheme - (AccountData_CallsUseLessDataSetting)(0), // 5: signal.backup.AccountData.CallsUseLessDataSetting - (AccountData_UsernameLink_Color)(0), // 6: signal.backup.AccountData.UsernameLink.Color - (AccountData_AutoDownloadSettings_AutoDownloadOption)(0), // 7: signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOption - (AccountData_AndroidSpecificSettings_NavigationBarSize)(0), // 8: signal.backup.AccountData.AndroidSpecificSettings.NavigationBarSize - (Contact_IdentityState)(0), // 9: signal.backup.Contact.IdentityState - (Contact_Visibility)(0), // 10: signal.backup.Contact.Visibility - (Group_StorySendMode)(0), // 11: signal.backup.Group.StorySendMode - (Group_Member_Role)(0), // 12: signal.backup.Group.Member.Role - (Group_AccessControl_AccessRequired)(0), // 13: signal.backup.Group.AccessControl.AccessRequired - (CallLink_Restrictions)(0), // 14: signal.backup.CallLink.Restrictions - (AdHocCall_State)(0), // 15: signal.backup.AdHocCall.State - (DistributionList_PrivacyMode)(0), // 16: signal.backup.DistributionList.PrivacyMode - (SendStatus_Failed_FailureReason)(0), // 17: signal.backup.SendStatus.Failed.FailureReason - (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason)(0), // 18: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.FailureReason - (PaymentNotification_TransactionDetails_Transaction_Status)(0), // 19: signal.backup.PaymentNotification.TransactionDetails.Transaction.Status - (GiftBadge_State)(0), // 20: signal.backup.GiftBadge.State - (ContactAttachment_Phone_Type)(0), // 21: signal.backup.ContactAttachment.Phone.Type - (ContactAttachment_Email_Type)(0), // 22: signal.backup.ContactAttachment.Email.Type - (ContactAttachment_PostalAddress_Type)(0), // 23: signal.backup.ContactAttachment.PostalAddress.Type - (MessageAttachment_Flag)(0), // 24: signal.backup.MessageAttachment.Flag - (Quote_Type)(0), // 25: signal.backup.Quote.Type - (BodyRange_Style)(0), // 26: signal.backup.BodyRange.Style - (IndividualCall_Type)(0), // 27: signal.backup.IndividualCall.Type - (IndividualCall_Direction)(0), // 28: signal.backup.IndividualCall.Direction - (IndividualCall_State)(0), // 29: signal.backup.IndividualCall.State - (GroupCall_State)(0), // 30: signal.backup.GroupCall.State - (SimpleChatUpdate_Type)(0), // 31: signal.backup.SimpleChatUpdate.Type - (ChatStyle_WallpaperPreset)(0), // 32: signal.backup.ChatStyle.WallpaperPreset - (ChatStyle_BubbleColorPreset)(0), // 33: signal.backup.ChatStyle.BubbleColorPreset - (NotificationProfile_DayOfWeek)(0), // 34: signal.backup.NotificationProfile.DayOfWeek - (ChatFolder_FolderType)(0), // 35: signal.backup.ChatFolder.FolderType - (*BackupInfo)(nil), // 36: signal.backup.BackupInfo - (*Frame)(nil), // 37: signal.backup.Frame - (*AccountData)(nil), // 38: signal.backup.AccountData - (*Recipient)(nil), // 39: signal.backup.Recipient - (*Contact)(nil), // 40: signal.backup.Contact - (*Group)(nil), // 41: signal.backup.Group - (*Self)(nil), // 42: signal.backup.Self - (*ReleaseNotes)(nil), // 43: signal.backup.ReleaseNotes - (*Chat)(nil), // 44: signal.backup.Chat - (*CallLink)(nil), // 45: signal.backup.CallLink - (*AdHocCall)(nil), // 46: signal.backup.AdHocCall - (*DistributionListItem)(nil), // 47: signal.backup.DistributionListItem - (*DistributionList)(nil), // 48: signal.backup.DistributionList - (*ChatItem)(nil), // 49: signal.backup.ChatItem - (*SendStatus)(nil), // 50: signal.backup.SendStatus - (*Text)(nil), // 51: signal.backup.Text - (*StandardMessage)(nil), // 52: signal.backup.StandardMessage - (*ContactMessage)(nil), // 53: signal.backup.ContactMessage - (*DirectStoryReplyMessage)(nil), // 54: signal.backup.DirectStoryReplyMessage - (*PaymentNotification)(nil), // 55: signal.backup.PaymentNotification - (*GiftBadge)(nil), // 56: signal.backup.GiftBadge - (*ViewOnceMessage)(nil), // 57: signal.backup.ViewOnceMessage - (*ContactAttachment)(nil), // 58: signal.backup.ContactAttachment - (*StickerMessage)(nil), // 59: signal.backup.StickerMessage - (*RemoteDeletedMessage)(nil), // 60: signal.backup.RemoteDeletedMessage - (*Sticker)(nil), // 61: signal.backup.Sticker - (*LinkPreview)(nil), // 62: signal.backup.LinkPreview - (*MessageAttachment)(nil), // 63: signal.backup.MessageAttachment - (*FilePointer)(nil), // 64: signal.backup.FilePointer - (*Quote)(nil), // 65: signal.backup.Quote - (*BodyRange)(nil), // 66: signal.backup.BodyRange - (*Reaction)(nil), // 67: signal.backup.Reaction - (*Poll)(nil), // 68: signal.backup.Poll - (*AdminDeletedMessage)(nil), // 69: signal.backup.AdminDeletedMessage - (*ChatUpdateMessage)(nil), // 70: signal.backup.ChatUpdateMessage - (*IndividualCall)(nil), // 71: signal.backup.IndividualCall - (*GroupCall)(nil), // 72: signal.backup.GroupCall - (*SimpleChatUpdate)(nil), // 73: signal.backup.SimpleChatUpdate - (*ExpirationTimerChatUpdate)(nil), // 74: signal.backup.ExpirationTimerChatUpdate - (*ProfileChangeChatUpdate)(nil), // 75: signal.backup.ProfileChangeChatUpdate - (*LearnedProfileChatUpdate)(nil), // 76: signal.backup.LearnedProfileChatUpdate - (*ThreadMergeChatUpdate)(nil), // 77: signal.backup.ThreadMergeChatUpdate - (*SessionSwitchoverChatUpdate)(nil), // 78: signal.backup.SessionSwitchoverChatUpdate - (*GroupChangeChatUpdate)(nil), // 79: signal.backup.GroupChangeChatUpdate - (*GenericGroupUpdate)(nil), // 80: signal.backup.GenericGroupUpdate - (*GroupCreationUpdate)(nil), // 81: signal.backup.GroupCreationUpdate - (*GroupNameUpdate)(nil), // 82: signal.backup.GroupNameUpdate - (*GroupAvatarUpdate)(nil), // 83: signal.backup.GroupAvatarUpdate - (*GroupDescriptionUpdate)(nil), // 84: signal.backup.GroupDescriptionUpdate - (*GroupMembershipAccessLevelChangeUpdate)(nil), // 85: signal.backup.GroupMembershipAccessLevelChangeUpdate - (*GroupAttributesAccessLevelChangeUpdate)(nil), // 86: signal.backup.GroupAttributesAccessLevelChangeUpdate - (*GroupMemberLabelAccessLevelChangeUpdate)(nil), // 87: signal.backup.GroupMemberLabelAccessLevelChangeUpdate - (*GroupTerminateChangeUpdate)(nil), // 88: signal.backup.GroupTerminateChangeUpdate - (*GroupAnnouncementOnlyChangeUpdate)(nil), // 89: signal.backup.GroupAnnouncementOnlyChangeUpdate - (*GroupAdminStatusUpdate)(nil), // 90: signal.backup.GroupAdminStatusUpdate - (*GroupMemberLeftUpdate)(nil), // 91: signal.backup.GroupMemberLeftUpdate - (*GroupMemberRemovedUpdate)(nil), // 92: signal.backup.GroupMemberRemovedUpdate - (*SelfInvitedToGroupUpdate)(nil), // 93: signal.backup.SelfInvitedToGroupUpdate - (*SelfInvitedOtherUserToGroupUpdate)(nil), // 94: signal.backup.SelfInvitedOtherUserToGroupUpdate - (*GroupUnknownInviteeUpdate)(nil), // 95: signal.backup.GroupUnknownInviteeUpdate - (*GroupInvitationAcceptedUpdate)(nil), // 96: signal.backup.GroupInvitationAcceptedUpdate - (*GroupInvitationDeclinedUpdate)(nil), // 97: signal.backup.GroupInvitationDeclinedUpdate - (*GroupMemberJoinedUpdate)(nil), // 98: signal.backup.GroupMemberJoinedUpdate - (*GroupMemberAddedUpdate)(nil), // 99: signal.backup.GroupMemberAddedUpdate - (*GroupSelfInvitationRevokedUpdate)(nil), // 100: signal.backup.GroupSelfInvitationRevokedUpdate - (*GroupInvitationRevokedUpdate)(nil), // 101: signal.backup.GroupInvitationRevokedUpdate - (*GroupJoinRequestUpdate)(nil), // 102: signal.backup.GroupJoinRequestUpdate - (*GroupJoinRequestApprovalUpdate)(nil), // 103: signal.backup.GroupJoinRequestApprovalUpdate - (*GroupJoinRequestCanceledUpdate)(nil), // 104: signal.backup.GroupJoinRequestCanceledUpdate - (*GroupSequenceOfRequestsAndCancelsUpdate)(nil), // 105: signal.backup.GroupSequenceOfRequestsAndCancelsUpdate - (*GroupInviteLinkResetUpdate)(nil), // 106: signal.backup.GroupInviteLinkResetUpdate - (*GroupInviteLinkEnabledUpdate)(nil), // 107: signal.backup.GroupInviteLinkEnabledUpdate - (*GroupInviteLinkAdminApprovalUpdate)(nil), // 108: signal.backup.GroupInviteLinkAdminApprovalUpdate - (*GroupInviteLinkDisabledUpdate)(nil), // 109: signal.backup.GroupInviteLinkDisabledUpdate - (*GroupMemberJoinedByLinkUpdate)(nil), // 110: signal.backup.GroupMemberJoinedByLinkUpdate - (*GroupV2MigrationUpdate)(nil), // 111: signal.backup.GroupV2MigrationUpdate - (*GroupV2MigrationSelfInvitedUpdate)(nil), // 112: signal.backup.GroupV2MigrationSelfInvitedUpdate - (*GroupV2MigrationInvitedMembersUpdate)(nil), // 113: signal.backup.GroupV2MigrationInvitedMembersUpdate - (*GroupV2MigrationDroppedMembersUpdate)(nil), // 114: signal.backup.GroupV2MigrationDroppedMembersUpdate - (*GroupExpirationTimerUpdate)(nil), // 115: signal.backup.GroupExpirationTimerUpdate - (*PollTerminateUpdate)(nil), // 116: signal.backup.PollTerminateUpdate - (*PinMessageUpdate)(nil), // 117: signal.backup.PinMessageUpdate - (*StickerPack)(nil), // 118: signal.backup.StickerPack - (*ChatStyle)(nil), // 119: signal.backup.ChatStyle - (*NotificationProfile)(nil), // 120: signal.backup.NotificationProfile - (*ChatFolder)(nil), // 121: signal.backup.ChatFolder - (*AccountData_UsernameLink)(nil), // 122: signal.backup.AccountData.UsernameLink - (*AccountData_AutoDownloadSettings)(nil), // 123: signal.backup.AccountData.AutoDownloadSettings - (*AccountData_AccountSettings)(nil), // 124: signal.backup.AccountData.AccountSettings - (*AccountData_SubscriberData)(nil), // 125: signal.backup.AccountData.SubscriberData - (*AccountData_IAPSubscriberData)(nil), // 126: signal.backup.AccountData.IAPSubscriberData - (*AccountData_AndroidSpecificSettings)(nil), // 127: signal.backup.AccountData.AndroidSpecificSettings - (*Contact_Registered)(nil), // 128: signal.backup.Contact.Registered - (*Contact_NotRegistered)(nil), // 129: signal.backup.Contact.NotRegistered - (*Contact_Name)(nil), // 130: signal.backup.Contact.Name - (*Group_GroupSnapshot)(nil), // 131: signal.backup.Group.GroupSnapshot - (*Group_GroupAttributeBlob)(nil), // 132: signal.backup.Group.GroupAttributeBlob - (*Group_Member)(nil), // 133: signal.backup.Group.Member - (*Group_MemberPendingProfileKey)(nil), // 134: signal.backup.Group.MemberPendingProfileKey - (*Group_MemberPendingAdminApproval)(nil), // 135: signal.backup.Group.MemberPendingAdminApproval - (*Group_MemberBanned)(nil), // 136: signal.backup.Group.MemberBanned - (*Group_AccessControl)(nil), // 137: signal.backup.Group.AccessControl - (*ChatItem_IncomingMessageDetails)(nil), // 138: signal.backup.ChatItem.IncomingMessageDetails - (*ChatItem_OutgoingMessageDetails)(nil), // 139: signal.backup.ChatItem.OutgoingMessageDetails - (*ChatItem_DirectionlessMessageDetails)(nil), // 140: signal.backup.ChatItem.DirectionlessMessageDetails - (*ChatItem_PinDetails)(nil), // 141: signal.backup.ChatItem.PinDetails - (*SendStatus_Pending)(nil), // 142: signal.backup.SendStatus.Pending - (*SendStatus_Sent)(nil), // 143: signal.backup.SendStatus.Sent - (*SendStatus_Delivered)(nil), // 144: signal.backup.SendStatus.Delivered - (*SendStatus_Read)(nil), // 145: signal.backup.SendStatus.Read - (*SendStatus_Viewed)(nil), // 146: signal.backup.SendStatus.Viewed - (*SendStatus_Skipped)(nil), // 147: signal.backup.SendStatus.Skipped - (*SendStatus_Failed)(nil), // 148: signal.backup.SendStatus.Failed - (*DirectStoryReplyMessage_TextReply)(nil), // 149: signal.backup.DirectStoryReplyMessage.TextReply - (*PaymentNotification_TransactionDetails)(nil), // 150: signal.backup.PaymentNotification.TransactionDetails - (*PaymentNotification_TransactionDetails_MobileCoinTxoIdentification)(nil), // 151: signal.backup.PaymentNotification.TransactionDetails.MobileCoinTxoIdentification - (*PaymentNotification_TransactionDetails_FailedTransaction)(nil), // 152: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction - (*PaymentNotification_TransactionDetails_Transaction)(nil), // 153: signal.backup.PaymentNotification.TransactionDetails.Transaction - (*ContactAttachment_Name)(nil), // 154: signal.backup.ContactAttachment.Name - (*ContactAttachment_Phone)(nil), // 155: signal.backup.ContactAttachment.Phone - (*ContactAttachment_Email)(nil), // 156: signal.backup.ContactAttachment.Email - (*ContactAttachment_PostalAddress)(nil), // 157: signal.backup.ContactAttachment.PostalAddress - (*FilePointer_LocatorInfo)(nil), // 158: signal.backup.FilePointer.LocatorInfo - (*Quote_QuotedAttachment)(nil), // 159: signal.backup.Quote.QuotedAttachment - (*Poll_PollOption)(nil), // 160: signal.backup.Poll.PollOption - (*Poll_PollOption_PollVote)(nil), // 161: signal.backup.Poll.PollOption.PollVote - (*GroupChangeChatUpdate_Update)(nil), // 162: signal.backup.GroupChangeChatUpdate.Update - (*GroupInvitationRevokedUpdate_Invitee)(nil), // 163: signal.backup.GroupInvitationRevokedUpdate.Invitee - (*ChatStyle_Gradient)(nil), // 164: signal.backup.ChatStyle.Gradient - (*ChatStyle_CustomChatColor)(nil), // 165: signal.backup.ChatStyle.CustomChatColor - (*ChatStyle_AutomaticBubbleColor)(nil), // 166: signal.backup.ChatStyle.AutomaticBubbleColor + (AvatarColor)(0), // 0: signal.backup.AvatarColor + (GroupV2AccessLevel)(0), // 1: signal.backup.GroupV2AccessLevel + (AccountData_PhoneNumberSharingMode)(0), // 2: signal.backup.AccountData.PhoneNumberSharingMode + (AccountData_UsernameLink_Color)(0), // 3: signal.backup.AccountData.UsernameLink.Color + (Contact_IdentityState)(0), // 4: signal.backup.Contact.IdentityState + (Contact_Visibility)(0), // 5: signal.backup.Contact.Visibility + (Group_StorySendMode)(0), // 6: signal.backup.Group.StorySendMode + (Group_Member_Role)(0), // 7: signal.backup.Group.Member.Role + (Group_AccessControl_AccessRequired)(0), // 8: signal.backup.Group.AccessControl.AccessRequired + (CallLink_Restrictions)(0), // 9: signal.backup.CallLink.Restrictions + (AdHocCall_State)(0), // 10: signal.backup.AdHocCall.State + (DistributionList_PrivacyMode)(0), // 11: signal.backup.DistributionList.PrivacyMode + (SendStatus_Failed_FailureReason)(0), // 12: signal.backup.SendStatus.Failed.FailureReason + (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason)(0), // 13: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.FailureReason + (PaymentNotification_TransactionDetails_Transaction_Status)(0), // 14: signal.backup.PaymentNotification.TransactionDetails.Transaction.Status + (GiftBadge_State)(0), // 15: signal.backup.GiftBadge.State + (ContactAttachment_Phone_Type)(0), // 16: signal.backup.ContactAttachment.Phone.Type + (ContactAttachment_Email_Type)(0), // 17: signal.backup.ContactAttachment.Email.Type + (ContactAttachment_PostalAddress_Type)(0), // 18: signal.backup.ContactAttachment.PostalAddress.Type + (MessageAttachment_Flag)(0), // 19: signal.backup.MessageAttachment.Flag + (Quote_Type)(0), // 20: signal.backup.Quote.Type + (BodyRange_Style)(0), // 21: signal.backup.BodyRange.Style + (IndividualCall_Type)(0), // 22: signal.backup.IndividualCall.Type + (IndividualCall_Direction)(0), // 23: signal.backup.IndividualCall.Direction + (IndividualCall_State)(0), // 24: signal.backup.IndividualCall.State + (GroupCall_State)(0), // 25: signal.backup.GroupCall.State + (SimpleChatUpdate_Type)(0), // 26: signal.backup.SimpleChatUpdate.Type + (ChatStyle_WallpaperPreset)(0), // 27: signal.backup.ChatStyle.WallpaperPreset + (ChatStyle_BubbleColorPreset)(0), // 28: signal.backup.ChatStyle.BubbleColorPreset + (NotificationProfile_DayOfWeek)(0), // 29: signal.backup.NotificationProfile.DayOfWeek + (ChatFolder_FolderType)(0), // 30: signal.backup.ChatFolder.FolderType + (*BackupInfo)(nil), // 31: signal.backup.BackupInfo + (*Frame)(nil), // 32: signal.backup.Frame + (*AccountData)(nil), // 33: signal.backup.AccountData + (*Recipient)(nil), // 34: signal.backup.Recipient + (*Contact)(nil), // 35: signal.backup.Contact + (*Group)(nil), // 36: signal.backup.Group + (*Self)(nil), // 37: signal.backup.Self + (*ReleaseNotes)(nil), // 38: signal.backup.ReleaseNotes + (*Chat)(nil), // 39: signal.backup.Chat + (*CallLink)(nil), // 40: signal.backup.CallLink + (*AdHocCall)(nil), // 41: signal.backup.AdHocCall + (*DistributionListItem)(nil), // 42: signal.backup.DistributionListItem + (*DistributionList)(nil), // 43: signal.backup.DistributionList + (*ChatItem)(nil), // 44: signal.backup.ChatItem + (*SendStatus)(nil), // 45: signal.backup.SendStatus + (*Text)(nil), // 46: signal.backup.Text + (*StandardMessage)(nil), // 47: signal.backup.StandardMessage + (*ContactMessage)(nil), // 48: signal.backup.ContactMessage + (*DirectStoryReplyMessage)(nil), // 49: signal.backup.DirectStoryReplyMessage + (*PaymentNotification)(nil), // 50: signal.backup.PaymentNotification + (*GiftBadge)(nil), // 51: signal.backup.GiftBadge + (*ViewOnceMessage)(nil), // 52: signal.backup.ViewOnceMessage + (*ContactAttachment)(nil), // 53: signal.backup.ContactAttachment + (*StickerMessage)(nil), // 54: signal.backup.StickerMessage + (*RemoteDeletedMessage)(nil), // 55: signal.backup.RemoteDeletedMessage + (*Sticker)(nil), // 56: signal.backup.Sticker + (*LinkPreview)(nil), // 57: signal.backup.LinkPreview + (*MessageAttachment)(nil), // 58: signal.backup.MessageAttachment + (*FilePointer)(nil), // 59: signal.backup.FilePointer + (*Quote)(nil), // 60: signal.backup.Quote + (*BodyRange)(nil), // 61: signal.backup.BodyRange + (*Reaction)(nil), // 62: signal.backup.Reaction + (*ChatUpdateMessage)(nil), // 63: signal.backup.ChatUpdateMessage + (*IndividualCall)(nil), // 64: signal.backup.IndividualCall + (*GroupCall)(nil), // 65: signal.backup.GroupCall + (*SimpleChatUpdate)(nil), // 66: signal.backup.SimpleChatUpdate + (*ExpirationTimerChatUpdate)(nil), // 67: signal.backup.ExpirationTimerChatUpdate + (*ProfileChangeChatUpdate)(nil), // 68: signal.backup.ProfileChangeChatUpdate + (*LearnedProfileChatUpdate)(nil), // 69: signal.backup.LearnedProfileChatUpdate + (*ThreadMergeChatUpdate)(nil), // 70: signal.backup.ThreadMergeChatUpdate + (*SessionSwitchoverChatUpdate)(nil), // 71: signal.backup.SessionSwitchoverChatUpdate + (*GroupChangeChatUpdate)(nil), // 72: signal.backup.GroupChangeChatUpdate + (*GenericGroupUpdate)(nil), // 73: signal.backup.GenericGroupUpdate + (*GroupCreationUpdate)(nil), // 74: signal.backup.GroupCreationUpdate + (*GroupNameUpdate)(nil), // 75: signal.backup.GroupNameUpdate + (*GroupAvatarUpdate)(nil), // 76: signal.backup.GroupAvatarUpdate + (*GroupDescriptionUpdate)(nil), // 77: signal.backup.GroupDescriptionUpdate + (*GroupMembershipAccessLevelChangeUpdate)(nil), // 78: signal.backup.GroupMembershipAccessLevelChangeUpdate + (*GroupAttributesAccessLevelChangeUpdate)(nil), // 79: signal.backup.GroupAttributesAccessLevelChangeUpdate + (*GroupAnnouncementOnlyChangeUpdate)(nil), // 80: signal.backup.GroupAnnouncementOnlyChangeUpdate + (*GroupAdminStatusUpdate)(nil), // 81: signal.backup.GroupAdminStatusUpdate + (*GroupMemberLeftUpdate)(nil), // 82: signal.backup.GroupMemberLeftUpdate + (*GroupMemberRemovedUpdate)(nil), // 83: signal.backup.GroupMemberRemovedUpdate + (*SelfInvitedToGroupUpdate)(nil), // 84: signal.backup.SelfInvitedToGroupUpdate + (*SelfInvitedOtherUserToGroupUpdate)(nil), // 85: signal.backup.SelfInvitedOtherUserToGroupUpdate + (*GroupUnknownInviteeUpdate)(nil), // 86: signal.backup.GroupUnknownInviteeUpdate + (*GroupInvitationAcceptedUpdate)(nil), // 87: signal.backup.GroupInvitationAcceptedUpdate + (*GroupInvitationDeclinedUpdate)(nil), // 88: signal.backup.GroupInvitationDeclinedUpdate + (*GroupMemberJoinedUpdate)(nil), // 89: signal.backup.GroupMemberJoinedUpdate + (*GroupMemberAddedUpdate)(nil), // 90: signal.backup.GroupMemberAddedUpdate + (*GroupSelfInvitationRevokedUpdate)(nil), // 91: signal.backup.GroupSelfInvitationRevokedUpdate + (*GroupInvitationRevokedUpdate)(nil), // 92: signal.backup.GroupInvitationRevokedUpdate + (*GroupJoinRequestUpdate)(nil), // 93: signal.backup.GroupJoinRequestUpdate + (*GroupJoinRequestApprovalUpdate)(nil), // 94: signal.backup.GroupJoinRequestApprovalUpdate + (*GroupJoinRequestCanceledUpdate)(nil), // 95: signal.backup.GroupJoinRequestCanceledUpdate + (*GroupSequenceOfRequestsAndCancelsUpdate)(nil), // 96: signal.backup.GroupSequenceOfRequestsAndCancelsUpdate + (*GroupInviteLinkResetUpdate)(nil), // 97: signal.backup.GroupInviteLinkResetUpdate + (*GroupInviteLinkEnabledUpdate)(nil), // 98: signal.backup.GroupInviteLinkEnabledUpdate + (*GroupInviteLinkAdminApprovalUpdate)(nil), // 99: signal.backup.GroupInviteLinkAdminApprovalUpdate + (*GroupInviteLinkDisabledUpdate)(nil), // 100: signal.backup.GroupInviteLinkDisabledUpdate + (*GroupMemberJoinedByLinkUpdate)(nil), // 101: signal.backup.GroupMemberJoinedByLinkUpdate + (*GroupV2MigrationUpdate)(nil), // 102: signal.backup.GroupV2MigrationUpdate + (*GroupV2MigrationSelfInvitedUpdate)(nil), // 103: signal.backup.GroupV2MigrationSelfInvitedUpdate + (*GroupV2MigrationInvitedMembersUpdate)(nil), // 104: signal.backup.GroupV2MigrationInvitedMembersUpdate + (*GroupV2MigrationDroppedMembersUpdate)(nil), // 105: signal.backup.GroupV2MigrationDroppedMembersUpdate + (*GroupExpirationTimerUpdate)(nil), // 106: signal.backup.GroupExpirationTimerUpdate + (*StickerPack)(nil), // 107: signal.backup.StickerPack + (*ChatStyle)(nil), // 108: signal.backup.ChatStyle + (*NotificationProfile)(nil), // 109: signal.backup.NotificationProfile + (*ChatFolder)(nil), // 110: signal.backup.ChatFolder + (*AccountData_UsernameLink)(nil), // 111: signal.backup.AccountData.UsernameLink + (*AccountData_AccountSettings)(nil), // 112: signal.backup.AccountData.AccountSettings + (*AccountData_SubscriberData)(nil), // 113: signal.backup.AccountData.SubscriberData + (*AccountData_IAPSubscriberData)(nil), // 114: signal.backup.AccountData.IAPSubscriberData + (*Contact_Registered)(nil), // 115: signal.backup.Contact.Registered + (*Contact_NotRegistered)(nil), // 116: signal.backup.Contact.NotRegistered + (*Contact_Name)(nil), // 117: signal.backup.Contact.Name + (*Group_GroupSnapshot)(nil), // 118: signal.backup.Group.GroupSnapshot + (*Group_GroupAttributeBlob)(nil), // 119: signal.backup.Group.GroupAttributeBlob + (*Group_Member)(nil), // 120: signal.backup.Group.Member + (*Group_MemberPendingProfileKey)(nil), // 121: signal.backup.Group.MemberPendingProfileKey + (*Group_MemberPendingAdminApproval)(nil), // 122: signal.backup.Group.MemberPendingAdminApproval + (*Group_MemberBanned)(nil), // 123: signal.backup.Group.MemberBanned + (*Group_AccessControl)(nil), // 124: signal.backup.Group.AccessControl + (*ChatItem_IncomingMessageDetails)(nil), // 125: signal.backup.ChatItem.IncomingMessageDetails + (*ChatItem_OutgoingMessageDetails)(nil), // 126: signal.backup.ChatItem.OutgoingMessageDetails + (*ChatItem_DirectionlessMessageDetails)(nil), // 127: signal.backup.ChatItem.DirectionlessMessageDetails + (*SendStatus_Pending)(nil), // 128: signal.backup.SendStatus.Pending + (*SendStatus_Sent)(nil), // 129: signal.backup.SendStatus.Sent + (*SendStatus_Delivered)(nil), // 130: signal.backup.SendStatus.Delivered + (*SendStatus_Read)(nil), // 131: signal.backup.SendStatus.Read + (*SendStatus_Viewed)(nil), // 132: signal.backup.SendStatus.Viewed + (*SendStatus_Skipped)(nil), // 133: signal.backup.SendStatus.Skipped + (*SendStatus_Failed)(nil), // 134: signal.backup.SendStatus.Failed + (*DirectStoryReplyMessage_TextReply)(nil), // 135: signal.backup.DirectStoryReplyMessage.TextReply + (*PaymentNotification_TransactionDetails)(nil), // 136: signal.backup.PaymentNotification.TransactionDetails + (*PaymentNotification_TransactionDetails_MobileCoinTxoIdentification)(nil), // 137: signal.backup.PaymentNotification.TransactionDetails.MobileCoinTxoIdentification + (*PaymentNotification_TransactionDetails_FailedTransaction)(nil), // 138: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction + (*PaymentNotification_TransactionDetails_Transaction)(nil), // 139: signal.backup.PaymentNotification.TransactionDetails.Transaction + (*ContactAttachment_Name)(nil), // 140: signal.backup.ContactAttachment.Name + (*ContactAttachment_Phone)(nil), // 141: signal.backup.ContactAttachment.Phone + (*ContactAttachment_Email)(nil), // 142: signal.backup.ContactAttachment.Email + (*ContactAttachment_PostalAddress)(nil), // 143: signal.backup.ContactAttachment.PostalAddress + (*FilePointer_LocatorInfo)(nil), // 144: signal.backup.FilePointer.LocatorInfo + (*Quote_QuotedAttachment)(nil), // 145: signal.backup.Quote.QuotedAttachment + (*GroupChangeChatUpdate_Update)(nil), // 146: signal.backup.GroupChangeChatUpdate.Update + (*GroupInvitationRevokedUpdate_Invitee)(nil), // 147: signal.backup.GroupInvitationRevokedUpdate.Invitee + (*ChatStyle_Gradient)(nil), // 148: signal.backup.ChatStyle.Gradient + (*ChatStyle_CustomChatColor)(nil), // 149: signal.backup.ChatStyle.CustomChatColor + (*ChatStyle_AutomaticBubbleColor)(nil), // 150: signal.backup.ChatStyle.AutomaticBubbleColor } var file_backuppb_Backup_proto_depIdxs = []int32{ - 38, // 0: signal.backup.Frame.account:type_name -> signal.backup.AccountData - 39, // 1: signal.backup.Frame.recipient:type_name -> signal.backup.Recipient - 44, // 2: signal.backup.Frame.chat:type_name -> signal.backup.Chat - 49, // 3: signal.backup.Frame.chatItem:type_name -> signal.backup.ChatItem - 118, // 4: signal.backup.Frame.stickerPack:type_name -> signal.backup.StickerPack - 46, // 5: signal.backup.Frame.adHocCall:type_name -> signal.backup.AdHocCall - 120, // 6: signal.backup.Frame.notificationProfile:type_name -> signal.backup.NotificationProfile - 121, // 7: signal.backup.Frame.chatFolder:type_name -> signal.backup.ChatFolder - 122, // 8: signal.backup.AccountData.usernameLink:type_name -> signal.backup.AccountData.UsernameLink - 125, // 9: signal.backup.AccountData.donationSubscriberData:type_name -> signal.backup.AccountData.SubscriberData - 124, // 10: signal.backup.AccountData.accountSettings:type_name -> signal.backup.AccountData.AccountSettings - 126, // 11: signal.backup.AccountData.backupsSubscriberData:type_name -> signal.backup.AccountData.IAPSubscriberData - 127, // 12: signal.backup.AccountData.androidSpecificSettings:type_name -> signal.backup.AccountData.AndroidSpecificSettings - 40, // 13: signal.backup.Recipient.contact:type_name -> signal.backup.Contact - 41, // 14: signal.backup.Recipient.group:type_name -> signal.backup.Group - 47, // 15: signal.backup.Recipient.distributionList:type_name -> signal.backup.DistributionListItem - 42, // 16: signal.backup.Recipient.self:type_name -> signal.backup.Self - 43, // 17: signal.backup.Recipient.releaseNotes:type_name -> signal.backup.ReleaseNotes - 45, // 18: signal.backup.Recipient.callLink:type_name -> signal.backup.CallLink - 10, // 19: signal.backup.Contact.visibility:type_name -> signal.backup.Contact.Visibility - 128, // 20: signal.backup.Contact.registered:type_name -> signal.backup.Contact.Registered - 129, // 21: signal.backup.Contact.notRegistered:type_name -> signal.backup.Contact.NotRegistered - 9, // 22: signal.backup.Contact.identityState:type_name -> signal.backup.Contact.IdentityState - 130, // 23: signal.backup.Contact.nickname:type_name -> signal.backup.Contact.Name - 0, // 24: signal.backup.Contact.avatarColor:type_name -> signal.backup.AvatarColor - 11, // 25: signal.backup.Group.storySendMode:type_name -> signal.backup.Group.StorySendMode - 131, // 26: signal.backup.Group.snapshot:type_name -> signal.backup.Group.GroupSnapshot - 0, // 27: signal.backup.Group.avatarColor:type_name -> signal.backup.AvatarColor - 0, // 28: signal.backup.Self.avatarColor:type_name -> signal.backup.AvatarColor - 119, // 29: signal.backup.Chat.style:type_name -> signal.backup.ChatStyle - 14, // 30: signal.backup.CallLink.restrictions:type_name -> signal.backup.CallLink.Restrictions - 15, // 31: signal.backup.AdHocCall.state:type_name -> signal.backup.AdHocCall.State - 48, // 32: signal.backup.DistributionListItem.distributionList:type_name -> signal.backup.DistributionList - 16, // 33: signal.backup.DistributionList.privacyMode:type_name -> signal.backup.DistributionList.PrivacyMode - 49, // 34: signal.backup.ChatItem.revisions:type_name -> signal.backup.ChatItem - 138, // 35: signal.backup.ChatItem.incoming:type_name -> signal.backup.ChatItem.IncomingMessageDetails - 139, // 36: signal.backup.ChatItem.outgoing:type_name -> signal.backup.ChatItem.OutgoingMessageDetails - 140, // 37: signal.backup.ChatItem.directionless:type_name -> signal.backup.ChatItem.DirectionlessMessageDetails - 52, // 38: signal.backup.ChatItem.standardMessage:type_name -> signal.backup.StandardMessage - 53, // 39: signal.backup.ChatItem.contactMessage:type_name -> signal.backup.ContactMessage - 59, // 40: signal.backup.ChatItem.stickerMessage:type_name -> signal.backup.StickerMessage - 60, // 41: signal.backup.ChatItem.remoteDeletedMessage:type_name -> signal.backup.RemoteDeletedMessage - 70, // 42: signal.backup.ChatItem.updateMessage:type_name -> signal.backup.ChatUpdateMessage - 55, // 43: signal.backup.ChatItem.paymentNotification:type_name -> signal.backup.PaymentNotification - 56, // 44: signal.backup.ChatItem.giftBadge:type_name -> signal.backup.GiftBadge - 57, // 45: signal.backup.ChatItem.viewOnceMessage:type_name -> signal.backup.ViewOnceMessage - 54, // 46: signal.backup.ChatItem.directStoryReplyMessage:type_name -> signal.backup.DirectStoryReplyMessage - 68, // 47: signal.backup.ChatItem.poll:type_name -> signal.backup.Poll - 69, // 48: signal.backup.ChatItem.adminDeletedMessage:type_name -> signal.backup.AdminDeletedMessage - 141, // 49: signal.backup.ChatItem.pinDetails:type_name -> signal.backup.ChatItem.PinDetails - 142, // 50: signal.backup.SendStatus.pending:type_name -> signal.backup.SendStatus.Pending - 143, // 51: signal.backup.SendStatus.sent:type_name -> signal.backup.SendStatus.Sent - 144, // 52: signal.backup.SendStatus.delivered:type_name -> signal.backup.SendStatus.Delivered - 145, // 53: signal.backup.SendStatus.read:type_name -> signal.backup.SendStatus.Read - 146, // 54: signal.backup.SendStatus.viewed:type_name -> signal.backup.SendStatus.Viewed - 147, // 55: signal.backup.SendStatus.skipped:type_name -> signal.backup.SendStatus.Skipped - 148, // 56: signal.backup.SendStatus.failed:type_name -> signal.backup.SendStatus.Failed - 66, // 57: signal.backup.Text.bodyRanges:type_name -> signal.backup.BodyRange - 65, // 58: signal.backup.StandardMessage.quote:type_name -> signal.backup.Quote - 51, // 59: signal.backup.StandardMessage.text:type_name -> signal.backup.Text - 63, // 60: signal.backup.StandardMessage.attachments:type_name -> signal.backup.MessageAttachment - 62, // 61: signal.backup.StandardMessage.linkPreview:type_name -> signal.backup.LinkPreview - 64, // 62: signal.backup.StandardMessage.longText:type_name -> signal.backup.FilePointer - 67, // 63: signal.backup.StandardMessage.reactions:type_name -> signal.backup.Reaction - 58, // 64: signal.backup.ContactMessage.contact:type_name -> signal.backup.ContactAttachment - 67, // 65: signal.backup.ContactMessage.reactions:type_name -> signal.backup.Reaction - 149, // 66: signal.backup.DirectStoryReplyMessage.textReply:type_name -> signal.backup.DirectStoryReplyMessage.TextReply - 67, // 67: signal.backup.DirectStoryReplyMessage.reactions:type_name -> signal.backup.Reaction - 150, // 68: signal.backup.PaymentNotification.transactionDetails:type_name -> signal.backup.PaymentNotification.TransactionDetails - 20, // 69: signal.backup.GiftBadge.state:type_name -> signal.backup.GiftBadge.State - 63, // 70: signal.backup.ViewOnceMessage.attachment:type_name -> signal.backup.MessageAttachment - 67, // 71: signal.backup.ViewOnceMessage.reactions:type_name -> signal.backup.Reaction - 154, // 72: signal.backup.ContactAttachment.name:type_name -> signal.backup.ContactAttachment.Name - 155, // 73: signal.backup.ContactAttachment.number:type_name -> signal.backup.ContactAttachment.Phone - 156, // 74: signal.backup.ContactAttachment.email:type_name -> signal.backup.ContactAttachment.Email - 157, // 75: signal.backup.ContactAttachment.address:type_name -> signal.backup.ContactAttachment.PostalAddress - 64, // 76: signal.backup.ContactAttachment.avatar:type_name -> signal.backup.FilePointer - 61, // 77: signal.backup.StickerMessage.sticker:type_name -> signal.backup.Sticker - 67, // 78: signal.backup.StickerMessage.reactions:type_name -> signal.backup.Reaction - 64, // 79: signal.backup.Sticker.data:type_name -> signal.backup.FilePointer - 64, // 80: signal.backup.LinkPreview.image:type_name -> signal.backup.FilePointer - 64, // 81: signal.backup.MessageAttachment.pointer:type_name -> signal.backup.FilePointer - 24, // 82: signal.backup.MessageAttachment.flag:type_name -> signal.backup.MessageAttachment.Flag - 158, // 83: signal.backup.FilePointer.locatorInfo:type_name -> signal.backup.FilePointer.LocatorInfo - 51, // 84: signal.backup.Quote.text:type_name -> signal.backup.Text - 159, // 85: signal.backup.Quote.attachments:type_name -> signal.backup.Quote.QuotedAttachment - 25, // 86: signal.backup.Quote.type:type_name -> signal.backup.Quote.Type - 26, // 87: signal.backup.BodyRange.style:type_name -> signal.backup.BodyRange.Style - 160, // 88: signal.backup.Poll.options:type_name -> signal.backup.Poll.PollOption - 67, // 89: signal.backup.Poll.reactions:type_name -> signal.backup.Reaction - 73, // 90: signal.backup.ChatUpdateMessage.simpleUpdate:type_name -> signal.backup.SimpleChatUpdate - 79, // 91: signal.backup.ChatUpdateMessage.groupChange:type_name -> signal.backup.GroupChangeChatUpdate - 74, // 92: signal.backup.ChatUpdateMessage.expirationTimerChange:type_name -> signal.backup.ExpirationTimerChatUpdate - 75, // 93: signal.backup.ChatUpdateMessage.profileChange:type_name -> signal.backup.ProfileChangeChatUpdate - 77, // 94: signal.backup.ChatUpdateMessage.threadMerge:type_name -> signal.backup.ThreadMergeChatUpdate - 78, // 95: signal.backup.ChatUpdateMessage.sessionSwitchover:type_name -> signal.backup.SessionSwitchoverChatUpdate - 71, // 96: signal.backup.ChatUpdateMessage.individualCall:type_name -> signal.backup.IndividualCall - 72, // 97: signal.backup.ChatUpdateMessage.groupCall:type_name -> signal.backup.GroupCall - 76, // 98: signal.backup.ChatUpdateMessage.learnedProfileChange:type_name -> signal.backup.LearnedProfileChatUpdate - 116, // 99: signal.backup.ChatUpdateMessage.pollTerminate:type_name -> signal.backup.PollTerminateUpdate - 117, // 100: signal.backup.ChatUpdateMessage.pinMessage:type_name -> signal.backup.PinMessageUpdate - 27, // 101: signal.backup.IndividualCall.type:type_name -> signal.backup.IndividualCall.Type - 28, // 102: signal.backup.IndividualCall.direction:type_name -> signal.backup.IndividualCall.Direction - 29, // 103: signal.backup.IndividualCall.state:type_name -> signal.backup.IndividualCall.State - 30, // 104: signal.backup.GroupCall.state:type_name -> signal.backup.GroupCall.State - 31, // 105: signal.backup.SimpleChatUpdate.type:type_name -> signal.backup.SimpleChatUpdate.Type - 162, // 106: signal.backup.GroupChangeChatUpdate.updates:type_name -> signal.backup.GroupChangeChatUpdate.Update - 1, // 107: signal.backup.GroupMembershipAccessLevelChangeUpdate.accessLevel:type_name -> signal.backup.GroupV2AccessLevel - 1, // 108: signal.backup.GroupAttributesAccessLevelChangeUpdate.accessLevel:type_name -> signal.backup.GroupV2AccessLevel - 1, // 109: signal.backup.GroupMemberLabelAccessLevelChangeUpdate.accessLevel:type_name -> signal.backup.GroupV2AccessLevel - 163, // 110: signal.backup.GroupInvitationRevokedUpdate.invitees:type_name -> signal.backup.GroupInvitationRevokedUpdate.Invitee - 32, // 111: signal.backup.ChatStyle.wallpaperPreset:type_name -> signal.backup.ChatStyle.WallpaperPreset - 64, // 112: signal.backup.ChatStyle.wallpaperPhoto:type_name -> signal.backup.FilePointer - 166, // 113: signal.backup.ChatStyle.autoBubbleColor:type_name -> signal.backup.ChatStyle.AutomaticBubbleColor - 33, // 114: signal.backup.ChatStyle.bubbleColorPreset:type_name -> signal.backup.ChatStyle.BubbleColorPreset - 34, // 115: signal.backup.NotificationProfile.scheduleDaysEnabled:type_name -> signal.backup.NotificationProfile.DayOfWeek - 35, // 116: signal.backup.ChatFolder.folderType:type_name -> signal.backup.ChatFolder.FolderType - 6, // 117: signal.backup.AccountData.UsernameLink.color:type_name -> signal.backup.AccountData.UsernameLink.Color - 7, // 118: signal.backup.AccountData.AutoDownloadSettings.images:type_name -> signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOption - 7, // 119: signal.backup.AccountData.AutoDownloadSettings.audio:type_name -> signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOption - 7, // 120: signal.backup.AccountData.AutoDownloadSettings.video:type_name -> signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOption - 7, // 121: signal.backup.AccountData.AutoDownloadSettings.documents:type_name -> signal.backup.AccountData.AutoDownloadSettings.AutoDownloadOption - 2, // 122: signal.backup.AccountData.AccountSettings.phoneNumberSharingMode:type_name -> signal.backup.AccountData.PhoneNumberSharingMode - 119, // 123: signal.backup.AccountData.AccountSettings.defaultChatStyle:type_name -> signal.backup.ChatStyle - 165, // 124: signal.backup.AccountData.AccountSettings.customChatColors:type_name -> signal.backup.ChatStyle.CustomChatColor - 3, // 125: signal.backup.AccountData.AccountSettings.defaultSentMediaQuality:type_name -> signal.backup.AccountData.SentMediaQuality - 123, // 126: signal.backup.AccountData.AccountSettings.autoDownloadSettings:type_name -> signal.backup.AccountData.AutoDownloadSettings - 4, // 127: signal.backup.AccountData.AccountSettings.appTheme:type_name -> signal.backup.AccountData.AppTheme - 5, // 128: signal.backup.AccountData.AccountSettings.callsUseLessDataSetting:type_name -> signal.backup.AccountData.CallsUseLessDataSetting - 8, // 129: signal.backup.AccountData.AndroidSpecificSettings.navigationBarSize:type_name -> signal.backup.AccountData.AndroidSpecificSettings.NavigationBarSize - 132, // 130: signal.backup.Group.GroupSnapshot.title:type_name -> signal.backup.Group.GroupAttributeBlob - 132, // 131: signal.backup.Group.GroupSnapshot.description:type_name -> signal.backup.Group.GroupAttributeBlob - 132, // 132: signal.backup.Group.GroupSnapshot.disappearingMessagesTimer:type_name -> signal.backup.Group.GroupAttributeBlob - 137, // 133: signal.backup.Group.GroupSnapshot.accessControl:type_name -> signal.backup.Group.AccessControl - 133, // 134: signal.backup.Group.GroupSnapshot.members:type_name -> signal.backup.Group.Member - 134, // 135: signal.backup.Group.GroupSnapshot.membersPendingProfileKey:type_name -> signal.backup.Group.MemberPendingProfileKey - 135, // 136: signal.backup.Group.GroupSnapshot.membersPendingAdminApproval:type_name -> signal.backup.Group.MemberPendingAdminApproval - 136, // 137: signal.backup.Group.GroupSnapshot.members_banned:type_name -> signal.backup.Group.MemberBanned - 12, // 138: signal.backup.Group.Member.role:type_name -> signal.backup.Group.Member.Role - 133, // 139: signal.backup.Group.MemberPendingProfileKey.member:type_name -> signal.backup.Group.Member - 13, // 140: signal.backup.Group.AccessControl.attributes:type_name -> signal.backup.Group.AccessControl.AccessRequired - 13, // 141: signal.backup.Group.AccessControl.members:type_name -> signal.backup.Group.AccessControl.AccessRequired - 13, // 142: signal.backup.Group.AccessControl.addFromInviteLink:type_name -> signal.backup.Group.AccessControl.AccessRequired - 13, // 143: signal.backup.Group.AccessControl.memberLabel:type_name -> signal.backup.Group.AccessControl.AccessRequired - 50, // 144: signal.backup.ChatItem.OutgoingMessageDetails.sendStatus:type_name -> signal.backup.SendStatus - 17, // 145: signal.backup.SendStatus.Failed.reason:type_name -> signal.backup.SendStatus.Failed.FailureReason - 51, // 146: signal.backup.DirectStoryReplyMessage.TextReply.text:type_name -> signal.backup.Text - 64, // 147: signal.backup.DirectStoryReplyMessage.TextReply.longText:type_name -> signal.backup.FilePointer - 153, // 148: signal.backup.PaymentNotification.TransactionDetails.transaction:type_name -> signal.backup.PaymentNotification.TransactionDetails.Transaction - 152, // 149: signal.backup.PaymentNotification.TransactionDetails.failedTransaction:type_name -> signal.backup.PaymentNotification.TransactionDetails.FailedTransaction - 18, // 150: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.reason:type_name -> signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.FailureReason - 19, // 151: signal.backup.PaymentNotification.TransactionDetails.Transaction.status:type_name -> signal.backup.PaymentNotification.TransactionDetails.Transaction.Status - 151, // 152: signal.backup.PaymentNotification.TransactionDetails.Transaction.mobileCoinIdentification:type_name -> signal.backup.PaymentNotification.TransactionDetails.MobileCoinTxoIdentification - 21, // 153: signal.backup.ContactAttachment.Phone.type:type_name -> signal.backup.ContactAttachment.Phone.Type - 22, // 154: signal.backup.ContactAttachment.Email.type:type_name -> signal.backup.ContactAttachment.Email.Type - 23, // 155: signal.backup.ContactAttachment.PostalAddress.type:type_name -> signal.backup.ContactAttachment.PostalAddress.Type - 63, // 156: signal.backup.Quote.QuotedAttachment.thumbnail:type_name -> signal.backup.MessageAttachment - 161, // 157: signal.backup.Poll.PollOption.votes:type_name -> signal.backup.Poll.PollOption.PollVote - 80, // 158: signal.backup.GroupChangeChatUpdate.Update.genericGroupUpdate:type_name -> signal.backup.GenericGroupUpdate - 81, // 159: signal.backup.GroupChangeChatUpdate.Update.groupCreationUpdate:type_name -> signal.backup.GroupCreationUpdate - 82, // 160: signal.backup.GroupChangeChatUpdate.Update.groupNameUpdate:type_name -> signal.backup.GroupNameUpdate - 83, // 161: signal.backup.GroupChangeChatUpdate.Update.groupAvatarUpdate:type_name -> signal.backup.GroupAvatarUpdate - 84, // 162: signal.backup.GroupChangeChatUpdate.Update.groupDescriptionUpdate:type_name -> signal.backup.GroupDescriptionUpdate - 85, // 163: signal.backup.GroupChangeChatUpdate.Update.groupMembershipAccessLevelChangeUpdate:type_name -> signal.backup.GroupMembershipAccessLevelChangeUpdate - 86, // 164: signal.backup.GroupChangeChatUpdate.Update.groupAttributesAccessLevelChangeUpdate:type_name -> signal.backup.GroupAttributesAccessLevelChangeUpdate - 89, // 165: signal.backup.GroupChangeChatUpdate.Update.groupAnnouncementOnlyChangeUpdate:type_name -> signal.backup.GroupAnnouncementOnlyChangeUpdate - 90, // 166: signal.backup.GroupChangeChatUpdate.Update.groupAdminStatusUpdate:type_name -> signal.backup.GroupAdminStatusUpdate - 91, // 167: signal.backup.GroupChangeChatUpdate.Update.groupMemberLeftUpdate:type_name -> signal.backup.GroupMemberLeftUpdate - 92, // 168: signal.backup.GroupChangeChatUpdate.Update.groupMemberRemovedUpdate:type_name -> signal.backup.GroupMemberRemovedUpdate - 93, // 169: signal.backup.GroupChangeChatUpdate.Update.selfInvitedToGroupUpdate:type_name -> signal.backup.SelfInvitedToGroupUpdate - 94, // 170: signal.backup.GroupChangeChatUpdate.Update.selfInvitedOtherUserToGroupUpdate:type_name -> signal.backup.SelfInvitedOtherUserToGroupUpdate - 95, // 171: signal.backup.GroupChangeChatUpdate.Update.groupUnknownInviteeUpdate:type_name -> signal.backup.GroupUnknownInviteeUpdate - 96, // 172: signal.backup.GroupChangeChatUpdate.Update.groupInvitationAcceptedUpdate:type_name -> signal.backup.GroupInvitationAcceptedUpdate - 97, // 173: signal.backup.GroupChangeChatUpdate.Update.groupInvitationDeclinedUpdate:type_name -> signal.backup.GroupInvitationDeclinedUpdate - 98, // 174: signal.backup.GroupChangeChatUpdate.Update.groupMemberJoinedUpdate:type_name -> signal.backup.GroupMemberJoinedUpdate - 99, // 175: signal.backup.GroupChangeChatUpdate.Update.groupMemberAddedUpdate:type_name -> signal.backup.GroupMemberAddedUpdate - 100, // 176: signal.backup.GroupChangeChatUpdate.Update.groupSelfInvitationRevokedUpdate:type_name -> signal.backup.GroupSelfInvitationRevokedUpdate - 101, // 177: signal.backup.GroupChangeChatUpdate.Update.groupInvitationRevokedUpdate:type_name -> signal.backup.GroupInvitationRevokedUpdate - 102, // 178: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestUpdate:type_name -> signal.backup.GroupJoinRequestUpdate - 103, // 179: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestApprovalUpdate:type_name -> signal.backup.GroupJoinRequestApprovalUpdate - 104, // 180: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestCanceledUpdate:type_name -> signal.backup.GroupJoinRequestCanceledUpdate - 106, // 181: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkResetUpdate:type_name -> signal.backup.GroupInviteLinkResetUpdate - 107, // 182: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkEnabledUpdate:type_name -> signal.backup.GroupInviteLinkEnabledUpdate - 108, // 183: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkAdminApprovalUpdate:type_name -> signal.backup.GroupInviteLinkAdminApprovalUpdate - 109, // 184: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkDisabledUpdate:type_name -> signal.backup.GroupInviteLinkDisabledUpdate - 110, // 185: signal.backup.GroupChangeChatUpdate.Update.groupMemberJoinedByLinkUpdate:type_name -> signal.backup.GroupMemberJoinedByLinkUpdate - 111, // 186: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationUpdate:type_name -> signal.backup.GroupV2MigrationUpdate - 112, // 187: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationSelfInvitedUpdate:type_name -> signal.backup.GroupV2MigrationSelfInvitedUpdate - 113, // 188: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationInvitedMembersUpdate:type_name -> signal.backup.GroupV2MigrationInvitedMembersUpdate - 114, // 189: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationDroppedMembersUpdate:type_name -> signal.backup.GroupV2MigrationDroppedMembersUpdate - 105, // 190: signal.backup.GroupChangeChatUpdate.Update.groupSequenceOfRequestsAndCancelsUpdate:type_name -> signal.backup.GroupSequenceOfRequestsAndCancelsUpdate - 115, // 191: signal.backup.GroupChangeChatUpdate.Update.groupExpirationTimerUpdate:type_name -> signal.backup.GroupExpirationTimerUpdate - 87, // 192: signal.backup.GroupChangeChatUpdate.Update.groupMemberLabelAccessLevelChangeUpdate:type_name -> signal.backup.GroupMemberLabelAccessLevelChangeUpdate - 88, // 193: signal.backup.GroupChangeChatUpdate.Update.groupTerminateChangeUpdate:type_name -> signal.backup.GroupTerminateChangeUpdate - 164, // 194: signal.backup.ChatStyle.CustomChatColor.gradient:type_name -> signal.backup.ChatStyle.Gradient - 195, // [195:195] is the sub-list for method output_type - 195, // [195:195] is the sub-list for method input_type - 195, // [195:195] is the sub-list for extension type_name - 195, // [195:195] is the sub-list for extension extendee - 0, // [0:195] is the sub-list for field type_name + 33, // 0: signal.backup.Frame.account:type_name -> signal.backup.AccountData + 34, // 1: signal.backup.Frame.recipient:type_name -> signal.backup.Recipient + 39, // 2: signal.backup.Frame.chat:type_name -> signal.backup.Chat + 44, // 3: signal.backup.Frame.chatItem:type_name -> signal.backup.ChatItem + 107, // 4: signal.backup.Frame.stickerPack:type_name -> signal.backup.StickerPack + 41, // 5: signal.backup.Frame.adHocCall:type_name -> signal.backup.AdHocCall + 109, // 6: signal.backup.Frame.notificationProfile:type_name -> signal.backup.NotificationProfile + 110, // 7: signal.backup.Frame.chatFolder:type_name -> signal.backup.ChatFolder + 111, // 8: signal.backup.AccountData.usernameLink:type_name -> signal.backup.AccountData.UsernameLink + 113, // 9: signal.backup.AccountData.donationSubscriberData:type_name -> signal.backup.AccountData.SubscriberData + 112, // 10: signal.backup.AccountData.accountSettings:type_name -> signal.backup.AccountData.AccountSettings + 114, // 11: signal.backup.AccountData.backupsSubscriberData:type_name -> signal.backup.AccountData.IAPSubscriberData + 35, // 12: signal.backup.Recipient.contact:type_name -> signal.backup.Contact + 36, // 13: signal.backup.Recipient.group:type_name -> signal.backup.Group + 42, // 14: signal.backup.Recipient.distributionList:type_name -> signal.backup.DistributionListItem + 37, // 15: signal.backup.Recipient.self:type_name -> signal.backup.Self + 38, // 16: signal.backup.Recipient.releaseNotes:type_name -> signal.backup.ReleaseNotes + 40, // 17: signal.backup.Recipient.callLink:type_name -> signal.backup.CallLink + 5, // 18: signal.backup.Contact.visibility:type_name -> signal.backup.Contact.Visibility + 115, // 19: signal.backup.Contact.registered:type_name -> signal.backup.Contact.Registered + 116, // 20: signal.backup.Contact.notRegistered:type_name -> signal.backup.Contact.NotRegistered + 4, // 21: signal.backup.Contact.identityState:type_name -> signal.backup.Contact.IdentityState + 117, // 22: signal.backup.Contact.nickname:type_name -> signal.backup.Contact.Name + 0, // 23: signal.backup.Contact.avatarColor:type_name -> signal.backup.AvatarColor + 6, // 24: signal.backup.Group.storySendMode:type_name -> signal.backup.Group.StorySendMode + 118, // 25: signal.backup.Group.snapshot:type_name -> signal.backup.Group.GroupSnapshot + 0, // 26: signal.backup.Group.avatarColor:type_name -> signal.backup.AvatarColor + 0, // 27: signal.backup.Self.avatarColor:type_name -> signal.backup.AvatarColor + 108, // 28: signal.backup.Chat.style:type_name -> signal.backup.ChatStyle + 9, // 29: signal.backup.CallLink.restrictions:type_name -> signal.backup.CallLink.Restrictions + 10, // 30: signal.backup.AdHocCall.state:type_name -> signal.backup.AdHocCall.State + 43, // 31: signal.backup.DistributionListItem.distributionList:type_name -> signal.backup.DistributionList + 11, // 32: signal.backup.DistributionList.privacyMode:type_name -> signal.backup.DistributionList.PrivacyMode + 44, // 33: signal.backup.ChatItem.revisions:type_name -> signal.backup.ChatItem + 125, // 34: signal.backup.ChatItem.incoming:type_name -> signal.backup.ChatItem.IncomingMessageDetails + 126, // 35: signal.backup.ChatItem.outgoing:type_name -> signal.backup.ChatItem.OutgoingMessageDetails + 127, // 36: signal.backup.ChatItem.directionless:type_name -> signal.backup.ChatItem.DirectionlessMessageDetails + 47, // 37: signal.backup.ChatItem.standardMessage:type_name -> signal.backup.StandardMessage + 48, // 38: signal.backup.ChatItem.contactMessage:type_name -> signal.backup.ContactMessage + 54, // 39: signal.backup.ChatItem.stickerMessage:type_name -> signal.backup.StickerMessage + 55, // 40: signal.backup.ChatItem.remoteDeletedMessage:type_name -> signal.backup.RemoteDeletedMessage + 63, // 41: signal.backup.ChatItem.updateMessage:type_name -> signal.backup.ChatUpdateMessage + 50, // 42: signal.backup.ChatItem.paymentNotification:type_name -> signal.backup.PaymentNotification + 51, // 43: signal.backup.ChatItem.giftBadge:type_name -> signal.backup.GiftBadge + 52, // 44: signal.backup.ChatItem.viewOnceMessage:type_name -> signal.backup.ViewOnceMessage + 49, // 45: signal.backup.ChatItem.directStoryReplyMessage:type_name -> signal.backup.DirectStoryReplyMessage + 128, // 46: signal.backup.SendStatus.pending:type_name -> signal.backup.SendStatus.Pending + 129, // 47: signal.backup.SendStatus.sent:type_name -> signal.backup.SendStatus.Sent + 130, // 48: signal.backup.SendStatus.delivered:type_name -> signal.backup.SendStatus.Delivered + 131, // 49: signal.backup.SendStatus.read:type_name -> signal.backup.SendStatus.Read + 132, // 50: signal.backup.SendStatus.viewed:type_name -> signal.backup.SendStatus.Viewed + 133, // 51: signal.backup.SendStatus.skipped:type_name -> signal.backup.SendStatus.Skipped + 134, // 52: signal.backup.SendStatus.failed:type_name -> signal.backup.SendStatus.Failed + 61, // 53: signal.backup.Text.bodyRanges:type_name -> signal.backup.BodyRange + 60, // 54: signal.backup.StandardMessage.quote:type_name -> signal.backup.Quote + 46, // 55: signal.backup.StandardMessage.text:type_name -> signal.backup.Text + 58, // 56: signal.backup.StandardMessage.attachments:type_name -> signal.backup.MessageAttachment + 57, // 57: signal.backup.StandardMessage.linkPreview:type_name -> signal.backup.LinkPreview + 59, // 58: signal.backup.StandardMessage.longText:type_name -> signal.backup.FilePointer + 62, // 59: signal.backup.StandardMessage.reactions:type_name -> signal.backup.Reaction + 53, // 60: signal.backup.ContactMessage.contact:type_name -> signal.backup.ContactAttachment + 62, // 61: signal.backup.ContactMessage.reactions:type_name -> signal.backup.Reaction + 135, // 62: signal.backup.DirectStoryReplyMessage.textReply:type_name -> signal.backup.DirectStoryReplyMessage.TextReply + 62, // 63: signal.backup.DirectStoryReplyMessage.reactions:type_name -> signal.backup.Reaction + 136, // 64: signal.backup.PaymentNotification.transactionDetails:type_name -> signal.backup.PaymentNotification.TransactionDetails + 15, // 65: signal.backup.GiftBadge.state:type_name -> signal.backup.GiftBadge.State + 58, // 66: signal.backup.ViewOnceMessage.attachment:type_name -> signal.backup.MessageAttachment + 62, // 67: signal.backup.ViewOnceMessage.reactions:type_name -> signal.backup.Reaction + 140, // 68: signal.backup.ContactAttachment.name:type_name -> signal.backup.ContactAttachment.Name + 141, // 69: signal.backup.ContactAttachment.number:type_name -> signal.backup.ContactAttachment.Phone + 142, // 70: signal.backup.ContactAttachment.email:type_name -> signal.backup.ContactAttachment.Email + 143, // 71: signal.backup.ContactAttachment.address:type_name -> signal.backup.ContactAttachment.PostalAddress + 59, // 72: signal.backup.ContactAttachment.avatar:type_name -> signal.backup.FilePointer + 56, // 73: signal.backup.StickerMessage.sticker:type_name -> signal.backup.Sticker + 62, // 74: signal.backup.StickerMessage.reactions:type_name -> signal.backup.Reaction + 59, // 75: signal.backup.Sticker.data:type_name -> signal.backup.FilePointer + 59, // 76: signal.backup.LinkPreview.image:type_name -> signal.backup.FilePointer + 59, // 77: signal.backup.MessageAttachment.pointer:type_name -> signal.backup.FilePointer + 19, // 78: signal.backup.MessageAttachment.flag:type_name -> signal.backup.MessageAttachment.Flag + 144, // 79: signal.backup.FilePointer.locatorInfo:type_name -> signal.backup.FilePointer.LocatorInfo + 46, // 80: signal.backup.Quote.text:type_name -> signal.backup.Text + 145, // 81: signal.backup.Quote.attachments:type_name -> signal.backup.Quote.QuotedAttachment + 20, // 82: signal.backup.Quote.type:type_name -> signal.backup.Quote.Type + 21, // 83: signal.backup.BodyRange.style:type_name -> signal.backup.BodyRange.Style + 66, // 84: signal.backup.ChatUpdateMessage.simpleUpdate:type_name -> signal.backup.SimpleChatUpdate + 72, // 85: signal.backup.ChatUpdateMessage.groupChange:type_name -> signal.backup.GroupChangeChatUpdate + 67, // 86: signal.backup.ChatUpdateMessage.expirationTimerChange:type_name -> signal.backup.ExpirationTimerChatUpdate + 68, // 87: signal.backup.ChatUpdateMessage.profileChange:type_name -> signal.backup.ProfileChangeChatUpdate + 70, // 88: signal.backup.ChatUpdateMessage.threadMerge:type_name -> signal.backup.ThreadMergeChatUpdate + 71, // 89: signal.backup.ChatUpdateMessage.sessionSwitchover:type_name -> signal.backup.SessionSwitchoverChatUpdate + 64, // 90: signal.backup.ChatUpdateMessage.individualCall:type_name -> signal.backup.IndividualCall + 65, // 91: signal.backup.ChatUpdateMessage.groupCall:type_name -> signal.backup.GroupCall + 69, // 92: signal.backup.ChatUpdateMessage.learnedProfileChange:type_name -> signal.backup.LearnedProfileChatUpdate + 22, // 93: signal.backup.IndividualCall.type:type_name -> signal.backup.IndividualCall.Type + 23, // 94: signal.backup.IndividualCall.direction:type_name -> signal.backup.IndividualCall.Direction + 24, // 95: signal.backup.IndividualCall.state:type_name -> signal.backup.IndividualCall.State + 25, // 96: signal.backup.GroupCall.state:type_name -> signal.backup.GroupCall.State + 26, // 97: signal.backup.SimpleChatUpdate.type:type_name -> signal.backup.SimpleChatUpdate.Type + 146, // 98: signal.backup.GroupChangeChatUpdate.updates:type_name -> signal.backup.GroupChangeChatUpdate.Update + 1, // 99: signal.backup.GroupMembershipAccessLevelChangeUpdate.accessLevel:type_name -> signal.backup.GroupV2AccessLevel + 1, // 100: signal.backup.GroupAttributesAccessLevelChangeUpdate.accessLevel:type_name -> signal.backup.GroupV2AccessLevel + 147, // 101: signal.backup.GroupInvitationRevokedUpdate.invitees:type_name -> signal.backup.GroupInvitationRevokedUpdate.Invitee + 27, // 102: signal.backup.ChatStyle.wallpaperPreset:type_name -> signal.backup.ChatStyle.WallpaperPreset + 59, // 103: signal.backup.ChatStyle.wallpaperPhoto:type_name -> signal.backup.FilePointer + 150, // 104: signal.backup.ChatStyle.autoBubbleColor:type_name -> signal.backup.ChatStyle.AutomaticBubbleColor + 28, // 105: signal.backup.ChatStyle.bubbleColorPreset:type_name -> signal.backup.ChatStyle.BubbleColorPreset + 29, // 106: signal.backup.NotificationProfile.scheduleDaysEnabled:type_name -> signal.backup.NotificationProfile.DayOfWeek + 30, // 107: signal.backup.ChatFolder.folderType:type_name -> signal.backup.ChatFolder.FolderType + 3, // 108: signal.backup.AccountData.UsernameLink.color:type_name -> signal.backup.AccountData.UsernameLink.Color + 2, // 109: signal.backup.AccountData.AccountSettings.phoneNumberSharingMode:type_name -> signal.backup.AccountData.PhoneNumberSharingMode + 108, // 110: signal.backup.AccountData.AccountSettings.defaultChatStyle:type_name -> signal.backup.ChatStyle + 149, // 111: signal.backup.AccountData.AccountSettings.customChatColors:type_name -> signal.backup.ChatStyle.CustomChatColor + 119, // 112: signal.backup.Group.GroupSnapshot.title:type_name -> signal.backup.Group.GroupAttributeBlob + 119, // 113: signal.backup.Group.GroupSnapshot.description:type_name -> signal.backup.Group.GroupAttributeBlob + 119, // 114: signal.backup.Group.GroupSnapshot.disappearingMessagesTimer:type_name -> signal.backup.Group.GroupAttributeBlob + 124, // 115: signal.backup.Group.GroupSnapshot.accessControl:type_name -> signal.backup.Group.AccessControl + 120, // 116: signal.backup.Group.GroupSnapshot.members:type_name -> signal.backup.Group.Member + 121, // 117: signal.backup.Group.GroupSnapshot.membersPendingProfileKey:type_name -> signal.backup.Group.MemberPendingProfileKey + 122, // 118: signal.backup.Group.GroupSnapshot.membersPendingAdminApproval:type_name -> signal.backup.Group.MemberPendingAdminApproval + 123, // 119: signal.backup.Group.GroupSnapshot.members_banned:type_name -> signal.backup.Group.MemberBanned + 7, // 120: signal.backup.Group.Member.role:type_name -> signal.backup.Group.Member.Role + 120, // 121: signal.backup.Group.MemberPendingProfileKey.member:type_name -> signal.backup.Group.Member + 8, // 122: signal.backup.Group.AccessControl.attributes:type_name -> signal.backup.Group.AccessControl.AccessRequired + 8, // 123: signal.backup.Group.AccessControl.members:type_name -> signal.backup.Group.AccessControl.AccessRequired + 8, // 124: signal.backup.Group.AccessControl.addFromInviteLink:type_name -> signal.backup.Group.AccessControl.AccessRequired + 45, // 125: signal.backup.ChatItem.OutgoingMessageDetails.sendStatus:type_name -> signal.backup.SendStatus + 12, // 126: signal.backup.SendStatus.Failed.reason:type_name -> signal.backup.SendStatus.Failed.FailureReason + 46, // 127: signal.backup.DirectStoryReplyMessage.TextReply.text:type_name -> signal.backup.Text + 59, // 128: signal.backup.DirectStoryReplyMessage.TextReply.longText:type_name -> signal.backup.FilePointer + 139, // 129: signal.backup.PaymentNotification.TransactionDetails.transaction:type_name -> signal.backup.PaymentNotification.TransactionDetails.Transaction + 138, // 130: signal.backup.PaymentNotification.TransactionDetails.failedTransaction:type_name -> signal.backup.PaymentNotification.TransactionDetails.FailedTransaction + 13, // 131: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.reason:type_name -> signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.FailureReason + 14, // 132: signal.backup.PaymentNotification.TransactionDetails.Transaction.status:type_name -> signal.backup.PaymentNotification.TransactionDetails.Transaction.Status + 137, // 133: signal.backup.PaymentNotification.TransactionDetails.Transaction.mobileCoinIdentification:type_name -> signal.backup.PaymentNotification.TransactionDetails.MobileCoinTxoIdentification + 16, // 134: signal.backup.ContactAttachment.Phone.type:type_name -> signal.backup.ContactAttachment.Phone.Type + 17, // 135: signal.backup.ContactAttachment.Email.type:type_name -> signal.backup.ContactAttachment.Email.Type + 18, // 136: signal.backup.ContactAttachment.PostalAddress.type:type_name -> signal.backup.ContactAttachment.PostalAddress.Type + 58, // 137: signal.backup.Quote.QuotedAttachment.thumbnail:type_name -> signal.backup.MessageAttachment + 73, // 138: signal.backup.GroupChangeChatUpdate.Update.genericGroupUpdate:type_name -> signal.backup.GenericGroupUpdate + 74, // 139: signal.backup.GroupChangeChatUpdate.Update.groupCreationUpdate:type_name -> signal.backup.GroupCreationUpdate + 75, // 140: signal.backup.GroupChangeChatUpdate.Update.groupNameUpdate:type_name -> signal.backup.GroupNameUpdate + 76, // 141: signal.backup.GroupChangeChatUpdate.Update.groupAvatarUpdate:type_name -> signal.backup.GroupAvatarUpdate + 77, // 142: signal.backup.GroupChangeChatUpdate.Update.groupDescriptionUpdate:type_name -> signal.backup.GroupDescriptionUpdate + 78, // 143: signal.backup.GroupChangeChatUpdate.Update.groupMembershipAccessLevelChangeUpdate:type_name -> signal.backup.GroupMembershipAccessLevelChangeUpdate + 79, // 144: signal.backup.GroupChangeChatUpdate.Update.groupAttributesAccessLevelChangeUpdate:type_name -> signal.backup.GroupAttributesAccessLevelChangeUpdate + 80, // 145: signal.backup.GroupChangeChatUpdate.Update.groupAnnouncementOnlyChangeUpdate:type_name -> signal.backup.GroupAnnouncementOnlyChangeUpdate + 81, // 146: signal.backup.GroupChangeChatUpdate.Update.groupAdminStatusUpdate:type_name -> signal.backup.GroupAdminStatusUpdate + 82, // 147: signal.backup.GroupChangeChatUpdate.Update.groupMemberLeftUpdate:type_name -> signal.backup.GroupMemberLeftUpdate + 83, // 148: signal.backup.GroupChangeChatUpdate.Update.groupMemberRemovedUpdate:type_name -> signal.backup.GroupMemberRemovedUpdate + 84, // 149: signal.backup.GroupChangeChatUpdate.Update.selfInvitedToGroupUpdate:type_name -> signal.backup.SelfInvitedToGroupUpdate + 85, // 150: signal.backup.GroupChangeChatUpdate.Update.selfInvitedOtherUserToGroupUpdate:type_name -> signal.backup.SelfInvitedOtherUserToGroupUpdate + 86, // 151: signal.backup.GroupChangeChatUpdate.Update.groupUnknownInviteeUpdate:type_name -> signal.backup.GroupUnknownInviteeUpdate + 87, // 152: signal.backup.GroupChangeChatUpdate.Update.groupInvitationAcceptedUpdate:type_name -> signal.backup.GroupInvitationAcceptedUpdate + 88, // 153: signal.backup.GroupChangeChatUpdate.Update.groupInvitationDeclinedUpdate:type_name -> signal.backup.GroupInvitationDeclinedUpdate + 89, // 154: signal.backup.GroupChangeChatUpdate.Update.groupMemberJoinedUpdate:type_name -> signal.backup.GroupMemberJoinedUpdate + 90, // 155: signal.backup.GroupChangeChatUpdate.Update.groupMemberAddedUpdate:type_name -> signal.backup.GroupMemberAddedUpdate + 91, // 156: signal.backup.GroupChangeChatUpdate.Update.groupSelfInvitationRevokedUpdate:type_name -> signal.backup.GroupSelfInvitationRevokedUpdate + 92, // 157: signal.backup.GroupChangeChatUpdate.Update.groupInvitationRevokedUpdate:type_name -> signal.backup.GroupInvitationRevokedUpdate + 93, // 158: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestUpdate:type_name -> signal.backup.GroupJoinRequestUpdate + 94, // 159: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestApprovalUpdate:type_name -> signal.backup.GroupJoinRequestApprovalUpdate + 95, // 160: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestCanceledUpdate:type_name -> signal.backup.GroupJoinRequestCanceledUpdate + 97, // 161: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkResetUpdate:type_name -> signal.backup.GroupInviteLinkResetUpdate + 98, // 162: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkEnabledUpdate:type_name -> signal.backup.GroupInviteLinkEnabledUpdate + 99, // 163: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkAdminApprovalUpdate:type_name -> signal.backup.GroupInviteLinkAdminApprovalUpdate + 100, // 164: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkDisabledUpdate:type_name -> signal.backup.GroupInviteLinkDisabledUpdate + 101, // 165: signal.backup.GroupChangeChatUpdate.Update.groupMemberJoinedByLinkUpdate:type_name -> signal.backup.GroupMemberJoinedByLinkUpdate + 102, // 166: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationUpdate:type_name -> signal.backup.GroupV2MigrationUpdate + 103, // 167: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationSelfInvitedUpdate:type_name -> signal.backup.GroupV2MigrationSelfInvitedUpdate + 104, // 168: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationInvitedMembersUpdate:type_name -> signal.backup.GroupV2MigrationInvitedMembersUpdate + 105, // 169: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationDroppedMembersUpdate:type_name -> signal.backup.GroupV2MigrationDroppedMembersUpdate + 96, // 170: signal.backup.GroupChangeChatUpdate.Update.groupSequenceOfRequestsAndCancelsUpdate:type_name -> signal.backup.GroupSequenceOfRequestsAndCancelsUpdate + 106, // 171: signal.backup.GroupChangeChatUpdate.Update.groupExpirationTimerUpdate:type_name -> signal.backup.GroupExpirationTimerUpdate + 148, // 172: signal.backup.ChatStyle.CustomChatColor.gradient:type_name -> signal.backup.ChatStyle.Gradient + 173, // [173:173] is the sub-list for method output_type + 173, // [173:173] is the sub-list for method input_type + 173, // [173:173] is the sub-list for extension type_name + 173, // [173:173] is the sub-list for extension extendee + 0, // [0:173] is the sub-list for field type_name } func init() { file_backuppb_Backup_proto_init() } @@ -13859,8 +12572,6 @@ func file_backuppb_Backup_proto_init() { (*ChatItem_GiftBadge)(nil), (*ChatItem_ViewOnceMessage)(nil), (*ChatItem_DirectStoryReplyMessage)(nil), - (*ChatItem_Poll)(nil), - (*ChatItem_AdminDeletedMessage)(nil), } file_backuppb_Backup_proto_msgTypes[14].OneofWrappers = []any{ (*SendStatus_Pending_)(nil), @@ -13887,7 +12598,7 @@ func file_backuppb_Backup_proto_init() { (*BodyRange_MentionAci)(nil), (*BodyRange_Style_)(nil), } - file_backuppb_Backup_proto_msgTypes[34].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[32].OneofWrappers = []any{ (*ChatUpdateMessage_SimpleUpdate)(nil), (*ChatUpdateMessage_GroupChange)(nil), (*ChatUpdateMessage_ExpirationTimerChange)(nil), @@ -13897,15 +12608,15 @@ func file_backuppb_Backup_proto_init() { (*ChatUpdateMessage_IndividualCall)(nil), (*ChatUpdateMessage_GroupCall)(nil), (*ChatUpdateMessage_LearnedProfileChange)(nil), - (*ChatUpdateMessage_PollTerminate)(nil), - (*ChatUpdateMessage_PinMessage)(nil), } - file_backuppb_Backup_proto_msgTypes[35].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[36].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[40].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[33].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[34].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[38].OneofWrappers = []any{ (*LearnedProfileChatUpdate_E164)(nil), (*LearnedProfileChatUpdate_Username)(nil), } + file_backuppb_Backup_proto_msgTypes[42].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[43].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[44].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[45].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[46].OneofWrappers = []any{} @@ -13913,59 +12624,51 @@ func file_backuppb_Backup_proto_init() { file_backuppb_Backup_proto_msgTypes[48].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[49].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[50].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[51].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[52].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[53].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[54].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[55].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[56].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[57].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[59].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[60].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[61].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[63].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[64].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[65].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[66].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[67].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[70].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[71].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[72].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[73].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[79].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[83].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[68].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[69].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[75].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[77].OneofWrappers = []any{ (*ChatStyle_WallpaperPreset_)(nil), (*ChatStyle_WallpaperPhoto)(nil), (*ChatStyle_AutoBubbleColor)(nil), (*ChatStyle_BubbleColorPreset_)(nil), (*ChatStyle_CustomColorId)(nil), } - file_backuppb_Backup_proto_msgTypes[84].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[88].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[90].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[78].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[81].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[83].OneofWrappers = []any{ (*AccountData_IAPSubscriberData_PurchaseToken)(nil), (*AccountData_IAPSubscriberData_OriginalTransactionId)(nil), } - file_backuppb_Backup_proto_msgTypes[96].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[88].OneofWrappers = []any{ (*Group_GroupAttributeBlob_Title)(nil), (*Group_GroupAttributeBlob_Avatar)(nil), (*Group_GroupAttributeBlob_DisappearingMessagesDuration)(nil), (*Group_GroupAttributeBlob_DescriptionText)(nil), } - file_backuppb_Backup_proto_msgTypes[102].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[94].OneofWrappers = []any{} file_backuppb_Backup_proto_msgTypes[105].OneofWrappers = []any{ - (*ChatItem_PinDetails_PinExpiresAtTimestamp)(nil), - (*ChatItem_PinDetails_PinNeverExpires)(nil), - } - file_backuppb_Backup_proto_msgTypes[114].OneofWrappers = []any{ (*PaymentNotification_TransactionDetails_Transaction_)(nil), (*PaymentNotification_TransactionDetails_FailedTransaction_)(nil), } - file_backuppb_Backup_proto_msgTypes[117].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[122].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[108].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[113].OneofWrappers = []any{ (*FilePointer_LocatorInfo_PlaintextHash)(nil), (*FilePointer_LocatorInfo_EncryptedDigest)(nil), } - file_backuppb_Backup_proto_msgTypes[123].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[126].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[114].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[115].OneofWrappers = []any{ (*GroupChangeChatUpdate_Update_GenericGroupUpdate)(nil), (*GroupChangeChatUpdate_Update_GroupCreationUpdate)(nil), (*GroupChangeChatUpdate_Update_GroupNameUpdate)(nil), @@ -14000,11 +12703,9 @@ func file_backuppb_Backup_proto_init() { (*GroupChangeChatUpdate_Update_GroupV2MigrationDroppedMembersUpdate)(nil), (*GroupChangeChatUpdate_Update_GroupSequenceOfRequestsAndCancelsUpdate)(nil), (*GroupChangeChatUpdate_Update_GroupExpirationTimerUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupMemberLabelAccessLevelChangeUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupTerminateChangeUpdate)(nil), } - file_backuppb_Backup_proto_msgTypes[127].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[129].OneofWrappers = []any{ + file_backuppb_Backup_proto_msgTypes[116].OneofWrappers = []any{} + file_backuppb_Backup_proto_msgTypes[118].OneofWrappers = []any{ (*ChatStyle_CustomChatColor_Solid)(nil), (*ChatStyle_CustomChatColor_Gradient)(nil), } @@ -14013,8 +12714,8 @@ func file_backuppb_Backup_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_backuppb_Backup_proto_rawDesc), len(file_backuppb_Backup_proto_rawDesc)), - NumEnums: 36, - NumMessages: 131, + NumEnums: 31, + NumMessages: 120, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/signalmeow/protobuf/backuppb/Backup.proto b/pkg/signalmeow/protobuf/backuppb/Backup.proto index d7407cb..464301d 100644 --- a/pkg/signalmeow/protobuf/backuppb/Backup.proto +++ b/pkg/signalmeow/protobuf/backuppb/Backup.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package signal.backup; -option java_package = "org.signal.archive.proto"; +option java_package = "org.thoughtcrime.securesms.backup.v2.proto"; option swift_prefix = "BackupProto_"; message BackupInfo { @@ -68,40 +68,6 @@ message AccountData { Color color = 3; } - enum SentMediaQuality { - UNKNOWN_QUALITY = 0; // Interpret as "Standard" - STANDARD = 1; - HIGH = 2; - } - - message AutoDownloadSettings { - enum AutoDownloadOption { - UNKNOWN = 0; // Interpret as "Never" - NEVER = 1; - WIFI = 2; - WIFI_AND_CELLULAR = 3; - } - - AutoDownloadOption images = 1; - AutoDownloadOption audio = 2; - AutoDownloadOption video = 3; - AutoDownloadOption documents = 4; - } - - enum AppTheme { - UNKNOWN_APP_THEME = 0; // Interpret as "System" - SYSTEM = 1; - LIGHT = 2; - DARK = 3; - } - - enum CallsUseLessDataSetting { - UNKNOWN_CALL_DATA_SETTING = 0; // Interpret as "Never" - NEVER = 1; - MOBILE_DATA_ONLY = 2; - WIFI_AND_MOBILE_DATA = 3; - } - message AccountSettings { bool readReceipts = 1; bool sealedSenderIndicators = 2; @@ -125,17 +91,6 @@ message AccountData { bool optimizeOnDeviceStorage = 20; // See zkgroup for integer particular values. Unset if backups are not enabled. optional uint64 backupTier = 21; - reserved /* showSealedSenderIndicators */ 22; - SentMediaQuality defaultSentMediaQuality = 23; - AutoDownloadSettings autoDownloadSettings = 24; - reserved /* wifiAutoDownloadSettings */ 25; - optional uint32 screenLockTimeoutMinutes = 26; // If unset, consider screen lock to be disabled. - optional bool pinReminders = 27; // If unset, consider pin reminders to be enabled. - AppTheme appTheme = 28; // If unset, treat the same as "Unknown" case - CallsUseLessDataSetting callsUseLessDataSetting = 29; // If unset, treat the same as "Unknown" case - bool allowSealedSenderFromAnyone = 30; - bool allowAutomaticKeyVerification = 31; - bool hasSeenAdminDeleteEducationDialog = 32; } message SubscriberData { @@ -156,18 +111,6 @@ message AccountData { } } - message AndroidSpecificSettings { - enum NavigationBarSize { - UNKNOWN_BAR_SIZE = 0; // Intepret as "Normal" - NORMAL = 1; - COMPACT = 2; - } - - bool useSystemEmoji = 1; - bool screenshotSecurity = 2; - NavigationBarSize navigationBarSize = 3; // If unset, treat the same as "Unknown" case - } - bytes profileKey = 1; optional string username = 2; UsernameLink usernameLink = 3; @@ -179,10 +122,6 @@ message AccountData { AccountSettings accountSettings = 9; IAPSubscriberData backupsSubscriberData = 10; string svrPin = 11; - AndroidSpecificSettings androidSpecificSettings = 12; - string bioText = 13; - string bioEmoji = 14; - optional bytes keyTransparencyData = 15; } message Recipient { @@ -271,7 +210,6 @@ message Contact { string systemFamilyName = 19; string systemNickname = 20; optional AvatarColor avatarColor = 21; - optional bytes keyTransparencyData = 22; } message Group { @@ -308,7 +246,6 @@ message Group { bytes inviteLinkPassword = 10; bool announcements_only = 12; repeated MemberBanned members_banned = 13; - bool terminated = 14; } message GroupAttributeBlob { @@ -333,8 +270,6 @@ message Group { reserved /*profileKey*/ 3; // This field is ignored in Backups, in favor of Contact frames for members reserved /*presentation*/ 4; // This field is deprecated in the context of static group state uint32 joinedAtVersion = 5; - string labelEmoji = 6; - string labelString = 7; } message MemberPendingProfileKey { @@ -367,7 +302,6 @@ message Group { AccessRequired attributes = 1; AccessRequired members = 2; AccessRequired addFromInviteLink = 3; - AccessRequired memberLabel = 4; } } @@ -410,7 +344,7 @@ message CallLink { string name = 3; Restrictions restrictions = 4; uint64 expirationMs = 5; - reserved /*epoch*/ 6; + optional bytes epoch = 6; // May be absent/empty for older links } message AdHocCall { @@ -468,14 +402,6 @@ message ChatItem { message DirectionlessMessageDetails { } - message PinDetails { - uint64 pinnedAtTimestamp = 1; - oneof pinExpiry { - uint64 pinExpiresAtTimestamp = 2; // timestamp when the pin should expire - bool pinNeverExpires = 3; - } - } - uint64 chatId = 1; // conversation id uint64 authorId = 2; // recipient id uint64 dateSent = 3; @@ -502,11 +428,7 @@ message ChatItem { GiftBadge giftBadge = 17; ViewOnceMessage viewOnceMessage = 18; DirectStoryReplyMessage directStoryReplyMessage = 19; // group story reply messages are not backed up - Poll poll = 20; - AdminDeletedMessage adminDeletedMessage = 22; } - - PinDetails pinDetails = 21; // only set if message is pinned } message SendStatus { @@ -837,7 +759,6 @@ message Quote { NORMAL = 1; GIFT_BADGE = 2; VIEW_ONCE = 3; - POLL = 4; } message QuotedAttachment { @@ -884,30 +805,6 @@ message Reaction { uint64 sortOrder = 4; } -message Poll { - - message PollOption { - - message PollVote { - uint64 voterId = 1; // A direct reference to Recipient proto id. Must be self or contact. - uint32 voteCount = 2; // Tracks how many times you voted. - } - - string option = 1; // Between 1-100 characters - repeated PollVote votes = 2; - } - - string question = 1; // Between 1-100 characters - bool allowMultiple = 2; - repeated PollOption options = 3; // At least two - bool hasEnded = 4; - repeated Reaction reactions = 5; -} - -message AdminDeletedMessage { - uint64 adminId = 1; // id of the admin that deleted the message -} - message ChatUpdateMessage { // If unset, importers should ignore the update message without throwing an error. oneof update { @@ -920,8 +817,6 @@ message ChatUpdateMessage { IndividualCall individualCall = 7; GroupCall groupCall = 8; LearnedProfileChatUpdate learnedProfileChange = 9; - PollTerminateUpdate pollTerminate = 10; - PinMessageUpdate pinMessage = 11; } } @@ -1078,8 +973,6 @@ message GroupChangeChatUpdate { GroupV2MigrationDroppedMembersUpdate groupV2MigrationDroppedMembersUpdate = 32; GroupSequenceOfRequestsAndCancelsUpdate groupSequenceOfRequestsAndCancelsUpdate = 33; GroupExpirationTimerUpdate groupExpirationTimerUpdate = 34; - GroupMemberLabelAccessLevelChangeUpdate groupMemberLabelAccessLevelChangeUpdate = 35; - GroupTerminateChangeUpdate groupTerminateChangeUpdate = 36; } } @@ -1131,15 +1024,6 @@ message GroupAttributesAccessLevelChangeUpdate { GroupV2AccessLevel accessLevel = 2; } -message GroupMemberLabelAccessLevelChangeUpdate { - optional bytes updaterAci = 1; - GroupV2AccessLevel accessLevel = 2; -} - -message GroupTerminateChangeUpdate { - optional bytes updaterAci = 1; -} - message GroupAnnouncementOnlyChangeUpdate { optional bytes updaterAci = 1; bool isAnnouncementOnly = 2; @@ -1298,16 +1182,6 @@ message GroupExpirationTimerUpdate { optional bytes updaterAci = 2; } -message PollTerminateUpdate { - uint64 targetSentTimestamp = 1; - string question = 2; // Between 1-100 characters -} - -message PinMessageUpdate { - uint64 targetSentTimestamp = 1; - uint64 authorId = 2; // recipient id -} - message StickerPack { bytes packId = 1; bytes packKey = 2; diff --git a/pkg/signalmeow/protobuf/update-protos.sh b/pkg/signalmeow/protobuf/update-protos.sh index f9c86fc..bcdd71b 100755 --- a/pkg/signalmeow/protobuf/update-protos.sh +++ b/pkg/signalmeow/protobuf/update-protos.sh @@ -1,19 +1,19 @@ #!/bin/bash set -euo pipefail -ANDROID_GIT_REVISION=${1:-439760e7732585bfd078d92d93732c04cc31e29e} -DESKTOP_GIT_REVISION=${1:-1b2a3e7b283c32c5654a39da12fc04139fd26dbd} +ANDROID_GIT_REVISION=${1:-62fdf3d1aa9f637729ae67b55aadcc24f38f0117} +DESKTOP_GIT_REVISION=${1:-203a1cc5e3f9c1533a58caff72e13aa6eaeeddc7} update_proto() { case "$1" in Signal-Android) REPO="Signal-Android" - prefix="lib/libsignal-service/src/main/protowire/" + prefix="libsignal-service/src/main/protowire/" GIT_REVISION=$ANDROID_GIT_REVISION ;; - Signal-Android-Archive) + Signal-Android-App) REPO="Signal-Android" - prefix="lib/archive/src/main/protowire/" + prefix="app/src/main/protowire/" GIT_REVISION=$ANDROID_GIT_REVISION ;; Signal-Desktop) @@ -34,10 +34,10 @@ update_proto Signal-Android StickerResources.proto update_proto Signal-Android WebSocketResources.proto update_proto Signal-Android StorageService.proto -update_proto Signal-Android-Archive Backup.proto +update_proto Signal-Android-App Backup.proto mv Backup.proto backuppb/Backup.proto update_proto Signal-Desktop DeviceName.proto -# TODO these were moved to libsignal only -#update_proto Signal-Desktop UnidentifiedDelivery.proto -#update_proto Signal-Desktop ContactDiscovery.proto +update_proto Signal-Desktop UnidentifiedDelivery.proto +# Android has CDSI.proto too, but the types have more generic names (since android uses a different package name) +update_proto Signal-Desktop ContactDiscovery.proto diff --git a/pkg/signalmeow/provisioning.go b/pkg/signalmeow/provisioning.go index 8e0fa96..8e87738 100644 --- a/pkg/signalmeow/provisioning.go +++ b/pkg/signalmeow/provisioning.go @@ -18,10 +18,11 @@ package signalmeow import ( "context" + "crypto/hmac" "encoding/base64" "encoding/json" "fmt" - mrand "math/rand/v2" + mrand "math/rand" "net/http" "net/url" "time" @@ -53,6 +54,7 @@ const ( StateProvisioningError ProvisioningState = iota StateProvisioningURLReceived StateProvisioningDataReceived + StateProvisioningPreKeysRegistered ) func (s ProvisioningState) String() string { @@ -63,6 +65,8 @@ func (s ProvisioningState) String() string { return "StateProvisioningURLReceived" case StateProvisioningDataReceived: return "StateProvisioningDataReceived" + case StateProvisioningPreKeysRegistered: + return "StateProvisioningPreKeysRegistered" default: return fmt.Sprintf("ProvisioningState(%d)", s) } @@ -124,8 +128,8 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev username := *provisioningMessage.Number password := random.String(22) code := provisioningMessage.ProvisioningCode - aciRegistrationID := mrand.IntN(16383) + 1 - pniRegistrationID := mrand.IntN(16383) + 1 + aciRegistrationID := mrand.Intn(16383) + 1 + pniRegistrationID := mrand.Intn(16383) + 1 aciSignedPreKey := GenerateSignedPreKey(1, aciIdentityKeyPair) pniSignedPreKey := GenerateSignedPreKey(1, pniIdentityKeyPair) aciPQLastResortPreKey := GenerateKyberPreKeys(1, 1, aciIdentityKeyPair)[0] @@ -165,19 +169,24 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev DeviceID: deviceId, Number: *provisioningMessage.Number, Password: password, + MasterKey: provisioningMessage.GetMasterKey(), AccountEntropyPool: libsignalgo.AccountEntropyPool(provisioningMessage.GetAccountEntropyPool()), EphemeralBackupKey: libsignalgo.BytesToBackupKey(provisioningMessage.GetEphemeralBackupKey()), MediaRootBackupKey: libsignalgo.BytesToBackupKey(provisioningMessage.GetMediaRootBackupKey()), } if provisioningMessage.GetAccountEntropyPool() != "" { - data.MasterKey, err = libsignalgo.AccountEntropyPool(provisioningMessage.GetAccountEntropyPool()).DeriveSVRKey() + var masterKey []byte + masterKey, err = libsignalgo.AccountEntropyPool(provisioningMessage.GetAccountEntropyPool()).DeriveSVRKey() if err != nil { log.Err(err).Msg("Failed to derive master key from account entropy pool") } else { log.Debug().Msg("Derived master key from account entropy pool") } - } else { - log.Warn().Msg("No account entropy pool in provisioning message") + if data.MasterKey == nil { + data.MasterKey = masterKey + } else if !hmac.Equal(data.MasterKey, masterKey) { + log.Warn().Msg("Master key mismatch") + } } // Store the provisioning data @@ -241,6 +250,28 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev // Return the provisioning data c <- ProvisioningResponse{State: StateProvisioningDataReceived, ProvisioningData: data} + + // Generate, store, and register prekeys + // TODO hacky client construction + cli := &Client{Store: device} + err = cli.GenerateAndRegisterPreKeys(ctx, device.ACIPreKeyStore) + if err != nil { + c <- ProvisioningResponse{ + State: StateProvisioningError, + Err: fmt.Errorf("error generating and registering ACI prekeys: %w", err), + } + return + } + err = cli.GenerateAndRegisterPreKeys(ctx, device.PNIPreKeyStore) + if err != nil { + c <- ProvisioningResponse{ + State: StateProvisioningError, + Err: fmt.Errorf("error generating and registering PNI prekeys: %w", err), + } + return + } + + c <- ProvisioningResponse{State: StateProvisioningPreKeysRegistered} }() return c } @@ -268,7 +299,7 @@ func startProvisioning(ctx context.Context, ws *websocket.Conn, provisioningCiph return "", fmt.Errorf("failed to unmarshal provisioning UUID: %w", err) } - linkCapabilities := []string{"backup4,backup5"} + linkCapabilities := []string{"backup4", "backup5"} if !allowBackup { linkCapabilities = []string{} } @@ -335,19 +366,36 @@ var signalCapabilities = map[string]any{ var signalCapabilitiesBody = exerrors.Must(json.Marshal(signalCapabilities)) func (cli *Client) RegisterCapabilities(ctx context.Context) error { - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodPut, "/v1/devices/capabilities", signalCapabilitiesBody, nil) + username, password := cli.Store.BasicAuthCreds() + resp, err := web.SendHTTPRequest(ctx, http.MethodPut, "/v1/devices/capabilities", &web.HTTPReqOpt{ + Body: signalCapabilitiesBody, + Username: &username, + Password: &password, + ContentType: web.ContentTypeJSON, + }) + if resp != nil { + _ = resp.Body.Close() + } if err != nil { return err + } else if resp.StatusCode >= 400 { + return fmt.Errorf("unexpected status code %d", resp.StatusCode) } - return web.DecodeWSResponseBody(ctx, nil, resp) + return nil } func (cli *Client) Unlink(ctx context.Context) error { - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodDelete, fmt.Sprintf("/v1/devices/%d", cli.Store.DeviceID), nil, nil) + username, password := cli.Store.BasicAuthCreds() + resp, err := web.SendHTTPRequest(ctx, http.MethodDelete, fmt.Sprintf("/v1/devices/%d", cli.Store.DeviceID), &web.HTTPReqOpt{ + Username: &username, + Password: &password, + }) if err != nil { return err + } else if resp.StatusCode >= 400 { + return fmt.Errorf("unexpected status code %d", resp.StatusCode) } - return web.DecodeWSResponseBody(ctx, nil, resp) + return nil } func confirmDevice( diff --git a/pkg/signalmeow/pushreg.go b/pkg/signalmeow/pushreg.go index 79d0318..fe45785 100644 --- a/pkg/signalmeow/pushreg.go +++ b/pkg/signalmeow/pushreg.go @@ -19,9 +19,9 @@ package signalmeow import ( "context" "encoding/json" + "fmt" "net/http" - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) @@ -36,21 +36,30 @@ type ReqRegisterAPNs struct { } func (cli *Client) registerPush(ctx context.Context, pushType string, data any) error { - var resp *signalpb.WebSocketResponseMessage - var err error + username, password := cli.Store.BasicAuthCreds() + req := &web.HTTPReqOpt{ + Username: &username, + Password: &password, + } + var method string if data != nil { - body, err := json.Marshal(data) + method = http.MethodPut + req.ContentType = web.ContentTypeJSON + var err error + req.Body, err = json.Marshal(data) if err != nil { return err } - resp, err = cli.AuthedWS.SendRequest(ctx, http.MethodPut, "/v1/accounts/"+pushType, body, nil) } else { - resp, err = cli.AuthedWS.SendRequest(ctx, http.MethodDelete, "/v1/accounts/"+pushType, nil, nil) + method = http.MethodDelete } + resp, err := web.SendHTTPRequest(ctx, method, "/v1/accounts/"+pushType, req) if err != nil { return err + } else if resp.StatusCode >= 300 || resp.StatusCode < 200 { + return fmt.Errorf("unexpected status code %d", resp.StatusCode) } - return web.DecodeWSResponseBody(ctx, nil, resp) + return nil } func (cli *Client) RegisterFCM(ctx context.Context, token string) error { diff --git a/pkg/signalmeow/receiving.go b/pkg/signalmeow/receiving.go index 6b92d04..d630386 100644 --- a/pkg/signalmeow/receiving.go +++ b/pkg/signalmeow/receiving.go @@ -29,7 +29,6 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/util/ptr" "google.golang.org/protobuf/proto" "go.mau.fi/mautrix-signal/pkg/libsignalgo" @@ -250,39 +249,32 @@ func (cli *Client) StartReceiveLoops(ctx context.Context) (chan SignalConnection cli.loopWg.Add(1) go func() { defer cli.loopWg.Done() - select { - case <-loopCtx.Done(): - return - case <-initialConnectChan: - log.Info().Msg("Both websockets connected, sending contacts sync request") - err = cli.RegisterCapabilities(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to register capabilities") - } else { - zerolog.Ctx(ctx).Debug().Msg("Successfully registered capabilities") - } - // Start loop to check for and upload more prekeys - cli.loopWg.Add(1) - go func() { - defer cli.loopWg.Done() - cli.keyCheckLoop(loopCtx) - }() - // TODO hacky - if cli.SyncContactsOnConnect { - cli.SendContactSyncRequest(loopCtx) - } - if cli.Store.MasterKey == nil { - cli.SendStorageMasterKeyRequest(loopCtx) + for { + select { + case <-loopCtx.Done(): + return + case <-initialConnectChan: + log.Info().Msg("Both websockets connected, sending contacts sync request") + // TODO hacky + if cli.SyncContactsOnConnect { + cli.SendContactSyncRequest(loopCtx) + } + if cli.Store.MasterKey == nil { + cli.SendStorageMasterKeyRequest(loopCtx) + } + return } } }() - return statusChan, nil -} + // Start loop to check for and upload more prekeys + cli.loopWg.Add(1) + go func() { + defer cli.loopWg.Done() + cli.keyCheckLoop(loopCtx) + }() -func (cli *Client) ForceReconnect() { - cli.AuthedWS.ForceReconnect() - cli.UnauthedWS.ForceReconnect() + return statusChan, nil } func (cli *Client) StopReceiveLoops() error { @@ -357,25 +349,21 @@ func (cli *Client) incomingAPIMessageHandler(ctx context.Context, req *signalpb. return nil, err } log = log.With(). - Uint64("envelope_timestamp", envelope.GetClientTimestamp()). + Uint64("envelope_timestamp", envelope.GetTimestamp()). Uint64("server_timestamp", envelope.GetServerTimestamp()). Logger() ctx = log.WithContext(ctx) - destinationServiceID, _ := ParseStringOrBinaryServiceID(envelope.GetDestinationServiceId(), envelope.GetDestinationServiceIdBinary()) - sourceServiceID, _ := ParseStringOrBinaryServiceID(envelope.GetSourceServiceId(), envelope.GetSourceServiceIdBinary()) + destinationServiceID, err := libsignalgo.ServiceIDFromString(envelope.GetDestinationServiceId()) log.Debug(). Str("destination_service_id", envelope.GetDestinationServiceId()). Str("source_service_id", envelope.GetSourceServiceId()). - Hex("destination_service_id_bytes", envelope.GetDestinationServiceIdBinary()). - Hex("source_service_id_bytes", envelope.GetSourceServiceIdBinary()). - Uint32("source_device_id", envelope.GetSourceDeviceId()). + Uint32("source_device_id", envelope.GetSourceDevice()). Object("parsed_destination_service_id", destinationServiceID). - Object("parsed_source_service_id", sourceServiceID). Int32("envelope_type_id", int32(envelope.GetType())). Str("envelope_type", signalpb.Envelope_Type_name[int32(envelope.GetType())]). Msg("Received envelope") - result := cli.decryptEnvelope(ctx, envelope, sourceServiceID, destinationServiceID) + result := cli.decryptEnvelope(ctx, envelope) err = cli.handleDecryptedResult(ctx, result, envelope, destinationServiceID) if err != nil { @@ -407,7 +395,7 @@ func (cli *Client) handleDecryptedResult( result DecryptionResult, envelope *signalpb.Envelope, destinationServiceID libsignalgo.ServiceID, -) (retErr error) { +) error { if errors.Is(result.Err, context.Canceled) { return result.Err } else if ctx.Err() != nil { @@ -429,58 +417,37 @@ func (cli *Client) handleDecryptedResult( }() } - var theirServiceID libsignalgo.ServiceID - var err error - if result.SenderAddress == nil { - log.Err(result.Err). - Bool("urgent", envelope.GetUrgent()). - Stringer("content_hint", result.ContentHint). - Uint64("server_ts", envelope.GetServerTimestamp()). - Uint64("client_ts", envelope.GetClientTimestamp()). - Msg("No sender address received") - return nil - } else if theirServiceID, err = result.SenderAddress.NameServiceID(); err != nil { - log.Warn(). - Uint64("server_ts", envelope.GetServerTimestamp()). - Uint64("client_ts", envelope.GetClientTimestamp()). - Msg("Failed to get sender name as service ID") - return fmt.Errorf("failed to get sender name as service ID: %w", err) - } else if theirServiceID.Type != libsignalgo.ServiceIDTypeACI { - log.Warn(). - Any("their_service_id", theirServiceID). - Uint64("server_ts", envelope.GetServerTimestamp()). - Uint64("client_ts", envelope.GetClientTimestamp()). - Msg("Dropping message from non-ACI sender") - return nil - } - cli.Store.RecipientStore.MarkUnregistered(ctx, theirServiceID, false) - handlerSuccess := true - defer func() { - if retErr == nil && !handlerSuccess { - retErr = ErrHandlerFailed - } - }() // result.Err is set if there was an error during decryption and we // should notifiy the user that the message could not be decrypted if result.Err != nil { + logEvt := log.Err(result.Err). + Bool("urgent", envelope.GetUrgent()). + Stringer("content_hint", result.ContentHint). + Uint64("server_ts", envelope.GetServerTimestamp()). + Uint64("client_ts", envelope.GetTimestamp()) + if result.SenderAddress == nil { + logEvt.Msg("Decryption error with unknown sender") + return nil + } + theirServiceID, err := result.SenderAddress.NameServiceID() + if err != nil { + log.Err(err).Msg("Name error handling decryption error") + } else if theirServiceID.Type != libsignalgo.ServiceIDTypeACI { + log.Warn().Any("their_service_id", theirServiceID).Msg("Sender ServiceID is not an ACI") + } if errors.Is(result.Err, EventAlreadyProcessed) { + logEvt.Discard().Msg("") log.Debug().Err(result.Err). Bool("urgent", envelope.GetUrgent()). Stringer("content_hint", result.ContentHint). Uint64("server_ts", envelope.GetServerTimestamp()). - Uint64("client_ts", envelope.GetClientTimestamp()). + Uint64("client_ts", envelope.GetTimestamp()). Stringer("sender", theirServiceID). Msg("Ignoring already processed event") return nil } - log.Err(result.Err). - Bool("urgent", envelope.GetUrgent()). - Stringer("content_hint", result.ContentHint). - Uint64("server_ts", envelope.GetServerTimestamp()). - Uint64("client_ts", envelope.GetClientTimestamp()). - Stringer("sender", theirServiceID). - Msg("Decryption error with known sender") + logEvt.Stringer("sender", theirServiceID).Msg("Decryption error with known sender") // Only send decryption error event if the message was urgent, // to prevent spamming errors for typing notifications and whatnot if envelope.GetUrgent() && @@ -489,38 +456,27 @@ func (cli *Client) handleDecryptedResult( handlerSuccess = cli.handleEvent(&events.DecryptionError{ Sender: theirServiceID.UUID, Err: result.Err, - Timestamp: envelope.GetClientTimestamp(), + Timestamp: envelope.GetTimestamp(), }) } - if result.Retriable { - go func() { - err := cli.sendRetryRequest(ctx, result, envelope.GetClientTimestamp()) - if err != nil { - log.Err(err).Msg("Failed to send retry request in background") - } - }() - } if !handlerSuccess { return ErrHandlerFailed } return nil } - rawContent := result.Content - if rawContent == nil { + content := result.Content + if content == nil { log.Warn().Msg("Decrypted content is nil") return nil } - deviceID, _ := result.SenderAddress.DeviceID() - log.Trace(). - Any("raw_data", rawContent). - Stringer("sender", theirServiceID). - Uint("sender_device", deviceID). - Msg("Raw event data") + name, _ := result.SenderAddress.Name() + deviceId, _ := result.SenderAddress.DeviceID() + log.Trace().Any("raw_data", content).Str("sender", name).Uint("sender_device", deviceId).Msg("Raw event data") newLog := log.With(). - Stringer("sender_name", theirServiceID). - Uint("sender_device_id", deviceID). + Str("sender_name", name). + Uint("sender_device_id", deviceId). Str("destination_service_id", destinationServiceID.String()). Logger() log = &newLog @@ -529,32 +485,12 @@ func (cli *Client) handleDecryptedResult( if result.CiphertextHash != nil { logEvt = logEvt.Hex("ciphertext_hash", result.CiphertextHash[:]) } - logEvt.Bool("unencrypted", result.Unencrypted).Msg("Decrypted message") - - // Handle unencrypted types early and refuse any other unencrypted message - if rawContent.GetDecryptionErrorMessage() != nil { - handlerSuccess = true - dem, err := libsignalgo.DeserializeDecryptionErrorMessage(rawContent.GetDecryptionErrorMessage()) - if err != nil { - log.Warn().Err(err).Msg("Failed to unmarshal decryption error message") - } else { - go func() { - err := cli.handleRetryRequest(ctx, result, dem) - if err != nil { - log.Err(err).Msg("Failed to handle decryption error message in background") - } - }() - } - return - } else if result.Unencrypted { - log.Warn().Msg("Unexpected non-decryption-error content in unencrypted message") - return nil - } + logEvt.Msg("Decrypted message") // If there's a sender key distribution message, process it - if rawContent.SenderKeyDistributionMessage != nil { + if content.GetSenderKeyDistributionMessage() != nil { log.Debug().Msg("content includes sender key distribution message") - skdm, err := libsignalgo.DeserializeSenderKeyDistributionMessage(rawContent.SenderKeyDistributionMessage) + skdm, err := libsignalgo.DeserializeSenderKeyDistributionMessage(content.GetSenderKeyDistributionMessage()) if err != nil { log.Err(err).Msg("DeserializeSenderKeyDistributionMessage error") return err @@ -571,120 +507,214 @@ func (cli *Client) handleDecryptedResult( } } - // If we're getting a message to our PNI, mark it as needing a PNI signature message on the next send + theirServiceID, err := result.SenderAddress.NameServiceID() + if err != nil { + log.Err(err).Msg("Name error") + return err + } else if theirServiceID.Type != libsignalgo.ServiceIDTypeACI { + log.Warn().Any("their_service_id", theirServiceID).Msg("Sender ServiceID is not an ACI") + return nil + } + if destinationServiceID == cli.Store.PNIServiceID() { _, err = cli.Store.RecipientStore.LoadAndUpdateRecipient(ctx, theirServiceID.UUID, uuid.Nil, func(recipient *types.Recipient) (changed bool, err error) { - if recipient.Whitelisted == nil { - log.Debug().Msg("Marking recipient as not whitelisted") - recipient.Whitelisted = ptr.Ptr(false) - changed = true - } if !recipient.NeedsPNISignature { log.Debug().Msg("Marking recipient as needing PNI signature") recipient.NeedsPNISignature = true - changed = true + return true, nil } - return + return false, nil }) if err != nil { log.Err(err).Msg("Failed to set needs_pni_signature flag after receiving message to PNI service ID") } } - // If we receive a PNI signature message (because we sent to a PNI earlier), process it - if rawContent.PniSignatureMessage != nil { + if content.GetPniSignatureMessage() != nil { log.Debug().Msg("Content includes PNI signature message") - err = cli.handlePNISignatureMessage(ctx, theirServiceID, rawContent.PniSignatureMessage) + err = cli.handlePNISignatureMessage(ctx, theirServiceID, content.GetPniSignatureMessage()) if err != nil { log.Err(err). - Hex("pni_raw", rawContent.PniSignatureMessage.GetPni()). + Hex("pni_raw", content.GetPniSignatureMessage().GetPni()). Stringer("aci", theirServiceID.UUID). Msg("Failed to verify ACI-PNI mapping") } } - isBlocked, err := cli.Store.RecipientStore.IsBlocked(ctx, theirServiceID.UUID) - if err != nil { - log.Err(err).Stringer("sender", theirServiceID).Msg("Failed to check if sender is blocked") + // TODO: handle more sync messages + if content.SyncMessage != nil { + if content.SyncMessage.Keys != nil { + aep := libsignalgo.AccountEntropyPool(content.SyncMessage.Keys.GetAccountEntropyPool()) + cli.Store.MasterKey = content.SyncMessage.Keys.GetMaster() + if aep != "" { + aepMasterKey, err := aep.DeriveSVRKey() + if err != nil { + log.Err(err).Msg("Failed to derive master key from account entropy pool") + } else if cli.Store.MasterKey == nil { + cli.Store.MasterKey = aepMasterKey + log.Debug().Msg("Derived master key from account entropy pool (no master key in sync message)") + } else if !bytes.Equal(aepMasterKey, cli.Store.MasterKey) { + log.Warn().Msg("Derived master key doesn't match one in sync message") + } else { + log.Debug().Msg("Derived master key matches one in sync message") + } + } else { + log.Debug().Msg("No account entropy pool in sync message") + } + err = cli.Store.DeviceStore.PutDevice(ctx, &cli.Store.DeviceData) + if err != nil { + log.Err(err).Msg("Failed to save device after receiving master key") + } else { + log.Info().Msg("Received master key") + go cli.SyncStorage(ctx) + } + } else if content.SyncMessage.GetFetchLatest().GetType() == signalpb.SyncMessage_FetchLatest_STORAGE_MANIFEST { + log.Debug().Msg("Received storage manifest fetch latest notice") + go cli.SyncStorage(ctx) + } + syncSent := content.SyncMessage.GetSent() + if syncSent.GetMessage() != nil || syncSent.GetEditMessage() != nil { + destination := syncSent.DestinationServiceId + var syncDestinationServiceID libsignalgo.ServiceID + if destination != nil { + syncDestinationServiceID, err = libsignalgo.ServiceIDFromString(*destination) + if err != nil { + log.Err(err).Msg("Sync message destination parse error") + return err + } + if syncSent.GetDestinationE164() != "" { + aci, pni := syncDestinationServiceID.ToACIAndPNI() + _, err = cli.Store.RecipientStore.UpdateRecipientE164(ctx, aci, pni, syncSent.GetDestinationE164()) + if err != nil { + log.Err(err).Msg("Failed to update recipient E164 after receiving sync message") + } + } + } + if destination == nil && syncSent.GetMessage().GetGroupV2() == nil && syncSent.GetEditMessage().GetDataMessage().GetGroupV2() == nil { + log.Warn().Msg("sync message sent destination is nil") + } else if content.SyncMessage.Sent.Message != nil { + // TODO handle expiration start ts, and maybe the sync message ts? + cli.incomingDataMessage(ctx, content.SyncMessage.Sent.Message, cli.Store.ACI, syncDestinationServiceID, envelope.GetServerTimestamp()) + } else if content.SyncMessage.Sent.EditMessage != nil { + cli.incomingEditMessage(ctx, content.SyncMessage.Sent.EditMessage, cli.Store.ACI, syncDestinationServiceID, envelope.GetServerTimestamp()) + } + } + if content.SyncMessage.Contacts != nil { + log.Debug().Msg("Recieved sync message contacts") + blob := content.SyncMessage.Contacts.Blob + if blob != nil { + contactsBytes, err := DownloadAttachmentWithPointer(ctx, blob, nil) + if err != nil { + log.Err(err).Msg("Contacts Sync DownloadAttachment error") + } + // unmarshall contacts + contacts, avatars, err := unmarshalContactDetailsMessages(contactsBytes) + if err != nil { + log.Err(err).Msg("Contacts Sync unmarshalContactDetailsMessages error") + } + log.Debug().Int("contact_count", len(contacts)).Msg("Contacts Sync received contacts") + convertedContacts := make([]*types.Recipient, 0, len(contacts)) + err = cli.Store.DoContactTxn(ctx, func(ctx context.Context) error { + for i, signalContact := range contacts { + if signalContact.Aci == nil || *signalContact.Aci == "" { + // TODO lookup PNI via CDSI and store that when ACI is missing? + log.Info(). + Any("contact", signalContact). + Msg("Signal Contact UUID is nil, skipping") + continue + } + contact, err := cli.StoreContactDetailsAsContact(ctx, signalContact, &avatars[i]) + if err != nil { + return err + } + convertedContacts = append(convertedContacts, contact) + } + return nil + }) + if err != nil { + log.Err(err).Msg("Error storing contacts") + } else { + handlerSuccess = cli.handleEvent(&events.ContactList{ + Contacts: convertedContacts, + }) + } + } + } + if content.SyncMessage.Read != nil { + handlerSuccess = cli.handleEvent(&events.ReadSelf{ + Timestamp: envelope.GetTimestamp(), + Messages: content.SyncMessage.GetRead(), + }) + } + if content.SyncMessage.DeleteForMe != nil { + handlerSuccess = cli.handleEvent(&events.DeleteForMe{ + Timestamp: envelope.GetTimestamp(), + SyncMessage_DeleteForMe: content.SyncMessage.DeleteForMe, + }) + } + } - var sendDeliveryReceipt bool - var deliveryReceiptTS uint64 - switch content := rawContent.Content.(type) { - case *signalpb.Content_SyncMessage: - if theirServiceID == cli.Store.ACIServiceID() { - handlerSuccess = cli.handleSyncMessage(ctx, content.SyncMessage, envelope) + sendDeliveryReceipt := true + if content.DataMessage != nil { + handlerSuccess = cli.incomingDataMessage(ctx, content.DataMessage, theirServiceID.UUID, theirServiceID, envelope.GetServerTimestamp()) + } else if content.EditMessage != nil { + handlerSuccess = cli.incomingEditMessage(ctx, content.EditMessage, theirServiceID.UUID, theirServiceID, envelope.GetServerTimestamp()) + } else { + sendDeliveryReceipt = false + } + if sendDeliveryReceipt && handlerSuccess { + err = cli.sendDeliveryReceipts(ctx, []uint64{content.DataMessage.GetTimestamp()}, theirServiceID.UUID) + if err != nil { + log.Err(err).Msg("sendDeliveryReceipts error") } - return nil - case *signalpb.Content_DataMessage: - handlerSuccess, sendDeliveryReceipt = cli.incomingDataMessage( - ctx, content.DataMessage, theirServiceID.UUID, theirServiceID, envelope.GetServerTimestamp(), isBlocked, - ) - deliveryReceiptTS = content.DataMessage.GetTimestamp() - case *signalpb.Content_EditMessage: - handlerSuccess, sendDeliveryReceipt = cli.incomingEditMessage( - ctx, content.EditMessage, theirServiceID.UUID, theirServiceID, envelope.GetServerTimestamp(), isBlocked, - ) - deliveryReceiptTS = content.EditMessage.GetDataMessage().GetTimestamp() - case *signalpb.Content_ReceiptMessage: - if content.ReceiptMessage.GetType() == signalpb.ReceiptMessage_DELIVERY && theirServiceID == cli.Store.ACIServiceID() { + } + + if content.TypingMessage != nil { + var groupID types.GroupIdentifier + if content.TypingMessage.GetGroupId() != nil { + gidBytes := content.TypingMessage.GetGroupId() + groupID = types.GroupIdentifier(base64.StdEncoding.EncodeToString(gidBytes)) + } + // No handler success check here, nobody cares if typing notifications are dropped + cli.handleEvent(&events.ChatEvent{ + Info: events.MessageInfo{ + Sender: theirServiceID.UUID, + ChatID: groupOrUserID(groupID, theirServiceID), + ServerTimestamp: envelope.GetServerTimestamp(), + }, + Event: content.TypingMessage, + }) + } + + // DM call message (group call is an opaque callMessage and a groupCallUpdate in a dataMessage) + if content.CallMessage != nil && (content.CallMessage.Offer != nil || content.CallMessage.Hangup != nil) { + handlerSuccess = cli.handleEvent(&events.Call{ + Info: events.MessageInfo{ + Sender: theirServiceID.UUID, + ChatID: theirServiceID.String(), + ServerTimestamp: envelope.GetServerTimestamp(), + }, + // CallMessage doesn't have its own timestamp, use one from the envelope + Timestamp: envelope.GetTimestamp(), + IsRinging: content.CallMessage.Offer != nil, + }) && handlerSuccess + } + + // Read and delivery receipts + if content.ReceiptMessage != nil { + if content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_DELIVERY && theirServiceID == cli.Store.ACIServiceID() { // Ignore delivery receipts from other own devices return nil } handlerSuccess = cli.handleEvent(&events.Receipt{ Sender: theirServiceID.UUID, Content: content.ReceiptMessage, - }) - case *signalpb.Content_TypingMessage: - var groupID types.GroupIdentifier - if content.TypingMessage.GetGroupId() != nil { - gidBytes := content.TypingMessage.GetGroupId() - groupID = types.GroupIdentifier(base64.StdEncoding.EncodeToString(gidBytes)) - } - if !isBlocked || groupID != "" { - // No handler success check here, nobody cares if typing notifications are dropped - cli.handleEvent(&events.ChatEvent{ - Info: events.MessageInfo{ - Sender: theirServiceID.UUID, - ChatID: groupOrUserID(groupID, theirServiceID), - ServerTimestamp: envelope.GetServerTimestamp(), - }, - Event: content.TypingMessage, - }) - } - case *signalpb.Content_CallMessage: - if !isBlocked && (content.CallMessage.Offer != nil || content.CallMessage.Hangup != nil) { - handlerSuccess = cli.handleEvent(&events.Call{ - Info: events.MessageInfo{ - Sender: theirServiceID.UUID, - ChatID: theirServiceID.String(), - ServerTimestamp: envelope.GetServerTimestamp(), - }, - // CallMessage doesn't have its own timestamp, use one from the envelope - Timestamp: envelope.GetClientTimestamp(), - IsRinging: content.CallMessage.Offer != nil, - }) - } - case *signalpb.Content_DecryptionErrorMessage: - // These should've been handled earlier - log.Warn().Msg("Unexpected decryption error message content in decrypted message") - case *signalpb.Content_NullMessage: - // This is intentionally ignored - case *signalpb.Content_StoryMessage: - // This is also ignored for now - default: - if rawContent.PniSignatureMessage == nil && rawContent.SenderKeyDistributionMessage == nil { - log.Warn().Type("content_type", content).Msg("Unrecognized message content type") - } + }) && handlerSuccess } - - if sendDeliveryReceipt && handlerSuccess { - err = cli.sendDeliveryReceipts(ctx, []uint64{deliveryReceiptTS}, theirServiceID.UUID) - if err != nil { - log.Err(err).Msg("sendDeliveryReceipts error") - } + if !handlerSuccess { + return ErrHandlerFailed } - return nil } @@ -695,184 +725,6 @@ func groupOrUserID(groupID types.GroupIdentifier, userID libsignalgo.ServiceID) return string(groupID) } -func (cli *Client) handleSyncMessage(ctx context.Context, msg *signalpb.SyncMessage, envelope *signalpb.Envelope) (handlerSuccess bool) { - // TODO: handle more sync messages - handlerSuccess = true - log := zerolog.Ctx(ctx) - switch content := msg.Content.(type) { - case *signalpb.SyncMessage_Keys_: - aep := libsignalgo.AccountEntropyPool(content.Keys.GetAccountEntropyPool()) - if aep != "" { - aepMasterKey, err := aep.DeriveSVRKey() - if err != nil { - log.Err(err).Msg("Failed to derive master key from account entropy pool") - } else if cli.Store.MasterKey == nil { - cli.Store.MasterKey = aepMasterKey - log.Debug().Msg("Derived master key from account entropy pool (no master key in sync message)") - } else if !bytes.Equal(aepMasterKey, cli.Store.MasterKey) { - log.Warn().Msg("Derived master key doesn't match one in sync message") - } else { - log.Debug().Msg("Derived master key matches one in sync message") - } - } else { - log.Debug().Msg("No account entropy pool in sync message") - } - err := cli.Store.DeviceStore.PutDevice(ctx, &cli.Store.DeviceData) - if err != nil { - log.Err(err).Msg("Failed to save device after receiving master key") - } else { - log.Info().Msg("Received master key") - go cli.SyncStorage(ctx) - } - case *signalpb.SyncMessage_FetchLatest_: - switch content.FetchLatest.GetType() { - case signalpb.SyncMessage_FetchLatest_STORAGE_MANIFEST: - log.Debug().Msg("Received storage manifest fetch latest notice") - go cli.SyncStorage(ctx) - default: - log.Debug(). - Stringer("fetch_latest_type", content.FetchLatest.GetType()). - Msg("Received unknown fetch latest notice") - } - case *signalpb.SyncMessage_Sent_: - syncSent := content.Sent - if syncSent.GetMessage() != nil || syncSent.GetEditMessage() != nil { - syncDestinationServiceID, err := ParseStringOrBinaryServiceID(syncSent.GetDestinationServiceId(), syncSent.GetDestinationServiceIdBinary()) - if err != nil && !errors.Is(err, ErrEmptyUUIDInput) { - log.Err(err).Msg("Sync message destination parse error") - } - if syncSent.GetDestinationE164() != "" && !syncDestinationServiceID.IsEmpty() { - aci, pni := syncDestinationServiceID.ToACIAndPNI() - _, err = cli.Store.RecipientStore.UpdateRecipientE164(ctx, aci, pni, syncSent.GetDestinationE164()) - if err != nil { - log.Err(err).Msg("Failed to update recipient E164 after receiving sync message") - } - } - for _, unident := range syncSent.GetUnidentifiedStatus() { - serviceID, err := ParseStringOrBinaryServiceID(unident.GetDestinationServiceId(), unident.GetDestinationServiceIdBinary()) - if err != nil { - log.Err(err). - Str("destination_service_id", unident.GetDestinationServiceId()). - Hex("destination_service_id_bytes", unident.GetDestinationServiceIdBinary()). - Msg("Failed to parse destination service ID of unidentified send") - continue - } - changed, err := cli.saveSyncPNIIdentityKey(ctx, serviceID, unident.GetDestinationPniIdentityKey()) - if err != nil { - log.Err(err). - Stringer("destination_service_id", serviceID). - Msg("Failed to save PNI identity key from sync message") - } else if changed { - log.Debug(). - Stringer("destination_service_id", serviceID). - Msg("Saved new PNI identity key from sync message") - } - } - - if syncDestinationServiceID.IsEmpty() && syncSent.GetMessage().GetGroupV2() == nil && syncSent.GetEditMessage().GetDataMessage().GetGroupV2() == nil { - log.Warn().Msg("sync message sent destination is nil") - } else if syncSent.Message != nil { - // TODO handle expiration start ts, and maybe the sync message ts? - cli.incomingDataMessage(ctx, syncSent.Message, cli.Store.ACI, syncDestinationServiceID, envelope.GetServerTimestamp(), false) - } else if syncSent.EditMessage != nil { - cli.incomingEditMessage(ctx, syncSent.EditMessage, cli.Store.ACI, syncDestinationServiceID, envelope.GetServerTimestamp(), false) - } - } - case *signalpb.SyncMessage_Contacts_: - log.Debug().Msg("Recieved sync message contacts") - if content.Contacts.Blob != nil { - // TODO roundtrip via disk to save memory - contactsBytes, err := DownloadAttachmentWithPointer(ctx, content.Contacts.Blob, nil, nil) - if err != nil { - log.Err(err).Msg("Contacts Sync DownloadAttachment error") - } - // unmarshall contacts - contacts, avatars, err := unmarshalContactDetailsMessages(contactsBytes) - if err != nil { - log.Err(err).Msg("Contacts Sync unmarshalContactDetailsMessages error") - } - log.Debug().Int("contact_count", len(contacts)).Msg("Contacts Sync received contacts") - convertedContacts := make([]*types.Recipient, 0, len(contacts)) - err = cli.Store.DoContactTxn(ctx, func(ctx context.Context) error { - for i, signalContact := range contacts { - if (signalContact.Aci == nil || *signalContact.Aci == "") && len(signalContact.AciBinary) != 16 { - // TODO lookup PNI via CDSI and store that when ACI is missing? - log.Info(). - Any("contact", signalContact). - Msg("Signal Contact UUID is nil, skipping") - continue - } - contact, err := cli.StoreContactDetailsAsContact(ctx, signalContact, &avatars[i]) - if err != nil { - return err - } - convertedContacts = append(convertedContacts, contact) - } - return nil - }) - if err != nil { - log.Err(err).Msg("Error storing contacts") - } else { - handlerSuccess = cli.handleEvent(&events.ContactList{ - Contacts: convertedContacts, - }) - } - } - case *signalpb.SyncMessage_DeleteForMe_: - handlerSuccess = cli.handleEvent(&events.DeleteForMe{ - Timestamp: envelope.GetClientTimestamp(), - SyncMessage_DeleteForMe: content.DeleteForMe, - }) - case *signalpb.SyncMessage_MessageRequestResponse_: - aciUUID, _ := ParseStringOrBinaryUUID(content.MessageRequestResponse.GetThreadAci(), content.MessageRequestResponse.GetThreadAciBinary()) - if aciUUID != uuid.Nil && content.MessageRequestResponse.GetType() == signalpb.SyncMessage_MessageRequestResponse_ACCEPT { - _, err := cli.Store.RecipientStore.LoadAndUpdateRecipient(ctx, aciUUID, uuid.Nil, func(recipient *types.Recipient) (changed bool, err error) { - changed = !ptr.Val(recipient.Whitelisted) || recipient.NeedsPNISignature - recipient.Whitelisted = ptr.Ptr(true) - recipient.NeedsPNISignature = false - return - }) - if err != nil { - log.Err(err).Msg("Failed to clear needs_pni_signature flag after message request accept") - } - } - var groupID *libsignalgo.GroupIdentifier - if len(content.MessageRequestResponse.GroupId) == libsignalgo.GroupIdentifierLength { - groupID = (*libsignalgo.GroupIdentifier)(content.MessageRequestResponse.GroupId) - } - handlerSuccess = cli.handleEvent(&events.MessageRequestResponse{ - Timestamp: envelope.GetClientTimestamp(), - ThreadACI: aciUUID, - GroupID: groupID, - Type: content.MessageRequestResponse.GetType(), - Raw: content.MessageRequestResponse, - }) - default: - if msg.Read != nil { - handlerSuccess = cli.handleEvent(&events.ReadSelf{ - Timestamp: envelope.GetClientTimestamp(), - Messages: msg.Read, - }) - } - } - return -} - -func (cli *Client) saveSyncPNIIdentityKey(ctx context.Context, serviceID libsignalgo.ServiceID, identityKeyBytes []byte) (bool, error) { - if identityKeyBytes == nil || serviceID.Type != libsignalgo.ServiceIDTypePNI { - return false, nil - } - identityKey, err := libsignalgo.DeserializeIdentityKey(identityKeyBytes) - if err != nil { - return false, fmt.Errorf("failed to deserialize PNI identity key: %w", err) - } - changed, err := cli.Store.IdentityKeyStore.SaveIdentityKey(ctx, serviceID, identityKey) - if err != nil { - return false, fmt.Errorf("failed to save PNI identity key: %w", err) - } - return changed, nil -} - func (cli *Client) handlePNISignatureMessage(ctx context.Context, sender libsignalgo.ServiceID, msg *signalpb.PniSignatureMessage) error { if sender.Type != libsignalgo.ServiceIDTypeACI { return fmt.Errorf("PNI signature message sender is not an ACI") @@ -923,14 +775,7 @@ func (cli *Client) handlePNISignatureMessage(ctx context.Context, sender libsign return nil } -func (cli *Client) incomingEditMessage( - ctx context.Context, - editMessage *signalpb.EditMessage, - messageSenderACI uuid.UUID, - chatRecipient libsignalgo.ServiceID, - serverTimestamp uint64, - isBlocked bool, -) (handlerSuccess, sendDeliveryReceipt bool) { +func (cli *Client) incomingEditMessage(ctx context.Context, editMessage *signalpb.EditMessage, messageSenderACI uuid.UUID, chatRecipient libsignalgo.ServiceID, serverTimestamp uint64) bool { // If it's a group message, get the ID and invalidate cache if necessary var groupID types.GroupIdentifier var groupRevision uint32 @@ -942,12 +787,9 @@ func (cli *Client) incomingEditMessage( groupID, err = cli.StoreMasterKey(ctx, masterKey) if err != nil { zerolog.Ctx(ctx).Err(err).Msg("StoreMasterKey error") - return + return false } groupRevision = editMessage.GetDataMessage().GetGroupV2().GetRevision() - } else if isBlocked { - zerolog.Ctx(ctx).Debug().Msg("Dropping direct message from blocked user") - return true, false } return cli.handleEvent(&events.ChatEvent{ Info: events.MessageInfo{ @@ -957,24 +799,17 @@ func (cli *Client) incomingEditMessage( ServerTimestamp: serverTimestamp, }, Event: editMessage, - }), true + }) } -func (cli *Client) incomingDataMessage( - ctx context.Context, - dataMessage *signalpb.DataMessage, - messageSenderACI uuid.UUID, - chatRecipient libsignalgo.ServiceID, - serverTimestamp uint64, - isBlocked bool, -) (handlerSuccess, sendDeliveryReceipt bool) { +func (cli *Client) incomingDataMessage(ctx context.Context, dataMessage *signalpb.DataMessage, messageSenderACI uuid.UUID, chatRecipient libsignalgo.ServiceID, serverTimestamp uint64) bool { // If there's a profile key, save it if dataMessage.ProfileKey != nil { profileKey := libsignalgo.ProfileKey(dataMessage.ProfileKey) err := cli.Store.RecipientStore.StoreProfileKey(ctx, messageSenderACI, profileKey) if err != nil { zerolog.Ctx(ctx).Err(err).Msg("StoreProfileKey error") - return + return false } } @@ -989,12 +824,9 @@ func (cli *Client) incomingDataMessage( groupID, err = cli.StoreMasterKey(ctx, masterKey) if err != nil { zerolog.Ctx(ctx).Err(err).Msg("StoreMasterKey error") - return + return false } groupRevision = dataMessage.GetGroupV2().GetRevision() - } else if isBlocked { - zerolog.Ctx(ctx).Debug().Msg("Dropping direct message from blocked user") - return true, false } evtInfo := events.MessageInfo{ @@ -1005,17 +837,17 @@ func (cli *Client) incomingDataMessage( } // Hacky special case for group calls to cache the state if dataMessage.GroupCallUpdate != nil { - isRinging := cli.GroupCache.UpdateActiveCall(groupID, dataMessage.GroupCallUpdate.GetEraId()) + isRinging := cli.UpdateActiveCalls(groupID, dataMessage.GroupCallUpdate.GetEraId()) return cli.handleEvent(&events.Call{ Info: evtInfo, Timestamp: dataMessage.GetTimestamp(), IsRinging: isRinging, - }), true + }) } else { return cli.handleEvent(&events.ChatEvent{ Info: evtInfo, Event: dataMessage, - }), true + }) } } diff --git a/pkg/signalmeow/receiving_decrypt.go b/pkg/signalmeow/receiving_decrypt.go index 1d2c8cc..1ffceb0 100644 --- a/pkg/signalmeow/receiving_decrypt.go +++ b/pkg/signalmeow/receiving_decrypt.go @@ -39,21 +39,18 @@ type DecryptionResult struct { Content *signalpb.Content ContentHint signalpb.UnidentifiedSenderMessage_Message_ContentHint Err error - GroupID *libsignalgo.GroupIdentifier - Unencrypted bool - - Retriable bool - Ciphertext []byte - CiphertextType libsignalgo.CiphertextMessageType } func (cli *Client) decryptEnvelope( ctx context.Context, envelope *signalpb.Envelope, - sourceServiceID, destinationServiceID libsignalgo.ServiceID, ) DecryptionResult { - if destinationServiceID.IsEmpty() { - return DecryptionResult{Err: fmt.Errorf("envelope missing destination service ID")} + log := zerolog.Ctx(ctx) + + destinationServiceID, err := libsignalgo.ServiceIDFromString(envelope.GetDestinationServiceId()) + if err != nil { + log.Err(err).Str("destination_service_id", envelope.GetDestinationServiceId()).Msg("Failed to parse destination service ID") + return DecryptionResult{Err: fmt.Errorf("failed to parse destination service ID: %w", err)} } switch *envelope.Type { @@ -64,14 +61,17 @@ func (cli *Client) decryptEnvelope( } return result - case signalpb.Envelope_PREKEY_MESSAGE, signalpb.Envelope_DOUBLE_RATCHET: - sender, err := sourceServiceID.Address(uint(envelope.GetSourceDeviceId())) + case signalpb.Envelope_PREKEY_BUNDLE, signalpb.Envelope_CIPHERTEXT: + sender, err := libsignalgo.NewUUIDAddressFromString( + *envelope.SourceServiceId, + uint(*envelope.SourceDevice), + ) if err != nil { return DecryptionResult{Err: fmt.Errorf("failed to wrap address: %v", err)} } var result *DecryptionResult var bundleType string - if *envelope.Type == signalpb.Envelope_PREKEY_MESSAGE { + if *envelope.Type == signalpb.Envelope_PREKEY_BUNDLE { result, err = cli.prekeyDecrypt(ctx, destinationServiceID, sender, envelope.Content, envelope.GetServerTimestamp()) bundleType = "prekey bundle" } else { @@ -79,34 +79,19 @@ func (cli *Client) decryptEnvelope( bundleType = "ciphertext" } if err != nil { - return DecryptionResult{ - SenderAddress: sender, - Err: fmt.Errorf("failed to decrypt %s envelope: %w", bundleType, err), - Retriable: true, // TODO should these ever be not retriable? - Ciphertext: envelope.Content, - CiphertextType: libsignalgo.CiphertextMessageType(envelope.GetType()), - } + return DecryptionResult{Err: fmt.Errorf("failed to decrypt %s envelope: %w", bundleType, err), SenderAddress: sender} } return *result case signalpb.Envelope_PLAINTEXT_CONTENT: - addr, err := sourceServiceID.Address(uint(envelope.GetSourceDeviceId())) - if err != nil { - return DecryptionResult{Err: fmt.Errorf("failed to wrap address: %v", err)} - } - content, err := stripPadding(envelope.GetContent()) - if err != nil { - return DecryptionResult{Err: fmt.Errorf("failed to strip padding: %w", err)} - } - return DecryptionResult{ - SenderAddress: addr, - Content: &signalpb.Content{Content: &signalpb.Content_DecryptionErrorMessage{DecryptionErrorMessage: content}}, - Unencrypted: true, - } + return DecryptionResult{Err: fmt.Errorf("plaintext messages are not supported")} case signalpb.Envelope_SERVER_DELIVERY_RECEIPT: return DecryptionResult{Err: fmt.Errorf("server delivery receipt envelopes are not yet supported")} + case signalpb.Envelope_SENDERKEY_MESSAGE: + return DecryptionResult{Err: fmt.Errorf("senderkey message envelopes are not yet supported")} + case signalpb.Envelope_UNKNOWN: return DecryptionResult{Err: fmt.Errorf("unknown envelope type")} @@ -185,17 +170,12 @@ func (cli *Client) prekeyDecrypt( if is == nil { return nil, fmt.Errorf("no identity store found for %s", destination) } - destinationAddress, err := destination.Address(uint(cli.Store.DeviceID)) - if err != nil { - return nil, fmt.Errorf("failed to get own/destination address: %w", err) - } plaintext, ciphertextHash, err := cli.bufferedDecryptTxn(ctx, encryptedContent, serverTimestamp, func(ctx context.Context) ([]byte, error) { return libsignalgo.DecryptPreKey( ctx, preKeyMessage, sender, - destinationAddress, ss, is, pks, @@ -243,16 +223,11 @@ func (cli *Client) decryptCiphertextEnvelope( if identityStore == nil { return nil, fmt.Errorf("no identity store for destination service ID %s", destinationServiceID) } - destinationAddress, err := destinationServiceID.Address(uint(cli.Store.DeviceID)) - if err != nil { - return nil, fmt.Errorf("failed to get own address: %w", err) - } plaintext, ciphertextHash, err := cli.bufferedDecryptTxn(ctx, ciphertext, serverTimestamp, func(ctx context.Context) ([]byte, error) { return libsignalgo.Decrypt( ctx, message, senderAddress, - destinationAddress, sessionStore, identityStore, ) @@ -340,10 +315,6 @@ func (cli *Client) decryptUnidentifiedSenderEnvelope(ctx context.Context, destin if err != nil { return result, fmt.Errorf("failed to get content hint: %w", err) } - result.GroupID, err = usmc.GetGroupID() - if err != nil { - return result, fmt.Errorf("failed to get group ID: %w", err) - } result.ContentHint = signalpb.UnidentifiedSenderMessage_Message_ContentHint(contentHint) senderUUID, err := senderCertificate.GetSenderUUID() if err != nil { @@ -366,11 +337,8 @@ func (cli *Client) decryptUnidentifiedSenderEnvelope(ctx context.Context, destin if err != nil { return result, fmt.Errorf("failed to get USMC contents: %w", err) } - result.Ciphertext = usmcContents - result.CiphertextType = messageType newLog := log.With(). Stringer("sender_uuid", senderUUID). - Stringer("group_id", result.GroupID). Uint32("sender_device_id", senderDeviceID). Str("sender_e164", senderE164). Uint8("sealed_sender_type", uint8(messageType)). @@ -395,25 +363,15 @@ func (cli *Client) decryptUnidentifiedSenderEnvelope(ctx context.Context, destin case libsignalgo.CiphertextMessageTypeWhisper: resultPtr, err = cli.decryptCiphertextEnvelope(ctx, destinationServiceID, senderAddress, usmcContents, envelope.GetServerTimestamp()) case libsignalgo.CiphertextMessageTypePlaintext: - usmcContents, err = stripPadding(usmcContents) - if err != nil { - err = fmt.Errorf("failed to strip padding: %w", err) - } - result.Unencrypted = true - result.Content = &signalpb.Content{ - Content: &signalpb.Content_DecryptionErrorMessage{ - DecryptionErrorMessage: usmcContents, - }, - } - return result, err + // TODO: handle plaintext (usually DecryptionErrorMessage) and retries + // when implementing SenderKey groups + return result, fmt.Errorf("unsupported plaintext sealed sender message") default: return result, fmt.Errorf("unsupported sealed sender message type %d", messageType) } if err != nil { - result.Retriable = result.ContentHint == signalpb.UnidentifiedSenderMessage_Message_RESENDABLE return result, err } - resultPtr.GroupID = result.GroupID return *resultPtr, nil } diff --git a/pkg/signalmeow/retry.go b/pkg/signalmeow/retry.go deleted file mode 100644 index a581075..0000000 --- a/pkg/signalmeow/retry.go +++ /dev/null @@ -1,214 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2025 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package signalmeow - -import ( - "context" - "fmt" - "math/rand/v2" - "slices" - "time" - - "github.com/rs/zerolog" - "go.mau.fi/util/random" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -type sendCacheKey struct { - recipient libsignalgo.ServiceID - groupID types.GroupIdentifier - timestamp uint64 -} - -const RetryRespondMaxAge = 30 * 24 * time.Hour - -func (cli *Client) sendRetryRequest(ctx context.Context, result DecryptionResult, originalTS uint64) error { - serviceID, err := result.SenderAddress.NameServiceID() - if err != nil { - return fmt.Errorf("failed to get sender name as service ID: %w", err) - } - deviceID, err := result.SenderAddress.DeviceID() - if err != nil { - return fmt.Errorf("failed to get sender device ID: %w", err) - } - dem, err := libsignalgo.DecryptionErrorMessageForOriginalMessage(result.Ciphertext, result.CiphertextType, originalTS, deviceID) - if err != nil { - return fmt.Errorf("failed to create decryption error message: %w", err) - } - demBytes, err := dem.Serialize() - if err != nil { - return fmt.Errorf("failed to serialize decryption error message: %w", err) - } - ptc, err := libsignalgo.PlaintextContentFromDecryptionErrorMessage(dem) - if err != nil { - return fmt.Errorf("failed to create plaintext content from decryption error message: %w", err) - } - ctm, err := libsignalgo.NewCiphertextMessage(ptc) - if err != nil { - return fmt.Errorf("failed to create ciphertext message from plaintext content: %w", err) - } - _, err = cli.sendContent(ctx, serviceID, uint64(time.Now().UnixMilli()), &signalpb.Content{ - Content: &signalpb.Content_DecryptionErrorMessage{ - DecryptionErrorMessage: demBytes, - }, - }, 0, true, result.GroupID, ctm) - if err != nil { - return fmt.Errorf("failed to send decryption error message: %w", err) - } - zerolog.Ctx(ctx).Debug(). - Stringer("sender_service_id", serviceID). - Uint("sender_device_id", deviceID). - Stringer("group_id", result.GroupID). - Msg("Sent retry receipt") - return nil -} - -func (cli *Client) handleRetryRequest( - ctx context.Context, - result DecryptionResult, - dem *libsignalgo.DecryptionErrorMessage, -) error { - destDeviceID, err := dem.GetDeviceID() - if err != nil { - return fmt.Errorf("failed to get device ID from decryption error message: %w", err) - } else if int(destDeviceID) != cli.Store.DeviceID { - zerolog.Ctx(ctx).Debug(). - Uint32("dest_device_id", destDeviceID). - Msg("Ignoring decryption error message for another device") - return nil - } - serviceID, err := result.SenderAddress.NameServiceID() - if err != nil { - return fmt.Errorf("failed to get sender name as service ID: %w", err) - } - deviceID, err := result.SenderAddress.DeviceID() - if err != nil { - return fmt.Errorf("failed to get sender device ID: %w", err) - } - ts, err := dem.GetTimestamp() - if err != nil { - return fmt.Errorf("failed to get timestamp: %w", err) - } - - cli.encryptionLock.Lock() - defer cli.encryptionLock.Unlock() - ctx = context.WithValue(ctx, contextKeyEncryptionLock, true) - var didArchiveSession bool - if ratchetKey, err := dem.GetRatchetKey(); err != nil { - return fmt.Errorf("failed to get ratchet key: %w", err) - } else if ratchetKey == nil { - // No need to archive session if no ratchet key is provided, it was probably a sender key decryption error - } else if session, err := cli.Store.ACISessionStore.LoadSession(ctx, result.SenderAddress); err != nil { - return fmt.Errorf("failed to load session for sender: %w", err) - } else if match, err := session.CurrentRatchetKeyMatches(ratchetKey); err != nil { - return fmt.Errorf("failed to check ratchet key match: %w", err) - } else if match { - err = session.ArchiveCurrentState() - if err != nil { - return fmt.Errorf("failed to archive current session state: %w", err) - } - err = cli.Store.ACISessionStore.StoreSession(ctx, result.SenderAddress, session) - if err != nil { - return fmt.Errorf("failed to store archived session: %w", err) - } - didArchiveSession = true - } - var skdmBytes []byte - groupID := types.BytesToGroupIdentifier(result.GroupID) - if groupID != "" { - ski, err := cli.Store.SenderKeyStore.GetSenderKeyInfo(ctx, groupID) - if err != nil { - return fmt.Errorf("failed to get sender key info for group %s: %w", groupID, err) - } - myAddress, err := cli.Store.ACIServiceID().Address(uint(cli.Store.DeviceID)) - if err != nil { - return fmt.Errorf("failed to get own address: %w", err) - } - if slices.Contains(ski.SharedWith[serviceID], int(deviceID)) { - skdm, err := libsignalgo.NewSenderKeyDistributionMessage(ctx, myAddress, ski.DistributionID, cli.Store.SenderKeyStore) - if err != nil { - return fmt.Errorf("failed to create sender key distribution message: %w", err) - } - skdmBytes, err = skdm.Serialize() - if err != nil { - return fmt.Errorf("failed to serialize sender key distribution message: %w", err) - } - } else { - zerolog.Ctx(ctx).Warn(). - Stringer("group_id", result.GroupID). - Stringer("sender_service_id", serviceID). - Stringer("distribution_id", ski.DistributionID). - Uint("sender_device_id", deviceID). - Ints("shared_with", ski.SharedWith[serviceID]). - Msg("Sender key distribution list doesn't contain retry receipt sender") - } - } - var retryContent *signalpb.Content - var cacheHit bool - if time.Since(time.UnixMilli(int64(ts))) < RetryRespondMaxAge { - retryContent, cacheHit = cli.sendCache.Get(sendCacheKey{ - groupID: groupID, - recipient: serviceID, - timestamp: ts, - }) - if !cacheHit { - // TODO add support for external caches - } - } - if retryContent == nil { - retryContent = &signalpb.Content{} - } - retryContent.SenderKeyDistributionMessage = skdmBytes - if !cacheHit && skdmBytes == nil { - if !didArchiveSession { - zerolog.Ctx(ctx).Debug(). - Uint64("msg_timestamp", ts). - Stringer("sender_service_id", serviceID). - Uint("sender_device_id", deviceID). - Stringer("group_id", result.GroupID). - Msg("Not responding to decryption error message") - return nil - } - retryContent.Content = &signalpb.Content_NullMessage{ - NullMessage: &signalpb.NullMessage{ - Padding: random.Bytes(rand.IntN(511) + 1), - }, - } - } - responseTimestamp := uint64(time.Now().UnixMilli()) - if cacheHit { - responseTimestamp = ts - } - zerolog.Ctx(ctx).Debug(). - Uint32("dest_device_id", destDeviceID). - Uint64("requested_msg_timestamp", ts). - Stringer("sender_service_id", serviceID). - Uint("sender_device_id", deviceID). - Stringer("group_id", result.GroupID). - Bool("did_archive_session", didArchiveSession). - Bool("found_message_in_cache", cacheHit). - Bool("including_skdm", skdmBytes != nil). - Msg("Responding to decryption error message") - _, err = cli.sendContent(ctx, serviceID, responseTimestamp, retryContent, 0, true, result.GroupID, nil) - if err != nil { - return fmt.Errorf("failed to send response: %w", err) - } - return nil -} diff --git a/pkg/signalmeow/senderkey.go b/pkg/signalmeow/senderkey.go deleted file mode 100644 index 48a3203..0000000 --- a/pkg/signalmeow/senderkey.go +++ /dev/null @@ -1,431 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2025 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package signalmeow - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "maps" - "net/http" - "slices" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "go.mau.fi/util/exslices" - "google.golang.org/protobuf/proto" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" - "go.mau.fi/mautrix-signal/pkg/signalmeow/store" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" - "go.mau.fi/mautrix-signal/pkg/signalmeow/web" -) - -const SenderKeyMaxAge = 14 * 24 * time.Hour - -type contextKey int - -const ( - contextKeyEncryptionLock contextKey = iota -) - -func (cli *Client) ResetSenderKey(ctx context.Context, groupID types.GroupIdentifier) (uuid.UUID, error) { - cli.encryptionLock.Lock() - defer cli.encryptionLock.Unlock() - info, err := cli.Store.SenderKeyStore.GetSenderKeyInfo(ctx, groupID) - if err != nil { - return uuid.Nil, fmt.Errorf("failed to get sender key info: %w", err) - } else if info == nil { - return uuid.Nil, nil - } else if myAddress, err := cli.Store.ACIServiceID().Address(uint(cli.Store.DeviceID)); err != nil { - return uuid.Nil, fmt.Errorf("failed to get own address: %w", err) - } else if err = cli.Store.SenderKeyStore.DeleteSenderKey(ctx, myAddress, info.DistributionID); err != nil { - return info.DistributionID, fmt.Errorf("failed to delete sender key: %w", err) - } else if err = cli.Store.SenderKeyStore.DeleteSenderKeyInfo(ctx, groupID); err != nil { - return info.DistributionID, fmt.Errorf("failed to delete sender key info: %w", err) - } - return info.DistributionID, nil -} - -func (cli *Client) sendToGroupWithSenderKey( - ctx context.Context, - groupID *libsignalgo.GroupIdentifier, - allRecipients []libsignalgo.ServiceID, - sec SendEndorsementCache, - content *signalpb.Content, - messageTimestamp uint64, - retries int, -) (*GroupMessageSendResult, error) { - if retries >= 3 { - return cli.sendToGroup(ctx, allRecipients, content, messageTimestamp, nil, groupID) - } - myAddress, err := cli.Store.ACIServiceID().Address(uint(cli.Store.DeviceID)) - if err != nil { - return nil, fmt.Errorf("failed to get own address: %w", err) - } - log := zerolog.Ctx(ctx) - - cli.encryptionLock.Lock() - unlocked := false - doUnlock := func() { - if !unlocked { - unlocked = true - cli.encryptionLock.Unlock() - } - } - defer doUnlock() - ctx = context.WithValue(ctx, contextKeyEncryptionLock, true) - result := &GroupMessageSendResult{ - SuccessfullySentTo: make([]SuccessfulSendResult, 0), - FailedToSendTo: make([]FailedSendResult, 0), - } - - groupIDStr := types.GroupIdentifier(groupID.String()) - deviceIDs, senderKeyRecipients, fallbackRecipients := cli.getDevicesIDs(ctx, allRecipients, sec, result) - if len(senderKeyRecipients) == 0 { - doUnlock() - log.Debug().Msg("No sender key recipients, falling back to normal send") - return cli.sendToGroup(ctx, allRecipients, content, messageTimestamp, result, groupID) - } - ski, err := cli.Store.SenderKeyStore.GetSenderKeyInfo(ctx, groupIDStr) - if err != nil { - return nil, fmt.Errorf("failed to get sender key info: %w", err) - } else if ski == nil || time.Since(ski.CreatedAt) > SenderKeyMaxAge { - if ski != nil && time.Since(ski.CreatedAt) > SenderKeyMaxAge { - log.Debug().Any("old_sender_key_info", ski).Msg("Sender key expired, creating new one") - err = cli.Store.SenderKeyStore.DeleteSenderKey(ctx, myAddress, ski.DistributionID) - if err != nil { - return nil, fmt.Errorf("failed to delete old sender key: %w", err) - } - } else { - log.Debug().Msg("No existing sender key, creating new one") - } - ski = &store.SenderKeyInfo{ - DistributionID: uuid.New(), - CreatedAt: time.Now(), - SharedWith: make(map[libsignalgo.ServiceID][]int), - } - } else { - log.Debug().Any("sender_key_info", ski).Msg("Reusing existing sender key") - } - xak, devicesAddedTo, removedDevices := diffRecipients(ski.SharedWith, deviceIDs) - if len(removedDevices) > 0 { - log.Debug(). - Any("removed_devices", removedDevices). - Msg("Resetting sender key due to recipient device changes") - devicesAddedTo = slices.Collect(maps.Keys(deviceIDs)) - err = cli.Store.SenderKeyStore.DeleteSenderKey(ctx, myAddress, ski.DistributionID) - if err != nil { - return nil, fmt.Errorf("failed to delete old sender key: %w", err) - } - } - if len(devicesAddedTo) > 0 { - log.Debug(). - Any("devices_added_to", devicesAddedTo). - Msg("Sending sender key distribution message to users with new devices") - skdm, err := libsignalgo.NewSenderKeyDistributionMessage(ctx, myAddress, ski.DistributionID, cli.Store.SenderKeyStore) - if err != nil { - return nil, fmt.Errorf("failed to create sender key distribution message: %w", err) - } - skdmBytes, err := skdm.Serialize() - if err != nil { - return nil, fmt.Errorf("failed to serialize sender key distribution message: %w", err) - } - var needsRetry bool - for _, recipient := range devicesAddedTo { - log := log.With().Str("subaction", "skdm").Stringer("recipient_id", recipient).Logger() - _, err = cli.sendContent(log.WithContext(ctx), recipient, messageTimestamp, &signalpb.Content{ - SenderKeyDistributionMessage: skdmBytes, - }, 0, true, groupID, nil) - if errors.Is(err, ErrDevicesChanged) || errors.Is(err, ErrUnregisteredUser) { - log.Warn().Err(err).Msg("Failed to send sender key distribution message due to device changes, will retry") - needsRetry = true - } else if err != nil { - log.Err(err).Msg("Failed to send sender key distribution message") - fallbackRecipients = append(fallbackRecipients, recipient) - delete(deviceIDs, recipient) - senderKeyRecipients = slices.DeleteFunc(senderKeyRecipients, func(tuple store.SessionAddressTuple) bool { - return tuple.ServiceID == recipient - }) - } else { - log.Debug().Msg("Successfully sent sender key distribution message") - ski.SharedWith[recipient] = deviceIDs[recipient].DeviceIDs - } - } - err = cli.Store.SenderKeyStore.PutSenderKeyInfo(ctx, groupIDStr, ski) - if err != nil { - return nil, fmt.Errorf("failed to store updated sender key info: %w", err) - } - if needsRetry { - doUnlock() - return cli.sendToGroupWithSenderKey(ctx, groupID, allRecipients, sec, content, messageTimestamp, retries+1) - } - } - ssCiphertext, err := cli.encryptWithSenderKey(ctx, groupID, ski.DistributionID, myAddress, senderKeyRecipients, content) - if err != nil { - return nil, err - } - for recipientID := range ski.SharedWith { - cli.addSendCache(recipientID, groupIDStr, messageTimestamp, content) - } - header := http.Header{} - header.Set("Content-Type", string(web.ContentTypeMultiRecipientMessage)) - if sec.SendEndorsement != nil { - wantedEndorsements := make([]libsignalgo.GroupSendEndorsement, 0, len(deviceIDs)) - for serviceID := range deviceIDs { - endorsement, ok := sec.MemberEndorsements[serviceID] - if !ok { - return nil, fmt.Errorf("missing group send endorsement for service ID %s", serviceID.String()) - } - wantedEndorsements = append(wantedEndorsements, endorsement) - } - combinedEndorsement, err := libsignalgo.GroupSendEndorsementCombine(wantedEndorsements...) - if err != nil { - return nil, fmt.Errorf("failed to combine group send endorsements: %w", err) - } - groupSendToken, err := sec.GetTokenWith(combinedEndorsement) - if err != nil { - return nil, fmt.Errorf("failed to create group send full token: %w", err) - } - header.Set("Group-Send-Token", groupSendToken.String()) - } else { - header.Set("Unidentified-Access-Key", xak.String()) - } - path := fmt.Sprintf( - "/v1/messages/multi_recipient?ts=%d&urgent=%t&online=false", - messageTimestamp, isUrgent(content), - ) - log.Debug(). - Any("recipients", ski.SharedWith). - Any("fallback_recipients", fallbackRecipients). - Msg("Sending multi-recipient message with sender key") - resp, err := cli.UnauthedWS.SendRequest(ctx, http.MethodPut, path, ssCiphertext, header) - switch resp.GetStatus() { - case 200: - var respData MultiRecipient200Response - err = json.Unmarshal(resp.Body, &respData) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal 200 response: %w", err) - } - log.Debug(). - Any("response_data", respData). - Msg("Got successful multi-recipient send response") - for serviceID := range deviceIDs { - if slices.Contains(respData.UUIDs404, serviceID) { - err = cli.Store.ACISessionStore.RemoveAllSessionsForServiceID(ctx, serviceID) - if err != nil { - log.Err(err).Stringer("recipient_id", serviceID). - Msg("Failed to remove sessions after 404") - } - cli.Store.RecipientStore.MarkUnregistered(ctx, serviceID, true) - result.FailedToSendTo = append(result.FailedToSendTo, FailedSendResult{ - Recipient: serviceID, - Error: fmt.Errorf("multi-recipient send 404"), - }) - } else { - result.SuccessfullySentTo = append(result.SuccessfullySentTo, SuccessfulSendResult{ - Recipient: serviceID, - Unidentified: true, - }) - } - } - doUnlock() - // Send with fallback for any recipients that couldn't do sender key, plus our own sync copy - return cli.sendToGroup(ctx, fallbackRecipients, content, messageTimestamp, result, groupID) - case 401, 404: - log.Warn().Uint32("status_code", resp.GetStatus()). - Msg("Multi-recipient send failed, falling back to normal send") - doUnlock() - // Fall back to normal send for all recipients - return cli.sendToGroup(ctx, allRecipients, content, messageTimestamp, nil, groupID) - case 409, 410: - log.Warn().Uint32("status_code", resp.GetStatus()). - Msg("Multi-recipient send failed due to outdated device list, refreshing and retrying") - err = cli.handleMultiRecipient409410Response(ctx, resp) - if err != nil { - return nil, err - } - doUnlock() - // Retry recursively after fixing device lists - return cli.sendToGroupWithSenderKey(ctx, groupID, allRecipients, sec, content, messageTimestamp, retries+1) - default: - return nil, fmt.Errorf("unexpected status code %d in multi-recipient send", resp.GetStatus()) - } -} - -func (cli *Client) encryptWithSenderKey( - ctx context.Context, - groupID *libsignalgo.GroupIdentifier, - distributionID uuid.UUID, - myAddress *libsignalgo.Address, - senderKeyRecipients []store.SessionAddressTuple, - content *signalpb.Content, -) ([]byte, error) { - plaintext, err := proto.Marshal(content) - if err != nil { - return nil, fmt.Errorf("failed to marshal content: %w", err) - } - plaintext, err = addPadding(3, plaintext) - if err != nil { - return nil, fmt.Errorf("failed to add padding: %w", err) - } - ciphertext, err := libsignalgo.GroupEncrypt(ctx, plaintext, myAddress, distributionID, cli.Store.SenderKeyStore) - if err != nil { - return nil, fmt.Errorf("failed to encrypt group message: %w", err) - } - cert, err := cli.senderCertificate(ctx, false) - if err != nil { - return nil, fmt.Errorf("failed to get sender certificate: %w", err) - } - usmc, err := libsignalgo.NewUnidentifiedSenderMessageContent(ciphertext, cert, getContentHint(content), groupID) - if err != nil { - return nil, fmt.Errorf("failed to create unidentified sender message content: %w", err) - } - ssCiphertext, err := libsignalgo.SealedSenderMultiRecipientEncrypt(ctx, usmc, senderKeyRecipients, cli.Store.ACIIdentityStore) - if err != nil { - return nil, fmt.Errorf("failed to create sealed sender multi-recipient message: %w", err) - } - return ssCiphertext, nil -} - -func diffRecipients( - prevDevices map[libsignalgo.ServiceID][]int, - newDevices map[libsignalgo.ServiceID]senderKeySendMeta, -) ( - xak *libsignalgo.AccessKey, - devicesAddedTo []libsignalgo.ServiceID, - globalRemovedDevices map[libsignalgo.ServiceID][]int, -) { - collector := make(map[libsignalgo.ServiceID]uint8, max(len(prevDevices), len(newDevices))) - for key := range prevDevices { - collector[key] |= 0b01 - } - for key := range newDevices { - collector[key] |= 0b10 - } - globalRemovedDevices = make(map[libsignalgo.ServiceID][]int) - for serviceID, mask := range collector { - if mask != 0b01 { - xak = xak.Xor(newDevices[serviceID].AccessKey) - } - switch mask { - case 0b01: - // Someone left the group - globalRemovedDevices[serviceID] = prevDevices[serviceID] - case 0b10: - // Someone was added to the group - devicesAddedTo = append(devicesAddedTo, serviceID) - case 0b11: - removedDevices, addedDevices := exslices.Diff(prevDevices[serviceID], newDevices[serviceID].DeviceIDs) - if len(removedDevices) > 0 { - // Device was removed - globalRemovedDevices[serviceID] = removedDevices - } else if len(addedDevices) > 0 { - // User got new devices - devicesAddedTo = append(devicesAddedTo, serviceID) - } - } - } - return -} - -type senderKeySendMeta struct { - DeviceIDs []int - AccessKey *libsignalgo.AccessKey -} - -func (cli *Client) getDevicesIDs( - ctx context.Context, - recipients []libsignalgo.ServiceID, - sendEndorsement SendEndorsementCache, - result *GroupMessageSendResult, -) ( - map[libsignalgo.ServiceID]senderKeySendMeta, - []store.SessionAddressTuple, - []libsignalgo.ServiceID, -) { - log := zerolog.Ctx(ctx) - out := make(map[libsignalgo.ServiceID]senderKeySendMeta) - senderKeyRecipients := make([]store.SessionAddressTuple, 0, len(recipients)) - fallbackRecipients := make([]libsignalgo.ServiceID, 0) - for _, recipient := range recipients { - if recipient == cli.Store.ACIServiceID() { - // We'll send a sync copy to ourselves, not sender key and no need to include in fallback recipients either - continue - } - fallbackRecipients = append(fallbackRecipients, recipient) - if recipient.Type != libsignalgo.ServiceIDTypeACI { - continue - } - _, hasEndorsement := sendEndorsement.MemberEndorsements[recipient] - if !hasEndorsement { - continue - } - profileKey, err := cli.Store.RecipientStore.LoadProfileKey(ctx, recipient.UUID) - if err != nil { - log.Err(err).Stringer("recipient_id", recipient.UUID).Msg("Failed to get profile key") - continue - } else if profileKey == nil { - log.Debug().Stringer("recipient_id", recipient.UUID).Msg("No profile key for recipient") - continue - } - accessKey, err := profileKey.DeriveAccessKey() - if err != nil { - log.Err(err).Stringer("recipient_id", recipient.UUID).Msg("Failed to derive access key") - continue - } - sessions, err := cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, recipient) - if err == nil && len(sessions) == 0 { - // No sessions, make one with prekey - err = cli.FetchAndProcessPreKey(ctx, recipient, -1) - if errors.Is(err, ErrUnregisteredUser) { - fallbackRecipients = fallbackRecipients[:len(fallbackRecipients)-1] - result.FailedToSendTo = append(result.FailedToSendTo, FailedSendResult{ - Recipient: recipient, - Error: err, - }) - log.Debug(). - Stringer("recipient_id", recipient). - Msg("Recipient is not registered, won't try to send") - continue - } else if err != nil { - log.Warn().Err(err).Stringer("recipient_id", recipient.UUID).Msg("Failed to fetch keys for recipient") - continue - } - sessions, err = cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, recipient) - } - if err != nil { - log.Err(err).Stringer("recipient_id", recipient.UUID).Msg("Failed to get sessions for recipient") - continue - } else if len(sessions) == 0 { - log.Debug().Stringer("recipient_id", recipient.UUID).Msg("No sessions for recipient after fetching keys") - continue - } - fallbackRecipients = fallbackRecipients[:len(fallbackRecipients)-1] - out[recipient] = senderKeySendMeta{ - DeviceIDs: exslices.CastFunc(sessions, func(from store.SessionAddressTuple) int { - return from.DeviceID - }), - AccessKey: accessKey, - } - senderKeyRecipients = append(senderKeyRecipients, sessions...) - } - return out, senderKeyRecipients, fallbackRecipients -} diff --git a/pkg/signalmeow/sending.go b/pkg/signalmeow/sending.go index a485b54..c1b2016 100644 --- a/pkg/signalmeow/sending.go +++ b/pkg/signalmeow/sending.go @@ -22,7 +22,6 @@ import ( "encoding/json" "errors" "fmt" - "math/rand/v2" "net/http" "strconv" "strings" @@ -32,7 +31,6 @@ import ( "github.com/rs/zerolog" "go.mau.fi/util/exfmt" "go.mau.fi/util/ptr" - "go.mau.fi/util/random" "google.golang.org/protobuf/proto" "go.mau.fi/mautrix-signal/pkg/libsignalgo" @@ -44,17 +42,15 @@ import ( // Sending func (cli *Client) senderCertificate(ctx context.Context, e164 bool) (*libsignalgo.SenderCertificate, error) { - cli.senderCertificateCache.Lock() - defer cli.senderCertificateCache.Unlock() - cached := cli.senderCertificateNoE164 + cached := cli.SenderCertificateNoE164 if e164 { - cached = cli.senderCertificateWithE164 + cached = cli.SenderCertificateWithE164 } setCache := func(val *libsignalgo.SenderCertificate) { if e164 { - cli.senderCertificateWithE164 = val + cli.SenderCertificateWithE164 = val } else { - cli.senderCertificateNoE164 = val + cli.SenderCertificateNoE164 = val } } if cached != nil { @@ -74,15 +70,17 @@ func (cli *Client) senderCertificate(ctx context.Context, e164 bool) (*libsignal } var r response + username, password := cli.Store.BasicAuthCreds() + opts := &web.HTTPReqOpt{Username: &username, Password: &password} var query string if !e164 { query = "?includeE164=false" } - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, "/v1/certificate/delivery"+query, nil, nil) + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, "/v1/certificate/delivery"+query, opts) if err != nil { return nil, err } - err = web.DecodeWSResponseBody(ctx, &r, resp) + err = web.DecodeHTTPResponseBody(ctx, &r, resp) if err != nil { return nil, err } @@ -145,73 +143,108 @@ func addPadding(version uint32, contents []byte) ([]byte, error) { } } -func (cli *Client) buildMessagesToSend( - ctx context.Context, - recipient libsignalgo.ServiceID, - content *signalpb.Content, - unauthenticated bool, - groupID *libsignalgo.GroupIdentifier, - ctmOverride *libsignalgo.CiphertextMessage, - forceResync bool, -) ([]MyMessage, error) { - if ctx.Value(contextKeyEncryptionLock) != true { - cli.encryptionLock.Lock() - defer cli.encryptionLock.Unlock() +func checkForErrorWithSessions(err error, addresses []*libsignalgo.Address, sessionRecords []*libsignalgo.SessionRecord) error { + if err != nil { + return err } + if addresses == nil || sessionRecords == nil { + return fmt.Errorf("addresses or session records are nil") + } + if len(addresses) != len(sessionRecords) { + return fmt.Errorf("mismatched number of addresses (%d) and session records (%d)", len(addresses), len(sessionRecords)) + } + if len(addresses) == 0 || len(sessionRecords) == 0 { + return fmt.Errorf("no addresses or session records") + } + return nil +} - sessions, err := cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, recipient) - if err == nil && (len(sessions) == 0 || forceResync) { +func (cli *Client) howManyOtherDevicesDoWeHave(ctx context.Context) int { + addresses, _, err := cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, cli.Store.ACIServiceID()) + if err != nil { + return 0 + } + // Filter out our deviceID + otherDevices := 0 + for _, address := range addresses { + deviceID, err := address.DeviceID() + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Error getting deviceID from address") + continue + } + if deviceID != uint(cli.Store.DeviceID) { + otherDevices++ + } + } + return otherDevices +} + +func (cli *Client) buildMessagesToSend(ctx context.Context, recipient libsignalgo.ServiceID, content *signalpb.Content, unauthenticated, isGroup bool) ([]MyMessage, error) { + // We need to prevent multiple encryption operations from happening at once, or else ratchets can race + cli.encryptionLock.Lock() + defer cli.encryptionLock.Unlock() + + addresses, sessionRecords, err := cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, recipient) + if err == nil && (len(addresses) == 0 || len(sessionRecords) == 0) { // No sessions, make one with prekey err = cli.FetchAndProcessPreKey(ctx, recipient, -1) if err != nil { return nil, err } - sessions, err = cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, recipient) + addresses, sessionRecords, err = cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, recipient) } + err = checkForErrorWithSessions(err, addresses, sessionRecords) if err != nil { return nil, err - } else if len(sessions) == 0 { - return nil, fmt.Errorf("no sessions found for recipient %s", recipient.String()) - } - localAddress, err := cli.Store.ACIServiceID().Address(uint(cli.Store.DeviceID)) - if err != nil { - return nil, fmt.Errorf("failed to get own address: %w", err) } - messages := make([]MyMessage, 0, len(sessions)) - for _, tuple := range sessions { + messages := make([]MyMessage, 0, len(addresses)) + for i, recipientAddress := range addresses { + recipientDeviceID, err := recipientAddress.DeviceID() + if err != nil { + return nil, err + } + // Don't send to this device that we are sending from - if recipient == cli.Store.ACIServiceID() && tuple.DeviceID == cli.Store.DeviceID { + if recipient == cli.Store.ACIServiceID() && recipientDeviceID == uint(cli.Store.DeviceID) { zerolog.Ctx(ctx).Debug(). - Int("recipient_device_id", tuple.DeviceID). + Uint("recipient_device_id", recipientDeviceID). Msg("Not sending to the device I'm sending from") continue } + // Build message payload serializedMessage, err := proto.Marshal(content) if err != nil { return nil, err } - paddedMessage, err := addPadding(3, serializedMessage) + paddedMessage, err := addPadding(3, serializedMessage) // TODO: figure out how to get actual version + if err != nil { + return nil, err + } + sessionRecord := sessionRecords[i] + + var envelopeType int + var encryptedPayload []byte + if unauthenticated { + includeE164 := !isGroup && cli.Store.AccountRecord.GetPhoneNumberSharingMode() == signalpb.AccountRecord_EVERYBODY + envelopeType, encryptedPayload, err = cli.buildSSMessageToSend( + ctx, recipientAddress, paddedMessage, getContentHint(content), includeE164, + ) + } else { + envelopeType, encryptedPayload, err = cli.buildAuthedMessageToSend(ctx, recipientAddress, paddedMessage) + } if err != nil { return nil, err } - includeE164 := groupID == nil && cli.Store.AccountRecord.GetPhoneNumberSharingMode() == signalpb.AccountRecord_EVERYBODY - envelopeType, encryptedPayload, err := cli.buildMessageToSend( - ctx, tuple.Address, localAddress, paddedMessage, getContentHint(content), ctmOverride, groupID, includeE164, unauthenticated, - ) - if err != nil { - return nil, err - } - - destinationRegistrationID, err := tuple.Record.GetRemoteRegistrationID() + destinationRegistrationID, err := sessionRecord.GetRemoteRegistrationID() if err != nil { return nil, err } outgoingMessage := MyMessage{ - Type: int(envelopeType), - DestinationDeviceID: tuple.DeviceID, + Type: envelopeType, + DestinationDeviceID: int(recipientDeviceID), DestinationRegistrationID: int(destinationRegistrationID), Content: base64.StdEncoding.EncodeToString(encryptedPayload), } @@ -221,58 +254,54 @@ func (cli *Client) buildMessagesToSend( return messages, nil } -func ctmTypeToEnvelopeType(ctmType libsignalgo.CiphertextMessageType) signalpb.Envelope_Type { - switch ctmType { - case libsignalgo.CiphertextMessageTypeWhisper: - return signalpb.Envelope_DOUBLE_RATCHET // 2 -> 1 - case libsignalgo.CiphertextMessageTypePreKey: - return signalpb.Envelope_PREKEY_MESSAGE // 3 -> 3 - case libsignalgo.CiphertextMessageTypePlaintext: - return signalpb.Envelope_PLAINTEXT_CONTENT // 8 -> 8 - default: - return signalpb.Envelope_UNKNOWN +func (cli *Client) buildAuthedMessageToSend(ctx context.Context, recipientAddress *libsignalgo.Address, paddedMessage []byte) (envelopeType int, encryptedPayload []byte, err error) { + cipherTextMessage, err := libsignalgo.Encrypt( + ctx, + paddedMessage, + recipientAddress, + cli.Store.ACISessionStore, + cli.Store.ACIIdentityStore, + ) + if err != nil { + return 0, nil, err } + encryptedPayload, err = cipherTextMessage.Serialize() + if err != nil { + return 0, nil, err + } + + // OMG Signal are you serious why can't your magic numbers just align + cipherMessageType, _ := cipherTextMessage.MessageType() + if cipherMessageType == libsignalgo.CiphertextMessageTypePreKey { // 3 -> 3 + envelopeType = int(signalpb.Envelope_PREKEY_BUNDLE) + } else if cipherMessageType == libsignalgo.CiphertextMessageTypeWhisper { // 2 -> 1 + envelopeType = int(signalpb.Envelope_CIPHERTEXT) + } else { + return 0, nil, fmt.Errorf("unknown message type: %v", cipherMessageType) + } + return envelopeType, encryptedPayload, nil } -func (cli *Client) buildMessageToSend( - ctx context.Context, - recipientAddress, localAddress *libsignalgo.Address, - paddedMessage []byte, - contentHint libsignalgo.UnidentifiedSenderMessageContentHint, - ciphertextMessage *libsignalgo.CiphertextMessage, - groupID *libsignalgo.GroupIdentifier, - includeE164, sealedSender bool, -) (envelopeType signalpb.Envelope_Type, encryptedPayload []byte, err error) { - if ciphertextMessage == nil { - ciphertextMessage, err = libsignalgo.Encrypt( - ctx, - paddedMessage, - recipientAddress, - localAddress, - cli.Store.ACISessionStore, - cli.Store.ACIIdentityStore, - ) - if err != nil { - return 0, nil, err - } - } - cipherMessageType, _ := ciphertextMessage.MessageType() - envelopeType = ctmTypeToEnvelopeType(cipherMessageType) - if !sealedSender { - encryptedPayload, err = ciphertextMessage.Serialize() - return - } +func (cli *Client) buildSSMessageToSend(ctx context.Context, recipientAddress *libsignalgo.Address, paddedMessage []byte, contentHint libsignalgo.UnidentifiedSenderMessageContentHint, includeE164 bool) (envelopeType int, encryptedPayload []byte, err error) { cert, err := cli.senderCertificate(ctx, includeE164) if err != nil { return 0, nil, err } - usmc, err := libsignalgo.NewUnidentifiedSenderMessageContent(ciphertextMessage, cert, contentHint, groupID) + encryptedPayload, err = libsignalgo.SealedSenderEncryptPlaintext( + ctx, + paddedMessage, + contentHint, + recipientAddress, + cert, + cli.Store.ACISessionStore, + cli.Store.ACIIdentityStore, + ) if err != nil { return 0, nil, err } - encryptedPayload, err = libsignalgo.SealedSenderEncrypt(ctx, usmc, recipientAddress, cli.Store.ACIIdentityStore) - envelopeType = signalpb.Envelope_UNIDENTIFIED_SENDER - return + envelopeType = int(signalpb.Envelope_UNIDENTIFIED_SENDER) + + return envelopeType, encryptedPayload, nil } type SuccessfulSendResult struct { @@ -302,89 +331,102 @@ type SendResult interface { func (gmsr *GroupMessageSendResult) isSendResult() {} func (smsr *SendMessageResult) isSendResult() {} -func WrapSyncMessage(content *signalpb.SyncMessage) *signalpb.Content { - content.Padding = random.Bytes(rand.IntN(511) + 1) +func contentFromDataMessage(dataMessage *signalpb.DataMessage) *signalpb.Content { return &signalpb.Content{ - Content: &signalpb.Content_SyncMessage{SyncMessage: content}, + DataMessage: dataMessage, } } - -func syncSentMessage(sent *signalpb.SyncMessage_Sent) *signalpb.Content { - return WrapSyncMessage(&signalpb.SyncMessage{ - Content: &signalpb.SyncMessage_Sent_{ - Sent: sent, - }, - }) -} - func syncMessageFromGroupDataMessage(dataMessage *signalpb.DataMessage, results []SuccessfulSendResult) *signalpb.Content { unidentifiedStatuses := []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{} for _, result := range results { unidentifiedStatuses = append(unidentifiedStatuses, &signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ - DestinationServiceIdBinary: result.Recipient.Bytes(), - Unidentified: &result.Unidentified, + DestinationServiceId: proto.String(result.Recipient.String()), + Unidentified: &result.Unidentified, }) } - return syncSentMessage(&signalpb.SyncMessage_Sent{ - Message: dataMessage, - Timestamp: dataMessage.Timestamp, - UnidentifiedStatus: unidentifiedStatuses, - ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), - }) + return &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ + Sent: &signalpb.SyncMessage_Sent{ + Message: dataMessage, + Timestamp: dataMessage.Timestamp, + UnidentifiedStatus: unidentifiedStatuses, + ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), + }, + }, + } } - func syncMessageFromGroupEditMessage(editMessage *signalpb.EditMessage, results []SuccessfulSendResult) *signalpb.Content { unidentifiedStatuses := []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{} for _, result := range results { unidentifiedStatuses = append(unidentifiedStatuses, &signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ - DestinationServiceIdBinary: result.Recipient.Bytes(), - Unidentified: &result.Unidentified, + DestinationServiceId: proto.String(result.Recipient.String()), + Unidentified: &result.Unidentified, }) } - return syncSentMessage(&signalpb.SyncMessage_Sent{ - EditMessage: editMessage, - Timestamp: editMessage.GetDataMessage().Timestamp, - UnidentifiedStatus: unidentifiedStatuses, - ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), - }) + return &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ + Sent: &signalpb.SyncMessage_Sent{ + EditMessage: editMessage, + Timestamp: editMessage.GetDataMessage().Timestamp, + UnidentifiedStatus: unidentifiedStatuses, + ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), + }, + }, + } } func syncMessageFromSoloDataMessage(dataMessage *signalpb.DataMessage, result SuccessfulSendResult) *signalpb.Content { - return syncSentMessage(&signalpb.SyncMessage_Sent{ - Message: dataMessage, - DestinationE164: result.RecipientE164, - DestinationServiceIdBinary: result.Recipient.Bytes(), - Timestamp: dataMessage.Timestamp, - ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), - UnidentifiedStatus: []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ - { - DestinationServiceIdBinary: result.Recipient.Bytes(), - Unidentified: &result.Unidentified, - DestinationPniIdentityKey: result.DestinationPNIIdentityKey.TrySerialize(), + return &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ + Sent: &signalpb.SyncMessage_Sent{ + Message: dataMessage, + DestinationE164: result.RecipientE164, + DestinationServiceId: proto.String(result.Recipient.String()), + Timestamp: dataMessage.Timestamp, + ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), + UnidentifiedStatus: []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ + { + DestinationServiceId: proto.String(result.Recipient.String()), + Unidentified: &result.Unidentified, + DestinationPniIdentityKey: result.DestinationPNIIdentityKey.TrySerialize(), + }, + }, }, }, - }) + } } func syncMessageFromSoloEditMessage(editMessage *signalpb.EditMessage, result SuccessfulSendResult) *signalpb.Content { - return syncSentMessage(&signalpb.SyncMessage_Sent{ - EditMessage: editMessage, - DestinationE164: result.RecipientE164, - DestinationServiceIdBinary: result.Recipient.Bytes(), - Timestamp: editMessage.DataMessage.Timestamp, - ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), - UnidentifiedStatus: []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ - { - DestinationServiceIdBinary: result.Recipient.Bytes(), - Unidentified: &result.Unidentified, - DestinationPniIdentityKey: result.DestinationPNIIdentityKey.TrySerialize(), + return &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ + Sent: &signalpb.SyncMessage_Sent{ + EditMessage: editMessage, + DestinationE164: result.RecipientE164, + DestinationServiceId: proto.String(result.Recipient.String()), + Timestamp: editMessage.DataMessage.Timestamp, + ExpirationStartTimestamp: ptr.Ptr(uint64(time.Now().UnixMilli())), + UnidentifiedStatus: []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ + { + DestinationServiceId: proto.String(result.Recipient.String()), + Unidentified: &result.Unidentified, + DestinationPniIdentityKey: result.DestinationPNIIdentityKey.TrySerialize(), + }, + }, }, }, - }) + } } func syncMessageFromReadReceiptMessage(ctx context.Context, receiptMessage *signalpb.ReceiptMessage, messageSender libsignalgo.ServiceID) *signalpb.Content { - if *receiptMessage.Type != signalpb.ReceiptMessage_READ || messageSender.Type != libsignalgo.ServiceIDTypeACI { + if *receiptMessage.Type != signalpb.ReceiptMessage_READ { + zerolog.Ctx(ctx).Warn(). + Any("receipt_message_type", receiptMessage.Type). + Msg("syncMessageFromReadReceiptMessage called with non-read receipt message") + return nil + } else if messageSender.Type != libsignalgo.ServiceIDTypeACI { + zerolog.Ctx(ctx).Warn(). + Stringer("message_sender", messageSender). + Msg("syncMessageFromReadReceiptMessage called with non-ACI message sender") return nil } read := []*signalpb.SyncMessage_Read{} @@ -394,9 +436,11 @@ func syncMessageFromReadReceiptMessage(ctx context.Context, receiptMessage *sign SenderAci: proto.String(messageSender.UUID.String()), }) } - return WrapSyncMessage(&signalpb.SyncMessage{ - Read: read, - }) + return &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ + Read: read, + }, + } } func (cli *Client) SendContactSyncRequest(ctx context.Context) error { @@ -412,13 +456,13 @@ func (cli *Client) SendContactSyncRequest(ctx context.Context) error { } cli.LastContactRequestTime = time.Now() - _, err := cli.sendContent(ctx, cli.Store.ACIServiceID(), uint64(time.Now().UnixMilli()), WrapSyncMessage(&signalpb.SyncMessage{ - Content: &signalpb.SyncMessage_Request_{ + _, err := cli.sendContent(ctx, cli.Store.ACIServiceID(), uint64(time.Now().UnixMilli()), &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ Request: &signalpb.SyncMessage_Request{ Type: signalpb.SyncMessage_Request_CONTACTS.Enum(), }, }, - }), 0, false, nil, nil) + }, 0, false, false) if err != nil { log.Err(err).Msg("Failed to send contact sync request message to myself") return err @@ -432,13 +476,13 @@ func (cli *Client) SendStorageMasterKeyRequest(ctx context.Context) error { Logger() ctx = log.WithContext(ctx) - _, err := cli.sendContent(ctx, cli.Store.ACIServiceID(), uint64(time.Now().UnixMilli()), WrapSyncMessage(&signalpb.SyncMessage{ - Content: &signalpb.SyncMessage_Request_{ + _, err := cli.sendContent(ctx, cli.Store.ACIServiceID(), uint64(time.Now().UnixMilli()), &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ Request: &signalpb.SyncMessage_Request{ Type: signalpb.SyncMessage_Request_KEYS.Enum(), }, }, - }), 0, false, nil, nil) + }, 0, false, false) if err != nil { log.Err(err).Msg("Failed to send key sync request message to myself") return err @@ -458,182 +502,142 @@ func TypingMessage(isTyping bool) *signalpb.Content { } else { action = signalpb.TypingMessage_STOPPED } + tm := &signalpb.TypingMessage{ + Timestamp: ×tamp, + Action: &action, + } return &signalpb.Content{ - Content: &signalpb.Content_TypingMessage{ - TypingMessage: &signalpb.TypingMessage{ - Timestamp: ×tamp, - Action: &action, - }, - }, + TypingMessage: tm, } } func DeliveredReceiptMessageForTimestamps(timestamps []uint64) *signalpb.Content { + rm := &signalpb.ReceiptMessage{ + Timestamp: timestamps, + Type: signalpb.ReceiptMessage_DELIVERY.Enum(), + } return &signalpb.Content{ - Content: &signalpb.Content_ReceiptMessage{ - ReceiptMessage: &signalpb.ReceiptMessage{ - Timestamp: timestamps, - Type: signalpb.ReceiptMessage_DELIVERY.Enum(), - }, - }, + ReceiptMessage: rm, } } func ReadReceptMessageForTimestamps(timestamps []uint64) *signalpb.Content { + rm := &signalpb.ReceiptMessage{ + Timestamp: timestamps, + Type: signalpb.ReceiptMessage_READ.Enum(), + } return &signalpb.Content{ - Content: &signalpb.Content_ReceiptMessage{ - ReceiptMessage: &signalpb.ReceiptMessage{ - Timestamp: timestamps, - Type: signalpb.ReceiptMessage_READ.Enum(), - }, - }, + ReceiptMessage: rm, } } -func WrapDataMessage(dm *signalpb.DataMessage) *signalpb.Content { +func wrapDataMessageInContent(dm *signalpb.DataMessage) *signalpb.Content { return &signalpb.Content{ - Content: &signalpb.Content_DataMessage{DataMessage: dm}, + DataMessage: dm, } } -func WrapEditMessage(dm *signalpb.EditMessage) *signalpb.Content { - return &signalpb.Content{ - Content: &signalpb.Content_EditMessage{EditMessage: dm}, - } -} - -func (cli *Client) addSendCache(recipient libsignalgo.ServiceID, groupID types.GroupIdentifier, ts uint64, content *signalpb.Content) { - cli.sendCache.Push(sendCacheKey{ - recipient: recipient, - groupID: groupID, - timestamp: ts, - }, content) -} - func (cli *Client) SendGroupUpdate(ctx context.Context, group *Group, groupContext *signalpb.GroupContextV2, groupChange *GroupChange) (*GroupMessageSendResult, error) { log := zerolog.Ctx(ctx).With(). Str("action", "send group change message"). Stringer("group_id", group.GroupIdentifier). Logger() - gidBytes, err := group.GroupIdentifier.Bytes() - if err != nil { - return nil, err - } ctx = log.WithContext(ctx) timestamp := currentMessageTimestamp() dm := &signalpb.DataMessage{ Timestamp: ×tamp, GroupV2: groupContext, } - content := WrapDataMessage(dm) - var recipients []libsignalgo.ServiceID + content := wrapDataMessageInContent(dm) + var recipients []*libsignalgo.ServiceID for _, member := range group.Members { serviceID := member.UserServiceID() - recipients = append(recipients, serviceID) - cli.addSendCache(serviceID, group.GroupIdentifier, timestamp, content) + recipients = append(recipients, &serviceID) } for _, member := range group.PendingMembers { - recipients = append(recipients, member.ServiceID) - cli.addSendCache(member.ServiceID, group.GroupIdentifier, timestamp, content) + recipients = append(recipients, &member.ServiceID) } if groupChange != nil { for _, member := range groupChange.AddPendingMembers { - recipients = append(recipients, member.ServiceID) - cli.addSendCache(member.ServiceID, group.GroupIdentifier, timestamp, content) + recipients = append(recipients, &member.ServiceID) } for _, member := range groupChange.AddMembers { serviceID := member.UserServiceID() - recipients = append(recipients, serviceID) - cli.addSendCache(serviceID, group.GroupIdentifier, timestamp, content) + recipients = append(recipients, &serviceID) } } - return cli.sendToGroup(ctx, recipients, content, timestamp, nil, &gidBytes) + return cli.sendToGroup(ctx, recipients, content, timestamp) } -const enableSenderKeySend = true - func (cli *Client) SendGroupMessage(ctx context.Context, gid types.GroupIdentifier, content *signalpb.Content) (*GroupMessageSendResult, error) { log := zerolog.Ctx(ctx).With(). Str("action", "send group message"). Stringer("group_id", gid). Logger() ctx = log.WithContext(ctx) - group, endorsement, err := cli.RetrieveGroupByID(ctx, gid, 0) + group, err := cli.RetrieveGroupByID(ctx, gid, 0) if err != nil { return nil, err } + var messageTimestamp uint64 - switch content := content.Content.(type) { - case *signalpb.Content_DataMessage: + if content.GetDataMessage() != nil { messageTimestamp = content.DataMessage.GetTimestamp() content.DataMessage.GroupV2 = groupMetadataForDataMessage(*group) - case *signalpb.Content_EditMessage: + } else if content.GetEditMessage().GetDataMessage() != nil { messageTimestamp = content.EditMessage.DataMessage.GetTimestamp() content.EditMessage.DataMessage.GroupV2 = groupMetadataForDataMessage(*group) - case *signalpb.Content_TypingMessage: - messageTimestamp = content.TypingMessage.GetTimestamp() - groupIDBytes, err := group.GroupIdentifier.Bytes() - if err != nil { - return nil, err - } - content.TypingMessage.GroupId = groupIDBytes[:] } - var recipients []libsignalgo.ServiceID + var recipients []*libsignalgo.ServiceID for _, member := range group.Members { - recipients = append(recipients, member.UserServiceID()) + serviceID := member.UserServiceID() + recipients = append(recipients, &serviceID) } - gidBytes, err := gid.Bytes() - if err != nil { - return nil, err - } - if enableSenderKeySend { - return cli.sendToGroupWithSenderKey(ctx, &gidBytes, recipients, ptr.Val(endorsement), content, messageTimestamp, 0) - } - return cli.sendToGroup(ctx, recipients, content, messageTimestamp, nil, &gidBytes) + return cli.sendToGroup(ctx, recipients, content, messageTimestamp) } -func (cli *Client) sendToGroup( - ctx context.Context, - recipients []libsignalgo.ServiceID, - content *signalpb.Content, - messageTimestamp uint64, - result *GroupMessageSendResult, - groupID *libsignalgo.GroupIdentifier, -) (*GroupMessageSendResult, error) { - if result == nil { - result = &GroupMessageSendResult{ - SuccessfullySentTo: []SuccessfulSendResult{}, - FailedToSendTo: []FailedSendResult{}, - } - } - if content.GetTypingMessage() != nil { - // Never send typing messages via fallback path - return result, nil +func (cli *Client) sendToGroup(ctx context.Context, recipients []*libsignalgo.ServiceID, content *signalpb.Content, messageTimestamp uint64) (*GroupMessageSendResult, error) { + // Send to each member of the group + result := &GroupMessageSendResult{ + SuccessfullySentTo: []SuccessfulSendResult{}, + FailedToSendTo: []FailedSendResult{}, } for _, recipient := range recipients { if recipient.Type == libsignalgo.ServiceIDTypeACI && recipient.UUID == cli.Store.ACI { // Don't send normal DataMessages to ourselves continue } - log := zerolog.Ctx(ctx).With().Stringer("member", recipient).Logger() + log := zerolog.Ctx(ctx).With().Stringer("member", *recipient).Logger() ctx := log.WithContext(ctx) - sentUnidentified, err := cli.sendContent(ctx, recipient, messageTimestamp, content, 0, true, groupID, nil) + sentUnidentified, err := cli.sendContent(ctx, *recipient, messageTimestamp, content, 0, true, true) if err != nil { result.FailedToSendTo = append(result.FailedToSendTo, FailedSendResult{ - Recipient: recipient, + Recipient: *recipient, Error: err, }) log.Err(err).Msg("Failed to send to user") } else { result.SuccessfullySentTo = append(result.SuccessfullySentTo, SuccessfulSendResult{ - Recipient: recipient, + Recipient: *recipient, Unidentified: sentUnidentified, }) log.Trace().Msg("Successfully sent to user") } } - cli.sendGroupSyncCopy(ctx, content, messageTimestamp, result, groupID) + // No need to send to ourselves if we don't have any other devices + if cli.howManyOtherDevicesDoWeHave(ctx) > 0 { + var syncContent *signalpb.Content + if content.GetDataMessage() != nil { + syncContent = syncMessageFromGroupDataMessage(content.DataMessage, result.SuccessfullySentTo) + } else if content.GetEditMessage() != nil { + syncContent = syncMessageFromGroupEditMessage(content.EditMessage, result.SuccessfullySentTo) + } + _, selfSendErr := cli.sendContent(ctx, cli.Store.ACIServiceID(), messageTimestamp, syncContent, 0, true, true) + if selfSendErr != nil { + zerolog.Ctx(ctx).Err(selfSendErr).Msg("Failed to send sync message to myself") + } + } if len(result.FailedToSendTo) == 0 && len(result.SuccessfullySentTo) == 0 { return result, nil // I only sent to myself @@ -646,46 +650,24 @@ func (cli *Client) sendToGroup( return result, nil } -func (cli *Client) sendGroupSyncCopy( - ctx context.Context, - rawContent *signalpb.Content, - messageTimestamp uint64, - result *GroupMessageSendResult, - groupID *libsignalgo.GroupIdentifier, -) { - var syncContent *signalpb.Content - switch content := rawContent.Content.(type) { - case *signalpb.Content_DataMessage: - syncContent = syncMessageFromGroupDataMessage(content.DataMessage, result.SuccessfullySentTo) - case *signalpb.Content_EditMessage: - syncContent = syncMessageFromGroupEditMessage(content.EditMessage, result.SuccessfullySentTo) - } - if syncContent != nil { - _, selfSendErr := cli.sendContent(ctx, cli.Store.ACIServiceID(), messageTimestamp, syncContent, 0, true, groupID, nil) - if selfSendErr != nil { - zerolog.Ctx(ctx).Err(selfSendErr).Msg("Failed to send sync message to myself") +func (cli *Client) sendSyncCopy(ctx context.Context, content *signalpb.Content, messageTS uint64, result *SuccessfulSendResult) bool { + // If we have other devices, send Sync messages to them too + if cli.howManyOtherDevicesDoWeHave(ctx) > 0 { + var syncContent *signalpb.Content + if content.GetDataMessage() != nil { + syncContent = syncMessageFromSoloDataMessage(content.DataMessage, *result) + } else if content.GetEditMessage() != nil { + syncContent = syncMessageFromSoloEditMessage(content.EditMessage, *result) + } else if content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_READ { + syncContent = syncMessageFromReadReceiptMessage(ctx, content.ReceiptMessage, result.Recipient) } - } -} - -func (cli *Client) sendSyncCopy(ctx context.Context, rawContent *signalpb.Content, messageTS uint64, result *SuccessfulSendResult) bool { - var syncContent *signalpb.Content - switch content := rawContent.Content.(type) { - case *signalpb.Content_DataMessage: - syncContent = syncMessageFromSoloDataMessage(content.DataMessage, *result) - case *signalpb.Content_EditMessage: - syncContent = syncMessageFromSoloEditMessage(content.EditMessage, *result) - case *signalpb.Content_ReceiptMessage: - syncContent = syncMessageFromReadReceiptMessage(ctx, content.ReceiptMessage, result.Recipient) - case *signalpb.Content_SyncMessage: - syncContent = rawContent - } - if syncContent != nil { - _, selfSendErr := cli.sendContent(ctx, cli.Store.ACIServiceID(), messageTS, syncContent, 0, true, nil, nil) - if selfSendErr != nil { - zerolog.Ctx(ctx).Err(selfSendErr).Msg("Failed to send sync message to myself") - } else { - return true + if syncContent != nil { + _, selfSendErr := cli.sendContent(ctx, cli.Store.ACIServiceID(), messageTS, syncContent, 0, true, false) + if selfSendErr != nil { + zerolog.Ctx(ctx).Err(selfSendErr).Msg("Failed to send sync message to myself") + } else { + return true + } } } return false @@ -694,39 +676,24 @@ func (cli *Client) sendSyncCopy(ctx context.Context, rawContent *signalpb.Conten func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.ServiceID, content *signalpb.Content) SendMessageResult { // Assemble the content to send var messageTimestamp uint64 - switch realContent := content.Content.(type) { - case *signalpb.Content_DataMessage: - messageTimestamp = *realContent.DataMessage.Timestamp - case *signalpb.Content_EditMessage: - messageTimestamp = *realContent.EditMessage.DataMessage.Timestamp - case *signalpb.Content_TypingMessage: - messageTimestamp = *realContent.TypingMessage.Timestamp - case *signalpb.Content_SyncMessage, - *signalpb.Content_NullMessage, - *signalpb.Content_ReceiptMessage, - *signalpb.Content_DecryptionErrorMessage: - messageTimestamp = currentMessageTimestamp() - case *signalpb.Content_StoryMessage: - // not yet supported - default: - if content.SenderKeyDistributionMessage == nil && content.PniSignatureMessage == nil { - panic(fmt.Errorf("unsupported payload in SendMessage")) - } + if content.GetDataMessage() != nil { + messageTimestamp = *content.DataMessage.Timestamp + } else if content.GetEditMessage().GetDataMessage() != nil { + messageTimestamp = *content.EditMessage.DataMessage.Timestamp + } else { messageTimestamp = currentMessageTimestamp() } + needsPNISignature := false var aci, pni uuid.UUID if recipientID.Type == libsignalgo.ServiceIDTypeACI { aci = recipientID.UUID } else if recipientID.Type == libsignalgo.ServiceIDTypePNI { pni = recipientID.UUID } - isTypingOrReceipt := content.GetTypingMessage() != nil || content.GetReceiptMessage() != nil + isTypingOrReceipt := content.TypingMessage != nil || content.ReceiptMessage != nil recipientData, err := cli.Store.RecipientStore.LoadAndUpdateRecipient(ctx, aci, pni, func(recipientData *types.Recipient) (changed bool, err error) { - if content.GetDataMessage().GetFlags() == uint32(signalpb.DataMessage_PROFILE_KEY_UPDATE) { - recipientData.Whitelisted = ptr.Ptr(true) - } - needsPNISignature := recipientID.Type == libsignalgo.ServiceIDTypeACI && recipientData.NeedsPNISignature - if needsPNISignature && !isTypingOrReceipt && content.PniSignatureMessage == nil { + needsPNISignature = recipientID.Type == libsignalgo.ServiceIDTypeACI && recipientData.NeedsPNISignature + if needsPNISignature && !isTypingOrReceipt { zerolog.Ctx(ctx).Debug(). Stringer("recipient", recipientID). Msg("Including PNI identity in message") @@ -740,9 +707,6 @@ func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.Serv Signature: sig, } return true, nil - } else if needsPNISignature && content.PniSignatureMessage != nil { - recipientData.NeedsPNISignature = false - return true, nil } return false, nil }) @@ -750,7 +714,7 @@ func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.Serv zerolog.Ctx(ctx).Err(err).Msg("Failed to get message recipient data") } // Treat needs PNI signature as "this is a message request" and don't send receipts/typing - if recipientData.ProbablyMessageRequest() && isTypingOrReceipt { + if needsPNISignature && isTypingOrReceipt { zerolog.Ctx(ctx).Debug().Msg("Not sending typing/receipt message to recipient as needs PNI signature flag is set") res := SuccessfulSendResult{Recipient: recipientID} if content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_READ { @@ -758,7 +722,7 @@ func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.Serv cli.sendSyncCopy(ctx, content, messageTimestamp, &res) } return SendMessageResult{WasSuccessful: true, SuccessfulSendResult: res} - } else if content.GetTypingMessage() != nil && cli.Store.DeviceData.AccountRecord != nil && !cli.Store.DeviceData.AccountRecord.GetTypingIndicators() { + } else if content.TypingMessage != nil && cli.Store.DeviceData.AccountRecord != nil && !cli.Store.DeviceData.AccountRecord.GetTypingIndicators() { zerolog.Ctx(ctx).Debug().Msg("Not sending typing message as typing indicators are disabled") res := SuccessfulSendResult{Recipient: recipientID} return SendMessageResult{WasSuccessful: true, SuccessfulSendResult: res} @@ -770,7 +734,7 @@ func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.Serv return SendMessageResult{WasSuccessful: true, SuccessfulSendResult: res} } - isDeliveryReceipt := content.GetReceiptMessage() != nil && content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_DELIVERY + isDeliveryReceipt := content.ReceiptMessage != nil && content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_DELIVERY if recipientID == cli.Store.ACIServiceID() && !isDeliveryReceipt { res := SuccessfulSendResult{ Recipient: recipientID, @@ -783,9 +747,8 @@ func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.Serv } } - cli.addSendCache(recipientID, "", messageTimestamp, content) // Send to the recipient - sentUnidentified, err := cli.sendContent(ctx, recipientID, messageTimestamp, content, 0, true, nil, nil) + sentUnidentified, err := cli.sendContent(ctx, recipientID, messageTimestamp, content, 0, true, false) if err != nil { return SendMessageResult{ WasSuccessful: false, @@ -824,38 +787,26 @@ func currentMessageTimestamp() uint64 { } func isSyncMessageUrgent(content *signalpb.SyncMessage) bool { - switch content.Content.(type) { - case *signalpb.SyncMessage_Request_, - *signalpb.SyncMessage_Sent_: - return true - default: - return false - } + return content.Sent != nil || content.Request != nil } -func isUrgent(rawContent *signalpb.Content) bool { - switch content := rawContent.Content.(type) { - case *signalpb.Content_SyncMessage: - return isSyncMessageUrgent(content.SyncMessage) - case *signalpb.Content_DataMessage, - *signalpb.Content_EditMessage, - *signalpb.Content_CallMessage, - *signalpb.Content_StoryMessage: - return true - default: - return false - } +func isUrgent(content *signalpb.Content) bool { + return content.DataMessage != nil || + content.CallMessage != nil || + content.StoryMessage != nil || + content.EditMessage != nil || + (content.SyncMessage != nil && isSyncMessageUrgent(content.SyncMessage)) } -func getContentHint(rawContent *signalpb.Content) libsignalgo.UnidentifiedSenderMessageContentHint { - switch rawContent.Content.(type) { - case *signalpb.Content_DataMessage, *signalpb.Content_EditMessage: - return libsignalgo.UnidentifiedSenderMessageContentHintResendable - case *signalpb.Content_TypingMessage, *signalpb.Content_ReceiptMessage: +func getContentHint(content *signalpb.Content) libsignalgo.UnidentifiedSenderMessageContentHint { + if content.DataMessage != nil || content.EditMessage != nil { + // TODO add support for resending before setting this + //return libsignalgo.UnidentifiedSenderMessageContentHintResendable + } + if content.TypingMessage != nil || content.ReceiptMessage != nil { return libsignalgo.UnidentifiedSenderMessageContentHintImplicit - default: - return libsignalgo.UnidentifiedSenderMessageContentHintDefault } + return libsignalgo.UnidentifiedSenderMessageContentHintDefault } func (cli *Client) sendContent( @@ -865,8 +816,7 @@ func (cli *Client) sendContent( content *signalpb.Content, retryCount int, useUnidentifiedSender bool, - groupID *libsignalgo.GroupIdentifier, - ctmOverride *libsignalgo.CiphertextMessage, + isGroup bool, ) (sentUnidentified bool, err error) { log := zerolog.Ctx(ctx).With(). Str("action", "send content"). @@ -874,19 +824,18 @@ func (cli *Client) sendContent( Uint64("timestamp", messageTimestamp). Logger() ctx = log.WithContext(ctx) + log.Trace().Any("raw_content", content).Stringer("recipient", recipient).Msg("Raw data of outgoing message") // If it's a data message, add our profile key - if content.GetDataMessage() != nil && content.GetDataMessage().ProfileKey == nil { + if content.DataMessage != nil { profileKey, err := cli.ProfileKeyForSignalID(ctx, cli.Store.ACI) if err != nil { log.Err(err).Msg("Error getting profile key, not adding to outgoing message") } else { - content.GetDataMessage().ProfileKey = profileKey.Slice() + content.DataMessage.ProfileKey = profileKey.Slice() } } - log.Trace().Any("raw_content", content).Stringer("recipient", recipient).Msg("Raw data of outgoing message") - if retryCount > 3 { log.Error().Int("retry_count", retryCount).Msg("sendContent too many retries") return false, fmt.Errorf("too many retries") @@ -914,16 +863,9 @@ func (cli *Client) sendContent( useUnidentifiedSender = false } } - if !useUnidentifiedSender && content.SenderKeyDistributionMessage != nil { - return false, fmt.Errorf("won't send sender key distribution message without sealed sender") - } var messages []MyMessage - messages, err = cli.buildMessagesToSend(ctx, recipient, content, useUnidentifiedSender, groupID, ctmOverride, false) - if errors.Is(err, libsignalgo.ErrorCodeSessionNotFound) { - log.Err(err).Msg("Got session not found error from libsignal, trying to refetch prekeys") - messages, err = cli.buildMessagesToSend(ctx, recipient, content, useUnidentifiedSender, groupID, ctmOverride, true) - } + messages, err = cli.buildMessagesToSend(ctx, recipient, content, useUnidentifiedSender, isGroup) if err != nil { log.Err(err).Msg("Error building messages to send") return false, err @@ -940,17 +882,17 @@ func (cli *Client) sendContent( return false, err } path := fmt.Sprintf("/v1/messages/%s", recipient) + request := web.CreateWSRequest(http.MethodPut, path, jsonBytes, nil, nil) var response *signalpb.WebSocketResponseMessage - header := http.Header{} - header.Set("Content-Type", string(web.ContentTypeJSON)) if useUnidentifiedSender { log.Trace().Msg("Sending message over unidentified WS") - header.Set("Unidentified-Access-Key", accessKey.String()) - response, err = cli.UnauthedWS.SendRequest(ctx, http.MethodPut, path, jsonBytes, header) + base64AccessKey := base64.StdEncoding.EncodeToString(accessKey[:]) + request.Headers = append(request.Headers, "unidentified-access-key:"+base64AccessKey) + response, err = cli.UnauthedWS.SendRequest(ctx, request) } else { log.Trace().Msg("Sending message over authed WS") - response, err = cli.AuthedWS.SendRequest(ctx, http.MethodPut, path, jsonBytes, header) + response, err = cli.AuthedWS.SendRequest(ctx, request) } sentUnidentified = useUnidentifiedSender if err != nil { @@ -980,14 +922,11 @@ func (cli *Client) sendContent( } if needToRetry { - if *response.Status == 409 || *response.Status == 410 { - err = cli.handleSingleRecipient409410Response(ctx, recipient, response) - if content.SenderKeyDistributionMessage != nil { - if err == nil { - err = ErrDevicesChanged - } - return false, err - } + var err error + if *response.Status == 409 { + err = cli.handle409(ctx, recipient, response) + } else if *response.Status == 410 { + err = cli.handle410(ctx, recipient, response) } else if *response.Status == 428 { err = cli.handle428(ctx, recipient, response) } @@ -995,29 +934,19 @@ func (cli *Client) sendContent( return false, err } // Try to send again (**RECURSIVELY**) - sentUnidentified, err = cli.sendContent(ctx, recipient, messageTimestamp, content, retryCount+1, sentUnidentified, groupID, ctmOverride) + sentUnidentified, err = cli.sendContent(ctx, recipient, messageTimestamp, content, retryCount+1, sentUnidentified, isGroup) if err != nil { log.Err(err).Msg("2nd try sendMessage error") return sentUnidentified, err } } else if *response.Status == 401 && useUnidentifiedSender { - if content.SenderKeyDistributionMessage != nil { - return sentUnidentified, fmt.Errorf("unauthorized to send sender key distribution message via sealed sender") - } log.Debug().Msg("Retrying send without sealed sender") // Try to send again (**RECURSIVELY**) - sentUnidentified, err = cli.sendContent(ctx, recipient, messageTimestamp, content, retryCount+1, false, groupID, ctmOverride) + sentUnidentified, err = cli.sendContent(ctx, recipient, messageTimestamp, content, retryCount+1, false, isGroup) if err != nil { log.Err(err).Msg("2nd try sendMessage error") return sentUnidentified, err } - } else if *response.Status == 404 { - err = cli.Store.ACISessionStore.RemoveAllSessionsForServiceID(ctx, recipient) - if err != nil { - log.Err(err).Msg("Failed to remove sessions after 404") - } - cli.Store.RecipientStore.MarkUnregistered(ctx, recipient, true) - return sentUnidentified, fmt.Errorf("%w (send returned 404)", ErrUnregisteredUser) } else if *response.Status != 200 { return sentUnidentified, fmt.Errorf("unexpected status code while sending: %d", *response.Status) } @@ -1025,88 +954,81 @@ func (cli *Client) sendContent( return sentUnidentified, nil } -type SingleRecipient409410Response struct { - MissingDevices []uint `json:"missingDevices"` - ExtraDevices []uint `json:"extraDevices"` - StaleDevices []uint `json:"staleDevices"` -} - -type MultiRecipient409410Response struct { - UUID libsignalgo.ServiceID `json:"uuid"` - Devices SingleRecipient409410Response `json:"devices"` -} - -type MultiRecipient200Response struct { - UUIDs404 []libsignalgo.ServiceID `json:"uuids404"` - NeedsSync bool `json:"needsSync"` -} - -func (cli *Client) handleSingleRecipient409410Response(ctx context.Context, recipient libsignalgo.ServiceID, response *signalpb.WebSocketResponseMessage) error { - var body SingleRecipient409410Response - err := json.Unmarshal(response.Body, &body) - if err != nil { - return fmt.Errorf("failed to unmarshal error response body: %w", err) - } - return cli.handle409410(ctx, recipient, body) -} - -func (cli *Client) handleMultiRecipient409410Response(ctx context.Context, response *signalpb.WebSocketResponseMessage) error { - var body []MultiRecipient409410Response - err := json.Unmarshal(response.Body, &body) - if err != nil { - return fmt.Errorf("failed to unmarshal error response body: %w", err) - } - for _, recipientBody := range body { - err = cli.handle409410(ctx, recipientBody.UUID, recipientBody.Devices) - if err != nil { - return err - } - } - return nil -} - -func (cli *Client) handle409410(ctx context.Context, recipient libsignalgo.ServiceID, body SingleRecipient409410Response) error { +// A 409 means our device list was out of date, so we will fix it up +func (cli *Client) handle409(ctx context.Context, recipient libsignalgo.ServiceID, response *signalpb.WebSocketResponseMessage) error { log := zerolog.Ctx(ctx) - if body.StaleDevices != nil { - log.Debug().Uints("stale_devices", body.StaleDevices).Msg("stale devices found in 410 response") - for _, staleDevice := range body.StaleDevices { - recipientAddr, err := recipient.Address(staleDevice) + // Decode json body + // TODO use an actual struct for this + var body map[string]interface{} + err := json.Unmarshal(response.Body, &body) + if err != nil { + log.Err(err).Msg("Unmarshal error") + return err + } + // check for missingDevices and extraDevices + if body["missingDevices"] != nil { + missingDevices := body["missingDevices"].([]any) + log.Debug().Any("missing_devices", missingDevices).Msg("missing devices found in 409 response") + // TODO: establish session with missing devices + for _, missingDevice := range missingDevices { + err = cli.FetchAndProcessPreKey(ctx, recipient, int(missingDevice.(float64))) if err != nil { - return fmt.Errorf("failed to get address for stale device %s:%d: %w", recipient, staleDevice, err) + return nil + } + } + } + if body["extraDevices"] != nil { + extraDevices := body["extraDevices"].([]any) + log.Debug().Any("extra_devices", extraDevices).Msg("extra devices found in 409 response") + for _, extraDevice := range extraDevices { + recipientAddr, err := recipient.Address(uint(extraDevice.(float64))) + if err != nil { + log.Err(err).Msg("NewAddress error") + return err } err = cli.Store.ACISessionStore.RemoveSession(ctx, recipientAddr) if err != nil { - return fmt.Errorf("failed to remove session for stale device %s:%d: %w", recipient, staleDevice, err) - } - err = cli.FetchAndProcessPreKey(ctx, recipient, int(staleDevice)) - if err != nil { - return fmt.Errorf("failed to fetch and process prekey for stale device %s:%d: %w", recipient, staleDevice, err) + log.Err(err).Msg("RemoveSession error") + return err } } } - if body.MissingDevices != nil { - log.Debug().Uints("missing_devices", body.MissingDevices).Msg("missing devices found in 409 response") - for _, missingDevice := range body.MissingDevices { - err := cli.FetchAndProcessPreKey(ctx, recipient, int(missingDevice)) - if err != nil { - return fmt.Errorf("failed to fetch and process prekey for missing device %s:%d: %w", recipient, missingDevice, err) - } - } + return err +} + +// A 410 means we have a stale device, so get rid of it +func (cli *Client) handle410(ctx context.Context, recipient libsignalgo.ServiceID, response *signalpb.WebSocketResponseMessage) error { + log := zerolog.Ctx(ctx) + // Decode json body + // TODO use an actual struct + var body map[string]interface{} + err := json.Unmarshal(response.Body, &body) + if err != nil { + log.Err(err).Msg("Unmarshal error") + return err } - if body.ExtraDevices != nil { - log.Debug().Any("extra_devices", body.ExtraDevices).Msg("extra devices found in 409 response") - for _, extraDevice := range body.ExtraDevices { - recipientAddr, err := recipient.Address(extraDevice) + // check for staleDevices and make new sessions with them + if body["staleDevices"] != nil { + staleDevices := body["staleDevices"].([]any) + log.Debug().Any("stale_devices", staleDevices).Msg("stale devices found in 410 response") + for _, staleDevice := range staleDevices { + recipientAddr, err := recipient.Address(uint(staleDevice.(float64))) if err != nil { - return fmt.Errorf("failed to get address for extra device %s:%d: %w", recipient, extraDevice, err) + log.Err(err).Msg("error creating new UUID Address") + return err } err = cli.Store.ACISessionStore.RemoveSession(ctx, recipientAddr) if err != nil { - return fmt.Errorf("failed to remove session for extra device %s:%d: %w", recipient, extraDevice, err) + log.Err(err).Msg("RemoveSession error") + return err + } + err = cli.FetchAndProcessPreKey(ctx, recipient, int(staleDevice.(float64))) + if err != nil { + return err } } } - return nil + return err } // We got rate limited. @@ -1170,5 +1092,5 @@ func (cli *Client) handle428(ctx context.Context, recipient libsignalgo.ServiceI // } // } //} - return fmt.Errorf("got 428 error") + return nil } diff --git a/pkg/signalmeow/serviceauth.go b/pkg/signalmeow/serviceauth.go index 5365ded..b945f30 100644 --- a/pkg/signalmeow/serviceauth.go +++ b/pkg/signalmeow/serviceauth.go @@ -58,14 +58,20 @@ func (cli *Client) getCredentialsWithCache(ctx context.Context, cache **basicExp } func (cli *Client) getCredentialsFromServer(ctx context.Context, path string) (*basicExpiringCredentials, error) { - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, path, nil, nil) + username, password := cli.Store.BasicAuthCreds() + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, path, &web.HTTPReqOpt{ + Username: &username, + Password: &password, + }) if err != nil { return nil, err + } else if resp.StatusCode >= 300 || resp.StatusCode < 200 { + return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode) } var auth basicExpiringCredentials auth.CreatedAt = time.Now() - err = web.DecodeWSResponseBody(ctx, &auth, resp) + err = web.DecodeHTTPResponseBody(ctx, &auth, resp) if err != nil { return nil, fmt.Errorf("failed to decode response: %w", err) } diff --git a/pkg/signalmeow/sticker.go b/pkg/signalmeow/sticker.go deleted file mode 100644 index 2759d18..0000000 --- a/pkg/signalmeow/sticker.go +++ /dev/null @@ -1,251 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2026 Tulir Asokan -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package signalmeow - -import ( - "bytes" - "context" - "crypto/hkdf" - "crypto/sha256" - "encoding/hex" - "errors" - "fmt" - "io" - "mime/multipart" - "net/http" - "net/textproto" - "sync" - - "go.mau.fi/util/exerrors" - "go.mau.fi/util/random" - "golang.org/x/sync/semaphore" - "google.golang.org/protobuf/proto" - - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" - "go.mau.fi/mautrix-signal/pkg/signalmeow/web" -) - -func DownloadStickerPackManifest(ctx context.Context, packID, packKey []byte) (*signalpb.Pack, error) { - if len(packID) != 16 { - return nil, fmt.Errorf("invalid pack ID length: %d", len(packID)) - } - resp, err := downloadStickerData(ctx, fmt.Sprintf("/stickers/%x/manifest.proto", packID), packKey) - if err != nil { - return nil, err - } - var pack signalpb.Pack - err = proto.Unmarshal(resp, &pack) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal decrypted manifest: %w", err) - } - return &pack, nil -} - -func DownloadStickerPackItem(ctx context.Context, packID, packKey []byte, stickerID uint32) ([]byte, error) { - if len(packID) != 16 { - return nil, fmt.Errorf("invalid pack ID length: %d", len(packID)) - } - return downloadStickerData(ctx, fmt.Sprintf("/stickers/%x/full/%d", packID, stickerID), packKey) -} - -func downloadStickerData(ctx context.Context, path string, packKey []byte) ([]byte, error) { - if len(packKey) != 32 { - return nil, fmt.Errorf("invalid pack key length: %d", len(packKey)) - } - var body, decrypted []byte - resp, err := web.SendHTTPRequest(ctx, web.CDN1Hostname, http.MethodGet, path, nil) - defer web.CloseBody(resp) - if err != nil { - return nil, fmt.Errorf("failed to make request: %w", err) - } else if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode) - } else if body, err = io.ReadAll(resp.Body); err != nil { - return nil, fmt.Errorf("failed to read response: %w", err) - } else if decrypted, err = decryptSticker(packKey, body); err != nil { - return nil, fmt.Errorf("failed to decrypt response: %w", err) - } else { - return decrypted, nil - } -} - -type stickerUploadAttributes struct { - ACL string `json:"acl"` - Algorithm string `json:"algorithm"` - Credential string `json:"credential"` - Date string `json:"date"` - ID int `json:"id"` - Key string `json:"key"` - Policy string `json:"policy"` - Signature string `json:"signature"` -} - -func (sua *stickerUploadAttributes) makeFormBody(encryptedData []byte) (*web.HTTPReqOpt, error) { - var buf bytes.Buffer - writer := multipart.NewWriter(&buf) - var closed bool - // This isn't necessary in practice, just do it to avoid linter warnings - defer func() { - if !closed { - _ = writer.Close() - } - }() - fields := map[string]string{ - "key": sua.Key, - "acl": sua.ACL, - "policy": sua.Policy, - "x-amz-algorithm": sua.Algorithm, - "x-amz-credential": sua.Credential, - "x-amz-date": sua.Date, - "Content-Type": "application/octet-stream", - } - for key, value := range fields { - err := writer.WriteField(key, value) - if err != nil { - return nil, fmt.Errorf("failed to write multipart field %s: %w", key, err) - } - } - filePart, err := writer.CreatePart(textproto.MIMEHeader{ - "Content-Type": []string{"application/octet-stream"}, - "Content-Disposition": []string{`form-data; name="file"`}, - }) - if err != nil { - return nil, fmt.Errorf("failed to create multipart file part: %w", err) - } - _, err = filePart.Write(encryptedData) - if err != nil { - return nil, fmt.Errorf("failed to write file data to multipart body: %w", err) - } - err = writer.Close() - if err != nil { - return nil, fmt.Errorf("failed to close multipart writer: %w", err) - } - closed = true - return &web.HTTPReqOpt{ - Body: buf.Bytes(), - ContentType: web.ContentType(writer.FormDataContentType()), - }, nil -} - -func (sua *stickerUploadAttributes) upload(ctx context.Context, packKey, fileData []byte) error { - encryptedData, err := macAndAESEncrypt(fileData, deriveStickerPackKey(packKey)) - if err != nil { - return fmt.Errorf("failed to encrypt sticker data: %w", err) - } - req, err := sua.makeFormBody(encryptedData) - if err != nil { - return fmt.Errorf("failed to prepare request: %w", err) - } - resp, err := web.SendHTTPRequest(ctx, web.CDN1Hostname, http.MethodPost, "/", req) - if err != nil { - return err - } - _ = resp.Body.Close() - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - return fmt.Errorf("unexpected status code %d", resp.StatusCode) - } - return nil -} - -func (sua *stickerUploadAttributes) uploadAsync( - ctx context.Context, - packKey []byte, - getFileData func(context.Context) ([]byte, error), - sema *semaphore.Weighted, - done func(), - onError func(error), -) { - defer done() - err := sema.Acquire(ctx, 1) - if err != nil { - return - } - defer sema.Release(1) - fileData, err := getFileData(ctx) - if err == nil { - err = sua.upload(ctx, packKey, fileData) - } - if err != nil { - onError(err) - } -} - -type stickerPackUploadAttributes struct { - PackID string `json:"packId"` - Manifest *stickerUploadAttributes `json:"manifest"` - Stickers []*stickerUploadAttributes `json:"stickers"` -} - -var StickerUploadParallelism = 4 - -func (cli *Client) UploadStickerPack(ctx context.Context, pack *signalpb.Pack, stickerData []func(context.Context) ([]byte, error)) (packID, packKey []byte, err error) { - for i, sticker := range pack.Stickers { - if sticker.GetId() >= uint32(len(stickerData)) { - return nil, nil, fmt.Errorf("sticker ID %d at index %d is out of bounds, only %d sticker blobs provided", sticker.GetId(), i, len(stickerData)) - } - } - marshaledPack, err := proto.Marshal(pack) - if err != nil { - return nil, nil, fmt.Errorf("failed to marshal pack: %w", err) - } - packKey = random.Bytes(32) - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, fmt.Sprintf("/v1/sticker/pack/form/%d", len(stickerData)), nil, nil) - if err != nil { - return nil, nil, fmt.Errorf("failed to get upload form: %w", err) - } - var packAttributes stickerPackUploadAttributes - err = web.DecodeWSResponseBody(ctx, &packAttributes, resp) - if err != nil { - return nil, nil, fmt.Errorf("failed to decode pack attributes: %w", err) - } - if len(packAttributes.Stickers) != len(stickerData) { - return nil, nil, fmt.Errorf("expected %d sticker upload attribute sets, got %d", len(stickerData), len(packAttributes.Stickers)) - } - packID, err = hex.DecodeString(packAttributes.PackID) - if err != nil { - return nil, nil, fmt.Errorf("invalid pack ID in response: %w", err) - } - err = packAttributes.Manifest.upload(ctx, packKey, marshaledPack) - if err != nil { - return nil, nil, fmt.Errorf("failed to upload manifest: %w", err) - } - var wg sync.WaitGroup - wg.Add(len(packAttributes.Stickers)) - sema := semaphore.NewWeighted(int64(StickerUploadParallelism)) - var errorList []error - var errorLock sync.Mutex - for i, attrs := range packAttributes.Stickers { - go attrs.uploadAsync(ctx, packKey, stickerData[i], sema, wg.Done, func(err error) { - errorLock.Lock() - errorList = append(errorList, fmt.Errorf("failed to upload sticker #%d: %w", i+1, err)) - errorLock.Unlock() - }) - } - wg.Wait() - err = ctx.Err() - if err == nil { - err = errors.Join(errorList...) - } - return -} - -func decryptSticker(packKey, ciphertext []byte) ([]byte, error) { - return macAndAESDecrypt(ciphertext, deriveStickerPackKey(packKey)) -} - -func deriveStickerPackKey(key []byte) []byte { - return exerrors.Must(hkdf.Key(sha256.New, key, make([]byte, 32), "Sticker Pack", 2*32)) -} diff --git a/pkg/signalmeow/storageservice.go b/pkg/signalmeow/storageservice.go index 899c54b..06b0283 100644 --- a/pkg/signalmeow/storageservice.go +++ b/pkg/signalmeow/storageservice.go @@ -30,7 +30,6 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" "go.mau.fi/util/exerrors" - "go.mau.fi/util/ptr" "golang.org/x/crypto/hkdf" "golang.org/x/exp/maps" "google.golang.org/protobuf/proto" @@ -66,14 +65,12 @@ func (cli *Client) processStorageInTxn(ctx context.Context, update *StorageUpdat switch data := record.StorageRecord.GetRecord().(type) { case *signalpb.StorageRecord_Contact: log.Trace().Any("contact_record", data.Contact).Msg("Handling contact record") - aci, _ := ParseStringOrBinaryUUID(data.Contact.Aci, data.Contact.AciBinary) - pni, _ := ParseStringOrBinaryUUID(data.Contact.Pni, data.Contact.PniBinary) + aci, _ := uuid.Parse(data.Contact.Aci) + pni, _ := uuid.Parse(data.Contact.Pni) if aci == uuid.Nil && pni == uuid.Nil { log.Warn(). Str("raw_aci", data.Contact.Aci). Str("raw_pni", data.Contact.Pni). - Hex("raw_aci_binary", data.Contact.AciBinary). - Hex("raw_pni_binary", data.Contact.PniBinary). Str("raw_e164", data.Contact.E164). Msg("Storage service has contact record with no ACI or PNI") continue @@ -94,26 +91,14 @@ func (cli *Client) processStorageInTxn(ctx context.Context, update *StorageUpdat changed = true recipient.ContactName = strings.TrimSpace(fmt.Sprintf("%s %s", contact.SystemGivenName, contact.SystemFamilyName)) } - newNickname := "" if contact.Nickname != nil { - newNickname = strings.TrimSpace(fmt.Sprintf("%s %s", contact.Nickname.Given, contact.Nickname.Family)) - } - if recipient.Nickname != newNickname { changed = true - recipient.Nickname = newNickname + recipient.Nickname = strings.TrimSpace(fmt.Sprintf("%s %s", contact.Nickname.Given, contact.Nickname.Family)) } if contact.E164 != "" { changed = changed || recipient.E164 != contact.E164 recipient.E164 = contact.E164 } - if contact.Blocked != recipient.Blocked { - changed = true - recipient.Blocked = contact.Blocked - } - if !ptr.Val(recipient.Whitelisted) { - changed = true - recipient.Whitelisted = &contact.Whitelisted - } topLevelChanged = changed return }) @@ -254,12 +239,12 @@ func (cli *Client) fetchStorageManifest(ctx context.Context, storageKey []byte, } var encryptedManifest signalpb.StorageManifest var manifestRecord signalpb.ManifestRecord - resp, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodGet, path, &web.HTTPReqOpt{ + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, path, &web.HTTPReqOpt{ Username: &storageCreds.Username, Password: &storageCreds.Password, ContentType: web.ContentTypeProtobuf, + Host: web.StorageHostname, }) - defer web.CloseBody(resp) if err != nil { return nil, fmt.Errorf("failed to fetch storage manifest: %w", err) } else if resp.StatusCode == http.StatusNoContent { @@ -360,18 +345,18 @@ func (cli *Client) fetchStorageItemsChunk(ctx context.Context, recordKeys [][]by return nil, fmt.Errorf("failed to marshal read operation: %w", err) } var storageItems signalpb.StorageItems - resp, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodPut, "/v1/storage/read", &web.HTTPReqOpt{ + resp, err := web.SendHTTPRequest(ctx, http.MethodPut, "/v1/storage/read", &web.HTTPReqOpt{ Username: &storageCreds.Username, Password: &storageCreds.Password, Body: body, ContentType: web.ContentTypeProtobuf, + Host: web.StorageHostname, }) - defer web.CloseBody(resp) if err != nil { return nil, fmt.Errorf("failed to fetch storage records: %w", err) } else if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("unexpected status code %d fetching storage records", resp.StatusCode) - } else if body, err = io.ReadAll(resp.Body); err != nil { + } else if body, err := io.ReadAll(resp.Body); err != nil { return nil, fmt.Errorf("failed to read storage manifest response: %w", err) } else if err = proto.Unmarshal(body, &storageItems); err != nil { return nil, fmt.Errorf("failed to unmarshal encrypted storage manifest: %w", err) diff --git a/pkg/signalmeow/store/backup_store.go b/pkg/signalmeow/store/backup_store.go index e99b110..4575b05 100644 --- a/pkg/signalmeow/store/backup_store.go +++ b/pkg/signalmeow/store/backup_store.go @@ -161,16 +161,9 @@ func (s *sqlStore) AddBackupRecipient(ctx context.Context, recipient *backuppb.R if dest.Contact.ProfileGivenName != nil || dest.Contact.ProfileFamilyName != nil { recipient.Profile.Name = strings.TrimSpace(fmt.Sprintf("%s %s", dest.Contact.GetProfileGivenName(), dest.Contact.GetProfileFamilyName())) } - if dest.Contact.ProfileSharing && !ptr.Val(recipient.Whitelisted) { - recipient.Whitelisted = ptr.Ptr(true) - changed = true - } - recipient.Blocked = dest.Contact.Blocked - changed = changed || - oldRecipient.E164 != recipient.E164 || + changed = oldRecipient.E164 != recipient.E164 || oldRecipient.Profile.Key != recipient.Profile.Key || - oldRecipient.Profile.Name != recipient.Profile.Name || - oldRecipient.Blocked != recipient.Blocked + oldRecipient.Profile.Name != recipient.Profile.Name return }) if err != nil { @@ -182,9 +175,6 @@ func (s *sqlStore) AddBackupRecipient(ctx context.Context, recipient *backuppb.R Any("entry", dest.Contact). Msg("Both ACI and PNI are invalid for registered contact recipient") } - if aci != uuid.Nil { - s.MarkUnregistered(ctx, libsignalgo.NewACIServiceID(aci), dest.Contact.GetNotRegistered() != nil) - } case *backuppb.Recipient_Group: groupMasterKey = types.SerializedGroupMasterKey(base64.StdEncoding.EncodeToString(dest.Group.MasterKey)) if len(dest.Group.MasterKey) == libsignalgo.GroupMasterKeyLength { diff --git a/pkg/signalmeow/store/container.go b/pkg/signalmeow/store/container.go index e6335e5..f6842ac 100644 --- a/pkg/signalmeow/store/container.go +++ b/pkg/signalmeow/store/container.go @@ -85,7 +85,7 @@ func (c *Container) scanDevice(row dbutil.Scannable) (*Device, error) { device.AccountEntropyPool = libsignalgo.AccountEntropyPool(accountEntropyPool.String) device.EphemeralBackupKey = libsignalgo.BytesToBackupKey(ephemeralBackupKey) device.MediaRootBackupKey = libsignalgo.BytesToBackupKey(mediaRootBackupKey) - baseStore := &sqlStore{Container: c, AccountID: device.ACI, blockCache: make(map[uuid.UUID]bool)} + baseStore := &sqlStore{Container: c, AccountID: device.ACI} aciStore := &scopedSQLStore{Container: c, AccountID: device.ACI, ServiceID: device.ACIServiceID()} pniStore := &scopedSQLStore{Container: c, AccountID: device.ACI, ServiceID: device.PNIServiceID()} device.ACIPreKeyStore = aciStore diff --git a/pkg/signalmeow/store/device.go b/pkg/signalmeow/store/device.go index e72c04f..aabee03 100644 --- a/pkg/signalmeow/store/device.go +++ b/pkg/signalmeow/store/device.go @@ -18,9 +18,6 @@ type sqlStore struct { AccountID uuid.UUID contactLock sync.Mutex - - blockCacheLock sync.RWMutex - blockCache map[uuid.UUID]bool } type scopedSQLStore struct { @@ -76,7 +73,7 @@ type Device struct { ACIIdentityStore libsignalgo.IdentityKeyStore PNIIdentityStore libsignalgo.IdentityKeyStore IdentityKeyStore IdentityKeyStore - SenderKeyStore SenderKeyStore + SenderKeyStore libsignalgo.SenderKeyStore GroupStore GroupStore RecipientStore RecipientStore diff --git a/pkg/signalmeow/store/recipient_store.go b/pkg/signalmeow/store/recipient_store.go index 5f328be..9e2bb8e 100644 --- a/pkg/signalmeow/store/recipient_store.go +++ b/pkg/signalmeow/store/recipient_store.go @@ -38,14 +38,10 @@ type RecipientStore interface { MyProfileKey(ctx context.Context) (*libsignalgo.ProfileKey, error) LoadAndUpdateRecipient(ctx context.Context, aci, pni uuid.UUID, updater RecipientUpdaterFunc) (*types.Recipient, error) - IsBlocked(ctx context.Context, aci uuid.UUID) (bool, error) LoadRecipientByE164(ctx context.Context, e164 string) (*types.Recipient, error) StoreRecipient(ctx context.Context, recipient *types.Recipient) error UpdateRecipientE164(ctx context.Context, aci, pni uuid.UUID, e164 string) (*types.Recipient, error) - IsUnregistered(ctx context.Context, serviceID libsignalgo.ServiceID) bool - MarkUnregistered(ctx context.Context, serviceID libsignalgo.ServiceID, unregistered bool) - LoadAllContacts(ctx context.Context) ([]*types.Recipient, error) } @@ -66,9 +62,7 @@ const ( profile_about_emoji, profile_avatar_path, profile_fetched_at, - needs_pni_signature, - blocked, - whitelisted + needs_pni_signature FROM signalmeow_recipients WHERE account_id = $1 ` @@ -93,11 +87,9 @@ const ( profile_about_emoji, profile_avatar_path, profile_fetched_at, - needs_pni_signature, - blocked, - whitelisted + needs_pni_signature ) - VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) ON CONFLICT (account_id, aci_uuid) DO UPDATE SET pni_uuid = excluded.pni_uuid, e164_number = excluded.e164_number, @@ -110,9 +102,7 @@ const ( profile_about_emoji = excluded.profile_about_emoji, profile_avatar_path = excluded.profile_avatar_path, profile_fetched_at = excluded.profile_fetched_at, - needs_pni_signature = excluded.needs_pni_signature, - blocked = excluded.blocked, - whitelisted = excluded.whitelisted + needs_pni_signature = excluded.needs_pni_signature ` upsertPNIRecipientQuery = ` INSERT INTO signalmeow_recipients ( @@ -149,8 +139,6 @@ func scanRecipient(row dbutil.Scannable) (*types.Recipient, error) { &recipient.Profile.AvatarPath, &profileFetchedAt, &recipient.NeedsPNISignature, - &recipient.Blocked, - &recipient.Whitelisted, ) if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -220,13 +208,6 @@ func (s *sqlStore) LoadAndUpdateRecipient(ctx context.Context, aci, pni uuid.UUI return false, nil } } - defer func() { - if outRecipient != nil && outRecipient.ACI != uuid.Nil && outErr == nil { - s.blockCacheLock.Lock() - s.blockCache[outRecipient.ACI] = outRecipient.Blocked - s.blockCacheLock.Unlock() - } - }() if ctx.Value(contextKeyContactLock) == nil { s.contactLock.Lock() defer s.contactLock.Unlock() @@ -314,20 +295,6 @@ func (s *sqlStore) LoadAndUpdateRecipient(ctx context.Context, aci, pni uuid.UUI return } -func (s *sqlStore) IsBlocked(ctx context.Context, aci uuid.UUID) (bool, error) { - s.blockCacheLock.RLock() - cachedVal, ok := s.blockCache[aci] - s.blockCacheLock.RUnlock() - if ok { - return cachedVal, nil - } - recipient, err := s.LoadAndUpdateRecipient(ctx, aci, uuid.Nil, nil) - if err != nil { - return false, err - } - return recipient.Blocked, nil -} - func (s *sqlStore) UpdateRecipientE164(ctx context.Context, aci, pni uuid.UUID, e164 string) (*types.Recipient, error) { return s.LoadAndUpdateRecipient(ctx, aci, pni, func(recipient *types.Recipient) (bool, error) { if recipient.E164 != e164 { @@ -374,12 +341,7 @@ func (s *sqlStore) StoreRecipient(ctx context.Context, recipient *types.Recipien recipient.Profile.AvatarPath, dbutil.UnixMilliPtr(recipient.Profile.FetchedAt), recipient.NeedsPNISignature, - recipient.Blocked, - recipient.Whitelisted, ) - s.blockCacheLock.Lock() - s.blockCache[recipient.ACI] = recipient.Blocked - s.blockCacheLock.Unlock() } else if recipient.PNI != uuid.Nil { _, err = s.db.Exec( ctx, @@ -395,35 +357,3 @@ func (s *sqlStore) StoreRecipient(ctx context.Context, recipient *types.Recipien } return } - -const ( - isUnregisteredQuery = `SELECT 1 FROM signalmeow_unregistered_users WHERE aci_uuid=$1` - markUnregisteredQuery = `INSERT INTO signalmeow_unregistered_users (aci_uuid) VALUES ($1) ON CONFLICT (aci_uuid) DO NOTHING` - markRegisteredQuery = `DELETE FROM signalmeow_unregistered_users WHERE aci_uuid=$1` -) - -func (s *sqlStore) IsUnregistered(ctx context.Context, serviceID libsignalgo.ServiceID) (unregistered bool) { - if serviceID.Type != libsignalgo.ServiceIDTypeACI { - return - } - _ = s.db.QueryRow(ctx, isUnregisteredQuery, serviceID.UUID).Scan(&unregistered) - return -} - -func (s *sqlStore) MarkUnregistered(ctx context.Context, serviceID libsignalgo.ServiceID, unregistered bool) { - if serviceID.Type != libsignalgo.ServiceIDTypeACI { - return - } - var err error - if unregistered { - _, err = s.db.Exec(ctx, markUnregisteredQuery, serviceID.UUID) - } else { - _, err = s.db.Exec(ctx, markRegisteredQuery, serviceID.UUID) - } - if err != nil { - zerolog.Ctx(ctx).Err(err). - Stringer("service_id", serviceID). - Bool("unregistered", unregistered). - Msg("Failed to mark recipient as unregistered") - } -} diff --git a/pkg/signalmeow/store/sender_key_store.go b/pkg/signalmeow/store/sender_key_store.go index 1334066..092bcdd 100644 --- a/pkg/signalmeow/store/sender_key_store.go +++ b/pkg/signalmeow/store/sender_key_store.go @@ -21,45 +21,18 @@ import ( "database/sql" "errors" "fmt" - "time" "github.com/google/uuid" "go.mau.fi/util/dbutil" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" ) -type SenderKeyStore interface { - libsignalgo.SenderKeyStore - DeleteSenderKey(ctx context.Context, address *libsignalgo.Address, distributionID uuid.UUID) error - GetSenderKeyInfo(ctx context.Context, groupID types.GroupIdentifier) (*SenderKeyInfo, error) - DeleteSenderKeyInfo(ctx context.Context, groupID types.GroupIdentifier) error - PutSenderKeyInfo(ctx context.Context, groupID types.GroupIdentifier, info *SenderKeyInfo) error -} - -var _ SenderKeyStore = (*sqlStore)(nil) +var _ libsignalgo.SenderKeyStore = (*sqlStore)(nil) const ( - loadSenderKeyQuery = `SELECT key_record FROM signalmeow_sender_keys WHERE account_id=$1 AND sender_uuid=$2 AND sender_device_id=$3 AND distribution_id=$4` - storeSenderKeyQuery = `INSERT INTO signalmeow_sender_keys (account_id, sender_uuid, sender_device_id, distribution_id, key_record) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (account_id, sender_uuid, sender_device_id, distribution_id) DO UPDATE SET key_record=excluded.key_record` - deleteSenderKeyQuery = `DELETE FROM signalmeow_sender_keys WHERE account_id=$1 AND sender_uuid=$2 AND sender_device_id=$3 AND distribution_id=$4` - - getSenderKeyInfoQuery = ` - SELECT distribution_id, shared_with - FROM signalmeow_outbound_sender_key_info - WHERE account_id=$1 AND group_id=$2 - ` - putSenderKeyInfoQuery = ` - INSERT INTO signalmeow_outbound_sender_key_info (account_id, group_id, distribution_id, shared_with) - VALUES ($1, $2, $3, $4) - ON CONFLICT (account_id, group_id) DO UPDATE - SET distribution_id=excluded.distribution_id, shared_with=excluded.shared_with - ` - deleteSenderKeyInfoQuery = ` - DELETE FROM signalmeow_outbound_sender_key_info - WHERE account_id=$1 AND group_id=$2 - ` + loadSenderKeyQuery = `SELECT key_record FROM signalmeow_sender_keys WHERE account_id=$1 AND sender_uuid=$2 AND sender_device_id=$3 AND distribution_id=$4` + storeSenderKeyQuery = `INSERT INTO signalmeow_sender_keys (account_id, sender_uuid, sender_device_id, distribution_id, key_record) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (account_id, sender_uuid, sender_device_id, distribution_id) DO UPDATE SET key_record=excluded.key_record` ) func scanSenderKey(row dbutil.Scannable) (*libsignalgo.SenderKeyRecord, error) { @@ -101,47 +74,3 @@ func (s *sqlStore) StoreSenderKey(ctx context.Context, sender *libsignalgo.Addre _, err = s.db.Exec(ctx, storeSenderKeyQuery, s.AccountID, senderUUID, deviceID, distributionID, serialized) return err } - -func (s *sqlStore) DeleteSenderKey(ctx context.Context, sender *libsignalgo.Address, distributionID uuid.UUID) error { - senderUUID, err := sender.Name() - if err != nil { - return fmt.Errorf("failed to get sender UUID: %w", err) - } - deviceID, err := sender.DeviceID() - if err != nil { - return fmt.Errorf("failed to get sender device ID: %w", err) - } - _, err = s.db.Exec(ctx, deleteSenderKeyQuery, s.AccountID, senderUUID, deviceID, distributionID) - return err -} - -type SenderKeyInfo struct { - DistributionID uuid.UUID `json:"distribution_id"` - SharedWith map[libsignalgo.ServiceID][]int `json:"shared_with"` - CreatedAt time.Time `json:"created_at"` -} - -func scanSenderKeyInfo(row dbutil.Scannable) (*SenderKeyInfo, error) { - var ski SenderKeyInfo - err := row.Scan(&ski.DistributionID, dbutil.JSON{Data: &ski}) - if errors.Is(err, sql.ErrNoRows) { - return nil, nil - } else if err != nil { - return nil, err - } - return &ski, nil -} - -func (s *sqlStore) GetSenderKeyInfo(ctx context.Context, groupID types.GroupIdentifier) (*SenderKeyInfo, error) { - return scanSenderKeyInfo(s.db.QueryRow(ctx, getSenderKeyInfoQuery, s.AccountID, groupID)) -} - -func (s *sqlStore) PutSenderKeyInfo(ctx context.Context, groupID types.GroupIdentifier, info *SenderKeyInfo) error { - _, err := s.db.Exec(ctx, putSenderKeyInfoQuery, s.AccountID, groupID, info.DistributionID, dbutil.JSON{Data: info}) - return err -} - -func (s *sqlStore) DeleteSenderKeyInfo(ctx context.Context, groupID types.GroupIdentifier) error { - _, err := s.db.Exec(ctx, deleteSenderKeyInfoQuery, s.AccountID, groupID) - return err -} diff --git a/pkg/signalmeow/store/session_store.go b/pkg/signalmeow/store/session_store.go index 3956714..5fe6cba 100644 --- a/pkg/signalmeow/store/session_store.go +++ b/pkg/signalmeow/store/session_store.go @@ -30,49 +30,40 @@ import ( var _ SessionStore = (*scopedSQLStore)(nil) const ( - loadSessionQuery = `SELECT their_service_id, their_device_id, record FROM signalmeow_sessions WHERE account_id=$1 AND service_id=$2 AND their_service_id=$3 AND their_device_id=$4` + loadSessionQuery = `SELECT their_device_id, record FROM signalmeow_sessions WHERE account_id=$1 AND service_id=$2 AND their_service_id=$3 AND their_device_id=$4` storeSessionQuery = ` INSERT INTO signalmeow_sessions (account_id, service_id, their_service_id, their_device_id, record) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (account_id, service_id, their_service_id, their_device_id) DO UPDATE SET record=excluded.record ` - allSessionsQuery = `SELECT their_service_id, their_device_id, record FROM signalmeow_sessions WHERE account_id=$1 AND service_id=$2 AND their_service_id=$3` - removeSessionQuery = `DELETE FROM signalmeow_sessions WHERE account_id=$1 AND service_id=$2 AND their_service_id=$3 AND their_device_id=$4` - removeSessionsForRecipientQuery = "DELETE FROM signalmeow_sessions WHERE account_id=$1 AND their_service_id=$2" - deleteAllSessionsQuery = "DELETE FROM signalmeow_sessions WHERE account_id=$1" + allSessionsQuery = `SELECT their_device_id, record FROM signalmeow_sessions WHERE account_id=$1 AND service_id=$2 AND their_service_id=$3` + removeSessionQuery = `DELETE FROM signalmeow_sessions WHERE account_id=$1 AND service_id=$2 AND their_service_id=$3 AND their_device_id=$4` + deleteAllSessionsQuery = "DELETE FROM signalmeow_sessions WHERE account_id=$1" ) -type SessionAddressTuple = libsignalgo.SessionAddressTuple - type SessionStore interface { libsignalgo.SessionStore ServiceScopedStore // AllSessionsForServiceID returns all sessions for the given service ID. - AllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) ([]SessionAddressTuple, error) + AllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) ([]*libsignalgo.Address, []*libsignalgo.SessionRecord, error) // RemoveSession removes the session for the given address. RemoveSession(ctx context.Context, address *libsignalgo.Address) error - RemoveAllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) error // RemoveAllSessions removes all sessions for our ACI UUID RemoveAllSessions(ctx context.Context) error } -func scanSessionRecord(row dbutil.Scannable) (tuple SessionAddressTuple, err error) { - var rawServiceID string - var rawRecord []byte - err = row.Scan(&rawServiceID, &tuple.DeviceID, &rawRecord) +func scanSessionRecord(row dbutil.Scannable) (int, *libsignalgo.SessionRecord, error) { + var record []byte + var deviceID int + err := row.Scan(&deviceID, &record) if errors.Is(err, sql.ErrNoRows) { - err = nil + return 0, nil, nil } else if err != nil { - // return error as-is - } else if tuple.Record, err = libsignalgo.DeserializeSessionRecord(rawRecord); err != nil { - err = fmt.Errorf("failed to deserialize session record: %w", err) - } else if tuple.ServiceID, err = libsignalgo.ServiceIDFromString(rawServiceID); err != nil { - err = fmt.Errorf("failed to parse service ID: %w", err) - } else if tuple.Address, err = tuple.ServiceID.Address(uint(tuple.DeviceID)); err != nil { - err = fmt.Errorf("failed to construct address: %w", err) + return 0, nil, err } - return + sessionRecord, err := libsignalgo.DeserializeSessionRecord(record) + return deviceID, sessionRecord, err } func (s *scopedSQLStore) RemoveSession(ctx context.Context, address *libsignalgo.Address) error { @@ -88,17 +79,27 @@ func (s *scopedSQLStore) RemoveSession(ctx context.Context, address *libsignalgo return err } -func (s *scopedSQLStore) AllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) ([]SessionAddressTuple, error) { +func (s *scopedSQLStore) AllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) ([]*libsignalgo.Address, []*libsignalgo.SessionRecord, error) { rows, err := s.db.Query(ctx, allSessionsQuery, s.AccountID, s.ServiceID, theirID) if err != nil { - return nil, err + return nil, nil, err } - return dbutil.NewRowIterWithError(rows, scanSessionRecord, err).AsList() -} - -func (s *scopedSQLStore) RemoveAllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) error { - _, err := s.db.Exec(ctx, removeSessionsForRecipientQuery, s.AccountID, theirID) - return err + defer rows.Close() + var records []*libsignalgo.SessionRecord + var addresses []*libsignalgo.Address + for rows.Next() { + deviceID, record, err := scanSessionRecord(rows) + if err != nil { + return nil, nil, err + } + records = append(records, record) + address, err := theirID.Address(uint(deviceID)) + if err != nil { + return nil, nil, err + } + addresses = append(addresses, address) + } + return addresses, records, rows.Err() } func (s *scopedSQLStore) LoadSession(ctx context.Context, address *libsignalgo.Address) (*libsignalgo.SessionRecord, error) { @@ -110,8 +111,8 @@ func (s *scopedSQLStore) LoadSession(ctx context.Context, address *libsignalgo.A if err != nil { return nil, fmt.Errorf("failed to get their device ID: %w", err) } - tuple, err := scanSessionRecord(s.db.QueryRow(ctx, loadSessionQuery, s.AccountID, s.ServiceID, theirServiceID, deviceID)) - return tuple.Record, err + _, record, err := scanSessionRecord(s.db.QueryRow(ctx, loadSessionQuery, s.AccountID, s.ServiceID, theirServiceID, deviceID)) + return record, err } func (s *scopedSQLStore) StoreSession(ctx context.Context, address *libsignalgo.Address, record *libsignalgo.SessionRecord) error { diff --git a/pkg/signalmeow/store/upgrades/00-latest.sql b/pkg/signalmeow/store/upgrades/00-latest.sql index fbb44ad..2c550c9 100644 --- a/pkg/signalmeow/store/upgrades/00-latest.sql +++ b/pkg/signalmeow/store/upgrades/00-latest.sql @@ -1,4 +1,4 @@ --- v0 -> v27 (compatible with v13+): Latest revision +-- v0 -> v22 (compatible with v13+): Latest revision CREATE TABLE signalmeow_device ( aci_uuid TEXT PRIMARY KEY, @@ -94,25 +94,12 @@ CREATE TABLE signalmeow_sender_keys ( FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); -CREATE TABLE signalmeow_outbound_sender_key_info ( - account_id TEXT NOT NULL, - group_id TEXT NOT NULL, - distribution_id TEXT NOT NULL, - shared_with jsonb NOT NULL, - - PRIMARY KEY (account_id, group_id), - CONSTRAINT signalmeow_outbound_sender_key_info_device_fkey - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); - CREATE TABLE signalmeow_groups ( account_id TEXT NOT NULL, group_identifier TEXT NOT NULL, master_key TEXT NOT NULL, - PRIMARY KEY (account_id, group_identifier), - CONSTRAINT signalmeow_groups_device_fkey - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE + PRIMARY KEY (account_id, group_identifier) ); CREATE TABLE signalmeow_recipients ( @@ -130,8 +117,6 @@ CREATE TABLE signalmeow_recipients ( profile_avatar_path TEXT NOT NULL DEFAULT '', profile_fetched_at BIGINT, needs_pni_signature BOOLEAN NOT NULL DEFAULT false, - blocked BOOLEAN NOT NULL DEFAULT false, - whitelisted BOOLEAN, CONSTRAINT signalmeow_contacts_account_id_fkey FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE, @@ -139,10 +124,6 @@ CREATE TABLE signalmeow_recipients ( CONSTRAINT signalmeow_contacts_pni_unique UNIQUE (account_id, pni_uuid) ); -CREATE TABLE signalmeow_unregistered_users ( - aci_uuid uuid PRIMARY KEY -); - CREATE TABLE signalmeow_backup_recipient ( account_id TEXT NOT NULL, recipient_id BIGINT NOT NULL, diff --git a/pkg/signalmeow/store/upgrades/23-recipient-blocked.sql b/pkg/signalmeow/store/upgrades/23-recipient-blocked.sql deleted file mode 100644 index 3a9654a..0000000 --- a/pkg/signalmeow/store/upgrades/23-recipient-blocked.sql +++ /dev/null @@ -1,2 +0,0 @@ --- v23 (compatible with v13+): Store block status for recipients -ALTER TABLE signalmeow_recipients ADD COLUMN blocked BOOLEAN NOT NULL DEFAULT false; diff --git a/pkg/signalmeow/store/upgrades/24-outbound-sender-keys.sql b/pkg/signalmeow/store/upgrades/24-outbound-sender-keys.sql deleted file mode 100644 index 4f02389..0000000 --- a/pkg/signalmeow/store/upgrades/24-outbound-sender-keys.sql +++ /dev/null @@ -1,9 +0,0 @@ --- v24 (compatible with v13+): Store outbound sender keys for groups -CREATE TABLE IF NOT EXISTS signalmeow_outbound_sender_key_info ( - account_id TEXT NOT NULL, - group_id TEXT NOT NULL, - distribution_id TEXT NOT NULL, - shared_with jsonb NOT NULL, - - PRIMARY KEY (account_id, group_id) -); diff --git a/pkg/signalmeow/store/upgrades/25-unregistered-user-cache.sql b/pkg/signalmeow/store/upgrades/25-unregistered-user-cache.sql deleted file mode 100644 index 04a5233..0000000 --- a/pkg/signalmeow/store/upgrades/25-unregistered-user-cache.sql +++ /dev/null @@ -1,4 +0,0 @@ --- v25 (compatible with v13+): Cache unregistered users -CREATE TABLE signalmeow_unregistered_users ( - aci_uuid uuid PRIMARY KEY -); diff --git a/pkg/signalmeow/store/upgrades/26-recipient-whitelisted.sql b/pkg/signalmeow/store/upgrades/26-recipient-whitelisted.sql deleted file mode 100644 index c61bf33..0000000 --- a/pkg/signalmeow/store/upgrades/26-recipient-whitelisted.sql +++ /dev/null @@ -1,2 +0,0 @@ --- v26 (compatible with v13+): Store whitelisted status for recipients -ALTER TABLE signalmeow_recipients ADD COLUMN whitelisted BOOLEAN; diff --git a/pkg/signalmeow/store/upgrades/27-sender-key-info-foreign-key.postgres.sql b/pkg/signalmeow/store/upgrades/27-sender-key-info-foreign-key.postgres.sql deleted file mode 100644 index e9c0ee5..0000000 --- a/pkg/signalmeow/store/upgrades/27-sender-key-info-foreign-key.postgres.sql +++ /dev/null @@ -1,10 +0,0 @@ --- v27 (compatible with v13+): Add missing foreign key for outbound sender key info and groups -DELETE FROM signalmeow_outbound_sender_key_info -WHERE NOT EXISTS(SELECT 1 FROM signalmeow_device WHERE aci_uuid=account_id); -ALTER TABLE signalmeow_outbound_sender_key_info ADD CONSTRAINT signalmeow_outbound_sender_key_info_device_fkey - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE; - -DELETE FROM signalmeow_groups -WHERE NOT EXISTS(SELECT 1 FROM signalmeow_device WHERE aci_uuid=account_id); -ALTER TABLE signalmeow_groups ADD CONSTRAINT signalmeow_groups_device_fkey - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/pkg/signalmeow/store/upgrades/27-sender-key-info-foreign-key.sqlite.sql b/pkg/signalmeow/store/upgrades/27-sender-key-info-foreign-key.sqlite.sql deleted file mode 100644 index b6017ba..0000000 --- a/pkg/signalmeow/store/upgrades/27-sender-key-info-foreign-key.sqlite.sql +++ /dev/null @@ -1,32 +0,0 @@ --- v27 (compatible with v13+): Add missing foreign key for outbound sender key info and groups - -CREATE TABLE new_signalmeow_outbound_sender_key_info ( - account_id TEXT NOT NULL, - group_id TEXT NOT NULL, - distribution_id TEXT NOT NULL, - shared_with jsonb NOT NULL, - - PRIMARY KEY (account_id, group_id), - CONSTRAINT signalmeow_outbound_sender_key_info_device_fkey - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); -INSERT INTO new_signalmeow_outbound_sender_key_info -SELECT * FROM signalmeow_outbound_sender_key_info -WHERE EXISTS(SELECT 1 FROM signalmeow_device WHERE aci_uuid=account_id); -DROP TABLE signalmeow_outbound_sender_key_info; -ALTER TABLE new_signalmeow_outbound_sender_key_info RENAME TO signalmeow_outbound_sender_key_info; - -CREATE TABLE new_signalmeow_groups ( - account_id TEXT NOT NULL, - group_identifier TEXT NOT NULL, - master_key TEXT NOT NULL, - - PRIMARY KEY (account_id, group_identifier), - CONSTRAINT signalmeow_groups_device_fkey - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); -INSERT INTO new_signalmeow_groups -SELECT * FROM signalmeow_groups -WHERE EXISTS(SELECT 1 FROM signalmeow_device WHERE aci_uuid=account_id); -DROP TABLE signalmeow_groups; -ALTER TABLE new_signalmeow_groups RENAME TO signalmeow_groups; diff --git a/pkg/signalmeow/types/contact.go b/pkg/signalmeow/types/contact.go index 889dd3e..53852aa 100644 --- a/pkg/signalmeow/types/contact.go +++ b/pkg/signalmeow/types/contact.go @@ -55,12 +55,6 @@ type Recipient struct { Profile Profile NeedsPNISignature bool - Blocked bool - Whitelisted *bool -} - -func (r *Recipient) ProbablyMessageRequest() bool { - return r != nil && (r.NeedsPNISignature || (r.Whitelisted != nil && !*r.Whitelisted)) } type ContactAvatar struct { diff --git a/pkg/signalmeow/web/signalwebsocket.go b/pkg/signalmeow/web/signalwebsocket.go index a2153a1..ca09208 100644 --- a/pkg/signalmeow/web/signalwebsocket.go +++ b/pkg/signalmeow/web/signalwebsocket.go @@ -19,7 +19,6 @@ package web import ( "context" "encoding/base64" - "encoding/json" "errors" "fmt" "net/http" @@ -37,10 +36,6 @@ import ( "go.mau.fi/mautrix-signal/pkg/signalmeow/wspb" ) -var WebsocketPingInterval = 30 * time.Second -var WebsocketPingTimeout = 20 * time.Second -var WebsocketPingTimeoutLimit = 5 - const WebsocketProvisioningPath = "/v1/websocket/provisioning/" const WebsocketPath = "/v1/websocket/" @@ -59,7 +54,6 @@ type SignalWebsocket struct { closeEvt *exsync.Event closeCalled atomic.Bool cancel atomic.Pointer[context.CancelFunc] - cancelConn atomic.Pointer[context.CancelCauseFunc] } func NewSignalWebsocket(basicAuth *url.Userinfo) *SignalWebsocket { @@ -161,19 +155,6 @@ func (s *SignalWebsocket) pushOutgoing(ctx context.Context, send SignalWebsocket } } -var ErrForcedReconnect = errors.New("forced reconnect") - -func (s *SignalWebsocket) ForceReconnect() { - if s == nil { - return - } - cancelFn := s.cancelConn.Load() - if cancelFn == nil { - return - } - (*cancelFn)(ErrForcedReconnect) -} - func (s *SignalWebsocket) connectLoop( ctx context.Context, requestHandler RequestHandlerFunc, @@ -324,9 +305,8 @@ func (s *SignalWebsocket) connectLoop( retrying = false backoff = initialBackoff - responseChannels := exsync.NewMap[uint64, chan *signalpb.WebSocketResponseMessage]() + responseChannels := make(map[uint64]chan *signalpb.WebSocketResponseMessage) loopCtx, loopCancel := context.WithCancelCause(ctx) - s.cancelConn.Store(&loopCancel) var wg sync.WaitGroup wg.Add(3) @@ -361,20 +341,20 @@ func (s *SignalWebsocket) connectLoop( // Ping loop (send a keepalive Ping every 30s) go func() { defer wg.Done() - ticker := time.NewTicker(WebsocketPingInterval) + ticker := time.NewTicker(30 * time.Second) defer ticker.Stop() pingTimeoutCount := 0 for { select { case <-ticker.C: - pingCtx, cancel := context.WithTimeout(loopCtx, WebsocketPingTimeout) + pingCtx, cancel := context.WithTimeout(loopCtx, 20*time.Second) err := ws.Ping(pingCtx) cancel() if err != nil { pingTimeoutCount++ log.Err(err).Msg("Failed to send ping") - if pingTimeoutCount >= WebsocketPingTimeoutLimit { + if pingTimeoutCount >= 5 { log.Warn().Msg("Ping timeout count exceeded, closing websocket") err = ws.Close(websocket.StatusNormalClosure, "Ping timeout") if err != nil { @@ -404,16 +384,11 @@ func (s *SignalWebsocket) connectLoop( } else { errorCount++ s.pushStatus(ctx, SignalWebsocketConnectionEventDisconnected, ctxCauseErr) - if errors.Is(ctxCauseErr, ErrForcedReconnect) { - // Skip the delay for forced reconnects - // TODO should the delay be lowered globally? - isFirstConnect = true - } } // Clean up ws.Close(websocket.StatusGoingAway, "Going away") - for _, responseChannel := range responseChannels.SwapData(nil) { + for _, responseChannel := range responseChannels { close(responseChannel) } loopCancel(nil) @@ -432,7 +407,7 @@ func readLoop( ctx context.Context, ws *websocket.Conn, incomingRequestChan chan *signalpb.WebSocketRequestMessage, - responseChannels *exsync.Map[uint64, chan *signalpb.WebSocketResponseMessage], + responseChannels map[uint64]chan *signalpb.WebSocketResponseMessage, ) error { log := zerolog.Ctx(ctx).With(). Str("loop", "signal_websocket_read_loop"). @@ -472,27 +447,22 @@ func readLoop( if msg.Response.Id == nil { log.Fatal().Msg("Received response with no id") } - responseChannel, ok := responseChannels.Pop(*msg.Response.Id) + responseChannel, ok := responseChannels[*msg.Response.Id] if !ok { log.Warn(). Uint64("response_id", *msg.Response.Id). Msg("Received response with unknown id") continue } - logEvt := log.Debug(). - Uint64("response_id", msg.Response.GetId()). - Uint32("response_status", msg.Response.GetStatus()). - Str("response_message", msg.Response.GetMessage()) - if log.GetLevel() == zerolog.TraceLevel || len(msg.Response.Body) < 256 { - logEvt.Strs("response_headers", msg.Response.Headers) - if json.Valid(msg.Response.Body) { - logEvt.RawJSON("response_body", msg.Response.Body) - } else { - logEvt.Str("response_body", base64.StdEncoding.EncodeToString(msg.Response.Body)) - } - } - logEvt.Msg("Received WS response") + log.Debug(). + Uint64("response_id", *msg.Response.Id). + Uint32("response_status", *msg.Response.Status). + Msg("Received WS response") responseChannel <- msg.Response + delete(responseChannels, *msg.Response.Id) + log.Debug(). + Uint64("response_id", *msg.Response.Id). + Msg("Deleted response channel for ID") close(responseChannel) } else if *msg.Type == signalpb.WebSocketMessage_UNKNOWN { return fmt.Errorf("received message with unknown type: %v", *msg.Type) @@ -516,7 +486,7 @@ func writeLoop( ctx context.Context, ws *websocket.Conn, sendChannel chan SignalWebsocketSendMessage, - responseChannels *exsync.Map[uint64, chan *signalpb.WebSocketResponseMessage], + responseChannels map[uint64]chan *signalpb.WebSocketResponseMessage, ) error { log := zerolog.Ctx(ctx).With(). Str("loop", "signal_websocket_write_loop"). @@ -539,7 +509,11 @@ func writeLoop( Request: request.RequestMessage, } request.RequestMessage.Id = &i - responseChannels.Set(i, request.ResponseChannel) + responseChannels[i] = request.ResponseChannel + path := *request.RequestMessage.Path + if len(path) > 30 { + path = path[:40] + } if !request.RequestTime.IsZero() { elapsed := time.Since(request.RequestTime) if elapsed > 1*time.Minute { @@ -548,14 +522,14 @@ func writeLoop( log.Warn(). Uint64("request_id", i). Str("request_verb", *request.RequestMessage.Verb). - Str("request_path", *request.RequestMessage.Path). + Str("request_path", path). Dur("elapsed", elapsed). Msg("Sending WS request") } else { log.Debug(). Uint64("request_id", i). Str("request_verb", *request.RequestMessage.Verb). - Str("request_path", *request.RequestMessage.Path). + Str("request_path", path). Dur("elapsed", elapsed). Msg("Sending WS request") } @@ -590,33 +564,13 @@ func writeLoop( func (s *SignalWebsocket) SendRequest( ctx context.Context, - method, - path string, - body []byte, - headers http.Header, + request *signalpb.WebSocketRequestMessage, ) (*signalpb.WebSocketResponseMessage, error) { if s == nil { return nil, errors.New("websocket is nil") } - headerArray := make([]string, len(headers)) - var hasContentType bool - for key, values := range headers { - if strings.ToLower(key) == "content-type" { - hasContentType = true - } - for _, value := range values { - headerArray = append(headerArray, fmt.Sprintf("%s:%s", strings.ToLower(key), value)) - } - } - if !hasContentType && body != nil { - headerArray = append(headerArray, "content-type:application/json") - } - return s.sendRequestInternal(ctx, &signalpb.WebSocketRequestMessage{ - Verb: &method, - Path: &path, - Body: body, - Headers: headerArray, - }, time.Now(), 0) + startTime := time.Now() + return s.sendRequestInternal(ctx, request, startTime, 0) } func (s *SignalWebsocket) sendRequestInternal( @@ -639,8 +593,7 @@ func (s *SignalWebsocket) sendRequestInternal( } response := <-responseChannel - isSelfDelete := request.GetVerb() == http.MethodDelete && strings.HasPrefix(request.GetPath(), "/v1/devices/") - if response == nil && !isSelfDelete { + if response == nil { // If out of retries, return error no matter what if retryCount >= 3 { // TODO: I think error isn't getting passed in this context (as it's not the one in writeLoop) diff --git a/pkg/signalmeow/web/web.go b/pkg/signalmeow/web/web.go index f211b77..3644451 100644 --- a/pkg/signalmeow/web/web.go +++ b/pkg/signalmeow/web/web.go @@ -26,18 +26,20 @@ import ( "fmt" "io" "net/http" + "net/url" + "os" "runtime" "strings" - "time" "github.com/rs/zerolog" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" ) -var BaseUserAgent = "libsignal/" + libsignalgo.Version + " go/" + strings.TrimPrefix(runtime.Version(), "go") -var UserAgent = "signalmeow/0.1.0 " + BaseUserAgent +const proxyUrlStr = "" // Set this to proxy requests +const caCertPath = "" // Set this to trust a self-signed cert (ie. for mitmproxy) + +var UserAgent = "signalmeow/0.1.0 libsignal/" + libsignalgo.Version + " go/" + strings.TrimPrefix(runtime.Version(), "go") var SignalAgent = "MAU" const ( @@ -57,11 +59,11 @@ var CDNHosts = []string{ //go:embed signal-root.crt.der var signalRootCertBytes []byte -var SignalCertPool = x509.NewCertPool() -var SignalTLSConfig = &tls.Config{RootCAs: SignalCertPool} var signalTransport = &http.Transport{ ForceAttemptHTTP2: true, - TLSClientConfig: SignalTLSConfig, + TLSClientConfig: &tls.Config{ + RootCAs: x509.NewCertPool(), + }, } var SignalHTTPClient = &http.Client{ Transport: signalTransport, @@ -72,17 +74,31 @@ func init() { if err != nil { panic(err) } - SignalCertPool.AddCert(cert) + signalTransport.TLSClientConfig.RootCAs.AddCert(cert) + + if proxyUrlStr != "" { + proxyURL, err := url.Parse(proxyUrlStr) + if err != nil { + panic(err) + } + signalTransport.Proxy = http.ProxyURL(proxyURL) + } + if caCertPath != "" { + caCert, err := os.ReadFile(caCertPath) + if err != nil { + panic(err) + } + signalTransport.TLSClientConfig.RootCAs.AppendCertsFromPEM(caCert) + } } type ContentType string const ( - ContentTypeJSON ContentType = "application/json" - ContentTypeProtobuf ContentType = "application/x-protobuf" - ContentTypeOctetStream ContentType = "application/octet-stream" - ContentTypeOffsetOctetStream ContentType = "application/offset+octet-stream" - ContentTypeMultiRecipientMessage ContentType = "application/vnd.signal-messenger.mrm" + ContentTypeJSON ContentType = "application/json" + ContentTypeProtobuf ContentType = "application/x-protobuf" + ContentTypeOctetStream ContentType = "application/octet-stream" + ContentTypeOffsetOctetStream ContentType = "application/offset+octet-stream" ) type HTTPReqOpt struct { @@ -90,21 +106,25 @@ type HTTPReqOpt struct { Username *string Password *string ContentType ContentType + Host string Headers map[string]string OverrideURL string // Override the full URL, if set ignores path and Host } var httpReqCounter = 0 -func SendHTTPRequest(ctx context.Context, host, method, path string, opt *HTTPReqOpt) (*http.Response, error) { +func SendHTTPRequest(ctx context.Context, method string, path string, opt *HTTPReqOpt) (*http.Response, error) { // Set defaults if opt == nil { opt = &HTTPReqOpt{} } + if opt.Host == "" { + opt.Host = APIHostname + } if len(path) > 0 && path[0] != '/' { path = "/" + path } - urlStr := "https://" + host + path + urlStr := "https://" + opt.Host + path if opt.OverrideURL != "" { urlStr = opt.OverrideURL } @@ -130,7 +150,6 @@ func SendHTTPRequest(ctx context.Context, host, method, path string, opt *HTTPRe } else { req.Header.Set("Content-Type", string(ContentTypeJSON)) } - req.ContentLength = int64(len(opt.Body)) req.Header.Set("Content-Length", fmt.Sprintf("%d", len(opt.Body))) req.Header.Set("User-Agent", UserAgent) req.Header.Set("X-Signal-Agent", SignalAgent) @@ -141,45 +160,18 @@ func SendHTTPRequest(ctx context.Context, host, method, path string, opt *HTTPRe httpReqCounter++ log = log.With().Int("request_number", httpReqCounter).Logger() log.Trace().Msg("Sending HTTP request") - start := time.Now() resp, err := SignalHTTPClient.Do(req) - dur := time.Since(start) if err != nil { - log.Err(err).Dur("duration", dur).Msg("Error sending request") + log.Err(err).Msg("Error sending request") return nil, err } - log.Debug().Int("status_code", resp.StatusCode).Dur("duration", dur).Msg("Received HTTP response") + log.Debug().Int("status_code", resp.StatusCode).Msg("received HTTP response") return resp, nil } -func CloseBody(resp *http.Response) { - if resp != nil && resp.Body != nil { - _ = resp.Body.Close() - } -} - -func DecodeWSResponseBody(ctx context.Context, out any, resp *signalpb.WebSocketResponseMessage) error { - if resp == nil { - return nil - } - if resp.GetStatus() < 200 || resp.GetStatus() >= 300 { - zerolog.Ctx(ctx).Warn(). - Bytes("body", resp.Body). - Str("resp_message", resp.GetMessage()). - Strs("headers", resp.Headers). - Uint32("status_code", resp.GetStatus()). - Msg("Unexpected status code") - return fmt.Errorf("unexpected response status %d", resp.GetStatus()) - } - if out == nil { - return nil - } - return json.Unmarshal(resp.Body, &out) -} - // DecodeHTTPResponseBody checks status code, reads an http.Response's Body and decodes it into the provided interface. func DecodeHTTPResponseBody(ctx context.Context, out any, resp *http.Response) error { - defer CloseBody(resp) + defer resp.Body.Close() // Check if status code indicates success if resp.StatusCode < 200 || resp.StatusCode >= 300 { @@ -200,33 +192,37 @@ func DecodeHTTPResponseBody(ctx context.Context, out any, resp *http.Response) e return nil } -func GetAttachment(ctx context.Context, path string, cdnNumber uint32) (*http.Response, error) { +func GetAttachment(ctx context.Context, path string, cdnNumber uint32, opt *HTTPReqOpt) (*http.Response, error) { log := zerolog.Ctx(ctx).With(). Str("action", "get_attachment"). Str("path", path). Uint32("cdn_number", cdnNumber). Logger() - var host string - if int(cdnNumber) > len(CDNHosts) { - log.Warn().Msg("Invalid CDN index") - host = CDN1Hostname - } else { - host = CDNHosts[cdnNumber] + if opt == nil { + opt = &HTTPReqOpt{} } - if cdnNumber == 0 { - // This is basically a fallback if cdnNumber is not set, - // but it also seems to be the right host if cdnNumber == 0 - host = CDNHosts[0] - } else if cdnNumber > 0 && int(cdnNumber) <= len(CDNHosts) { - // Pull CDN hosts from array (cdnNumber is 1-indexed, but we have a placeholder host at index 0) - // (the 1-indexed is just an assumption, other clients seem to only explicitly handle cdnNumber == 0 and 2) - host = CDNHosts[cdnNumber] - } else { - host = CDNHosts[0] - log.Warn().Msg("Invalid CDN index") + if opt.Host == "" { + if int(cdnNumber) > len(CDNHosts) { + log.Warn().Msg("Invalid CDN index") + opt.Host = CDN1Hostname + } else { + opt.Host = CDNHosts[cdnNumber] + } + if cdnNumber == 0 { + // This is basically a fallback if cdnNumber is not set + // but it also seems to be the right host if cdnNumber == 0 + opt.Host = CDNHosts[0] + } else if cdnNumber > 0 && int(cdnNumber) <= len(CDNHosts) { + // Pull CDN hosts from array (cdnNumber is 1-indexed, but we have a placeholder host at index 0) + // (the 1-indexed is just an assumption, other clients seem to only explicitly handle cdnNumber == 0 and 2) + opt.Host = CDNHosts[cdnNumber] + } else { + opt.Host = CDNHosts[0] + log.Warn().Msg("Invalid CDN index") + } } - log.Debug().Str("host", host).Msg("getting attachment") - urlStr := "https://" + host + path + log.Debug().Str("host", opt.Host).Msg("getting attachment") + urlStr := "https://" + opt.Host + path req, err := http.NewRequest(http.MethodGet, urlStr, nil) if err != nil { return nil, err