diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..4520fd1 --- /dev/null +++ b/.envrc @@ -0,0 +1,8 @@ +if [[ $(uname -s) == "Linux" && $(uname --kernel-version | grep "NixOS") ]]; then + echo "The best OS (NixOS) has been detected. Using nice tools." + if ! has nix_direnv_version || ! nix_direnv_version 3.0.0; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.0/direnvrc" "sha256-21TMnI2xWX7HkSTjFFri2UaohXVj854mgvWapWrxRXg=" + fi + + use flake +fi diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index dfb4b8b..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.pb.go linguist-generated=true -*.pb.raw binary linguist-generated=true diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index cba1054..02ed284 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,18 +1,7 @@ --- name: Bug report about: If something is definitely wrong in the bridge (rather than just a setup issue), - file a bug report. Remember to include relevant logs. Asking in the Matrix room first - is strongly recommended. -type: Bug + file a bug report. Remember to include relevant logs. +labels: bug --- - - - -### Checklist - - - -* [ ] 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: `` diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md index a04fe58..264e67f 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.md +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -1,6 +1,6 @@ --- name: Enhancement request about: Submit a feature request or other suggestion -type: Feature +labels: enhancement --- diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8b988db..844bdba 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -2,25 +2,16 @@ name: Go on: [push, pull_request] -env: - GOTOOLCHAIN: local - jobs: lint: runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - go-version: ["1.26", "1.27"] - name: Lint ${{ matrix.go-version == '1.27' && '(latest)' || '(old)' }} - steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v7 + uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} + go-version: "1.21" cache: true - name: Install libolm @@ -33,29 +24,28 @@ jobs: export PATH="$HOME/go/bin:$PATH" - name: Run pre-commit - uses: pre-commit/action@v3.0.1 + uses: pre-commit/action@v3.0.0 test: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - go-version: ["1.26", "1.27"] - name: Test ${{ matrix.go-version == '1.27' && '(latest)' || '(old)' }} + go-version: ["1.20", "1.21"] steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v7 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} cache: true - #- name: Set up gotestfmt - # uses: GoTestTools/gotestfmt-action@v2 - # with: - # token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up gotestfmt + uses: GoTestTools/gotestfmt-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: Install libolm run: sudo apt-get install libolm-dev @@ -68,5 +58,4 @@ jobs: run: | set -euo pipefail export LIBRARY_PATH=. - #go test -v -json ./... -cover | gotestfmt - go test ./... + go test -v -json ./... -cover | gotestfmt diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index c15f2fa..0000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: 'Lock old issues' - -on: - schedule: - - cron: '0 12 * * *' - workflow_dispatch: - -permissions: - issues: write -# pull-requests: write -# discussions: write - -concurrency: - group: lock-threads - -jobs: - lock-stale: - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v6 - id: lock - with: - issue-inactive-days: 90 - process-only: issues - - name: Log processed threads - run: | - if [ '${{ steps.lock.outputs.issues }}' ]; then - echo "Issues:" && echo '${{ steps.lock.outputs.issues }}' | jq -r '.[] | "https://github.com/\(.owner)/\(.repo)/issues/\(.issue_number)"' - fi diff --git a/.gitignore b/.gitignore index 7766014..c4d535d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ *.log* /mautrix-signal +/mautrix-signalgo /start /libsignal_ffi.a - -.idea diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6420bf8..6c694eb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,10 @@ include: - project: 'mautrix/ci' - file: '/gov2-as-default.yml' + file: '/go.yml' variables: BUILDER_IMAGE: dock.mau.dev/tulir/gomuks-build-docker/signal + BINARY_NAME: mautrix-signal # 32-bit arm builds aren't supported build arm: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9cc6a3..064e948 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 + rev: v4.5.0 hooks: - id: trailing-whitespace exclude_types: [markdown] @@ -9,20 +9,16 @@ 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.1 hooks: - id: go-imports exclude: "pb\\.go$" - args: - - "-local" - - "go.mau.fi/mautrix-signal" - - "-w" - id: go-vet-mod -# - id: go-staticcheck-repo-mod + #- id: go-staticcheck-repo-mod # TODO: reenable this and fix all the problems - repo: https://github.com/beeper/pre-commit-go - rev: v0.4.2 + rev: v0.3.0 hooks: - id: zerolog-ban-msgf - id: zerolog-use-stringer diff --git a/CHANGELOG.md b/CHANGELOG.md index a0d718c..b2ff61f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,314 +1,12 @@ -# v26.09 - -* Bumped minimum Go version to 1.26. -* Updated libsignal to v1.102.2. -* Fixed handling messages with invalid values in formatting body ranges. -* Fixed websocket request retrying not working correctly if the first attempt - times out. -* Fixed another potential race condition with edited message bridging. - -# v26.08 - -* Updated libsignal to v0.100.0 -* Added support for handling own profile key changes. -* Changed attachment bridging behavior to match Signal Desktop. -* Fixed edited messages being bridged twice if certain race conditions occurred. - -# v26.07 - -* Updated Docker image to Alpine 3.24. -* Updated libsignal to v0.97.2. -* Added automatic retry when sender key send fails due to missing session. -* Fixed changing poll votes from Matrix. - -# v26.06 - -* Updated libsignal to v0.94.4. -* Updated mrenclave to fix looking up phone numbers. -* Changed knock accept handling to auto-join the ghost user afterwards. - -# v26.05 - -* Updated libsignal to v0.93.2. -* Added support for importing sticker packs from Signal. - -# v26.04 - -* 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 - -* Switched to calendar versioning. -* Updated libsignal to v0.84.0. -* Fixed backfill creating incorrect disappearing timer change notices. - -# v0.8.7 (2025-09-16) - -* Removed legacy provisioning API and database legacy migration. - Upgrading directly from versions prior to v0.7.0 is not supported. - * If you've been using the bridge since before v0.7.0 and have prevented the - bridge from writing to the config, you must either update the config - manually or allow the bridge to update it for you **before** upgrading to - this release (i.e. run v0.8.6 once with config writing allowed). -* Updated libsignal to v0.80.3. -* Added support for `com.beeper.disappearing_timer` state event, which stores - the disappearing setting of chats and allows changing the setting from Matrix. -* Added support for nicknames in displayname templates. - * Like contact list names, nicknames are not safe to use on multi-user instances. -* Added support for creating Signal groups. -* Fixed certain types of logouts not being detected properly. - -# v0.8.6 (2025-08-16) - -* Deprecated legacy provisioning API. The `/_matrix/provision/v2` endpoints will - be deleted in the next release. -* Bumped minimum Go version to 1.24. -* Updated libsignal to v0.78.2. -* Added support for "delete to me" of chats and messages. -* Added support for latest Signal backup/transfer protocol. - -# v0.8.5 (2025-07-16) - -* Updated libsignal to v0.76.1. - -# v0.8.4 (2025-06-16) - -* Updated libsignal to v0.74.1. -* Updated Docker image to Alpine 3.22. -* Fixed avatars when using direct media. -* Fixed starting chats with non-contact users. -* Fixed Matrix media being rejected if the mime type isn't specified. - -# v0.8.3 (2025-05-16) - -* Updated libsignal to v0.72.1. -* Added initial support for direct media access. - * Note that media is only kept on the Signal servers for 45 days, after which - any direct media links will permanently stop working. -* Added buffer for decrypted events to prevent losing messages if the bridge is - stopped in the middle of event handling. -* Fixed backfilling messages in existing portals after relogining. - -# v0.8.2 (2025-04-16) - -* Updated libsignal to v0.70.0. -* Fixed panics in some cases when the bridge was under heavy load. - -# v0.8.1 (2025-03-16) - -* Added QR refreshing when logging in. -* Updated libsignal to v0.67.4. - -# v0.8.0 (2025-02-16) - -* Bumped minimum Go version to 1.23. -* Added support for history transfer. -* Updated libsignal to v0.66.2. - -# v0.7.5 (2025-01-16) - -* Added support for bridging mp4 gifs in both directions. -* Added support for signaling supported features to clients using the - `com.beeper.room_features` state event. -* Updated Signal websocket authentication method. -* Fixed some cases where websocket would get stuck after a ping timeout. - -# v0.7.4 (2024-12-16) - -* Fixed syncing server-side storage after Signal login. -* Added support for new SSRE2 method of receiving the server-side storage key. -* Updated libsignal to v0.64.1. -* Updated Docker image to Alpine 3.21. - -# v0.7.3 (2024-11-16) - -* Updated libsignal to v0.62.0. - * Note for bridges running in systemd: the new version of libsignal may be - incompatible with the `MemoryDenyWriteExecute=true` option (see [#750]). -* Added basic support for Signal's new file upload protocol. - -[#750]: https://github.com/mautrix/signal/issues/570 - -# v0.7.2 (2024-10-16) - -* Updated to libsignal v0.58.3. -* Fixed spurious decryption error notices for Signal messages when the - websocket reconnects and receives old already-bridged messages. -* Fixed signalmeow not respecting account settings for choosing sender - certificate. -* Fixed bugs in storage service decryption, which could cause issues with - missing contact names among other things. -* Fixed call start notices only working once per direct chat. - -# v0.7.1 (2024-09-16) - -* Updated to libsignal v0.57.1. -* Dropped support for unauthenticated media on Matrix. -* Added support for Matrix->Signal power level bridging - (thanks to [@maltee1] in [#531]). -* Changed voice message conversion to convert to aac instead of m4a, - because Signal iOS doesn't appear to like ffmpeg's m4a files. -* Fixed outgoing sync messages not including disappearing start timestamp, - which would cause native clients to disappear messages at the wrong time. -* Re-added notices about decryption errors. - -[#531]: https://github.com/mautrix/signal/pull/531 - -# v0.7.0 (2024-08-16) - -* Bumped minimum Go version to 1.22. -* Updated to libsignal v0.55.0. -* Rewrote bridge using bridgev2 architecture. - * It is recommended to check the config file after upgrading. If you have - prevented the bridge from writing to the config, you should update it - manually. - * Thanks to [@maltee1] for reimplementing Matrix -> Signal membership - handling in the rewrite. - * If you are still somehow using a pre-v0.5.0 versions, upgrading to v0.6.3 - is required before upgrading to v0.7.0 or higher. - -# v0.6.3 (2024-07-16) - -* Updated to libsignal v0.52.0. -* Fixed bridge losing track of user phone numbers in some cases. -* Fixed edge cases in handling new outgoing DMs started from other devices. -* Added `sync groups` command (thanks to [@maltee1] in [#490]). -* Fixed typo in location bridging example config - (thanks to [@AndrewFerr] in [#516]). - -[#490]: https://github.com/mautrix/signal/pull/490 -[#516]: https://github.com/mautrix/signal/pull/516 -[@AndrewFerr]: https://github.com/mautrix/signal/pull/516 - -# v0.6.2 (2024-06-16) - -* Updated to libsignal v0.51.0. -* Fixed voice messages not being rendered correctly in Element X. -* Fixed contact avatars not being bridged correctly even when enabled in - the bridge config. -* Implemented connector for the upcoming bridgev2 architecture. - -# v0.6.1 (2024-05-16) - -* Added support for bridging location messages from Matrix to Signal - (thanks to [@maltee1] in [#504]). - * Note that Signal doesn't support real location messages, so they're just - bridged as links. The link template is configurable. -* Fixed bridging long text messages from Signal - (thanks to [@maltee1] in [#506]). -* Improved handling of ping timeouts in Signal websocket. - -[#504]: https://github.com/mautrix/signal/pull/504 -[#506]: https://github.com/mautrix/signal/pull/506 - -# v0.6.0 (2024-04-16) - -* Updated to libsignal v0.44.0. -* Refactored bridge to support Signal's new phone number identifier (PNI) - system in order to fix starting new chats and receiving messages from new - users. - * When starting a chat with a user you haven't talked to before, the portal - room will not have a ghost user for the recipient until they accept the - message request. -* Added support for syncing existing groups on login instead of having to wait - for new messages. -* Added notices if decrypting incoming message from Signal fails. -* Added bridging of group metadata from Matrix to Signal - (thanks to [@maltee1] in [#461]). -* Added command to create new Signal group for Matrix room - (thanks to [@maltee1] in [#461] and [#491]). -* Added commands for inviting users to Signal groups by phone number - (thanks to [@maltee1] in [#495]). -* Improved handling of missed Signal group metadata changes - (thanks to [@maltee1] in [#488]). - -[#461]: https://github.com/mautrix/signal/pull/461 -[#488]: https://github.com/mautrix/signal/pull/488 -[#491]: https://github.com/mautrix/signal/pull/491 -[#495]: https://github.com/mautrix/signal/pull/495 - -# v0.5.1 (2024-03-16) - -* Updated to libsignal v0.41.0. -* Fixed sending messages to groups. -* Fixed some cases of ghost user info changing repeatedly on multi-user - instances. -* Fixed migrating SQLite databases from Python version. - -# v0.5.0 (2024-02-16) +# v0.5.0 (unreleased) * Rewrote bridge in Go. - * To migrate the bridge, simply upgrade in-place. The database and config - will be migrated automatically, although some parts of the config aren't - migrated (e.g. log config). If you prevented the bridge from writing to - the config file, you'll have to temporarily allow it or update it yourself. - * The bridge doesn't use signald anymore, all users will have to re-link the - bridge. signald can be deleted after upgrading. + * The bridge doesn't use signald anymore. + * All users will have to re-link the bridge. * Primary device mode is no longer supported, signal-cli is recommended if you don't want to use the official Signal mobile apps. - * Some old features are not yet supported (e.g. group management features). + * Some old features are not yet supported (e.g. membership action bridging, + join rules and getting group invite links). * Renamed main branch from `master` to `main`. * Added support for edits and message formatting. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 764f753..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -See diff --git a/Dockerfile b/Dockerfile index ba0a602..6e6b20d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,17 @@ # -- 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 . -RUN ./build-rust.sh +ENV RUSTFLAGS="-Ctarget-feature=-crt-static" RUSTC_WRAPPER="" +RUN cd pkg/libsignalgo/libsignal/ && cargo build -p libsignal-ffi --release # -- Build mautrix-signal (with Go) -- -FROM golang:1-alpine3.24 AS go-builder -RUN apk add --no-cache git ca-certificates build-base olm-dev zlib-dev +FROM golang:1-alpine3.19 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 @@ -19,27 +19,25 @@ COPY *.go go.* *.yaml *.sh ./ COPY pkg/signalmeow/. pkg/signalmeow/. COPY pkg/libsignalgo/* pkg/libsignalgo/ COPY pkg/libsignalgo/resources/. pkg/libsignalgo/resources/. -COPY pkg/msgconv/. pkg/msgconv/. -COPY pkg/signalid/. pkg/signalid/. -COPY pkg/connector/. pkg/connector/. -COPY cmd/. cmd/. +COPY config/. config/. +COPY database/. database/. +COPY msgconv/. msgconv/. COPY .git .git ENV LIBRARY_PATH=. -COPY --from=rust-builder /build/pkg/libsignalgo/libsignal/target/*/libsignal_ffi.a ./ -RUN </dev/null) -X main.Commit=$$(git rev-parse HEAD) -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`'" + +clean: + rm -f ./$(LIBRARY_FILENAME) + cd $(RUST_DIR) && cargo clean + rm -f $(GO_BINARY) diff --git a/README.md b/README.md index 82e9624..4e644f5 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ Some quick links: * Basic usage: [Authentication](https://docs.mau.fi/bridges/go/signal/authentication.html) ### Features & Roadmap -[ROADMAP.md](ROADMAP.md) contains a general overview of what is supported by the bridge. +[ROADMAP.md](https://github.com/mautrix/signal/blob/main/ROADMAP.md) +contains a general overview of what is supported by the bridge. ## Discussion Matrix room: [`#signal:maunium.net`](https://matrix.to/#/#signal:maunium.net) diff --git a/ROADMAP.md b/ROADMAP.md index 228b271..3899a4a 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,32 +1,30 @@ # Features & roadmap * Matrix → Signal - * [x] Message content + * [ ] Message content * [x] Text * [x] Formatting * [x] Mentions - * [x] Polls - * [x] Media + * [ ] Media * [x] Images * [x] Audio files * [x] Voice messages * [x] Files * [x] Gifs - * [x] Locations + * [ ] Locations * [x] Stickers * [x] Message edits * [x] Message reactions * [x] Message redactions - * [x] Group info changes - * [x] Name - * [x] Avatar - * [x] Topic + * [ ] Group info changes + * [ ] Name + * [ ] Avatar + * [ ] Topic * [ ] Membership actions * [ ] Join (accepting invites) - * [x] Invite - * [x] Leave - * [x] Kick/Ban/Unban - * [x] Group permissions + * [ ] Invite + * [ ] Leave + * [ ] Kick/Ban/Unban * [x] Typing notifications * [x] Read receipts * [x] Delivery receipts (sent after message is bridged) @@ -35,7 +33,6 @@ * [x] Text * [x] Formatting * [x] Mentions - * [x] Polls * [ ] Media * [x] Images * [x] Voice notes @@ -55,20 +52,20 @@ * [x] Name * [x] Avatar * [x] Topic - * [x] Membership actions - * [x] Join - * [x] Invite - * [x] Request join (via invite link, requires a client that supports knocks) - * [x] Leave - * [x] Kick/Ban/Unban - * [x] Group permissions + * [ ] Membership actions + * [ ] Join + * [ ] Invite + * [ ] Request join (via invite link, requires a client that supports knocks) + * [ ] Leave + * [ ] Kick/Ban/Unban + * [ ] Group permissions * [x] Typing notifications * [x] Read receipts * [ ] Delivery receipts (there's no good way to bridge these) * [x] Disappearing messages * Misc - * [x] Automatic portal creation - * [x] After login + * [ ] Automatic portal creation + * [ ] After login * [x] When receiving message * [x] Linking as secondary device * [ ] Registering as primary device diff --git a/bpnsclient/bpnsclient.go b/bpnsclient/bpnsclient.go new file mode 100644 index 0000000..18642e8 --- /dev/null +++ b/bpnsclient/bpnsclient.go @@ -0,0 +1,309 @@ +package bpnsclient + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "net/http" + "sync" + "time" + + "github.com/google/uuid" + "github.com/rs/zerolog" +) + +var ( + ErrBPNSUnauthorized = errors.New("imat unauthorized") + ErrBPNSUnknownDevice = errors.New("device not registered on bpns") + ErrBPNSConflict = errors.New("registration conflict on bpns") + ErrBPNSUnexpectedResponse = errors.New("unexpected error from bpns") +) + +const bpnsMinKeepalive = time.Second * 1 + +type BPNSClient struct { + log *zerolog.Logger + url string + imaToken string + cfg DeviceConfig + cancel context.CancelFunc + wg sync.WaitGroup +} + +type FCMConfig struct { + Token string `json:"token"` +} + +type SignalConfig struct { + AciUUID string `json:"aci_uuid"` + DeviceID int `json:"device_id"` + Password string `json:"password"` +} + +type DeviceConfig struct { + FCM FCMConfig `json:"fcm"` + Signal SignalConfig `json:"signal,omitempty"` +} + +type JSONDurationMs time.Duration + +func (t *JSONDurationMs) UnmarshalJSON(data []byte) error { + var value int64 + + if err := json.Unmarshal(data, &value); err != nil { + return err + } + + *t = JSONDurationMs(value * int64(time.Millisecond)) + return nil +} + +type KeepaliveResponse struct { + Rate JSONDurationMs `json:"rate_ms"` +} + +func NewBPNSClient(log *zerolog.Logger, url, imaToken, pushToken string, signalACI uuid.UUID, signalPassword string, deviceID int) *BPNSClient { + deviceConfig := DeviceConfig{ + FCM: FCMConfig{ + Token: pushToken, + }, + Signal: SignalConfig{ + AciUUID: signalACI.String(), + Password: signalPassword, + DeviceID: deviceID, + }, + } + + return &BPNSClient{ + log: log, + url: url, + imaToken: imaToken, + cfg: deviceConfig, + } +} + +func (bpns *BPNSClient) request(ctx context.Context, method, endpoint string, body any) (*http.Response, error) { + var bodyReader io.Reader + + if body != nil { + data, err := json.Marshal(body) + if err != nil { + return nil, err + } + + bodyReader = bytes.NewReader(data) + } + + req, err := http.NewRequestWithContext(ctx, method, fmt.Sprintf("%s/v1/signal/%s", bpns.url, endpoint), bodyReader) + if err != nil { + return nil, err + } + + req.Header.Set("Authorization", "Bearer "+bpns.imaToken) + req.Header.Set("User-Agent", "signal") + + normalTransport := &http.Transport{ + DialContext: (&net.Dialer{Timeout: 10 * time.Second}).DialContext, + ForceAttemptHTTP2: true, + TLSHandshakeTimeout: 10 * time.Second, + ResponseHeaderTimeout: 5 * time.Second, + } + normalClient := &http.Client{ + Timeout: 1 * time.Minute, + Transport: normalTransport, + } + resp, err := normalClient.Do(req) + if err != nil { + bpns.log.Trace().Err(err).Stringer("url", req.URL).Str("method", method).Msg("bpns Request Error") + } else { + bpns.log.Trace().Stringer("url", req.URL).Str("method", method).Str("status", resp.Status).Msg("bpns Request") + } + + return resp, err +} + +func (bpns *BPNSClient) register(ctx context.Context) (time.Duration, error) { + resp, err := bpns.request(ctx, http.MethodPut, "device", &bpns.cfg) + if err != nil { + return 0, err + } + + switch resp.StatusCode { + case http.StatusCreated: + return decodeKeepaliveRate(resp) + case http.StatusConflict: + return 0, ErrBPNSConflict + case http.StatusUnauthorized: + return 0, ErrBPNSUnauthorized + default: + return 0, fmt.Errorf("%w: register returned unexpected status %d", ErrBPNSUnexpectedResponse, resp.StatusCode) + } +} + +func decodeKeepaliveRate(resp *http.Response) (rate time.Duration, err error) { + if resp.Body == nil { + return + } + + var keepaliveResp KeepaliveResponse + if err = json.NewDecoder(resp.Body).Decode(&keepaliveResp); err != nil { + return + } + + rate = time.Duration(keepaliveResp.Rate) + return +} + +func (bpns *BPNSClient) keepalive(ctx context.Context) (time.Duration, error) { + resp, err := bpns.request(ctx, http.MethodPost, "keepalive", nil) + if err != nil { + return 0, err + } + + switch resp.StatusCode { + case http.StatusOK: + return decodeKeepaliveRate(resp) + case http.StatusNoContent: + return 0, nil + case http.StatusUnauthorized: + return 0, ErrBPNSUnauthorized + case http.StatusNotFound: + return 0, ErrBPNSUnknownDevice + default: + return 0, fmt.Errorf("%w: keepalive returned unexpected status %d", ErrBPNSUnexpectedResponse, resp.StatusCode) + } +} + +func (bpns *BPNSClient) yield(ctx context.Context) error { + resp, err := bpns.request(ctx, http.MethodPost, "yield", nil) + if err != nil { + return err + } + + switch resp.StatusCode { + case http.StatusNoContent: + return nil + case http.StatusUnauthorized: + return ErrBPNSUnauthorized + case http.StatusNotFound: + return ErrBPNSUnknownDevice + default: + return fmt.Errorf("%w: yield returned unexpected status %d", ErrBPNSUnexpectedResponse, resp.StatusCode) + } +} + +func (bpns *BPNSClient) keepaliveOrRegister(ctx context.Context) (time.Duration, error) { + rate, err := bpns.keepalive(ctx) + + if err == ErrBPNSUnknownDevice { + rate, err = bpns.register(ctx) + } + + return rate, err +} + +func (bpns *BPNSClient) Start(ctx context.Context) { + if bpns.cancel != nil { + bpns.log.Debug().Msg("Start() called when already running") + return + } + + if bpns.url == "" { + bpns.log.Warn().Msg("No URL set, bpns disabled") + return + } + + // we need to run once with start context to make bpns disconnect from remote network immediately + rate, err := bpns.keepaliveOrRegister(ctx) + if err != nil { + bpns.log.Warn().Err(err).Msg("Unexpected bpns error during start") + // first successful keepalive will reset the ticker + rate = time.Second * 30 + } else if rate == 0 { + bpns.log.Warn().Msg("Server requested we don't do keepalives, not starting loop") + return + } else if rate < bpnsMinKeepalive { + bpns.log.Warn().Dur("rate_req", rate).Dur("rate_min", bpnsMinKeepalive).Msg("Server requested keepalive time less than allowed, using ours") + rate = bpnsMinKeepalive + } + + bpns.log.Info().Str("url", bpns.url).Dur("rate", rate).Msg("Starting bpns loop") + + ctx, bpns.cancel = context.WithCancel(context.Background()) + + bpns.wg.Add(1) + go func() { + defer func() { + bpns.wg.Done() + bpns.log.Trace().Msg("Leaving bpns loop") + }() + + ticker := time.NewTicker(rate) + for { + select { + case <-ticker.C: + newRate, err := bpns.keepaliveOrRegister(ctx) + if errors.Is(err, context.Canceled) { + return + } else if err != nil { + bpns.log.Warn().Err(err).Msg("Unexpected bpns error") + } else if newRate == 0 { + bpns.log.Warn().Msg("Keepalive returned zero rate, stopping loop") + return + } else if newRate > bpnsMinKeepalive && newRate != rate { + bpns.log.Info().Dur("rate_new", newRate).Dur("rate_old", rate).Msg("Keepalive rate changed by bpns") + rate = newRate + ticker.Reset(rate) + } + case <-ctx.Done(): + return + } + } + }() +} + +func (bpns *BPNSClient) Stop(ctx context.Context) { + if bpns.cancel == nil { + return + } + + bpns.log.Info().Msg("Stopping bpns loop") + + bpns.Close() + + // send yield before returning + bpns.log.Debug().Msg("Sending final yield") + err := bpns.yield(ctx) + if err != nil { + bpns.log.Err(err).Msg("Final yield failed") + } else { + bpns.log.Info().Msg("Yielded bpns connection") + } +} + +func (bpns *BPNSClient) Close() { + if bpns.cancel == nil { + return + } + + bpns.cancel() + bpns.cancel = nil + bpns.wg.Wait() +} + +func (bpns *BPNSClient) Deregister(ctx context.Context) error { + _, err := bpns.request(ctx, http.MethodDelete, "device", &bpns.cfg) + return err +} + +func (bpns *BPNSClient) IsUsingSignalACI(aci uuid.UUID) bool { + return uuid.MustParse(bpns.cfg.Signal.AciUUID) == aci +} + +func (bpns *BPNSClient) IsUsingFCMPushToken(token string) bool { + return bpns.cfg.FCM.Token == token +} diff --git a/build-go.sh b/build-go.sh index 54f9c6a..91123ec 100755 --- a/build-go.sh +++ b/build-go.sh @@ -1,2 +1,4 @@ #!/bin/sh -BINARY_NAME=mautrix-signal go tool maubuild "$@" +export MAUTRIX_VERSION=$(cat go.mod | grep 'maunium.net/go/mautrix ' | awk '{ print $2 }') +export GO_LDFLAGS="-s -w -X main.Tag=$(git describe --exact-match --tags 2>/dev/null) -X main.Commit=$(git rev-parse HEAD) -X 'main.BuildTime=`date '+%b %_d %Y, %H:%M:%S'`' -X 'maunium.net/go/mautrix.GoModVersion=$MAUTRIX_VERSION'" +go build -ldflags "$GO_LDFLAGS" -o mautrix-signal diff --git a/build-rust.sh b/build-rust.sh deleted file mode 100755 index d75efb3..0000000 --- a/build-rust.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -git submodule update --init -cd pkg/libsignalgo/libsignal && RUSTFLAGS="-Ctarget-feature=-crt-static" RUSTC_WRAPPER="" cargo build -p libsignal-ffi --profile=release diff --git a/build.sh b/build.sh index 3ec20a6..b17ad4f 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,4 @@ #!/bin/sh -set -e -./build-rust.sh -cp -f pkg/libsignalgo/libsignal/target/release/libsignal_ffi.a . -LIBRARY_PATH=.:$LIBRARY_PATH ./build-go.sh +git submodule init +git submodule update +make diff --git a/cmd/mautrix-signal/legacyprovision.go b/cmd/mautrix-signal/legacyprovision.go deleted file mode 100644 index c9061ac..0000000 --- a/cmd/mautrix-signal/legacyprovision.go +++ /dev/null @@ -1,147 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 istributed 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 main - -import ( - "encoding/json" - "fmt" - "net/http" - - "github.com/rs/zerolog" - "maunium.net/go/mautrix" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/id" -) - -func legacyResolveIdentifierOrStartChat(w http.ResponseWriter, r *http.Request, create bool) { - login := m.Matrix.Provisioning.GetLoginForRequest(w, r) - if login == nil { - return - } - api := login.Client.(bridgev2.IdentifierResolvingNetworkAPI) - phonenum := r.PathValue("phonenum") - resp, err := api.ResolveIdentifier(r.Context(), phonenum, create) - if err != nil { - zerolog.Ctx(r.Context()).Err(err).Msg("Failed to resolve identifier") - JSONResponse(w, http.StatusInternalServerError, &Error{ - Error: fmt.Sprintf("Failed to resolve identifier: %v", err), - ErrCode: "M_UNKNOWN", - }) - return - } else if resp == nil { - JSONResponse(w, http.StatusNotFound, &Error{ - ErrCode: mautrix.MNotFound.ErrCode, - Error: "User not found on Signal", - }) - return - } - status := http.StatusOK - apiResp := &ResolveIdentifierResponse{ - ChatID: ResolveIdentifierResponseChatID{ - UUID: string(resp.UserID), - Number: phonenum, - }, - } - if resp.Ghost != nil { - if resp.UserInfo != nil { - resp.Ghost.UpdateInfo(r.Context(), resp.UserInfo) - } - apiResp.OtherUser = &ResolveIdentifierResponseOtherUser{ - MXID: resp.Ghost.Intent.GetMXID(), - DisplayName: resp.Ghost.Name, - AvatarURL: resp.Ghost.AvatarMXC.ParseOrIgnore(), - } - } - if resp.Chat != nil { - if resp.Chat.Portal == nil { - resp.Chat.Portal, err = m.Bridge.GetPortalByKey(r.Context(), resp.Chat.PortalKey) - if err != nil { - zerolog.Ctx(r.Context()).Err(err).Msg("Failed to get portal") - JSONResponse(w, http.StatusInternalServerError, &mautrix.RespError{ - Err: "Failed to get portal", - ErrCode: "M_UNKNOWN", - }) - return - } - } - if create && resp.Chat.Portal.MXID == "" { - apiResp.JustCreated = true - status = http.StatusCreated - err = resp.Chat.Portal.CreateMatrixRoom(r.Context(), login, resp.Chat.PortalInfo) - if err != nil { - zerolog.Ctx(r.Context()).Err(err).Msg("Failed to create portal room") - JSONResponse(w, http.StatusInternalServerError, &mautrix.RespError{ - Err: "Failed to create portal room", - ErrCode: "M_UNKNOWN", - }) - return - } - } - apiResp.RoomID = resp.Chat.Portal.MXID - } - JSONResponse(w, status, &Response{ - Success: true, - Status: "ok", - ResolveIdentifierResponse: apiResp, - }) -} - -func legacyProvResolveIdentifier(w http.ResponseWriter, r *http.Request) { - legacyResolveIdentifierOrStartChat(w, r, false) -} - -func legacyProvPM(w http.ResponseWriter, r *http.Request) { - legacyResolveIdentifierOrStartChat(w, r, true) -} - -func JSONResponse(w http.ResponseWriter, status int, response any) { - w.Header().Add("Content-Type", "application/json") - w.WriteHeader(status) - _ = json.NewEncoder(w).Encode(response) -} - -type Error struct { - Success bool `json:"success"` - Error string `json:"error"` - ErrCode string `json:"errcode"` -} - -type Response struct { - Success bool `json:"success"` - Status string `json:"status"` - - // For response in ResolveIdentifier - *ResolveIdentifierResponse -} - -type ResolveIdentifierResponse struct { - RoomID id.RoomID `json:"room_id"` - ChatID ResolveIdentifierResponseChatID `json:"chat_id"` - JustCreated bool `json:"just_created"` - OtherUser *ResolveIdentifierResponseOtherUser `json:"other_user,omitempty"` -} - -type ResolveIdentifierResponseChatID struct { - UUID string `json:"uuid"` - Number string `json:"number"` -} - -type ResolveIdentifierResponseOtherUser struct { - MXID id.UserID `json:"mxid"` - DisplayName string `json:"displayname"` - AvatarURL id.ContentURI `json:"avatar_url"` -} diff --git a/cmd/mautrix-signal/main.go b/cmd/mautrix-signal/main.go deleted file mode 100644 index 703d779..0000000 --- a/cmd/mautrix-signal/main.go +++ /dev/null @@ -1,56 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 main - -import ( - "fmt" - - "maunium.net/go/mautrix/bridgev2/matrix/mxmain" - - "go.mau.fi/mautrix-signal/pkg/connector" - "go.mau.fi/mautrix-signal/pkg/signalmeow/web" -) - -// Information to find out exactly which commit the bridge was built from. -// These are filled at build time with the -X linker flag. -var ( - Tag = "unknown" - Commit = "unknown" - BuildTime = "unknown" -) - -var m = mxmain.BridgeMain{ - Name: "mautrix-signal", - URL: "https://github.com/mautrix/signal", - Description: "A Matrix-Signal puppeting bridge.", - Version: "26.09", - SemCalVer: true, - - Connector: &connector.SignalConnector{}, -} - -func main() { - web.UserAgent = fmt.Sprintf("mautrix-signal/%s %s", m.Version, web.BaseUserAgent) - m.PostStart = func() { - if m.Matrix.Provisioning != nil { - m.Matrix.Provisioning.Router.HandleFunc("GET /v2/resolve_identifier/{phonenum}", legacyProvResolveIdentifier) - m.Matrix.Provisioning.Router.HandleFunc("POST /v2/pm/{phonenum}", legacyProvPM) - } - } - m.InitVersion(Tag, Commit, BuildTime) - m.Run() -} diff --git a/commands.go b/commands.go new file mode 100644 index 0000000..9d93ded --- /dev/null +++ b/commands.go @@ -0,0 +1,644 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber +// +// 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 main + +import ( + "context" + "fmt" + "strconv" + "strings" + + "github.com/google/uuid" + "github.com/skip2/go-qrcode" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/bridge/commands" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/pkg/signalmeow" +) + +var ( + HelpSectionConnectionManagement = commands.HelpSection{Name: "Connection management", Order: 11} + HelpSectionCreatingPortals = commands.HelpSection{Name: "Creating portals", Order: 15} + HelpSectionPortalManagement = commands.HelpSection{Name: "Portal management", Order: 20} + HelpSectionInvites = commands.HelpSection{Name: "Group invites", Order: 25} + HelpSectionMiscellaneous = commands.HelpSection{Name: "Miscellaneous", Order: 30} +) + +type WrappedCommandEvent struct { + *commands.Event + Bridge *SignalBridge + User *User + Portal *Portal +} + +func (br *SignalBridge) RegisterCommands() { + proc := br.CommandProcessor.(*commands.Processor) + proc.AddHandlers( + cmdPing, + cmdLogin, + cmdSetDeviceName, + cmdPM, + cmdResolvePhone, + cmdSyncSpace, + cmdDeleteSession, + cmdSetRelay, + cmdUnsetRelay, + cmdDeletePortal, + cmdDeleteAllPortals, + cmdCleanupLostPortals, + ) +} + +func wrapCommand(handler func(*WrappedCommandEvent)) func(*commands.Event) { + return func(ce *commands.Event) { + user := ce.User.(*User) + var portal *Portal + if ce.Portal != nil { + portal = ce.Portal.(*Portal) + } + br := ce.Bridge.Child.(*SignalBridge) + handler(&WrappedCommandEvent{ce, br, user, portal}) + } +} + +var cmdSetRelay = &commands.FullHandler{ + Func: wrapCommand(fnSetRelay), + Name: "set-relay", + Help: commands.HelpMeta{ + Section: HelpSectionPortalManagement, + Description: "Relay messages in this room through your Signal account.", + }, + RequiresPortal: true, + RequiresLogin: true, +} + +func fnSetRelay(ce *WrappedCommandEvent) { + if !ce.Bridge.Config.Bridge.Relay.Enabled { + ce.Reply("Relay mode is not enabled on this instance of the bridge") + } else if ce.Bridge.Config.Bridge.Relay.AdminOnly && !ce.User.Admin { + ce.Reply("Only bridge admins are allowed to enable relay mode on this instance of the bridge") + } else { + ce.Portal.RelayUserID = ce.User.MXID + ce.Portal.Update(ce.Ctx) + ce.Reply("Messages from non-logged-in users in this room will now be bridged through your Signal account") + } +} + +var cmdUnsetRelay = &commands.FullHandler{ + Func: wrapCommand(fnUnsetRelay), + Name: "unset-relay", + Help: commands.HelpMeta{ + Section: HelpSectionPortalManagement, + Description: "Stop relaying messages in this room.", + }, + RequiresPortal: true, +} + +func fnUnsetRelay(ce *WrappedCommandEvent) { + if !ce.Bridge.Config.Bridge.Relay.Enabled { + ce.Reply("Relay mode is not enabled on this instance of the bridge") + } else if ce.Bridge.Config.Bridge.Relay.AdminOnly && !ce.User.Admin { + ce.Reply("Only bridge admins are allowed to enable relay mode on this instance of the bridge") + } else { + ce.Portal.RelayUserID = "" + ce.Portal.Update(ce.Ctx) + ce.Reply("Messages from non-logged-in users will no longer be bridged in this room") + } +} + +var cmdDeleteSession = &commands.FullHandler{ + Func: wrapCommand(fnDeleteSession), + Name: "delete-session", + Help: commands.HelpMeta{ + Section: HelpSectionConnectionManagement, + Description: "Disconnect from Signal, clearing sessions but keeping other data. Reconnect with `login`", + }, +} + +func fnDeleteSession(ce *WrappedCommandEvent) { + if !ce.User.IsLoggedIn() { + ce.Reply("You're not logged in") + return + } + ce.User.Client.ClearKeysAndDisconnect(ce.Ctx) + ce.Reply("Disconnected from Signal") +} + +var cmdPing = &commands.FullHandler{ + Func: wrapCommand(fnPing), + Name: "ping", + Help: commands.HelpMeta{ + Section: commands.HelpSectionAuth, + Description: "Check your connection to Signal", + }, +} + +func fnPing(ce *WrappedCommandEvent) { + if ce.User.SignalID == uuid.Nil { + ce.Reply("You're not logged in") + } else if !ce.User.IsLoggedIn() { + ce.Reply("You were logged in at some point, but are not anymore") + } else if !ce.User.Client.IsConnected() { + ce.Reply("You're logged into Signal, but not connected to the server") + } else { + ce.Reply("You're logged into Signal and probably connected to the server") + } +} + +var cmdSetDeviceName = &commands.FullHandler{ + Func: wrapCommand(fnSetDeviceName), + Name: "set-device-name", + Help: commands.HelpMeta{ + Section: HelpSectionConnectionManagement, + Description: "Set the name of this device in Signal", + Args: "", + }, + RequiresLogin: true, +} + +func fnSetDeviceName(ce *WrappedCommandEvent) { + if len(ce.Args) == 0 { + ce.Reply("**Usage:** `set-device-name `") + return + } + + name := strings.Join(ce.Args, " ") + err := ce.User.Client.UpdateDeviceName(ce.Ctx, name) + if err != nil { + ce.Reply("Error setting device name: %v", err) + return + } + ce.Reply("Device name updated") +} + +var cmdPM = &commands.FullHandler{ + Func: wrapCommand(fnPM), + Name: "pm", + Help: commands.HelpMeta{ + Section: HelpSectionCreatingPortals, + Description: "Open a private chat with the given phone number.", + Args: "<_international phone number_>", + }, + RequiresLogin: true, +} + +var numberCleaner = strings.NewReplacer("-", "", " ", "", "(", "", ")", "", "+", "") + +func fnPM(ce *WrappedCommandEvent) { + if len(ce.Args) == 0 { + ce.Reply("**Usage:** `pm `") + return + } + number, err := strconv.ParseUint(numberCleaner.Replace(strings.Join(ce.Args, "")), 10, 64) + if err != nil { + ce.Reply("Failed to parse number") + return + } + + user := ce.User + var targetUUID uuid.UUID + + if contact, err := user.Client.ContactByE164(ce.Ctx, fmt.Sprintf("+%d", number)); err != nil { + ce.Reply("Error looking up number in local contact list: %v", err) + return + } else if contact != nil { + targetUUID = contact.UUID + } else if resp, err := user.Client.LookupPhone(ce.Ctx, number); err != nil { + ce.ZLog.Err(err).Uint64("e164", number).Msg("Failed to lookup number on server") + ce.Reply("Error looking up number on server: %v", err) + return + } else if resp[number].ACI == uuid.Nil { + if resp[number].PNI == uuid.Nil { + ce.Reply("+%d doesn't seem to be on Signal", number) + } else { + ce.Reply("Server only returned PNI (%s) for +%d, but the bridge doesn't know what to do with it", resp[number].PNI, number) + } + return + } else { + targetUUID = resp[number].ACI + err = user.Client.Store.ContactStore.UpdatePhone(ce.Ctx, targetUUID, fmt.Sprintf("+%d", number)) + if err != nil { + ce.ZLog.Warn().Err(err).Msg("Failed to update phone number in user's contact store") + } + } + ce.ZLog.Debug(). + Uint64("e164", number). + Stringer("uuid", targetUUID). + Msg("Found DM target user") + + portal := user.GetPortalByChatID(targetUUID.String()) + if portal == nil { + ce.Reply("Couldn't get portal with %s/+%d", targetUUID, number) + return + } else if portal.MXID != "" { + ok := portal.ensureUserInvited(ce.Ctx, ce.User) + if ok { + ce.Reply("You already have a portal with +%d at [%s](%s)", number, portal.MXID, portal.MXID.URI(portal.bridge.Config.Homeserver.Domain).MatrixToURL()) + return + } + ce.ZLog.Warn().Stringer("existing_room_id", portal.MXID).Msg("Ensuring user is invited to existing room failed, creating new room") + portal.Cleanup(ce.Ctx, false) + portal.MXID = "" + } + + if err = portal.CreateMatrixRoom(ce.Ctx, user, 0); err != nil { + ce.ZLog.Err(err).Msg("Failed to create portal room") + ce.Reply("Error creating Matrix room for portal to +%d", number) + } else { + ce.Reply("Created portal room [%s](%s) with +%d and invited you to it.", portal.MXID, portal.MXID.URI(portal.bridge.Config.Homeserver.Domain).MatrixToURL(), number) + } +} + +var cmdResolvePhone = &commands.FullHandler{ + Func: wrapCommand(fnResolvePhone), + Name: "resolve-phone", + Help: commands.HelpMeta{ + Section: HelpSectionCreatingPortals, + Description: "Look up phone numbers on the Signal servers.", + Args: "", + }, + RequiresLogin: true, +} + +func fnResolvePhone(ce *WrappedCommandEvent) { + numbers := make([]uint64, len(ce.Args)) + for i, arg := range ce.Args { + var err error + numbers[i], err = strconv.ParseUint(numberCleaner.Replace(arg), 10, 64) + if err != nil { + ce.Reply("Failed to parse number %s: %v", arg, err) + return + } + } + resp, err := ce.User.Client.LookupPhone(ce.Ctx, numbers...) + if err != nil { + ce.Reply("Failed to look up: %v", err) + } else { + var out strings.Builder + for _, phone := range numbers { + result, found := resp[phone] + if found { + _, _ = fmt.Fprintf(&out, "+%d: %s / %s\n", phone, result.ACI, result.PNI) + if result.ACI != uuid.Nil { + err = ce.User.Client.Store.ContactStore.UpdatePhone(ce.Ctx, result.ACI, fmt.Sprintf("+%d", phone)) + if err != nil { + ce.ZLog.Warn().Err(err).Msg("Failed to update phone number in user's contact store") + } + } + } else { + _, _ = fmt.Fprintf(&out, "+%d: not found\n", phone) + } + } + ce.Reply(strings.TrimSpace(out.String())) + } +} + +var cmdSyncSpace = &commands.FullHandler{ + Func: wrapCommand(fnSyncSpace), + Name: "sync-space", + Help: commands.HelpMeta{ + Section: HelpSectionMiscellaneous, + Description: "Synchronize your personal filtering space", + }, + RequiresLogin: true, +} + +func fnSyncSpace(ce *WrappedCommandEvent) { + if !ce.Bridge.Config.Bridge.PersonalFilteringSpaces { + ce.Reply("Personal filtering spaces are not enabled on this instance of the bridge") + return + } + ctx := ce.Ctx + dmKeys, err := ce.Bridge.DB.Portal.FindPrivateChatsNotInSpace(ctx, ce.User.SignalID) + if err != nil { + ce.ZLog.Err(err).Msg("Failed to get private chat keys") + ce.Reply("Failed to get private chat IDs from database") + return + } + count := 0 + allPortals := ce.Bridge.GetAllPortalsWithMXID() + for _, portal := range allPortals { + if portal.IsPrivateChat() { + continue + } + if ce.Bridge.StateStore.IsInRoom(ctx, portal.MXID, ce.User.MXID) && portal.addToPersonalSpace(ctx, ce.User) { + count++ + } + } + for _, key := range dmKeys { + portal := ce.Bridge.GetPortalByChatID(key) + portal.addToPersonalSpace(ctx, ce.User) + count++ + } + plural := "s" + if count == 1 { + plural = "" + } + ce.Reply("Added %d room%s to space", count, plural) +} + +var cmdLogin = &commands.FullHandler{ + Func: wrapCommand(fnLogin), + Name: "login", + Help: commands.HelpMeta{ + Section: commands.HelpSectionAuth, + Description: "Link the bridge to your Signal account as a web client.", + }, +} + +func fnLogin(ce *WrappedCommandEvent) { + if ce.User.IsLoggedIn() { + if ce.User.Client.IsConnected() { + ce.Reply("You're already logged in") + } else { + ce.Reply("You're already logged in, but not connected 🤔") + } + return + } + + var qrEventID, msgEventID id.EventID + var signalID uuid.UUID + var signalPhone string + + // First get the provisioning URL + provChan, err := ce.User.Login() + if err != nil { + ce.Log.Errorln("Failure logging in:", err) + ce.Reply("Failure logging in: %v", err) + return + } + + resp := <-provChan + if resp.Err != nil || resp.State == signalmeow.StateProvisioningError { + ce.Reply("Error getting provisioning URL: %v", resp.Err) + return + } + if resp.State == signalmeow.StateProvisioningURLReceived { + qrEventID, msgEventID = ce.User.sendQR(ce, resp.ProvisioningURL, qrEventID, msgEventID) + } else { + ce.Reply("Unexpected state: %v", resp.State) + return + } + + // Next, get the results of finishing registration + resp = <-provChan + _, _ = ce.Bot.RedactEvent(ce.Ctx, ce.RoomID, qrEventID) + _, _ = ce.Bot.RedactEvent(ce.Ctx, ce.RoomID, msgEventID) + if resp.Err != nil || resp.State == signalmeow.StateProvisioningError { + if resp.Err != nil && strings.HasSuffix(resp.Err.Error(), " EOF") { + ce.Reply("Logging in timed out, please try again.") + } else { + ce.Reply("Error finishing registration: %v", resp.Err) + } + return + } + if resp.State == signalmeow.StateProvisioningDataReceived { + signalID = resp.ProvisioningData.ACI + signalPhone = resp.ProvisioningData.Number + } else { + ce.Reply("Unexpected state: %v", resp.State) + return + } + + // Finally, get the results of generating and registering prekeys + resp = <-provChan + if resp.Err != nil || resp.State == signalmeow.StateProvisioningError { + ce.Reply("Error with prekeys: %v", resp.Err) + return + } else if resp.State != signalmeow.StateProvisioningPreKeysRegistered { + ce.Reply("Unexpected state: %v", resp.State) + return + } + + if signalID == uuid.Nil { + ce.Reply("Problem logging in - No SignalID received") + return + } + ce.User.saveSignalID(ce.Ctx, signalID, signalPhone) + + // Connect to Signal + ce.User.Connect() + ce.Reply("Successfully logged in as %s (UUID: %s)", ce.User.SignalUsername, ce.User.SignalID) +} + +func (user *User) sendQR(ce *WrappedCommandEvent, code string, prevQR, prevMsg id.EventID) (qr, msg id.EventID) { + content, ok := user.uploadQR(ce, code) + if !ok { + return prevQR, prevMsg + } + if len(prevQR) != 0 { + content.SetEdit(prevQR) + } + resp, err := ce.Bot.SendMessageEvent(ce.Ctx, ce.RoomID, event.EventMessage, &content) + if err != nil { + ce.Log.Errorln("Failed to send QR code to user:", err) + } else if len(prevQR) == 0 { + prevQR = resp.EventID + } + content = event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: fmt.Sprintf("Raw linking URI: %s", code), + Format: event.FormatHTML, + FormattedBody: fmt.Sprintf("Raw linking URI: %s", code), + } + if len(prevMsg) != 0 { + content.SetEdit(prevMsg) + } + resp, err = ce.Bot.SendMessageEvent(ce.Ctx, ce.RoomID, event.EventMessage, &content) + if err != nil { + ce.Log.Errorln("Failed to send raw code to user:", err) + } else if len(prevMsg) == 0 { + prevMsg = resp.EventID + } + return prevQR, prevMsg +} + +func (user *User) uploadQR(ce *WrappedCommandEvent, code string) (event.MessageEventContent, bool) { + const size = 512 + qrCode, err := qrcode.Encode(code, qrcode.Low, size) + if err != nil { + ce.Log.Errorln("Failed to encode QR code:", err) + ce.Reply("Failed to encode QR code: %v", err) + return event.MessageEventContent{}, false + } + + bot := user.bridge.AS.BotClient() + + resp, err := bot.UploadBytes(ce.Ctx, qrCode, "image/png") + if err != nil { + ce.Log.Errorln("Failed to upload QR code:", err) + ce.Reply("Failed to upload QR code: %v", err) + return event.MessageEventContent{}, false + } + return event.MessageEventContent{ + MsgType: event.MsgImage, + Info: &event.FileInfo{ + MimeType: "image/png", + Width: size, + Height: size, + Size: len(qrCode), + }, + Body: "qr.png", + URL: resp.ContentURI.CUString(), + }, true +} + +func canDeletePortal(ctx context.Context, portal *Portal, userID id.UserID) bool { + if len(portal.MXID) == 0 { + return false + } + + members, err := portal.MainIntent().JoinedMembers(ctx, portal.MXID) + if err != nil { + portal.log.Err(err). + Str("user_id", userID.String()). + Msg("Failed to get joined members to check if user can delete portal") + return false + } + for otherUser := range members.Joined { + _, isPuppet := portal.bridge.ParsePuppetMXID(otherUser) + if isPuppet || otherUser == portal.bridge.Bot.UserID || otherUser == userID { + continue + } + user := portal.bridge.GetUserByMXID(otherUser) + if user != nil && user.IsLoggedIn() { + return false + } + } + return true +} + +var cmdDeletePortal = &commands.FullHandler{ + Func: wrapCommand(fnDeletePortal), + Name: "delete-portal", + Help: commands.HelpMeta{ + Section: HelpSectionPortalManagement, + Description: "Delete the current portal. If the portal is used by other people, this is limited to bridge admins.", + }, + RequiresPortal: true, +} + +func fnDeletePortal(ce *WrappedCommandEvent) { + if !ce.User.Admin && !canDeletePortal(ce.Ctx, ce.Portal, ce.User.MXID) { + ce.Reply("Only bridge admins can delete portals with other Matrix users") + return + } + + ce.Portal.log.Info().Stringer("user_id", ce.User.MXID).Msg("User requested deletion of portal") + ce.Portal.Delete() + ce.Portal.Cleanup(ce.Ctx, false) +} + +var cmdDeleteAllPortals = &commands.FullHandler{ + Func: wrapCommand(fnDeleteAllPortals), + Name: "delete-all-portals", + Help: commands.HelpMeta{ + Section: HelpSectionPortalManagement, + Description: "Delete all portals.", + }, +} + +func fnDeleteAllPortals(ce *WrappedCommandEvent) { + portals := ce.Bridge.GetAllPortalsWithMXID() + var portalsToDelete []*Portal + + if ce.User.Admin { + portalsToDelete = portals + } else { + portalsToDelete = portals[:0] + for _, portal := range portals { + if canDeletePortal(ce.Ctx, portal, ce.User.MXID) { + portalsToDelete = append(portalsToDelete, portal) + } + } + } + if len(portalsToDelete) == 0 { + ce.Reply("Didn't find any portals to delete") + return + } + + leave := func(portal *Portal) { + if len(portal.MXID) > 0 { + _, _ = portal.MainIntent().KickUser(ce.Ctx, portal.MXID, &mautrix.ReqKickUser{ + Reason: "Deleting portal", + UserID: ce.User.MXID, + }) + } + } + customPuppet := ce.Bridge.GetPuppetByCustomMXID(ce.User.MXID) + if customPuppet != nil && customPuppet.CustomIntent() != nil { + intent := customPuppet.CustomIntent() + leave = func(portal *Portal) { + if len(portal.MXID) > 0 { + _, _ = intent.LeaveRoom(ce.Ctx, portal.MXID) + _, _ = intent.ForgetRoom(ce.Ctx, portal.MXID) + } + } + } + ce.Reply("Found %d portals, deleting...", len(portalsToDelete)) + for _, portal := range portalsToDelete { + portal.Delete() + leave(portal) + } + ce.Reply("Finished deleting portal info. Now cleaning up rooms in background.") + + backgroundCtx := context.TODO() + go func() { + for _, portal := range portalsToDelete { + portal.Cleanup(backgroundCtx, false) + } + ce.Reply("Finished background cleanup of deleted portal rooms.") + }() +} + +var cmdCleanupLostPortals = &commands.FullHandler{ + Func: wrapCommand(fnCleanupLostPortals), + Name: "cleanup-lost-portals", + Help: commands.HelpMeta{ + Section: HelpSectionPortalManagement, + Description: "Clean up portals that were discarded due to the receiver not being logged into the bridge", + }, + RequiresAdmin: true, +} + +func fnCleanupLostPortals(ce *WrappedCommandEvent) { + portals, err := ce.Bridge.DB.LostPortal.GetAll(ce.Ctx) + if err != nil { + ce.Reply("Failed to get portals: %v", err) + return + } else if len(portals) == 0 { + ce.Reply("No lost portals found") + return + } + + ce.Reply("Found %d lost portals, deleting...", len(portals)) + for _, portal := range portals { + dmUUID, err := uuid.Parse(portal.ChatID) + intent := ce.Bot + if err == nil { + intent = ce.Bridge.GetPuppetBySignalID(dmUUID).DefaultIntent() + } + ce.Bridge.CleanupRoom(ce.Ctx, ce.ZLog, intent, portal.MXID, false) + err = portal.Delete(ce.Ctx) + if err != nil { + ce.ZLog.Err(err).Msg("Failed to delete lost portal from database after cleanup") + } + } + ce.Reply("Finished cleaning up portals") +} diff --git a/config/bridge.go b/config/bridge.go new file mode 100644 index 0000000..521c56d --- /dev/null +++ b/config/bridge.go @@ -0,0 +1,233 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2022 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 config + +import ( + "errors" + "fmt" + "strings" + "text/template" + "time" + + "maunium.net/go/mautrix/bridge/bridgeconfig" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/pkg/signalmeow/types" +) + +type BridgeConfig struct { + UsernameTemplate string `yaml:"username_template"` + DisplaynameTemplate string `yaml:"displayname_template"` + PrivateChatPortalMeta string `yaml:"private_chat_portal_meta"` + UseContactAvatars bool `yaml:"use_contact_avatars"` + NumberInTopic bool `yaml:"number_in_topic"` + + NoteToSelfAvatar id.ContentURIString `yaml:"note_to_self_avatar"` + + PortalMessageBuffer int `yaml:"portal_message_buffer"` + + PersonalFilteringSpaces bool `yaml:"personal_filtering_spaces"` + BridgeNotices bool `yaml:"bridge_notices"` + DeliveryReceipts bool `yaml:"delivery_receipts"` + MessageStatusEvents bool `yaml:"message_status_events"` + MessageErrorNotices bool `yaml:"message_error_notices"` + SyncDirectChatList bool `yaml:"sync_direct_chat_list"` + ResendBridgeInfo bool `yaml:"resend_bridge_info"` + CaptionInMessage bool `yaml:"caption_in_message"` + FederateRooms bool `yaml:"federate_rooms"` + + DoublePuppetConfig bridgeconfig.DoublePuppetConfig `yaml:",inline"` + + MessageHandlingTimeout struct { + ErrorAfterStr string `yaml:"error_after"` + DeadlineStr string `yaml:"deadline"` + + ErrorAfter time.Duration `yaml:"-"` + Deadline time.Duration `yaml:"-"` + } `yaml:"message_handling_timeout"` + + CommandPrefix string `yaml:"command_prefix"` + ManagementRoomText bridgeconfig.ManagementRoomTexts `yaml:"management_room_text"` + + Encryption bridgeconfig.EncryptionConfig `yaml:"encryption"` + + Provisioning struct { + Prefix string `yaml:"prefix"` + SharedSecret string `yaml:"shared_secret"` + DebugEndpoints bool `yaml:"debug_endpoints"` + } `yaml:"provisioning"` + + Permissions bridgeconfig.PermissionConfig `yaml:"permissions"` + + Relay RelaybotConfig `yaml:"relay"` + + usernameTemplate *template.Template `yaml:"-"` + displaynameTemplate *template.Template `yaml:"-"` +} + +func (bc *BridgeConfig) GetResendBridgeInfo() bool { + return bc.ResendBridgeInfo +} + +func (bc *BridgeConfig) EnableMessageStatusEvents() bool { + return bc.MessageStatusEvents +} + +func (bc *BridgeConfig) EnableMessageErrorNotices() bool { + return bc.MessageErrorNotices +} + +func boolToInt(val bool) int { + if val { + return 1 + } + return 0 +} + +func (bc *BridgeConfig) Validate() error { + _, hasWildcard := bc.Permissions["*"] + _, hasExampleDomain := bc.Permissions["example.com"] + _, hasExampleUser := bc.Permissions["@admin:example.com"] + exampleLen := boolToInt(hasWildcard) + boolToInt(hasExampleUser) + boolToInt(hasExampleDomain) + if len(bc.Permissions) <= exampleLen { + return errors.New("bridge.permissions not configured") + } + return nil +} + +type umBridgeConfig BridgeConfig + +func (bc *BridgeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { + err := unmarshal((*umBridgeConfig)(bc)) + if err != nil { + return err + } + + bc.usernameTemplate, err = template.New("username").Parse(bc.UsernameTemplate) + if err != nil { + return err + } else if !strings.Contains(bc.FormatUsername("1234567890"), "1234567890") { + return fmt.Errorf("username template is missing user ID placeholder") + } + bc.displaynameTemplate, err = template.New("displayname").Parse(bc.DisplaynameTemplate) + if err != nil { + return err + } + + return nil +} + +var _ bridgeconfig.BridgeConfig = (*BridgeConfig)(nil) + +func (bc BridgeConfig) GetDoublePuppetConfig() bridgeconfig.DoublePuppetConfig { + return bc.DoublePuppetConfig +} + +func (bc BridgeConfig) GetEncryptionConfig() bridgeconfig.EncryptionConfig { + return bc.Encryption +} + +func (bc BridgeConfig) GetCommandPrefix() string { + return bc.CommandPrefix +} + +func (bc BridgeConfig) GetManagementRoomTexts() bridgeconfig.ManagementRoomTexts { + return bc.ManagementRoomText +} + +func (bc BridgeConfig) FormatUsername(userID string) string { + var buffer strings.Builder + _ = bc.usernameTemplate.Execute(&buffer, userID) + return buffer.String() +} + +type DisplaynameParams struct { + ProfileName string + ContactName string + Username string + PhoneNumber string + UUID string + AboutEmoji string +} + +func (bc BridgeConfig) FormatDisplayname(contact *types.Contact) string { + var buffer strings.Builder + _ = bc.displaynameTemplate.Execute(&buffer, DisplaynameParams{ + ProfileName: contact.ProfileName, + ContactName: contact.ContactName, + //Username: contact.Username, + PhoneNumber: contact.E164, + UUID: contact.UUID.String(), + AboutEmoji: contact.ProfileAboutEmoji, + }) + return buffer.String() +} + +type RelaybotConfig struct { + Enabled bool `yaml:"enabled"` + AdminOnly bool `yaml:"admin_only"` + MessageFormats map[event.MessageType]string `yaml:"message_formats"` + messageTemplates *template.Template `yaml:"-"` +} + +type umRelaybotConfig RelaybotConfig + +func (rc *RelaybotConfig) UnmarshalYAML(unmarshal func(interface{}) error) error { + err := unmarshal((*umRelaybotConfig)(rc)) + if err != nil { + return err + } + + rc.messageTemplates = template.New("messageTemplates") + for key, format := range rc.MessageFormats { + _, err := rc.messageTemplates.New(string(key)).Parse(format) + if err != nil { + return err + } + } + + return nil +} + +type Sender struct { + UserID string + event.MemberEventContent +} + +type formatData struct { + Sender Sender + Message string + Content *event.MessageEventContent +} + +func (rc *RelaybotConfig) FormatMessage(content *event.MessageEventContent, sender id.UserID, member event.MemberEventContent) (string, error) { + if len(member.Displayname) == 0 { + member.Displayname = sender.String() + } + member.Displayname = template.HTMLEscapeString(member.Displayname) + var output strings.Builder + err := rc.messageTemplates.ExecuteTemplate(&output, string(content.MsgType), formatData{ + Sender: Sender{ + UserID: template.HTMLEscapeString(sender.String()), + MemberEventContent: member, + }, + Content: content, + Message: content.FormattedBody, + }) + return output.String(), err +} diff --git a/pkg/signalmeow/store/upgrades/20-fix-backup-chat-columns.go b/config/config.go similarity index 50% rename from pkg/signalmeow/store/upgrades/20-fix-backup-chat-columns.go rename to config/config.go index 1313f11..de62c82 100644 --- a/pkg/signalmeow/store/upgrades/20-fix-backup-chat-columns.go +++ b/config/config.go @@ -1,5 +1,5 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2025 Tulir Asokan +// mautrix-signal - A Matrix-Signal puppeting bridge. +// Copyright (C) 2022 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 @@ -14,21 +14,31 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -package upgrades +package config import ( - "context" - - "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/bridge/bridgeconfig" + "maunium.net/go/mautrix/id" ) -var upgradeV20 = dbutil.WrapUpgrade(-1, 20, 13, "Add missing columns for backup chat table", dbutil.TxnModeOn, func(ctx context.Context, db *dbutil.Database) (err error) { - var exists bool - if exists, err = db.ColumnExists(ctx, "signalmeow_backup_chat", "latest_message_id"); err == nil && !exists { - _, err = db.Exec(ctx, ` - ALTER TABLE signalmeow_backup_chat ADD COLUMN latest_message_id BIGINT; - ALTER TABLE signalmeow_backup_chat ADD COLUMN total_message_count INTEGER; - `) - } - return -}) +type Config struct { + *bridgeconfig.BaseConfig `yaml:",inline"` + + Metrics struct { + Enabled bool `yaml:"enabled"` + Listen string `yaml:"listen"` + } `yaml:"metrics"` + + Signal struct { + DeviceName string `yaml:"device_name"` + } `yaml:"signal"` + + Bridge BridgeConfig `yaml:"bridge"` +} + +func (config *Config) CanAutoDoublePuppet(userID id.UserID) bool { + _, homeserver, _ := userID.Parse() + _, hasSecret := config.Bridge.DoublePuppetConfig.SharedSecretMap[homeserver] + + return hasSecret +} diff --git a/config/upgrade.go b/config/upgrade.go new file mode 100644 index 0000000..ba0daf9 --- /dev/null +++ b/config/upgrade.go @@ -0,0 +1,163 @@ +// mautrix-signal - A Matrix-Signal puppeting bridge. +// Copyright (C) 2022 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 config + +import ( + "net/url" + "strings" + + up "go.mau.fi/util/configupgrade" + "go.mau.fi/util/random" + "maunium.net/go/mautrix/bridge/bridgeconfig" +) + +func DoUpgrade(helper *up.Helper) { + bridgeconfig.Upgrader.DoUpgrade(helper) + + legacyDB, ok := helper.Get(up.Str, "appservice", "database") + if ok { + if strings.HasPrefix(legacyDB, "postgres") { + parsedDB, err := url.Parse(legacyDB) + if err != nil { + panic(err) + } + q := parsedDB.Query() + if parsedDB.Host == "" && !q.Has("host") { + q.Set("host", "/var/run/postgresql") + } else if !q.Has("sslmode") { + q.Set("sslmode", "disable") + } + parsedDB.RawQuery = q.Encode() + helper.Set(up.Str, parsedDB.String(), "appservice", "database", "uri") + helper.Set(up.Str, "postgres", "appservice", "database", "type") + } else { + dbPath := strings.TrimPrefix(strings.TrimPrefix(legacyDB, "sqlite:"), "///") + helper.Set(up.Str, dbPath, "appservice", "database", "uri") + helper.Set(up.Str, "sqlite3-fk-wal", "appservice", "database", "type") + } + } + if legacyDBMinSize, ok := helper.Get(up.Int, "appservice", "database_opts", "min_size"); ok { + helper.Set(up.Int, legacyDBMinSize, "appservice", "database", "max_idle_conns") + } + if legacyDBMaxSize, ok := helper.Get(up.Int, "appservice", "database_opts", "max_size"); ok { + helper.Set(up.Int, legacyDBMaxSize, "appservice", "database", "max_open_conns") + } + if legacyBotUsername, ok := helper.Get(up.Str, "appservice", "bot_username"); ok { + helper.Set(up.Str, legacyBotUsername, "appservice", "bot", "username") + } + if legacyBotDisplayname, ok := helper.Get(up.Str, "appservice", "bot_displayname"); ok { + helper.Set(up.Str, legacyBotDisplayname, "appservice", "bot", "displayname") + } + if legacyBotAvatar, ok := helper.Get(up.Str, "appservice", "bot_avatar"); ok { + helper.Set(up.Str, legacyBotAvatar, "appservice", "bot", "avatar") + } + + helper.Copy(up.Bool, "metrics", "enabled") + helper.Copy(up.Str, "metrics", "listen") + + helper.Copy(up.Str, "signal", "device_name") + + if usernameTemplate, ok := helper.Get(up.Str, "bridge", "username_template"); ok && strings.Contains(usernameTemplate, "{userid}") { + helper.Set(up.Str, strings.ReplaceAll(usernameTemplate, "{userid}", "{{.}}"), "bridge", "username_template") + } else { + helper.Copy(up.Str, "bridge", "username_template") + } + if displaynameTemplate, ok := helper.Get(up.Str, "bridge", "displayname_template"); ok && strings.Contains(displaynameTemplate, "{displayname}") { + helper.Set(up.Str, strings.ReplaceAll(displaynameTemplate, "{displayname}", `{{or .ProfileName .PhoneNumber "Unknown user"}}`), "bridge", "displayname_template") + } else { + helper.Copy(up.Str, "bridge", "displayname_template") + } + helper.Copy(up.Str, "bridge", "private_chat_portal_meta") + helper.Copy(up.Bool, "bridge", "use_contact_avatars") + helper.Copy(up.Bool, "bridge", "number_in_topic") + helper.Copy(up.Str, "bridge", "note_to_self_avatar") + helper.Copy(up.Int, "bridge", "portal_message_buffer") + helper.Copy(up.Bool, "bridge", "personal_filtering_spaces") + helper.Copy(up.Bool, "bridge", "bridge_notices") + helper.Copy(up.Bool, "bridge", "delivery_receipts") + helper.Copy(up.Bool, "bridge", "message_status_events") + helper.Copy(up.Bool, "bridge", "message_error_notices") + helper.Copy(up.Bool, "bridge", "sync_direct_chat_list") + helper.Copy(up.Bool, "bridge", "resend_bridge_info") + helper.Copy(up.Bool, "bridge", "caption_in_message") + helper.Copy(up.Bool, "bridge", "federate_rooms") + helper.Copy(up.Map, "bridge", "double_puppet_server_map") + helper.Copy(up.Bool, "bridge", "double_puppet_allow_discovery") + helper.Copy(up.Map, "bridge", "login_shared_secret_map") + helper.Copy(up.Str, "bridge", "command_prefix") + helper.Copy(up.Str, "bridge", "management_room_text", "welcome") + helper.Copy(up.Str, "bridge", "management_room_text", "welcome_connected") + helper.Copy(up.Str, "bridge", "management_room_text", "welcome_unconnected") + helper.Copy(up.Str|up.Null, "bridge", "management_room_text", "additional_help") + helper.Copy(up.Bool, "bridge", "encryption", "allow") + helper.Copy(up.Bool, "bridge", "encryption", "default") + helper.Copy(up.Bool, "bridge", "encryption", "require") + helper.Copy(up.Bool, "bridge", "encryption", "appservice") + helper.Copy(up.Bool, "bridge", "encryption", "allow_key_sharing") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "delete_outbound_on_ack") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "dont_store_outbound") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "ratchet_on_decrypt") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "delete_fully_used_on_decrypt") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "delete_prev_on_new_session") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "delete_on_device_delete") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "periodically_delete_expired") + helper.Copy(up.Bool, "bridge", "encryption", "delete_keys", "delete_outdated_inbound") + helper.Copy(up.Str, "bridge", "encryption", "verification_levels", "receive") + helper.Copy(up.Str, "bridge", "encryption", "verification_levels", "send") + helper.Copy(up.Str, "bridge", "encryption", "verification_levels", "share") + helper.Copy(up.Bool, "bridge", "encryption", "rotation", "enable_custom") + helper.Copy(up.Int, "bridge", "encryption", "rotation", "milliseconds") + helper.Copy(up.Int, "bridge", "encryption", "rotation", "messages") + helper.Copy(up.Bool, "bridge", "encryption", "rotation", "disable_device_change_key_rotation") + + helper.Copy(up.Str, "bridge", "provisioning", "prefix") + if secret, ok := helper.Get(up.Str, "bridge", "provisioning", "shared_secret"); !ok || secret == "generate" { + sharedSecret := random.String(64) + helper.Set(up.Str, sharedSecret, "bridge", "provisioning", "shared_secret") + } else { + helper.Copy(up.Str, "bridge", "provisioning", "shared_secret") + } + helper.Copy(up.Bool, "bridge", "provisioning", "debug_endpoints") + + helper.Copy(up.Map, "bridge", "permissions") + helper.Copy(up.Bool, "bridge", "relay", "enabled") + helper.Copy(up.Bool, "bridge", "relay", "admin_only") + if textRelayFormat, ok := helper.Get(up.Str, "bridge", "relay", "message_formats", "m.text"); ok && strings.Contains(textRelayFormat, "$message") && !strings.Contains(textRelayFormat, ".Message") { + // don't copy legacy message formats + } else { + helper.Copy(up.Map, "bridge", "relay", "message_formats") + } +} + +var SpacedBlocks = [][]string{ + {"homeserver", "software"}, + {"appservice"}, + {"appservice", "hostname"}, + {"appservice", "database"}, + {"appservice", "id"}, + {"appservice", "as_token"}, + {"metrics"}, + {"signal"}, + {"bridge"}, + {"bridge", "personal_filtering_spaces"}, + {"bridge", "command_prefix"}, + {"bridge", "management_room_text"}, + {"bridge", "encryption"}, + {"bridge", "provisioning"}, + {"bridge", "permissions"}, + {"logging"}, +} diff --git a/custompuppet.go b/custompuppet.go new file mode 100644 index 0000000..cde3059 --- /dev/null +++ b/custompuppet.go @@ -0,0 +1,97 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 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 main + +import ( + "context" + "fmt" + + "maunium.net/go/mautrix/id" +) + +func (puppet *Puppet) SwitchCustomMXID(accessToken string, mxid id.UserID) error { + puppet.CustomMXID = mxid + puppet.AccessToken = accessToken + err := puppet.Update(context.TODO()) + if err != nil { + return fmt.Errorf("failed to save access token: %w", err) + } + err = puppet.StartCustomMXID(false) + if err != nil { + return err + } + // TODO leave rooms with default puppet + return nil +} + +func (puppet *Puppet) ClearCustomMXID() { + save := puppet.CustomMXID != "" || puppet.AccessToken != "" + puppet.bridge.puppetsLock.Lock() + if puppet.CustomMXID != "" && puppet.bridge.puppetsByCustomMXID[puppet.CustomMXID] == puppet { + delete(puppet.bridge.puppetsByCustomMXID, puppet.CustomMXID) + } + puppet.bridge.puppetsLock.Unlock() + puppet.CustomMXID = "" + puppet.AccessToken = "" + puppet.customIntent = nil + puppet.customUser = nil + if save { + err := puppet.Update(context.TODO()) + if err != nil { + puppet.log.Err(err).Msg("Failed to clear custom MXID") + } + } +} + +func (puppet *Puppet) StartCustomMXID(reloginOnFail bool) error { + newIntent, newAccessToken, err := puppet.bridge.DoublePuppet.Setup(context.TODO(), puppet.CustomMXID, puppet.AccessToken, reloginOnFail) + if err != nil { + puppet.ClearCustomMXID() + return err + } + puppet.bridge.puppetsLock.Lock() + puppet.bridge.puppetsByCustomMXID[puppet.CustomMXID] = puppet + puppet.bridge.puppetsLock.Unlock() + if puppet.AccessToken != newAccessToken { + puppet.AccessToken = newAccessToken + err = puppet.Update(context.TODO()) + } + puppet.customIntent = newIntent + puppet.customUser = puppet.bridge.GetUserByMXID(puppet.CustomMXID) + return err +} + +func (user *User) tryAutomaticDoublePuppeting() { + if !user.bridge.Config.CanAutoDoublePuppet(user.MXID) { + return + } + user.log.Debug().Msg("Checking if double puppeting needs to be enabled") + puppet := user.bridge.GetPuppetBySignalID(user.SignalID) + if puppet.CustomMXID == user.MXID { + user.log.Debug().Msg("User already has double-puppeting enabled") + // Custom puppet already enabled + return + } + puppet.CustomMXID = user.MXID + err := puppet.StartCustomMXID(true) + if err != nil { + user.log.Warn().Err(err).Msg("Failed to login with shared secret") + } else { + // TODO leave rooms with default puppet + user.log.Debug().Msg("Successfully automatically enabled custom puppet") + } +} diff --git a/database/database.go b/database/database.go new file mode 100644 index 0000000..daa365f --- /dev/null +++ b/database/database.go @@ -0,0 +1,53 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + _ "embed" + + _ "github.com/lib/pq" + _ "github.com/mattn/go-sqlite3" + "go.mau.fi/util/dbutil" + + "go.mau.fi/mautrix-signal/database/upgrades" +) + +type Database struct { + *dbutil.Database + + User *UserQuery + Portal *PortalQuery + LostPortal *LostPortalQuery + Puppet *PuppetQuery + Message *MessageQuery + Reaction *ReactionQuery + DisappearingMessage *DisappearingMessageQuery +} + +func New(db *dbutil.Database) *Database { + db.UpgradeTable = upgrades.Table + return &Database{ + Database: db, + User: &UserQuery{dbutil.MakeQueryHelper(db, newUser)}, + Portal: &PortalQuery{dbutil.MakeQueryHelper(db, newPortal)}, + LostPortal: &LostPortalQuery{dbutil.MakeQueryHelper(db, newLostPortal)}, + Puppet: &PuppetQuery{dbutil.MakeQueryHelper(db, newPuppet)}, + Message: &MessageQuery{dbutil.MakeQueryHelper(db, newMessage)}, + Reaction: &ReactionQuery{dbutil.MakeQueryHelper(db, newReaction)}, + DisappearingMessage: &DisappearingMessageQuery{dbutil.MakeQueryHelper(db, newDisappearingMessage)}, + } +} diff --git a/database/disappearingmessage.go b/database/disappearingmessage.go new file mode 100644 index 0000000..b32a8ee --- /dev/null +++ b/database/disappearingmessage.go @@ -0,0 +1,125 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + "context" + "database/sql" + "time" + + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/id" +) + +const ( + getUnscheduledDisappearingMessagesForRoomQuery = ` + SELECT room_id, mxid, expiration_seconds, expiration_ts + FROM disappearing_message WHERE expiration_ts IS NULL AND room_id = $1 + ` + getExpiredDisappearingMessagesQuery = ` + SELECT room_id, mxid, expiration_seconds, expiration_ts + FROM disappearing_message WHERE expiration_ts IS NOT NULL AND expiration_ts <= $1 + ` + getNextDisappearingMessageQuery = ` + SELECT room_id, mxid, expiration_seconds, expiration_ts + FROM disappearing_message WHERE expiration_ts IS NOT NULL ORDER BY expiration_ts ASC LIMIT 1 + ` + insertDisappearingMessageQuery = ` + INSERT INTO disappearing_message (room_id, mxid, expiration_seconds, expiration_ts) VALUES ($1, $2, $3, $4) + ` + updateDisappearingMessageQuery = ` + UPDATE disappearing_message SET expiration_ts=$2 WHERE mxid=$1 + ` + deleteDisappearingMessageQuery = ` + DELETE FROM disappearing_message WHERE mxid=$1 + ` +) + +type DisappearingMessageQuery struct { + *dbutil.QueryHelper[*DisappearingMessage] +} + +type DisappearingMessage struct { + qh *dbutil.QueryHelper[*DisappearingMessage] + + RoomID id.RoomID + EventID id.EventID + ExpireIn time.Duration + ExpireAt time.Time +} + +func newDisappearingMessage(qh *dbutil.QueryHelper[*DisappearingMessage]) *DisappearingMessage { + return &DisappearingMessage{qh: qh} +} + +func (dmq *DisappearingMessageQuery) NewWithValues(roomID id.RoomID, eventID id.EventID, expireIn time.Duration, expireAt time.Time) *DisappearingMessage { + return &DisappearingMessage{ + qh: dmq.QueryHelper, + RoomID: roomID, + EventID: eventID, + ExpireIn: expireIn, + ExpireAt: expireAt, + } +} + +func (dmq *DisappearingMessageQuery) GetUnscheduledForRoom(ctx context.Context, roomID id.RoomID) ([]*DisappearingMessage, error) { + return dmq.QueryMany(ctx, getUnscheduledDisappearingMessagesForRoomQuery, roomID) +} + +func (dmq *DisappearingMessageQuery) GetExpiredMessages(ctx context.Context) ([]*DisappearingMessage, error) { + return dmq.QueryMany(ctx, getExpiredDisappearingMessagesQuery, time.Now().Unix()+1) +} + +func (dmq *DisappearingMessageQuery) GetNextScheduledMessage(ctx context.Context) (*DisappearingMessage, error) { + return dmq.QueryOne(ctx, getNextDisappearingMessageQuery) +} + +func (msg *DisappearingMessage) Scan(row dbutil.Scannable) (*DisappearingMessage, error) { + var expireIn int64 + var expireAt sql.NullInt64 + err := row.Scan(&msg.RoomID, &msg.EventID, &expireIn, &expireAt) + if err != nil { + return nil, err + } + msg.ExpireIn = time.Duration(expireIn) * time.Second + if expireAt.Valid { + msg.ExpireAt = time.Unix(expireAt.Int64, 0) + } + return msg, nil +} + +func (msg *DisappearingMessage) sqlVariables() []any { + var expireAt sql.NullInt64 + if !msg.ExpireAt.IsZero() { + expireAt.Valid = true + expireAt.Int64 = msg.ExpireAt.Unix() + } + return []any{msg.RoomID, msg.EventID, int64(msg.ExpireIn.Seconds()), expireAt} +} + +func (msg *DisappearingMessage) Insert(ctx context.Context) error { + return msg.qh.Exec(ctx, insertDisappearingMessageQuery, msg.sqlVariables()...) +} + +func (msg *DisappearingMessage) StartExpirationTimer(ctx context.Context) error { + msg.ExpireAt = time.Now().Add(msg.ExpireIn) + return msg.qh.Exec(ctx, updateDisappearingMessageQuery, msg.EventID, msg.ExpireAt.Unix()) +} + +func (msg *DisappearingMessage) Delete(ctx context.Context) error { + return msg.qh.Exec(ctx, deleteDisappearingMessageQuery, msg.EventID) +} diff --git a/database/lostportal.go b/database/lostportal.go new file mode 100644 index 0000000..29779b8 --- /dev/null +++ b/database/lostportal.go @@ -0,0 +1,58 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 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 database + +import ( + "context" + + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/id" +) + +const ( + getLostPortalsQuery = `SELECT chat_id, receiver, mxid FROM lost_portals` + deleteLostPortalQuery = `DELETE FROM lost_portals WHERE mxid=$1` +) + +type LostPortalQuery struct { + *dbutil.QueryHelper[*LostPortal] +} + +func (lpq *LostPortalQuery) GetAll(ctx context.Context) ([]*LostPortal, error) { + return lpq.QueryMany(ctx, getLostPortalsQuery) +} + +type LostPortal struct { + qh *dbutil.QueryHelper[*LostPortal] + + ChatID string + Receiver string + MXID id.RoomID +} + +func newLostPortal(qh *dbutil.QueryHelper[*LostPortal]) *LostPortal { + return &LostPortal{qh: qh} +} + +func (l *LostPortal) Scan(row dbutil.Scannable) (*LostPortal, error) { + err := row.Scan(&l.ChatID, &l.Receiver, &l.MXID) + return l, err +} + +func (l *LostPortal) Delete(ctx context.Context) error { + return l.qh.Exec(ctx, deleteLostPortalQuery, l.MXID) +} diff --git a/database/message.go b/database/message.go new file mode 100644 index 0000000..5184bd8 --- /dev/null +++ b/database/message.go @@ -0,0 +1,179 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + "context" + "fmt" + "strings" + + "github.com/google/uuid" + "github.com/lib/pq" + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/id" +) + +const ( + getMessageByMXIDQuery = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE mxid=$1 + ` + getMessagePartBySignalIDQuery = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE sender=$1 AND timestamp=$2 AND part_index=$3 AND signal_receiver=$4 + ` + getLastMessagePartBySignalIDQuery = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE sender=$1 AND timestamp=$2 AND signal_receiver=$3 + ORDER BY part_index DESC LIMIT 1 + ` + getAllMessagePartsBySignalIDQuery = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE sender=$1 AND timestamp=$2 AND signal_receiver=$3 + ` + getMessageLastPartBySignalIDWithUnknownReceiverQuery = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE sender=$1 AND timestamp=$2 AND (signal_receiver=$3 OR signal_receiver='00000000-0000-0000-0000-000000000000') + ORDER BY part_index DESC LIMIT 1 + ` + getManyMessagesBySignalIDQueryPostgres = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE sender=$1 AND (signal_receiver=$2 OR signal_receiver=$3) AND timestamp=ANY($4) + ORDER BY timestamp DESC, part_index DESC + ` + getManyMessagesBySignalIDQuerySQLite = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE sender=?1 AND (signal_receiver=?2 OR signal_receiver=?3) AND timestamp IN (?4) + ORDER BY timestamp DESC, part_index DESC + ` + getFirstBeforeQuery = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE mx_room=$1 AND timestamp <= $2 + ORDER BY timestamp DESC + LIMIT 1 + ` + getMessagesBetweenTimeQuery = ` + SELECT sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room FROM message + WHERE signal_chat_id=$1 AND signal_receiver=$2 AND timestamp>$3 AND timestamp<=$4 AND part_index=0 + ORDER BY timestamp ASC + ` + insertMessageQuery = ` + INSERT INTO message (sender, timestamp, part_index, signal_chat_id, signal_receiver, mxid, mx_room) + VALUES ($1, $2, $3, $4, $5, $6, $7) + ` + deleteMessageQuery = ` + DELETE FROM message + WHERE sender=$1 AND timestamp=$2 AND part_index=$3 AND signal_receiver=$4 + ` + updateMessageTimestampQuery = ` + UPDATE message SET timestamp=$4 WHERE sender=$1 AND timestamp=$2 AND signal_receiver=$3 + ` +) + +type MessageQuery struct { + *dbutil.QueryHelper[*Message] +} + +type Message struct { + qh *dbutil.QueryHelper[*Message] + + Sender uuid.UUID + Timestamp uint64 + PartIndex int + + SignalChatID string + SignalReceiver uuid.UUID + + MXID id.EventID + RoomID id.RoomID +} + +func newMessage(qh *dbutil.QueryHelper[*Message]) *Message { + return &Message{qh: qh} +} + +func (mq *MessageQuery) GetByMXID(ctx context.Context, mxid id.EventID) (*Message, error) { + return mq.QueryOne(ctx, getMessageByMXIDQuery, mxid) +} + +func (mq *MessageQuery) GetBySignalID(ctx context.Context, sender uuid.UUID, timestamp uint64, partIndex int, receiver uuid.UUID) (*Message, error) { + return mq.QueryOne(ctx, getMessagePartBySignalIDQuery, sender, timestamp, partIndex, receiver) +} + +func (mq *MessageQuery) GetLastPartBySignalID(ctx context.Context, sender uuid.UUID, timestamp uint64, receiver uuid.UUID) (*Message, error) { + return mq.QueryOne(ctx, getLastMessagePartBySignalIDQuery, sender, timestamp, receiver) +} + +func (mq *MessageQuery) GetAllPartsBySignalID(ctx context.Context, sender uuid.UUID, timestamp uint64, receiver uuid.UUID) ([]*Message, error) { + return mq.QueryMany(ctx, getAllMessagePartsBySignalIDQuery, sender, timestamp, receiver) +} + +func (mq *MessageQuery) GetAllBetweenTimestamps(ctx context.Context, key PortalKey, min, max uint64) ([]*Message, error) { + return mq.QueryMany(ctx, getMessagesBetweenTimeQuery, key.ChatID, key.Receiver, int64(min), int64(max)) +} + +func (mq *MessageQuery) GetLastPartBySignalIDWithUnknownReceiver(ctx context.Context, sender uuid.UUID, timestamp uint64, receiver uuid.UUID) (*Message, error) { + return mq.QueryOne(ctx, getMessageLastPartBySignalIDWithUnknownReceiverQuery, sender, timestamp, receiver) +} + +func (mq *MessageQuery) GetManyBySignalID(ctx context.Context, sender uuid.UUID, timestamps []uint64, receiver uuid.UUID, strictReceiver bool) ([]*Message, error) { + receiver2 := uuid.Nil + if strictReceiver { + receiver2 = receiver + } + if mq.GetDB().Dialect == dbutil.Postgres { + int64Array := make([]int64, len(timestamps)) + for i, timestamp := range timestamps { + int64Array[i] = int64(timestamp) + } + return mq.QueryMany(ctx, getManyMessagesBySignalIDQueryPostgres, sender, receiver, receiver2, pq.Array(int64Array)) + } else { + const varargIndex = 3 + arguments := make([]any, len(timestamps)+varargIndex) + placeholders := make([]string, len(timestamps)) + arguments[0] = sender + arguments[1] = receiver + arguments[2] = receiver2 + for i, timestamp := range timestamps { + arguments[i+varargIndex] = timestamp + placeholders[i] = fmt.Sprintf("?%d", i+varargIndex+1) + } + return mq.QueryMany(ctx, strings.Replace(getManyMessagesBySignalIDQuerySQLite, fmt.Sprintf("?%d", varargIndex+1), strings.Join(placeholders, ", "), 1), arguments...) + } +} + +func (msg *Message) Scan(row dbutil.Scannable) (*Message, error) { + return dbutil.ValueOrErr(msg, row.Scan( + &msg.Sender, &msg.Timestamp, &msg.PartIndex, &msg.SignalChatID, &msg.SignalReceiver, &msg.MXID, &msg.RoomID, + )) +} + +func (msg *Message) sqlVariables() []any { + return []any{msg.Sender, msg.Timestamp, msg.PartIndex, msg.SignalChatID, msg.SignalReceiver, msg.MXID, msg.RoomID} +} + +func (msg *Message) Insert(ctx context.Context) error { + return msg.qh.Exec(ctx, insertMessageQuery, msg.sqlVariables()...) +} + +func (msg *Message) Delete(ctx context.Context) error { + return msg.qh.Exec(ctx, deleteMessageQuery, msg.Sender, msg.Timestamp, msg.PartIndex, msg.SignalReceiver) +} + +func (msg *Message) SetTimestamp(ctx context.Context, editTime uint64) error { + return msg.qh.Exec(ctx, updateMessageTimestampQuery, msg.Sender, msg.Timestamp, msg.SignalReceiver, editTime) +} diff --git a/database/portal.go b/database/portal.go new file mode 100644 index 0000000..31132c6 --- /dev/null +++ b/database/portal.go @@ -0,0 +1,200 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + "context" + "database/sql" + + "github.com/google/uuid" + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/pkg/signalmeow/types" +) + +const ( + portalBaseSelect = ` + SELECT chat_id, receiver, mxid, name, topic, avatar_path, avatar_hash, avatar_url, + name_set, avatar_set, topic_set, revision, encrypted, relay_user_id, expiration_time + FROM portal + ` + getPortalByMXIDQuery = portalBaseSelect + `WHERE mxid=$1` + getPortalByChatIDQuery = portalBaseSelect + `WHERE chat_id=$1 AND receiver=$2` + getPortalsByReceiver = portalBaseSelect + `WHERE receiver=$1` + getPortalsByUser = portalBaseSelect + `WHERE chat_id=$1` + getAllPortalsWithMXIDQuery = portalBaseSelect + `WHERE mxid IS NOT NULL` + getChatsNotInSpaceQuery = ` + SELECT chat_id FROM portal + LEFT JOIN user_portal ON portal.chat_id=user_portal.portal_chat_id AND portal.receiver=user_portal.portal_receiver + WHERE mxid<>'' AND receiver=$1 AND (user_portal.in_space=false OR user_portal.in_space IS NULL) + ` + insertPortalQuery = ` + INSERT INTO portal ( + chat_id, receiver, mxid, name, topic, avatar_path, avatar_hash, avatar_url, + name_set, avatar_set, topic_set, revision, encrypted, relay_user_id, expiration_time + ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) + ` + updatePortalQuery = ` + UPDATE portal SET + mxid=$3, name=$4, topic=$5, avatar_path=$6, avatar_hash=$7, avatar_url=$8, + name_set=$9, avatar_set=$10, topic_set=$11, revision=$12, encrypted=$13, relay_user_id=$14, expiration_time=$15 + WHERE chat_id=$1 AND receiver=$2 + ` + deletePortalQuery = `DELETE FROM portal WHERE chat_id=$1 AND receiver=$2` +) + +type PortalQuery struct { + *dbutil.QueryHelper[*Portal] +} + +type PortalKey struct { + ChatID string + Receiver uuid.UUID +} + +func (pk *PortalKey) UserID() uuid.UUID { + parsed, _ := uuid.Parse(pk.ChatID) + return parsed +} + +func (pk *PortalKey) GroupID() types.GroupIdentifier { + if len(pk.ChatID) == 44 { + return types.GroupIdentifier(pk.ChatID) + } + return "" +} + +func NewPortalKey(chatID string, receiver uuid.UUID) PortalKey { + return PortalKey{ + ChatID: chatID, + Receiver: receiver, + } +} + +type Portal struct { + qh *dbutil.QueryHelper[*Portal] + + PortalKey + MXID id.RoomID + Name string + Topic string + AvatarPath string + AvatarHash string + AvatarURL id.ContentURI + NameSet bool + AvatarSet bool + TopicSet bool + Revision uint32 + Encrypted bool + RelayUserID id.UserID + ExpirationTime uint32 +} + +func newPortal(qh *dbutil.QueryHelper[*Portal]) *Portal { + return &Portal{qh: qh} +} + +func (pq *PortalQuery) GetByMXID(ctx context.Context, mxid id.RoomID) (*Portal, error) { + return pq.QueryOne(ctx, getPortalByMXIDQuery, mxid) +} + +func (pq *PortalQuery) GetByChatID(ctx context.Context, pk PortalKey) (*Portal, error) { + return pq.QueryOne(ctx, getPortalByChatIDQuery, pk.ChatID, pk.Receiver) +} + +func (pq *PortalQuery) FindPrivateChatsWith(ctx context.Context, userID uuid.UUID) ([]*Portal, error) { + return pq.QueryMany(ctx, getPortalsByUser, userID.String()) +} + +func (pq *PortalQuery) FindPrivateChatsOf(ctx context.Context, receiver uuid.UUID) ([]*Portal, error) { + return pq.QueryMany(ctx, getPortalsByReceiver, receiver) +} + +func (pq *PortalQuery) GetAllWithMXID(ctx context.Context) ([]*Portal, error) { + return pq.QueryMany(ctx, getAllPortalsWithMXIDQuery) +} + +func (pq *PortalQuery) FindPrivateChatsNotInSpace(ctx context.Context, receiver uuid.UUID) ([]PortalKey, error) { + rows, err := pq.GetDB().Query(ctx, getChatsNotInSpaceQuery, receiver) + if err != nil { + return nil, err + } + return dbutil.NewRowIter(rows, func(rows dbutil.Scannable) (key PortalKey, err error) { + err = rows.Scan(&key.ChatID) + key.Receiver = receiver + return + }).AsList() +} + +func (p *Portal) Scan(row dbutil.Scannable) (*Portal, error) { + var mxid sql.NullString + err := row.Scan( + &p.ChatID, + &p.Receiver, + &mxid, + &p.Name, + &p.Topic, + &p.AvatarPath, + &p.AvatarHash, + &p.AvatarURL, + &p.NameSet, + &p.AvatarSet, + &p.TopicSet, + &p.Revision, + &p.Encrypted, + &p.RelayUserID, + &p.ExpirationTime, + ) + if err != nil { + return nil, err + } + p.MXID = id.RoomID(mxid.String) + return p, nil +} + +func (p *Portal) sqlVariables() []any { + return []any{ + p.ChatID, + p.Receiver, + dbutil.StrPtr(p.MXID), + p.Name, + p.Topic, + p.AvatarPath, + p.AvatarHash, + &p.AvatarURL, + p.NameSet, + p.AvatarSet, + p.TopicSet, + p.Revision, + p.Encrypted, + p.RelayUserID, + p.ExpirationTime, + } +} + +func (p *Portal) Insert(ctx context.Context) error { + return p.qh.Exec(ctx, insertPortalQuery, p.sqlVariables()...) +} + +func (p *Portal) Update(ctx context.Context) error { + return p.qh.Exec(ctx, updatePortalQuery, p.sqlVariables()...) +} + +func (p *Portal) Delete(ctx context.Context) error { + return p.qh.Exec(ctx, deletePortalQuery, p.ChatID, p.Receiver) +} diff --git a/database/puppet.go b/database/puppet.go new file mode 100644 index 0000000..8c300df --- /dev/null +++ b/database/puppet.go @@ -0,0 +1,150 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + "context" + "database/sql" + + "github.com/google/uuid" + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/id" +) + +const ( + puppetBaseSelect = ` + SELECT uuid, number, name, name_quality, avatar_path, avatar_hash, avatar_url, name_set, avatar_set, + contact_info_set, is_registered, custom_mxid, access_token + FROM puppet + ` + getPuppetBySignalIDQuery = puppetBaseSelect + `WHERE uuid=$1` + getPuppetByNumberQuery = puppetBaseSelect + `WHERE number=$1` + getPuppetByCustomMXIDQuery = puppetBaseSelect + `WHERE custom_mxid=$1` + getPuppetsWithCustomMXID = puppetBaseSelect + `WHERE custom_mxid<>''` + updatePuppetQuery = ` + UPDATE puppet SET + number=$2, name=$3, name_quality=$4, avatar_path=$5, avatar_hash=$6, avatar_url=$7, + name_set=$8, avatar_set=$9, contact_info_set=$10, is_registered=$11, + custom_mxid=$12, access_token=$13 + WHERE uuid=$1 + ` + insertPuppetQuery = ` + INSERT INTO puppet ( + uuid, number, name, name_quality, avatar_path, avatar_hash, avatar_url, + name_set, avatar_set, contact_info_set, is_registered, + custom_mxid, access_token + ) + VALUES ( + $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13 + ) + ` +) + +type PuppetQuery struct { + *dbutil.QueryHelper[*Puppet] +} + +type Puppet struct { + qh *dbutil.QueryHelper[*Puppet] + + SignalID uuid.UUID + Number string + Name string + NameQuality int + AvatarPath string + AvatarHash string + AvatarURL id.ContentURI + NameSet bool + AvatarSet bool + + IsRegistered bool + + CustomMXID id.UserID + AccessToken string + ContactInfoSet bool +} + +func newPuppet(qh *dbutil.QueryHelper[*Puppet]) *Puppet { + return &Puppet{qh: qh} +} + +func (pq *PuppetQuery) GetBySignalID(ctx context.Context, signalID uuid.UUID) (*Puppet, error) { + return pq.QueryOne(ctx, getPuppetBySignalIDQuery, signalID) +} + +func (pq *PuppetQuery) GetByNumber(ctx context.Context, number string) (*Puppet, error) { + return pq.QueryOne(ctx, getPuppetByNumberQuery, number) +} + +func (pq *PuppetQuery) GetByCustomMXID(ctx context.Context, mxid id.UserID) (*Puppet, error) { + return pq.QueryOne(ctx, getPuppetByCustomMXIDQuery, mxid) +} + +func (pq *PuppetQuery) GetAllWithCustomMXID(ctx context.Context) ([]*Puppet, error) { + return pq.QueryMany(ctx, getPuppetsWithCustomMXID) +} + +func (p *Puppet) Scan(row dbutil.Scannable) (*Puppet, error) { + var number, customMXID sql.NullString + err := row.Scan( + &p.SignalID, + &number, + &p.Name, + &p.NameQuality, + &p.AvatarPath, + &p.AvatarHash, + &p.AvatarURL, + &p.NameSet, + &p.AvatarSet, + &p.ContactInfoSet, + &p.IsRegistered, + &customMXID, + &p.AccessToken, + ) + if err != nil { + return nil, nil + } + p.Number = number.String + p.CustomMXID = id.UserID(customMXID.String) + return p, nil +} + +func (p *Puppet) sqlVariables() []any { + return []any{ + p.SignalID, + dbutil.StrPtr(p.Number), + p.Name, + p.NameQuality, + p.AvatarPath, + p.AvatarHash, + &p.AvatarURL, + p.NameSet, + p.AvatarSet, + p.ContactInfoSet, + p.IsRegistered, + dbutil.StrPtr(p.CustomMXID), + p.AccessToken, + } +} + +func (p *Puppet) Insert(ctx context.Context) error { + return p.qh.Exec(ctx, insertPuppetQuery, p.sqlVariables()...) +} + +func (p *Puppet) Update(ctx context.Context) error { + return p.qh.Exec(ctx, updatePuppetQuery, p.sqlVariables()...) +} diff --git a/database/reaction.go b/database/reaction.go new file mode 100644 index 0000000..fc5228e --- /dev/null +++ b/database/reaction.go @@ -0,0 +1,97 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + "context" + + "github.com/google/uuid" + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/id" +) + +const ( + getReactionByMXIDQuery = `SELECT msg_author, msg_timestamp, author, emoji, signal_chat_id, signal_receiver, mxid, mx_room FROM reaction WHERE mxid=$1` + getReactionBySignalIDQuery = `SELECT msg_author, msg_timestamp, author, emoji, signal_chat_id, signal_receiver, mxid, mx_room FROM reaction WHERE msg_author=$1 AND msg_timestamp=$2 AND author=$3 AND signal_receiver=$4` + insertReactionQuery = ` + INSERT INTO reaction (msg_author, msg_timestamp, author, emoji, signal_chat_id, signal_receiver, mxid, mx_room) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8) + ` + updateReactionQuery = ` + UPDATE reaction + SET mxid=$1, emoji=$2 + WHERE msg_author=$3 AND msg_timestamp=$4 AND author=$5 AND signal_receiver=$6 + ` + deleteReactionQuery = ` + DELETE FROM reaction WHERE msg_author=$1 AND msg_timestamp=$2 AND author=$3 AND signal_receiver=$4 + ` +) + +type ReactionQuery struct { + *dbutil.QueryHelper[*Reaction] +} + +func newReaction(qh *dbutil.QueryHelper[*Reaction]) *Reaction { + return &Reaction{qh: qh} +} + +type Reaction struct { + qh *dbutil.QueryHelper[*Reaction] + + MsgAuthor uuid.UUID + MsgTimestamp uint64 + Author uuid.UUID + Emoji string + + SignalChatID string + SignalReceiver uuid.UUID + + MXID id.EventID + RoomID id.RoomID +} + +func (rq *ReactionQuery) GetByMXID(ctx context.Context, mxid id.EventID) (*Reaction, error) { + return rq.QueryOne(ctx, getReactionByMXIDQuery, mxid) +} + +func (rq *ReactionQuery) GetBySignalID(ctx context.Context, msgAuthor uuid.UUID, msgTimestamp uint64, author, signalReceiver uuid.UUID) (*Reaction, error) { + return rq.QueryOne(ctx, getReactionBySignalIDQuery, msgAuthor, msgTimestamp, author, signalReceiver) +} + +func (r *Reaction) Scan(row dbutil.Scannable) (*Reaction, error) { + return dbutil.ValueOrErr(r, row.Scan( + &r.MsgAuthor, &r.MsgTimestamp, &r.Author, &r.Emoji, &r.SignalChatID, &r.SignalReceiver, &r.MXID, &r.RoomID, + )) +} + +func (r *Reaction) sqlVariables() []any { + return []any{ + r.MsgAuthor, r.MsgTimestamp, r.Author, r.Emoji, r.SignalChatID, r.SignalReceiver, r.MXID, r.RoomID, + } +} + +func (r *Reaction) Insert(ctx context.Context) error { + return r.qh.Exec(ctx, insertReactionQuery, r.sqlVariables()...) +} + +func (r *Reaction) Update(ctx context.Context) error { + return r.qh.Exec(ctx, updateReactionQuery, r.MXID, r.Emoji, r.MsgAuthor, r.MsgTimestamp, r.Author, r.SignalReceiver) +} + +func (r *Reaction) Delete(ctx context.Context) error { + return r.qh.Exec(ctx, deleteReactionQuery, r.MsgAuthor, r.MsgTimestamp, r.Author, r.SignalReceiver) +} diff --git a/database/upgrades/00-latest.sql b/database/upgrades/00-latest.sql new file mode 100644 index 0000000..ae8e157 --- /dev/null +++ b/database/upgrades/00-latest.sql @@ -0,0 +1,115 @@ +-- v0 -> v19 (compatible with v17+): Latest revision + +CREATE TABLE portal ( + chat_id TEXT NOT NULL, + receiver uuid NOT NULL, + mxid TEXT, + name TEXT NOT NULL, + topic TEXT NOT NULL, + encrypted BOOLEAN NOT NULL DEFAULT false, + avatar_path TEXT NOT NULL DEFAULT '', + avatar_hash TEXT NOT NULL, + avatar_url TEXT NOT NULL, + name_set BOOLEAN NOT NULL DEFAULT false, + avatar_set BOOLEAN NOT NULL DEFAULT false, + topic_set BOOLEAN NOT NULL DEFAULT false, + revision INTEGER NOT NULL DEFAULT 0, + + expiration_time BIGINT NOT NULL, + relay_user_id TEXT NOT NULL, + + PRIMARY KEY (chat_id, receiver), + CONSTRAINT portal_mxid_unique UNIQUE(mxid) +); + +CREATE TABLE puppet ( + uuid uuid PRIMARY KEY, + number TEXT UNIQUE, + name TEXT NOT NULL, + name_quality INTEGER NOT NULL, + avatar_path TEXT NOT NULL, + avatar_hash TEXT NOT NULL, + avatar_url TEXT NOT NULL, + name_set BOOLEAN NOT NULL DEFAULT false, + avatar_set BOOLEAN NOT NULL DEFAULT false, + + is_registered BOOLEAN NOT NULL DEFAULT false, + contact_info_set BOOLEAN NOT NULL DEFAULT false, + + custom_mxid TEXT, + access_token TEXT NOT NULL, + + CONSTRAINT puppet_custom_mxid_unique UNIQUE(custom_mxid) +); + +CREATE TABLE "user" ( + mxid TEXT PRIMARY KEY, + uuid uuid, + phone TEXT, + + management_room TEXT, + space_room TEXT, + + CONSTRAINT user_uuid_unique UNIQUE(uuid) +); + +CREATE TABLE user_portal ( + user_mxid TEXT, + portal_chat_id TEXT, + portal_receiver uuid, + last_read_ts BIGINT NOT NULL DEFAULT 0, + in_space BOOLEAN NOT NULL DEFAULT false, + + PRIMARY KEY (user_mxid, portal_chat_id, portal_receiver), + CONSTRAINT user_portal_user_fkey FOREIGN KEY (user_mxid) + REFERENCES "user"(mxid) ON UPDATE CASCADE ON DELETE CASCADE, + CONSTRAINT user_portal_portal_fkey FOREIGN KEY (portal_chat_id, portal_receiver) + REFERENCES portal(chat_id, receiver) ON UPDATE CASCADE ON DELETE CASCADE +); + +CREATE TABLE message ( + sender uuid NOT NULL, + timestamp BIGINT NOT NULL, + part_index INTEGER NOT NULL, + + signal_chat_id TEXT NOT NULL, + signal_receiver uuid NOT NULL, + + mxid TEXT NOT NULL, + mx_room TEXT NOT NULL, + + PRIMARY KEY (sender, timestamp, part_index, signal_receiver), + CONSTRAINT message_portal_fkey FOREIGN KEY (signal_chat_id, signal_receiver) + REFERENCES portal(chat_id, receiver) ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (sender) REFERENCES puppet(uuid) ON DELETE CASCADE, + CONSTRAINT message_mxid_unique UNIQUE (mxid) +); + +CREATE TABLE reaction ( + msg_author uuid NOT NULL, + msg_timestamp BIGINT NOT NULL, + -- part_index is not used in reactions, but is required for the foreign key. + _part_index INTEGER NOT NULL DEFAULT 0, + + author uuid NOT NULL, + emoji TEXT NOT NULL, + + signal_chat_id TEXT NOT NULL, + signal_receiver uuid NOT NULL, + + mxid TEXT NOT NULL, + mx_room TEXT NOT NULL, + + PRIMARY KEY (msg_author, msg_timestamp, author, signal_receiver), + CONSTRAINT reaction_message_fkey FOREIGN KEY (msg_author, msg_timestamp, _part_index, signal_receiver) + REFERENCES message (sender, timestamp, part_index, signal_receiver) ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (author) REFERENCES puppet(uuid) ON DELETE CASCADE, + CONSTRAINT reaction_mxid_unique UNIQUE (mxid) +); + +CREATE TABLE disappearing_message ( + mxid TEXT NOT NULL PRIMARY KEY, + room_id TEXT NOT NULL, + expiration_seconds BIGINT NOT NULL, + expiration_ts BIGINT +); diff --git a/database/upgrades/13-upgrade-mx-state-store.sql b/database/upgrades/13-upgrade-mx-state-store.sql new file mode 100644 index 0000000..ec1b6c2 --- /dev/null +++ b/database/upgrades/13-upgrade-mx-state-store.sql @@ -0,0 +1,18 @@ +-- v13: Switch mx_room_state from Python to Go format +ALTER TABLE mx_room_state DROP COLUMN is_encrypted; +ALTER TABLE mx_room_state DROP COLUMN has_full_member_list; + +-- only: postgres for next 2 lines +ALTER TABLE mx_room_state ALTER COLUMN power_levels TYPE jsonb USING power_levels::jsonb; +ALTER TABLE mx_room_state ALTER COLUMN encryption TYPE jsonb USING encryption::jsonb; + +ALTER TABLE "user" ADD COLUMN management_room TEXT; + +UPDATE mx_user_profile SET displayname='' WHERE displayname IS NULL; +UPDATE mx_user_profile SET avatar_url='' WHERE avatar_url IS NULL; + +CREATE TABLE mx_registrations ( + user_id TEXT PRIMARY KEY +); + +UPDATE mx_version SET version=5; diff --git a/database/upgrades/14-remove-notice-room.sql b/database/upgrades/14-remove-notice-room.sql new file mode 100644 index 0000000..9ad0692 --- /dev/null +++ b/database/upgrades/14-remove-notice-room.sql @@ -0,0 +1,3 @@ +-- v14: Remove redundant notice_room column from users +UPDATE "user" SET management_room = COALESCE(management_room, notice_room); +ALTER TABLE "user" DROP COLUMN notice_room; diff --git a/database/upgrades/15-remove-unused-puppet-columns.sql b/database/upgrades/15-remove-unused-puppet-columns.sql new file mode 100644 index 0000000..925c3a8 --- /dev/null +++ b/database/upgrades/15-remove-unused-puppet-columns.sql @@ -0,0 +1,3 @@ +-- v15: Remove unused columns in puppet table +ALTER TABLE puppet DROP COLUMN next_batch; +ALTER TABLE puppet DROP COLUMN base_url; diff --git a/database/upgrades/16-refactor-postgres.sql b/database/upgrades/16-refactor-postgres.sql new file mode 100644 index 0000000..331a6ae --- /dev/null +++ b/database/upgrades/16-refactor-postgres.sql @@ -0,0 +1,113 @@ +-- v16: Refactor types (Postgres) +-- only: postgres + +DROP TABLE IF EXISTS user_portal; + +-- Drop constraints so we can fix timestamps. +ALTER TABLE reaction DROP CONSTRAINT reaction_message_fkey; +ALTER TABLE message DROP CONSTRAINT message_pkey; + +-- Add part index to message and fix the hacky timestamps +ALTER TABLE message ADD COLUMN part_index INTEGER; +UPDATE message + SET timestamp=CASE WHEN timestamp > 1500000000000000 THEN timestamp / 1000 ELSE timestamp END, + part_index=CASE WHEN timestamp > 1500000000000000 THEN timestamp % 1000 ELSE 0 END; +-- If the bridge users have reacted to message parts, forget about those, not worth trying to deal with potential conflicts. +DELETE FROM reaction WHERE msg_timestamp > 1500000000000000; +ALTER TABLE message ALTER COLUMN part_index SET NOT NULL; +ALTER TABLE reaction ADD COLUMN _part_index INTEGER NOT NULL DEFAULT 0; + +-- Re-add the dropped constraints (but with part index and no chat) +ALTER TABLE message ADD PRIMARY KEY (sender, timestamp, part_index, signal_receiver); +ALTER TABLE message DROP CONSTRAINT IF EXISTS message_signal_chat_id_signal_receiver_fkey; +ALTER TABLE message DROP CONSTRAINT IF EXISTS message_signal_chat_id_fkey; +ALTER TABLE message ADD CONSTRAINT message_portal_fkey + FOREIGN KEY (signal_chat_id, signal_receiver) + REFERENCES portal (chat_id, receiver) + ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE reaction ADD CONSTRAINT reaction_message_fkey FOREIGN KEY (msg_author, msg_timestamp, _part_index, signal_receiver) + REFERENCES message (sender, timestamp, part_index, signal_receiver) ON DELETE CASCADE ON UPDATE CASCADE; +-- Also update the reaction primary key +ALTER TABLE reaction DROP CONSTRAINT reaction_pkey; +ALTER TABLE reaction ADD PRIMARY KEY (author, msg_author, msg_timestamp, signal_receiver); + +-- Change unique constraint from (mxid, mx_room) to just mxid. +ALTER TABLE message DROP CONSTRAINT message_mxid_mx_room_key; +ALTER TABLE message ADD CONSTRAINT message_mxid_unique UNIQUE (mxid); +ALTER TABLE reaction DROP CONSTRAINT reaction_mxid_mx_room_key; +ALTER TABLE reaction ADD CONSTRAINT reaction_mxid_unique UNIQUE (mxid); + +CREATE TABLE lost_portals ( + mxid TEXT PRIMARY KEY, + chat_id TEXT, + receiver TEXT +); +INSERT INTO lost_portals SELECT mxid, chat_id, receiver FROM portal WHERE mxid<>''; + +-- Make mxid column unique (requires using nulls for missing values) +UPDATE portal SET mxid=NULL WHERE mxid=''; +ALTER TABLE portal ADD CONSTRAINT portal_mxid_unique UNIQUE(mxid); +-- Delete any portals that aren't associated with logged-in users. +DELETE FROM portal WHERE receiver<>'' AND receiver NOT IN (SELECT username FROM "user" WHERE uuid IS NOT NULL); +-- Change receiver to uuid instead of phone number, also add nil uuid for groups. +UPDATE portal SET receiver=(SELECT uuid FROM "user" WHERE username=receiver AND uuid IS NOT NULL LIMIT 1) WHERE receiver<>''; +UPDATE portal SET receiver='00000000-0000-0000-0000-000000000000' WHERE receiver=''; +-- Drop the foreign keys again to allow changing types (the ON UPDATE CASCADEs are needed for the above step) +ALTER TABLE message DROP CONSTRAINT message_portal_fkey; +ALTER TABLE reaction DROP CONSTRAINT reaction_message_fkey; +ALTER TABLE portal ALTER COLUMN receiver TYPE uuid USING receiver::uuid; +ALTER TABLE message ALTER COLUMN signal_receiver TYPE uuid USING signal_receiver::uuid; +ALTER TABLE reaction ALTER COLUMN signal_receiver TYPE uuid USING signal_receiver::uuid; +-- Re-add the dropped constraints again +ALTER TABLE message ADD CONSTRAINT message_portal_fkey + FOREIGN KEY (signal_chat_id, signal_receiver) + REFERENCES portal (chat_id, receiver) + ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE reaction ADD CONSTRAINT reaction_message_fkey FOREIGN KEY (msg_author, msg_timestamp, _part_index, signal_receiver) + REFERENCES message (sender, timestamp, part_index, signal_receiver) ON DELETE CASCADE ON UPDATE CASCADE; +-- Delete group v1 portal entries +DELETE FROM portal WHERE chat_id NOT LIKE '________-____-____-____-____________' AND LENGTH(chat_id) <> 44; +DELETE FROM lost_portals WHERE mxid IN (SELECT mxid FROM portal WHERE mxid<>''); + +-- Remove unnecessary nullables in portal +UPDATE portal SET name='' WHERE name IS NULL; +UPDATE portal SET topic='' WHERE topic IS NULL; +UPDATE portal SET avatar_hash='' WHERE avatar_hash IS NULL; +UPDATE portal SET avatar_url='' WHERE avatar_url IS NULL; +UPDATE portal SET expiration_time=0 WHERE expiration_time IS NULL; +UPDATE portal SET relay_user_id='' WHERE relay_user_id IS NULL; +ALTER TABLE portal ALTER COLUMN name SET NOT NULL; +ALTER TABLE portal ALTER COLUMN topic SET NOT NULL; +ALTER TABLE portal ALTER COLUMN avatar_hash SET NOT NULL; +ALTER TABLE portal ALTER COLUMN avatar_url SET NOT NULL; +ALTER TABLE portal ALTER COLUMN expiration_time SET NOT NULL; +ALTER TABLE portal ALTER COLUMN relay_user_id SET NOT NULL; + +-- Add unique constraint to custom_mxid +UPDATE puppet + SET custom_mxid=NULL, access_token='' + WHERE custom_mxid<>'' + AND uuid<>COALESCE((SELECT uuid FROM "user" WHERE mxid=custom_mxid), '00000000-0000-0000-0000-000000000000'); +UPDATE puppet SET custom_mxid=NULL WHERE custom_mxid=''; +ALTER TABLE puppet ADD CONSTRAINT puppet_custom_mxid_unique UNIQUE(custom_mxid); +-- Remove unnecessary nullables in puppet +UPDATE puppet SET name='' WHERE name IS NULL; +UPDATE puppet SET avatar_hash='' WHERE avatar_hash IS NULL; +UPDATE puppet SET avatar_url='' WHERE avatar_url IS NULL; +UPDATE puppet SET access_token='' WHERE access_token IS NULL; +ALTER TABLE puppet ALTER COLUMN name SET NOT NULL; +ALTER TABLE puppet ALTER COLUMN avatar_hash SET NOT NULL; +ALTER TABLE puppet ALTER COLUMN avatar_url SET NOT NULL; +ALTER TABLE puppet ALTER COLUMN access_token SET NOT NULL; +ALTER TABLE puppet ALTER COLUMN name_quality DROP DEFAULT; + +ALTER TABLE "user" ADD CONSTRAINT user_uuid_unique UNIQUE(uuid); +ALTER TABLE "user" RENAME COLUMN username TO phone; + +-- Drop room_id from disappearing message primary key +ALTER TABLE disappearing_message DROP CONSTRAINT disappearing_message_pkey; +ALTER TABLE disappearing_message ADD PRIMARY KEY (mxid); +-- Remove unnecessary nullables in disappearing_message +ALTER TABLE disappearing_message ALTER COLUMN room_id SET NOT NULL; +UPDATE disappearing_message SET expiration_seconds=0 WHERE expiration_seconds IS NULL; +ALTER TABLE disappearing_message ALTER COLUMN expiration_seconds SET NOT NULL; diff --git a/database/upgrades/17-refactor-sqlite.sql b/database/upgrades/17-refactor-sqlite.sql new file mode 100644 index 0000000..c1edd5b --- /dev/null +++ b/database/upgrades/17-refactor-sqlite.sql @@ -0,0 +1,194 @@ +-- v17: Refactor types (SQLite) +-- transaction: off +-- only: sqlite + +-- This is separate from v16 so that postgres can run with transaction: on +-- (split upgrades by dialect don't currently allow disabling transaction in only one dialect) + +DROP TABLE IF EXISTS user_portal; + +PRAGMA foreign_keys = OFF; +BEGIN; + +CREATE TABLE message_new ( + sender uuid NOT NULL, + timestamp BIGINT NOT NULL, + part_index INTEGER NOT NULL, + + signal_chat_id TEXT NOT NULL, + signal_receiver TEXT NOT NULL, + + mxid TEXT NOT NULL, + mx_room TEXT NOT NULL, + + PRIMARY KEY (sender, timestamp, part_index, signal_receiver), + CONSTRAINT message_portal_fkey FOREIGN KEY (signal_chat_id, signal_receiver) REFERENCES portal(chat_id, receiver) ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (sender) REFERENCES puppet(uuid) ON DELETE CASCADE, + CONSTRAINT message_mxid_unique UNIQUE (mxid) +); + +CREATE TABLE reaction_new ( + msg_author uuid NOT NULL, + msg_timestamp BIGINT NOT NULL, + -- part_index is not used in reactions, but is required for the foreign key. + _part_index INTEGER NOT NULL DEFAULT 0, + + author uuid NOT NULL, + emoji TEXT NOT NULL, + + signal_chat_id TEXT NOT NULL, + signal_receiver TEXT NOT NULL, + + mxid TEXT NOT NULL, + mx_room TEXT NOT NULL, + + PRIMARY KEY (msg_author, msg_timestamp, author, signal_receiver), + CONSTRAINT reaction_message_fkey FOREIGN KEY (msg_author, msg_timestamp, _part_index, signal_receiver) + REFERENCES message (sender, timestamp, part_index, signal_receiver) ON DELETE CASCADE ON UPDATE CASCADE, + FOREIGN KEY (author) REFERENCES puppet(uuid) ON DELETE CASCADE, + CONSTRAINT reaction_mxid_unique UNIQUE (mxid) +); + + +INSERT INTO message_new +SELECT sender, + CASE WHEN timestamp > 1500000000000000 THEN timestamp / 1000 ELSE timestamp END, + CASE WHEN timestamp > 1500000000000000 THEN timestamp % 1000 ELSE 0 END, + COALESCE(signal_chat_id, ''), + COALESCE(signal_receiver, ''), + mxid, + mx_room +FROM message; + +INSERT INTO reaction_new +SELECT msg_author, + msg_timestamp, + 0, -- _part_index + author, + emoji, + COALESCE(signal_chat_id, ''), + COALESCE(signal_receiver, ''), + mxid, + mx_room +FROM reaction +WHERE msg_timestamp<1500000000000000; + +DROP TABLE message; +DROP TABLE reaction; +ALTER TABLE message_new RENAME TO message; +ALTER TABLE reaction_new RENAME TO reaction; + +PRAGMA foreign_key_check; +COMMIT; + +PRAGMA foreign_keys = ON; + +BEGIN; +CREATE TABLE lost_portals ( + mxid TEXT PRIMARY KEY, + chat_id TEXT, + receiver TEXT +); +INSERT INTO lost_portals SELECT mxid, chat_id, receiver FROM portal WHERE mxid<>''; +DELETE FROM portal WHERE receiver<>'' AND receiver NOT IN (SELECT username FROM "user" WHERE uuid<>''); +UPDATE portal SET receiver=(SELECT uuid FROM "user" WHERE username=receiver AND uuid<>'' LIMIT 1) WHERE receiver<>''; +UPDATE portal SET receiver='00000000-0000-0000-0000-000000000000' WHERE receiver=''; +DELETE FROM portal WHERE chat_id NOT LIKE '________-____-____-____-____________' AND LENGTH(chat_id) <> 44; +DELETE FROM lost_portals WHERE mxid IN (SELECT mxid FROM portal WHERE mxid<>''); +COMMIT; + +PRAGMA foreign_keys = OFF; + +BEGIN; + +CREATE TABLE portal_new ( + chat_id TEXT NOT NULL, + receiver uuid NOT NULL, + mxid TEXT, + name TEXT NOT NULL, + topic TEXT NOT NULL, + encrypted BOOLEAN NOT NULL DEFAULT false, + avatar_hash TEXT NOT NULL, + avatar_url TEXT NOT NULL, + name_set BOOLEAN NOT NULL DEFAULT false, + avatar_set BOOLEAN NOT NULL DEFAULT false, + revision INTEGER NOT NULL DEFAULT 0, + + expiration_time BIGINT NOT NULL, + relay_user_id TEXT NOT NULL, + + PRIMARY KEY (chat_id, receiver), + CONSTRAINT portal_mxid_unique UNIQUE(mxid) +); + +INSERT INTO portal_new + SELECT chat_id, receiver, CASE WHEN mxid='' THEN NULL ELSE mxid END, + COALESCE(name, ''), COALESCE(topic, ''), encrypted, COALESCE(avatar_hash, ''), COALESCE(avatar_url, ''), + name_set, avatar_set, revision, COALESCE(expiration_time, 0), COALESCE(relay_user_id, '') + FROM portal; +DROP TABLE portal; +ALTER TABLE portal_new RENAME TO portal; + +CREATE TABLE puppet_new ( + uuid uuid PRIMARY KEY, + number TEXT UNIQUE, + name TEXT NOT NULL, + name_quality INTEGER NOT NULL, + avatar_hash TEXT NOT NULL, + avatar_url TEXT NOT NULL, + name_set BOOLEAN NOT NULL DEFAULT false, + avatar_set BOOLEAN NOT NULL DEFAULT false, + + is_registered BOOLEAN NOT NULL DEFAULT false, + contact_info_set BOOLEAN NOT NULL DEFAULT false, + + custom_mxid TEXT, + access_token TEXT NOT NULL, + + CONSTRAINT puppet_custom_mxid_unique UNIQUE(custom_mxid) +); + +UPDATE puppet + SET custom_mxid=NULL, access_token='' + WHERE custom_mxid<>'' + AND uuid<>COALESCE((SELECT uuid FROM "user" WHERE mxid=custom_mxid), '00000000-0000-0000-0000-000000000000'); +INSERT INTO puppet_new + SELECT uuid, number, COALESCE(name, ''), COALESCE(name_quality, 0), COALESCE(avatar_hash, ''), + COALESCE(avatar_url, ''), name_set, avatar_set, is_registered, contact_info_set, + CASE WHEN custom_mxid='' THEN NULL ELSE custom_mxid END, COALESCE(access_token, '') + FROM puppet; +DROP TABLE puppet; +ALTER TABLE puppet_new RENAME TO puppet; + +CREATE TABLE user_new ( + mxid TEXT PRIMARY KEY, + uuid uuid, + phone TEXT, + + management_room TEXT, + + CONSTRAINT user_uuid_unique UNIQUE(uuid) +); + +INSERT INTO user_new + SELECT mxid, uuid, username, management_room + FROM user; +DROP TABLE user; +ALTER TABLE user_new RENAME TO user; + +CREATE TABLE disappearing_message_new ( + mxid TEXT NOT NULL PRIMARY KEY, + room_id TEXT NOT NULL, + expiration_seconds BIGINT NOT NULL, + expiration_ts BIGINT +); + +INSERT INTO disappearing_message_new + SELECT mxid, room_id, COALESCE(expiration_seconds, 0), expiration_ts + FROM disappearing_message; +DROP TABLE disappearing_message; +ALTER TABLE disappearing_message_new RENAME TO disappearing_message; + +PRAGMA foreign_key_check; +COMMIT; +PRAGMA foreign_keys = ON; diff --git a/database/upgrades/18-spaces.sql b/database/upgrades/18-spaces.sql new file mode 100644 index 0000000..24248ba --- /dev/null +++ b/database/upgrades/18-spaces.sql @@ -0,0 +1,17 @@ +-- v18 (compatible with v17+): Add columns for personal filtering space info +ALTER TABLE "user" ADD COLUMN space_room TEXT; + +DROP TABLE IF EXISTS user_portal; +CREATE TABLE user_portal ( + user_mxid TEXT, + portal_chat_id TEXT, + portal_receiver uuid, + last_read_ts BIGINT NOT NULL DEFAULT 0, + in_space BOOLEAN NOT NULL DEFAULT false, + + PRIMARY KEY (user_mxid, portal_chat_id, portal_receiver), + CONSTRAINT user_portal_user_fkey FOREIGN KEY (user_mxid) + REFERENCES "user"(mxid) ON UPDATE CASCADE ON DELETE CASCADE, + CONSTRAINT user_portal_portal_fkey FOREIGN KEY (portal_chat_id, portal_receiver) + REFERENCES portal(chat_id, receiver) ON UPDATE CASCADE ON DELETE CASCADE +); diff --git a/database/upgrades/19-more-portal-metadata.sql b/database/upgrades/19-more-portal-metadata.sql new file mode 100644 index 0000000..6230b21 --- /dev/null +++ b/database/upgrades/19-more-portal-metadata.sql @@ -0,0 +1,5 @@ +-- v19 (compatible with v17+): Add more metadata for portals +ALTER TABLE portal ADD COLUMN topic_set BOOLEAN NOT NULL DEFAULT false; +UPDATE portal SET topic_set=true WHERE topic<>''; +ALTER TABLE portal ADD COLUMN avatar_path TEXT NOT NULL DEFAULT ''; +ALTER TABLE puppet ADD COLUMN avatar_path TEXT NOT NULL DEFAULT ''; diff --git a/pkg/connector/dbmeta.go b/database/upgrades/upgrades.go similarity index 56% rename from pkg/connector/dbmeta.go rename to database/upgrades/upgrades.go index d8f644e..895be62 100644 --- a/pkg/connector/dbmeta.go +++ b/database/upgrades/upgrades.go @@ -1,5 +1,5 @@ // mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 Tulir Asokan +// Copyright (C) 2023 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 @@ -14,28 +14,27 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -package connector +package upgrades import ( - "maunium.net/go/mautrix/bridgev2/database" + "context" + "embed" + "errors" - "go.mau.fi/mautrix-signal/pkg/signalid" + "go.mau.fi/util/dbutil" ) -func (s *SignalConnector) GetDBMetaTypes() database.MetaTypes { - return database.MetaTypes{ - Portal: func() any { - return &signalid.PortalMetadata{} - }, - Ghost: func() any { - return &signalid.GhostMetadata{} - }, - Message: func() any { - return &signalid.MessageMetadata{} - }, - Reaction: nil, - UserLogin: func() any { - return &signalid.UserLoginMetadata{} - }, - } +var Table dbutil.UpgradeTable + +//go:embed *.sql +var rawUpgrades embed.FS + +func init() { + Table.Register(-1, 12, 0, "Unsupported version", false, func(ctx context.Context, database *dbutil.Database) error { + return errors.New("please upgrade to mautrix-signal v0.4.3 before upgrading to a newer version") + }) + Table.Register(1, 13, 0, "Jump to version 13", false, func(ctx context.Context, database *dbutil.Database) error { + return nil + }) + Table.RegisterFS(rawUpgrades) } diff --git a/database/user.go b/database/user.go new file mode 100644 index 0000000..aa90686 --- /dev/null +++ b/database/user.go @@ -0,0 +1,115 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + "context" + "database/sql" + "sync" + + "github.com/google/uuid" + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix/id" +) + +const ( + getUserByMXIDQuery = `SELECT mxid, phone, uuid, management_room, space_room FROM "user" WHERE mxid=$1` + getUserByPhoneQuery = `SELECT mxid, phone, uuid, management_room, space_room FROM "user" WHERE phone=$1` + getUserByUUIDQuery = `SELECT mxid, phone, uuid, management_room, space_room FROM "user" WHERE uuid=$1` + getAllLoggedInUsersQuery = `SELECT mxid, phone, uuid, management_room, space_room FROM "user" WHERE phone IS NOT NULL` + insertUserQuery = `INSERT INTO "user" (mxid, phone, uuid, management_room, space_room) VALUES ($1, $2, $3, $4, $5)` + updateUserQuery = `UPDATE "user" SET phone=$2, uuid=$3, management_room=$4, space_room=$5 WHERE mxid=$1` +) + +type UserQuery struct { + *dbutil.QueryHelper[*User] +} + +type User struct { + qh *dbutil.QueryHelper[*User] + + MXID id.UserID + SignalUsername string + SignalID uuid.UUID + ManagementRoom id.RoomID + SpaceRoom id.RoomID + + lastReadCache map[PortalKey]uint64 + lastReadCacheLock sync.Mutex + inSpaceCache map[PortalKey]bool + inSpaceCacheLock sync.Mutex +} + +func newUser(qh *dbutil.QueryHelper[*User]) *User { + return &User{ + qh: qh, + + lastReadCache: make(map[PortalKey]uint64), + inSpaceCache: make(map[PortalKey]bool), + } +} + +func (uq *UserQuery) GetByMXID(ctx context.Context, mxid id.UserID) (*User, error) { + return uq.QueryOne(ctx, getUserByMXIDQuery, mxid) +} + +func (uq *UserQuery) GetByPhone(ctx context.Context, phone string) (*User, error) { + return uq.QueryOne(ctx, getUserByPhoneQuery, phone) +} + +func (uq *UserQuery) GetBySignalID(ctx context.Context, uuid uuid.UUID) (*User, error) { + return uq.QueryOne(ctx, getUserByUUIDQuery, uuid) +} + +func (uq *UserQuery) GetAllLoggedIn(ctx context.Context) ([]*User, error) { + return uq.QueryMany(ctx, getAllLoggedInUsersQuery) +} + +func (u *User) sqlVariables() []any { + var nu uuid.NullUUID + nu.UUID = u.SignalID + nu.Valid = u.SignalID != uuid.Nil + return []any{u.MXID, dbutil.StrPtr(u.SignalUsername), nu, dbutil.StrPtr(u.ManagementRoom), dbutil.StrPtr(u.SpaceRoom)} +} + +func (u *User) Insert(ctx context.Context) error { + return u.qh.Exec(ctx, insertUserQuery, u.sqlVariables()...) +} + +func (u *User) Update(ctx context.Context) error { + return u.qh.Exec(ctx, updateUserQuery, u.sqlVariables()...) +} + +func (u *User) Scan(row dbutil.Scannable) (*User, error) { + var phone, managementRoom, spaceRoom sql.NullString + var signalID uuid.NullUUID + err := row.Scan( + &u.MXID, + &phone, + &signalID, + &managementRoom, + &spaceRoom, + ) + if err != nil { + return nil, err + } + u.SignalUsername = phone.String + u.SignalID = signalID.UUID + u.ManagementRoom = id.RoomID(managementRoom.String) + u.SpaceRoom = id.RoomID(spaceRoom.String) + return u, nil +} diff --git a/database/userportal.go b/database/userportal.go new file mode 100644 index 0000000..c1ba828 --- /dev/null +++ b/database/userportal.go @@ -0,0 +1,116 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 database + +import ( + "context" + "database/sql" + "errors" + + "github.com/rs/zerolog" +) + +const ( + getLastReadTSQuery = `SELECT last_read_ts FROM user_portal WHERE user_mxid=$1 AND portal_chat_id=$2 AND portal_receiver=$3` + setLastReadTSQuery = ` + INSERT INTO user_portal (user_mxid, portal_chat_id, portal_receiver, last_read_ts) VALUES ($1, $2, $3, $4) + ON CONFLICT (user_mxid, portal_chat_id, portal_receiver) DO UPDATE + SET last_read_ts=excluded.last_read_ts WHERE user_portal.last_read_ts. + +package main + +import ( + "context" + "fmt" + "time" + + "github.com/rs/zerolog" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/database" +) + +type DisappearingMessagesManager struct { + DB *database.Database + Log zerolog.Logger + Bridge *SignalBridge + checkMessagesChan chan struct{} +} + +func (dmm *DisappearingMessagesManager) ScheduleDisappearingForRoom(ctx context.Context, roomID id.RoomID) { + log := dmm.Log.With().Stringer("room_id", roomID).Logger() + disappearingMessages, err := dmm.DB.DisappearingMessage.GetUnscheduledForRoom(ctx, roomID) + if err != nil { + log.Err(err).Msg("Failed to get unscheduled disappearing messages") + return + } + for _, disappearingMessage := range disappearingMessages { + err = disappearingMessage.StartExpirationTimer(ctx) + if err != nil { + log.Err(err).Msg("Failed to schedule disappearing message") + } else { + log.Debug(). + Str("event_id", disappearingMessage.EventID.String()). + Time("expire_at", disappearingMessage.ExpireAt). + Msg("Scheduling disappearing message") + } + } + + // Tell the disappearing messages loop to check again + dmm.checkMessagesChan <- struct{}{} +} + +func (dmm *DisappearingMessagesManager) StartDisappearingLoop(ctx context.Context) { + dmm.checkMessagesChan = make(chan struct{}, 1) + go func() { + log := dmm.Log.With().Str("action", "loop").Logger() + ctx = log.WithContext(ctx) + for { + dmm.redactExpiredMessages(ctx) + + duration := 10 * time.Minute // Check again in 10 minutes just in case + nextMsg, err := dmm.DB.DisappearingMessage.GetNextScheduledMessage(ctx) + if err != nil { + if ctx.Err() != nil { + return + } + log.Err(err).Msg("Failed to get next disappearing message") + continue + } else if nextMsg != nil { + duration = time.Until(nextMsg.ExpireAt) + } + + select { + case <-time.After(duration): + case <-dmm.checkMessagesChan: + case <-ctx.Done(): + return + } + } + }() +} + +func (dmm *DisappearingMessagesManager) redactExpiredMessages(ctx context.Context) { + log := zerolog.Ctx(ctx) + expiredMessages, err := dmm.DB.DisappearingMessage.GetExpiredMessages(ctx) + if err != nil { + log.Err(err).Msg("Failed to get expired disappearing messages") + return + } + + for _, msg := range expiredMessages { + portal := dmm.Bridge.GetPortalByMXID(msg.RoomID) + if portal == nil { + log.Warn().Stringer("event_id", msg.EventID).Stringer("room_id", msg.RoomID).Msg("Failed to redact message: portal not found") + err = msg.Delete(ctx) + if err != nil { + log.Err(err). + Str("event_id", msg.EventID.String()). + Msg("Failed to delete disappearing message row in database") + } + continue + } + _, err = portal.MainIntent().RedactEvent(ctx, msg.RoomID, msg.EventID, mautrix.ReqRedact{ + Reason: "Message expired", + TxnID: fmt.Sprintf("mxsg_disappear_%s", msg.EventID), + }) + if err != nil { + log.Err(err). + Str("event_id", msg.EventID.String()). + Str("room_id", msg.RoomID.String()). + Msg("Failed to redact message") + } else { + log.Err(err). + Str("event_id", msg.EventID.String()). + Str("room_id", msg.RoomID.String()). + Msg("Redacted message") + } + err = msg.Delete(ctx) + if err != nil { + log.Err(err). + Str("event_id", msg.EventID.String()). + Msg("Failed to delete disappearing message row in database") + } + } +} + +func (dmm *DisappearingMessagesManager) AddDisappearingMessage(ctx context.Context, eventID id.EventID, roomID id.RoomID, expireIn time.Duration, startTimerNow bool) { + if expireIn == 0 { + return + } + var expireAt time.Time + if startTimerNow { + expireAt = time.Now().Add(expireIn) + } + disappearingMessage := dmm.DB.DisappearingMessage.NewWithValues(roomID, eventID, expireIn, expireAt) + err := disappearingMessage.Insert(ctx) + if err != nil { + zerolog.Ctx(ctx).Err(err).Stringer("event_id", eventID). + Msg("Failed to add disappearing message to database") + return + } + zerolog.Ctx(ctx).Debug().Stringer("event_id", eventID). + Msg("Added disappearing message row to database") + if startTimerNow { + // Tell the disappearing messages loop to check again + dmm.checkMessagesChan <- struct{}{} + } +} diff --git a/docker-run.sh b/docker-run.sh index 5f1ec65..f4285ed 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -4,8 +4,6 @@ if [[ -z "$GID" ]]; then GID="$UID" fi -BINARY_NAME=/usr/bin/mautrix-signal - # Define functions. function fixperms { chown -R $UID:$GID /data @@ -17,7 +15,7 @@ function fixperms { } if [[ ! -f /data/config.yaml ]]; then - $BINARY_NAME -c /data/config.yaml -e + cp /opt/mautrix-signal/example-config.yaml /data/config.yaml echo "Didn't find a config file." echo "Copied default config file to /data/config.yaml" echo "Modify that config file to your liking." @@ -26,7 +24,7 @@ if [[ ! -f /data/config.yaml ]]; then fi if [[ ! -f /data/registration.yaml ]]; then - $BINARY_NAME -g -c /data/config.yaml -r /data/registration.yaml || exit $? + /usr/bin/mautrix-signal -g -c /data/config.yaml -r /data/registration.yaml || exit $? echo "Didn't find a registration file." echo "Generated one for you." echo "See https://docs.mau.fi/bridges/general/registering-appservices.html on how to use it." @@ -36,12 +34,13 @@ fi cd /data fixperms +EXE=/usr/bin/mautrix-signal DLV=/usr/bin/dlv -if [ -x "$DLV" ]; then - if [ "$DBGWAIT" != 1 ]; then +if [[ -x $DLV ]]; then + if [[ $DBGWAIT -ne 1 ]]; then NOWAIT=1 fi - BINARY_NAME="${DLV} exec ${BINARY_NAME} ${NOWAIT:+--continue --accept-multiclient} --api-version 2 --headless -l :4040" + EXE="${DLV} exec ${EXE} ${NOWAIT:+--continue --accept-multiclient} --api-version 2 --headless -l :4040" fi -exec su-exec $UID:$GID $BINARY_NAME +exec su-exec $UID:$GID $EXE diff --git a/example-config.yaml b/example-config.yaml new file mode 100644 index 0000000..1a208a4 --- /dev/null +++ b/example-config.yaml @@ -0,0 +1,307 @@ +# Homeserver details. +homeserver: + # The address that this appservice can use to connect to the homeserver. + address: https://matrix.example.com + # The domain of the homeserver (also known as server_name, used for MXIDs, etc). + domain: example.com + + # What software is the homeserver running? + # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here. + software: standard + # The URL to push real-time bridge status to. + # If set, the bridge will make POST requests to this URL whenever a user's discord connection state changes. + # The bridge will use the appservice as_token to authorize requests. + status_endpoint: null + # Endpoint for reporting per-message status. + message_send_checkpoint_endpoint: null + # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246? + async_media: false + + # Should the bridge use a websocket for connecting to the homeserver? + # The server side is currently not documented anywhere and is only implemented by mautrix-wsproxy, + # mautrix-asmux (deprecated), and hungryserv (proprietary). + websocket: false + # How often should the websocket be pinged? Pinging will be disabled if this is zero. + ping_interval_seconds: 0 + +# Application service host/registration related details. +# Changing these values requires regeneration of the registration. +appservice: + # The address that the homeserver can use to connect to this appservice. + address: http://localhost:29328 + + # The hostname and port where this appservice should listen. + hostname: 0.0.0.0 + port: 29328 + + # Database config. + database: + # The database type. "sqlite3-fk-wal" and "postgres" are supported. + type: postgres + # The database URI. + # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended. + # https://github.com/mattn/go-sqlite3#connection-string + # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable + # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql + uri: postgres://user:password@host/database?sslmode=disable + # Maximum number of connections. Mostly relevant for Postgres. + max_open_conns: 20 + max_idle_conns: 2 + # Maximum connection idle time and lifetime before they're closed. Disabled if null. + # Parsed with https://pkg.go.dev/time#ParseDuration + max_conn_idle_time: null + max_conn_lifetime: null + + # The unique ID of this appservice. + id: signal + # Appservice bot details. + bot: + # Username of the appservice bot. + username: signalbot + # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty + # to leave display name/avatar as-is. + displayname: Signal bridge bot + avatar: mxc://maunium.net/wPJgTQbZOtpBFmDNkiNEMDUp + + # Whether or not to receive ephemeral events via appservice transactions. + # Requires MSC2409 support (i.e. Synapse 1.22+). + ephemeral_events: true + + # Should incoming events be handled asynchronously? + # This may be necessary for large public instances with lots of messages going through. + # However, messages will not be guaranteed to be bridged in the same order they were sent in. + async_transactions: false + + # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify. + as_token: "This value is generated when generating the registration" + hs_token: "This value is generated when generating the registration" + +# Prometheus config. +metrics: + # Enable prometheus metrics? + enabled: false + # IP and port where the metrics listener should be. The path is always /metrics + listen: 127.0.0.1:8000 + +signal: + # Default device name that shows up in the Signal app. + device_name: mautrix-signal + +# Bridge config +bridge: + # Localpart template of MXIDs for Signal users. + # {{.}} is replaced with the internal ID of the Signal user. + username_template: signal_{{.}} + # Displayname template for Signal users. This is also used as the room name in DMs if private_chat_portal_meta is enabled. + # {{.ProfileName}} - The Signal profile name set by the user. + # {{.ContactName}} - The name for the user from your phone's contact list. This is not safe on multi-user instances. + # {{.PhoneNumber}} - The phone number of the user. + # {{.UUID}} - The UUID of the Signal user. + # {{.AboutEmoji}} - The emoji set by the user in their profile. + displayname_template: '{{or .ProfileName .PhoneNumber "Unknown user"}}' + # Whether to explicitly set the avatar and room name for private chat portal rooms. + # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms. + # If set to `always`, all DM rooms will have explicit names and avatars set. + # If set to `never`, DM rooms will never have names and avatars set. + private_chat_portal_meta: default + # Should avatars from the user's contact list be used? This is not safe on multi-user instances. + use_contact_avatars: false + # Should the Signal user's phone number be included in the room topic in private chat portal rooms? + number_in_topic: true + # Avatar image for the Note to Self room. + note_to_self_avatar: mxc://maunium.net/REBIVrqjZwmaWpssCZpBlmlL + + portal_message_buffer: 128 + + # Should the bridge create a space for each logged-in user and add bridged rooms to it? + # Users who logged in before turning this on should run `!signal sync-space` to create and fill the space for the first time. + personal_filtering_spaces: false + # Should Matrix m.notice-type messages be bridged? + bridge_notices: true + # Should the bridge send a read receipt from the bridge bot when a message has been sent to Signal? + delivery_receipts: false + # Whether the bridge should send the message status as a custom com.beeper.message_send_status event. + message_status_events: false + # Whether the bridge should send error notices via m.notice events when a message fails to bridge. + message_error_notices: true + # Should the bridge update the m.direct account data event when double puppeting is enabled. + # Note that updating the m.direct event is not atomic (except with mautrix-asmux) + # and is therefore prone to race conditions. + sync_direct_chat_list: false + # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run. + # This field will automatically be changed back to false after it, except if the config file is not writable. + resend_bridge_info: false + # Send captions in the same message as images. This will send data compatible with both MSC2530. + # This is currently not supported in most clients. + caption_in_message: false + # Whether or not created rooms should have federation enabled. + # If false, created portal rooms will never be federated. + federate_rooms: true + # Servers to always allow double puppeting from + double_puppet_server_map: + example.com: https://example.com + # Allow using double puppeting from any server with a valid client .well-known file. + double_puppet_allow_discovery: false + # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth + # + # If set, double puppeting will be enabled automatically for local users + # instead of users having to find an access token and run `login-matrix` + # manually. + login_shared_secret_map: + example.com: foobar + + # Maximum time for handling Matrix events. Duration strings formatted for https://pkg.go.dev/time#ParseDuration + # Null means there's no enforced timeout. + message_handling_timeout: + # Send an error message after this timeout, but keep waiting for the response until the deadline. + # This is counted from the origin_server_ts, so the warning time is consistent regardless of the source of delay. + # If the message is older than this when it reaches the bridge, the message won't be handled at all. + error_after: null + # Drop messages after this timeout. They may still go through if the message got sent to the servers. + # This is counted from the time the bridge starts handling the message. + deadline: 120s + + # The prefix for commands. Only required in non-management rooms. + command_prefix: '!signal' + # Messages sent upon joining a management room. + # Markdown is supported. The defaults are listed below. + management_room_text: + # Sent when joining a room. + welcome: "Hello, I'm a Signal bridge bot." + # Sent when joining a management room and the user is already logged in. + welcome_connected: "Use `help` for help." + # Sent when joining a management room and the user is not logged in. + welcome_unconnected: "Use `help` for help or `login` to log in." + # Optional extra text sent when joining a management room. + additional_help: "" + + # End-to-bridge encryption support options. + # + # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info. + encryption: + # Allow encryption, work in group chat rooms with e2ee enabled + allow: false + # Default to encryption, force-enable encryption in all portals the bridge creates + # This will cause the bridge bot to be in private chats for the encryption to work properly. + default: false + # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data. + appservice: false + # Require encryption, drop any unencrypted messages. + require: false + # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled. + # You must use a client that supports requesting keys from other users to use this feature. + allow_key_sharing: false + # Options for deleting megolm sessions from the bridge. + delete_keys: + # Beeper-specific: delete outbound sessions when hungryserv confirms + # that the user has uploaded the key to key backup. + delete_outbound_on_ack: false + # Don't store outbound sessions in the inbound table. + dont_store_outbound: false + # Ratchet megolm sessions forward after decrypting messages. + ratchet_on_decrypt: false + # Delete fully used keys (index >= max_messages) after decrypting messages. + delete_fully_used_on_decrypt: false + # Delete previous megolm sessions from same device when receiving a new one. + delete_prev_on_new_session: false + # Delete megolm sessions received from a device when the device is deleted. + delete_on_device_delete: false + # Periodically delete megolm sessions when 2x max_age has passed since receiving the session. + periodically_delete_expired: false + # Delete inbound megolm sessions that don't have the received_at field used for + # automatic ratcheting and expired session deletion. This is meant as a migration + # to delete old keys prior to the bridge update. + delete_outdated_inbound: false + # What level of device verification should be required from users? + # + # Valid levels: + # unverified - Send keys to all device in the room. + # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys. + # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes). + # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot. + # Note that creating user signatures from the bridge bot is not currently possible. + # verified - Require manual per-device verification + # (currently only possible by modifying the `trust` column in the `crypto_device` database table). + verification_levels: + # Minimum level for which the bridge should send keys to when bridging messages from Signal to Matrix. + receive: unverified + # Minimum level that the bridge should accept for incoming Matrix messages. + send: unverified + # Minimum level that the bridge should require for accepting key requests. + share: cross-signed-tofu + # Options for Megolm room key rotation. These options allow you to + # configure the m.room.encryption event content. See: + # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for + # more information about that event. + rotation: + # Enable custom Megolm room key rotation settings. Note that these + # settings will only apply to rooms created after this option is + # set. + enable_custom: false + # The maximum number of milliseconds a session should be used + # before changing it. The Matrix spec recommends 604800000 (a week) + # as the default. + milliseconds: 604800000 + # The maximum number of messages that should be sent with a given a + # session before changing it. The Matrix spec recommends 100 as the + # default. + messages: 100 + + # Disable rotating keys when a user's devices change? + # You should not enable this option unless you understand all the implications. + disable_device_change_key_rotation: false + + # Settings for provisioning API + provisioning: + # Prefix for the provisioning API paths. + prefix: /_matrix/provision + # Shared secret for authentication. If set to "generate", a random secret will be generated, + # or if set to "disable", the provisioning API will be disabled. + shared_secret: generate + # Enable debug API at /debug with provisioning authentication. + debug_endpoints: false + + # Permissions for using the bridge. + # Permitted values: + # relay - Talk through the relaybot (if enabled), no access otherwise + # user - Access to use the bridge to chat with a Signal account. + # admin - User level and some additional administration tools + # Permitted keys: + # * - All Matrix users + # domain - All users on that homeserver + # mxid - Specific user + permissions: + "*": relay + "example.com": user + "@admin:example.com": admin + + # Settings for relay mode + relay: + # Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any + # authenticated user into a relaybot for that chat. + enabled: false + # Should only admins be allowed to set themselves as relay users? + admin_only: true + # The formats to use when sending messages to Signal via the relaybot. + message_formats: + m.text: "{{ .Sender.Displayname }}: {{ .Message }}" + m.notice: "{{ .Sender.Displayname }}: {{ .Message }}" + m.emote: "* {{ .Sender.Displayname }} {{ .Message }}" + m.file: "{{ .Sender.Displayname }} sent a file" + m.image: "{{ .Sender.Displayname }} sent an image" + m.audio: "{{ .Sender.Displayname }} sent an audio file" + m.video: "{{ .Sender.Displayname }} sent a video" + m.location: "{{ .Sender.Displayname }} sent a location" + +# Logging config. See https://github.com/tulir/zeroconfig for details. +logging: + min_level: debug + writers: + - type: stdout + format: pretty-colored + - type: file + format: json + filename: ./logs/mautrix-signal.log + max_size: 100 + max_backups: 10 + compress: true diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..80c5341 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1703255338, + "narHash": "sha256-Z6wfYJQKmDN9xciTwU3cOiOk+NElxdZwy/FiHctCzjU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6df37dc6a77654682fe9f071c62b4242b5342e04", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..cbb2b61 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + description = "mautrix-signal development environment"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + (flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { inherit system; }; + in { + devShells.default = pkgs.mkShell { + LIBCLANG_PATH = "${pkgs.llvmPackages_11.libclang.lib}/lib"; + + buildInputs = with pkgs; [ + clang + cmake + gnumake + protobuf + rust-cbindgen + rustup + olm + + go_1_20 + go-tools + gotools + + pre-commit + ]; + }; + })); +} diff --git a/go.mod b/go.mod index 93eb572..a810ac3 100644 --- a/go.mod +++ b/go.mod @@ -1,52 +1,52 @@ module go.mau.fi/mautrix-signal -go 1.26.0 - -toolchain go1.27.1 - -tool go.mau.fi/util/cmd/maubuild +go 1.20 require ( - github.com/coder/websocket v1.8.15 - github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff - github.com/google/uuid v1.6.0 + github.com/beeper/libserv v0.0.0-20231231202820-c7303abfc32c + github.com/emersion/go-vcard v0.0.0-20230815062825-8fda7d206ec9 + github.com/google/uuid v1.5.0 + github.com/gorilla/mux v1.8.0 + github.com/lib/pq v1.10.9 github.com/mattn/go-pointer v0.0.1 - github.com/rs/zerolog v1.35.1 - github.com/stretchr/testify v1.12.0 - github.com/tidwall/gjson v1.19.0 - go.mau.fi/util v0.10.1 - golang.org/x/crypto v0.57.0 - golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba - golang.org/x/net v0.59.0 - golang.org/x/sync v0.23.0 - google.golang.org/grpc v1.83.2 - google.golang.org/protobuf v1.36.12 - gopkg.in/yaml.v3 v3.0.1 - maunium.net/go/mautrix v0.31.0 + github.com/mattn/go-sqlite3 v1.14.19 + github.com/prometheus/client_golang v1.18.0 + github.com/rs/zerolog v1.31.0 + github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e + github.com/stretchr/testify v1.8.4 + github.com/tidwall/gjson v1.17.0 + go.mau.fi/util v0.3.0 + golang.org/x/crypto v0.18.0 + golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 + golang.org/x/net v0.20.0 + google.golang.org/protobuf v1.32.0 + maunium.net/go/maulogger/v2 v2.4.1 + maunium.net/go/mautrix v0.17.0 + nhooyr.io/websocket v1.8.10 ) require ( - filippo.io/edwards25519 v1.2.0 // indirect - github.com/coreos/go-systemd/v22 v22.7.0 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/lib/pq v1.12.3 // indirect - github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-sqlite3 v1.14.52 // indirect - github.com/petermattis/goid v0.0.0-20260820044319-269ab09b5261 // indirect - github.com/rogpeppe/go-internal v1.10.0 // indirect - github.com/rs/xid v1.6.0 // indirect - github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect - github.com/tidwall/match v1.2.0 // indirect - github.com/tidwall/pretty v1.2.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/coreos/go-systemd/v22 v22.5.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gorilla/websocket v1.5.0 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/rs/xid v1.5.0 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect github.com/tidwall/sjson v1.2.5 // indirect - github.com/yuin/goldmark v1.8.6 // indirect - go.mau.fi/zeroconfig v0.2.0 // indirect - golang.org/x/mod v0.41.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + github.com/yuin/goldmark v1.6.0 // indirect + go.mau.fi/zeroconfig v0.1.2 // indirect + golang.org/x/sys v0.16.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect maunium.net/go/mauflag v1.0.0 // indirect ) diff --git a/go.sum b/go.sum index 606a4ad..e9ba207 100644 --- a/go.sum +++ b/go.sum @@ -1,117 +1,100 @@ -filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= -filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= -github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= -github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/coder/websocket v1.8.15 h1:6B2JPeOGlpff2Uz6vOEH1Vzpi0iUz20A+lPVhPHtNUA= -github.com/coder/websocket v1.8.15/go.mod h1:NX3SzP+inril6yawo5CQXx8+fk145lPDC6pumgx0mVg= -github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA= -github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w= +github.com/DATA-DOG/go-sqlmock v1.5.1 h1:FK6RCIUSfmbnI/imIICmboyQBkOckutaa6R5YYlLZyo= +github.com/beeper/libserv v0.0.0-20231231202820-c7303abfc32c h1:WqjRVgUO039eiISCjsZC4F9onOEV93DJAk6v33rsZzY= +github.com/beeper/libserv v0.0.0-20231231202820-c7303abfc32c/go.mod h1:b9FFm9y4mEm36G8ytVmS1vkNzJa0KepmcdVY+qf7qRU= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff h1:4N8wnS3f1hNHSmFD5zgFkWCyA4L1kCDkImPAtK7D6tg= -github.com/emersion/go-vcard v0.0.0-20241024213814-c9703dde27ff/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM= -github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= -github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/emersion/go-vcard v0.0.0-20230815062825-8fda7d206ec9 h1:ATgqloALX6cHCranzkLb8/zjivwQ9DWWDCQRnxTPfaA= +github.com/emersion/go-vcard v0.0.0-20230815062825-8fda7d206ec9/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ= -github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= -github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= -github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0= github.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc= -github.com/mattn/go-sqlite3 v1.14.52 h1:wVbm2Qnf4OXkqhBTSPuCRZDRnxfbVrrmiCEroVdog8U= -github.com/mattn/go-sqlite3 v1.14.52/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w= -github.com/petermattis/goid v0.0.0-20260820044319-269ab09b5261 h1:lcWAnrqr2nNfDiArwFNHCE4787Mw2tCdVSOXCru0/0E= -github.com/petermattis/goid v0.0.0-20260820044319-269ab09b5261/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= +github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= -github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= -github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= -github.com/rs/zerolog v1.35.1 h1:m7xQeoiLIiV0BCEY4Hs+j2NG4Gp2o2KPKmhnnLiazKI= -github.com/rs/zerolog v1.35.1/go.mod h1:EjML9kdfa/RMA7h/6z6pYmq1ykOuA8/mjWaEvGI+jcw= +github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= +github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= -github.com/stretchr/testify v1.12.0 h1:K6Mr6jO9JICuend/5xzTM03ydSV3vdNRYAdPSukj8uI= -github.com/stretchr/testify v1.12.0/go.mod h1:bOYBZb5qJ00vPzWfIqBUZPaxK8jWiXc6d3ErP4Ca9Gw= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/gjson v1.19.0 h1:xwxm7n691Uf3u5OFjzngavjGTh55KX5q/9w9xHW88JU= -github.com/tidwall/gjson v1.19.0/go.mod h1:V37/opeE/JbLUOfH0QTXiNez2l0RUjYUhpT4szFQAfc= +github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= +github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM= -github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= -github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/yuin/goldmark v1.8.6 h1:d0VcaP1sx9GkFVkoW+KtggpGi2KZ965i14b0+bDQST4= -github.com/yuin/goldmark v1.8.6/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -go.mau.fi/util v0.10.1 h1:1oSqb4TwzLA0cUDY0aomyBPFKkZ3J5fqCmrXV3VH3GQ= -go.mau.fi/util v0.10.1/go.mod h1:40TDo7/ekSeOjgr8KAmX31Yf4zrOF94j83WQB+u5ZPc= -go.mau.fi/zeroconfig v0.2.0 h1:e/OGEERqVRRKlgaro7E6bh8xXiKFSXB3eNNIud7FUjU= -go.mau.fi/zeroconfig v0.2.0/go.mod h1:J0Vn0prHNOm493oZoQ84kq83ZaNCYZnq+noI1b1eN8w= -go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= -go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= -go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= -go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= -go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= -go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= -go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= -go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= -go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= -go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= -go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= -golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= -golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= -golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba h1:Ck8QetSgk912qxWLMCKxd0in+aiyBQyDSMae6e/xmpU= -golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba/go.mod h1:50RgIsmK7OwqzTTeqcSXQW8SswW0o8fRcDxmqGluJ8E= -golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= -golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= -golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues= -golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= -golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= -golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68= +github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +go.mau.fi/util v0.3.0 h1:Lt3lbRXP6ZBqTINK0EieRWor3zEwwwrDT14Z5N8RUCs= +go.mau.fi/util v0.3.0/go.mod h1:9dGsBCCbZJstx16YgnVMVi3O2bOizELoKpugLD4FoGs= +go.mau.fi/zeroconfig v0.1.2 h1:DKOydWnhPMn65GbXZOafgkPm11BvFashZWLct0dGFto= +go.mau.fi/zeroconfig v0.1.2/go.mod h1:NcSJkf180JT+1IId76PcMuLTNa1CzsFFZ0nBygIQM70= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3 h1:hNQpMuAJe5CtcUqCXaWga3FHu+kQvCqcsoVaQgSV60o= +golang.org/x/exp v0.0.0-20240112132812-db7319d0e0e3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= -golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= -golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= -gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= -gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= -google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= -google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= -google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= maunium.net/go/mauflag v1.0.0 h1:YiaRc0tEI3toYtJMRIfjP+jklH45uDHtT80nUamyD4M= maunium.net/go/mauflag v1.0.0/go.mod h1:nLivPOpTpHnpzEh8jEdSL9UqO9+/KBJFmNRlwKfkPeA= -maunium.net/go/mautrix v0.31.0 h1:x6XNBSa0kOaBgcleI+ZBLkGvBdHIE0qdeY6TZ4wWUeI= -maunium.net/go/mautrix v0.31.0/go.mod h1:vfPYtoGAjlTnIF+W8tl+rjX3yB4PEfqYR2sDXvQo4Co= +maunium.net/go/maulogger/v2 v2.4.1 h1:N7zSdd0mZkB2m2JtFUsiGTQQAdP0YeFWT7YMc80yAL8= +maunium.net/go/maulogger/v2 v2.4.1/go.mod h1:omPuYwYBILeVQobz8uO3XC8DIRuEb5rXYlQSuqrbCho= +maunium.net/go/mautrix v0.17.0 h1:scc1qlUbzPn+wc+3eAPquyD+3gZwwy/hBANBm+iGKK8= +maunium.net/go/mautrix v0.17.0/go.mod h1:j+puTEQCEydlVxhJ/dQP5chfa26TdvBO7X6F3Ataav8= +nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= +nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= diff --git a/main.go b/main.go new file mode 100644 index 0000000..be1de08 --- /dev/null +++ b/main.go @@ -0,0 +1,375 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber +// +// 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 main + +import ( + "context" + _ "embed" + "fmt" + "os" + "sync" + + "github.com/google/uuid" + "github.com/rs/zerolog" + "go.mau.fi/util/configupgrade" + "go.mau.fi/util/dbutil" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/bridge" + "maunium.net/go/mautrix/bridge/commands" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/format" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/bpnsclient" + "go.mau.fi/mautrix-signal/config" + "go.mau.fi/mautrix-signal/database" + "go.mau.fi/mautrix-signal/msgconv/matrixfmt" + "go.mau.fi/mautrix-signal/msgconv/signalfmt" + "go.mau.fi/mautrix-signal/pkg/signalmeow" + "go.mau.fi/mautrix-signal/pkg/signalmeow/store" +) + +//go:embed example-config.yaml +var ExampleConfig string + +// Information to find out exactly which commit the bridge was built from. +// These are filled at build time with the -X linker flag. +var ( + Tag = "unknown" + Commit = "unknown" + BuildTime = "unknown" +) + +type SignalBridge struct { + bridge.Bridge + + Config *config.Config + DB *database.Database + Metrics *MetricsHandler + MeowStore *store.StoreContainer + + provisioning *ProvisioningAPI + + usersByMXID map[id.UserID]*User + usersBySignalID map[uuid.UUID]*User + usersLock sync.Mutex + + managementRooms map[id.RoomID]*User + managementRoomsLock sync.Mutex + + portalsByMXID map[id.RoomID]*Portal + portalsByID map[database.PortalKey]*Portal + portalsLock sync.Mutex + + puppets map[uuid.UUID]*Puppet + puppetsByCustomMXID map[id.UserID]*Puppet + puppetsLock sync.Mutex + + disappearingMessagesManager *DisappearingMessagesManager + + bpnsClient *bpnsclient.BPNSClient +} + +var _ bridge.ChildOverride = (*SignalBridge)(nil) + +func (br *SignalBridge) GetExampleConfig() string { + return ExampleConfig +} + +func (br *SignalBridge) GetConfigPtr() interface{} { + br.Config = &config.Config{ + BaseConfig: &br.Bridge.Config, + } + br.Config.BaseConfig.Bridge = &br.Config.Bridge + return br.Config +} + +func (br *SignalBridge) Init() { + br.CommandProcessor = commands.NewProcessor(&br.Bridge) + br.RegisterCommands() + + signalmeow.SetLogger(br.ZLog.With().Str("component", "signalmeow").Logger()) + + br.DB = database.New(br.Bridge.DB) + br.MeowStore = store.NewStore(br.Bridge.DB, dbutil.ZeroLogger(br.ZLog.With().Str("db_section", "signalmeow").Logger())) + + ss := br.Config.Bridge.Provisioning.SharedSecret + if len(ss) > 0 && ss != "disable" { + br.provisioning = &ProvisioningAPI{bridge: br, log: br.ZLog.With().Str("component", "provisioning").Logger()} + } + br.disappearingMessagesManager = &DisappearingMessagesManager{ + DB: br.DB, + Log: br.ZLog.With().Str("component", "disappearing messages").Logger(), + Bridge: br, + } + + br.Metrics = NewMetricsHandler(br.Config.Metrics.Listen, br.Log.Sub("Metrics"), br.DB) + br.MatrixHandler.TrackEventDuration = br.Metrics.TrackMatrixEvent + + signalFormatParams = &signalfmt.FormatParams{ + GetUserInfo: func(u uuid.UUID) signalfmt.UserInfo { + puppet := br.GetPuppetBySignalID(u) + if puppet == nil { + return signalfmt.UserInfo{} + } + user := br.GetUserBySignalID(u) + if user != nil { + return signalfmt.UserInfo{ + MXID: user.MXID, + Name: puppet.Name, + } + } + return signalfmt.UserInfo{ + MXID: puppet.MXID, + Name: puppet.Name, + } + }, + } + matrixFormatParams = &matrixfmt.HTMLParser{ + GetUUIDFromMXID: func(userID id.UserID) uuid.UUID { + parsed, ok := br.ParsePuppetMXID(userID) + if ok { + return parsed + } + user := br.GetUserByMXIDIfExists(userID) + if user != nil && user.SignalID != uuid.Nil { + return user.SignalID + } + return uuid.Nil + }, + } +} + +func (br *SignalBridge) logLostPortals(ctx context.Context) { + exists, err := br.DB.TableExists(ctx, "lost_portals") + if err != nil { + br.ZLog.Err(err).Msg("Failed to check if lost_portals table exists") + } else if !exists { + return + } + lostPortals, err := br.DB.LostPortal.GetAll(ctx) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get lost portals") + return + } else if len(lostPortals) == 0 { + return + } + lostCountByReceiver := make(map[string]int) + for _, lost := range lostPortals { + lostCountByReceiver[lost.Receiver]++ + } + br.ZLog.Warn(). + Any("count_by_receiver", lostCountByReceiver). + Msg("Some portals were discarded due to the receiver not being logged into the bridge anymore. " + + "Use `!signal cleanup-lost-portals` to remove them from the database. " + + "Alternatively, you can re-insert the data into the portal table with the appropriate receiver column to restore the portals.") +} + +func (br *SignalBridge) Start() { + go br.logLostPortals(context.TODO()) + err := br.MeowStore.Upgrade(context.TODO()) + if err != nil { + br.Log.Fatalln("Failed to upgrade signalmeow database: %v", err) + os.Exit(15) + } + if br.provisioning != nil { + br.Log.Debugln("Initializing provisioning API") + br.provisioning.Init() + } + go func() { + startingUsers := br.StartUsers() + + logger := br.ZLog.With().Str("component", "bpnsclient").Logger() + br.bpnsClient = bpnsclient.NewBPNSClient( + &logger, + "http://localhost:8000", + "myimaToken", + "mypushToken", + startingUsers[0].SignalID, + startingUsers[0].Client.Store.Password, + startingUsers[0].Client.Store.DeviceID, + ) + if br.bpnsClient != nil { + br.Log.Debugln("Starting BPNS client") + br.bpnsClient.Start(context.TODO()) + } + }() + if br.Config.Metrics.Enabled { + go br.Metrics.Start() + } + go br.disappearingMessagesManager.StartDisappearingLoop(context.TODO()) +} + +func (br *SignalBridge) Stop() { + br.Metrics.Stop() + for _, user := range br.usersByMXID { + br.Log.Debugln("Disconnecting", user.MXID) + user.Disconnect() + } + if br.bpnsClient != nil { + br.bpnsClient.Stop(context.TODO()) + } +} + +func (br *SignalBridge) GetIPortal(mxid id.RoomID) bridge.Portal { + p := br.GetPortalByMXID(mxid) + if p == nil { + return nil + } + return p +} + +func (br *SignalBridge) GetIUser(mxid id.UserID, create bool) bridge.User { + p := br.GetUserByMXID(mxid) + if p == nil { + return nil + } + return p +} + +func (br *SignalBridge) IsGhost(mxid id.UserID) bool { + _, isGhost := br.ParsePuppetMXID(mxid) + return isGhost +} + +func (br *SignalBridge) GetIGhost(mxid id.UserID) bridge.Ghost { + p := br.GetPuppetByMXID(mxid) + if p == nil { + return nil + } + return p +} + +func (br *SignalBridge) CreatePrivatePortal(roomID id.RoomID, brInviter bridge.User, brGhost bridge.Ghost) { + inviter := brInviter.(*User) + puppet := brGhost.(*Puppet) + + log := br.ZLog.With(). + Str("action", "create private portal"). + Str("target_room_id", roomID.String()). + Str("inviter_mxid", brInviter.GetMXID().String()). + Str("invitee_uuid", puppet.SignalID.String()). + Logger() + log.Debug().Msg("Creating private chat portal") + + key := database.NewPortalKey(puppet.SignalID.String(), inviter.SignalID) + portal := br.GetPortalByChatID(key) + ctx := log.WithContext(context.TODO()) + + if len(portal.MXID) == 0 { + br.createPrivatePortalFromInvite(ctx, roomID, inviter, puppet, portal) + return + } + log.Debug(). + Str("existing_room_id", portal.MXID.String()). + Msg("Existing private chat portal found, trying to invite user") + + ok := portal.ensureUserInvited(ctx, inviter) + if !ok { + log.Warn().Msg("Failed to invite user to existing private chat portal. Redirecting portal to new room") + br.createPrivatePortalFromInvite(ctx, roomID, inviter, puppet, portal) + return + } + intent := puppet.DefaultIntent() + errorMessage := fmt.Sprintf("You already have a private chat portal with me at [%[1]s](https://matrix.to/#/%[1]s)", portal.MXID) + errorContent := format.RenderMarkdown(errorMessage, true, false) + _, _ = intent.SendMessageEvent(ctx, roomID, event.EventMessage, errorContent) + log.Debug().Msg("Leaving ghost from private chat room after accepting invite because we already have a chat with the user") + _, _ = intent.LeaveRoom(ctx, roomID) +} + +func (br *SignalBridge) createPrivatePortalFromInvite(ctx context.Context, roomID id.RoomID, inviter *User, puppet *Puppet, portal *Portal) { + log := zerolog.Ctx(ctx) + log.Debug().Msg("Creating private portal from invite") + + // Check if room is already encrypted + var existingEncryption event.EncryptionEventContent + var encryptionEnabled bool + err := portal.MainIntent().StateEvent(ctx, roomID, event.StateEncryption, "", &existingEncryption) + if err != nil { + log.Err(err).Msg("Failed to check if encryption is enabled in private chat room") + } else { + encryptionEnabled = existingEncryption.Algorithm == id.AlgorithmMegolmV1 + } + portal.MXID = roomID + br.portalsLock.Lock() + br.portalsByMXID[portal.MXID] = portal + br.portalsLock.Unlock() + intent := puppet.DefaultIntent() + + if br.Config.Bridge.Encryption.Default || encryptionEnabled { + log.Debug().Msg("Adding bridge bot to new private chat portal as encryption is enabled") + _, err = intent.InviteUser(ctx, roomID, &mautrix.ReqInviteUser{UserID: br.Bot.UserID}) + if err != nil { + log.Err(err).Msg("Failed to invite bridge bot to enable e2be") + } + err = br.Bot.EnsureJoined(ctx, roomID) + if err != nil { + log.Err(err).Msg("Failed to join as bridge bot to enable e2be") + } + if !encryptionEnabled { + _, err = intent.SendStateEvent(ctx, roomID, event.StateEncryption, "", portal.getEncryptionEventContent()) + if err != nil { + log.Err(err).Msg("Failed to enable e2be") + } + } + br.AS.StateStore.SetMembership(ctx, roomID, inviter.MXID, event.MembershipJoin) + br.AS.StateStore.SetMembership(ctx, roomID, puppet.MXID, event.MembershipJoin) + br.AS.StateStore.SetMembership(ctx, roomID, br.Bot.UserID, event.MembershipJoin) + portal.Encrypted = true + } + portal.UpdateDMInfo(ctx, true) + _, _ = intent.SendNotice(ctx, roomID, "Private chat portal created") + log.Info().Msg("Created private chat portal after invite") +} + +func main() { + br := &SignalBridge{ + usersByMXID: make(map[id.UserID]*User), + usersBySignalID: make(map[uuid.UUID]*User), + + managementRooms: make(map[id.RoomID]*User), + + portalsByMXID: make(map[id.RoomID]*Portal), + portalsByID: make(map[database.PortalKey]*Portal), + + puppets: make(map[uuid.UUID]*Puppet), + puppetsByCustomMXID: make(map[id.UserID]*Puppet), + } + br.Bridge = bridge.Bridge{ + Name: "mautrix-signal", + URL: "https://github.com/mautrix/signal", + Description: "A Matrix-Signal puppeting bridge.", + Version: "0.4.99", + ProtocolName: "Signal", + BeeperServiceName: "signal", + BeeperNetworkName: "signal", + + CryptoPickleKey: "mautrix.bridge.e2ee", + + ConfigUpgrader: &configupgrade.StructUpgrader{ + SimpleUpgrader: configupgrade.SimpleUpgrader(config.DoUpgrade), + Blocks: config.SpacedBlocks, + Base: ExampleConfig, + }, + + Child: br, + } + br.InitVersion(Tag, Commit, BuildTime) + + br.Main() +} diff --git a/messagetracking.go b/messagetracking.go new file mode 100644 index 0000000..a106ee6 --- /dev/null +++ b/messagetracking.go @@ -0,0 +1,311 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber +// +// 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 main + +import ( + "context" + "errors" + "fmt" + "sync" + "time" + + "github.com/rs/zerolog" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/bridge/status" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/msgconv" +) + +var ( + errUserNotConnected = errors.New("you are not connected to Signal") + errDifferentUser = errors.New("user is not the recipient of this private chat portal") + errUserNotLoggedIn = errors.New("user is not logged in and chat has no relay bot") + errRelaybotNotLoggedIn = errors.New("neither user nor relay bot of chat are logged in") + errCantRelayReactions = errors.New("user is not logged in and reactions can't be relayed") + errMNoticeDisabled = errors.New("bridging m.notice messages is disabled") + errUnexpectedParsedContentType = errors.New("unexpected parsed content type") + + errRedactionTargetNotFound = errors.New("redaction target message was not found") + errRedactionTargetSentBySomeoneElse = errors.New("redaction target message was sent by someone else") + errUnreactTargetSentBySomeoneElse = errors.New("redaction target reaction was sent by someone else") + errReactionTargetNotFound = errors.New("reaction target message not found") + errEditUnknownTarget = errors.New("unknown edit target message") + errFailedToGetEditTarget = errors.New("failed to get edit target message") + errEditDifferentSender = errors.New("can't edit message sent by another user") + errEditTooOld = errors.New("message is too old to be edited") + + errMessageTakingLong = errors.New("bridging the message is taking longer than usual") + errTimeoutBeforeHandling = errors.New("message timed out before handling was started") +) + +func errorToStatusReason(err error) (reason event.MessageStatusReason, status event.MessageStatus, isCertain, sendNotice bool, humanMessage string) { + switch { + case errors.Is(err, errUnexpectedParsedContentType), + errors.Is(err, msgconv.ErrUnsupportedMsgType), + errors.Is(err, msgconv.ErrInvalidGeoURI): + return event.MessageStatusUnsupported, event.MessageStatusFail, true, true, "" + case errors.Is(err, errMNoticeDisabled): + return event.MessageStatusUnsupported, event.MessageStatusFail, true, false, "" + case errors.Is(err, errEditDifferentSender), + errors.Is(err, errEditTooOld), + errors.Is(err, errEditUnknownTarget): + return event.MessageStatusUnsupported, event.MessageStatusFail, true, true, err.Error() + case errors.Is(err, errTimeoutBeforeHandling): + return event.MessageStatusTooOld, event.MessageStatusRetriable, true, true, "the message was too old when it reached the bridge, so it was not handled" + case errors.Is(err, context.DeadlineExceeded): + return event.MessageStatusTooOld, event.MessageStatusRetriable, false, true, "handling the message took too long and was cancelled" + case errors.Is(err, errMessageTakingLong): + return event.MessageStatusTooOld, event.MessageStatusPending, false, true, err.Error() + case errors.Is(err, errRedactionTargetNotFound), + errors.Is(err, errReactionTargetNotFound), + errors.Is(err, errRedactionTargetSentBySomeoneElse), + errors.Is(err, errUnreactTargetSentBySomeoneElse): + return event.MessageStatusGenericError, event.MessageStatusFail, true, false, "" + case errors.Is(err, errUserNotConnected): + return event.MessageStatusGenericError, event.MessageStatusRetriable, true, true, "" + case errors.Is(err, errUserNotLoggedIn), + errors.Is(err, errDifferentUser), + errors.Is(err, errRelaybotNotLoggedIn): + return event.MessageStatusGenericError, event.MessageStatusRetriable, true, false, "" + default: + return event.MessageStatusGenericError, event.MessageStatusRetriable, false, true, "" + } +} + +func (portal *Portal) sendErrorMessage(ctx context.Context, evt *event.Event, err error, confirmed bool, editID id.EventID) id.EventID { + if !portal.bridge.Config.Bridge.MessageErrorNotices { + return "" + } + certainty := "may not have been" + if confirmed { + certainty = "was not" + } + var msgType string + switch evt.Type { + case event.EventMessage: + msgType = "message" + case event.EventReaction: + msgType = "reaction" + case event.EventRedaction: + msgType = "redaction" + //case TypeMSC3381PollResponse, TypeMSC3381V2PollResponse: + // msgType = "poll response" + //case TypeMSC3381PollStart: + // msgType = "poll start" + default: + msgType = "unknown event" + } + msg := fmt.Sprintf("\u26a0 Your %s %s bridged: %v", msgType, certainty, err) + if errors.Is(err, errMessageTakingLong) { + msg = fmt.Sprintf("\u26a0 Bridging your %s is taking longer than usual", msgType) + } + content := &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: msg, + } + if editID != "" { + content.SetEdit(editID) + } else { + content.SetReply(evt) + } + resp, err := portal.sendMainIntentMessage(ctx, content) + if err != nil { + portal.log.Err(err).Msg("Failed to send bridging error message") + return "" + } + return resp.EventID +} + +func (portal *Portal) sendStatusEvent(ctx context.Context, evtID, lastRetry id.EventID, err error, deliveredTo *[]id.UserID) { + if !portal.bridge.Config.Bridge.MessageStatusEvents { + return + } + if lastRetry == evtID { + lastRetry = "" + } + intent := portal.bridge.Bot + if !portal.Encrypted { + // Bridge bot isn't present in unencrypted DMs + intent = portal.MainIntent() + } + content := event.BeeperMessageStatusEventContent{ + Network: portal.getBridgeInfoStateKey(), + RelatesTo: event.RelatesTo{ + Type: event.RelReference, + EventID: evtID, + }, + DeliveredToUsers: deliveredTo, + LastRetry: lastRetry, + } + if err == nil { + content.Status = event.MessageStatusSuccess + } else { + content.Reason, content.Status, _, _, content.Message = errorToStatusReason(err) + content.Error = err.Error() + } + _, err = intent.SendMessageEvent(ctx, portal.MXID, event.BeeperMessageStatus, &content) + if err != nil { + portal.log.Err(err).Msg("Failed to send message status event") + } +} + +func (portal *Portal) sendDeliveryReceipt(ctx context.Context, eventID id.EventID) { + if portal.bridge.Config.Bridge.DeliveryReceipts { + err := portal.bridge.Bot.SendReceipt(ctx, portal.MXID, eventID, event.ReceiptTypeRead, nil) + if err != nil { + portal.log.Debug().Err(err).Stringer("event_id", eventID).Msg("Failed to send delivery receipt") + } + } +} + +func (portal *Portal) sendMessageMetrics(ctx context.Context, evt *event.Event, err error, part string, ms *metricSender) { + log := portal.log.With(). + Str("handling_step", part). + Str("event_type", evt.Type.String()). + Stringer("event_id", evt.ID). + Stringer("sender", evt.Sender). + Logger() + if evt.Type == event.EventRedaction { + log = log.With().Stringer("redacts", evt.Redacts).Logger() + } + ctx = log.WithContext(ctx) + + origEvtID := evt.ID + if retryMeta := evt.Content.AsMessage().MessageSendRetry; retryMeta != nil { + origEvtID = retryMeta.OriginalEventID + } + if err != nil { + logEvt := log.Error() + if part == "Ignoring" { + logEvt = log.Debug() + } + logEvt.Err(err).Msg("Sending message metrics for event") + reason, statusCode, isCertain, sendNotice, _ := errorToStatusReason(err) + checkpointStatus := status.ReasonToCheckpointStatus(reason, statusCode) + portal.bridge.SendMessageCheckpoint(evt, status.MsgStepRemote, err, checkpointStatus, ms.getRetryNum()) + if sendNotice { + ms.setNoticeID(portal.sendErrorMessage(ctx, evt, err, isCertain, ms.getNoticeID())) + } + portal.sendStatusEvent(ctx, origEvtID, evt.ID, err, nil) + } else { + log.Debug().Msg("Sending metrics for successfully handled Matrix event") + portal.sendDeliveryReceipt(ctx, evt.ID) + portal.bridge.SendMessageSuccessCheckpoint(evt, status.MsgStepRemote, ms.getRetryNum()) + var deliveredTo *[]id.UserID + if portal.IsPrivateChat() { + deliveredTo = &[]id.UserID{} + } + portal.sendStatusEvent(ctx, origEvtID, evt.ID, nil, deliveredTo) + if prevNotice := ms.popNoticeID(); prevNotice != "" { + _, _ = portal.MainIntent().RedactEvent(ctx, portal.MXID, prevNotice, mautrix.ReqRedact{ + Reason: "error resolved", + }) + } + } + if ms != nil { + log.Debug().Object("timings", ms.timings).Msg("Timings for event") + } +} + +type messageTimings struct { + initReceive time.Duration + decrypt time.Duration + implicitRR time.Duration + portalQueue time.Duration + totalReceive time.Duration + + preproc time.Duration + convert time.Duration + totalSend time.Duration +} + +func niceRound(dur time.Duration) time.Duration { + switch { + case dur < time.Millisecond: + return dur + case dur < time.Second: + return dur.Round(100 * time.Microsecond) + default: + return dur.Round(time.Millisecond) + } +} + +func (mt *messageTimings) MarshalZerologObject(evt *zerolog.Event) { + evt. + Dict("bridge", zerolog.Dict(). + Str("init_receive", niceRound(mt.initReceive).String()). + Str("decrypt", niceRound(mt.decrypt).String()). + Str("queue", niceRound(mt.portalQueue).String()). + Str("total_hs_to_portal", niceRound(mt.totalReceive).String())). + Dict("portal", zerolog.Dict(). + Str("implicit_rr", niceRound(mt.implicitRR).String()). + Str("preproc", niceRound(mt.preproc).String()). + Str("convert", niceRound(mt.convert).String()). + Str("total_send", niceRound(mt.totalSend).String())) +} + +type metricSender struct { + portal *Portal + previousNotice id.EventID + lock sync.Mutex + completed bool + retryNum int + timings *messageTimings + ctx context.Context +} + +func (ms *metricSender) getRetryNum() int { + if ms != nil { + return ms.retryNum + } + return 0 +} + +func (ms *metricSender) getNoticeID() id.EventID { + if ms == nil { + return "" + } + return ms.previousNotice +} + +func (ms *metricSender) popNoticeID() id.EventID { + if ms == nil { + return "" + } + evtID := ms.previousNotice + ms.previousNotice = "" + return evtID +} + +func (ms *metricSender) setNoticeID(evtID id.EventID) { + if ms != nil && ms.previousNotice == "" { + ms.previousNotice = evtID + } +} + +func (ms *metricSender) sendMessageMetrics(evt *event.Event, err error, part string, completed bool) { + ms.lock.Lock() + defer ms.lock.Unlock() + if !completed && ms.completed { + return + } + ms.portal.sendMessageMetrics(ms.ctx, evt, err, part, ms) + ms.retryNum++ + ms.completed = completed +} diff --git a/metrics.go b/metrics.go new file mode 100644 index 0000000..783a6ad --- /dev/null +++ b/metrics.go @@ -0,0 +1,315 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Element +// +// 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 main + +import ( + "context" + "net/http" + "runtime/debug" + "strconv" + "sync" + "time" + + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" + "github.com/prometheus/client_golang/prometheus/promhttp" + log "maunium.net/go/maulogger/v2" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/database" +) + +type MetricsHandler struct { + db *database.Database + server *http.Server + log log.Logger + + running bool + ctx context.Context + stopRecorder func() + + matrixEventHandling *prometheus.HistogramVec + signalMessageAge prometheus.Histogram + signalMessageHandling *prometheus.HistogramVec + countCollection prometheus.Histogram + disconnections *prometheus.CounterVec + incomingRetryReceipts *prometheus.CounterVec + connectionFailures *prometheus.CounterVec + puppetCount prometheus.Gauge + userCount prometheus.Gauge + messageCount prometheus.Gauge + portalCount *prometheus.GaugeVec + encryptedGroupCount prometheus.Gauge + encryptedPrivateCount prometheus.Gauge + unencryptedGroupCount prometheus.Gauge + unencryptedPrivateCount prometheus.Gauge + + connected prometheus.Gauge + connectedState map[string]bool + connectedStateLock sync.Mutex + loggedIn prometheus.Gauge + loggedInState map[string]bool + loggedInStateLock sync.Mutex +} + +func NewMetricsHandler(address string, log log.Logger, db *database.Database) *MetricsHandler { + portalCount := promauto.NewGaugeVec(prometheus.GaugeOpts{ + Name: "bridge_portals_total", + Help: "Number of portal rooms on Matrix", + }, []string{"type", "encrypted"}) + return &MetricsHandler{ + db: db, + server: &http.Server{Addr: address, Handler: promhttp.Handler()}, + log: log, + running: false, + + matrixEventHandling: promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "matrix_event", + Help: "Time spent processing Matrix events", + }, []string{"event_type"}), + signalMessageAge: promauto.NewHistogram(prometheus.HistogramOpts{ + Name: "remote_event_age", + Help: "Age of messages received from Signal", + Buckets: []float64{1, 2, 3, 5, 7.5, 10, 20, 30, 60}, + }), + signalMessageHandling: promauto.NewHistogramVec(prometheus.HistogramOpts{ + Name: "remote_event", + Help: "Time spent processing Signal messages", + }, []string{"message_type"}), + countCollection: promauto.NewHistogram(prometheus.HistogramOpts{ + Name: "bridge_count_collection", + Help: "Time spent collecting the bridge_*_total metrics", + }), + disconnections: promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "bridge_disconnections", + Help: "Number of times a Matrix user has been disconnected from Signal", + }, []string{"user_id"}), + connectionFailures: promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "bridge_connection_failures", + Help: "Number of times a connection has failed to Signal", + }, []string{"reason"}), + incomingRetryReceipts: promauto.NewCounterVec(prometheus.CounterOpts{ + Name: "bridge_incoming_retry_receipts", + Help: "Number of times a remote Signal user has requested a retry from the bridge. retry_count = 5 is usually the last attempt (and very likely means a failed message)", + }, []string{"retry_count", "message_found"}), + puppetCount: promauto.NewGauge(prometheus.GaugeOpts{ + Name: "bridge_puppets_total", + Help: "Number of Signal users bridged into Matrix", + }), + userCount: promauto.NewGauge(prometheus.GaugeOpts{ + Name: "bridge_users_total", + Help: "Number of Matrix users using the bridge", + }), + messageCount: promauto.NewGauge(prometheus.GaugeOpts{ + Name: "bridge_messages_total", + Help: "Number of messages bridged", + }), + portalCount: portalCount, + encryptedGroupCount: portalCount.With(prometheus.Labels{"type": "group", "encrypted": "true"}), + encryptedPrivateCount: portalCount.With(prometheus.Labels{"type": "private", "encrypted": "true"}), + unencryptedGroupCount: portalCount.With(prometheus.Labels{"type": "group", "encrypted": "false"}), + unencryptedPrivateCount: portalCount.With(prometheus.Labels{"type": "private", "encrypted": "false"}), + + loggedIn: promauto.NewGauge(prometheus.GaugeOpts{ + Name: "bridge_logged_in", + Help: "Bridge users logged into Signal", + }), + loggedInState: make(map[string]bool), + connected: promauto.NewGauge(prometheus.GaugeOpts{ + Name: "bridge_connected", + Help: "Bridge users connected to Signal", + }), + connectedState: make(map[string]bool), + } +} + +func noop() {} + +func (mh *MetricsHandler) TrackMatrixEvent(eventType event.Type) func() { + if !mh.running { + return noop + } + start := time.Now() + return func() { + duration := time.Since(start) + mh.matrixEventHandling. + With(prometheus.Labels{"event_type": eventType.Type}). + Observe(duration.Seconds()) + } +} + +func (mh *MetricsHandler) TrackSignalMessage(timestamp time.Time, messageType string) func() { + if !mh.running { + return noop + } + + start := time.Now() + return func() { + duration := time.Since(start) + mh.signalMessageHandling. + With(prometheus.Labels{"message_type": messageType}). + Observe(duration.Seconds()) + mh.signalMessageAge.Observe(time.Since(timestamp).Seconds()) + } +} + +func (mh *MetricsHandler) TrackDisconnection(userID id.UserID) { + if !mh.running { + return + } + mh.disconnections.With(prometheus.Labels{"user_id": string(userID)}).Inc() +} + +func (mh *MetricsHandler) TrackConnectionFailure(reason string) { + if !mh.running { + return + } + mh.connectionFailures.With(prometheus.Labels{"reason": reason}).Inc() +} + +func (mh *MetricsHandler) TrackRetryReceipt(count int, found bool) { + if !mh.running { + return + } + mh.incomingRetryReceipts.With(prometheus.Labels{ + "retry_count": strconv.Itoa(count), + "message_found": strconv.FormatBool(found), + }).Inc() +} + +func (mh *MetricsHandler) TrackLoginState(signalID string, loggedIn bool) { + if !mh.running { + return + } + mh.loggedInStateLock.Lock() + defer mh.loggedInStateLock.Unlock() + currentVal, ok := mh.loggedInState[signalID] + if !ok || currentVal != loggedIn { + mh.loggedInState[signalID] = loggedIn + if loggedIn { + mh.loggedIn.Inc() + } else { + mh.loggedIn.Dec() + } + } +} + +func (mh *MetricsHandler) TrackConnectionState(signalID string, connected bool) { + if !mh.running { + return + } + mh.connectedStateLock.Lock() + defer mh.connectedStateLock.Unlock() + currentVal, ok := mh.connectedState[signalID] + if !ok || currentVal != connected { + mh.connectedState[signalID] = connected + if connected { + mh.connected.Inc() + } else { + mh.connected.Dec() + } + } +} + +func (mh *MetricsHandler) updateStats() { + start := time.Now() + var puppetCount int + err := mh.db.QueryRow(mh.ctx, "SELECT COUNT(*) FROM puppet").Scan(&puppetCount) + if err != nil { + mh.log.Warnln("Failed to scan number of puppets:", err) + } else { + mh.puppetCount.Set(float64(puppetCount)) + } + + var userCount int + err = mh.db.QueryRow(mh.ctx, `SELECT COUNT(*) FROM "user"`).Scan(&userCount) + if err != nil { + mh.log.Warnln("Failed to scan number of users:", err) + } else { + mh.userCount.Set(float64(userCount)) + } + + var messageCount int + err = mh.db.QueryRow(mh.ctx, "SELECT COUNT(*) FROM message").Scan(&messageCount) + if err != nil { + mh.log.Warnln("Failed to scan number of messages:", err) + } else { + mh.messageCount.Set(float64(messageCount)) + } + + var encryptedGroupCount, encryptedPrivateCount, unencryptedGroupCount, unencryptedPrivateCount int + // TODO Use a more precise way to check if a chat_id is a UUID. + // It should also be compatible with both SQLite & Postgres. + err = mh.db.QueryRow(mh.ctx, ` + SELECT + COUNT(CASE WHEN chat_id NOT LIKE '%-%-%-%-%' AND encrypted THEN 1 END) AS encrypted_group_portals, + COUNT(CASE WHEN chat_id LIKE '%-%-%-%-%' AND encrypted THEN 1 END) AS encrypted_private_portals, + COUNT(CASE WHEN chat_id NOT LIKE '%-%-%-%-%' AND NOT encrypted THEN 1 END) AS unencrypted_group_portals, + COUNT(CASE WHEN chat_id LIKE '%-%-%-%-%' AND NOT encrypted THEN 1 END) AS unencrypted_private_portals + FROM portal WHERE mxid<>'' + `).Scan(&encryptedGroupCount, &encryptedPrivateCount, &unencryptedGroupCount, &unencryptedPrivateCount) + if err != nil { + mh.log.Warnln("Failed to scan number of portals:", err) + } else { + mh.encryptedGroupCount.Set(float64(encryptedGroupCount)) + mh.encryptedPrivateCount.Set(float64(encryptedPrivateCount)) + mh.unencryptedGroupCount.Set(float64(unencryptedGroupCount)) + mh.unencryptedPrivateCount.Set(float64(encryptedPrivateCount)) + } + mh.countCollection.Observe(time.Since(start).Seconds()) +} + +func (mh *MetricsHandler) startUpdatingStats() { + defer func() { + err := recover() + if err != nil { + mh.log.Fatalfln("Panic in metric updater: %v\n%s", err, string(debug.Stack())) + } + }() + ticker := time.Tick(10 * time.Second) + for { + mh.updateStats() + select { + case <-mh.ctx.Done(): + return + case <-ticker: + } + } +} + +func (mh *MetricsHandler) Start() { + mh.running = true + mh.ctx, mh.stopRecorder = context.WithCancel(context.Background()) + go mh.startUpdatingStats() + err := mh.server.ListenAndServe() + mh.running = false + if err != nil && err != http.ErrServerClosed { + mh.log.Fatalln("Error in metrics listener:", err) + } +} + +func (mh *MetricsHandler) Stop() { + if !mh.running { + return + } + mh.stopRecorder() + err := mh.server.Close() + if err != nil { + mh.log.Errorln("Error closing metrics listener:", err) + } +} diff --git a/msgconv/from-matrix.go b/msgconv/from-matrix.go new file mode 100644 index 0000000..fd89cd6 --- /dev/null +++ b/msgconv/from-matrix.go @@ -0,0 +1,192 @@ +// mautrix-signal - A Matrix-Signal puppeting bridge. +// Copyright (C) 2024 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 ( + "context" + "errors" + "fmt" + "time" + + "github.com/rs/zerolog" + "go.mau.fi/util/exerrors" + "go.mau.fi/util/exmime" + "go.mau.fi/util/ffmpeg" + "go.mau.fi/util/variationselector" + "golang.org/x/exp/constraints" + "google.golang.org/protobuf/proto" + "maunium.net/go/mautrix/event" + + "go.mau.fi/mautrix-signal/msgconv/matrixfmt" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" +) + +var ( + ErrUnsupportedMsgType = errors.New("unsupported msgtype") + ErrMediaDownloadFailed = errors.New("failed to download media") + ErrMediaDecryptFailed = errors.New("failed to decrypt media") + ErrMediaConvertFailed = errors.New("failed to convert") + ErrMediaUploadFailed = errors.New("failed to upload media") + ErrInvalidGeoURI = errors.New("invalid `geo:` URI in message") +) + +func (mc *MessageConverter) ToSignal(ctx context.Context, evt *event.Event, content *event.MessageEventContent, relaybotFormatted bool) (*signalpb.DataMessage, error) { + if evt.Type == event.EventSticker { + content.MsgType = event.MessageType(event.EventSticker.Type) + } + + // Matrix timestamps can be faked, but if the user is using their own Signal account, faking timestamps is their problem. + ts := uint64(evt.Timestamp) + // However, when relaying, timestamps shouldn't be trusted because anyone can send a message with any timestamp. + if relaybotFormatted { + ts = uint64(time.Now().UnixMilli()) + } + dm := &signalpb.DataMessage{ + Timestamp: &ts, + Quote: mc.GetSignalReply(ctx, content), + Preview: mc.convertURLPreviewToSignal(ctx, evt), + } + if expirationTime := mc.GetData(ctx).ExpirationTime; expirationTime != 0 { + dm.ExpireTimer = proto.Uint32(uint32(expirationTime)) + } + if content.MsgType == event.MsgEmote && !relaybotFormatted { + content.Body = "/me " + content.Body + if content.FormattedBody != "" { + content.FormattedBody = "/me " + content.FormattedBody + } + } + body, bodyRanges := matrixfmt.Parse(mc.MatrixFmtParams, content) + switch content.MsgType { + case event.MsgText, event.MsgNotice, event.MsgEmote: + dm.Body = proto.String(body) + dm.BodyRanges = bodyRanges + case event.MsgImage, event.MsgVideo, event.MsgAudio, event.MsgFile: + att, err := mc.convertFileToSignal(ctx, evt, content) + if err != nil { + return nil, fmt.Errorf("failed to convert attachment: %w", err) + } + if content.FileName != "" && (content.FileName != content.Body || content.Format == event.FormatHTML) { + dm.Body = proto.String(body) + dm.BodyRanges = bodyRanges + } + dm.Attachments = []*signalpb.AttachmentPointer{att} + case event.MessageType(event.EventSticker.Type): + if content.FileName == "" { + content.FileName = "sticker" + exmime.ExtensionFromMimetype(content.Info.MimeType) + } + att, err := mc.convertFileToSignal(ctx, evt, content) + if err != nil { + return nil, fmt.Errorf("failed to convert sticker: %w", err) + } + att.Flags = proto.Uint32(uint32(signalpb.AttachmentPointer_BORDERLESS)) + 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, + } + case event.MsgLocation: + // TODO implement + fallthrough + default: + return nil, fmt.Errorf("%w %s", ErrUnsupportedMsgType, content.MsgType) + } + return dm, nil +} + +func maybeInt[T constraints.Integer](v T) *T { + if v == 0 { + return nil + } + return &v +} + +func (mc *MessageConverter) convertFileToSignal(ctx context.Context, evt *event.Event, content *event.MessageEventContent) (*signalpb.AttachmentPointer, error) { + log := zerolog.Ctx(ctx) + mxc := content.URL + if content.File != nil { + mxc = content.File.URL + } + data, err := mc.DownloadMatrixMedia(ctx, mxc) + if err != nil { + return nil, exerrors.NewDualError(ErrMediaDownloadFailed, err) + } + if content.File != nil { + err = content.File.DecryptInPlace(data) + if err != nil { + return nil, exerrors.NewDualError(ErrMediaDecryptFailed, err) + } + } + fileName := content.Body + if content.FileName != "" { + fileName = content.FileName + } + _, isVoice := evt.Content.Raw["org.matrix.msc3245.voice"] + mime := content.GetInfo().MimeType + if isVoice { + data, err = ffmpeg.ConvertBytes(ctx, data, ".m4a", []string{}, []string{"-c:a", "aac"}, mime) + if err != nil { + return nil, err + } + mime = "audio/aac" + fileName += ".m4a" + } else if evt.Type == event.EventSticker && mime != "image/webp" && mime != "image/png" && mime != "image/apng" { + switch mime { + case "image/webp", "image/png", "image/apng": + // allowed + case "image/gif": + if !mc.ConvertGIFToAPNG { + return nil, fmt.Errorf("converting gif stickers is not supported") + } + data, err = ffmpeg.ConvertBytes(ctx, data, ".apng", []string{}, []string{}, mime) + if err != nil { + return nil, fmt.Errorf("%w gif to apng: %w", ErrMediaConvertFailed, err) + } + fileName += ".apng" + mime = "image/apng" + default: + return nil, fmt.Errorf("unsupported content type for sticker %s", mime) + } + } + att, err := mc.GetClient(ctx).UploadAttachment(ctx, data) + if err != nil { + log.Err(err).Msg("Failed to upload file") + return nil, exerrors.NewDualError(ErrMediaUploadFailed, err) + } + if isVoice { + att.Flags = proto.Uint32(uint32(signalpb.AttachmentPointer_VOICE_MESSAGE)) + } + att.ContentType = proto.String(mime) + att.FileName = &fileName + att.Height = maybeInt(uint32(content.Info.Height)) + att.Width = maybeInt(uint32(content.Info.Width)) + if content.Info.Blurhash != "" { + att.BlurHash = proto.String(content.Info.Blurhash) + } else if content.Info.AnoaBlurhash != "" { + att.BlurHash = proto.String(content.Info.AnoaBlurhash) + } + return att, nil +} diff --git a/msgconv/from-signal.go b/msgconv/from-signal.go new file mode 100644 index 0000000..e73ea0f --- /dev/null +++ b/msgconv/from-signal.go @@ -0,0 +1,492 @@ +// mautrix-signal - A Matrix-Signal puppeting bridge. +// Copyright (C) 2024 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/base64" + "fmt" + "net/http" + "strings" + "time" + + "github.com/emersion/go-vcard" + "github.com/rs/zerolog" + "go.mau.fi/util/exfmt" + "go.mau.fi/util/exmime" + "go.mau.fi/util/ffmpeg" + "golang.org/x/exp/slices" + "maunium.net/go/mautrix/crypto/attachment" + "maunium.net/go/mautrix/event" + + "go.mau.fi/mautrix-signal/msgconv/signalfmt" + "go.mau.fi/mautrix-signal/pkg/signalmeow" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" +) + +type ConvertedMessage struct { + Parts []*ConvertedMessagePart + Timestamp uint64 + DisappearIn uint32 +} + +func (cm *ConvertedMessage) MergeCaption() { + if len(cm.Parts) != 2 || cm.Parts[1].Content.MsgType != event.MsgText { + return + } + switch cm.Parts[0].Content.MsgType { + case event.MsgImage, event.MsgVideo, event.MsgAudio, event.MsgFile: + default: + return + } + mediaContent := cm.Parts[0].Content + textContent := cm.Parts[1].Content + mediaContent.FileName = mediaContent.Body + mediaContent.Body = textContent.Body + mediaContent.Format = textContent.Format + mediaContent.FormattedBody = textContent.FormattedBody + cm.Parts = cm.Parts[:1] +} + +type ConvertedMessagePart struct { + Type event.Type + Content *event.MessageEventContent + Extra map[string]any +} + +func calculateLength(dm *signalpb.DataMessage) int { + if dm.GetFlags()&uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE) != 0 { + return 1 + } + if dm.Sticker != nil { + return 1 + } + length := len(dm.Attachments) + len(dm.Contact) + if dm.Body != nil { + length++ + } + if dm.Payment != nil { + length++ + } + if dm.GiftBadge != nil { + length++ + } + if length == 0 && dm.GetRequiredProtocolVersion() > uint32(signalpb.DataMessage_CURRENT) { + length = 1 + } + return length +} + +func CanConvertSignal(dm *signalpb.DataMessage) bool { + return calculateLength(dm) > 0 +} + +func (mc *MessageConverter) ToMatrix(ctx context.Context, dm *signalpb.DataMessage) *ConvertedMessage { + cm := &ConvertedMessage{ + Timestamp: dm.GetTimestamp(), + DisappearIn: dm.GetExpireTimer(), + Parts: make([]*ConvertedMessagePart, 0, calculateLength(dm)), + } + if dm.GetFlags()&uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE) != 0 { + cm.Parts = append(cm.Parts, mc.ConvertDisappearingTimerChangeToMatrix(ctx, dm.GetExpireTimer(), true)) + // Don't disappear disappearing timer changes + cm.DisappearIn = 0 + // Don't allow any other parts in a disappearing timer change message + return cm + } + if dm.Sticker != nil { + cm.Parts = append(cm.Parts, mc.convertStickerToMatrix(ctx, dm.Sticker)) + // Don't allow any other parts in a sticker message + return cm + } + for i, att := range dm.GetAttachments() { + cm.Parts = append(cm.Parts, mc.convertAttachmentToMatrix(ctx, i, att)) + } + for _, contact := range dm.GetContact() { + cm.Parts = append(cm.Parts, mc.convertContactToMatrix(ctx, contact)) + } + if dm.Payment != nil { + cm.Parts = append(cm.Parts, mc.convertPaymentToMatrix(ctx, dm.Payment)) + } + if dm.GiftBadge != nil { + cm.Parts = append(cm.Parts, mc.convertGiftBadgeToMatrix(ctx, dm.GiftBadge)) + } + if dm.Body != nil { + cm.Parts = append(cm.Parts, mc.convertTextToMatrix(ctx, dm)) + } + if len(cm.Parts) == 0 && dm.GetRequiredProtocolVersion() > uint32(signalpb.DataMessage_CURRENT) { + cm.Parts = append(cm.Parts, &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: "The bridge does not support this message type yet.", + }, + }) + } + replyTo, sender := mc.GetMatrixReply(ctx, dm.Quote) + for _, part := range cm.Parts { + if part.Content.Mentions == nil { + part.Content.Mentions = &event.Mentions{} + } + if replyTo != "" { + part.Content.RelatesTo = (&event.RelatesTo{}).SetReplyTo(replyTo) + if !slices.Contains(part.Content.Mentions.UserIDs, sender) { + part.Content.Mentions.UserIDs = append(part.Content.Mentions.UserIDs, sender) + } + } + } + return cm +} + +func (mc *MessageConverter) ConvertDisappearingTimerChangeToMatrix(ctx context.Context, timer uint32, updatePortal bool) *ConvertedMessagePart { + part := &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: fmt.Sprintf("Disappearing messages set to %s", exfmt.Duration(time.Duration(timer)*time.Second)), + }, + } + if timer == 0 { + part.Content.Body = "Disappearing messages disabled" + } + if updatePortal { + portal := mc.GetData(ctx) + portal.ExpirationTime = timer + err := portal.Update(ctx) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to update portal disappearing timer in database") + } + } + return part +} + +func (mc *MessageConverter) convertTextToMatrix(ctx context.Context, dm *signalpb.DataMessage) *ConvertedMessagePart { + content := signalfmt.Parse(dm.GetBody(), dm.GetBodyRanges(), mc.SignalFmtParams) + extra := map[string]any{} + if len(dm.Preview) > 0 { + extra["com.beeper.linkpreviews"] = mc.convertURLPreviewsToBeeper(ctx, dm.Preview) + } + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: content, + Extra: extra, + } +} + +func (mc *MessageConverter) convertPaymentToMatrix(ctx context.Context, payment *signalpb.DataMessage_Payment) *ConvertedMessagePart { + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: "Payments are not yet supported", + }, + Extra: map[string]any{ + "fi.mau.signal.payment": payment, + }, + } +} + +func (mc *MessageConverter) convertGiftBadgeToMatrix(ctx context.Context, giftBadge *signalpb.DataMessage_GiftBadge) *ConvertedMessagePart { + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: "Gift badges are not yet supported", + }, + Extra: map[string]any{ + "fi.mau.signal.gift_badge": giftBadge, + }, + } +} + +func (mc *MessageConverter) convertContactToVCard(ctx context.Context, contact *signalpb.DataMessage_Contact) vcard.Card { + card := make(vcard.Card) + card.SetValue(vcard.FieldVersion, "4.0") + name := contact.GetName() + if name.GetFamilyName() != "" || name.GetGivenName() != "" { + card.SetName(&vcard.Name{ + FamilyName: name.GetFamilyName(), + GivenName: name.GetGivenName(), + AdditionalName: name.GetMiddleName(), + HonorificPrefix: name.GetPrefix(), + HonorificSuffix: name.GetSuffix(), + }) + } + if name.GetDisplayName() != "" { + card.SetValue(vcard.FieldFormattedName, name.GetDisplayName()) + } + if contact.GetOrganization() != "" { + card.SetValue(vcard.FieldOrganization, contact.GetOrganization()) + } + for _, addr := range contact.GetAddress() { + field := vcard.Field{ + Value: strings.Join([]string{ + addr.GetPobox(), + "", // extended address, + addr.GetStreet(), + addr.GetCity(), + addr.GetRegion(), + addr.GetPostcode(), + addr.GetCountry(), + // TODO put neighborhood somewhere? + }, ";"), + Params: make(vcard.Params), + } + if addr.GetLabel() != "" { + field.Params.Set("LABEL", addr.GetLabel()) + } + field.Params.Set(vcard.ParamType, strings.ToLower(addr.GetType().String())) + card.Add(vcard.FieldAddress, &field) + } + for _, email := range contact.GetEmail() { + field := vcard.Field{ + Value: email.GetValue(), + Params: make(vcard.Params), + } + field.Params.Set(vcard.ParamType, strings.ToLower(email.GetType().String())) + if email.GetLabel() != "" { + field.Params.Set("LABEL", email.GetLabel()) + } + card.Add(vcard.FieldEmail, &field) + } + for _, phone := range contact.GetNumber() { + field := vcard.Field{ + Value: phone.GetValue(), + Params: make(vcard.Params), + } + field.Params.Set(vcard.ParamType, strings.ToLower(phone.GetType().String())) + if phone.GetLabel() != "" { + field.Params.Set("LABEL", phone.GetLabel()) + } + card.Add(vcard.FieldTelephone, &field) + } + if contact.GetAvatar().GetAvatar() != nil { + avatarData, err := signalmeow.DownloadAttachment(ctx, contact.GetAvatar().GetAvatar()) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to download contact avatar") + } else { + mimeType := contact.GetAvatar().GetAvatar().GetContentType() + if mimeType == "" { + mimeType = http.DetectContentType(avatarData) + } + card.SetValue(vcard.FieldPhoto, fmt.Sprintf("data:%s;base64,%s", mimeType, base64.StdEncoding.EncodeToString(avatarData))) + } + } + return card +} + +func (mc *MessageConverter) convertContactToMatrix(ctx context.Context, contact *signalpb.DataMessage_Contact) *ConvertedMessagePart { + card := mc.convertContactToVCard(ctx, contact) + contact.Avatar = nil + extraData := map[string]any{ + "fi.mau.signal.contact": contact, + } + var buf bytes.Buffer + err := vcard.NewEncoder(&buf).Encode(card) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to encode vCard") + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: "Failed to encode vCard", + }, + Extra: extraData, + } + } + data := buf.Bytes() + var file *event.EncryptedFileInfo + uploadMime := "text/vcard" + uploadFileName := "contact.vcf" + if mc.GetData(ctx).Encrypted { + file = &event.EncryptedFileInfo{ + EncryptedFile: *attachment.NewEncryptedFile(), + URL: "", + } + file.EncryptInPlace(data) + uploadMime = "application/octet-stream" + uploadFileName = "" + } + mxc, err := mc.UploadMatrixMedia(ctx, data, uploadFileName, uploadMime) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to upload vCard") + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: "Failed to upload vCard", + }, + Extra: extraData, + } + } + displayName := contact.GetName().GetDisplayName() + if displayName == "" { + displayName = contact.GetName().GetGivenName() + if contact.GetName().GetFamilyName() != "" { + if displayName != "" { + displayName += " " + } + displayName += contact.GetName().GetFamilyName() + } + } + if displayName == "" { + displayName = "contact" + } + content := &event.MessageEventContent{ + MsgType: event.MsgFile, + Body: displayName + ".vcf", + Info: &event.FileInfo{ + MimeType: "text/vcf", + Size: len(data), + }, + } + if file != nil { + file.URL = mxc + content.File = file + } else { + content.URL = mxc + } + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: content, + Extra: extraData, + } +} + +func (mc *MessageConverter) convertAttachmentToMatrix(ctx context.Context, index int, att *signalpb.AttachmentPointer) *ConvertedMessagePart { + part, err := mc.reuploadAttachment(ctx, att) + if err != nil { + zerolog.Ctx(ctx).Err(err).Int("attachment_index", index).Msg("Failed to handle attachment") + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: fmt.Sprintf("Failed to handle attachment %s: %v", att.GetFileName(), err), + }, + } + } + return part +} + +func (mc *MessageConverter) convertStickerToMatrix(ctx context.Context, sticker *signalpb.DataMessage_Sticker) *ConvertedMessagePart { + converted, err := mc.reuploadAttachment(ctx, sticker.GetData()) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to handle sticker") + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: &event.MessageEventContent{ + MsgType: event.MsgNotice, + Body: fmt.Sprintf("Failed to handle sticker: %v", err), + }, + } + } + // 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 = 256 + converted.Content.Info.Height = 256 + } + converted.Content.Body = sticker.GetEmoji() + converted.Type = event.EventSticker + converted.Content.MsgType = "" + // 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) reuploadAttachment(ctx context.Context, att *signalpb.AttachmentPointer) (*ConvertedMessagePart, error) { + data, err := signalmeow.DownloadAttachment(ctx, att) + if err != nil { + return nil, fmt.Errorf("failed to download attachment: %w", err) + } + mimeType := att.GetContentType() + if mimeType == "" { + mimeType = http.DetectContentType(data) + } + fileName := att.GetFileName() + extra := map[string]any{} + if mc.ConvertVoiceMessages && att.GetFlags()&uint32(signalpb.AttachmentPointer_VOICE_MESSAGE) != 0 { + 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" + extra["org.matrix.msc3245.voice"] = map[string]any{} + extra["org.matrix.msc1767.audio"] = map[string]any{} + } + var file *event.EncryptedFileInfo + uploadMime := mimeType + uploadFileName := fileName + if mc.GetData(ctx).Encrypted { + file = &event.EncryptedFileInfo{ + EncryptedFile: *attachment.NewEncryptedFile(), + URL: "", + } + file.EncryptInPlace(data) + uploadMime = "application/octet-stream" + uploadFileName = "" + } + mxc, err := mc.UploadMatrixMedia(ctx, data, uploadFileName, uploadMime) + if err != nil { + return nil, err + } + content := &event.MessageEventContent{ + Body: fileName, + Info: &event.FileInfo{ + MimeType: mimeType, + Width: int(att.GetWidth()), + Height: int(att.GetHeight()), + Size: len(data), + }, + } + if att.GetBlurHash() != "" { + content.Info.Blurhash = att.GetBlurHash() + content.Info.AnoaBlurhash = att.GetBlurHash() + } + switch strings.Split(mimeType, "/")[0] { + case "image": + content.MsgType = event.MsgImage + case "video": + content.MsgType = event.MsgVideo + case "audio": + content.MsgType = event.MsgAudio + default: + content.MsgType = event.MsgFile + } + if content.Body == "" { + content.Body = strings.TrimPrefix(string(content.MsgType), "m.") + exmime.ExtensionFromMimetype(mimeType) + } + if file != nil { + file.URL = mxc + content.File = file + } else { + content.URL = mxc + } + return &ConvertedMessagePart{ + Type: event.EventMessage, + Content: content, + Extra: extra, + }, nil +} diff --git a/pkg/msgconv/matrixfmt/convert.go b/msgconv/matrixfmt/convert.go similarity index 78% rename from pkg/msgconv/matrixfmt/convert.go rename to msgconv/matrixfmt/convert.go index ddc5cba..8e20e52 100644 --- a/pkg/msgconv/matrixfmt/convert.go +++ b/msgconv/matrixfmt/convert.go @@ -17,20 +17,18 @@ package matrixfmt import ( - "context" - "maunium.net/go/mautrix/event" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" ) -func Parse(ctx context.Context, parser *HTMLParser, content *event.MessageEventContent) (string, []*signalpb.BodyRange) { +func Parse(parser *HTMLParser, content *event.MessageEventContent) (string, []*signalpb.BodyRange) { if content.Format != event.FormatHTML { return content.Body, nil } - parseCtx := NewContext(ctx) - parseCtx.AllowedMentions = content.Mentions - parsed := parser.Parse(content.FormattedBody, parseCtx) + ctx := NewContext() + ctx.AllowedMentions = content.Mentions + parsed := parser.Parse(content.FormattedBody, ctx) if parsed == nil { return "", nil } diff --git a/pkg/msgconv/matrixfmt/convert_test.go b/msgconv/matrixfmt/convert_test.go similarity index 73% rename from pkg/msgconv/matrixfmt/convert_test.go rename to msgconv/matrixfmt/convert_test.go index 5e243e3..0ee2514 100644 --- a/pkg/msgconv/matrixfmt/convert_test.go +++ b/msgconv/matrixfmt/convert_test.go @@ -1,7 +1,6 @@ package matrixfmt_test import ( - "context" "fmt" "testing" @@ -10,12 +9,12 @@ import ( "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" - "go.mau.fi/mautrix-signal/pkg/msgconv/matrixfmt" - "go.mau.fi/mautrix-signal/pkg/msgconv/signalfmt" + "go.mau.fi/mautrix-signal/msgconv/matrixfmt" + "go.mau.fi/mautrix-signal/msgconv/signalfmt" ) var formatParams = &matrixfmt.HTMLParser{ - GetUUIDFromMXID: func(_ context.Context, id id.UserID) uuid.UUID { + GetUUIDFromMXID: func(id id.UserID) uuid.UUID { if id.Homeserver() == "signal" { return uuid.MustParse(id.Localpart()) } @@ -24,7 +23,7 @@ var formatParams = &matrixfmt.HTMLParser{ } func TestParse_Empty(t *testing.T) { - text, entities := matrixfmt.Parse(context.TODO(), formatParams, &event.MessageEventContent{ + text, entities := matrixfmt.Parse(formatParams, &event.MessageEventContent{ MsgType: event.MsgText, Body: "", }) @@ -33,7 +32,7 @@ func TestParse_Empty(t *testing.T) { } func TestParse_EmptyHTML(t *testing.T) { - text, entities := matrixfmt.Parse(context.TODO(), formatParams, &event.MessageEventContent{ + text, entities := matrixfmt.Parse(formatParams, &event.MessageEventContent{ MsgType: event.MsgText, Body: "", Format: event.FormatHTML, @@ -44,7 +43,7 @@ func TestParse_EmptyHTML(t *testing.T) { } func TestParse_Plaintext(t *testing.T) { - text, entities := matrixfmt.Parse(context.TODO(), formatParams, &event.MessageEventContent{ + text, entities := matrixfmt.Parse(formatParams, &event.MessageEventContent{ MsgType: event.MsgText, Body: "Hello world!", }) @@ -65,13 +64,6 @@ func TestParse_HTML(t *testing.T) { Length: 5, Value: signalfmt.StyleBold, }}}, - {name: "UnnecessaryWhitespace", in: " Hello , World!", out: "Hello, World!", ent: signalfmt.BodyRangeList{{ - Start: 0, - Length: 5, - Value: signalfmt.StyleBold, - }}}, - {name: "UnnecessaryWhitespaceParagraph", in: "

Hello

", out: "Hello"}, - {name: "EmptyParagraph", in: "

Hello

", out: "Hello"}, { name: "MultiBasic", in: "Hello, World!", @@ -111,13 +103,22 @@ func TestParse_HTML(t *testing.T) { { name: "List", in: "
  • woof
  • meow
  • hmm\nmeow
  • meow

    meow

", - out: "* woof\n* meow\n* ```\n hmm\n meow\n ```\n* > meow\n > \n > # meow", + out: "* woof\n* meow\n* hmm\n meow\n* > meow\n > \n > # meow", ent: signalfmt.BodyRangeList{{ Start: 9, Length: 4, Value: signalfmt.StyleBold, }, { - Start: 57, + Start: 16, + Length: 3, + Value: signalfmt.StyleMonospace, + }, { + // FIXME optimally this would be a single range with the previous one so the indent is also monospace + Start: 22, + Length: 4, + Value: signalfmt.StyleMonospace, + }, { + Start: 45, Length: 6, Value: signalfmt.StyleBold, }}, @@ -125,13 +126,21 @@ func TestParse_HTML(t *testing.T) { { name: "OrderedList", in: "
  1. woof
  2. meow
  3. hmm\nmeow
  4. meow

    meow

", - out: "9. woof\n10. meow\n11. ```\n hmm\n meow\n ```\n12. > meow\n > \n > # meow", + out: "9. woof\n10. meow\n11. hmm\n meow\n12. > meow\n > \n > # meow", ent: signalfmt.BodyRangeList{{ Start: 13, Length: 4, Value: signalfmt.StyleBold, }, { - Start: 75, + Start: 22, + Length: 3, + Value: signalfmt.StyleMonospace, + }, { + Start: 30, + Length: 4, + Value: signalfmt.StyleMonospace, + }, { + Start: 59, Length: 6, Value: signalfmt.StyleBold, }}, @@ -143,7 +152,7 @@ func TestParse_HTML(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { fmt.Println("--------------------------------------------------------------------------------") - parsed := formatParams.Parse(test.in, matrixfmt.NewContext(context.TODO())) + parsed := formatParams.Parse(test.in, matrixfmt.NewContext()) assert.Equal(t, test.out, parsed.String.String()) assert.Equal(t, test.ent, parsed.Entities) }) diff --git a/pkg/msgconv/matrixfmt/html.go b/msgconv/matrixfmt/html.go similarity index 94% rename from pkg/msgconv/matrixfmt/html.go rename to msgconv/matrixfmt/html.go index b60c0ad..88dc975 100644 --- a/pkg/msgconv/matrixfmt/html.go +++ b/msgconv/matrixfmt/html.go @@ -1,19 +1,18 @@ package matrixfmt import ( - "context" "fmt" "math" - "slices" "strconv" "strings" "github.com/google/uuid" + "golang.org/x/exp/slices" "golang.org/x/net/html" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" - "go.mau.fi/mautrix-signal/pkg/msgconv/signalfmt" + "go.mau.fi/mautrix-signal/msgconv/signalfmt" ) type EntityString struct { @@ -81,26 +80,22 @@ func (es *EntityString) TrimSpace() *EntityString { return nil } DebugLog("TRIMSPACE %q %+v\n", es.String, es.Entities) - cutStart := 0 - for ; cutStart < len(es.String); cutStart++ { + var cutEnd, cutStart int + for cutStart = 0; cutStart < len(es.String); cutStart++ { switch es.String[cutStart] { case '\t', '\n', '\v', '\f', '\r', ' ', 0x85, 0xA0: continue } break } - cutEnd := len(es.String) - for ; cutEnd > cutStart; cutEnd-- { - switch es.String[cutEnd-1] { + for cutEnd = len(es.String) - 1; cutEnd >= 0; cutEnd-- { + switch es.String[cutEnd] { case '\t', '\n', '\v', '\f', '\r', ' ', 0x85, 0xA0: continue } break } - if cutEnd == cutStart { - DebugLog(" -> EMPTY\n") - return NewEntityString("") - } + cutEnd++ if cutStart == 0 && cutEnd == len(es.String) { DebugLog(" -> NOOP\n") return es @@ -206,15 +201,13 @@ func (ts TagStack) Has(tag string) bool { } type Context struct { - Ctx context.Context AllowedMentions *event.Mentions TagStack TagStack PreserveWhitespace bool } -func NewContext(ctx context.Context) Context { +func NewContext() Context { return Context{ - Ctx: ctx, TagStack: make(TagStack, 0, 4), } } @@ -231,7 +224,7 @@ func (ctx Context) WithWhitespace() Context { // HTMLParser is a somewhat customizable Matrix HTML parser. type HTMLParser struct { - GetUUIDFromMXID func(context.Context, id.UserID) uuid.UUID + GetUUIDFromMXID func(id.UserID) uuid.UUID } // TaggedString is a string that also contains a HTML tag. @@ -362,7 +355,7 @@ func (parser *HTMLParser) linkToString(node *html.Node, ctx Context) *EntityStri // Mention not allowed, use name as-is return str } - u := parser.GetUUIDFromMXID(ctx.Ctx, mxid) + u := parser.GetUUIDFromMXID(mxid) if u == uuid.Nil { // Don't include the link for mentions of non-Signal users, the name is enough return str @@ -404,17 +397,17 @@ func (parser *HTMLParser) tagToString(node *html.Node, ctx Context) *EntityStrin return NewEntityString("---") case "pre": var preStr *EntityString - var language string + //var language string if node.FirstChild != nil && node.FirstChild.Type == html.ElementNode && node.FirstChild.Data == "code" { - class := parser.getAttribute(node.FirstChild, "class") - if strings.HasPrefix(class, "language-") { - language = class[len("language-"):] - } + //class := parser.getAttribute(node.FirstChild, "class") + //if strings.HasPrefix(class, "language-") { + // language = class[len("language-"):] + //} preStr = parser.nodeToString(node.FirstChild.FirstChild, ctx.WithWhitespace()) } else { preStr = parser.nodeToString(node.FirstChild, ctx.WithWhitespace()) } - return NewEntityString(fmt.Sprintf("```%s\n", language)).Append(preStr).AppendString("\n```") + return preStr.Format(signalfmt.StyleMonospace) default: return parser.nodeToTagAwareString(node.FirstChild, ctx) } diff --git a/msgconv/msgconv.go b/msgconv/msgconv.go new file mode 100644 index 0000000..4e926ed --- /dev/null +++ b/msgconv/msgconv.go @@ -0,0 +1,62 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2024 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 ( + "context" + + "github.com/google/uuid" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/database" + "go.mau.fi/mautrix-signal/msgconv/matrixfmt" + "go.mau.fi/mautrix-signal/msgconv/signalfmt" + "go.mau.fi/mautrix-signal/pkg/signalmeow" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" +) + +type PortalMethods interface { + UploadMatrixMedia(ctx context.Context, data []byte, fileName, contentType string) (id.ContentURIString, error) + DownloadMatrixMedia(ctx context.Context, uri id.ContentURIString) ([]byte, error) + GetMatrixReply(ctx context.Context, msg *signalpb.DataMessage_Quote) (replyTo id.EventID, replyTargetSender id.UserID) + GetSignalReply(ctx context.Context, content *event.MessageEventContent) *signalpb.DataMessage_Quote + + GetClient(ctx context.Context) *signalmeow.Client + + GetData(ctx context.Context) *database.Portal +} + +type ExtendedPortalMethods interface { + QueueFileTransfer(ctx context.Context, msgTS uint64, fileName string, ap *signalpb.AttachmentPointer) (id.ContentURIString, error) +} + +type MessageConverter struct { + PortalMethods + + SignalFmtParams *signalfmt.FormatParams + MatrixFmtParams *matrixfmt.HTMLParser + + ConvertVoiceMessages bool + ConvertGIFToAPNG bool + MaxFileSize int64 + AsyncFiles bool +} + +func (mc *MessageConverter) IsPrivateChat(ctx context.Context) bool { + return mc.GetData(ctx).UserID() != uuid.Nil +} diff --git a/pkg/msgconv/signalfmt/convert.go b/msgconv/signalfmt/convert.go similarity index 77% rename from pkg/msgconv/signalfmt/convert.go rename to msgconv/signalfmt/convert.go index d237703..317374d 100644 --- a/pkg/msgconv/signalfmt/convert.go +++ b/msgconv/signalfmt/convert.go @@ -17,18 +17,16 @@ package signalfmt import ( - "context" "html" - "slices" "strings" "github.com/google/uuid" - "github.com/rs/zerolog" "golang.org/x/exp/maps" + "golang.org/x/exp/slices" "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" ) type UserInfo struct { @@ -37,7 +35,7 @@ type UserInfo struct { } type FormatParams struct { - GetUserInfo func(ctx context.Context, uuid uuid.UUID) UserInfo + GetUserInfo func(uuid uuid.UUID) UserInfo } type formatContext struct { @@ -51,7 +49,7 @@ func (ctx formatContext) TextToHTML(text string) string { return event.TextToHTML(text) } -func Parse(ctx context.Context, message string, ranges []*signalpb.BodyRange, params *FormatParams) *event.MessageEventContent { +func Parse(message string, ranges []*signalpb.BodyRange, params *FormatParams) *event.MessageEventContent { content := &event.MessageEventContent{ MsgType: event.MsgText, Body: message, @@ -86,30 +84,15 @@ func Parse(ctx context.Context, message string, ranges []*signalpb.BodyRange, pa Start: int(*r.Start), Length: int(*r.Length), }.TruncateEnd(maxLength) - if br.Start >= maxLength { - continue - } - 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(parsed) if userInfo.MXID == "" { continue } @@ -118,7 +101,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/convert_test.go b/msgconv/signalfmt/convert_test.go similarity index 95% rename from pkg/msgconv/signalfmt/convert_test.go rename to msgconv/signalfmt/convert_test.go index ac9f201..eaed12d 100644 --- a/pkg/msgconv/signalfmt/convert_test.go +++ b/msgconv/signalfmt/convert_test.go @@ -17,7 +17,6 @@ package signalfmt_test import ( - "context" "testing" "github.com/google/uuid" @@ -26,15 +25,15 @@ import ( "maunium.net/go/mautrix/event" "maunium.net/go/mautrix/id" - "go.mau.fi/mautrix-signal/pkg/msgconv/signalfmt" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + "go.mau.fi/mautrix-signal/msgconv/signalfmt" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" ) var realUser = uuid.New() func TestParse(t *testing.T) { formatParams := &signalfmt.FormatParams{ - GetUserInfo: func(ctx context.Context, uuid uuid.UUID) signalfmt.UserInfo { + GetUserInfo: func(uuid uuid.UUID) signalfmt.UserInfo { if uuid == realUser { return signalfmt.UserInfo{ MXID: "@test:example.com", @@ -169,7 +168,7 @@ func TestParse(t *testing.T) { } for _, test := range tests { t.Run(test.name, func(t *testing.T) { - parsed := signalfmt.Parse(context.TODO(), test.ins, test.ine, formatParams) + parsed := signalfmt.Parse(test.ins, test.ine, formatParams) assert.Equal(t, test.body, parsed.Body) assert.Equal(t, test.html, parsed.FormattedBody) }) diff --git a/pkg/msgconv/signalfmt/html.go b/msgconv/signalfmt/html.go similarity index 100% rename from pkg/msgconv/signalfmt/html.go rename to msgconv/signalfmt/html.go diff --git a/pkg/msgconv/signalfmt/tags.go b/msgconv/signalfmt/tags.go similarity index 92% rename from pkg/msgconv/signalfmt/tags.go rename to msgconv/signalfmt/tags.go index 4862fe9..043bb43 100644 --- a/pkg/msgconv/signalfmt/tags.go +++ b/msgconv/signalfmt/tags.go @@ -21,7 +21,7 @@ import ( "github.com/google/uuid" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" ) type BodyRangeValue interface { @@ -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/msgconv/signalfmt/tree.go b/msgconv/signalfmt/tree.go similarity index 98% rename from pkg/msgconv/signalfmt/tree.go rename to msgconv/signalfmt/tree.go index 955b128..5f37b1c 100644 --- a/pkg/msgconv/signalfmt/tree.go +++ b/msgconv/signalfmt/tree.go @@ -22,7 +22,7 @@ import ( "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" ) type BodyRange struct { diff --git a/msgconv/urlpreview.go b/msgconv/urlpreview.go new file mode 100644 index 0000000..168dcb9 --- /dev/null +++ b/msgconv/urlpreview.go @@ -0,0 +1,141 @@ +// mautrix-signal - A Matrix-Signal puppeting bridge. +// Copyright (C) 2024 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 ( + "context" + "encoding/json" + "regexp" + "time" + + "github.com/rs/zerolog" + "github.com/tidwall/gjson" + "google.golang.org/protobuf/proto" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/event" + + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" +) + +type BeeperLinkPreview struct { + mautrix.RespPreviewURL + MatchedURL string `json:"matched_url"` + ImageEncryption *event.EncryptedFileInfo `json:"beeper:image:encryption,omitempty"` +} + +func (mc *MessageConverter) convertURLPreviewsToBeeper(ctx context.Context, preview []*signalpb.Preview) []*BeeperLinkPreview { + output := make([]*BeeperLinkPreview, len(preview)) + for i, p := range preview { + output[i] = mc.convertURLPreviewToBeeper(ctx, p) + } + return output +} + +func (mc *MessageConverter) convertURLPreviewToBeeper(ctx context.Context, preview *signalpb.Preview) *BeeperLinkPreview { + output := &BeeperLinkPreview{ + MatchedURL: preview.GetUrl(), + RespPreviewURL: mautrix.RespPreviewURL{ + CanonicalURL: preview.GetUrl(), + Title: preview.GetTitle(), + Description: preview.GetDescription(), + }, + } + if preview.Image != nil { + msg, err := mc.reuploadAttachment(ctx, preview.Image) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to reupload link preview image") + } else { + output.ImageURL = msg.Content.URL + output.ImageEncryption = msg.Content.File + output.ImageType = msg.Content.Info.MimeType + output.ImageSize = msg.Content.Info.Size + output.ImageHeight = msg.Content.Info.Height + output.ImageWidth = msg.Content.Info.Width + } + } + return output +} + +var URLRegex = regexp.MustCompile(`https?://[^\s/_*]+(?:/\S*)?`) + +func (mc *MessageConverter) convertURLPreviewToSignal(ctx context.Context, evt *event.Event) []*signalpb.Preview { + var previews []*BeeperLinkPreview + + log := zerolog.Ctx(ctx) + rawPreview := gjson.GetBytes(evt.Content.VeryRaw, `com\.beeper\.linkpreviews`) + if rawPreview.Exists() && rawPreview.IsArray() { + if err := json.Unmarshal([]byte(rawPreview.Raw), &previews); err != nil || len(previews) == 0 { + return nil + } + } /* else if portal.bridge.Config.Bridge.URLPreviews { + if matchedURL := URLRegex.FindString(evt.Content.AsMessage().Body); len(matchedURL) == 0 { + return nil + } else if parsed, err := url.Parse(matchedURL); err != nil { + return nil + } else if parsed.Host, err = idna.ToASCII(parsed.Host); err != nil { + return nil + } else if mxPreview, err := portal.MainIntent().GetURLPreview(parsed.String()); err != nil { + log.Err(err).Str("matched_url", matchedURL).Msg("Failed to fetch preview for URL found in message") + return nil + } else { + previews = []*BeeperLinkPreview{{ + RespPreviewURL: *mxPreview, + MatchedURL: matchedURL, + }} + } + }*/ + if len(previews) == 0 { + return nil + } + output := make([]*signalpb.Preview, len(previews)) + for i, preview := range previews { + output[i] = &signalpb.Preview{ + Url: proto.String(preview.MatchedURL), + Title: proto.String(preview.Title), + Description: proto.String(preview.Description), + Date: proto.Uint64(uint64(time.Now().UnixMilli())), + } + imageMXC := preview.ImageURL + if preview.ImageEncryption != nil { + imageMXC = preview.ImageEncryption.URL + } + if imageMXC != "" { + data, err := mc.DownloadMatrixMedia(ctx, imageMXC) + if err != nil { + log.Err(err).Int("preview_index", i).Msg("Failed to download URL preview image") + continue + } + if preview.ImageEncryption != nil { + err = preview.ImageEncryption.DecryptInPlace(data) + if err != nil { + log.Err(err).Int("preview_index", i).Msg("Failed to decrypt URL preview image") + continue + } + } + uploaded, err := mc.GetClient(ctx).UploadAttachment(ctx, data) + if err != nil { + log.Err(err).Int("preview_index", i).Msg("Failed to reupload URL preview image") + continue + } + uploaded.ContentType = proto.String(preview.ImageType) + uploaded.Width = proto.Uint32(uint32(preview.ImageWidth)) + uploaded.Height = proto.Uint32(uint32(preview.ImageHeight)) + output[i].Image = uploaded + } + } + return output +} diff --git a/pkg/connector/backfill.go b/pkg/connector/backfill.go deleted file mode 100644 index b7b2a23..0000000 --- a/pkg/connector/backfill.go +++ /dev/null @@ -1,207 +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 connector - -import ( - "context" - "fmt" - "slices" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "go.mau.fi/util/ptr" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/networkid" - - "go.mau.fi/mautrix-signal/pkg/msgconv" - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/backuppb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/store" -) - -var _ bridgev2.BackfillingNetworkAPI = (*SignalClient)(nil) - -func tryCastUUID(b []byte) uuid.UUID { - if len(b) == 16 { - return uuid.UUID(b) - } - return uuid.Nil -} - -func (s *SignalClient) FetchMessages(ctx context.Context, params bridgev2.FetchMessagesParams) (*bridgev2.FetchMessagesResponse, error) { - if !s.IsLoggedIn() { - return nil, bridgev2.ErrNotLoggedIn - } - userID, groupID, err := signalid.ParsePortalID(params.Portal.ID) - if err != nil { - return nil, fmt.Errorf("failed to parse portal ID: %w", err) - } - var chat *store.BackupChat - if groupID != "" { - chat, err = s.Client.Store.BackupStore.GetBackupChatByGroupID(ctx, groupID) - } else { - chat, err = s.Client.Store.BackupStore.GetBackupChatByUserID(ctx, userID) - } - if err != nil { - return nil, fmt.Errorf("failed to get chat: %w", err) - } else if chat == nil { - zerolog.Ctx(ctx).Debug().Msg("Chat not found, returning nil response for backfill") - return nil, nil - } - var anchorTS time.Time - if params.AnchorMessage != nil { - anchorTS = params.AnchorMessage.Timestamp - } - minTS := anchorTS - items, err := s.Client.Store.BackupStore.GetBackupChatItems(ctx, chat.Id, anchorTS, params.Forward, params.Count) - if err != nil { - return nil, fmt.Errorf("failed to get chat items: %w", err) - } - if len(items) > 0 { - minTS = time.UnixMilli(int64(items[0].DateSent)) - } - // GetBackupChatItems returns in reverse chronological order, so flip the list - slices.Reverse(items) - var firstDirectionfulProcessed bool - var isRead bool - convertedMessages := make([]*bridgev2.BackfillMessage, 0, len(items)) - attMap := make(msgconv.AttachmentMap) - recipientMap := make(map[uint64]*backuppb.Recipient) - getRecipientACI := func(id uint64) (uuid.UUID, error) { - recipient, ok := recipientMap[id] - if !ok { - recipient, err = s.Client.Store.BackupStore.GetBackupRecipient(ctx, id) - if err != nil { - return uuid.Nil, fmt.Errorf("failed to get recipient %d: %w", id, err) - } else if len(recipient.GetContact().GetAci()) != 16 && recipient.GetSelf() == nil { - zerolog.Ctx(ctx).Warn(). - Uint64("recipient_id", id). - Type("recipient_type", recipient.GetDestination()). - Msg("ACI not found for recipient") - } - recipientMap[id] = recipient - } - - switch dest := recipient.Destination.(type) { - case *backuppb.Recipient_Self: - return s.Client.Store.ACI, nil - case *backuppb.Recipient_Contact: - if len(dest.Contact.GetAci()) == 16 { - return uuid.UUID(dest.Contact.GetAci()), nil - } - } - return uuid.Nil, nil - } - var prevStreamOrder int64 - findNextStreamOrder := func(i int) int64 { - for ; i < len(items); i++ { - inc, ok := items[i].DirectionalDetails.(*backuppb.ChatItem_Incoming) - if ok { - return int64(inc.Incoming.GetDateServerSent()) - } - } - return time.Now().UnixMilli() - } - for i, item := range items { - var streamOrder int64 - switch dt := item.DirectionalDetails.(type) { - case *backuppb.ChatItem_Incoming: - streamOrder = int64(dt.Incoming.GetDateServerSent()) - prevStreamOrder = streamOrder - if !firstDirectionfulProcessed { - firstDirectionfulProcessed = true - isRead = dt.Incoming.Read - } - case *backuppb.ChatItem_Outgoing: - streamOrder = int64(item.GetDateSent()) - // Ensure stream order is higher than previous incoming item, but lower than next incoming item - streamOrder = min(streamOrder, findNextStreamOrder(i+1)-1) - streamOrder = max(streamOrder, prevStreamOrder+1) - - if !firstDirectionfulProcessed { - firstDirectionfulProcessed = true - isRead = true - } - } - if len(attMap) > 0 { - clear(attMap) - } - senderACI, err := getRecipientACI(item.AuthorId) - if err != nil { - return nil, err - } else if senderACI == uuid.Nil { - continue - } - dm, reactions := msgconv.BackupToDataMessage(item, attMap) - if dm == nil { - continue - } - cm := s.Main.MsgConv.ToMatrix(ctx, s.Client, params.Portal, senderACI, s.Main.Bridge.Bot, dm, attMap) - convertedReactions := make([]*bridgev2.BackfillReaction, 0, len(reactions)) - for _, reaction := range reactions { - reactionSenderACI, err := getRecipientACI(reaction.AuthorId) - if err != nil { - return nil, err - } else if reactionSenderACI == uuid.Nil { - continue - } - convertedReactions = append(convertedReactions, &bridgev2.BackfillReaction{ - TargetPart: ptr.Ptr(networkid.PartID("")), - Timestamp: time.UnixMilli(int64(reaction.SentTimestamp)), - Sender: s.makeEventSender(reactionSenderACI), - Emoji: reaction.GetEmoji(), - }) - } - msgID := signalid.MakeMessageID(senderACI, item.DateSent) - convertedMessages = append(convertedMessages, &bridgev2.BackfillMessage{ - ConvertedMessage: cm, - Sender: s.makeEventSender(senderACI), - ID: msgID, - TxnID: networkid.TransactionID(msgID), - Timestamp: time.UnixMilli(int64(item.DateSent)), - StreamOrder: streamOrder, - Reactions: convertedReactions, - }) - } - return &bridgev2.FetchMessagesResponse{ - Messages: convertedMessages, - HasMore: len(items) >= params.Count, - Forward: params.Forward, - MarkRead: isRead, - ApproxTotalCount: chat.TotalMessages, - CompleteCallback: func() { - // When reaching the last backwards backfill batch, delete the chat from the backup store. - // If backwards backfilling isn't enabled, delete immediately after the first backfill request. - if (!params.Forward && len(items) < params.Count) || !s.Main.Bridge.Config.Backfill.Queue.AnyEnabled() { - err := s.Client.Store.BackupStore.DeleteBackupChat(ctx, chat.Id) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to delete chat from backup store") - } else { - zerolog.Ctx(ctx).Debug().Msg("Deleted chat from backup store as backfill seems finished") - } - } else { - err := s.Client.Store.BackupStore.DeleteBackupChatItems(ctx, chat.Id, minTS) - if err != nil { - zerolog.Ctx(ctx).Err(err).Time("min_ts", minTS).Msg("Failed to delete messages from backup store") - } else { - zerolog.Ctx(ctx).Debug().Time("min_ts", minTS).Msg("Deleted messages from backup store") - } - } - }, - }, nil -} diff --git a/pkg/connector/capabilities.go b/pkg/connector/capabilities.go deleted file mode 100644 index 228ac94..0000000 --- a/pkg/connector/capabilities.go +++ /dev/null @@ -1,249 +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 connector - -import ( - "context" - "time" - - "go.mau.fi/util/ffmpeg" - "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" - "maunium.net/go/mautrix/event" -) - -func supportedIfFFmpeg() event.CapabilitySupportLevel { - if ffmpeg.Supported() { - return event.CapLevelPartialSupport - } - return event.CapLevelRejected -} - -func capID() string { - base := "fi.mau.signal.capabilities.2026_07_22" - if ffmpeg.Supported() { - return base + "+ffmpeg" - } - return base -} - -const MaxFileSize = 100 * 1024 * 1024 -const MaxTextLength = 2000 - -var signalCaps = &event.RoomFeatures{ - ID: capID(), - - Formatting: map[event.FormattingFeature]event.CapabilitySupportLevel{ - // Features that Signal supports natively - event.FmtBold: event.CapLevelFullySupported, - event.FmtItalic: event.CapLevelFullySupported, - event.FmtStrikethrough: event.CapLevelFullySupported, - event.FmtSpoiler: event.CapLevelFullySupported, - event.FmtInlineCode: event.CapLevelFullySupported, - event.FmtCodeBlock: event.CapLevelFullySupported, - event.FmtUserLink: event.CapLevelFullySupported, - - // Features that aren't supported on Signal, but are converted into a markdown-like representation - event.FmtBlockquote: event.CapLevelPartialSupport, - event.FmtInlineLink: event.CapLevelPartialSupport, - event.FmtUnorderedList: event.CapLevelPartialSupport, - event.FmtOrderedList: event.CapLevelPartialSupport, - event.FmtListStart: event.CapLevelPartialSupport, - event.FmtHeaders: event.CapLevelPartialSupport, - }, - File: map[event.CapabilityMsgType]*event.FileFeatures{ - event.MsgImage: { - MimeTypes: map[string]event.CapabilitySupportLevel{ - "image/gif": event.CapLevelFullySupported, - "image/png": event.CapLevelFullySupported, - "image/jpeg": event.CapLevelFullySupported, - "image/webp": event.CapLevelFullySupported, - "image/bmp": event.CapLevelFullySupported, - "image/avif": event.CapLevelFullySupported, - }, - MaxWidth: 4096, - MaxHeight: 4096, - MaxSize: MaxFileSize, - Caption: event.CapLevelFullySupported, - MaxCaptionLength: MaxTextLength, - }, - event.MsgVideo: { - MimeTypes: map[string]event.CapabilitySupportLevel{ - "video/mp4": event.CapLevelFullySupported, - "video/ogg": event.CapLevelFullySupported, - "video/webm": event.CapLevelFullySupported, - }, - MaxSize: MaxFileSize, - Caption: event.CapLevelFullySupported, - MaxCaptionLength: MaxTextLength, - }, - event.MsgAudio: { - MimeTypes: map[string]event.CapabilitySupportLevel{ - "audio/aac": event.CapLevelFullySupported, - "audio/mpeg": event.CapLevelFullySupported, - "audio/mp3": event.CapLevelFullySupported, - "audio/flac": event.CapLevelFullySupported, - }, - MaxSize: MaxFileSize, - }, - event.MsgFile: { - MimeTypes: map[string]event.CapabilitySupportLevel{ - "*/*": event.CapLevelFullySupported, - }, - MaxSize: MaxFileSize, - Caption: event.CapLevelFullySupported, - MaxCaptionLength: MaxTextLength, - }, - event.CapMsgSticker: { - MimeTypes: map[string]event.CapabilitySupportLevel{ - // Signal clients will only render static webp, so apng is preferred - "image/webp": event.CapLevelPartialSupport, - "image/png": event.CapLevelFullySupported, - "image/apng": event.CapLevelFullySupported, - "image/gif": supportedIfFFmpeg(), - }, - Caption: event.CapLevelDropped, - MaxSize: MaxFileSize, - }, - event.CapMsgVoice: { - MimeTypes: map[string]event.CapabilitySupportLevel{ - "audio/aac": event.CapLevelFullySupported, - "audio/ogg": supportedIfFFmpeg(), - }, - Caption: event.CapLevelDropped, - MaxSize: MaxFileSize, - MaxDuration: ptr.Ptr(jsontime.S(1 * time.Hour)), - }, - event.CapMsgGIF: { - MimeTypes: map[string]event.CapabilitySupportLevel{ - "image/gif": event.CapLevelFullySupported, - "video/mp4": event.CapLevelFullySupported, - }, - Caption: event.CapLevelFullySupported, - MaxSize: MaxFileSize, - }, - }, - State: event.StateFeatureMap{ - event.StateRoomName.Type: {Level: event.CapLevelFullySupported}, - event.StateRoomAvatar.Type: {Level: event.CapLevelFullySupported}, - event.StateTopic.Type: {Level: event.CapLevelFullySupported}, - event.StateBeeperDisappearingTimer.Type: {Level: event.CapLevelFullySupported}, - }, - MemberActions: event.MemberFeatureMap{ - event.MemberActionInvite: event.CapLevelFullySupported, - event.MemberActionRevokeInvite: event.CapLevelFullySupported, - event.MemberActionLeave: event.CapLevelFullySupported, - event.MemberActionBan: event.CapLevelFullySupported, - event.MemberActionKick: event.CapLevelFullySupported, - }, - MaxTextLength: MaxTextLength, // TODO support arbitrary sized text messages with files - LocationMessage: event.CapLevelPartialSupport, - Poll: event.CapLevelFullySupported, - PollEnd: event.CapLevelUnsupported, - PollHiddenVotes: event.CapLevelUnsupported, - PollDuplicateOptions: event.CapLevelFullySupported, - PollMaxOptions: 10, - PollOptionMaxLength: 100, - Thread: event.CapLevelUnsupported, - Reply: event.CapLevelFullySupported, - Edit: event.CapLevelFullySupported, - EditMaxCount: 10, - EditMaxAge: ptr.Ptr(jsontime.S(24 * time.Hour)), - Delete: event.CapLevelFullySupported, - DeleteForMe: false, - DeleteMaxAge: ptr.Ptr(jsontime.S(24 * time.Hour)), - DisappearingTimer: signalDisappearingCap, - - Reaction: event.CapLevelFullySupported, - ReactionCount: 1, - AllowedReactions: nil, - CustomEmojiReactions: false, - ReadReceipts: true, - TypingNotifications: true, - - DeleteChat: true, - MessageRequest: &event.MessageRequestFeatures{ - AcceptWithMessage: event.CapLevelPartialSupport, - AcceptWithButton: event.CapLevelFullySupported, - }, -} - -var signalDisappearingCap = &event.DisappearingTimerCapability{ - Types: []event.DisappearingType{event.DisappearingTypeAfterRead}, -} - -var signalCapsNoteToSelf *event.RoomFeatures -var signalCapsDM *event.RoomFeatures - -func init() { - signalCapsDM = ptr.Clone(signalCaps) - signalCapsDM.ID = capID() + "+dm" - signalCapsDM.MemberActions = nil - signalCapsDM.State = event.StateFeatureMap{ - event.StateBeeperDisappearingTimer.Type: {Level: event.CapLevelFullySupported}, - } - signalCapsNoteToSelf = ptr.Clone(signalCapsDM) - signalCapsNoteToSelf.EditMaxAge = nil - signalCapsNoteToSelf.DeleteMaxAge = nil - signalCapsNoteToSelf.ID = capID() + "+note_to_self" -} - -func (s *SignalClient) GetCapabilities(ctx context.Context, portal *bridgev2.Portal) *event.RoomFeatures { - if portal.Receiver == s.UserLogin.ID && portal.ID == networkid.PortalID(s.UserLogin.ID) { - return signalCapsNoteToSelf - } else if portal.RoomType == database.RoomTypeDM { - return signalCapsDM - } - return signalCaps -} - -var signalGeneralCaps = &bridgev2.NetworkGeneralCapabilities{ - DisappearingMessages: true, - AggressiveUpdateInfo: true, - ImplicitReadReceipts: true, - Provisioning: bridgev2.ProvisioningCapabilities{ - ImagePackImport: true, - ResolveIdentifier: bridgev2.ResolveIdentifierCapabilities{ - CreateDM: true, - LookupPhone: true, - LookupUsername: false, // TODO implement - ContactList: true, - }, - GroupCreation: map[string]bridgev2.GroupTypeCapabilities{ - "group": { - TypeDescription: "a group chat", - - Name: bridgev2.GroupFieldCapability{Allowed: true, Required: true, MaxLength: 32}, - Avatar: bridgev2.GroupFieldCapability{Allowed: true}, - Disappear: bridgev2.GroupFieldCapability{Allowed: true, DisappearSettings: signalDisappearingCap}, - Participants: bridgev2.GroupFieldCapability{Allowed: true}, - }, - }, - }, -} - -func (s *SignalConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities { - return signalGeneralCaps -} - -func (s *SignalConnector) GetBridgeInfoVersion() (info, capabilities int) { - return 1, 11 -} diff --git a/pkg/connector/chatinfo.go b/pkg/connector/chatinfo.go deleted file mode 100644 index 0d48c45..0000000 --- a/pkg/connector/chatinfo.go +++ /dev/null @@ -1,495 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "context" - "crypto/sha256" - "fmt" - "strconv" - "strings" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "go.mau.fi/util/ptr" - "maunium.net/go/mautrix" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/database" - "maunium.net/go/mautrix/bridgev2/networkid" - "maunium.net/go/mautrix/event" - "maunium.net/go/mautrix/id" - - "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/store" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -var ( - _ bridgev2.IdentifierResolvingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.GroupCreatingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.ContactListingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.GhostDMCreatingNetworkAPI = (*SignalClient)(nil) -) - -var _ bridgev2.IdentifierValidatingNetwork = (*SignalConnector)(nil) - -const PrivateChatTopic = "Signal private chat" -const NoteToSelfName = "Signal Note to Self" - -func (s *SignalClient) GetUserInfoWithRefreshAfter(ctx context.Context, ghost *bridgev2.Ghost, refreshAfter time.Duration) (*bridgev2.UserInfo, error) { - userID, err := signalid.ParseUserIDAsServiceID(ghost.ID) - if err != nil { - return nil, err - } - if ghost.Name != "" && s.Main.Bridge.Background { - // Don't do unnecessary fetches in background mode - return nil, nil - } - var contact *types.Recipient - if userID.Type == libsignalgo.ServiceIDTypePNI { - contact, err = s.Client.Store.RecipientStore.LoadAndUpdateRecipient(ctx, uuid.Nil, userID.UUID, nil) - } else { - contact, err = s.Client.ContactByACIWithRefreshAfter(ctx, userID.UUID, refreshAfter) - } - if err != nil { - return nil, err - } - meta := ghost.Metadata.(*signalid.GhostMetadata) - if userID.Type != libsignalgo.ServiceIDTypePNI && (!s.Main.Config.UseOutdatedProfiles && meta.ProfileFetchedAt.After(contact.Profile.FetchedAt)) { - return nil, nil - } - return s.contactToUserInfo(ctx, contact) -} - -func (s *SignalClient) GetUserInfo(ctx context.Context, ghost *bridgev2.Ghost) (*bridgev2.UserInfo, error) { - return s.GetUserInfoWithRefreshAfter(ctx, ghost, signalmeow.DefaultProfileRefreshAfter) -} - -func (s *SignalClient) GetChatInfo(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error) { - userID, groupID, err := signalid.ParsePortalID(portal.ID) - if err != nil { - return nil, fmt.Errorf("failed to parse portal id: %w", err) - } - if groupID != "" { - return s.getGroupInfo(ctx, groupID, 0, nil) - } else { - aci, pni := userID.ToACIAndPNI() - contact, err := s.Client.Store.RecipientStore.LoadAndUpdateRecipient(ctx, aci, pni, nil) - if err != nil { - return nil, err - } - return s.makeCreateDMResponse(ctx, contact, nil).PortalInfo, nil - } -} - -func (s *SignalClient) contactToUserInfo(ctx context.Context, contact *types.Recipient) (*bridgev2.UserInfo, error) { - isBot := false - ui := &bridgev2.UserInfo{ - IsBot: &isBot, - Identifiers: []string{}, - ExtraUpdates: func(ctx context.Context, ghost *bridgev2.Ghost) (changed bool) { - meta := ghost.Metadata.(*signalid.GhostMetadata) - if meta.ProfileFetchedAt.Before(contact.Profile.FetchedAt) { - changed = meta.ProfileFetchedAt.IsZero() && !contact.Profile.FetchedAt.IsZero() - meta.ProfileFetchedAt.Time = contact.Profile.FetchedAt - } - return false - }, - } - if contact.E164 != "" { - ui.Identifiers = append(ui.Identifiers, "tel:"+contact.E164) - } - name := s.Main.Config.FormatDisplayname(contact) - ui.Name = &name - if s.Main.Config.UseContactAvatars && contact.ContactAvatar.Hash != "" { - ui.Avatar = &bridgev2.Avatar{ - ID: networkid.AvatarID("hash:" + contact.ContactAvatar.Hash), - Get: func(ctx context.Context) ([]byte, error) { - if contact.ContactAvatar.Image == nil { - return nil, fmt.Errorf("contact avatar not available") - } - return contact.ContactAvatar.Image, nil - }, - } - } else if contact.Profile.AvatarPath == "clear" { - ui.Avatar = &bridgev2.Avatar{ - ID: "", - Remove: true, - } - } else if contact.Profile.AvatarPath != "" { - ui.Avatar = &bridgev2.Avatar{ - ID: makeAvatarPathID(contact.Profile.AvatarPath), - } - - if s.Main.MsgConv.DirectMedia { - userID, err := signalid.ParseUserLoginID(s.UserLogin.ID) - if err != nil { - return nil, fmt.Errorf("failed to parse user login ID: %w", err) - } - mediaID, err := signalid.DirectMediaProfileAvatar{ - UserID: userID, - ContactID: contact.ACI, - ProfileAvatarPath: contact.Profile.AvatarPath, - }.AsMediaID() - if err != nil { - return nil, err - } - ui.Avatar.MXC, err = s.Main.Bridge.Matrix.GenerateContentURI(ctx, mediaID) - if err != nil { - return nil, err - } - ui.Avatar.Hash = signalid.HashMediaID(mediaID) - } else { - ui.Avatar.Get = func(ctx context.Context) ([]byte, error) { - return s.Client.DownloadUserAvatar(ctx, contact.Profile.AvatarPath, contact.Profile.Key) - } - } - } - return ui, nil -} - -func (s *SignalConnector) ValidateUserID(id networkid.UserID) bool { - _, err := signalid.ParseUserIDAsServiceID(id) - return err == nil -} - -func (s *SignalClient) CreateChatWithGhost(ctx context.Context, ghost *bridgev2.Ghost) (*bridgev2.CreateChatResponse, error) { - parsedID, err := signalid.ParseUserIDAsServiceID(ghost.ID) - if err != nil { - return nil, err - } - resp, err := s.ResolveIdentifier(ctx, parsedID.String(), true) - if err != nil { - return nil, err - } else if resp == nil { - return nil, nil - } - resultID, err := signalid.ParseUserIDAsServiceID(resp.UserID) - if err != nil { - return nil, fmt.Errorf("failed to parse result user ID: %w", err) - } - if parsedID.Type == libsignalgo.ServiceIDTypePNI { - if resultID.Type == libsignalgo.ServiceIDTypeACI && !resultID.IsEmpty() { - resp.Chat.DMRedirectedTo = resp.UserID - } else { - resp.Chat.DMRedirectedTo = bridgev2.SpecialValueDMRedirectedToBot - } - } - return resp.Chat, nil -} - -func (s *SignalClient) ResolveIdentifier(ctx context.Context, number string, _ bool) (*bridgev2.ResolveIdentifierResponse, error) { - var aci, pni uuid.UUID - var e164Number uint64 - var recipient *types.Recipient - serviceID, err := signalid.ParseUserIDAsServiceID(networkid.UserID(number)) - if err != nil { - number, err = bridgev2.CleanPhoneNumber(number) - if err != nil { - return nil, bridgev2.WrapRespErr(err, mautrix.MInvalidParam) - } - e164Number, err = strconv.ParseUint(strings.TrimPrefix(number, "+"), 10, 64) - if err != nil { - return nil, bridgev2.WrapRespErr(fmt.Errorf("error parsing phone number: %w", err), mautrix.MInvalidParam) - } - e164String := fmt.Sprintf("+%d", e164Number) - if recipient, err = s.Client.ContactByE164(ctx, e164String); err != nil { - return nil, fmt.Errorf("error looking up number in local contact list: %w", err) - } else if recipient != nil && (recipient.ACI == uuid.Nil || !s.Client.Store.RecipientStore.IsUnregistered(ctx, libsignalgo.NewACIServiceID(recipient.ACI))) { - aci = recipient.ACI - pni = recipient.PNI - } else if resp, err := s.Client.LookupPhone(ctx, e164Number); err != nil { - return nil, fmt.Errorf("error looking up number on server: %w", err) - } else { - aci = resp[e164Number].ACI - pni = resp[e164Number].PNI - if aci == uuid.Nil && pni == uuid.Nil { - return nil, nil - } - recipient, err = s.Client.Store.RecipientStore.UpdateRecipientE164(ctx, aci, pni, e164String) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to save recipient entry after looking up phone") - } - aci, pni = recipient.ACI, recipient.PNI - if aci != uuid.Nil { - s.Client.Store.RecipientStore.MarkUnregistered(ctx, libsignalgo.NewACIServiceID(aci), false) - } - } - } else { - aci, pni = serviceID.ToACIAndPNI() - recipient, err = s.Client.Store.RecipientStore.LoadAndUpdateRecipient(ctx, aci, pni, nil) - if err != nil { - return nil, fmt.Errorf("error loading recipient: %w", err) - } - } - zerolog.Ctx(ctx).Debug(). - Uint64("e164", e164Number). - Stringer("aci", aci). - Stringer("pni", pni). - Msg("Found resolve identifier target user") - - userInfo, err := s.contactToUserInfo(ctx, recipient) - if err != nil { - return nil, fmt.Errorf("failed to convert contact: %w", err) - } - - var userID networkid.UserID - if aci != uuid.Nil { - userID = signalid.MakeUserID(aci) - } else { - userID = signalid.MakeUserIDFromServiceID(libsignalgo.NewPNIServiceID(pni)) - } - // createChat is a no-op: chats don't need to be created, and we always return chat info - resp := &bridgev2.ResolveIdentifierResponse{ - UserID: userID, - UserInfo: userInfo, - Chat: s.makeCreateDMResponse(ctx, recipient, nil), - } - resp.Ghost, err = s.Main.Bridge.GetGhostByID(ctx, resp.UserID) - if err != nil { - return nil, fmt.Errorf("failed to get ghost: %w", err) - } - return resp, nil -} - -func (s *SignalClient) CreateGroup(ctx context.Context, params *bridgev2.GroupCreateParams) (*bridgev2.CreateChatResponse, error) { - group := &signalmeow.Group{ - Title: ptr.Val(params.Name).Name, - Members: make([]*signalmeow.GroupMember, 1, len(params.Participants)+1), - Description: ptr.Val(params.Topic).Topic, - AnnouncementsOnly: false, - DisappearingMessagesDuration: uint32(ptr.Val(params.Disappear).Timer.Seconds()), - AccessControl: &signalmeow.GroupAccessControl{ - Members: signalmeow.AccessControl_MEMBER, - AddFromInviteLink: signalmeow.AccessControl_UNSATISFIABLE, - Attributes: signalmeow.AccessControl_ADMINISTRATOR, - }, - } - var pl *event.PowerLevelsEventContent - // TODO actually get PLs - if pl != nil { - if pl.EventsDefault > pl.UsersDefault { - group.AnnouncementsOnly = true - } - if pl.Invite() > pl.UsersDefault { - group.AccessControl.Members = signalmeow.AccessControl_ADMINISTRATOR - } - if pl.GetEventLevel(event.StateRoomName) <= pl.UsersDefault { - group.AccessControl.Attributes = signalmeow.AccessControl_MEMBER - } - } - group.Members[0] = &signalmeow.GroupMember{ - ACI: s.Client.Store.ACI, - Role: signalmeow.GroupMember_ADMINISTRATOR, - } - currentTS := uint64(time.Now().UnixMilli()) - for _, member := range params.Participants { - userID, err := signalid.ParseUserIDAsServiceID(member) - if err != nil { - return nil, fmt.Errorf("invalid user ID %q: %w", member, err) - } - if userID.Type == libsignalgo.ServiceIDTypeACI { - group.Members = append(group.Members, &signalmeow.GroupMember{ - ACI: userID.UUID, - Role: signalmeow.GroupMember_DEFAULT, // TODO set proper role from power levels - }) - } else if userID.Type == libsignalgo.ServiceIDTypePNI { - // TODO check if this is correct - group.PendingMembers = append(group.PendingMembers, &signalmeow.PendingMember{ - ServiceID: userID, - Role: signalmeow.GroupMember_DEFAULT, - AddedByUserID: s.Client.Store.ACI, - Timestamp: currentTS, - }) - } - } - _, err := signalmeow.PrepareGroupCreation(group) - if err != nil { - return nil, fmt.Errorf("failed to prepare group creation: %w", err) - } - var avatarBytes []byte - var avatarMXC id.ContentURIString - if params.Avatar != nil && params.Avatar.URL != "" { - avatarMXC = params.Avatar.URL - avatarBytes, err = s.Main.Bridge.Bot.DownloadMedia(ctx, params.Avatar.URL, nil) - if err != nil { - return nil, fmt.Errorf("failed to download avatar: %w", err) - } - group.AvatarPath, err = s.Client.UploadGroupAvatar(ctx, avatarBytes, group.GroupIdentifier, group.GroupMasterKey) - if err != nil { - return nil, fmt.Errorf("failed to upload avatar: %w", err) - } - } - portal, err := s.Main.Bridge.GetPortalByKey(ctx, s.makePortalKey(string(group.GroupIdentifier))) - if err != nil { - return nil, fmt.Errorf("failed to get portal: %w", err) - } - if params.RoomID != "" { - err = portal.UpdateMatrixRoomID(ctx, params.RoomID, bridgev2.UpdateMatrixRoomIDParams{SyncDBMetadata: func() { - portal.Name = group.Title - portal.NameSet = true - portal.Topic = group.Description - portal.TopicSet = true - portal.AvatarHash = sha256.Sum256(avatarBytes) - portal.AvatarSet = true - portal.AvatarMXC = avatarMXC - portal.AvatarID = makeAvatarPathID(group.AvatarPath) - if group.DisappearingMessagesDuration > 0 { - portal.Disappear = database.DisappearingSetting{ - Type: event.DisappearingTypeAfterRead, - Timer: time.Duration(group.DisappearingMessagesDuration) * time.Second, - } - } - }}) - if err != nil { - return nil, fmt.Errorf("failed to set portal room ID: %w", err) - } - } - resp, err := s.Client.CreateGroup(ctx, group) - if err != nil { - return nil, fmt.Errorf("failed to create group: %w", err) - } - if params.RoomID != "" { - // UpdateMatrixRoomID could do this for us if we passed ChatInfoSource to it, - // but we only want to do it after the group is successfully created - portal.UpdateBridgeInfo(ctx) - portal.UpdateCapabilities(ctx, s.UserLogin, true) - } - wrappedInfo, err := s.wrapGroupInfo(ctx, resp, nil) - if err != nil { - return nil, fmt.Errorf("failed to wrap group info for sync: %w", err) - } - return &bridgev2.CreateChatResponse{ - PortalKey: portal.PortalKey, - Portal: portal, - PortalInfo: wrappedInfo, - }, nil -} - -func (s *SignalClient) GetContactList(ctx context.Context) ([]*bridgev2.ResolveIdentifierResponse, error) { - recipients, err := s.Client.Store.RecipientStore.LoadAllContacts(ctx) - if err != nil { - return nil, err - } - resp := make([]*bridgev2.ResolveIdentifierResponse, len(recipients)) - for i, recipient := range recipients { - userInfo, err := s.contactToUserInfo(ctx, recipient) - if err != nil { - return nil, fmt.Errorf("failed to convert contact: %w", err) - } - recipientResp := &bridgev2.ResolveIdentifierResponse{ - UserInfo: userInfo, - Chat: s.makeCreateDMResponse(ctx, recipient, nil), - } - if recipient.ACI != uuid.Nil { - recipientResp.UserID = signalid.MakeUserID(recipient.ACI) - ghost, err := s.Main.Bridge.GetGhostByID(ctx, recipientResp.UserID) - if err != nil { - return nil, fmt.Errorf("failed to get ghost for %s: %w", recipient.ACI, err) - } - recipientResp.Ghost = ghost - } else { - recipientResp.UserID = signalid.MakeUserIDFromServiceID(libsignalgo.NewPNIServiceID(recipient.PNI)) - } - resp[i] = recipientResp - } - return resp, nil -} - -func (s *SignalClient) makeCreateDMResponse(ctx context.Context, recipient *types.Recipient, backupChat *store.BackupChat) *bridgev2.CreateChatResponse { - namePtr := bridgev2.DefaultChatName - topic := PrivateChatTopic - selfUser := s.makeEventSender(s.Client.Store.ACI) - members := &bridgev2.ChatMemberList{ - IsFull: true, - MemberMap: map[networkid.UserID]bridgev2.ChatMember{ - selfUser.Sender: { - EventSender: selfUser, - Membership: event.MembershipJoin, - PowerLevel: &moderatorPL, - }, - }, - PowerLevels: &bridgev2.PowerLevelOverrides{ - Events: map[event.Type]int{ - event.StateRoomName: 0, - event.StateTopic: 0, - event.StateRoomAvatar: 0, - event.StateBeeperDisappearingTimer: 0, - }, - }, - } - if s.Main.Config.NumberInTopic && recipient.E164 != "" { - topic = fmt.Sprintf("%s with %s", PrivateChatTopic, recipient.E164) - } - var serviceID libsignalgo.ServiceID - var avatar *bridgev2.Avatar - if recipient.ACI == uuid.Nil { - namePtr = ptr.Ptr(s.Main.Config.FormatDisplayname(recipient)) - serviceID = libsignalgo.NewPNIServiceID(recipient.PNI) - } else { - if backupChat == nil { - var err error - backupChat, err = s.Client.Store.BackupStore.GetBackupChatByUserID(ctx, libsignalgo.NewACIServiceID(recipient.ACI)) - if err != nil { - zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to get backup chat for recipient") - } - } - members.OtherUserID = signalid.MakeUserID(recipient.ACI) - if recipient.ACI == s.Client.Store.ACI { - namePtr = ptr.Ptr(NoteToSelfName) - avatar = &bridgev2.Avatar{ - ID: networkid.AvatarID(s.Main.Config.NoteToSelfAvatar), - Remove: len(s.Main.Config.NoteToSelfAvatar) == 0, - MXC: s.Main.Config.NoteToSelfAvatar, - Hash: sha256.Sum256([]byte(s.Main.Config.NoteToSelfAvatar)), - } - } else { - // The other user is only present if their ACI is known - recipientUser := s.makeEventSender(recipient.ACI) - members.MemberMap[recipientUser.Sender] = bridgev2.ChatMember{ - EventSender: recipientUser, - Membership: event.MembershipJoin, - PowerLevel: &moderatorPL, - } - } - serviceID = libsignalgo.NewACIServiceID(recipient.ACI) - } - return &bridgev2.CreateChatResponse{ - PortalKey: s.makeDMPortalKey(serviceID), - PortalInfo: &bridgev2.ChatInfo{ - Name: namePtr, - Avatar: avatar, - Topic: &topic, - Members: members, - Type: ptr.Ptr(database.RoomTypeDM), - - MessageRequest: ptr.Ptr(recipient.ACI != uuid.Nil && recipient.ProbablyMessageRequest()), - CanBackfill: backupChat != nil, - ExtraUpdates: updatePortalSyncMeta, - }, - } -} - -func makeAvatarPathID(avatarPath string) networkid.AvatarID { - if avatarPath == "" { - return "" - } - return networkid.AvatarID("path:" + avatarPath) -} diff --git a/pkg/connector/chatsync.go b/pkg/connector/chatsync.go deleted file mode 100644 index 47963d7..0000000 --- a/pkg/connector/chatsync.go +++ /dev/null @@ -1,183 +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 connector - -import ( - "context" - "encoding/base64" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/simplevent" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/backuppb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -func (s *SignalClient) stopChatSync() { - if cancel := s.cancelChatSync.Swap(nil); cancel != nil { - (*cancel)() - } -} - -func (s *SignalClient) syncChats(ctx context.Context, cancel context.CancelFunc) { - defer cancel() - - if s.UserLogin.Metadata.(*signalid.UserLoginMetadata).ChatsSynced { - return - } - - if s.Client.Store.EphemeralBackupKey != nil { - zerolog.Ctx(ctx).Info().Msg("Fetching transfer archive before syncing chats") - meta, err := s.Client.WaitForTransfer(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to request transfer archive") - return - } else if meta.Error != "" { - zerolog.Ctx(ctx).Error().Str("error_type", meta.Error).Msg("Transfer archive request was rejected") - s.UserLogin.Metadata.(*signalid.UserLoginMetadata).ChatsSynced = true - err = s.UserLogin.Save(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to save user login metadata after transfer archive request was rejected") - } - return - } - err = s.Client.FetchAndProcessTransfer(ctx, meta) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to fetch and process transfer archive") - return - } - zerolog.Ctx(ctx).Info().Msg("Transfer archive fetched and processed, syncing chats") - } - chats, err := s.Client.Store.BackupStore.GetBackupChats(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get chats from backup store") - return - } - zerolog.Ctx(ctx).Info().Int("chat_count", len(chats)).Msg("Fetched chats to sync from database") - for _, chat := range chats { - if ctx.Err() != nil { - zerolog.Ctx(ctx).Debug(). - AnErr("ctx_err", ctx.Err()). - Msg("Context cancelled while syncing chats, stopping") - return - } - recipient, err := s.Client.Store.BackupStore.GetBackupRecipient(ctx, chat.RecipientId) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get recipient for chat") - continue - } else if recipient == nil { - zerolog.Ctx(ctx).Warn(). - Uint64("backup_chat_id", chat.Id). - Uint64("backup_recipient_id", chat.RecipientId). - Msg("No recipient found for chat") - continue - } - resyncEvt := &simplevent.ChatResync{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventChatResync, - LogContext: func(c zerolog.Context) zerolog.Context { - return c. - Int("message_count", chat.TotalMessages). - Uint64("backup_chat_id", chat.Id). - Uint64("backup_recipient_id", chat.RecipientId) - }, - CreatePortal: true, - }, - LatestMessageTS: time.UnixMilli(int64(chat.LatestMessageID)), - } - switch dest := recipient.Destination.(type) { - case *backuppb.Recipient_Contact: - aci := tryCastUUID(dest.Contact.GetAci()) - pni := tryCastUUID(dest.Contact.GetPni()) - if chat.TotalMessages == 0 { - zerolog.Ctx(ctx).Debug(). - Stringer("aci", aci). - Stringer("pni", pni). - Uint64("e164", dest.Contact.GetE164()). - Msg("Skipping direct chat with no messages and deleting data") - err = s.Client.Store.BackupStore.DeleteBackupChat(ctx, chat.Id) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to delete chat from backup store") - } - continue - } - processedRecipient, err := s.Client.Store.RecipientStore.LoadAndUpdateRecipient(ctx, aci, pni, nil) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get full recipient data") - continue - } - dmInfo := s.makeCreateDMResponse(ctx, processedRecipient, chat) - resyncEvt.PortalKey = dmInfo.PortalKey - resyncEvt.ChatInfo = dmInfo.PortalInfo - case *backuppb.Recipient_Self: - processedRecipient, err := s.Client.Store.RecipientStore.LoadAndUpdateRecipient(ctx, s.Client.Store.ACI, uuid.Nil, nil) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get full recipient data") - continue - } - dmInfo := s.makeCreateDMResponse(ctx, processedRecipient, chat) - resyncEvt.PortalKey = dmInfo.PortalKey - resyncEvt.ChatInfo = dmInfo.PortalInfo - case *backuppb.Recipient_Group: - if len(dest.Group.MasterKey) != libsignalgo.GroupMasterKeyLength { - continue - } - rawGroupID, err := libsignalgo.GroupMasterKey(dest.Group.MasterKey).GroupIdentifier() - if err != nil { - zerolog.Ctx(ctx).Err(err). - Uint64("recipient_id", recipient.Id). - Msg("Failed to get group identifier from master key") - continue - } - groupID := types.GroupIdentifier(base64.StdEncoding.EncodeToString(rawGroupID[:])) - groupInfo, err := s.getGroupInfo(ctx, groupID, dest.Group.GetSnapshot().GetVersion(), chat) - if err != nil { - zerolog.Ctx(ctx).Err(err). - Uint64("recipient_id", recipient.Id). - Stringer("group_id", groupID). - Msg("Failed to get full group info") - continue - } - resyncEvt.PortalKey = s.makePortalKey(string(groupID)) - resyncEvt.ChatInfo = groupInfo - default: - zerolog.Ctx(ctx).Debug(). - Type("destination_type", dest). - Uint64("backup_chat_id", chat.Id). - Uint64("backup_recipient_id", chat.RecipientId). - Msg("Ignoring and deleting chat with unsupported destination type") - err = s.Client.Store.BackupStore.DeleteBackupChat(ctx, chat.Id) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to delete chat from backup store") - } - continue - } - if !s.UserLogin.QueueRemoteEvent(resyncEvt).Success { - return - } - } - s.UserLogin.Metadata.(*signalid.UserLoginMetadata).ChatsSynced = true - err = s.UserLogin.Save(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to save user login metadata after syncing chats") - } -} diff --git a/pkg/connector/client.go b/pkg/connector/client.go deleted file mode 100644 index 4fcf188..0000000 --- a/pkg/connector/client.go +++ /dev/null @@ -1,365 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "context" - "fmt" - "sync/atomic" - "time" - - "github.com/rs/zerolog" - "go.mau.fi/util/exsync" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/networkid" - "maunium.net/go/mautrix/bridgev2/status" - "maunium.net/go/mautrix/event" - - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" - "go.mau.fi/mautrix-signal/pkg/signalmeow/web" -) - -type SignalClient struct { - Main *SignalConnector - UserLogin *bridgev2.UserLogin - Client *signalmeow.Client - Ghost *bridgev2.Ghost - - queueEmptyWaiter *exsync.Event - cancelChatSync atomic.Pointer[context.CancelFunc] -} - -var ( - _ bridgev2.NetworkAPI = (*SignalClient)(nil) - _ bridgev2.BackgroundSyncingNetworkAPI = (*SignalClient)(nil) - _ bridgev2.StickerImportingNetworkAPI = (*SignalClient)(nil) -) - -var pushCfg = &bridgev2.PushConfig{ - FCM: &bridgev2.FCMPushConfig{ - // https://github.com/signalapp/Signal-Android/blob/main/app/src/main/res/values/firebase_messaging.xml#L4 - SenderID: "312334754206", - }, - APNs: &bridgev2.APNsPushConfig{ - BundleID: "org.whispersystems.signal", - }, -} - -func (s *SignalClient) GetPushConfigs() *bridgev2.PushConfig { - return pushCfg -} - -func (s *SignalClient) RegisterPushNotifications(ctx context.Context, pushType bridgev2.PushType, token string) error { - if s.Client == nil { - return bridgev2.ErrNotLoggedIn - } - switch pushType { - case bridgev2.PushTypeFCM: - return s.Client.RegisterFCM(ctx, token) - case bridgev2.PushTypeAPNs: - return s.Client.RegisterAPNs(ctx, token) - default: - return fmt.Errorf("unsupported push type: %s", pushType) - } -} - -func (s *SignalClient) DownloadImagePack(ctx context.Context, url string) (*bridgev2.ImportedImagePack, error) { - return s.Main.MsgConv.DownloadImagePack(ctx, url) -} - -func (s *SignalClient) ListImagePacks(ctx context.Context) ([]*event.ImagePackMetadata, error) { - return []*event.ImagePackMetadata{}, nil -} - -func (s *SignalClient) LogoutRemote(ctx context.Context) { - if s.Client == nil { - return - } - s.stopChatSync() - err := s.Client.Unlink(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to unlink device") - } - err = s.Client.StopReceiveLoops() - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to stop receive loops for logout") - } - err = s.Main.Store.DeleteDevice(context.TODO(), &s.Client.Store.DeviceData) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to delete device from store") - } -} - -func (s *SignalClient) IsThisUser(_ context.Context, userID networkid.UserID) bool { - if s.Client == nil { - return false - } - return userID == signalid.MakeUserID(s.Client.Store.ACI) -} - -func (s *SignalClient) bridgeStateLoop(statusChan <-chan signalmeow.SignalConnectionStatus) { - var peekedConnectionStatus signalmeow.SignalConnectionStatus - for { - var connectionStatus signalmeow.SignalConnectionStatus - if peekedConnectionStatus.Event != signalmeow.SignalConnectionEventNone { - s.UserLogin.Log.Debug(). - Stringer("peeked_connection_status_event", peekedConnectionStatus.Event). - Msg("Using peeked connectionStatus event") - connectionStatus = peekedConnectionStatus - peekedConnectionStatus = signalmeow.SignalConnectionStatus{} - } else { - var ok bool - connectionStatus, ok = <-statusChan - if !ok { - s.UserLogin.Log.Debug().Msg("statusChan channel closed") - return - } - } - - err := connectionStatus.Err - switch connectionStatus.Event { - case signalmeow.SignalConnectionEventConnected: - s.UserLogin.Log.Debug().Msg("Sending Connected BridgeState") - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateConnected}) - - case signalmeow.SignalConnectionEventDisconnected: - s.UserLogin.Log.Debug().Msg("Received SignalConnectionEventDisconnected") - - // Debounce: wait 7s before sending TransientDisconnect, in case we get a reconnect - // We should wait until the next message comes in, or 7 seconds has passed. - // - If a disconnected event comes in, just loop again, unless it's been more than 7 seconds. - // - If a non-disconnected event comes in, store it in peekedConnectionStatus, - // break out of this loop and go back to the top of the goroutine to handle it in the switch. - // - If 7 seconds passes without any non-disconnect messages, send the TransientDisconnect. - // (Why 7 seconds? It was 5 at first, but websockets min retry is 5 seconds, - // so it would send TransientDisconnect right before reconnecting. 7 seems to work well.) - debounceTimer := time.NewTimer(7 * time.Second) - PeekLoop: - for { - var ok bool - select { - case peekedConnectionStatus, ok = <-statusChan: - // Handle channel closing - if !ok { - s.UserLogin.Log.Debug().Msg("connectionStatus channel closed") - return - } - // If it's another Disconnected event, just keep looping - if peekedConnectionStatus.Event == signalmeow.SignalConnectionEventDisconnected { - peekedConnectionStatus = signalmeow.SignalConnectionStatus{} - continue - } - // If it's a non-disconnect event, break out of the PeekLoop and handle it in the switch - break PeekLoop - case <-debounceTimer.C: - // Time is up, so break out of the loop and send the TransientDisconnect - break PeekLoop - } - } - // We're out of the PeekLoop, so either we got a non-disconnect event, or it's been 7 seconds (or both). - // We want to send TransientDisconnect if it's been 7 seconds, but not if the latest event was something - // other than Disconnected - if !debounceTimer.Stop() { // If the timer has already expired - // Send TransientDisconnect only if the latest event is a disconnect or no event - // (peekedConnectionStatus could be something else if the timer and the event race) - if peekedConnectionStatus.Event == signalmeow.SignalConnectionEventDisconnected || - peekedConnectionStatus.Event == signalmeow.SignalConnectionEventNone { - s.UserLogin.Log.Debug().Msg("Sending TransientDisconnect BridgeState") - if err == nil { - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateTransientDisconnect}) - } else { - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateTransientDisconnect, Error: "unknown-websocket-error", Message: err.Error()}) - } - } - } - - case signalmeow.SignalConnectionEventLoggedOut: - s.stopChatSync() - s.UserLogin.Log.Debug().Msg("Sending BadCredentials BridgeState") - if err == nil { - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"}) - } else { - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: err.Error()}) - } - err = s.Client.ClearKeysAndDisconnect(context.TODO()) - if err != nil { - s.UserLogin.Log.Error().Err(err).Msg("Failed to clear keys and disconnect") - } - - case signalmeow.SignalConnectionEventError: - s.UserLogin.Log.Debug().Msg("Sending TransientDisconnect BridgeState") - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateTransientDisconnect, Error: "unknown-websocket-error", Message: err.Error()}) - - case signalmeow.SignalConnectionEventFatalError: - s.UserLogin.Log.Debug().Msg("Sending UnknownError BridgeState") - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateUnknownError, Error: "unknown-websocket-error", Message: err.Error()}) - - case signalmeow.SignalConnectionCleanShutdown: - if s.Client.IsLoggedIn() { - s.UserLogin.Log.Debug().Msg("Clean Shutdown - sending no BridgeState") - } else { - s.UserLogin.Log.Debug().Msg("Clean Shutdown, but logged out - Sending BadCredentials BridgeState") - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"}) - } - } - } -} - -func (s *SignalClient) Connect(ctx context.Context) { - if s.Client == nil { - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You're not logged into Signal"}) - return - } - s.updateRemoteProfile(ctx, false) - s.tryConnect(ctx, 0, true) -} - -func (s *SignalClient) ConnectBackground(ctx context.Context, _ *bridgev2.ConnectBackgroundParams) error { - s.queueEmptyWaiter.Clear() - ch, unauthCh, err := s.Client.StartWebsockets(ctx) - if err != nil { - return err - } - defer s.Disconnect() - log := zerolog.Ctx(ctx) - queueEmpty := s.queueEmptyWaiter.GetChan() - didConnect := false - for { - select { - case status := <-ch: - switch status.Event { - case web.SignalWebsocketConnectionEventConnected: - log.Info().Msg("Authed websocket connected") - didConnect = true - case web.SignalWebsocketConnectionEventDisconnected: - log.Err(status.Err).Msg("Authed websocket disconnected") - case web.SignalWebsocketConnectionEventLoggedOut: - log.Err(status.Err).Msg("Authed websocket logged out") - return fmt.Errorf("authed websocket logged out: %w", status.Err) - case web.SignalWebsocketConnectionEventError, web.SignalWebsocketConnectionEventFatalError: - log.Err(status.Err).Msg("Authed websocket error") - return fmt.Errorf("authed websocket errored: %w", status.Err) - case web.SignalWebsocketConnectionEventCleanShutdown: - log.Info().Msg("Authed websocket clean shutdown") - } - case status := <-unauthCh: - switch status.Event { - case web.SignalWebsocketConnectionEventConnected: - log.Info().Msg("Unauthed websocket connected") - case web.SignalWebsocketConnectionEventDisconnected: - log.Err(status.Err).Msg("Unauthed websocket disconnected") - case web.SignalWebsocketConnectionEventLoggedOut: - log.Err(status.Err).Msg("Unauthed websocket logged out") - case web.SignalWebsocketConnectionEventError, web.SignalWebsocketConnectionEventFatalError: - log.Err(status.Err).Msg("Unauthed websocket error") - case web.SignalWebsocketConnectionEventCleanShutdown: - log.Info().Msg("Unauthed websocket clean shutdown") - } - case <-ctx.Done(): - log.Warn().Msg("Context finished before queue empty event") - if didConnect { - // Don't propagate timeout errors if the connection was successful at least once - return nil - } - return ctx.Err() - case <-queueEmpty: - log.Info().Msg("Received queue empty event") - return nil - } - } -} - -func (s *SignalClient) Disconnect() { - if s.Client == nil { - return - } - s.stopChatSync() - err := s.Client.StopReceiveLoops() - if err != nil { - s.UserLogin.Log.Err(err).Msg("Failed to stop receive loops") - } -} - -func (s *SignalClient) postLoginConnect() { - ctx := s.UserLogin.Log.WithContext(s.Main.Bridge.BackgroundCtx) - s.tryConnect(ctx, 0, false) -} - -func (s *SignalClient) tryConnect(ctx context.Context, retryCount int, noLoginSync bool) { - if ctx.Err() != nil { - zerolog.Ctx(ctx).Debug(). - Int("retry_count", retryCount). - AnErr("ctx_err", ctx.Err()). - Msg("Context is canceled, not trying to connect") - return - } - if retryCount == 0 { - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateConnecting}) - } - ch, err := s.Client.StartReceiveLoops(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to start receive loops") - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateTransientDisconnect, Error: "unknown-websocket-error", Message: err.Error()}) - retryInSeconds := 2 << retryCount - if retryInSeconds > 150 { - retryInSeconds = 150 - } - zerolog.Ctx(ctx).Debug().Int("retry_in_seconds", retryInSeconds).Msg("Sleeping and retrying connection") - select { - case <-time.After(time.Duration(retryInSeconds) * time.Second): - case <-ctx.Done(): - zerolog.Ctx(ctx).Info().Msg("Context canceled, exit tryConnect") - return - } - s.tryConnect(ctx, retryCount+1, noLoginSync) - return - } - syncCtx, cancel := context.WithCancel(ctx) - if oldCancel := s.cancelChatSync.Swap(&cancel); oldCancel != nil { - (*oldCancel)() - } - go s.bridgeStateLoop(ch) - if noLoginSync { - go s.syncChats(syncCtx, cancel) - } else { - // TODO it would be more proper to only connect after syncing, - // but currently syncing will fetch group info online, so it has to be connected. - if s.Client.Store.EphemeralBackupKey != nil { - go func() { - if s.Client.Store.MasterKey != nil { - s.Client.SyncStorage(ctx) - } else { - s.UserLogin.Log.Warn().Msg("No master key for storage sync before backup sync") - } - s.syncChats(syncCtx, cancel) - }() - } else { - cancel() - if s.Client.Store.MasterKey != nil { - go s.Client.SyncStorage(ctx) - } - } - } -} - -func (s *SignalClient) IsLoggedIn() bool { - if s.Client == nil { - return false - } - return s.Client.IsLoggedIn() -} diff --git a/pkg/connector/commands.go b/pkg/connector/commands.go deleted file mode 100644 index 0be2370..0000000 --- a/pkg/connector/commands.go +++ /dev/null @@ -1,73 +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 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 deleted file mode 100644 index 232571f..0000000 --- a/pkg/connector/config.go +++ /dev/null @@ -1,112 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - _ "embed" - "strings" - "text/template" - - up "go.mau.fi/util/configupgrade" - "gopkg.in/yaml.v3" - - "maunium.net/go/mautrix/id" - - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -//go:embed example-config.yaml -var ExampleConfig string - -type SignalConfig struct { - DisplaynameTemplate string `yaml:"displayname_template"` - UseContactAvatars bool `yaml:"use_contact_avatars"` - SyncContactsOnStartup bool `yaml:"sync_contacts_on_startup"` - UseOutdatedProfiles bool `yaml:"use_outdated_profiles"` - NumberInTopic bool `yaml:"number_in_topic"` - DeviceName string `yaml:"device_name"` - 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:"-"` -} - -type umConfig SignalConfig - -func (c *SignalConfig) UnmarshalYAML(node *yaml.Node) error { - err := node.Decode((*umConfig)(c)) - if err != nil { - return err - } - return c.PostProcess() -} - -func (c *SignalConfig) PostProcess() error { - var err error - c.displaynameTemplate, err = template.New("displayname").Parse(c.DisplaynameTemplate) - return err -} - -type DisplaynameParams struct { - ProfileName string - ContactName string - Nickname string - Username string - PhoneNumber string - UUID string - ACI string - PNI string - AboutEmoji string -} - -func (c *SignalConfig) FormatDisplayname(contact *types.Recipient) string { - var nameBuf strings.Builder - err := c.displaynameTemplate.Execute(&nameBuf, &DisplaynameParams{ - ProfileName: contact.Profile.Name, - ContactName: contact.ContactName, - Nickname: contact.Nickname, - Username: "", - PhoneNumber: contact.E164, - UUID: contact.ACI.String(), - ACI: contact.ACI.String(), - PNI: contact.PNI.String(), - AboutEmoji: contact.Profile.AboutEmoji, - }) - if err != nil { - panic(err) - } - return nameBuf.String() -} - -func upgradeConfig(helper up.Helper) { - helper.Copy(up.Str, "displayname_template") - helper.Copy(up.Bool, "use_contact_avatars") - helper.Copy(up.Bool, "sync_contacts_on_startup") - helper.Copy(up.Bool, "use_outdated_profiles") - helper.Copy(up.Bool, "number_in_topic") - helper.Copy(up.Str, "device_name") - 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) { - return ExampleConfig, &s.Config, up.SimpleUpgrader(upgradeConfig) -} diff --git a/pkg/connector/connector.go b/pkg/connector/connector.go deleted file mode 100644 index 0343d02..0000000 --- a/pkg/connector/connector.go +++ /dev/null @@ -1,137 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "context" - "fmt" - "strconv" - "time" - - "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 { - MsgConv *msgconv.MessageConverter - Store *store.Container - Bridge *bridgev2.Bridge - Config SignalConfig -} - -var _ bridgev2.NetworkConnector = (*SignalConnector)(nil) -var _ bridgev2.MaxFileSizeingNetwork = (*SignalConnector)(nil) -var _ bridgev2.TransactionIDGeneratingNetwork = (*SignalConnector)(nil) - -func (s *SignalConnector) GetName() bridgev2.BridgeName { - return bridgev2.BridgeName{ - DisplayName: "Signal", - NetworkURL: "https://signal.org", - NetworkIcon: "mxc://maunium.net/wPJgTQbZOtpBFmDNkiNEMDUp", - NetworkID: "signal", - BeeperBridgeType: "signal", - DefaultPort: 29328, - } -} - -func (s *SignalConnector) Init(bridge *bridgev2.Bridge) { - s.Store = store.NewStore(bridge.DB.Database, dbutil.ZeroLogger(bridge.Log.With().Str("db_section", "signalmeow").Logger())) - s.Bridge = 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) { - s.MsgConv.MaxFileSize = maxSize -} - -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"} - } - 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 { - return fmt.Errorf("failed to parse user login ID: %w", err) - } - device, err := s.Store.DeviceByACI(ctx, aci) - if err != nil { - return fmt.Errorf("failed to get device from store: %w", err) - } - sc := &SignalClient{ - Main: s, - UserLogin: login, - - 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 - } - login.Client = sc - return nil -} - -func (s *SignalConnector) GenerateTransactionID(userID id.UserID, roomID id.RoomID, eventType event.Type) networkid.RawTransactionID { - return networkid.RawTransactionID(strconv.FormatInt(time.Now().UnixMilli(), 10)) -} diff --git a/pkg/connector/directmedia.go b/pkg/connector/directmedia.go deleted file mode 100644 index 05e2a07..0000000 --- a/pkg/connector/directmedia.go +++ /dev/null @@ -1,130 +0,0 @@ -package connector - -import ( - "context" - "encoding/base64" - "fmt" - "os" - - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/networkid" - "maunium.net/go/mautrix/mediaproxy" - - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -var _ bridgev2.DirectMediableNetwork = (*SignalConnector)(nil) - -func (s *SignalConnector) SetUseDirectMedia() { - s.MsgConv.DirectMedia = true -} - -func (s *SignalConnector) Download(ctx context.Context, mediaID networkid.MediaID, params map[string]string) (mediaproxy.GetMediaResponse, error) { - log := s.Bridge.Log.With().Str("component", "direct download").Logger() - - info, err := signalid.ParseDirectMediaInfo(mediaID) - if err != nil { - return nil, fmt.Errorf("failed to parse direct media id: %w", err) - } - - var rawDataResp []byte - switch info := info.(type) { - case *signalid.DirectMediaAttachment: - log.Info(). - Uint64("cdn_id", info.CDNID). - Str("cdn_key", info.CDNKey). - Uint32("cdn_number", info.CDNNumber). - Int("key_len", len(info.Key)). - Int("digest_len", len(info.Digest)). - Bool("plaintext_digest", info.PlaintextDigest). - 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, - ) - if err != nil { - return nil, err - } - return &mediaproxy.FileMeta{}, nil - }, - }, nil - case *signalid.DirectMediaGroupAvatar: - log.Info(). - Stringer("user_id", info.UserID). - Hex("group_id", info.GroupID[:]). - Str("group_avatar_path", info.GroupAvatarPath). - Msg("Direct downloading group avatar") - - groupID := types.GroupIdentifier(base64.StdEncoding.EncodeToString(info.GroupID[:])) - - userLogin, err := s.Bridge.GetExistingUserLoginByID(ctx, signalid.MakeUserLoginID(info.UserID)) - if err != nil { - return nil, fmt.Errorf("failed to get user login: %w", err) - } else if userLogin == nil { - return nil, bridgev2.ErrNotLoggedIn - } - - client := userLogin.Client.(*SignalClient) - - groupMasterKey, err := client.Client.Store.GroupStore.MasterKeyFromGroupIdentifier(ctx, groupID) - if err != nil { - 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 - } - case *signalid.DirectMediaProfileAvatar: - log.Info(). - Stringer("user_id", info.UserID). - Stringer("contact_id", info.ContactID). - Str("profile_avatar_path", info.ProfileAvatarPath). - Msg("Direct downloading profile avatar") - - userLogin, err := s.Bridge.GetExistingUserLoginByID(ctx, signalid.MakeUserLoginID(info.UserID)) - if err != nil { - return nil, fmt.Errorf("failed to get user login: %w", err) - } else if userLogin == nil { - return nil, bridgev2.ErrNotLoggedIn - } - - client := userLogin.Client.(*SignalClient) - - profileKey, err := client.Client.Store.RecipientStore.LoadProfileKey(ctx, info.ContactID) - if err != nil { - return nil, fmt.Errorf("failed to get contact: %w", err) - } else if profileKey == nil { - 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") - - rawDataResp, err = signalmeow.DownloadStickerPackItem(ctx, info.PackID, info.PackKey, info.StickerID) - if err != nil { - log.Err(err).Msg("Direct download failed") - return nil, err - } - 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 deleted file mode 100644 index 25fe035..0000000 --- a/pkg/connector/example-config.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# Displayname template for Signal users. -# {{.ProfileName}} - The Signal profile name set by the user. -# {{.ContactName}} - The name for the user from your phone's contact list. This is not safe on multi-user instances. -# {{.Nickname}} - The nickname set for the user in the native Signal app. This is not safe on multi-user instances. -# {{.PhoneNumber}} - The phone number of the user. -# {{.UUID}} - The UUID of the Signal user. -# {{.AboutEmoji}} - The emoji set by the user in their profile. -displayname_template: '{{or .ProfileName .PhoneNumber "Unknown user"}}' -# Should avatars from the user's contact list be used? This is not safe on multi-user instances. -use_contact_avatars: false -# Should the bridge request the user's contact list from the phone on startup? -sync_contacts_on_startup: true -# Should the bridge sync ghost user info even if profile fetching fails? This is not safe on multi-user instances. -use_outdated_profiles: false -# Should the Signal user's phone number be included in the room topic in private chat portal rooms? -number_in_topic: true -# Default device name that shows up in the Signal app. -device_name: mautrix-signal -# Avatar image for the Note to Self room. -note_to_self_avatar: mxc://maunium.net/REBIVrqjZwmaWpssCZpBlmlL -# Format for generating URLs from location messages for sending to Signal. -# Google Maps: 'https://www.google.com/maps/place/%[1]s,%[2]s' -# OpenStreetMap: 'https://www.openstreetmap.org/?mlat=%[1]s&mlon=%[2]s' -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 deleted file mode 100644 index d958463..0000000 --- a/pkg/connector/groupinfo.go +++ /dev/null @@ -1,441 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "context" - "fmt" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "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" - "maunium.net/go/mautrix/event" - - "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/store" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -var defaultPL = 0 -var moderatorPL = 50 - -func roleToPL(role signalmeow.GroupMemberRole) *int { - switch role { - case signalmeow.GroupMember_ADMINISTRATOR: - return &moderatorPL - case signalmeow.GroupMember_DEFAULT: - fallthrough - default: - return &defaultPL - } -} - -func applyAnnouncementsOnly(plc *bridgev2.PowerLevelOverrides, announcementsOnly bool) { - if announcementsOnly { - plc.EventsDefault = &moderatorPL - } else { - plc.EventsDefault = &defaultPL - } -} - -func applyAttributesAccess(plc *bridgev2.PowerLevelOverrides, attributeAccess signalmeow.AccessControl) { - attributePL := defaultPL - if attributeAccess == signalmeow.AccessControl_ADMINISTRATOR { - attributePL = moderatorPL - } - plc.Events[event.StateRoomName] = attributePL - plc.Events[event.StateRoomAvatar] = attributePL - plc.Events[event.StateTopic] = attributePL - plc.Events[event.StateBeeperDisappearingTimer] = attributePL -} - -func applyMembersAccess(plc *bridgev2.PowerLevelOverrides, memberAccess signalmeow.AccessControl) { - if memberAccess == signalmeow.AccessControl_ADMINISTRATOR { - plc.Invite = &moderatorPL - } else { - plc.Invite = &defaultPL - } -} - -func inviteLinkToJoinRule(inviteLinkAccess signalmeow.AccessControl) event.JoinRule { - switch inviteLinkAccess { - case signalmeow.AccessControl_UNSATISFIABLE: - return event.JoinRuleInvite - case signalmeow.AccessControl_ADMINISTRATOR: - return event.JoinRuleKnock - case signalmeow.AccessControl_ANY: - // TODO allow public portals? - publicPortals := false - if publicPortals { - return event.JoinRulePublic - } else { - return event.JoinRuleKnock - } - default: - return event.JoinRuleInvite - } -} - -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) - if err != nil { - return nil, fmt.Errorf("failed to retrieve group by id: %w", err) - } - return s.wrapGroupInfo(ctx, groupInfo, backupChat) -} - -func (s *SignalClient) wrapGroupInfo(ctx context.Context, groupInfo *signalmeow.Group, backupChat *store.BackupChat) (*bridgev2.ChatInfo, error) { - members := &bridgev2.ChatMemberList{ - IsFull: true, - MemberMap: make(map[networkid.UserID]bridgev2.ChatMember, len(groupInfo.Members)+len(groupInfo.PendingMembers)+len(groupInfo.RequestingMembers)+len(groupInfo.BannedMembers)), - PowerLevels: &bridgev2.PowerLevelOverrides{ - Events: map[event.Type]int{ - event.StatePowerLevels: moderatorPL, - }, - }, - ExcludeChangesFromTimeline: true, - } - applyAnnouncementsOnly(members.PowerLevels, groupInfo.AnnouncementsOnly) - joinRule := event.JoinRuleInvite - if groupInfo.AccessControl != nil { - applyAttributesAccess(members.PowerLevels, groupInfo.AccessControl.Attributes) - applyMembersAccess(members.PowerLevels, groupInfo.AccessControl.Members) - joinRule = inviteLinkToJoinRule(groupInfo.AccessControl.AddFromInviteLink) - } - for _, member := range groupInfo.RequestingMembers { - members.MemberMap.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - Membership: event.MembershipKnock, - }) - } - for _, member := range groupInfo.PendingMembers { - s.addChatMemberWithACIQuery(ctx, members.MemberMap, member.ServiceID, bridgev2.ChatMember{ - PowerLevel: roleToPL(member.Role), - Membership: event.MembershipInvite, - MemberSender: s.makeEventSender(member.AddedByUserID), - }) - } - for _, member := range groupInfo.Members { - members.MemberMap.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - PowerLevel: roleToPL(member.Role), - Membership: event.MembershipJoin, - }) - } - for _, member := range groupInfo.BannedMembers { - s.addChatMemberWithACIQuery(ctx, members.MemberMap, member.ServiceID, bridgev2.ChatMember{ - Membership: event.MembershipBan, - }) - } - if backupChat == nil { - var err error - // TODO allow using backup chat for data too instead of asking server? - backupChat, err = s.Client.Store.BackupStore.GetBackupChatByGroupID(ctx, groupInfo.GroupIdentifier) - if err != nil { - zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to get backup chat for group") - } - } - avatar, err := s.makeGroupAvatar(ctx, groupInfo.GroupIdentifier, &groupInfo.AvatarPath, groupInfo.GroupMasterKey) - if err != nil { - return nil, fmt.Errorf("failed to make group avatar: %w", err) - } - return &bridgev2.ChatInfo{ - Name: &groupInfo.Title, - Topic: &groupInfo.Description, - Avatar: avatar, - Disappear: &database.DisappearingSetting{ - Type: event.DisappearingTypeAfterRead, - Timer: time.Duration(groupInfo.DisappearingMessagesDuration) * time.Second, - }, - Members: members, - Type: ptr.Ptr(database.RoomTypeDefault), - JoinRule: &event.JoinRulesEventContent{JoinRule: joinRule}, - ExtraUpdates: bridgev2.MergeExtraUpdaters(makeRevisionUpdater(groupInfo.Revision), updatePortalSyncMeta), - CanBackfill: backupChat != nil, - - ExcludeChangesFromTimeline: true, - }, nil -} - -func addMemberToMap(mc map[networkid.UserID]bridgev2.ChatMember, member bridgev2.ChatMember) { - mc[member.EventSender.Sender] = member -} - -func updatePortalSyncMeta(ctx context.Context, portal *bridgev2.Portal) bool { - meta := portal.Metadata.(*signalid.PortalMetadata) - meta.LastSync = jsontime.UnixNow() - return true -} - -func (s *SignalClient) makeGroupAvatar(ctx context.Context, groupID types.GroupIdentifier, path *string, groupMasterKey types.SerializedGroupMasterKey) (*bridgev2.Avatar, error) { - if path == nil { - return nil, nil - } - avatar := &bridgev2.Avatar{ - ID: makeAvatarPathID(*path), - Remove: *path == "", - } - if s.Main.MsgConv.DirectMedia { - userID, err := signalid.ParseUserLoginID(s.UserLogin.ID) - if err != nil { - return nil, fmt.Errorf("failed to parse user login ID: %w", err) - } - groupIDBytes, err := groupID.Bytes() - if err != nil { - return nil, fmt.Errorf("failed to get group id bytes: %w", err) - } - mediaID, err := signalid.DirectMediaGroupAvatar{ - UserID: userID, - GroupID: groupIDBytes, - GroupAvatarPath: *path, - }.AsMediaID() - if err != nil { - return nil, err - } - avatar.MXC, err = s.Main.Bridge.Matrix.GenerateContentURI(ctx, mediaID) - if err != nil { - return nil, err - } - avatar.Hash = signalid.HashMediaID(mediaID) - } else { - avatar.Get = func(ctx context.Context) ([]byte, error) { - return s.Client.DownloadGroupAvatar(ctx, *path, groupMasterKey) - } - } - return avatar, nil -} - -func makeRevisionUpdater(rev uint32) func(ctx context.Context, portal *bridgev2.Portal) bool { - return func(ctx context.Context, portal *bridgev2.Portal) bool { - meta := portal.Metadata.(*signalid.PortalMetadata) - if meta.Revision < rev { - meta.Revision = rev - return true - } - return false - } -} - -func (s *SignalClient) groupChangeToChatInfoChange(ctx context.Context, groupID types.GroupIdentifier, rev uint32, groupChange *signalmeow.GroupChange) (*bridgev2.ChatInfoChange, error) { - avatar, err := s.makeGroupAvatar(ctx, groupID, groupChange.ModifyAvatar, groupChange.GroupMasterKey) - if err != nil { - return nil, err - } - ic := &bridgev2.ChatInfoChange{ - ChatInfo: &bridgev2.ChatInfo{ - ExtraUpdates: makeRevisionUpdater(rev), - Name: groupChange.ModifyTitle, - Topic: groupChange.ModifyDescription, - Avatar: avatar, - }, - } - if groupChange.ModifyDisappearingMessagesDuration != nil { - ic.ChatInfo.Disappear = &database.DisappearingSetting{ - Type: event.DisappearingTypeAfterRead, - Timer: time.Duration(*groupChange.ModifyDisappearingMessagesDuration) * time.Second, - } - } - - var pls *bridgev2.PowerLevelOverrides - if groupChange.ModifyAnnouncementsOnly != nil || - groupChange.ModifyAttributesAccess != nil || - groupChange.ModifyMemberAccess != nil { - pls = &bridgev2.PowerLevelOverrides{Events: make(map[event.Type]int)} - if groupChange.ModifyAnnouncementsOnly != nil { - applyAnnouncementsOnly(pls, *groupChange.ModifyAnnouncementsOnly) - } - if groupChange.ModifyAttributesAccess != nil { - applyAttributesAccess(pls, *groupChange.ModifyAttributesAccess) - } - if groupChange.ModifyMemberAccess != nil { - applyMembersAccess(pls, *groupChange.ModifyMemberAccess) - } - } - if groupChange.ModifyAddFromInviteLinkAccess != nil { - ic.ChatInfo.JoinRule = &event.JoinRulesEventContent{ - JoinRule: inviteLinkToJoinRule(*groupChange.ModifyAddFromInviteLinkAccess), - } - } - mc := make(bridgev2.ChatMemberMap) - for _, member := range groupChange.AddPendingMembers { - s.addChatMemberWithACIQuery(ctx, mc, member.ServiceID, bridgev2.ChatMember{ - PowerLevel: roleToPL(member.Role), - Membership: event.MembershipInvite, - PrevMembership: event.MembershipLeave, - MemberSender: s.makeEventSender(member.AddedByUserID), - }) - } - for _, member := range groupChange.AddRequestingMembers { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - Membership: event.MembershipKnock, - }) - } - for _, memberServiceID := range groupChange.DeletePendingMembers { - s.addChatMemberWithACIQuery(ctx, mc, *memberServiceID, bridgev2.ChatMember{ - Membership: event.MembershipLeave, - PrevMembership: event.MembershipInvite, - }) - } - for _, memberACI := range groupChange.DeleteRequestingMembers { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(*memberACI), - Membership: event.MembershipLeave, - PrevMembership: event.MembershipKnock, - }) - } - for _, memberACI := range groupChange.DeleteMembers { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(*memberACI), - Membership: event.MembershipLeave, - PrevMembership: event.MembershipJoin, - }) - } - for _, memberServiceID := range groupChange.DeleteBannedMembers { - s.addChatMemberWithACIQuery(ctx, mc, *memberServiceID, bridgev2.ChatMember{ - Membership: event.MembershipLeave, - PrevMembership: event.MembershipBan, - }) - } - for _, member := range groupChange.AddBannedMembers { - s.addChatMemberWithACIQuery(ctx, mc, member.ServiceID, bridgev2.ChatMember{ - Membership: event.MembershipBan, - }) - } - for _, member := range groupChange.PromotePendingMembers { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - Membership: event.MembershipJoin, - PrevMembership: event.MembershipInvite, - }) - } - for _, member := range groupChange.PromotePendingPniAciMembers { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - Membership: event.MembershipJoin, - }) - mc.Set(bridgev2.ChatMember{ - EventSender: s.makePNIEventSender(member.PNI), - Membership: event.MembershipLeave, - PrevMembership: event.MembershipInvite, - MemberEventExtra: map[string]any{ - "com.beeper.exclude_from_timeline": true, - }, - }) - } - for _, member := range groupChange.PromoteRequestingMembers { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - Membership: event.MembershipJoin, - PrevMembership: event.MembershipKnock, - }) - } - for _, member := range groupChange.AddMembers { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - PowerLevel: roleToPL(member.Role), - Membership: event.MembershipJoin, - }) - } - for _, member := range groupChange.ModifyMemberRoles { - mc.Set(bridgev2.ChatMember{ - EventSender: s.makeEventSender(member.ACI), - PowerLevel: roleToPL(member.Role), - Membership: event.MembershipJoin, - }) - } - if len(mc) > 0 || pls != nil { - ic.MemberChanges = &bridgev2.ChatMemberList{MemberMap: mc, PowerLevels: pls} - } - return ic, nil -} - -func (s *SignalClient) addChatMemberWithACIQuery( - ctx context.Context, mc bridgev2.ChatMemberMap, serviceID libsignalgo.ServiceID, member bridgev2.ChatMember, -) { - member.EventSender = s.makeEventSenderFromServiceID(serviceID) - mc.Set(member) - if aci := s.tryResolvePNItoLoggedInACI(ctx, serviceID); aci != nil { - member.EventSender = s.makeEventSender(*aci) - mc.Add(member) - } -} - -func (s *SignalClient) tryResolvePNItoLoggedInACI(ctx context.Context, serviceID libsignalgo.ServiceID) *uuid.UUID { - if serviceID.Type != libsignalgo.ServiceIDTypePNI { - return nil - } else if serviceID.UUID == s.Client.Store.PNI { - return &s.Client.Store.ACI - } else if s.Main.Bridge.Config.SplitPortals { - // When split portals is enabled, we don't care about anyone else's logins - return nil - } else if device, err := s.Client.Store.DeviceStore.DeviceByPNI(ctx, serviceID.UUID); err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get ACI for PNI") - return nil - } else if device == nil { - return nil - } else { - return &device.ACI - } -} - -func (s *SignalClient) catchUpGroup(ctx context.Context, portal *bridgev2.Portal, fromRevision, toRevision uint32, ts uint64) { - if fromRevision >= toRevision { - return - } - log := zerolog.Ctx(ctx).With(). - Str("action", "catch up group changes"). - Uint32("from_revision", fromRevision). - Uint32("to_revision", toRevision). - Logger() - if fromRevision == 0 { - log.Info().Msg("Syncing full group info") - info, err := s.getGroupInfo(ctx, types.GroupIdentifier(portal.ID), toRevision, nil) - if err != nil { - log.Err(err).Msg("Failed to get group info") - } else { - portal.UpdateInfo(ctx, info, s.UserLogin, nil, time.Time{}) - } - } else { - log.Info().Msg("Syncing missed group changes") - groupChanges, err := s.Client.GetGroupHistoryPage(ctx, types.GroupIdentifier(portal.ID), fromRevision, false) - if err != nil { - log.Err(err).Msg("Failed to get group history page") - s.catchUpGroup(ctx, portal, 0, toRevision, ts) - return - } - for _, gc := range groupChanges { - log.Debug().Uint32("current_rev", gc.GroupChange.Revision).Msg("Processing group change") - chatInfoChange, err := s.groupChangeToChatInfoChange(ctx, types.GroupIdentifier(portal.ID), gc.GroupChange.Revision, gc.GroupChange) - if err != nil { - log.Err(err).Msg("Failed to convert group info") - } else { - portal.ProcessChatInfoChange(ctx, s.makeEventSenderFromServiceID(gc.GroupChange.SourceServiceID), s.UserLogin, chatInfoChange, time.UnixMilli(int64(ts))) - } - if gc.GroupChange.Revision == toRevision { - break - } - } - } -} diff --git a/pkg/connector/handlematrix.go b/pkg/connector/handlematrix.go deleted file mode 100644 index 009943a..0000000 --- a/pkg/connector/handlematrix.go +++ /dev/null @@ -1,957 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "context" - "crypto/sha256" - "errors" - "fmt" - "slices" - "strconv" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "go.mau.fi/util/ptr" - "go.mau.fi/util/variationselector" - "google.golang.org/protobuf/proto" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/database" - "maunium.net/go/mautrix/bridgev2/networkid" - "maunium.net/go/mautrix/bridgev2/simplevent" - "maunium.net/go/mautrix/event" - - "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/protobuf/signalpb" -) - -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) -) - -func (s *SignalClient) sendMessage(ctx context.Context, portalID networkid.PortalID, content *signalpb.Content) error { - userID, groupID, err := signalid.ParsePortalID(portalID) - if err != nil { - return err - } - if groupID != "" { - result, err := s.Client.SendGroupMessage(ctx, groupID, content) - if err != nil { - return err - } - totalRecipients := len(result.FailedToSendTo) + len(result.SuccessfullySentTo) - log := zerolog.Ctx(ctx).With(). - Int("total_recipients", totalRecipients). - Int("failed_to_send_to_count", len(result.FailedToSendTo)). - Int("successfully_sent_to_count", len(result.SuccessfullySentTo)). - Logger() - 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") - } - } else { - log.Debug().Msg("Sent event to all members of Signal group") - } - return nil - } else { - res := s.Client.SendMessage(ctx, userID, content) - if !res.WasSuccessful { - return res.Error - } - return nil - } -} - -func getTimestampForEvent(txnID networkid.RawTransactionID, evt *event.Event, origSender *bridgev2.OrigSender) uint64 { - if origSender != nil { - // Relaybot messages are never allowed to set the timestamp - return uint64(time.Now().UnixMilli()) - } - if len(txnID) > 0 { - parsed, err := strconv.ParseUint(string(txnID), 10, 64) - if err == nil { - return parsed - } - } - return uint64(evt.Timestamp) -} - -func (s *SignalClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.MatrixMessage) (message *bridgev2.MatrixMessageResponse, err error) { - converted, err := s.Main.MsgConv.ToSignal( - ctx, s.Client, msg.Portal, msg.Event, msg.Content, 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)) - if err != nil { - return nil, bridgev2.WrapErrorInStatus(err).WithSendNotice(true) - } - dbMsg := &database.Message{ - ID: msgID, - SenderID: signalid.MakeUserID(s.Client.Store.ACI), - Timestamp: time.UnixMilli(int64(ts)), - Metadata: meta, - } - return &bridgev2.MatrixMessageResponse{ - DB: dbMsg, - RemovePending: networkid.TransactionID(msgID), - }, nil -} - -func (s *SignalClient) HandleMatrixEdit(ctx context.Context, msg *bridgev2.MatrixEdit) error { - _, targetSentTimestamp, err := signalid.ParseMessageID(msg.EditTarget.ID) - if err != nil { - return fmt.Errorf("failed to parse target message ID: %w", err) - } else if msg.EditTarget.SenderID != signalid.MakeUserID(s.Client.Store.ACI) { - return fmt.Errorf("cannot edit other people's messages") - } - var replyTo *database.Message - if msg.EditTarget.ReplyTo.MessageID != "" { - replyTo, err = s.Main.Bridge.DB.Message.GetFirstOrSpecificPartByID(ctx, msg.Portal.Receiver, msg.EditTarget.ReplyTo) - if err != nil { - 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) - 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{ - TargetSentTimestamp: proto.Uint64(targetSentTimestamp), - DataMessage: converted, - })) - if err != nil { - return bridgev2.WrapErrorInStatus(err).WithSendNotice(true) - } - prevID := msg.EditTarget.ID - msg.EditTarget.ID = signalid.MakeMessageID(s.Client.Store.ACI, ts) - msg.EditTarget.Metadata = &signalid.MessageMetadata{ContainsAttachments: len(converted.Attachments) > 0} - msg.EditTarget.EditCount++ - if prevID != msg.EditTarget.ID { - err = s.Main.Bridge.DB.DoTxn(ctx, nil, func(ctx context.Context) error { - err = s.Main.Bridge.DB.Message.Update(ctx, msg.EditTarget) - if err != nil { - return err - } - err = saveEditStub(ctx, s.Main.Bridge, prevID, msg.EditTarget) - if err != nil { - return fmt.Errorf("failed to save edit stub: %w", err) - } - return nil - }) - if err != nil { - zerolog.Ctx(ctx).Err(err). - Str("prev_message_id", string(prevID)). - Str("message_id", string(msg.EditTarget.ID)). - Msg("Failed to save message after editing") - } - } - return nil -} - -// saveEditStub saves a placeholder message row pointing at the pre-edit ID of a message, such that -// duplicate checks on incoming edits find it and are dropped. This is necessary because the first -// time we see an edit it modifies the ID in place. -func saveEditStub(ctx context.Context, bridge *bridgev2.Bridge, prevID networkid.MessageID, target *database.Message) error { - stub := &database.Message{ - ID: prevID, - PartID: editStubPartID, - Room: target.Room, - SenderID: target.SenderID, - SenderMXID: target.SenderMXID, - Timestamp: target.Timestamp, - } - stub.SetFakeMXID() - return bridge.DB.Message.Insert(ctx, stub) -} - -func (s *SignalClient) PreHandleMatrixReaction(ctx context.Context, msg *bridgev2.MatrixReaction) (bridgev2.MatrixReactionPreResponse, error) { - return bridgev2.MatrixReactionPreResponse{ - SenderID: signalid.MakeUserID(s.Client.Store.ACI), - EmojiID: "", - Emoji: variationselector.FullyQualify(msg.Content.RelatesTo.Key), - }, nil -} - -func (s *SignalClient) HandleMatrixReaction(ctx context.Context, msg *bridgev2.MatrixReaction) (reaction *database.Reaction, err error) { - targetAuthorACI, targetSentTimestamp, err := signalid.ParseMessageID(msg.TargetMessage.ID) - if err != nil { - 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), - }, - })) - if err != nil { - return nil, err - } - return &database.Reaction{}, nil -} - -func (s *SignalClient) HandleMatrixReactionRemove(ctx context.Context, msg *bridgev2.MatrixReactionRemove) error { - targetAuthorACI, targetSentTimestamp, err := signalid.ParseMessageID(msg.TargetReaction.MessageID) - if err != nil { - 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), - }, - })) - if err != nil { - return err - } - return nil -} - -func (s *SignalClient) HandleMatrixMessageRemove(ctx context.Context, msg *bridgev2.MatrixMessageRemove) error { - _, targetSentTimestamp, err := signalid.ParseMessageID(msg.TargetMessage.ID) - if err != nil { - return fmt.Errorf("failed to parse target message ID: %w", err) - } else if msg.TargetMessage.SenderID != signalid.MakeUserID(s.Client.Store.ACI) { - 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), - }, - })) - if err != nil { - return err - } - return nil -} - -func (s *SignalClient) HandleMatrixReadReceipt(ctx context.Context, receipt *bridgev2.MatrixReadReceipt) error { - if !receipt.ReadUpTo.After(receipt.LastRead) { - return nil - } - if receipt.LastRead.IsZero() { - receipt.LastRead = receipt.ReadUpTo.Add(-5 * time.Second) - } - dbMessages, err := s.Main.Bridge.DB.Message.GetMessagesBetweenTimeQuery(ctx, receipt.Portal.PortalKey, receipt.LastRead, receipt.ReadUpTo) - if err != nil { - return fmt.Errorf("failed to get messages to mark as read: %w", err) - } else if len(dbMessages) == 0 { - return nil - } - messagesToRead := map[uuid.UUID][]uint64{} - for _, msg := range dbMessages { - userID, timestamp, err := signalid.ParseMessageID(msg.ID) - if err != nil { - continue - } - messagesToRead[userID] = append(messagesToRead[userID], timestamp) - } - zerolog.Ctx(ctx).Debug(). - Any("targets", messagesToRead). - Msg("Collected read receipt target messages") - - // TODO send sync message manually containing all read receipts instead of a separate message for each recipient - - for destination, messages := range messagesToRead { - // Don't send read receipts for own messages - if destination == s.Client.Store.ACI { - continue - } - // Don't use portal.sendSignalMessage because we're sending this straight to - // who sent the original message, not the portal's ChatID - ctx, cancel := context.WithTimeout(ctx, 10*time.Second) - result := s.Client.SendMessage(ctx, libsignalgo.NewACIServiceID(destination), signalmeow.ReadReceptMessageForTimestamps(messages)) - cancel() - if !result.WasSuccessful { - zerolog.Ctx(ctx).Err(result.Error). - Stringer("destination", destination). - Uints64("message_ids", messages). - Msg("Failed to send read receipt to Signal") - } else { - zerolog.Ctx(ctx).Debug(). - Stringer("destination", destination). - Uints64("message_ids", messages). - Msg("Sent read receipt to Signal") - } - } - return nil -} - -func (s *SignalClient) HandleMatrixTyping(ctx context.Context, typing *bridgev2.MatrixTyping) error { - userID, groupID, err := signalid.ParsePortalID(typing.Portal.ID) - if err != nil { - return err - } - typingMessage := signalmeow.TypingMessage(typing.IsTyping) - if !userID.IsEmpty() && userID.Type == libsignalgo.ServiceIDTypeACI { - 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 -} - -func (s *SignalClient) handleMatrixRoomMeta(ctx context.Context, portal *bridgev2.Portal, gc *signalmeow.GroupChange, postUpdatePortal func()) (bool, error) { - _, groupID, err := signalid.ParsePortalID(portal.ID) - if err != nil || groupID == "" { - return false, err - } - gc.Revision = portal.Metadata.(*signalid.PortalMetadata).Revision + 1 - revision, err := s.Client.UpdateGroup(ctx, gc, groupID) - if err != nil { - return false, err - } - if gc.ModifyTitle != nil { - portal.Name = *gc.ModifyTitle - portal.NameSet = true - } - if gc.ModifyDescription != nil { - portal.Topic = *gc.ModifyDescription - portal.TopicSet = true - } - if gc.ModifyAvatar != nil { - portal.AvatarID = makeAvatarPathID(*gc.ModifyAvatar) - portal.AvatarSet = true - } - if postUpdatePortal != nil { - postUpdatePortal() - } - portal.Metadata.(*signalid.PortalMetadata).Revision = revision - return true, nil -} - -func (s *SignalClient) HandleMatrixRoomName(ctx context.Context, msg *bridgev2.MatrixRoomName) (bool, error) { - return s.handleMatrixRoomMeta(ctx, msg.Portal, &signalmeow.GroupChange{ - ModifyTitle: &msg.Content.Name, - }, nil) -} - -func (s *SignalClient) HandleMatrixRoomAvatar(ctx context.Context, msg *bridgev2.MatrixRoomAvatar) (bool, error) { - _, groupID, err := signalid.ParsePortalID(msg.Portal.ID) - if err != nil || groupID == "" { - return false, err - } - var avatarPath string - var avatarHash [32]byte - if msg.Content.URL != "" { - data, err := s.Main.Bridge.Bot.DownloadMedia(ctx, msg.Content.URL, nil) - if err != nil { - return false, fmt.Errorf("failed to download avatar: %w", err) - } - avatarHash = sha256.Sum256(data) - avatarPath, err = s.Client.UploadGroupAvatar(ctx, data, groupID, "") - if err != nil { - return false, fmt.Errorf("failed to reupload avatar: %w", err) - } - } - return s.handleMatrixRoomMeta(ctx, msg.Portal, &signalmeow.GroupChange{ - ModifyAvatar: &avatarPath, - }, func() { - msg.Portal.AvatarMXC = msg.Content.URL - msg.Portal.AvatarHash = avatarHash - }) -} - -func (s *SignalClient) HandleMatrixRoomTopic(ctx context.Context, msg *bridgev2.MatrixRoomTopic) (bool, error) { - return s.handleMatrixRoomMeta(ctx, msg.Portal, &signalmeow.GroupChange{ - ModifyDescription: &msg.Content.Topic, - }, nil) -} - -func (s *SignalClient) HandleMatrixMembership(ctx context.Context, msg *bridgev2.MatrixMembershipChange) (*bridgev2.MatrixMembershipResult, error) { - if msg.Type.IsSelf && msg.OrigSender != nil { - return nil, nil - } - var targetIntent bridgev2.MatrixAPI - var targetSignalID libsignalgo.ServiceID - var err error - if msg.Portal.RoomType == database.RoomTypeDM { - switch msg.Type { - case bridgev2.Invite: - return nil, fmt.Errorf("cannot invite additional user to dm") - default: - return nil, nil - } - } - targetSignalID, err = signalid.ParseGhostOrUserLoginID(msg.Target) - if err != nil { - return nil, fmt.Errorf("failed to parse target signal id: %w", err) - } - switch target := msg.Target.(type) { - case *bridgev2.Ghost: - targetIntent = target.Intent - case *bridgev2.UserLogin: - targetIntent = target.User.DoublePuppet(ctx) - 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) - } - targetIntent = ghost.Intent - } - default: - return nil, fmt.Errorf("cannot get target intent: unknown type: %T", target) - } - log := zerolog.Ctx(ctx).With(). - Str("From Membership", string(msg.Type.From)). - Str("To Membership", string(msg.Type.To)). - Logger() - gc := &signalmeow.GroupChange{} - role := signalmeow.GroupMember_DEFAULT - if msg.Type.To == event.MembershipInvite || msg.Type == bridgev2.AcceptKnock { - levels, err := msg.Portal.Bridge.Matrix.GetPowerLevels(ctx, msg.Portal.MXID) - if err != nil { - log.Err(err).Msg("Couldn't get power levels") - if levels.GetUserLevel(targetIntent.GetMXID()) >= moderatorPL { - role = signalmeow.GroupMember_ADMINISTRATOR - } - } - } - switch msg.Type { - case bridgev2.AcceptInvite: - if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't accept invite for non-ACI service ID") - } - gc.PromotePendingMembers = []*signalmeow.PromotePendingMember{{ - ACI: targetSignalID.UUID, - }} - case bridgev2.RevokeInvite, bridgev2.RejectInvite: - 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") - } - gc.DeleteMembers = []*uuid.UUID{&targetSignalID.UUID} - case bridgev2.Invite: - if targetSignalID.Type == libsignalgo.ServiceIDTypeACI { - gc.AddMembers = []*signalmeow.AddMember{{ - GroupMember: signalmeow.GroupMember{ - ACI: targetSignalID.UUID, - Role: role, - }, - }} - } else { - gc.AddPendingMembers = []*signalmeow.PendingMember{{ - ServiceID: targetSignalID, - Role: role, - AddedByUserID: s.Client.Store.ACI, - Timestamp: uint64(msg.Event.Timestamp), - }} - } - // TODO: joining and knocking requires a way to obtain the invite link - // because the joining/knocking member doesn't have the GroupMasterKey yet - // case bridgev2.Join: - // gc.AddMembers = []*signalmeow.AddMember{{ - // GroupMember: signalmeow.GroupMember{ - // ACI: targetSignalID, - // Role: role, - // }, - // JoinFromInviteLink: true, - // }} - // case bridgev2.Knock: - // gc.AddRequestingMembers = []*signalmeow.RequestingMember{{ - // ACI: targetSignalID, - // Timestamp: uint64(time.Now().UnixMilli()), - // }} - case bridgev2.AcceptKnock: - if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("can't accept knock from non-ACI service ID") - } - gc.PromoteRequestingMembers = []*signalmeow.RoleMember{{ - ACI: targetSignalID.UUID, - Role: role, - }} - case bridgev2.RetractKnock, bridgev2.RejectKnock: - if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, 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: - gc.AddBannedMembers = []*signalmeow.BannedMember{{ - ServiceID: targetSignalID, - Timestamp: uint64(time.Now().UnixMilli()), - }} - switch msg.Type { - case bridgev2.BanJoined: - if targetSignalID.Type != libsignalgo.ServiceIDTypeACI { - return nil, 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") - } - 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) - } - _, groupID, err := signalid.ParsePortalID(msg.Portal.ID) - if err != nil || groupID == "" { - return nil, err - } - gc.Revision = msg.Portal.Metadata.(*signalid.PortalMetadata).Revision + 1 - revision, err := s.Client.UpdateGroup(ctx, gc, groupID) - if err != nil { - return nil, err - } - if (msg.Type == bridgev2.Invite || msg.Type == bridgev2.AcceptKnock) && targetSignalID.Type != libsignalgo.ServiceIDTypePNI { - err = targetIntent.EnsureJoined(ctx, msg.Portal.MXID) - if err != nil { - return nil, err - } - } - msg.Portal.Metadata.(*signalid.PortalMetadata).Revision = revision - return nil, nil -} - -func plToRole(pl int) signalmeow.GroupMemberRole { - if pl >= moderatorPL { - return signalmeow.GroupMember_ADMINISTRATOR - } else { - return signalmeow.GroupMember_DEFAULT - } -} - -func plToAccessControl(pl int) *signalmeow.AccessControl { - var accessControl signalmeow.AccessControl - if pl >= moderatorPL { - accessControl = signalmeow.AccessControl_ADMINISTRATOR - } else { - accessControl = signalmeow.AccessControl_MEMBER - } - return &accessControl -} - -func hasAdminChanged(plc *bridgev2.SinglePowerLevelChange) bool { - if plc == nil { - return false - } - return (plc.NewLevel < moderatorPL) != (plc.OrigLevel < moderatorPL) -} - -func (s *SignalClient) HandleMatrixPowerLevels(ctx context.Context, msg *bridgev2.MatrixPowerLevelChange) (bool, error) { - if msg.Portal.RoomType == database.RoomTypeDM { - return false, nil - } - gc := &signalmeow.GroupChange{} - for _, plc := range msg.Users { - if !hasAdminChanged(&plc.SinglePowerLevelChange) { - continue - } - serviceID, err := signalid.ParseGhostOrUserLoginID(plc.Target) - if err != nil || serviceID.Type != libsignalgo.ServiceIDTypeACI { - continue - } - gc.ModifyMemberRoles = append(gc.ModifyMemberRoles, &signalmeow.RoleMember{ - ACI: serviceID.UUID, - Role: plToRole(plc.NewLevel), - }) - } - if hasAdminChanged(msg.EventsDefault) { - announcementsOnly := msg.EventsDefault.NewLevel >= moderatorPL - gc.ModifyAnnouncementsOnly = &announcementsOnly - } - if hasAdminChanged(msg.StateDefault) { - gc.ModifyAttributesAccess = plToAccessControl(msg.StateDefault.NewLevel) - } - if hasAdminChanged(msg.Invite) { - gc.ModifyMemberAccess = plToAccessControl(msg.Invite.NewLevel) - } - _, groupID, err := signalid.ParsePortalID(msg.Portal.ID) - if err != nil || groupID == "" { - return false, err - } - revision, err := s.Client.UpdateGroup(ctx, gc, groupID) - if err != nil { - return false, err - } - msg.Portal.Metadata.(*signalid.PortalMetadata).Revision = revision - return true, nil -} - -func (s *SignalClient) HandleMatrixViewingChat(ctx context.Context, msg *bridgev2.MatrixViewingChat) error { - if msg.Portal == nil { - return nil - } - - // Sync the other users ghost in DMs - if msg.Portal.OtherUserID != "" { - ghost, err := s.Main.Bridge.GetExistingGhostByID(ctx, msg.Portal.OtherUserID) - if err != nil { - return fmt.Errorf("failed to get ghost for sync: %w", err) - } else if ghost == nil { - zerolog.Ctx(ctx).Warn(). - Str("other_user_id", string(msg.Portal.OtherUserID)). - Msg("No ghost found for other user in portal") - } else { - meta := ghost.Metadata.(*signalid.GhostMetadata) - if meta.ProfileFetchedAt.Time.Add(5 * time.Minute).Before(time.Now()) { - // Reset, but don't save, portal last sync time for immediate sync now - meta.ProfileFetchedAt.Time = time.Time{} - info, err := s.GetUserInfoWithRefreshAfter(ctx, ghost, 5*time.Minute) - if err != nil { - return fmt.Errorf("failed to get user info: %w", err) - } - ghost.UpdateInfo(ctx, info) - } - } - } - - // always resync the portal if its stale - portalMeta := msg.Portal.Metadata.(*signalid.PortalMetadata) - if portalMeta.LastSync.Add(24 * time.Hour).Before(time.Now()) { - s.UserLogin.QueueRemoteEvent(&simplevent.ChatResync{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventChatResync, - PortalKey: msg.Portal.PortalKey, - }, - GetChatInfoFunc: s.GetChatInfo, - }) - } - - return nil -} - -func (s *SignalClient) HandleMatrixDisappearingTimer(ctx context.Context, msg *bridgev2.MatrixDisappearingTimer) (bool, error) { - if msg.Content.Type != event.DisappearingTypeAfterRead && msg.Content.Timer.Duration != 0 { - return false, fmt.Errorf("unsupported disappearing timer type: %s", msg.Content.Type) - } - userID, groupID, err := signalid.ParsePortalID(msg.Portal.ID) - if err != nil { - return false, err - } - newSetting := database.DisappearingSetting{ - Type: event.DisappearingTypeAfterRead, - Timer: msg.Content.Timer.Duration, - } - if newSetting.Timer == 0 { - newSetting.Type = event.DisappearingTypeNone - } - if groupID != "" { - return s.handleMatrixRoomMeta(ctx, msg.Portal, &signalmeow.GroupChange{ - ModifyDisappearingMessagesDuration: ptr.Ptr(uint32(msg.Content.Timer.Seconds())), - }, func() { - msg.Portal.Disappear = newSetting - }) - } 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())), - })) - if !res.WasSuccessful { - return false, res.Error - } - msg.Portal.Disappear = newSetting - 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 - } - meta := msg.VoteTo.Metadata.(*signalid.MessageMetadata) - mxOptions := meta.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) - } - } - if meta.VoteCount == nil { - meta.VoteCount = make(map[string]uint32) - } - meta.VoteCount[s.Client.Store.ACI.String()]++ - err = s.Main.Bridge.DB.Message.Update(ctx, msg.VoteTo) - if err != nil { - zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to update poll message with new vote count") - } - converted := &signalpb.DataMessage{ - PollVote: &signalpb.DataMessage_PollVote{ - TargetAuthorAciBinary: senderACI[:], - TargetSentTimestamp: &msgTS, - OptionIndexes: optionIndexes, - VoteCount: proto.Uint32(meta.VoteCount[s.Client.Store.ACI.String()]), - }, - 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 deleted file mode 100644 index fce7f2c..0000000 --- a/pkg/connector/handlesignal.go +++ /dev/null @@ -1,842 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "context" - "encoding/base64" - "fmt" - "slices" - "strings" - "time" - - "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" - "maunium.net/go/mautrix/bridgev2/simplevent" - "maunium.net/go/mautrix/bridgev2/status" - "maunium.net/go/mautrix/event" - - "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" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -func (s *SignalClient) handleSignalEvent(rawEvt events.SignalEvent) bool { - switch evt := rawEvt.(type) { - case *events.ChatEvent: - return s.Main.Bridge.QueueRemoteEvent(s.UserLogin, &Bv2ChatEvent{ChatEvent: evt, s: s}).Success - case *events.DecryptionError: - return s.Main.Bridge.QueueRemoteEvent(s.UserLogin, s.wrapDecryptionError(evt)).Success - case *events.Receipt: - return s.handleSignalReceipt(evt) - case *events.ReadSelf: - 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: - s.handleSignalContactList(evt) - case *events.ACIFound: - s.handleSignalACIFound(evt) - case *events.QueueEmpty: - s.queueEmptyWaiter.Set() - case *events.LoggedOut: - s.UserLogin.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: evt.Error.Error()}) - default: - s.UserLogin.Log.Warn().Type("event_type", evt).Msg("Unrecognized signalmeow event type") - } - return true -} - -func (s *SignalClient) wrapCallEvent(evt *events.Call) bridgev2.RemoteMessage { - return &simplevent.Message[*events.Call]{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventMessage, - LogContext: func(c zerolog.Context) zerolog.Context { - c = c.Stringer("sender_id", evt.Info.Sender) - c = c.Uint64("message_ts", evt.Timestamp) - return c - }, - PortalKey: s.makePortalKey(evt.Info.ChatID), - CreatePortal: true, - Sender: s.makeEventSender(evt.Info.Sender), - Timestamp: time.UnixMilli(int64(evt.Timestamp)), - }, - Data: evt, - ID: signalid.MakeMessageID(evt.Info.Sender, evt.Timestamp), - - ConvertMessageFunc: convertCallEvent, - } -} - -func convertCallEvent(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, data *events.Call) (*bridgev2.ConvertedMessage, error) { - content := &event.MessageEventContent{ - MsgType: event.MsgNotice, - } - if data.IsRinging { - content.Body = "Incoming call" - if userID, _, _ := signalid.ParsePortalID(portal.ID); !userID.IsEmpty() { - content.MsgType = event.MsgText - } - content.BeeperActionMessage = &event.BeeperActionMessage{ - Type: event.BeeperActionMessageCall, - } - } else { - content.Body = "Call ended" - } - return &bridgev2.ConvertedMessage{ - Parts: []*bridgev2.ConvertedMessagePart{{ - Type: event.EventMessage, - Content: content, - }}, - }, nil -} - -func (s *SignalClient) wrapDecryptionError(evt *events.DecryptionError) bridgev2.RemoteMessage { - return &simplevent.Message[*events.DecryptionError]{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventMessage, - LogContext: func(c zerolog.Context) zerolog.Context { - c = c.Stringer("sender_id", evt.Sender) - c = c.Uint64("message_ts", evt.Timestamp) - return c - }, - PortalKey: s.makePortalKey(evt.Sender.String()), - CreatePortal: true, - Sender: s.makeEventSender(evt.Sender), - Timestamp: time.UnixMilli(int64(evt.Timestamp)), - StreamOrder: int64(evt.Timestamp), - }, - Data: evt, - // TODO use main message id and edit it if it later becomes decryptable? - ID: "decrypterr|" + signalid.MakeMessageID(evt.Sender, evt.Timestamp), - - ConvertMessageFunc: convertDecryptionError, - } -} - -func convertDecryptionError(_ context.Context, _ *bridgev2.Portal, _ bridgev2.MatrixAPI, _ *events.DecryptionError) (*bridgev2.ConvertedMessage, error) { - return &bridgev2.ConvertedMessage{ - Parts: []*bridgev2.ConvertedMessagePart{{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: "Message couldn't be decrypted. It may have been in this chat or a group chat. Please check your Signal app.", - }, - }}, - }, nil -} - -type Bv2ChatEvent struct { - *events.ChatEvent - s *SignalClient -} - -var ( - _ bridgev2.RemoteMessage = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteEdit = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteEventWithTimestamp = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteReaction = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteReactionRemove = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteMessageRemove = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteTyping = (*Bv2ChatEvent)(nil) - _ bridgev2.RemotePreHandler = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteChatInfoChange = (*Bv2ChatEvent)(nil) - _ bridgev2.RemoteEventWithStreamOrder = (*Bv2ChatEvent)(nil) -) - -func (evt *Bv2ChatEvent) GetType() bridgev2.RemoteEventType { - switch innerEvt := evt.Event.(type) { - 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.GetRequiredProtocolVersion() > uint32(signalpb.DataMessage_CURRENT), - innerEvt.GetFlags()&uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE) != 0: - return bridgev2.RemoteEventMessage - case innerEvt.Reaction != nil: - if innerEvt.Reaction.GetRemove() { - return bridgev2.RemoteEventReactionRemove - } - return bridgev2.RemoteEventReaction - case innerEvt.Delete != nil, innerEvt.AdminDelete != nil: - return bridgev2.RemoteEventMessageRemove - case innerEvt.GetGroupV2().GetGroupChange() != nil: - return bridgev2.RemoteEventChatInfoChange - } - case *signalpb.EditMessage: - return bridgev2.RemoteEventEdit - case *signalpb.TypingMessage: - return bridgev2.RemoteEventTyping - } - return bridgev2.RemoteEventUnknown -} - -func (evt *Bv2ChatEvent) GetChatInfoChange(ctx context.Context) (*bridgev2.ChatInfoChange, error) { - dm, _ := evt.Event.(*signalpb.DataMessage) - gv2 := dm.GetGroupV2() - if gv2 == nil || gv2.GroupChange == nil { - return nil, fmt.Errorf("GetChatInfoChange() called for non-GroupChange event") - } - groupChange, err := evt.s.Client.DecryptGroupChange(ctx, gv2) - if err != nil { - return nil, fmt.Errorf("failed to decrypt group change: %w", err) - } - // XXX: is this ID compatible with types.GroupIdentifier? - return evt.s.groupChangeToChatInfoChange(ctx, types.GroupIdentifier(evt.Info.ChatID), gv2.GetRevision(), groupChange) -} - -func (evt *Bv2ChatEvent) PreHandle(ctx context.Context, portal *bridgev2.Portal) { - dataMsg, ok := evt.Event.(*signalpb.DataMessage) - if !ok || dataMsg.GroupV2 == nil { - return - } - portalRev := portal.Metadata.(*signalid.PortalMetadata).Revision - if evt.Info.GroupRevision > portalRev { - toRevision := evt.Info.GroupRevision - if dataMsg.GetGroupV2().GetGroupChange() != nil { - toRevision-- - } - evt.s.catchUpGroup(ctx, portal, portalRev, toRevision, dataMsg.GetTimestamp()) - } -} - -func (evt *Bv2ChatEvent) GetTimeout() time.Duration { - if evt.Event.(*signalpb.TypingMessage).GetAction() == signalpb.TypingMessage_STARTED { - return 15 * time.Second - } else { - return 0 - } -} - -func (evt *Bv2ChatEvent) GetPortalKey() networkid.PortalKey { - return evt.s.makePortalKey(evt.Info.ChatID) -} - -func (evt *Bv2ChatEvent) ShouldCreatePortal() bool { - return evt.GetType() == bridgev2.RemoteEventMessage || evt.GetType() == bridgev2.RemoteEventChatInfoChange -} - -func (evt *Bv2ChatEvent) AddLogContext(c zerolog.Context) zerolog.Context { - c = c.Stringer("sender_id", evt.Info.Sender) - switch innerEvt := evt.Event.(type) { - case *signalpb.DataMessage: - c = c.Uint64("message_ts", innerEvt.GetTimestamp()) - switch { - case innerEvt.Reaction != nil: - c = c.Uint64("reaction_target_ts", innerEvt.Reaction.GetTargetSentTimestamp()) - case innerEvt.Delete != nil: - c = c.Uint64("delete_target_ts", innerEvt.Delete.GetTargetSentTimestamp()) - } - case *signalpb.EditMessage: - c = c. - Uint64("edit_target_ts", innerEvt.GetTargetSentTimestamp()). - Uint64("edit_ts", innerEvt.GetDataMessage().GetTimestamp()) - } - return c -} - -func (evt *Bv2ChatEvent) GetSender() bridgev2.EventSender { - return evt.s.makeEventSender(evt.Info.Sender) -} - -func (evt *Bv2ChatEvent) GetID() networkid.MessageID { - ts := evt.getDataMsgTimestamp() - if ts == 0 { - return "" - } - return signalid.MakeMessageID(evt.Info.Sender, ts) -} - -func (evt *Bv2ChatEvent) getDataMsgTimestamp() uint64 { - switch innerEvt := evt.Event.(type) { - case *signalpb.DataMessage: - return innerEvt.GetTimestamp() - case *signalpb.EditMessage: - return innerEvt.GetDataMessage().GetTimestamp() - default: - return 0 - } -} - -func (evt *Bv2ChatEvent) GetTimestamp() time.Time { - ts := evt.getDataMsgTimestamp() - if ts == 0 { - return time.Now() - } - return time.UnixMilli(int64(ts)) -} - -func (evt *Bv2ChatEvent) GetTargetMessage() networkid.MessageID { - var targetAuthorACI uuid.UUID - 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()) - 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 "" - } - case *signalpb.EditMessage: - targetSentTS = innerEvt.GetTargetSentTimestamp() - default: - return "" - } - if targetAuthorACI == uuid.Nil { - targetAuthorACI = evt.Info.Sender - } - return signalid.MakeMessageID(targetAuthorACI, targetSentTS) -} - -func (evt *Bv2ChatEvent) GetReactionEmoji() (string, networkid.EmojiID) { - dataMsg, ok := evt.Event.(*signalpb.DataMessage) - if !ok || dataMsg.Reaction == nil { - panic(fmt.Errorf("GetReactionEmoji() called for non-reaction event")) - } - return dataMsg.GetReaction().GetEmoji(), "" -} - -func (evt *Bv2ChatEvent) GetRemovedEmojiID() networkid.EmojiID { - return "" -} - -func (evt *Bv2ChatEvent) ConvertMessage(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI) (*bridgev2.ConvertedMessage, error) { - dataMsg, ok := evt.Event.(*signalpb.DataMessage) - 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) - if converted.Disappear.Type != "" { - evtTS := evt.GetTimestamp() - if !dataMsg.GetIsViewOnce() { - portal.UpdateDisappearingSetting(ctx, converted.Disappear, bridgev2.UpdateDisappearingSettingOpts{ - Sender: intent, - Timestamp: evtTS, - Implicit: true, - Save: true, - SendNotice: true, - }) - } - if evt.Info.Sender == evt.s.Client.Store.ACI { - converted.Disappear.DisappearAt = evtTS.Add(converted.Disappear.Timer) - } - } - return converted, nil -} - -const editStubPartID networkid.PartID = "editstub" - -func isEditStub(msg *database.Message) bool { - return msg.PartID == editStubPartID -} - -// editStubMessage returns a non-bridged message part which is saved as a placeholder row pointing -// at the pre-edit ID of a message, such that duplicate checks on incoming edits find it and are -// dropped. This is necessary because the first time we see an edit it modifies the ID in place. -func editStubMessage() *bridgev2.ConvertedMessage { - return &bridgev2.ConvertedMessage{ - Parts: []*bridgev2.ConvertedMessagePart{{ - ID: editStubPartID, - Type: event.EventMessage, - Content: &event.MessageEventContent{}, - DontBridge: true, - }}, - } -} - -func (evt *Bv2ChatEvent) ConvertEdit(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, existing []*database.Message) (*bridgev2.ConvertedEdit, error) { - editMsg, ok := evt.Event.(*signalpb.EditMessage) - if !ok { - return nil, fmt.Errorf("ConvertEdit() called for non-EditMessage event") - } - existing = slices.DeleteFunc(slices.Clone(existing), isEditStub) - if len(existing) == 0 { - return nil, fmt.Errorf("%w: edit target has already been edited", bridgev2.ErrIgnoringRemoteEvent) - } - // 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) - // TODO can anything other than the text be edited? - editPart := converted.Parts[len(converted.Parts)-1].ToEditPart(existing[len(existing)-1]) - prevID := editPart.Part.ID - // Clone the database message struct to avoid mutating the ID. - // The ID from the original struct is used for AddedParts (we specifically want the old ID for that) - editPart.Part = ptr.Clone(editPart.Part) - editPart.Part.EditCount++ - editPart.Part.ID = signalid.MakeMessageID(evt.Info.Sender, editMsg.GetDataMessage().GetTimestamp()) - convertedEdit := &bridgev2.ConvertedEdit{ - ModifiedParts: []*bridgev2.ConvertedEditPart{editPart}, - } - if prevID != editPart.Part.ID { - convertedEdit.AddedParts = editStubMessage() - } - return convertedEdit, nil -} - -func (evt *Bv2ChatEvent) GetStreamOrder() int64 { - return int64(evt.Info.ServerTimestamp) -} - -type Bv2Receipt struct { - Type signalpb.ReceiptMessage_Type - Chat networkid.PortalKey - Sender bridgev2.EventSender - - LastTS time.Time - LastID networkid.MessageID - IDs []networkid.MessageID -} - -func (b *Bv2Receipt) GetType() bridgev2.RemoteEventType { - switch b.Type { - case signalpb.ReceiptMessage_READ: - return bridgev2.RemoteEventReadReceipt - case signalpb.ReceiptMessage_DELIVERY: - return bridgev2.RemoteEventDeliveryReceipt - default: - return bridgev2.RemoteEventUnknown - } -} - -func (b *Bv2Receipt) GetPortalKey() networkid.PortalKey { - return b.Chat -} - -func (b *Bv2Receipt) AddLogContext(c zerolog.Context) zerolog.Context { - return c. - Str("sender_id", string(b.Sender.Sender)). - Stringer("receipt_type", b.Type). - Array("message_ids", exzerolog.ArrayOfStrs(b.IDs)) -} - -func (b *Bv2Receipt) GetSender() bridgev2.EventSender { - return b.Sender -} - -func (b *Bv2Receipt) GetLastReceiptTarget() networkid.MessageID { - return b.LastID -} - -func (b *Bv2Receipt) GetReceiptTargets() []networkid.MessageID { - return b.IDs -} - -func (b *Bv2Receipt) GetReadUpTo() time.Time { - return time.Time{} -} - -var _ bridgev2.RemoteReadReceipt = (*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) - receipts := make(map[networkid.PortalKey]*Bv2Receipt) - for _, msgID := range input { - msg, err := getMessageFunc(ctx, msgID) - if err != nil { - log.Err(err).Any("message_id", msgID).Msg("Failed to get target message for receipt") - } else if msg == nil { - log.Debug().Any("message_id", msgID).Msg("Got receipt for unknown message") - } else { - receiptEvt, ok := receipts[msg.Room] - if !ok { - receiptEvt = &Bv2Receipt{Chat: msg.Room} - receipts[msg.Room] = receiptEvt - } - receiptEvt.IDs = append(receiptEvt.IDs, msg.ID) - if receiptEvt.LastTS.Before(msg.Timestamp) { - receiptEvt.LastTS = msg.Timestamp - receiptEvt.LastID = msg.ID - } - } - } - return receipts -} - -func (s *SignalClient) dispatchReceipts(sender uuid.UUID, receiptType signalpb.ReceiptMessage_Type, receipts map[networkid.PortalKey]*Bv2Receipt) bool { - evtSender := s.makeEventSender(sender) - for chat, receiptEvt := range receipts { - receiptEvt.Chat = chat - receiptEvt.Sender = evtSender - receiptEvt.Type = receiptType - if !s.Main.Bridge.QueueRemoteEvent(s.UserLogin, receiptEvt).Success { - return false - } - } - return true -} - -func (s *SignalClient) handleSignalReceipt(evt *events.Receipt) bool { - log := s.UserLogin.Log.With(). - Str("action", "handle signal receipt"). - Stringer("sender_id", evt.Sender). - Stringer("receipt_type", evt.Content.GetType()). - Logger() - ctx := log.WithContext(s.Main.Bridge.BackgroundCtx) - 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)) - }) - return s.dispatchReceipts(evt.Sender, evt.Content.GetType(), receipts) -} - -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) - receipts := convertReceipts(ctx, evt.Messages, func(ctx context.Context, msgInfo *signalpb.SyncMessage_Read) (*database.Message, error) { - aciUUID, err := signalmeow.ParseStringOrBinaryUUID(msgInfo.GetSenderAci(), msgInfo.GetSenderAciBinary()) - if err != nil { - return nil, err - } - return s.Main.Bridge.DB.Message.GetFirstPartByID(ctx, s.UserLogin.ID, signalid.MakeMessageID(aciUUID, msgInfo.GetTimestamp())) - }) - return s.dispatchReceipts(s.Client.Store.ACI, signalpb.ReceiptMessage_READ, receipts) -} - -func (s *SignalClient) conversationIDToPortalKey(ctx context.Context, cid *signalpb.ConversationIdentifier) (networkid.PortalKey, bool) { - log := zerolog.Ctx(ctx) - switch ident := cid.GetIdentifier().(type) { - case *signalpb.ConversationIdentifier_ThreadServiceId: - serviceID, err := libsignalgo.ServiceIDFromString(ident.ThreadServiceId) - if err != nil { - log.Err(err).Str("chat_id", ident.ThreadServiceId).Msg("Failed to parse delete for me conversation ID") - 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(). - Str("chat_id", base64.StdEncoding.EncodeToString(ident.ThreadGroupId)). - Msg("Invalid group ID length in delete for me conversation") - return networkid.PortalKey{}, false - } - return s.makePortalKey((*libsignalgo.GroupIdentifier)(ident.ThreadGroupId).String()), true - case *signalpb.ConversationIdentifier_ThreadE164: - log.Warn().Str("chat_id", ident.ThreadE164).Msg("Unsupported E164 conversation ID in delete for me") - return networkid.PortalKey{}, false - default: - log.Warn(). - Type("chat_id_type", ident). - Msg("Unsupported conversation ID protobuf type in delete for me") - return networkid.PortalKey{}, false - } -} - -func (s *SignalClient) addressableMessageToID(ctx context.Context, portalKey networkid.PortalKey, am *signalpb.AddressableMessage) networkid.MessageID { - log := zerolog.Ctx(ctx) - switch typedAuthor := am.GetAuthor().(type) { - case *signalpb.AddressableMessage_AuthorServiceId: - serviceID, err := libsignalgo.ServiceIDFromString(typedAuthor.AuthorServiceId) - if err != nil { - log.Err(err). - Object("portal_key", portalKey). - Str("author_service_id", typedAuthor.AuthorServiceId). - Msg("Failed to parse delete for me message author service ID") - return "" - } else if serviceID.Type != libsignalgo.ServiceIDTypeACI { - log.Warn(). - Object("portal_key", portalKey). - Str("author_service_id", typedAuthor.AuthorServiceId). - Msg("Dropping delete for me message with unsupported service ID type") - 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). - Str("author_e164", typedAuthor.AuthorE164). - Msg("Dropping delete for me message with unsupported E164 author") - return "" - default: - log.Warn(). - Object("portal_key", portalKey). - Type("author_type", typedAuthor). - Msg("Dropping delete for me message with unrecognized author protobuf type") - return "" - } -} - -func (s *SignalClient) handleSignalDeleteForMe(evt *events.DeleteForMe) bool { - log := s.UserLogin.Log.With(). - Str("action", "handle signal delete for me"). - Logger() - ctx := log.WithContext(s.Main.Bridge.BackgroundCtx) - for _, conv := range evt.GetConversationDeletes() { - if !conv.GetIsFullDelete() { - // Non-full deletes might mean clearing chats? - continue - } - portalKey, ok := s.conversationIDToPortalKey(ctx, conv.GetConversation()) - if !ok { - continue - } - - res := s.UserLogin.QueueRemoteEvent(&simplevent.ChatDelete{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventChatDelete, - PortalKey: portalKey, - Timestamp: time.UnixMilli(int64(evt.Timestamp)), - StreamOrder: int64(evt.Timestamp), - }, - OnlyForMe: true, - }) - if !res.Success { - return false - } - } - for _, conv := range evt.GetLocalOnlyConversationDeletes() { - portalKey, ok := s.conversationIDToPortalKey(ctx, conv.GetConversation()) - if !ok { - continue - } - - res := s.UserLogin.QueueRemoteEvent(&simplevent.ChatDelete{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventChatDelete, - PortalKey: portalKey, - Timestamp: time.UnixMilli(int64(evt.Timestamp)), - StreamOrder: int64(evt.Timestamp), - }, - OnlyForMe: true, - }) - if !res.Success { - return false - } - } - for _, conv := range evt.GetMessageDeletes() { - portalKey, ok := s.conversationIDToPortalKey(ctx, conv.GetConversation()) - if !ok { - continue - } - for _, msg := range conv.GetMessages() { - msgID := s.addressableMessageToID(ctx, portalKey, msg) - if msgID == "" { - continue - } - res := s.UserLogin.QueueRemoteEvent(&simplevent.MessageRemove{ - EventMeta: simplevent.EventMeta{ - Type: bridgev2.RemoteEventMessageRemove, - PortalKey: portalKey, - Timestamp: time.UnixMilli(int64(evt.Timestamp)), - StreamOrder: int64(evt.Timestamp), - }, - OnlyForMe: true, - TargetMessage: msgID, - }) - if !res.Success { - return false - } - } - } - 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) - pniPortalKey := s.makeDMPortalKey(evt.PNI) - aciPortalKey := s.makeDMPortalKey(evt.ACI) - result, portal, err := s.Main.Bridge.ReIDPortal(ctx, pniPortalKey, aciPortalKey) - if err != nil { - log.Err(err).Msg("Failed to re-ID portal") - } else if result == bridgev2.ReIDResultSourceReIDd || result == bridgev2.ReIDResultTargetDeletedAndSourceReIDd { - // If the source portal is re-ID'd, we need to sync metadata and participants. - // If the source is deleted, then it doesn't matter, any existing target will already be correct - info, err := s.GetChatInfo(ctx, portal) - if err != nil { - log.Err(err).Msg("Failed to get chat info to update portal after re-ID") - } else { - portal.UpdateInfo(ctx, info, s.UserLogin, nil, time.Time{}) - } - } -} - -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) - for _, contact := range evt.Contacts { - if contact.ACI == uuid.Nil { - continue - } - if !evt.IsFromDB { - fullContact, err := s.Client.ContactByACI(ctx, contact.ACI) - if err != nil { - log.Err(err).Msg("Failed to get full contact info from store") - continue - } - fullContact.ContactAvatar = contact.ContactAvatar - contact = fullContact - } - ghost, err := s.Main.Bridge.GetGhostByID(ctx, signalid.MakeUserID(contact.ACI)) - if err != nil { - log.Err(err).Msg("Failed to get ghost to update contact info") - continue - } - userInfo, err := s.contactToUserInfo(ctx, contact) - if err != nil { - log.Err(err).Msg("Failed to convert contact info") - continue - } - ghost.UpdateInfo(ctx, userInfo) - 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") - } -} - -func (s *SignalClient) updateRemoteProfile(ctx context.Context, resendState bool) { - var err error - if s.Ghost == nil { - s.Ghost, err = s.Main.Bridge.GetGhostByID(ctx, signalid.MakeUserID(s.Client.Store.ACI)) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to get ghost for remote profile update") - return - } - } - changed := false - if s.UserLogin.RemoteProfile.Name != s.Ghost.Name { - s.UserLogin.RemoteProfile.Name = s.Ghost.Name - changed = true - } - if s.UserLogin.RemoteProfile.Avatar != s.Ghost.AvatarMXC { - s.UserLogin.RemoteProfile.Avatar = s.Ghost.AvatarMXC - changed = true - } - if len(s.Ghost.Identifiers) > 0 && strings.HasPrefix(s.Ghost.Identifiers[0], "tel:") { - phone := strings.TrimPrefix(s.Ghost.Identifiers[0], "tel:") - if s.UserLogin.RemoteProfile.Phone != phone { - s.UserLogin.RemoteProfile.Phone = phone - changed = true - } - } - if changed { - err = s.UserLogin.Save(ctx) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to save updated remote profile") - } - if resendState { - // TODO this has potential race conditions - s.UserLogin.BridgeState.Send(s.UserLogin.BridgeState.GetPrevUnsent()) - } - } -} diff --git a/pkg/connector/id.go b/pkg/connector/id.go deleted file mode 100644 index 4c3f123..0000000 --- a/pkg/connector/id.go +++ /dev/null @@ -1,69 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "fmt" - - "github.com/google/uuid" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/networkid" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalid" -) - -func (s *SignalClient) makePortalKey(chatID string) networkid.PortalKey { - key := networkid.PortalKey{ID: networkid.PortalID(chatID)} - // For non-group chats, add receiver - if s.Main.Bridge.Config.SplitPortals || len(chatID) != 44 { - key.Receiver = s.UserLogin.ID - } - return key -} - -func (s *SignalClient) makeDMPortalKey(serviceID libsignalgo.ServiceID) networkid.PortalKey { - return networkid.PortalKey{ - ID: signalid.MakeDMPortalID(serviceID), - Receiver: s.UserLogin.ID, - } -} - -func (s *SignalClient) makeEventSender(sender uuid.UUID) bridgev2.EventSender { - return bridgev2.EventSender{ - IsFromMe: sender == s.Client.Store.ACI, - SenderLogin: signalid.MakeUserLoginID(sender), - Sender: signalid.MakeUserID(sender), - } -} - -func (s *SignalClient) makePNIEventSender(sender uuid.UUID) bridgev2.EventSender { - return bridgev2.EventSender{ - Sender: signalid.MakeUserIDFromServiceID(libsignalgo.NewPNIServiceID(sender)), - } -} - -func (s *SignalClient) makeEventSenderFromServiceID(serviceID libsignalgo.ServiceID) bridgev2.EventSender { - switch serviceID.Type { - case libsignalgo.ServiceIDTypeACI: - return s.makeEventSender(serviceID.UUID) - case libsignalgo.ServiceIDTypePNI: - return s.makePNIEventSender(serviceID.UUID) - default: - panic(fmt.Errorf("invalid service ID type %d", serviceID.Type)) - } -} diff --git a/pkg/connector/login.go b/pkg/connector/login.go deleted file mode 100644 index 60fb936..0000000 --- a/pkg/connector/login.go +++ /dev/null @@ -1,244 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 connector - -import ( - "context" - "errors" - "fmt" - "net/http" - "time" - - "github.com/coder/websocket" - "github.com/google/uuid" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/database" - "maunium.net/go/mautrix/bridgev2/status" - - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" - "go.mau.fi/mautrix-signal/pkg/signalmeow/store" -) - -func (s *SignalConnector) GetLoginFlows() []bridgev2.LoginFlow { - return []bridgev2.LoginFlow{{ - Name: "QR", - Description: "Scan a QR code to pair the bridge to your Signal app", - ID: "qr", - }} -} - -func (s *SignalConnector) CreateLogin(ctx context.Context, user *bridgev2.User, flowID string) (bridgev2.LoginProcess, error) { - if flowID != "qr" { - return nil, bridgev2.ErrInvalidLoginFlowID - } - return &QRLogin{User: user, Main: s}, nil -} - -type QRLogin struct { - User *bridgev2.User - Main *SignalConnector - cancelChan context.CancelFunc - ProvChan chan signalmeow.ProvisioningResponse - newQRCount int -} - -var _ bridgev2.LoginProcessDisplayAndWait = (*QRLogin)(nil) - -func (qr *QRLogin) Cancel() { - qr.cancelChan() - go func() { - for range qr.ProvChan { - } - }() -} - -const ( - LoginStepQR = "fi.mau.signal.login.qr" - LoginStepComplete = "fi.mau.signal.login.complete" -) - -const ( - qrRefreshInterval = 45 * time.Second - maxQRRefreshes = 20 -) - -var ( - ErrLoginTimedOut = bridgev2.RespError{ - ErrCode: "FI.MAU.BRIDGE.LOGIN_TIMED_OUT", - Err: "The QR code wasn't scanned in time, please start a new login", - StatusCode: http.StatusGone, - } - ErrLoginCancelled = bridgev2.RespError{ - ErrCode: "FI.MAU.BRIDGE.LOGIN_CANCELLED", - Err: "Login process was cancelled", - StatusCode: http.StatusGone, - } - ErrDeviceLinkMissingCapability = bridgev2.RespError{ - ErrCode: "FI.MAU.SIGNAL.DEVICE_LINK_MISSING_CAPABILITY", - Err: "Signal rejected linking because the bridge is missing a capability required by your account's other devices. Please try again later", - StatusCode: http.StatusConflict, - } - ErrDeviceLimitReached = bridgev2.RespError{ - ErrCode: "FI.MAU.SIGNAL.DEVICE_LIMIT_REACHED", - Err: "Your Signal account already has the maximum number of linked devices. Remove one in the Signal app and try again", - StatusCode: http.StatusBadRequest, - } - ErrDeviceLinkCodeInvalid = bridgev2.RespError{ - ErrCode: "FI.MAU.SIGNAL.DEVICE_LINK_CODE_INVALID", - Err: "The scanned QR code was invalid or already used, please start a new login", - StatusCode: http.StatusForbidden, - } - ErrDeviceLinkRateLimited = bridgev2.RespError{ - ErrCode: "FI.MAU.SIGNAL.DEVICE_LINK_RATE_LIMITED", - Err: "Signal rate-limited the linking attempt, please wait a few minutes and try again", - StatusCode: http.StatusTooManyRequests, - } - ErrDeviceLinkRejected = bridgev2.RespError{ - ErrCode: "FI.MAU.SIGNAL.DEVICE_LINK_REJECTED", - Err: "Signal rejected linking the device", - StatusCode: http.StatusBadRequest, - } -) - -// Statuses of PUT /v1/devices/link, per Signal-Server's DeviceController -func wrapProvisioningError(err error) error { - var linkErr signalmeow.DeviceLinkError - if errors.As(err, &linkErr) { - switch linkErr.StatusCode { - case http.StatusConflict: - return ErrDeviceLinkMissingCapability - case http.StatusLengthRequired: - return ErrDeviceLimitReached - case http.StatusForbidden: - return ErrDeviceLinkCodeInvalid - case http.StatusTooManyRequests: - return ErrDeviceLinkRateLimited - default: - if linkErr.Message != "" { - return ErrDeviceLinkRejected.AppendMessage(" (HTTP %d: %s)", linkErr.StatusCode, linkErr.Message) - } - return ErrDeviceLinkRejected.AppendMessage(" (HTTP %d)", linkErr.StatusCode) - } - } - if websocket.CloseStatus(err) == websocket.StatusGoingAway { - return ErrLoginTimedOut - } - return err -} - -func (qr *QRLogin) Start(ctx context.Context) (*bridgev2.LoginStep, error) { - log := qr.Main.Bridge.Log.With(). - Str("action", "login"). - Stringer("user_id", qr.User.MXID). - Logger() - provCtx, cancel := context.WithCancel(log.WithContext(qr.Main.Bridge.BackgroundCtx)) - qr.cancelChan = cancel - // Don't use the start context here: the channel will outlive the start request. - qr.ProvChan = signalmeow.PerformProvisioning( - provCtx, qr.Main.Store, qr.Main.Config.DeviceName, qr.Main.Bridge.Config.Backfill.Enabled, - ) - var resp signalmeow.ProvisioningResponse - select { - case resp = <-qr.ProvChan: - if resp.Err != nil { - return nil, wrapProvisioningError(resp.Err) - } else if resp.State != signalmeow.StateProvisioningURLReceived { - return nil, fmt.Errorf("unexpected state %v", resp.State) - } - case <-ctx.Done(): - cancel() - if errors.Is(ctx.Err(), context.DeadlineExceeded) { - return nil, ErrLoginTimedOut - } - return nil, ErrLoginCancelled - } - return &bridgev2.LoginStep{ - Type: bridgev2.LoginStepTypeDisplayAndWait, - StepID: LoginStepQR, - Instructions: "Scan the QR code on your Signal app to log in", - DisplayAndWaitParams: &bridgev2.LoginDisplayAndWaitParams{ - Type: bridgev2.LoginDisplayTypeQR, - Data: resp.ProvisioningURL, - }, - }, nil -} - -func (qr *QRLogin) Wait(ctx context.Context) (*bridgev2.LoginStep, error) { - if qr.ProvChan == nil { - return nil, fmt.Errorf("login not started") - } - - select { - case resp := <-qr.ProvChan: - if resp.Err != nil { - qr.cancelChan() - return nil, wrapProvisioningError(resp.Err) - } else if resp.State != signalmeow.StateProvisioningDataReceived { - qr.cancelChan() - return nil, fmt.Errorf("unexpected state %v", resp.State) - } else if resp.ProvisioningData.ACI == uuid.Nil { - qr.cancelChan() - return nil, fmt.Errorf("no signal account ID received") - } - return qr.loginComplete(ctx, resp.ProvisioningData) - - // 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. - case <-time.After(qrRefreshInterval): - qr.cancelChan() - qr.newQRCount++ - if qr.newQRCount >= maxQRRefreshes { - return nil, ErrLoginTimedOut - } - return qr.Start(ctx) - - case <-ctx.Done(): - qr.cancelChan() - if errors.Is(ctx.Err(), context.DeadlineExceeded) { - return nil, ErrLoginTimedOut - } - return nil, ErrLoginCancelled - } -} - -func (qr *QRLogin) loginComplete(ctx context.Context, provData *store.DeviceData) (*bridgev2.LoginStep, error) { - defer qr.cancelChan() - ul, err := qr.User.NewLogin(ctx, &database.UserLogin{ - ID: signalid.MakeUserLoginID(provData.ACI), - RemoteName: provData.Number, - RemoteProfile: status.RemoteProfile{ - Phone: provData.Number, - }, - Metadata: &signalid.UserLoginMetadata{}, - }, &bridgev2.NewLoginParams{ - DeleteOnConflict: true, - }) - if err != nil { - return nil, fmt.Errorf("failed to create user login: %w", err) - } - ul.Client.(*SignalClient).postLoginConnect() - return &bridgev2.LoginStep{ - Type: bridgev2.LoginStepTypeComplete, - StepID: LoginStepComplete, - Instructions: fmt.Sprintf("Successfully logged in as %s / %s", provData.Number, provData.ACI), - CompleteParams: &bridgev2.LoginCompleteParams{ - UserLoginID: ul.ID, - UserLogin: ul, - }, - }, nil -} diff --git a/pkg/libsignalgo/accountentropy.go b/pkg/libsignalgo/accountentropy.go deleted file mode 100644 index 712f886..0000000 --- a/pkg/libsignalgo/accountentropy.go +++ /dev/null @@ -1,56 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2024 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 "runtime" - -type AccountEntropyPool string -type SVRKey = fixedArray32 - -func (aep AccountEntropyPool) DeriveSVRKey() ([]byte, error) { - var out SVRKey - aepC, free := GoStringToCString(string(aep)) - defer free() - signalFfiError := C.signal_account_entropy_pool_derive_svr_key( - out.cFixedArray(), - aepC, - ) - runtime.KeepAlive(aep) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return out[:], nil -} - -func (aep AccountEntropyPool) DeriveBackupKey() ([]byte, error) { - var out BackupKey - aepC, free := GoStringToCString(string(aep)) - defer free() - signalFfiError := C.signal_account_entropy_pool_derive_backup_key( - out.cFixedArray(), - aepC, - ) - runtime.KeepAlive(aep) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return out[:], nil -} diff --git a/pkg/libsignalgo/address.go b/pkg/libsignalgo/address.go index 8865816..fc6efa2 100644 --- a/pkg/libsignalgo/address.go +++ b/pkg/libsignalgo/address.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,11 +17,14 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" import ( "runtime" + + "github.com/google/uuid" ) type Address struct { @@ -36,46 +38,45 @@ func wrapAddress(ptr *C.SignalProtocolAddress) *Address { return address } +func NewUUIDAddress(u uuid.UUID, deviceID uint) (*Address, error) { + return newAddress(u.String(), deviceID) +} + func NewUUIDAddressFromString(uuidStr string, deviceID uint) (*Address, error) { - serviceID, err := ServiceIDFromString(uuidStr) + parsed, err := uuid.Parse(uuidStr) if err != nil { return nil, err } - return serviceID.Address(deviceID) + return NewUUIDAddress(parsed, deviceID) +} + +// Deprecated: phone addresses are not used anymore +func NewPhoneAddress(phone string, deviceID uint) (*Address, error) { + return newAddress(phone, deviceID) } func newAddress(name string, deviceID uint) (*Address, error) { - var pa C.SignalMutPointerProtocolAddress - nameStr, freeNameStr := GoStringToCString(name) - defer freeNameStr() - signalFfiError := C.signal_address_new(&pa, nameStr, C.uint(deviceID)) + var pa *C.SignalProtocolAddress + signalFfiError := C.signal_address_new(&pa, C.CString(name), C.uint(deviceID)) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapAddress(pa.raw), nil -} - -func (pa *Address) mutPtr() C.SignalMutPointerProtocolAddress { - return C.SignalMutPointerProtocolAddress{pa.ptr} -} - -func (pa *Address) constPtr() C.SignalConstPointerProtocolAddress { - return C.SignalConstPointerProtocolAddress{pa.ptr} + return wrapAddress(pa), nil } func (pa *Address) Clone() (*Address, error) { - var cloned C.SignalMutPointerProtocolAddress - signalFfiError := C.signal_address_clone(&cloned, pa.constPtr()) + var cloned *C.SignalProtocolAddress + signalFfiError := C.signal_address_clone(&cloned, pa.ptr) runtime.KeepAlive(pa) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapAddress(cloned.raw), nil + return wrapAddress(cloned), nil } func (pa *Address) Destroy() error { pa.CancelFinalizer() - return wrapError(C.signal_address_destroy(pa.mutPtr())) + return wrapError(C.signal_address_destroy(pa.ptr)) } func (pa *Address) CancelFinalizer() { @@ -83,8 +84,8 @@ func (pa *Address) CancelFinalizer() { } func (pa *Address) Name() (string, error) { - var name C.SignalCStringPtr - signalFfiError := C.signal_address_get_name(&name, pa.constPtr()) + var name *C.char + signalFfiError := C.signal_address_get_name(&name, pa.ptr) runtime.KeepAlive(pa) if signalFfiError != nil { return "", wrapError(signalFfiError) @@ -92,17 +93,17 @@ func (pa *Address) Name() (string, error) { return CopyCStringToString(name), nil } -func (pa *Address) NameServiceID() (ServiceID, error) { +func (pa *Address) NameUUID() (uuid.UUID, error) { name, err := pa.Name() if err != nil { - return ServiceID{}, err + return uuid.Nil, err } - return ServiceIDFromString(name) + return uuid.Parse(name) } func (pa *Address) DeviceID() (uint, error) { var deviceID C.uint - signalFfiError := C.signal_address_get_device_id(&deviceID, pa.constPtr()) + signalFfiError := C.signal_address_get_device_id(&deviceID, pa.ptr) runtime.KeepAlive(pa) if signalFfiError != nil { return 0, wrapError(signalFfiError) diff --git a/pkg/libsignalgo/address_test.go b/pkg/libsignalgo/address_test.go index b72eb2f..4026cb5 100644 --- a/pkg/libsignalgo/address_test.go +++ b/pkg/libsignalgo/address_test.go @@ -19,7 +19,6 @@ package libsignalgo_test import ( "testing" - "github.com/google/uuid" "github.com/stretchr/testify/assert" "go.mau.fi/mautrix-signal/pkg/libsignalgo" @@ -29,14 +28,12 @@ import ( func TestAddress(t *testing.T) { setupLogging() - testUUID := uuid.New() - - addr, err := libsignalgo.NewPNIServiceID(testUUID).Address(5) + addr, err := libsignalgo.NewPhoneAddress("addr1", 5) assert.NoError(t, err) name, err := addr.Name() assert.NoError(t, err) - assert.Equal(t, "PNI:"+testUUID.String(), name) + assert.Equal(t, "addr1", name) deviceID, err := addr.DeviceID() assert.NoError(t, err) diff --git a/pkg/libsignalgo/aes256gcmsiv.go b/pkg/libsignalgo/aes256gcmsiv.go index b02617d..f6fd2c8 100644 --- a/pkg/libsignalgo/aes256gcmsiv.go +++ b/pkg/libsignalgo/aes256gcmsiv.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -35,37 +35,23 @@ func wrapAES256_GCM_SIV(ptr *C.SignalAes256GcmSiv) *AES256_GCM_SIV { } func NewAES256_GCM_SIV(key []byte) (*AES256_GCM_SIV, error) { - var aes C.SignalMutPointerAes256GcmSiv + var aes *C.SignalAes256GcmSiv signalFfiError := C.signal_aes256_gcm_siv_new(&aes, BytesToBuffer(key)) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapAES256_GCM_SIV(aes.raw), nil -} - -func (aes *AES256_GCM_SIV) mutPtr() C.SignalMutPointerAes256GcmSiv { - return C.SignalMutPointerAes256GcmSiv{aes.ptr} -} - -func (aes *AES256_GCM_SIV) constPtr() C.SignalConstPointerAes256GcmSiv { - return C.SignalConstPointerAes256GcmSiv{aes.ptr} + return wrapAES256_GCM_SIV(aes), nil } func (aes *AES256_GCM_SIV) Destroy() error { runtime.SetFinalizer(aes, nil) - return wrapError(C.signal_aes256_gcm_siv_destroy(C.SignalMutPointerAes256GcmSiv{raw: aes.ptr})) + return wrapError(C.signal_aes256_gcm_siv_destroy(aes.ptr)) } func (aes *AES256_GCM_SIV) Encrypt(plaintext, nonce, associatedData []byte) ([]byte, error) { var encrypted C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_aes256_gcm_siv_encrypt( - &encrypted, - C.SignalConstPointerAes256GcmSiv{raw: aes.ptr}, - BytesToBuffer(plaintext), - BytesToBuffer(nonce), - BytesToBuffer(associatedData), - ) + signalFfiError := C.signal_aes256_gcm_siv_encrypt(&encrypted, aes.ptr, BytesToBuffer(plaintext), BytesToBuffer(nonce), BytesToBuffer(associatedData)) runtime.KeepAlive(aes) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -75,14 +61,7 @@ func (aes *AES256_GCM_SIV) Encrypt(plaintext, nonce, associatedData []byte) ([]b func (aes *AES256_GCM_SIV) Decrypt(ciphertext, nonce, associatedData []byte) ([]byte, error) { var decrypted C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_aes256_gcm_siv_decrypt( - &decrypted, - C.SignalConstPointerAes256GcmSiv{raw: aes.ptr}, - BytesToBuffer(ciphertext), - BytesToBuffer(nonce), - BytesToBuffer(associatedData), - ) - runtime.KeepAlive(aes) + signalFfiError := C.signal_aes256_gcm_siv_decrypt(&decrypted, aes.ptr, BytesToBuffer(ciphertext), BytesToBuffer(nonce), BytesToBuffer(associatedData)) if signalFfiError != nil { return nil, wrapError(signalFfiError) } diff --git a/pkg/libsignalgo/authcredential.go b/pkg/libsignalgo/authcredential.go index 0a1edfc..a0a0bc9 100644 --- a/pkg/libsignalgo/authcredential.go +++ b/pkg/libsignalgo/authcredential.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Scott Weber -// 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 @@ -18,23 +17,21 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" #include */ import "C" import ( - "fmt" + "unsafe" "github.com/google/uuid" ) -// type AuthCredential [181]byte -// type AuthCredentialResponse [361]byte -const AuthCredentialWithPniLength = 265 -const AuthCredentialWithPniResponseLength = 425 - -type AuthCredentialWithPni [AuthCredentialWithPniLength]byte -type AuthCredentialWithPniResponse [AuthCredentialWithPniResponseLength]byte +// type AuthCredential [C.SignalAUTH_CREDENTIAL_LEN]byte +// type AuthCredentialResponse [C.SignalAUTH_CREDENTIAL_RESPONSE_LEN]byte +type AuthCredentialWithPni [C.SignalAUTH_CREDENTIAL_WITH_PNI_LEN]byte +type AuthCredentialWithPniResponse [C.SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN]byte type AuthCredentialPresentation []byte func (ac *AuthCredentialWithPni) Slice() []byte { @@ -42,36 +39,40 @@ func (ac *AuthCredentialWithPni) Slice() []byte { } func ReceiveAuthCredentialWithPni( - serverPublicParams *ServerPublicParams, + serverPublicParams ServerPublicParams, aci uuid.UUID, pni uuid.UUID, redemptionTime uint64, authCredResponse AuthCredentialWithPniResponse, ) (*AuthCredentialWithPni, error) { - var c_result C.SignalOwnedBuffer = C.SignalOwnedBuffer{} + c_result := [C.SignalAUTH_CREDENTIAL_WITH_PNI_LEN]C.uchar{} + c_serverPublicParams := (*[C.SignalSERVER_PUBLIC_PARAMS_LEN]C.uchar)(unsafe.Pointer(&serverPublicParams[0])) + c_aci, err := SignalServiceIDFromUUID(aci) + if err != nil { + return nil, err + } + c_pni, err := SignalPNIServiceIDFromUUID(pni) + if err != nil { + return nil, err + } + c_authCredResponse := (*[C.SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN]C.uchar)(unsafe.Pointer(&authCredResponse[0])) - signalFfiError := C.signal_server_public_params_receive_auth_credential_with_pni_as_service_id( + signalFfiError := C.signal_server_public_params_receive_auth_credential_with_pni_as_aci( &c_result, - C.SignalConstPointerServerPublicParams{serverPublicParams}, - NewACIServiceID(aci).cConstFixedArray(), - NewPNIServiceID(pni).cConstFixedArray(), + c_serverPublicParams, + c_aci, + c_pni, C.uint64_t(redemptionTime), - BytesToBuffer(authCredResponse[:]), + c_authCredResponse, ) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - resultBytes := CopySignalOwnedBufferToBytes(c_result) - if len(resultBytes) != AuthCredentialWithPniLength { - return nil, fmt.Errorf("invalid response length %d (expected %d)", len(resultBytes), AuthCredentialWithPniLength) - } - return (*AuthCredentialWithPni)(resultBytes), nil + result := AuthCredentialWithPni(C.GoBytes(unsafe.Pointer(&c_result), C.int(C.SignalAUTH_CREDENTIAL_WITH_PNI_LEN))) + return &result, nil } func NewAuthCredentialWithPniResponse(b []byte) (*AuthCredentialWithPniResponse, error) { - if len(b) != AuthCredentialWithPniResponseLength { - return nil, fmt.Errorf("invalid auth credential with pni response length %d (expected %d)", len(b), AuthCredentialWithPniResponseLength) - } borrowedBuffer := BytesToBuffer(b) signalFfiError := C.signal_auth_credential_with_pni_response_check_valid_contents(borrowedBuffer) if signalFfiError != nil { @@ -82,19 +83,23 @@ func NewAuthCredentialWithPniResponse(b []byte) (*AuthCredentialWithPniResponse, } func CreateAuthCredentialWithPniPresentation( - serverPublicParams *ServerPublicParams, + serverPublicParams ServerPublicParams, randomness Randomness, groupSecretParams GroupSecretParams, authCredWithPni AuthCredentialWithPni, ) (*AuthCredentialPresentation, error) { var c_result C.SignalOwnedBuffer = C.SignalOwnedBuffer{} + c_serverPublicParams := (*[C.SignalSERVER_PUBLIC_PARAMS_LEN]C.uchar)(unsafe.Pointer(&serverPublicParams[0])) + c_randomness := (*[C.SignalRANDOMNESS_LEN]C.uchar)(unsafe.Pointer(&randomness[0])) + c_groupSecretParams := (*[C.SignalGROUP_SECRET_PARAMS_LEN]C.uchar)(unsafe.Pointer(&groupSecretParams[0])) + c_authCredWithPni := (*[C.SignalAUTH_CREDENTIAL_WITH_PNI_LEN]C.uchar)(unsafe.Pointer(&authCredWithPni[0])) signalFfiError := C.signal_server_public_params_create_auth_credential_with_pni_presentation_deterministic( &c_result, - C.SignalConstPointerServerPublicParams{serverPublicParams}, - randomness.cConstFixedArray(), - groupSecretParams.cConstFixedArray(), - BytesToBuffer(authCredWithPni[:]), + c_serverPublicParams, + c_randomness, + c_groupSecretParams, + c_authCredWithPni, ) if signalFfiError != nil { return nil, wrapError(signalFfiError) diff --git a/pkg/libsignalgo/backupkey.go b/pkg/libsignalgo/backupkey.go deleted file mode 100644 index b5f53f2..0000000 --- a/pkg/libsignalgo/backupkey.go +++ /dev/null @@ -1,152 +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 ( - "runtime" - "unsafe" - - "go.mau.fi/util/random" -) - -const BackupKeyLength = 32 - -type BackupKey [BackupKeyLength]byte - -func (bk *BackupKey) Slice() []byte { - if bk == nil { - return nil - } - return bk[:] -} - -const BackupIDLength = 16 - -type BackupID = fixedArray16 -type BackupMetadataKey = fixedArray32 -type BackupMediaID = fixedArray15 -type BackupMediaKey = fixedArray64 - -func (bk *BackupKey) cFixedArray() *C.SignalType_FixedArray32_uint8_t { - return (*C.SignalType_FixedArray32_uint8_t)(unsafe.Pointer(bk)) -} - -func (bk *BackupKey) cConstFixedArray() cFixedArray32Compat { - return cFixedArray32Compat(bk.cFixedArray()) -} - -func GenerateRandomBackupKey() *BackupKey { - return (*BackupKey)(random.Bytes(BackupKeyLength)) -} - -func BytesToBackupKey(bytes []byte) *BackupKey { - if len(bytes) != BackupKeyLength { - return nil - } - return (*BackupKey)(bytes) -} - -func (bk *BackupKey) DeriveBackupID(aci ServiceID) (*BackupID, error) { - var out BackupID - signalFfiError := C.signal_backup_key_derive_backup_id( - out.cFixedArray(), - bk.cConstFixedArray(), - aci.cConstFixedArray(), - ) - runtime.KeepAlive(bk) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &out, nil -} - -func (bk *BackupKey) DeriveECKey(aci ServiceID) (*PrivateKey, error) { - var out C.SignalMutPointerPrivateKey - signalFfiError := C.signal_backup_key_derive_ec_key( - &out, - bk.cConstFixedArray(), - aci.cConstFixedArray(), - ) - runtime.KeepAlive(bk) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return wrapPrivateKey(out.raw), nil -} - -func (bk *BackupKey) DeriveLocalBackupMetadataKey() (*BackupMetadataKey, error) { - var out BackupMetadataKey - signalFfiError := C.signal_backup_key_derive_local_backup_metadata_key( - out.cFixedArray(), - bk.cConstFixedArray(), - ) - runtime.KeepAlive(bk) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &out, nil -} - -func (bk *BackupKey) DeriveMediaID(mediaName string) (*BackupMediaID, error) { - var out BackupMediaID - mediaNameStr, mediaNameFree := GoStringToCString(mediaName) - defer mediaNameFree() - signalFfiError := C.signal_backup_key_derive_media_id( - out.cFixedArray(), - bk.cConstFixedArray(), - mediaNameStr, - ) - runtime.KeepAlive(bk) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &out, nil -} - -func (bk *BackupKey) DeriveMediaEncryptionKey(mediaID *BackupMediaID) (*BackupMediaKey, error) { - var out BackupMediaKey - signalFfiError := C.signal_backup_key_derive_media_encryption_key( - out.cFixedArray(), - bk.cConstFixedArray(), - mediaID.cConstFixedArray(), - ) - runtime.KeepAlive(bk) - runtime.KeepAlive(mediaID) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &out, nil -} - -func (bk *BackupKey) DeriveThumbnailTransitEncryptionKey(mediaID *BackupMediaID) (*BackupMediaKey, error) { - var out BackupMediaKey - signalFfiError := C.signal_backup_key_derive_thumbnail_transit_encryption_key( - out.cFixedArray(), - bk.cConstFixedArray(), - mediaID.cConstFixedArray(), - ) - runtime.KeepAlive(bk) - runtime.KeepAlive(mediaID) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &out, nil -} diff --git a/pkg/libsignalgo/buffer.go b/pkg/libsignalgo/buffer.go index b3f2c3f..2758590 100644 --- a/pkg/libsignalgo/buffer.go +++ b/pkg/libsignalgo/buffer.go @@ -17,18 +17,15 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" import ( - "runtime" "unsafe" ) func BorrowedMutableBuffer(length int) C.SignalBorrowedMutableBuffer { - if length <= 0 { - return C.SignalBorrowedMutableBuffer{} - } data := make([]byte, length) return C.SignalBorrowedMutableBuffer{ base: (*C.uchar)(unsafe.Pointer(&data[0])), @@ -46,21 +43,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 { - 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 deleted file mode 100644 index 50530d9..0000000 --- a/pkg/libsignalgo/cflags.go +++ /dev/null @@ -1,12 +0,0 @@ -package libsignalgo - -/* -#cgo LDFLAGS: -lsignal_ffi -ldl -lm -lz -lstdc++ -*/ -import "C" - -import ( - "go.mau.fi/mautrix-signal/pkg/libsignalgo/signalversion" -) - -const Version = signalversion.Version diff --git a/pkg/libsignalgo/ciphertextmessage.go b/pkg/libsignalgo/ciphertextmessage.go index bb2108f..f783ad8 100644 --- a/pkg/libsignalgo/ciphertextmessage.go +++ b/pkg/libsignalgo/ciphertextmessage.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -44,29 +44,17 @@ func wrapCiphertextMessage(ptr *C.SignalCiphertextMessage) *CiphertextMessage { } func NewCiphertextMessage(plaintext *PlaintextContent) (*CiphertextMessage, error) { - var ciphertextMessage C.SignalMutPointerCiphertextMessage - signalFfiError := C.signal_ciphertext_message_from_plaintext_content( - &ciphertextMessage, - plaintext.constPtr(), - ) - runtime.KeepAlive(plaintext) + var ciphertextMessage *C.SignalCiphertextMessage + signalFfiError := C.signal_ciphertext_message_from_plaintext_content(&ciphertextMessage, plaintext.ptr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapCiphertextMessage(ciphertextMessage.raw), nil -} - -func (c *CiphertextMessage) mutPtr() C.SignalMutPointerCiphertextMessage { - return C.SignalMutPointerCiphertextMessage{c.ptr} -} - -func (c *CiphertextMessage) constPtr() C.SignalConstPointerCiphertextMessage { - return C.SignalConstPointerCiphertextMessage{c.ptr} + return wrapCiphertextMessage(ciphertextMessage), nil } func (c *CiphertextMessage) Destroy() error { c.CancelFinalizer() - return wrapError(C.signal_ciphertext_message_destroy(c.mutPtr())) + return wrapError(C.signal_ciphertext_message_destroy(c.ptr)) } func (c *CiphertextMessage) CancelFinalizer() { @@ -75,7 +63,7 @@ func (c *CiphertextMessage) CancelFinalizer() { func (c *CiphertextMessage) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_ciphertext_message_serialize(&serialized, c.constPtr()) + signalFfiError := C.signal_ciphertext_message_serialize(&serialized, c.ptr) runtime.KeepAlive(c) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -85,7 +73,7 @@ func (c *CiphertextMessage) Serialize() ([]byte, error) { func (c *CiphertextMessage) MessageType() (CiphertextMessageType, error) { var messageType C.uint8_t - signalFfiError := C.signal_ciphertext_message_type(&messageType, c.constPtr()) + signalFfiError := C.signal_ciphertext_message_type(&messageType, c.ptr) runtime.KeepAlive(c) if signalFfiError != nil { return 0, wrapError(signalFfiError) diff --git a/pkg/libsignalgo/conversions.go b/pkg/libsignalgo/conversions.go index a70e782..a2da098 100644 --- a/pkg/libsignalgo/conversions.go +++ b/pkg/libsignalgo/conversions.go @@ -17,21 +17,14 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" -#include */ import "C" import "unsafe" -func GoStringToCString(str string) (C.SignalCStringPtr, func()) { - cStr := C.CString(str) - return C.SignalCStringPtr(unsafe.Pointer(cStr)), func() { - C.free(unsafe.Pointer(cStr)) - } -} - -func CopyCStringToString(cString C.SignalCStringPtr) (s string) { - s = C.GoString((*C.char)(unsafe.Pointer(cString))) +func CopyCStringToString(cString *C.char) (s string) { + s = C.GoString(cString) C.signal_free_string(cString) return } @@ -47,17 +40,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..c5d5f18 100644 --- a/pkg/libsignalgo/decryptionerrormessage.go +++ b/pkg/libsignalgo/decryptionerrormessage.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,11 +17,13 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" import ( "runtime" + "time" ) type DecryptionErrorMessage struct { @@ -37,64 +38,47 @@ func wrapDecryptionErrorMessage(ptr *C.SignalDecryptionErrorMessage) *Decryption } func DeserializeDecryptionErrorMessage(messageBytes []byte) (*DecryptionErrorMessage, error) { - var dem C.SignalMutPointerDecryptionErrorMessage - signalFfiError := C.signal_decryption_error_message_deserialize( - &dem, - BytesToBuffer(messageBytes), - ) + var dem *C.SignalDecryptionErrorMessage + signalFfiError := C.signal_decryption_error_message_deserialize(&dem, BytesToBuffer(messageBytes)) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapDecryptionErrorMessage(dem.raw), nil + return wrapDecryptionErrorMessage(dem), nil } -func DecryptionErrorMessageForOriginalMessage(originalBytes []byte, originalType CiphertextMessageType, originalTs uint64, originalSenderDeviceID uint) (*DecryptionErrorMessage, error) { - var dem C.SignalMutPointerDecryptionErrorMessage - signalFfiError := C.signal_decryption_error_message_for_original_message( - &dem, - BytesToBuffer(originalBytes), - C.uint8_t(originalType), - C.uint64_t(originalTs), - C.uint32_t(originalSenderDeviceID), - ) +func DecryptionErrorMessageForOriginalMessage(originalBytes []byte, originalType uint8, originalTs uint64, originalSenderDeviceID uint) (*DecryptionErrorMessage, error) { + var dem *C.SignalDecryptionErrorMessage + signalFfiError := C.signal_decryption_error_message_for_original_message(&dem, BytesToBuffer(originalBytes), C.uint8_t(originalType), C.uint64_t(originalTs), C.uint32_t(originalSenderDeviceID)) runtime.KeepAlive(originalBytes) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapDecryptionErrorMessage(dem.raw), nil + return wrapDecryptionErrorMessage(dem), nil } func DecryptionErrorMessageFromSerializedContent(serialized []byte) (*DecryptionErrorMessage, error) { - var dem C.SignalMutPointerDecryptionErrorMessage + var dem *C.SignalDecryptionErrorMessage signalFfiError := C.signal_decryption_error_message_extract_from_serialized_content(&dem, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapDecryptionErrorMessage(dem.raw), nil -} - -func (dem *DecryptionErrorMessage) mutPtr() C.SignalMutPointerDecryptionErrorMessage { - return C.SignalMutPointerDecryptionErrorMessage{dem.ptr} -} - -func (dem *DecryptionErrorMessage) constPtr() C.SignalConstPointerDecryptionErrorMessage { - return C.SignalConstPointerDecryptionErrorMessage{dem.ptr} + return wrapDecryptionErrorMessage(dem), nil } func (dem *DecryptionErrorMessage) Clone() (*DecryptionErrorMessage, error) { - var cloned C.SignalMutPointerDecryptionErrorMessage - signalFfiError := C.signal_decryption_error_message_clone(&cloned, dem.constPtr()) + var cloned *C.SignalDecryptionErrorMessage + signalFfiError := C.signal_decryption_error_message_clone(&cloned, dem.ptr) runtime.KeepAlive(dem) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapDecryptionErrorMessage(cloned.raw), nil + return wrapDecryptionErrorMessage(cloned), nil } func (dem *DecryptionErrorMessage) Destroy() error { dem.CancelFinalizer() - return wrapError(C.signal_decryption_error_message_destroy(dem.mutPtr())) + return wrapError(C.signal_decryption_error_message_destroy(dem.ptr)) } func (dem *DecryptionErrorMessage) CancelFinalizer() { @@ -103,7 +87,7 @@ func (dem *DecryptionErrorMessage) CancelFinalizer() { func (dem *DecryptionErrorMessage) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_decryption_error_message_serialize(&serialized, dem.constPtr()) + signalFfiError := C.signal_decryption_error_message_serialize(&serialized, dem.ptr) runtime.KeepAlive(dem) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -111,19 +95,19 @@ 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()) + signalFfiError := C.signal_decryption_error_message_get_timestamp(&ts, dem.ptr) 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) { var deviceID C.uint32_t - signalFfiError := C.signal_decryption_error_message_get_device_id(&deviceID, dem.constPtr()) + signalFfiError := C.signal_decryption_error_message_get_device_id(&deviceID, dem.ptr) runtime.KeepAlive(dem) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -132,11 +116,11 @@ func (dem *DecryptionErrorMessage) GetDeviceID() (uint32, error) { } func (dem *DecryptionErrorMessage) GetRatchetKey() (*PublicKey, error) { - var pk C.SignalMutPointerPublicKey - signalFfiError := C.signal_decryption_error_message_get_ratchet_key(&pk, dem.constPtr()) + var pk *C.SignalPublicKey + signalFfiError := C.signal_decryption_error_message_get_ratchet_key(&pk, dem.ptr) runtime.KeepAlive(dem) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(pk.raw), nil + return wrapPublicKey(pk), nil } diff --git a/pkg/libsignalgo/devicetransfer.go b/pkg/libsignalgo/devicetransfer.go index 85aed37..fb50971 100644 --- a/pkg/libsignalgo/devicetransfer.go +++ b/pkg/libsignalgo/devicetransfer.go @@ -17,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -43,9 +44,7 @@ func (dtk *DeviceTransferKey) PrivateKeyMaterial() []byte { func (dtk *DeviceTransferKey) GenerateCertificate(name string, days int) ([]byte, error) { var resp C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - nameStr, freeNameStr := GoStringToCString(name) - defer freeNameStr() - signalFfiError := C.signal_device_transfer_generate_certificate(&resp, BytesToBuffer(dtk.privateKey), nameStr, C.uint32_t(days)) + signalFfiError := C.signal_device_transfer_generate_certificate(&resp, BytesToBuffer(dtk.privateKey), C.CString(name), C.uint32_t(days)) runtime.KeepAlive(dtk) if signalFfiError != nil { return nil, wrapError(signalFfiError) diff --git a/pkg/libsignalgo/error.go b/pkg/libsignalgo/error.go index cf46b94..9e2a872 100644 --- a/pkg/libsignalgo/error.go +++ b/pkg/libsignalgo/error.go @@ -17,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -26,91 +27,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 +66,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 @@ -152,8 +92,8 @@ func wrapError(signalError *C.SignalFfiError) error { } func wrapSignalError(signalError *C.SignalFfiError, errorType C.uint32_t) error { - var messageBytes C.SignalCStringPtr - getMessageError := C.signal_error_get_message(&messageBytes, signalError) + var messageBytes *C.char + getMessageError := C.signal_error_get_message(signalError, &messageBytes) if getMessageError != nil { // Ignore any errors from this, it will just end up being an empty string. C.signal_error_free(getMessageError) diff --git a/pkg/libsignalgo/fingerprint.go b/pkg/libsignalgo/fingerprint.go index f436aec..2636015 100644 --- a/pkg/libsignalgo/fingerprint.go +++ b/pkg/libsignalgo/fingerprint.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -42,50 +42,32 @@ func wrapFingerprint(ptr *C.SignalFingerprint) *Fingerprint { } func NewFingerprint(iterations, version FingerprintVersion, localIdentifier []byte, localKey *PublicKey, remoteIdentifier []byte, remoteKey *PublicKey) (*Fingerprint, error) { - var pa C.SignalMutPointerFingerprint - signalFfiError := C.signal_fingerprint_new( - &pa, - C.uint32_t(iterations), - C.uint32_t(version), - BytesToBuffer(localIdentifier), - localKey.constPtr(), - BytesToBuffer(remoteIdentifier), - remoteKey.constPtr(), - ) - runtime.KeepAlive(localKey) - runtime.KeepAlive(remoteKey) + var pa *C.SignalFingerprint + signalFfiError := C.signal_fingerprint_new(&pa, C.uint32_t(iterations), C.uint32_t(version), BytesToBuffer(localIdentifier), localKey.ptr, BytesToBuffer(remoteIdentifier), remoteKey.ptr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapFingerprint(pa.raw), nil -} - -func (f *Fingerprint) mutPtr() C.SignalMutPointerFingerprint { - return C.SignalMutPointerFingerprint{f.ptr} -} - -func (f *Fingerprint) constPtr() C.SignalConstPointerFingerprint { - return C.SignalConstPointerFingerprint{f.ptr} + return wrapFingerprint(pa), nil } func (f *Fingerprint) Clone() (*Fingerprint, error) { - var cloned C.SignalMutPointerFingerprint - signalFfiError := C.signal_fingerprint_clone(&cloned, f.constPtr()) + var cloned *C.SignalFingerprint + signalFfiError := C.signal_fingerprint_clone(&cloned, f.ptr) runtime.KeepAlive(f) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapFingerprint(cloned.raw), nil + return wrapFingerprint(cloned), nil } func (f *Fingerprint) Destroy() error { runtime.SetFinalizer(f, nil) - return wrapError(C.signal_fingerprint_destroy(f.mutPtr())) + return wrapError(C.signal_fingerprint_destroy(f.ptr)) } func (f *Fingerprint) ScannableEncoding() ([]byte, error) { var scannableEncoding C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_fingerprint_scannable_encoding(&scannableEncoding, f.constPtr()) + signalFfiError := C.signal_fingerprint_scannable_encoding(&scannableEncoding, f.ptr) runtime.KeepAlive(f) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -94,8 +76,8 @@ func (f *Fingerprint) ScannableEncoding() ([]byte, error) { } func (f *Fingerprint) DisplayString() (string, error) { - var displayString C.SignalCStringPtr - signalFfiError := C.signal_fingerprint_display_string(&displayString, f.constPtr()) + var displayString *C.char + signalFfiError := C.signal_fingerprint_display_string(&displayString, f.ptr) runtime.KeepAlive(f) if signalFfiError != nil { return "", wrapError(signalFfiError) diff --git a/pkg/libsignalgo/fixedarray.go b/pkg/libsignalgo/fixedarray.go deleted file mode 100644 index 949e808..0000000 --- a/pkg/libsignalgo/fixedarray.go +++ /dev/null @@ -1,159 +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 libsignalgo - -/* -#include "./libsignal-ffi.h" -*/ -import "C" -import "unsafe" - -type fixedArray15 [15]byte -type fixedArray16 [16]byte -type fixedArray17 [17]byte -type fixedArray32 [32]byte -type fixedArray64 [64]byte -type fixedArray65 [65]byte -type fixedArray97 [97]byte -type fixedArray129 [129]byte -type fixedArray153 [153]byte -type fixedArray177 [177]byte -type fixedArray289 [289]byte -type fixedArray329 [329]byte -type fixedArray409 [409]byte -type fixedArray473 [473]byte -type fixedArray497 [497]byte - -func (a *fixedArray15) cFixedArray() *C.SignalType_FixedArray15_uint8_t { - return (*C.SignalType_FixedArray15_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray15) cConstFixedArray() cFixedArray15Compat { - return cFixedArray15Compat(a.cFixedArray()) -} - -func (a *fixedArray16) cFixedArray() *C.SignalType_FixedArray16_uint8_t { - return (*C.SignalType_FixedArray16_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray16) cConstFixedArray() cFixedArray16Compat { - return cFixedArray16Compat(a.cFixedArray()) -} - -func (a *fixedArray17) cFixedArray() *C.SignalType_FixedArray17_uint8_t { - return (*C.SignalType_FixedArray17_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray17) cConstFixedArray() cFixedArray17Compat { - return cFixedArray17Compat(a.cFixedArray()) -} - -func (a *fixedArray32) cFixedArray() *C.SignalType_FixedArray32_uint8_t { - return (*C.SignalType_FixedArray32_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray32) cConstFixedArray() cFixedArray32Compat { - return cFixedArray32Compat(a.cFixedArray()) -} - -func (a *fixedArray64) cFixedArray() *C.SignalType_FixedArray64_uint8_t { - return (*C.SignalType_FixedArray64_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray64) cConstFixedArray() cFixedArray64Compat { - return cFixedArray64Compat(a.cFixedArray()) -} - -func (a *fixedArray65) cFixedArray() *C.SignalType_FixedArray65_uint8_t { - return (*C.SignalType_FixedArray65_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray65) cConstFixedArray() cFixedArray65Compat { - return cFixedArray65Compat(a.cFixedArray()) -} - -func (a *fixedArray97) cFixedArray() *C.SignalType_FixedArray97_uint8_t { - return (*C.SignalType_FixedArray97_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray97) cConstFixedArray() cFixedArray97Compat { - return cFixedArray97Compat(a.cFixedArray()) -} - -func (a *fixedArray129) cFixedArray() *C.SignalType_FixedArray129_uint8_t { - return (*C.SignalType_FixedArray129_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray129) cConstFixedArray() cFixedArray129Compat { - return cFixedArray129Compat(a.cFixedArray()) -} - -func (a *fixedArray153) cFixedArray() *C.SignalType_FixedArray153_uint8_t { - return (*C.SignalType_FixedArray153_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray153) cConstFixedArray() cFixedArray153Compat { - return cFixedArray153Compat(a.cFixedArray()) -} - -func (a *fixedArray177) cFixedArray() *C.SignalType_FixedArray177_uint8_t { - return (*C.SignalType_FixedArray177_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray177) cConstFixedArray() cFixedArray177Compat { - return cFixedArray177Compat(a.cFixedArray()) -} - -func (a *fixedArray289) cFixedArray() *C.SignalType_FixedArray289_uint8_t { - return (*C.SignalType_FixedArray289_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray289) cConstFixedArray() cFixedArray289Compat { - return cFixedArray289Compat(a.cFixedArray()) -} - -func (a *fixedArray329) cFixedArray() *C.SignalType_FixedArray329_uint8_t { - return (*C.SignalType_FixedArray329_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray329) cConstFixedArray() cFixedArray329Compat { - return cFixedArray329Compat(a.cFixedArray()) -} - -func (a *fixedArray409) cFixedArray() *C.SignalType_FixedArray409_uint8_t { - return (*C.SignalType_FixedArray409_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray409) cConstFixedArray() cFixedArray409Compat { - return cFixedArray409Compat(a.cFixedArray()) -} - -func (a *fixedArray473) cFixedArray() *C.SignalType_FixedArray473_uint8_t { - return (*C.SignalType_FixedArray473_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray473) cConstFixedArray() cFixedArray473Compat { - return cFixedArray473Compat(a.cFixedArray()) -} - -func (a *fixedArray497) cFixedArray() *C.SignalType_FixedArray497_uint8_t { - return (*C.SignalType_FixedArray497_uint8_t)(unsafe.Pointer(a)) -} - -func (a *fixedArray497) cConstFixedArray() cFixedArray497Compat { - return cFixedArray497Compat(a.cFixedArray()) -} diff --git a/pkg/libsignalgo/fixedarray_clang.go b/pkg/libsignalgo/fixedarray_clang.go deleted file mode 100644 index 3dc0cd2..0000000 --- a/pkg/libsignalgo/fixedarray_clang.go +++ /dev/null @@ -1,24 +0,0 @@ -//go:build darwin || android || ios || (windows && arm64) - -package libsignalgo - -/* -#include "./libsignal-ffi.h" -*/ -import "C" - -type cFixedArray15Compat = *C.SignalType_FixedArray15_uint8_t -type cFixedArray16Compat = *C.SignalType_FixedArray16_uint8_t -type cFixedArray17Compat = *C.SignalType_FixedArray17_uint8_t -type cFixedArray32Compat = *C.SignalType_FixedArray32_uint8_t -type cFixedArray64Compat = *C.SignalType_FixedArray64_uint8_t -type cFixedArray65Compat = *C.SignalType_FixedArray65_uint8_t -type cFixedArray97Compat = *C.SignalType_FixedArray97_uint8_t -type cFixedArray129Compat = *C.SignalType_FixedArray129_uint8_t -type cFixedArray153Compat = *C.SignalType_FixedArray153_uint8_t -type cFixedArray177Compat = *C.SignalType_FixedArray177_uint8_t -type cFixedArray289Compat = *C.SignalType_FixedArray289_uint8_t -type cFixedArray329Compat = *C.SignalType_FixedArray329_uint8_t -type cFixedArray409Compat = *C.SignalType_FixedArray409_uint8_t -type cFixedArray473Compat = *C.SignalType_FixedArray473_uint8_t -type cFixedArray497Compat = *C.SignalType_FixedArray497_uint8_t diff --git a/pkg/libsignalgo/fixedarray_gcc.go b/pkg/libsignalgo/fixedarray_gcc.go deleted file mode 100644 index 6490494..0000000 --- a/pkg/libsignalgo/fixedarray_gcc.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build !(darwin || android || ios || (windows && arm64)) - -package libsignalgo - -/* -#include "./libsignal-ffi.h" -*/ -import "C" - -// Hack for https://github.com/golang/go/issues/7270 -// The clang version is more correct, but doesn't work with gcc. -type cFixedArray15Compat = *[15]C.uint8_t -type cFixedArray16Compat = *[16]C.uint8_t -type cFixedArray17Compat = *[17]C.uint8_t -type cFixedArray32Compat = *[32]C.uint8_t -type cFixedArray64Compat = *[64]C.uint8_t -type cFixedArray65Compat = *[65]C.uint8_t -type cFixedArray97Compat = *[97]C.uint8_t -type cFixedArray129Compat = *[129]C.uint8_t -type cFixedArray153Compat = *[153]C.uint8_t -type cFixedArray177Compat = *[177]C.uint8_t -type cFixedArray289Compat = *[289]C.uint8_t -type cFixedArray329Compat = *[329]C.uint8_t -type cFixedArray409Compat = *[409]C.uint8_t -type cFixedArray473Compat = *[473]C.uint8_t -type cFixedArray497Compat = *[497]C.uint8_t diff --git a/pkg/libsignalgo/groupcipher.go b/pkg/libsignalgo/groupcipher.go index 9ec5997..7faaf90 100644 --- a/pkg/libsignalgo/groupcipher.go +++ b/pkg/libsignalgo/groupcipher.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -32,11 +32,11 @@ import ( func GroupEncrypt(ctx context.Context, ptext []byte, sender *Address, distributionID uuid.UUID, store SenderKeyStore) (*CiphertextMessage, error) { callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() - var ciphertextMessage C.SignalMutPointerCiphertextMessage + var ciphertextMessage *C.SignalCiphertextMessage signalFfiError := C.signal_group_encrypt_message( &ciphertextMessage, - sender.constPtr(), - *(*C.SignalUuid)(unsafe.Pointer(&distributionID)), + sender.ptr, + (*[C.SignalUUID_LEN]C.uchar)(unsafe.Pointer(&distributionID)), BytesToBuffer(ptext), callbackCtx.wrapSenderKeyStore(store)) runtime.KeepAlive(ptext) @@ -44,7 +44,7 @@ func GroupEncrypt(ctx context.Context, ptext []byte, sender *Address, distributi if signalFfiError != nil { return nil, callbackCtx.wrapError(signalFfiError) } - return wrapCiphertextMessage(ciphertextMessage.raw), nil + return wrapCiphertextMessage(ciphertextMessage), nil } func GroupDecrypt(ctx context.Context, ctext []byte, sender *Address, store SenderKeyStore) ([]byte, error) { @@ -53,7 +53,7 @@ func GroupDecrypt(ctx context.Context, ctext []byte, sender *Address, store Send var resp C.SignalOwnedBuffer = C.SignalOwnedBuffer{} signalFfiError := C.signal_group_decrypt_message( &resp, - sender.constPtr(), + sender.ptr, BytesToBuffer(ctext), callbackCtx.wrapSenderKeyStore(store)) runtime.KeepAlive(ctext) diff --git a/pkg/libsignalgo/groupcipher_test.go b/pkg/libsignalgo/groupcipher_test.go index eda4fdf..f862705 100644 --- a/pkg/libsignalgo/groupcipher_test.go +++ b/pkg/libsignalgo/groupcipher_test.go @@ -30,7 +30,7 @@ import ( func TestGroupCipher(t *testing.T) { ctx := context.TODO() - sender, err := libsignalgo.NewACIServiceID(uuid.New()).Address(4) + sender, err := libsignalgo.NewPhoneAddress("+14159999111", 4) assert.NoError(t, err) distributionID, err := uuid.Parse("d1d1d1d1-7000-11eb-b32a-33b8a8a487a6") diff --git a/pkg/libsignalgo/groupsecretparams.go b/pkg/libsignalgo/groupsecretparams.go index eee983f..4861868 100644 --- a/pkg/libsignalgo/groupsecretparams.go +++ b/pkg/libsignalgo/groupsecretparams.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,22 +17,19 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" import ( "crypto/rand" - "encoding/base64" - "fmt" "runtime" "unsafe" "github.com/google/uuid" ) -const RandomnessLength = 32 - -type Randomness = fixedArray32 +type Randomness [C.SignalRANDOMNESS_LEN]byte func GenerateRandomness() Randomness { var randomness Randomness @@ -44,107 +40,64 @@ func GenerateRandomness() Randomness { return randomness } -const GroupMasterKeyLength = 32 -const GroupIdentifierLength = 32 -const GroupSecretParamsLength = 289 +type GroupMasterKey [C.SignalGROUP_MASTER_KEY_LEN]byte +type GroupSecretParams [C.SignalGROUP_SECRET_PARAMS_LEN]byte +type GroupPublicParams [C.SignalGROUP_PUBLIC_PARAMS_LEN]byte +type GroupIdentifier [C.SignalGROUP_IDENTIFIER_LEN]byte -type GroupMasterKey [GroupMasterKeyLength]byte -type GroupSecretParams [GroupSecretParamsLength]byte -type GroupPublicParams = fixedArray97 -type GroupIdentifier [GroupIdentifierLength]byte - -func (gmk *GroupMasterKey) cFixedArray() *C.SignalType_FixedArray32_uint8_t { - return (*C.SignalType_FixedArray32_uint8_t)(unsafe.Pointer(gmk)) -} - -func (gmk *GroupMasterKey) cConstFixedArray() cFixedArray32Compat { - return cFixedArray32Compat(gmk.cFixedArray()) -} - -func (gsp *GroupSecretParams) cFixedArray() *C.SignalType_FixedArray289_uint8_t { - return (*C.SignalType_FixedArray289_uint8_t)(unsafe.Pointer(gsp)) -} - -func (gsp *GroupSecretParams) cConstFixedArray() cFixedArray289Compat { - return cFixedArray289Compat(gsp.cFixedArray()) -} - -func (gid *GroupIdentifier) cFixedArray() *C.SignalType_FixedArray32_uint8_t { - return (*C.SignalType_FixedArray32_uint8_t)(unsafe.Pointer(gid)) -} - -func (gid *GroupIdentifier) cConstFixedArray() cFixedArray32Compat { - return cFixedArray32Compat(gid.cFixedArray()) -} - -func (gid *GroupIdentifier) String() string { - if gid == nil { - return "" - } - return base64.StdEncoding.EncodeToString(gid[:]) -} - -type UUIDCiphertext = fixedArray65 -type ProfileKeyCiphertext = fixedArray65 +type UUIDCiphertext [C.SignalUUID_CIPHERTEXT_LEN]byte +type ProfileKeyCiphertext [C.SignalPROFILE_KEY_CIPHERTEXT_LEN]byte func GenerateGroupSecretParams() (GroupSecretParams, error) { return GenerateGroupSecretParamsWithRandomness(GenerateRandomness()) } -func (gmk GroupMasterKey) GroupIdentifier() (*GroupIdentifier, error) { - if groupSecretParams, err := DeriveGroupSecretParamsFromMasterKey(gmk); err != nil { - return nil, fmt.Errorf("DeriveGroupSecretParamsFromMasterKey error: %w", err) - } else if groupPublicParams, err := groupSecretParams.GetPublicParams(); err != nil { - return nil, fmt.Errorf("GetPublicParams error: %w", err) - } else if groupIdentifier, err := GetGroupIdentifier(*groupPublicParams); err != nil { - return nil, fmt.Errorf("GetGroupIdentifier error: %w", err) - } else { - return groupIdentifier, nil - } -} - -func (gmk GroupMasterKey) SecretParams() (GroupSecretParams, error) { - return DeriveGroupSecretParamsFromMasterKey(gmk) -} - func GenerateGroupSecretParamsWithRandomness(randomness Randomness) (GroupSecretParams, error) { - var params GroupSecretParams - signalFfiError := C.signal_group_secret_params_generate_deterministic(params.cFixedArray(), randomness.cConstFixedArray()) + 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))) runtime.KeepAlive(randomness) if signalFfiError != nil { return GroupSecretParams{}, wrapError(signalFfiError) } - return params, nil + var groupSecretParams GroupSecretParams + copy(groupSecretParams[:], C.GoBytes(unsafe.Pointer(¶ms), C.int(C.SignalGROUP_SECRET_PARAMS_LEN))) + return groupSecretParams, nil } func DeriveGroupSecretParamsFromMasterKey(groupMasterKey GroupMasterKey) (GroupSecretParams, error) { - var params GroupSecretParams - signalFfiError := C.signal_group_secret_params_derive_from_master_key(params.cFixedArray(), groupMasterKey.cConstFixedArray()) + var params [C.SignalGROUP_SECRET_PARAMS_LEN]C.uchar + signalFfiError := C.signal_group_secret_params_derive_from_master_key(¶ms, (*[C.SignalGROUP_MASTER_KEY_LEN]C.uint8_t)(unsafe.Pointer(&groupMasterKey))) runtime.KeepAlive(groupMasterKey) if signalFfiError != nil { return GroupSecretParams{}, wrapError(signalFfiError) } - return params, nil + var groupSecretParams GroupSecretParams + copy(groupSecretParams[:], C.GoBytes(unsafe.Pointer(¶ms), C.int(C.SignalGROUP_SECRET_PARAMS_LEN))) + return groupSecretParams, nil } func (gsp *GroupSecretParams) GetPublicParams() (*GroupPublicParams, error) { - var publicParams GroupPublicParams - signalFfiError := C.signal_group_secret_params_get_public_params(publicParams.cFixedArray(), gsp.cConstFixedArray()) + var publicParams [C.SignalGROUP_PUBLIC_PARAMS_LEN]C.uchar + signalFfiError := C.signal_group_secret_params_get_public_params(&publicParams, (*[C.SignalGROUP_SECRET_PARAMS_LEN]C.uint8_t)(unsafe.Pointer(gsp))) runtime.KeepAlive(gsp) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return &publicParams, nil + var groupPublicParams GroupPublicParams + copy(groupPublicParams[:], C.GoBytes(unsafe.Pointer(&publicParams), C.int(C.SignalGROUP_PUBLIC_PARAMS_LEN))) + return &groupPublicParams, nil } func GetGroupIdentifier(groupPublicParams GroupPublicParams) (*GroupIdentifier, error) { - var groupIdentifier GroupIdentifier - signalFfiError := C.signal_group_public_params_get_group_identifier(groupIdentifier.cFixedArray(), groupPublicParams.cConstFixedArray()) + var groupIdentifier [C.SignalGROUP_IDENTIFIER_LEN]C.uchar + signalFfiError := C.signal_group_public_params_get_group_identifier(&groupIdentifier, (*[C.SignalGROUP_PUBLIC_PARAMS_LEN]C.uint8_t)(unsafe.Pointer(&groupPublicParams))) runtime.KeepAlive(groupPublicParams) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return &groupIdentifier, nil + var result GroupIdentifier + copy(result[:], C.GoBytes(unsafe.Pointer(&groupIdentifier), C.int(C.SignalGROUP_IDENTIFIER_LEN))) + return &result, nil } func (gsp *GroupSecretParams) DecryptBlobWithPadding(blob []byte) ([]byte, error) { @@ -152,7 +105,7 @@ func (gsp *GroupSecretParams) DecryptBlobWithPadding(blob []byte) ([]byte, error borrowedBlob := BytesToBuffer(blob) signalFfiError := C.signal_group_secret_params_decrypt_blob_with_padding( &plaintext, - gsp.cConstFixedArray(), + (*[C.SignalGROUP_SECRET_PARAMS_LEN]C.uint8_t)(unsafe.Pointer(gsp)), borrowedBlob, ) runtime.KeepAlive(gsp) @@ -163,120 +116,44 @@ func (gsp *GroupSecretParams) DecryptBlobWithPadding(blob []byte) ([]byte, error return CopySignalOwnedBufferToBytes(plaintext), nil } -func (gsp *GroupSecretParams) EncryptBlobWithPaddingDeterministic(randomness Randomness, plaintext []byte, padding_len uint32) ([]byte, error) { - var ciphertext C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - borrowedPlaintext := BytesToBuffer(plaintext) - signalFfiError := C.signal_group_secret_params_encrypt_blob_with_padding_deterministic( - &ciphertext, - gsp.cConstFixedArray(), - randomness.cConstFixedArray(), - borrowedPlaintext, - (C.uint32_t)(padding_len), - ) - runtime.KeepAlive(randomness) - runtime.KeepAlive(gsp) - runtime.KeepAlive(plaintext) - runtime.KeepAlive(padding_len) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return CopySignalOwnedBufferToBytes(ciphertext), nil -} - -func (gsp *GroupSecretParams) DecryptServiceID(ciphertextServiceID UUIDCiphertext) (ServiceID, error) { - var serviceIDBytes ServiceIDFixedBytes +func (gsp *GroupSecretParams) DecryptUUID(ciphertextUUID UUIDCiphertext) (uuid.UUID, error) { + u := C.SignalServiceIdFixedWidthBinaryBytes{} signalFfiError := C.signal_group_secret_params_decrypt_service_id( - serviceIDBytes.cFixedArray(), - gsp.cConstFixedArray(), - ciphertextServiceID.cConstFixedArray(), + &u, + (*[C.SignalGROUP_SECRET_PARAMS_LEN]C.uint8_t)(unsafe.Pointer(gsp)), + (*[C.SignalUUID_CIPHERTEXT_LEN]C.uint8_t)(unsafe.Pointer(&ciphertextUUID)), ) runtime.KeepAlive(gsp) - runtime.KeepAlive(ciphertextServiceID) + runtime.KeepAlive(ciphertextUUID) if signalFfiError != nil { - return EmptyServiceID, wrapError(signalFfiError) + return uuid.Nil, wrapError(signalFfiError) } - serviceID := ServiceIDFromCFixedBytes(serviceIDBytes.cFixedArray()) - return serviceID, nil -} - -func (gsp *GroupSecretParams) EncryptServiceID(serviceID ServiceID) (*UUIDCiphertext, error) { - var cipherTextServiceID UUIDCiphertext - signalFfiError := C.signal_group_secret_params_encrypt_service_id( - cipherTextServiceID.cFixedArray(), - gsp.cConstFixedArray(), - serviceID.cConstFixedArray(), - ) - runtime.KeepAlive(gsp) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) + result, err := SignalServiceIDToUUID(&u) + if err != nil { + return uuid.Nil, err } - return &cipherTextServiceID, nil + return result, nil } func (gsp *GroupSecretParams) DecryptProfileKey(ciphertextProfileKey ProfileKeyCiphertext, u uuid.UUID) (*ProfileKey, error) { - var profileKey ProfileKey + profileKey := [C.SignalPROFILE_KEY_LEN]C.uchar{} + serviceId, err := SignalServiceIDFromUUID(u) + if err != nil { + return nil, err + } signalFfiError := C.signal_group_secret_params_decrypt_profile_key( - profileKey.cFixedArray(), - gsp.cConstFixedArray(), - ciphertextProfileKey.cConstFixedArray(), - NewACIServiceID(u).cConstFixedArray(), + &profileKey, + (*[C.SignalGROUP_SECRET_PARAMS_LEN]C.uint8_t)(unsafe.Pointer(gsp)), + (*[C.SignalPROFILE_KEY_CIPHERTEXT_LEN]C.uint8_t)(unsafe.Pointer(&ciphertextProfileKey)), + serviceId, ) runtime.KeepAlive(gsp) runtime.KeepAlive(ciphertextProfileKey) - runtime.KeepAlive(u) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return &profileKey, nil -} - -func (gsp *GroupSecretParams) EncryptProfileKey(profileKey ProfileKey, u uuid.UUID) (*ProfileKeyCiphertext, error) { - var ciphertextProfileKey ProfileKeyCiphertext - signalFfiError := C.signal_group_secret_params_encrypt_profile_key( - ciphertextProfileKey.cFixedArray(), - gsp.cConstFixedArray(), - profileKey.cConstFixedArray(), - NewACIServiceID(u).cConstFixedArray(), - ) - runtime.KeepAlive(gsp) - runtime.KeepAlive(profileKey) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &ciphertextProfileKey, nil -} - -func (gsp *GroupSecretParams) CreateExpiringProfileKeyCredentialPresentation(spp *ServerPublicParams, credential ExpiringProfileKeyCredential) (*ProfileKeyCredentialPresentation, error) { - var out C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - randomness := GenerateRandomness() - signalFfiError := C.signal_server_public_params_create_expiring_profile_key_credential_presentation_deterministic( - &out, - C.SignalConstPointerServerPublicParams{spp}, - randomness.cConstFixedArray(), - gsp.cConstFixedArray(), - credential.cConstFixedArray(), - ) - runtime.KeepAlive(gsp) - runtime.KeepAlive(credential) - runtime.KeepAlive(randomness) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - presentationBytes := CopySignalOwnedBufferToBytes(out) - presentation := ProfileKeyCredentialPresentation(presentationBytes) - return &presentation, nil -} - -func (gsp *GroupSecretParams) GetMasterKey() (*GroupMasterKey, error) { - var masterKey GroupMasterKey - signalFfiError := C.signal_group_secret_params_get_master_key( - masterKey.cFixedArray(), - gsp.cConstFixedArray(), - ) - runtime.KeepAlive(gsp) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &masterKey, nil + var result ProfileKey + copy(result[:], C.GoBytes(unsafe.Pointer(&profileKey), C.int(C.SignalPROFILE_KEY_LEN))) + return &result, nil } diff --git a/pkg/libsignalgo/groupsendendorsement.go b/pkg/libsignalgo/groupsendendorsement.go deleted file mode 100644 index ed833e1..0000000 --- a/pkg/libsignalgo/groupsendendorsement.go +++ /dev/null @@ -1,220 +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" -) - -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), - groupSecretParams.cConstFixedArray(), - ) - 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)*ServiceIDFixedBytesLength) - for i, member := range groupMembers { - copy(concatenatedMembers[i*ServiceIDFixedBytesLength:(i+1)*ServiceIDFixedBytesLength], member.FixedBytes()[:]) - } - signalFfiError := C.signal_group_send_endorsements_response_receive_and_combine_with_service_ids( - &out, - BytesToBuffer(gser), - BytesToBuffer(concatenatedMembers), - localUser.cConstFixedArray(), - C.uint64_t(time.Now().Unix()), - params.cConstFixedArray(), - 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] - } - } - nonEmptyEndorsements := make([]GroupSendEndorsement, 0, len(endorsements)) - for _, endorsement := range endorsements { - if len(endorsement) > 0 { - nonEmptyEndorsements = append(nonEmptyEndorsements, endorsement) - } - } - combined, err := GroupSendEndorsementCombine(nonEmptyEndorsements...) - if err != nil { - return nil, memberEndorsements, err - } - return combined, memberEndorsements, nil -} diff --git a/pkg/libsignalgo/hsmenclave.go b/pkg/libsignalgo/hsmenclave.go index 2eb61cd..51ca6f4 100644 --- a/pkg/libsignalgo/hsmenclave.go +++ b/pkg/libsignalgo/hsmenclave.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -35,34 +35,22 @@ func wrapHSMEnclaveClient(ptr *C.SignalHsmEnclaveClient) *HSMEnclaveClient { } func NewHSMEnclaveClient(trustedPublicKey, trustedCodeHashes []byte) (*HSMEnclaveClient, error) { - var cds C.SignalMutPointerHsmEnclaveClient - signalFfiError := C.signal_hsm_enclave_client_new( - &cds, - BytesToBuffer(trustedPublicKey), - BytesToBuffer(trustedCodeHashes), - ) + var cds *C.SignalHsmEnclaveClient + signalFfiError := C.signal_hsm_enclave_client_new(&cds, BytesToBuffer(trustedPublicKey), BytesToBuffer(trustedCodeHashes)) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapHSMEnclaveClient(cds.raw), nil -} - -func (hsm *HSMEnclaveClient) mutPtr() C.SignalMutPointerHsmEnclaveClient { - return C.SignalMutPointerHsmEnclaveClient{hsm.ptr} -} - -func (hsm *HSMEnclaveClient) constPtr() C.SignalConstPointerHsmEnclaveClient { - return C.SignalConstPointerHsmEnclaveClient{hsm.ptr} + return wrapHSMEnclaveClient(cds), nil } func (hsm *HSMEnclaveClient) Destroy() error { runtime.SetFinalizer(hsm, nil) - return wrapError(C.signal_hsm_enclave_client_destroy(hsm.mutPtr())) + return wrapError(C.signal_hsm_enclave_client_destroy(hsm.ptr)) } func (hsm *HSMEnclaveClient) InitialRequest() ([]byte, error) { var resp C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_hsm_enclave_client_initial_request(&resp, hsm.constPtr()) + signalFfiError := C.signal_hsm_enclave_client_initial_request(&resp, hsm.ptr) runtime.KeepAlive(hsm) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -71,7 +59,7 @@ func (hsm *HSMEnclaveClient) InitialRequest() ([]byte, error) { } func (hsm *HSMEnclaveClient) CompleteHandshake(handshakeReceived []byte) error { - signalFfiError := C.signal_hsm_enclave_client_complete_handshake(hsm.mutPtr(), BytesToBuffer(handshakeReceived)) + signalFfiError := C.signal_hsm_enclave_client_complete_handshake(hsm.ptr, BytesToBuffer(handshakeReceived)) runtime.KeepAlive(hsm) runtime.KeepAlive(handshakeReceived) return wrapError(signalFfiError) @@ -79,7 +67,7 @@ func (hsm *HSMEnclaveClient) CompleteHandshake(handshakeReceived []byte) error { func (hsm *HSMEnclaveClient) EstablishedSend(plaintext []byte) ([]byte, error) { var resp C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_hsm_enclave_client_established_send(&resp, hsm.mutPtr(), BytesToBuffer(plaintext)) + signalFfiError := C.signal_hsm_enclave_client_established_send(&resp, hsm.ptr, BytesToBuffer(plaintext)) runtime.KeepAlive(hsm) runtime.KeepAlive(plaintext) if signalFfiError != nil { @@ -90,7 +78,7 @@ func (hsm *HSMEnclaveClient) EstablishedSend(plaintext []byte) ([]byte, error) { func (hsm *HSMEnclaveClient) EstablishedReceive(ciphertext []byte) ([]byte, error) { var resp C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_hsm_enclave_client_established_recv(&resp, hsm.mutPtr(), BytesToBuffer(ciphertext)) + signalFfiError := C.signal_hsm_enclave_client_established_recv(&resp, hsm.ptr, BytesToBuffer(ciphertext)) runtime.KeepAlive(hsm) runtime.KeepAlive(ciphertext) if signalFfiError != nil { diff --git a/pkg/libsignalgo/identitykey.go b/pkg/libsignalgo/identitykey.go index 0226e11..7ac9ec2 100644 --- a/pkg/libsignalgo/identitykey.go +++ b/pkg/libsignalgo/identitykey.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -41,39 +41,23 @@ func NewIdentityKeyFromBytes(bytes []byte) (*IdentityKey, error) { return &IdentityKey{publicKey: publicKey}, nil } -func (i *IdentityKey) TrySerialize() []byte { - if i == nil { - return nil - } - serialized, err := i.Serialize() - if err != nil { - return nil - } - return serialized -} - func (i *IdentityKey) Serialize() ([]byte, error) { return i.publicKey.Serialize() } func DeserializeIdentityKey(bytes []byte) (*IdentityKey, error) { - var publicKey C.SignalMutPointerPublicKey + var publicKey *C.SignalPublicKey signalFfiError := C.signal_publickey_deserialize(&publicKey, BytesToBuffer(bytes)) runtime.KeepAlive(bytes) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return &IdentityKey{publicKey: wrapPublicKey(publicKey.raw)}, nil + return &IdentityKey{publicKey: wrapPublicKey(publicKey)}, nil } func (i *IdentityKey) VerifyAlternateIdentity(other *IdentityKey, signature []byte) (bool, error) { var verify C.bool - signalFfiError := C.signal_identitykey_verify_alternate_identity( - &verify, - i.publicKey.constPtr(), - other.publicKey.constPtr(), - BytesToBuffer(signature), - ) + signalFfiError := C.signal_identitykey_verify_alternate_identity(&verify, i.publicKey.ptr, other.publicKey.ptr, BytesToBuffer(signature)) runtime.KeepAlive(i) runtime.KeepAlive(other) runtime.KeepAlive(signature) @@ -84,7 +68,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 { @@ -113,13 +98,14 @@ func GenerateIdentityKeyPair() (*IdentityKeyPair, error) { } func DeserializeIdentityKeyPair(bytes []byte) (*IdentityKeyPair, error) { - var keys C.SignalPairOfMutPointerPublicKeyMutPointerPrivateKey - signalFfiError := C.signal_identitykeypair_deserialize(&keys, BytesToBuffer(bytes)) + var privateKey *C.SignalPrivateKey + var publicKey *C.SignalPublicKey + signalFfiError := C.signal_identitykeypair_deserialize(&privateKey, &publicKey, BytesToBuffer(bytes)) runtime.KeepAlive(bytes) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return &IdentityKeyPair{publicKey: wrapPublicKey(keys.first.raw), privateKey: wrapPrivateKey(keys.second.raw)}, nil + return &IdentityKeyPair{publicKey: wrapPublicKey(publicKey), privateKey: wrapPrivateKey(privateKey)}, nil } func NewIdentityKeyPair(publicKey *PublicKey, privateKey *PrivateKey) (*IdentityKeyPair, error) { @@ -128,11 +114,7 @@ func NewIdentityKeyPair(publicKey *PublicKey, privateKey *PrivateKey) (*Identity func (i *IdentityKeyPair) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_identitykeypair_serialize( - &serialized, - i.publicKey.constPtr(), - i.privateKey.constPtr(), - ) + signalFfiError := C.signal_identitykeypair_serialize(&serialized, i.publicKey.ptr, i.privateKey.ptr) runtime.KeepAlive(i) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -146,12 +128,7 @@ func (i *IdentityKeyPair) GetIdentityKey() *IdentityKey { func (i *IdentityKeyPair) SignAlternateIdentity(other *IdentityKey) ([]byte, error) { var signature C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_identitykeypair_sign_alternate_identity( - &signature, - i.publicKey.constPtr(), - i.privateKey.constPtr(), - other.publicKey.constPtr(), - ) + signalFfiError := C.signal_identitykeypair_sign_alternate_identity(&signature, i.publicKey.ptr, i.privateKey.ptr, other.publicKey.ptr) runtime.KeepAlive(i) runtime.KeepAlive(other) if signalFfiError != nil { diff --git a/pkg/libsignalgo/identitykeystore.go b/pkg/libsignalgo/identitykeystore.go index ba26f06..58c3cdf 100644 --- a/pkg/libsignalgo/identitykeystore.go +++ b/pkg/libsignalgo/identitykeystore.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,14 +17,17 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #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 ( @@ -43,35 +45,28 @@ const ( type IdentityKeyStore interface { GetIdentityKeyPair(ctx context.Context) (*IdentityKeyPair, error) GetLocalRegistrationID(ctx context.Context) (uint32, error) - SaveIdentityKey(ctx context.Context, theirServiceID ServiceID, identityKey *IdentityKey) (bool, error) - GetIdentityKey(ctx context.Context, theirServiceID ServiceID) (*IdentityKey, error) - IsTrustedIdentity(ctx context.Context, theirServiceID ServiceID, identityKey *IdentityKey, direction SignalDirection) (bool, error) + SaveIdentityKey(ctx context.Context, address *Address, identityKey *IdentityKey) (bool, error) + GetIdentityKey(ctx context.Context, address *Address) (*IdentityKey, error) + IsTrustedIdentity(ctx context.Context, address *Address, identityKey *IdentityKey, direction SignalDirection) (bool, error) } //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,82 +83,63 @@ 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 - } - addr := &Address{ptr: address.raw} - theirServiceID, err := addr.NameServiceID() - if err != nil { - return err + return -1, err } replaced, err := store.SaveIdentityKey( ctx, - theirServiceID, + &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))}, &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} - theirServiceID, err := addr.NameServiceID() - if err != nil { - return err - } - key, err := store.GetIdentityKey(ctx, theirServiceID) + key, err := store.GetIdentityKey(ctx, &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))}) 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} - theirServiceID, err := addr.NameServiceID() +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) { + trusted, err := store.IsTrustedIdentity(ctx, &Address{ptr: (*C.SignalProtocolAddress)(unsafe.Pointer(address))}, &IdentityKey{&PublicKey{ptr: (*C.SignalPublicKey)(unsafe.Pointer(public_key))}}, SignalDirection(direction)) if err != nil { - return err + return -1, err } - trusted, err := store.IsTrustedIdentity(ctx, theirServiceID, &IdentityKey{&PublicKey{ptr: public_key.raw}}, SignalDirection(direction)) - if err != nil { - return 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), - }} +func (ctx *CallbackContext) wrapIdentityKeyStore(store IdentityKeyStore) *C.SignalIdentityKeyStore { + return &C.SignalIdentityKeyStore{ + 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/inmemorystore_test.go b/pkg/libsignalgo/inmemorystore_test.go index 1c95ae9..e73c201 100644 --- a/pkg/libsignalgo/inmemorystore_test.go +++ b/pkg/libsignalgo/inmemorystore_test.go @@ -44,7 +44,7 @@ type InMemorySignalProtocolStore struct { identityKeyPair *libsignalgo.IdentityKeyPair registrationID uint32 - identityKeyMap map[libsignalgo.ServiceID][]byte + identityKeyMap map[AddressKey][]byte preKeyMap map[uint32]*libsignalgo.PreKeyRecord senderKeyMap map[SenderKeyName]*libsignalgo.SenderKeyRecord sessionMap map[AddressKey]*libsignalgo.SessionRecord @@ -67,7 +67,7 @@ func NewInMemorySignalProtocolStore() *InMemorySignalProtocolStore { identityKeyPair: identityKeyPair, registrationID: uint32(registrationID.Uint64()), - identityKeyMap: make(map[libsignalgo.ServiceID][]byte), + identityKeyMap: make(map[AddressKey][]byte), preKeyMap: make(map[uint32]*libsignalgo.PreKeyRecord), senderKeyMap: make(map[SenderKeyName]*libsignalgo.SenderKeyRecord), sessionMap: make(map[AddressKey]*libsignalgo.SessionRecord), @@ -147,10 +147,18 @@ func (ps *InMemorySignalProtocolStore) GetLocalRegistrationID(ctx context.Contex return ps.registrationID, nil } -func (ps *InMemorySignalProtocolStore) SaveIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey) (bool, error) { +func (ps *InMemorySignalProtocolStore) SaveIdentityKey(ctx context.Context, address *libsignalgo.Address, identityKey *libsignalgo.IdentityKey) (bool, error) { log.Debug().Msg("SaveIdentityKey called") + name, err := address.Name() + if err != nil { + return false, err + } + deviceID, err := address.DeviceID() + if err != nil { + return false, err + } replacing := false - oldKeySerialized, ok := ps.identityKeyMap[theirServiceID] + oldKeySerialized, ok := ps.identityKeyMap[AddressKey{name, deviceID}] if ok { oldKey, err := libsignalgo.DeserializeIdentityKey(oldKeySerialized) if err != nil { @@ -172,22 +180,40 @@ func (ps *InMemorySignalProtocolStore) SaveIdentityKey(ctx context.Context, thei hexIdentityKey := hex.EncodeToString(serializedIdentityKey) log.Debug().Str("hexIdentityKey", hexIdentityKey).Msg("SaveIdentityKey") - ps.identityKeyMap[theirServiceID] = serializedIdentityKey + ps.identityKeyMap[AddressKey{name, deviceID}] = serializedIdentityKey return replacing, nil } -func (ps *InMemorySignalProtocolStore) GetIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID) (*libsignalgo.IdentityKey, error) { +func (ps *InMemorySignalProtocolStore) GetIdentityKey(ctx context.Context, address *libsignalgo.Address) (*libsignalgo.IdentityKey, error) { log.Debug().Msg("GetIdentityKey called") - serializedIdentityKey, ok := ps.identityKeyMap[theirServiceID] + name, err := address.Name() + if err != nil { + return nil, err + } + deviceID, err := address.DeviceID() + if err != nil { + return nil, err + } + serializedIdentityKey, ok := ps.identityKeyMap[AddressKey{name, deviceID}] if !ok { return nil, nil } return libsignalgo.DeserializeIdentityKey(serializedIdentityKey) } -func (ps *InMemorySignalProtocolStore) IsTrustedIdentity(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey, direction libsignalgo.SignalDirection) (bool, error) { +func (ps *InMemorySignalProtocolStore) IsTrustedIdentity(ctx context.Context, address *libsignalgo.Address, identityKey *libsignalgo.IdentityKey, direction libsignalgo.SignalDirection) (bool, error) { log.Debug().Msg("IsTrustedIdentity called") - if existingSerialized, ok := ps.identityKeyMap[theirServiceID]; ok { + name, err := address.Name() + if err != nil { + log.Error().Err(err).Msg("Error getting name") + return false, err + } + deviceID, err := address.DeviceID() + if err != nil { + log.Error().Err(err).Msg("Error getting deviceID") + return false, err + } + if existingSerialized, ok := ps.identityKeyMap[AddressKey{name, deviceID}]; ok { existingKey, err := libsignalgo.DeserializeIdentityKey(existingSerialized) if err != nil { log.Error().Err(err).Interface("existingKey", existingKey).Msg("Error deserializing existing identity key") diff --git a/pkg/libsignalgo/kdf.go b/pkg/libsignalgo/kdf.go index 2f6a497..d64e819 100644 --- a/pkg/libsignalgo/kdf.go +++ b/pkg/libsignalgo/kdf.go @@ -17,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" diff --git a/pkg/libsignalgo/kyberprekey.go b/pkg/libsignalgo/kyberprekey.go index 707db76..63c9fc7 100644 --- a/pkg/libsignalgo/kyberprekey.go +++ b/pkg/libsignalgo/kyberprekey.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Scott Weber -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -52,17 +52,9 @@ func wrapKyberKeyPair(ptr *C.SignalKyberKeyPair) *KyberKeyPair { return kp } -func (kp *KyberKeyPair) mutPtr() C.SignalMutPointerKyberKeyPair { - return C.SignalMutPointerKyberKeyPair{kp.ptr} -} - -func (kp *KyberKeyPair) constPtr() C.SignalConstPointerKyberKeyPair { - return C.SignalConstPointerKyberKeyPair{kp.ptr} -} - func (kp *KyberKeyPair) Destroy() error { kp.CancelFinalizer() - return wrapError(C.signal_kyber_key_pair_destroy(kp.mutPtr())) + return wrapError(C.signal_kyber_key_pair_destroy(kp.ptr)) } func (kp *KyberKeyPair) CancelFinalizer() { @@ -75,17 +67,9 @@ func wrapKyberPublicKey(ptr *C.SignalKyberPublicKey) *KyberPublicKey { return publicKey } -func (k *KyberPublicKey) mutPtr() C.SignalMutPointerKyberPublicKey { - return C.SignalMutPointerKyberPublicKey{k.ptr} -} - -func (k *KyberPublicKey) constPtr() C.SignalConstPointerKyberPublicKey { - return C.SignalConstPointerKyberPublicKey{k.ptr} -} - func (k *KyberPublicKey) Destroy() error { k.CancelFinalizer() - return wrapError(C.signal_kyber_public_key_destroy(k.mutPtr())) + return wrapError(C.signal_publickey_destroy(k.ptr)) } func (k *KyberPublicKey) CancelFinalizer() { @@ -98,17 +82,9 @@ func wrapKyberSecretKey(ptr *C.SignalKyberSecretKey) *KyberSecretKey { return secretKey } -func (k *KyberSecretKey) mutPtr() C.SignalMutPointerKyberSecretKey { - return C.SignalMutPointerKyberSecretKey{k.ptr} -} - -func (k *KyberSecretKey) constPtr() C.SignalConstPointerKyberSecretKey { - return C.SignalConstPointerKyberSecretKey{k.ptr} -} - func (k *KyberSecretKey) Destroy() error { k.CancelFinalizer() - return wrapError(C.signal_kyber_secret_key_destroy(k.mutPtr())) + return wrapError(C.signal_kyber_secret_key_destroy(k.ptr)) } func (k *KyberSecretKey) CancelFinalizer() { @@ -122,18 +98,18 @@ func wrapKyberPreKeyRecord(ptr *C.SignalKyberPreKeyRecord) *KyberPreKeyRecord { } func (kp *KyberKeyPair) GetPublicKey() (*KyberPublicKey, error) { - var pub C.SignalMutPointerKyberPublicKey - signalFfiError := C.signal_kyber_key_pair_get_public_key(&pub, kp.constPtr()) + var pub *C.SignalKyberPublicKey + signalFfiError := C.signal_kyber_key_pair_get_public_key(&pub, kp.ptr) runtime.KeepAlive(kp) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberPublicKey(pub.raw), nil + return wrapKyberPublicKey(pub), nil } func (kp *KyberPublicKey) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_kyber_public_key_serialize(&serialized, kp.constPtr()) + signalFfiError := C.signal_kyber_public_key_serialize(&serialized, kp.ptr) runtime.KeepAlive(kp) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -142,63 +118,49 @@ func (kp *KyberPublicKey) Serialize() ([]byte, error) { } func DeserializeKyberPublicKey(serialized []byte) (*KyberPublicKey, error) { - var kyberPublicKey C.SignalMutPointerKyberPublicKey + var kyberPublicKey *C.SignalKyberPublicKey signalFfiError := C.signal_kyber_public_key_deserialize(&kyberPublicKey, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberPublicKey(kyberPublicKey.raw), nil + return wrapKyberPublicKey(kyberPublicKey), nil } func NewKyberPreKeyRecord(id uint32, timestamp time.Time, keyPair *KyberKeyPair, signature []byte) (*KyberPreKeyRecord, error) { - var kpkr C.SignalMutPointerKyberPreKeyRecord - signalFfiError := C.signal_kyber_pre_key_record_new( - &kpkr, - C.uint32_t(id), - C.uint64_t(timestamp.UnixMilli()), - keyPair.constPtr(), - BytesToBuffer(signature), - ) + var kpkr *C.SignalKyberPreKeyRecord + signalFfiError := C.signal_kyber_pre_key_record_new(&kpkr, C.uint32_t(id), C.uint64_t(timestamp.UnixMilli()), keyPair.ptr, BytesToBuffer(signature)) runtime.KeepAlive(keyPair) runtime.KeepAlive(signature) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberPreKeyRecord(kpkr.raw), nil + return wrapKyberPreKeyRecord(kpkr), nil } func DeserializeKyberPreKeyRecord(serialized []byte) (*KyberPreKeyRecord, error) { - var kpkr C.SignalMutPointerKyberPreKeyRecord + var kpkr *C.SignalKyberPreKeyRecord signalFfiError := C.signal_kyber_pre_key_record_deserialize(&kpkr, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberPreKeyRecord(kpkr.raw), nil -} - -func (kpkr *KyberPreKeyRecord) mutPtr() C.SignalMutPointerKyberPreKeyRecord { - return C.SignalMutPointerKyberPreKeyRecord{kpkr.ptr} -} - -func (kpkr *KyberPreKeyRecord) constPtr() C.SignalConstPointerKyberPreKeyRecord { - return C.SignalConstPointerKyberPreKeyRecord{kpkr.ptr} + return wrapKyberPreKeyRecord(kpkr), nil } func (kpkr *KyberPreKeyRecord) Clone() (*KyberPreKeyRecord, error) { - var cloned C.SignalMutPointerKyberPreKeyRecord - signalFfiError := C.signal_kyber_pre_key_record_clone(&cloned, kpkr.constPtr()) + var cloned *C.SignalKyberPreKeyRecord + signalFfiError := C.signal_kyber_pre_key_record_clone(&cloned, kpkr.ptr) runtime.KeepAlive(kpkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberPreKeyRecord(cloned.raw), nil + return wrapKyberPreKeyRecord(cloned), nil } func (kpkr *KyberPreKeyRecord) Destroy() error { kpkr.CancelFinalizer() - return wrapError(C.signal_kyber_pre_key_record_destroy(kpkr.mutPtr())) + return wrapError(C.signal_kyber_pre_key_record_destroy(kpkr.ptr)) } func (kpkr *KyberPreKeyRecord) CancelFinalizer() { @@ -207,7 +169,7 @@ func (kpkr *KyberPreKeyRecord) CancelFinalizer() { func (kpkr *KyberPreKeyRecord) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_kyber_pre_key_record_serialize(&serialized, kpkr.constPtr()) + signalFfiError := C.signal_kyber_pre_key_record_serialize(&serialized, kpkr.ptr) runtime.KeepAlive(kpkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -217,7 +179,7 @@ func (kpkr *KyberPreKeyRecord) Serialize() ([]byte, error) { func (kpkr *KyberPreKeyRecord) GetSignature() ([]byte, error) { var signature C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_kyber_pre_key_record_get_signature(&signature, kpkr.constPtr()) + signalFfiError := C.signal_kyber_pre_key_record_get_signature(&signature, kpkr.ptr) runtime.KeepAlive(kpkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -225,19 +187,19 @@ func (kpkr *KyberPreKeyRecord) GetSignature() ([]byte, error) { return CopySignalOwnedBufferToBytes(signature), nil } -func (kpkr *KyberPreKeyRecord) GetID() (uint32, error) { +func (kpkr *KyberPreKeyRecord) GetID() (uint, error) { var id C.uint32_t - signalFfiError := C.signal_kyber_pre_key_record_get_id(&id, kpkr.constPtr()) + signalFfiError := C.signal_kyber_pre_key_record_get_id(&id, kpkr.ptr) runtime.KeepAlive(kpkr) if signalFfiError != nil { return 0, wrapError(signalFfiError) } - return uint32(id), nil + return uint(id), nil } func (kpkr *KyberPreKeyRecord) GetTimestamp() (time.Time, error) { var ts C.uint64_t - signalFfiError := C.signal_kyber_pre_key_record_get_timestamp(&ts, kpkr.constPtr()) + signalFfiError := C.signal_kyber_pre_key_record_get_timestamp(&ts, kpkr.ptr) runtime.KeepAlive(kpkr) if signalFfiError != nil { return time.Time{}, wrapError(signalFfiError) @@ -246,30 +208,30 @@ func (kpkr *KyberPreKeyRecord) GetTimestamp() (time.Time, error) { } func (kpkr *KyberPreKeyRecord) GetPublicKey() (*KyberPublicKey, error) { - var pub C.SignalMutPointerKyberPublicKey - signalFfiError := C.signal_kyber_pre_key_record_get_public_key(&pub, kpkr.constPtr()) + var pub *C.SignalKyberPublicKey + signalFfiError := C.signal_kyber_pre_key_record_get_public_key(&pub, kpkr.ptr) runtime.KeepAlive(kpkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberPublicKey(pub.raw), nil + return wrapKyberPublicKey(pub), nil } func (kpkr *KyberPreKeyRecord) GetSecretKey() (*KyberSecretKey, error) { - var sec C.SignalMutPointerKyberSecretKey - signalFfiError := C.signal_kyber_pre_key_record_get_secret_key(&sec, kpkr.constPtr()) + var sec *C.SignalKyberSecretKey + signalFfiError := C.signal_kyber_pre_key_record_get_secret_key(&sec, kpkr.ptr) runtime.KeepAlive(kpkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberSecretKey(sec.raw), nil + return wrapKyberSecretKey(sec), nil } func KyberKeyPairGenerate() (*KyberKeyPair, error) { - var kp C.SignalMutPointerKyberKeyPair + var kp *C.SignalKyberKeyPair signalFfiError := C.signal_kyber_key_pair_generate(&kp) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapKyberKeyPair(kp.raw), nil + return wrapKyberKeyPair(kp), nil } diff --git a/pkg/libsignalgo/kyberprekeystore.go b/pkg/libsignalgo/kyberprekeystore.go index 9deea17..a0204e5 100644 --- a/pkg/libsignalgo/kyberprekeystore.go +++ b/pkg/libsignalgo/kyberprekeystore.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Scott Weber -// 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 @@ -18,12 +17,14 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #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{ +func (ctx *CallbackContext) wrapKyberPreKeyStore(store KyberPreKeyStore) *C.SignalKyberPreKeyStore { + return &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 8fc2113..5436160 160000 --- a/pkg/libsignalgo/libsignal +++ b/pkg/libsignalgo/libsignal @@ -1 +1 @@ -Subproject commit 8fc2113bda042fc972a166a24b974b0d34155c6c +Subproject commit 5436160313d4fa43ea225918138866d05f2da6f7 diff --git a/pkg/libsignalgo/libsignal-ffi.h b/pkg/libsignalgo/libsignal-ffi.h index dec28cd..9cac926 100644 --- a/pkg/libsignalgo/libsignal-ffi.h +++ b/pkg/libsignalgo/libsignal-ffi.h @@ -1,3361 +1,142 @@ -// Copyright (C) 2026 Signal Messenger, LLC. -// SPDX-License-Identifier: AGPL-3.0-only -// AUTOGENERATED! Do not modify! -#pragma once -#include -#include +/* +Copyright (C) 2020-2021 Signal Messenger, LLC. +SPDX-License-Identifier: AGPL-3.0-only +*/ + + +#ifndef SIGNAL_FFI_H_ +#define SIGNAL_FFI_H_ + +/* This file was automatically generated by cbindgen */ + +#include #include #include #include -// A static assert that's only enabled for 64-bit platforms. -#define static_assert_64bit(flag) static_assert((sizeof(void*) == 8) ? (flag) : 1, "") -static_assert_64bit(sizeof(uint8_t) == 1); -static_assert_64bit(alignof(uint8_t) == 1); -typedef uint8_t SignalType_FixedArray32_uint8_t[32]; -static_assert_64bit(sizeof(SignalType_FixedArray32_uint8_t) == 32); -static_assert_64bit(alignof(SignalType_FixedArray32_uint8_t) == 1); -typedef const SignalType_FixedArray32_uint8_t* SignalType_ConstPointer_FixedArray32_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray32_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray32_uint8_t) == 8); -typedef const SignalType_ConstPointer_FixedArray32_uint8_t* SignalType_ConstPointer_ConstPointer_FixedArray32_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_ConstPointer_FixedArray32_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_ConstPointer_FixedArray32_uint8_t) == 8); -static_assert_64bit(sizeof(int8_t) == 1); -static_assert_64bit(alignof(int8_t) == 1); -typedef const int8_t* SignalCStringPtr; -static_assert_64bit(sizeof(SignalCStringPtr) == 8); -static_assert_64bit(alignof(SignalCStringPtr) == 8); -typedef const SignalCStringPtr* SignalType_ConstPointer_SignalCStringPtr; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalCStringPtr) == 8); -typedef uint8_t SignalType_FixedArray129_uint8_t[129]; -static_assert_64bit(sizeof(SignalType_FixedArray129_uint8_t) == 129); -static_assert_64bit(alignof(SignalType_FixedArray129_uint8_t) == 1); -typedef const SignalType_FixedArray129_uint8_t* SignalType_ConstPointer_FixedArray129_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray129_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray129_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray153_uint8_t[153]; -static_assert_64bit(sizeof(SignalType_FixedArray153_uint8_t) == 153); -static_assert_64bit(alignof(SignalType_FixedArray153_uint8_t) == 1); -typedef const SignalType_FixedArray153_uint8_t* SignalType_ConstPointer_FixedArray153_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray153_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray153_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray15_uint8_t[15]; -static_assert_64bit(sizeof(SignalType_FixedArray15_uint8_t) == 15); -static_assert_64bit(alignof(SignalType_FixedArray15_uint8_t) == 1); -typedef const SignalType_FixedArray15_uint8_t* SignalType_ConstPointer_FixedArray15_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray15_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray15_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray16_uint8_t[16]; -static_assert_64bit(sizeof(SignalType_FixedArray16_uint8_t) == 16); -static_assert_64bit(alignof(SignalType_FixedArray16_uint8_t) == 1); -typedef const SignalType_FixedArray16_uint8_t* SignalType_ConstPointer_FixedArray16_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray16_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray16_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray177_uint8_t[177]; -static_assert_64bit(sizeof(SignalType_FixedArray177_uint8_t) == 177); -static_assert_64bit(alignof(SignalType_FixedArray177_uint8_t) == 1); -typedef const SignalType_FixedArray177_uint8_t* SignalType_ConstPointer_FixedArray177_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray177_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray177_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray17_uint8_t[17]; -static_assert_64bit(sizeof(SignalType_FixedArray17_uint8_t) == 17); -static_assert_64bit(alignof(SignalType_FixedArray17_uint8_t) == 1); -typedef const SignalType_FixedArray17_uint8_t* SignalType_ConstPointer_FixedArray17_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray17_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray17_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray289_uint8_t[289]; -static_assert_64bit(sizeof(SignalType_FixedArray289_uint8_t) == 289); -static_assert_64bit(alignof(SignalType_FixedArray289_uint8_t) == 1); -typedef const SignalType_FixedArray289_uint8_t* SignalType_ConstPointer_FixedArray289_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray289_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray289_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray329_uint8_t[329]; -static_assert_64bit(sizeof(SignalType_FixedArray329_uint8_t) == 329); -static_assert_64bit(alignof(SignalType_FixedArray329_uint8_t) == 1); -typedef const SignalType_FixedArray329_uint8_t* SignalType_ConstPointer_FixedArray329_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray329_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray329_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray409_uint8_t[409]; -static_assert_64bit(sizeof(SignalType_FixedArray409_uint8_t) == 409); -static_assert_64bit(alignof(SignalType_FixedArray409_uint8_t) == 1); -typedef const SignalType_FixedArray409_uint8_t* SignalType_ConstPointer_FixedArray409_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray409_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray409_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray473_uint8_t[473]; -static_assert_64bit(sizeof(SignalType_FixedArray473_uint8_t) == 473); -static_assert_64bit(alignof(SignalType_FixedArray473_uint8_t) == 1); -typedef const SignalType_FixedArray473_uint8_t* SignalType_ConstPointer_FixedArray473_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray473_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray473_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray497_uint8_t[497]; -static_assert_64bit(sizeof(SignalType_FixedArray497_uint8_t) == 497); -static_assert_64bit(alignof(SignalType_FixedArray497_uint8_t) == 1); -typedef const SignalType_FixedArray497_uint8_t* SignalType_ConstPointer_FixedArray497_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray497_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray497_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray64_uint8_t[64]; -static_assert_64bit(sizeof(SignalType_FixedArray64_uint8_t) == 64); -static_assert_64bit(alignof(SignalType_FixedArray64_uint8_t) == 1); -typedef const SignalType_FixedArray64_uint8_t* SignalType_ConstPointer_FixedArray64_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray64_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray64_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray65_uint8_t[65]; -static_assert_64bit(sizeof(SignalType_FixedArray65_uint8_t) == 65); -static_assert_64bit(alignof(SignalType_FixedArray65_uint8_t) == 1); -typedef const SignalType_FixedArray65_uint8_t* SignalType_ConstPointer_FixedArray65_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray65_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray65_uint8_t) == 8); -typedef uint8_t SignalType_FixedArray97_uint8_t[97]; -static_assert_64bit(sizeof(SignalType_FixedArray97_uint8_t) == 97); -static_assert_64bit(alignof(SignalType_FixedArray97_uint8_t) == 1); -typedef const SignalType_FixedArray97_uint8_t* SignalType_ConstPointer_FixedArray97_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_FixedArray97_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_FixedArray97_uint8_t) == 8); -typedef struct SignalAes256GcmSiv SignalAes256GcmSiv; -typedef const SignalAes256GcmSiv* SignalType_ConstPointer_SignalAes256GcmSiv; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalAes256GcmSiv) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalAes256GcmSiv) == 8); -static_assert_64bit(sizeof(bool) == 1); -static_assert_64bit(alignof(bool) == 1); -typedef const bool* SignalType_ConstPointer_bool; -static_assert_64bit(sizeof(SignalType_ConstPointer_bool) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_bool) == 8); -typedef const void* SignalType_ConstPointer_void; -static_assert_64bit(sizeof(SignalType_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_void) == 8); -static_assert_64bit(sizeof(int32_t) == 4); -static_assert_64bit(alignof(int32_t) == 4); -typedef const int32_t* SignalType_ConstPointer_int32_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_int32_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_int32_t) == 8); -typedef struct SignalPinHash SignalPinHash; -typedef const SignalPinHash* SignalType_ConstPointer_SignalPinHash; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPinHash) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPinHash) == 8); -typedef const uint8_t* SignalType_ConstPointer_uint8_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_uint8_t) == 8); -static_assert_64bit(sizeof(size_t) == 8); -static_assert_64bit(alignof(size_t) == 8); -typedef struct { - const uint8_t* base; - size_t length; -} SignalBorrowedBuffer; -static_assert_64bit(offsetof(SignalBorrowedBuffer, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedBuffer, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedBuffer) == 16); -static_assert_64bit(alignof(SignalBorrowedBuffer) == 8); -typedef const SignalBorrowedBuffer* SignalType_ConstPointer_SignalBorrowedBuffer; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBorrowedBuffer) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBorrowedBuffer) == 8); -typedef struct SignalProtocolAddress SignalProtocolAddress; -typedef const SignalProtocolAddress* SignalType_ConstPointer_SignalProtocolAddress; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalProtocolAddress) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalProtocolAddress) == 8); -typedef struct { - const SignalProtocolAddress* raw; -} SignalConstPointerProtocolAddress; -static_assert_64bit(offsetof(SignalConstPointerProtocolAddress, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerProtocolAddress) == 8); -static_assert_64bit(alignof(SignalConstPointerProtocolAddress) == 8); -typedef const SignalConstPointerProtocolAddress* SignalType_ConstPointer_SignalConstPointerProtocolAddress; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalConstPointerProtocolAddress) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalConstPointerProtocolAddress) == 8); -typedef struct SignalPublicKey SignalPublicKey; -typedef const SignalPublicKey* SignalType_ConstPointer_SignalPublicKey; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPublicKey) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPublicKey) == 8); -typedef struct { - const SignalPublicKey* raw; -} SignalConstPointerPublicKey; -static_assert_64bit(offsetof(SignalConstPointerPublicKey, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalConstPointerPublicKey) == 8); -typedef const SignalConstPointerPublicKey* SignalType_ConstPointer_SignalConstPointerPublicKey; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalConstPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalConstPointerPublicKey) == 8); -typedef struct SignalCiphertextMessage SignalCiphertextMessage; -typedef const SignalCiphertextMessage* SignalType_ConstPointer_SignalCiphertextMessage; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalCiphertextMessage) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalCiphertextMessage) == 8); -typedef struct { - const SignalCiphertextMessage* raw; -} SignalConstPointerCiphertextMessage; -static_assert_64bit(offsetof(SignalConstPointerCiphertextMessage, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerCiphertextMessage) == 8); -static_assert_64bit(alignof(SignalConstPointerCiphertextMessage) == 8); -typedef const SignalConstPointerCiphertextMessage* SignalType_ConstPointer_SignalConstPointerCiphertextMessage; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalConstPointerCiphertextMessage) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalConstPointerCiphertextMessage) == 8); -typedef struct SignalSessionRecord SignalSessionRecord; -typedef const SignalSessionRecord* SignalType_ConstPointer_SignalSessionRecord; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSessionRecord) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSessionRecord) == 8); -typedef struct { - const SignalSessionRecord* raw; -} SignalConstPointerSessionRecord; -static_assert_64bit(offsetof(SignalConstPointerSessionRecord, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSessionRecord) == 8); -static_assert_64bit(alignof(SignalConstPointerSessionRecord) == 8); -typedef const SignalConstPointerSessionRecord* SignalType_ConstPointer_SignalConstPointerSessionRecord; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalConstPointerSessionRecord) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalConstPointerSessionRecord) == 8); -static_assert_64bit(sizeof(uint64_t) == 8); -static_assert_64bit(alignof(uint64_t) == 8); -typedef struct { - uint64_t e164; - SignalType_FixedArray16_uint8_t rawAciUuid; - SignalType_FixedArray16_uint8_t rawPniUuid; -} SignalFfiCdsiLookupResponseEntry; -static_assert_64bit(offsetof(SignalFfiCdsiLookupResponseEntry, e164) == 0); -static_assert_64bit(offsetof(SignalFfiCdsiLookupResponseEntry, rawAciUuid) == 8); -static_assert_64bit(offsetof(SignalFfiCdsiLookupResponseEntry, rawPniUuid) == 24); -static_assert_64bit(sizeof(SignalFfiCdsiLookupResponseEntry) == 40); -static_assert_64bit(alignof(SignalFfiCdsiLookupResponseEntry) == 8); -typedef SignalFfiCdsiLookupResponseEntry* SignalType_MutPointer_SignalFfiCdsiLookupResponseEntry; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalFfiCdsiLookupResponseEntry) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalFfiCdsiLookupResponseEntry) == 8); -typedef struct { - SignalFfiCdsiLookupResponseEntry* base; - size_t length; -} SignalOwnedLookupResponseEntryList; -static_assert_64bit(offsetof(SignalOwnedLookupResponseEntryList, base) == 0); -static_assert_64bit(offsetof(SignalOwnedLookupResponseEntryList, length) == 8); -static_assert_64bit(sizeof(SignalOwnedLookupResponseEntryList) == 16); -static_assert_64bit(alignof(SignalOwnedLookupResponseEntryList) == 8); -typedef struct { - SignalOwnedLookupResponseEntryList entries; - int32_t debug_permits_used; -} SignalFfiCdsiLookupResponse; -static_assert_64bit(offsetof(SignalFfiCdsiLookupResponse, entries) == 0); -static_assert_64bit(offsetof(SignalFfiCdsiLookupResponse, debug_permits_used) == 16); -static_assert_64bit(sizeof(SignalFfiCdsiLookupResponse) == 24); -static_assert_64bit(alignof(SignalFfiCdsiLookupResponse) == 8); -typedef const SignalFfiCdsiLookupResponse* SignalType_ConstPointer_SignalFfiCdsiLookupResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiCdsiLookupResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiCdsiLookupResponse) == 8); -typedef SignalCStringPtr* SignalType_MutPointer_SignalCStringPtr; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCStringPtr) == 8); -typedef struct { - SignalCStringPtr* base; - size_t length; -} SignalOwnedBufferOfCStringPtr; -static_assert_64bit(offsetof(SignalOwnedBufferOfCStringPtr, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfCStringPtr, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBufferOfCStringPtr) == 16); -static_assert_64bit(alignof(SignalOwnedBufferOfCStringPtr) == 8); -typedef uint8_t* SignalType_MutPointer_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_uint8_t) == 8); -typedef struct { - uint8_t* base; - size_t length; -} SignalOwnedBuffer; -static_assert_64bit(offsetof(SignalOwnedBuffer, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBuffer, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBuffer) == 16); -static_assert_64bit(alignof(SignalOwnedBuffer) == 8); -static_assert_64bit(sizeof(uint16_t) == 2); -static_assert_64bit(alignof(uint16_t) == 2); -typedef struct { - uint16_t status; - const int8_t* message; - SignalOwnedBufferOfCStringPtr headers; - SignalOwnedBuffer body; -} SignalFfiChatResponse; -static_assert_64bit(offsetof(SignalFfiChatResponse, status) == 0); -static_assert_64bit(offsetof(SignalFfiChatResponse, message) == 8); -static_assert_64bit(offsetof(SignalFfiChatResponse, headers) == 16); -static_assert_64bit(offsetof(SignalFfiChatResponse, body) == 32); -static_assert_64bit(sizeof(SignalFfiChatResponse) == 48); -static_assert_64bit(alignof(SignalFfiChatResponse) == 8); -typedef const SignalFfiChatResponse* SignalType_ConstPointer_SignalFfiChatResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiChatResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiChatResponse) == 8); -typedef size_t* SignalType_MutPointer_size_t; -static_assert_64bit(sizeof(SignalType_MutPointer_size_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_size_t) == 8); -typedef struct { - size_t* base; - size_t length; -} SignalOwnedBufferOfusize; -static_assert_64bit(offsetof(SignalOwnedBufferOfusize, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfusize, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBufferOfusize) == 16); -static_assert_64bit(alignof(SignalOwnedBufferOfusize) == 8); -typedef struct { - SignalOwnedBuffer bytes; - SignalOwnedBufferOfusize lengths; -} SignalBytestringArray; -static_assert_64bit(offsetof(SignalBytestringArray, bytes) == 0); -static_assert_64bit(offsetof(SignalBytestringArray, lengths) == 16); -static_assert_64bit(sizeof(SignalBytestringArray) == 32); -static_assert_64bit(alignof(SignalBytestringArray) == 8); -typedef struct { - SignalBytestringArray entries; -} SignalFfiCheckSvr2CredentialsResponse; -static_assert_64bit(offsetof(SignalFfiCheckSvr2CredentialsResponse, entries) == 0); -static_assert_64bit(sizeof(SignalFfiCheckSvr2CredentialsResponse) == 32); -static_assert_64bit(alignof(SignalFfiCheckSvr2CredentialsResponse) == 8); -typedef const SignalFfiCheckSvr2CredentialsResponse* SignalType_ConstPointer_SignalFfiCheckSvr2CredentialsResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiCheckSvr2CredentialsResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiCheckSvr2CredentialsResponse) == 8); -typedef SignalPublicKey* SignalType_MutPointer_SignalPublicKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPublicKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPublicKey) == 8); -typedef struct { - SignalPublicKey* raw; -} SignalMutPointerPublicKey; -static_assert_64bit(offsetof(SignalMutPointerPublicKey, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalMutPointerPublicKey) == 8); -typedef struct SignalPreKeyBundle SignalPreKeyBundle; -typedef SignalPreKeyBundle* SignalType_MutPointer_SignalPreKeyBundle; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPreKeyBundle) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPreKeyBundle) == 8); -typedef struct { - SignalPreKeyBundle* raw; -} SignalMutPointerPreKeyBundle; -static_assert_64bit(offsetof(SignalMutPointerPreKeyBundle, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerPreKeyBundle) == 8); -static_assert_64bit(alignof(SignalMutPointerPreKeyBundle) == 8); -typedef SignalMutPointerPreKeyBundle* SignalType_MutPointer_SignalMutPointerPreKeyBundle; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerPreKeyBundle) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerPreKeyBundle) == 8); -typedef struct { - SignalMutPointerPreKeyBundle* base; - size_t length; -} SignalOwnedBufferOfMutPointerPreKeyBundle; -static_assert_64bit(offsetof(SignalOwnedBufferOfMutPointerPreKeyBundle, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMutPointerPreKeyBundle, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBufferOfMutPointerPreKeyBundle) == 16); -static_assert_64bit(alignof(SignalOwnedBufferOfMutPointerPreKeyBundle) == 8); -typedef struct { - SignalMutPointerPublicKey identity_key; - SignalOwnedBufferOfMutPointerPreKeyBundle pre_key_bundles; -} SignalFfiPreKeysResponse; -static_assert_64bit(offsetof(SignalFfiPreKeysResponse, identity_key) == 0); -static_assert_64bit(offsetof(SignalFfiPreKeysResponse, pre_key_bundles) == 8); -static_assert_64bit(sizeof(SignalFfiPreKeysResponse) == 24); -static_assert_64bit(alignof(SignalFfiPreKeysResponse) == 8); -typedef const SignalFfiPreKeysResponse* SignalType_ConstPointer_SignalFfiPreKeysResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiPreKeysResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiPreKeysResponse) == 8); -static_assert_64bit(sizeof(uint32_t) == 4); -static_assert_64bit(alignof(uint32_t) == 4); -typedef struct { - uint32_t cdn; - const int8_t* key; - SignalOwnedBufferOfCStringPtr header_keys; - SignalOwnedBufferOfCStringPtr header_values; - const int8_t* signed_upload_url; -} SignalFfiUploadForm; -static_assert_64bit(offsetof(SignalFfiUploadForm, cdn) == 0); -static_assert_64bit(offsetof(SignalFfiUploadForm, key) == 8); -static_assert_64bit(offsetof(SignalFfiUploadForm, header_keys) == 16); -static_assert_64bit(offsetof(SignalFfiUploadForm, header_values) == 32); -static_assert_64bit(offsetof(SignalFfiUploadForm, signed_upload_url) == 48); -static_assert_64bit(sizeof(SignalFfiUploadForm) == 56); -static_assert_64bit(alignof(SignalFfiUploadForm) == 8); -typedef const SignalFfiUploadForm* SignalType_ConstPointer_SignalFfiUploadForm; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiUploadForm) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiUploadForm) == 8); -typedef struct SignalCdsiLookup SignalCdsiLookup; -typedef SignalCdsiLookup* SignalType_MutPointer_SignalCdsiLookup; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCdsiLookup) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCdsiLookup) == 8); -typedef struct { - SignalCdsiLookup* raw; -} SignalMutPointerCdsiLookup; -static_assert_64bit(offsetof(SignalMutPointerCdsiLookup, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerCdsiLookup) == 8); -static_assert_64bit(alignof(SignalMutPointerCdsiLookup) == 8); -typedef const SignalMutPointerCdsiLookup* SignalType_ConstPointer_SignalMutPointerCdsiLookup; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerCdsiLookup) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerCdsiLookup) == 8); -typedef struct SignalAuthenticatedChatConnection SignalAuthenticatedChatConnection; -typedef SignalAuthenticatedChatConnection* SignalType_MutPointer_SignalAuthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalAuthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalAuthenticatedChatConnection) == 8); -typedef struct { - SignalAuthenticatedChatConnection* raw; -} SignalMutPointerAuthenticatedChatConnection; -static_assert_64bit(offsetof(SignalMutPointerAuthenticatedChatConnection, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerAuthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalMutPointerAuthenticatedChatConnection) == 8); -typedef const SignalMutPointerAuthenticatedChatConnection* SignalType_ConstPointer_SignalMutPointerAuthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerAuthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerAuthenticatedChatConnection) == 8); -typedef struct SignalProvisioningChatConnection SignalProvisioningChatConnection; -typedef SignalProvisioningChatConnection* SignalType_MutPointer_SignalProvisioningChatConnection; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalProvisioningChatConnection) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalProvisioningChatConnection) == 8); -typedef struct { - SignalProvisioningChatConnection* raw; -} SignalMutPointerProvisioningChatConnection; -static_assert_64bit(offsetof(SignalMutPointerProvisioningChatConnection, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerProvisioningChatConnection) == 8); -static_assert_64bit(alignof(SignalMutPointerProvisioningChatConnection) == 8); -typedef const SignalMutPointerProvisioningChatConnection* SignalType_ConstPointer_SignalMutPointerProvisioningChatConnection; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerProvisioningChatConnection) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerProvisioningChatConnection) == 8); -typedef struct SignalUnauthenticatedChatConnection SignalUnauthenticatedChatConnection; -typedef SignalUnauthenticatedChatConnection* SignalType_MutPointer_SignalUnauthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalUnauthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalUnauthenticatedChatConnection) == 8); -typedef struct { - SignalUnauthenticatedChatConnection* raw; -} SignalMutPointerUnauthenticatedChatConnection; -static_assert_64bit(offsetof(SignalMutPointerUnauthenticatedChatConnection, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerUnauthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalMutPointerUnauthenticatedChatConnection) == 8); -typedef const SignalMutPointerUnauthenticatedChatConnection* SignalType_ConstPointer_SignalMutPointerUnauthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerUnauthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerUnauthenticatedChatConnection) == 8); -typedef struct SignalRegistrationService SignalRegistrationService; -typedef SignalRegistrationService* SignalType_MutPointer_SignalRegistrationService; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalRegistrationService) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalRegistrationService) == 8); -typedef struct { - SignalRegistrationService* raw; -} SignalMutPointerRegistrationService; -static_assert_64bit(offsetof(SignalMutPointerRegistrationService, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerRegistrationService) == 8); -static_assert_64bit(alignof(SignalMutPointerRegistrationService) == 8); -typedef const SignalMutPointerRegistrationService* SignalType_ConstPointer_SignalMutPointerRegistrationService; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerRegistrationService) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerRegistrationService) == 8); -typedef struct SignalBackupRestoreResponse SignalBackupRestoreResponse; -typedef SignalBackupRestoreResponse* SignalType_MutPointer_SignalBackupRestoreResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalBackupRestoreResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalBackupRestoreResponse) == 8); -typedef struct { - SignalBackupRestoreResponse* raw; -} SignalMutPointerBackupRestoreResponse; -static_assert_64bit(offsetof(SignalMutPointerBackupRestoreResponse, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerBackupRestoreResponse) == 8); -static_assert_64bit(alignof(SignalMutPointerBackupRestoreResponse) == 8); -typedef const SignalMutPointerBackupRestoreResponse* SignalType_ConstPointer_SignalMutPointerBackupRestoreResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerBackupRestoreResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerBackupRestoreResponse) == 8); -typedef struct SignalBackupStoreResponse SignalBackupStoreResponse; -typedef SignalBackupStoreResponse* SignalType_MutPointer_SignalBackupStoreResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalBackupStoreResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalBackupStoreResponse) == 8); -typedef struct { - SignalBackupStoreResponse* raw; -} SignalMutPointerBackupStoreResponse; -static_assert_64bit(offsetof(SignalMutPointerBackupStoreResponse, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerBackupStoreResponse) == 8); -static_assert_64bit(alignof(SignalMutPointerBackupStoreResponse) == 8); -typedef const SignalMutPointerBackupStoreResponse* SignalType_ConstPointer_SignalMutPointerBackupStoreResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerBackupStoreResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerBackupStoreResponse) == 8); -typedef struct SignalRegisterAccountResponse SignalRegisterAccountResponse; -typedef SignalRegisterAccountResponse* SignalType_MutPointer_SignalRegisterAccountResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalRegisterAccountResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalRegisterAccountResponse) == 8); -typedef struct { - SignalRegisterAccountResponse* raw; -} SignalMutPointerRegisterAccountResponse; -static_assert_64bit(offsetof(SignalMutPointerRegisterAccountResponse, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerRegisterAccountResponse) == 8); -static_assert_64bit(alignof(SignalMutPointerRegisterAccountResponse) == 8); -typedef const SignalMutPointerRegisterAccountResponse* SignalType_ConstPointer_SignalMutPointerRegisterAccountResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMutPointerRegisterAccountResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMutPointerRegisterAccountResponse) == 8); -typedef struct { - bool present; - const int8_t* first; - SignalType_FixedArray32_uint8_t second; -} SignalOptionalPairOfCStringPtrc_uchar32; -static_assert_64bit(offsetof(SignalOptionalPairOfCStringPtrc_uchar32, present) == 0); -static_assert_64bit(offsetof(SignalOptionalPairOfCStringPtrc_uchar32, first) == 8); -static_assert_64bit(offsetof(SignalOptionalPairOfCStringPtrc_uchar32, second) == 16); -static_assert_64bit(sizeof(SignalOptionalPairOfCStringPtrc_uchar32) == 48); -static_assert_64bit(alignof(SignalOptionalPairOfCStringPtrc_uchar32) == 8); -typedef const SignalOptionalPairOfCStringPtrc_uchar32* SignalType_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32) == 8); -typedef struct { - bool present; - SignalType_FixedArray16_uint8_t bytes; -} SignalOptionalUuid; -static_assert_64bit(offsetof(SignalOptionalUuid, present) == 0); -static_assert_64bit(offsetof(SignalOptionalUuid, bytes) == 1); -static_assert_64bit(sizeof(SignalOptionalUuid) == 17); -static_assert_64bit(alignof(SignalOptionalUuid) == 1); -typedef const SignalOptionalUuid* SignalType_ConstPointer_SignalOptionalUuid; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalOptionalUuid) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalOptionalUuid) == 8); -typedef SignalType_FixedArray17_uint8_t* SignalType_MutPointer_FixedArray17_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray17_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray17_uint8_t) == 8); -typedef struct { - SignalType_FixedArray17_uint8_t* base; - size_t length; -} SignalOwnedBufferOfc_uchar17; -static_assert_64bit(offsetof(SignalOwnedBufferOfc_uchar17, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfc_uchar17, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBufferOfc_uchar17) == 16); -static_assert_64bit(alignof(SignalOwnedBufferOfc_uchar17) == 8); -typedef const SignalOwnedBufferOfc_uchar17* SignalType_ConstPointer_SignalOwnedBufferOfc_uchar17; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalOwnedBufferOfc_uchar17) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalOwnedBufferOfc_uchar17) == 8); -typedef const SignalOwnedBuffer* SignalType_ConstPointer_SignalOwnedBuffer; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalOwnedBuffer) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalOwnedBuffer) == 8); +#include + +/** + * The encoded length of a [`FourCC`], in bytes. + */ +#define SignalFourCC_ENCODED_LEN 4 + +#define SignalBoxHeader_MAX_SIZE 32 + +#define SignalNUM_AUTH_CRED_ATTRIBUTES 3 + +#define SignalNUM_PROFILE_KEY_CRED_ATTRIBUTES 4 + +#define SignalNUM_RECEIPT_CRED_ATTRIBUTES 2 + +#define SignalPRESENTATION_VERSION_1 0 + +#define SignalPRESENTATION_VERSION_2 1 + +#define SignalPRESENTATION_VERSION_3 2 + +#define SignalAES_KEY_LEN 32 + +#define SignalAESGCM_NONCE_LEN 12 + +#define SignalAESGCM_TAG_LEN 16 + +#define SignalGROUP_MASTER_KEY_LEN 32 + +#define SignalGROUP_SECRET_PARAMS_LEN 289 + +#define SignalGROUP_PUBLIC_PARAMS_LEN 97 + +#define SignalGROUP_IDENTIFIER_LEN 32 + +#define SignalAUTH_CREDENTIAL_LEN 181 + +#define SignalAUTH_CREDENTIAL_PRESENTATION_V2_LEN 461 + +#define SignalAUTH_CREDENTIAL_RESPONSE_LEN 361 + +#define SignalAUTH_CREDENTIAL_WITH_PNI_LEN 265 + +#define SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN 425 + +#define SignalPROFILE_KEY_LEN 32 + +#define SignalPROFILE_KEY_CIPHERTEXT_LEN 65 + +#define SignalPROFILE_KEY_COMMITMENT_LEN 97 + +#define SignalEXPIRING_PROFILE_KEY_CREDENTIAL_LEN 153 + +#define SignalPROFILE_KEY_CREDENTIAL_PRESENTATION_V2_LEN 713 + +#define SignalPROFILE_KEY_CREDENTIAL_REQUEST_LEN 329 + +#define SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN 473 + +#define SignalEXPIRING_PROFILE_KEY_CREDENTIAL_RESPONSE_LEN 497 + +#define SignalPROFILE_KEY_VERSION_LEN 32 + +#define SignalPROFILE_KEY_VERSION_ENCODED_LEN 64 + +#define SignalRECEIPT_CREDENTIAL_LEN 129 + +#define SignalRECEIPT_CREDENTIAL_PRESENTATION_LEN 329 + +#define SignalRECEIPT_CREDENTIAL_REQUEST_LEN 97 + +#define SignalRECEIPT_CREDENTIAL_REQUEST_CONTEXT_LEN 177 + +#define SignalRECEIPT_CREDENTIAL_RESPONSE_LEN 409 + +#define SignalRECEIPT_SERIAL_LEN 16 + +#define SignalRESERVED_LEN 1 + +#define SignalSERVER_SECRET_PARAMS_LEN 2689 + +#define SignalSERVER_PUBLIC_PARAMS_LEN 641 + +#define SignalUUID_CIPHERTEXT_LEN 65 + +#define SignalRANDOMNESS_LEN 32 + +#define SignalSIGNATURE_LEN 64 + +#define SignalUUID_LEN 16 + +#define SignalACCESS_KEY_LEN 16 + +/** + * Seconds in a 24-hour cycle (ignoring leap seconds). + */ +#define SignalSECONDS_PER_DAY 86400 + typedef enum { - SignalAuthCheckResultFfiResultMatch, - SignalAuthCheckResultFfiResultNoMatch, - SignalAuthCheckResultFfiResultInvalid, -} SignalAuthCheckResultFfiResult; -static_assert_64bit(sizeof(SignalAuthCheckResultFfiResult) == 4); -static_assert_64bit(alignof(SignalAuthCheckResultFfiResult) == 4); -typedef struct { - const int8_t* first; - SignalAuthCheckResultFfiResult second; -} SignalPairOfCStringPtrAuthCheckResultFfiResult; -static_assert_64bit(offsetof(SignalPairOfCStringPtrAuthCheckResultFfiResult, first) == 0); -static_assert_64bit(offsetof(SignalPairOfCStringPtrAuthCheckResultFfiResult, second) == 8); -static_assert_64bit(sizeof(SignalPairOfCStringPtrAuthCheckResultFfiResult) == 16); -static_assert_64bit(alignof(SignalPairOfCStringPtrAuthCheckResultFfiResult) == 8); -typedef SignalPairOfCStringPtrAuthCheckResultFfiResult* SignalType_MutPointer_SignalPairOfCStringPtrAuthCheckResultFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPairOfCStringPtrAuthCheckResultFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPairOfCStringPtrAuthCheckResultFfiResult) == 8); -typedef struct { - SignalPairOfCStringPtrAuthCheckResultFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 8); -typedef const SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult* SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 8); -typedef struct { - const int8_t* name; - uint64_t created_at; -} SignalBridgeMfaMetadataFfiResult; -static_assert_64bit(offsetof(SignalBridgeMfaMetadataFfiResult, name) == 0); -static_assert_64bit(offsetof(SignalBridgeMfaMetadataFfiResult, created_at) == 8); -static_assert_64bit(sizeof(SignalBridgeMfaMetadataFfiResult) == 16); -static_assert_64bit(alignof(SignalBridgeMfaMetadataFfiResult) == 8); + SignalCiphertextMessageTypeWhisper = 2, + SignalCiphertextMessageTypePreKey = 3, + SignalCiphertextMessageTypeSenderKey = 7, + SignalCiphertextMessageTypePlaintext = 8, +} SignalCiphertextMessageType; + typedef enum { - SignalBridgeConfirmedMfaKeyMetadataFfiResultMetadata, - SignalBridgeConfirmedMfaKeyMetadataFfiResultUnreadable, -} SignalBridgeConfirmedMfaKeyMetadataFfiResult_Tag; -typedef struct { - SignalBridgeMfaMetadataFfiResult _0; -} SignalBridgeConfirmedMfaKeyMetadataFfiResultSignalMetadata_Body; -typedef struct { - SignalBridgeConfirmedMfaKeyMetadataFfiResult_Tag tag; - union { - SignalBridgeConfirmedMfaKeyMetadataFfiResultSignalMetadata_Body metadata; - }; -} SignalBridgeConfirmedMfaKeyMetadataFfiResult; -static_assert_64bit(sizeof(SignalBridgeConfirmedMfaKeyMetadataFfiResult) == 24); -static_assert_64bit(alignof(SignalBridgeConfirmedMfaKeyMetadataFfiResult) == 8); + SignalContentHintDefault = 0, + SignalContentHintResendable = 1, + SignalContentHintImplicit = 2, +} SignalContentHint; + typedef enum { - SignalBridgeMfaKeyKindFfiResultTotp, - SignalBridgeMfaKeyKindFfiResultUnknown, -} SignalBridgeMfaKeyKindFfiResult; -static_assert_64bit(sizeof(SignalBridgeMfaKeyKindFfiResult) == 4); -static_assert_64bit(alignof(SignalBridgeMfaKeyKindFfiResult) == 4); -typedef struct { - int32_t id; - SignalBridgeConfirmedMfaKeyMetadataFfiResult metadata; - SignalBridgeMfaKeyKindFfiResult kind; -} SignalBridgeConfirmedMfaKeyFfiResult; -static_assert_64bit(offsetof(SignalBridgeConfirmedMfaKeyFfiResult, id) == 0); -static_assert_64bit(offsetof(SignalBridgeConfirmedMfaKeyFfiResult, metadata) == 8); -static_assert_64bit(offsetof(SignalBridgeConfirmedMfaKeyFfiResult, kind) == 32); -static_assert_64bit(sizeof(SignalBridgeConfirmedMfaKeyFfiResult) == 40); -static_assert_64bit(alignof(SignalBridgeConfirmedMfaKeyFfiResult) == 8); -typedef SignalBridgeConfirmedMfaKeyFfiResult* SignalType_MutPointer_SignalBridgeConfirmedMfaKeyFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalBridgeConfirmedMfaKeyFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalBridgeConfirmedMfaKeyFfiResult) == 8); -typedef struct { - SignalBridgeConfirmedMfaKeyFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 8); -typedef const SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult* SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 8); -typedef struct { - uint8_t id; - SignalOwnedBuffer encrypted_name; - uint64_t last_seen; - uint16_t registration_id; - SignalOwnedBuffer created_at_ciphertext; -} SignalLinkedDeviceInternalFfiResult; -static_assert_64bit(offsetof(SignalLinkedDeviceInternalFfiResult, id) == 0); -static_assert_64bit(offsetof(SignalLinkedDeviceInternalFfiResult, encrypted_name) == 8); -static_assert_64bit(offsetof(SignalLinkedDeviceInternalFfiResult, last_seen) == 24); -static_assert_64bit(offsetof(SignalLinkedDeviceInternalFfiResult, registration_id) == 32); -static_assert_64bit(offsetof(SignalLinkedDeviceInternalFfiResult, created_at_ciphertext) == 40); -static_assert_64bit(sizeof(SignalLinkedDeviceInternalFfiResult) == 56); -static_assert_64bit(alignof(SignalLinkedDeviceInternalFfiResult) == 8); -typedef SignalLinkedDeviceInternalFfiResult* SignalType_MutPointer_SignalLinkedDeviceInternalFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalLinkedDeviceInternalFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalLinkedDeviceInternalFfiResult) == 8); -typedef struct { - SignalLinkedDeviceInternalFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 8); -typedef const SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult* SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 8); -typedef struct { - const int8_t* first; - const int8_t* second; -} SignalPairOfCStringPtrCStringPtr; -static_assert_64bit(offsetof(SignalPairOfCStringPtrCStringPtr, first) == 0); -static_assert_64bit(offsetof(SignalPairOfCStringPtrCStringPtr, second) == 8); -static_assert_64bit(sizeof(SignalPairOfCStringPtrCStringPtr) == 16); -static_assert_64bit(alignof(SignalPairOfCStringPtrCStringPtr) == 8); -typedef const SignalPairOfCStringPtrCStringPtr* SignalType_ConstPointer_SignalPairOfCStringPtrCStringPtr; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPairOfCStringPtrCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPairOfCStringPtrCStringPtr) == 8); -typedef struct { - SignalOwnedBufferOfCStringPtr first; - SignalOwnedBufferOfCStringPtr second; -} SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr; -static_assert_64bit(offsetof(SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr, first) == 0); -static_assert_64bit(offsetof(SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr, second) == 16); -static_assert_64bit(sizeof(SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 32); -static_assert_64bit(alignof(SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 8); -typedef const SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr* SignalType_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 8); -typedef struct { - SignalOwnedBuffer first; - SignalOwnedBuffer second; -} SignalPairOfOwnedBufferOwnedBuffer; -static_assert_64bit(offsetof(SignalPairOfOwnedBufferOwnedBuffer, first) == 0); -static_assert_64bit(offsetof(SignalPairOfOwnedBufferOwnedBuffer, second) == 16); -static_assert_64bit(sizeof(SignalPairOfOwnedBufferOwnedBuffer) == 32); -static_assert_64bit(alignof(SignalPairOfOwnedBufferOwnedBuffer) == 8); -typedef const SignalPairOfOwnedBufferOwnedBuffer* SignalType_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer) == 8); -typedef struct { - SignalType_FixedArray16_uint8_t bytes; -} SignalUuid; -static_assert_64bit(offsetof(SignalUuid, bytes) == 0); -static_assert_64bit(sizeof(SignalUuid) == 16); -static_assert_64bit(alignof(SignalUuid) == 1); -typedef const SignalUuid* SignalType_ConstPointer_SignalUuid; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalUuid) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalUuid) == 8); -typedef void* SignalType_MutPointer_void; -static_assert_64bit(sizeof(SignalType_MutPointer_void) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_void) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_void)(SignalType_MutPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_void) == 8); -typedef struct SignalConnectionManager SignalConnectionManager; -typedef const SignalConnectionManager* SignalType_ConstPointer_SignalConnectionManager; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalConnectionManager) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalConnectionManager) == 8); -typedef SignalType_ConstPointer_SignalConnectionManager (*SignalType_FunctionPointer_ConstPointer_SignalConnectionManager_MutPointer_void)(SignalType_MutPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_ConstPointer_SignalConnectionManager_MutPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_ConstPointer_SignalConnectionManager_MutPointer_void) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_ConstPointer_SignalConnectionManager_MutPointer_void get_connection_manager; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiConnectChatBridgeStruct; -static_assert_64bit(offsetof(SignalFfiConnectChatBridgeStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiConnectChatBridgeStruct, get_connection_manager) == 8); -static_assert_64bit(offsetof(SignalFfiConnectChatBridgeStruct, destroy) == 16); -static_assert_64bit(sizeof(SignalFfiConnectChatBridgeStruct) == 24); -static_assert_64bit(alignof(SignalFfiConnectChatBridgeStruct) == 8); -typedef const SignalFfiConnectChatBridgeStruct* SignalType_ConstPointer_SignalFfiConnectChatBridgeStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiConnectChatBridgeStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiConnectChatBridgeStruct) == 8); -typedef struct SignalFfiError SignalFfiError; -typedef const SignalFfiError* SignalType_ConstPointer_SignalFfiError; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiError) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiError) == 8); -typedef struct SignalHsmEnclaveClient SignalHsmEnclaveClient; -typedef const SignalHsmEnclaveClient* SignalType_ConstPointer_SignalHsmEnclaveClient; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalHsmEnclaveClient) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalHsmEnclaveClient) == 8); -typedef struct { - uint8_t* base; - size_t length; -} SignalBorrowedMutableBuffer; -static_assert_64bit(offsetof(SignalBorrowedMutableBuffer, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedMutableBuffer, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedMutableBuffer) == 16); -static_assert_64bit(alignof(SignalBorrowedMutableBuffer) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_size_t_SignalBorrowedMutableBuffer)(SignalType_MutPointer_void, SignalType_MutPointer_size_t, SignalBorrowedMutableBuffer); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_size_t_SignalBorrowedMutableBuffer) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_size_t_SignalBorrowedMutableBuffer) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_uint64_t)(SignalType_MutPointer_void, uint64_t); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint64_t) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint64_t) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_size_t_SignalBorrowedMutableBuffer read; - SignalType_FunctionPointer_int32_t_MutPointer_void_uint64_t skip; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiSyncInputStreamStruct; -static_assert_64bit(offsetof(SignalFfiSyncInputStreamStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiSyncInputStreamStruct, read) == 8); -static_assert_64bit(offsetof(SignalFfiSyncInputStreamStruct, skip) == 16); -static_assert_64bit(offsetof(SignalFfiSyncInputStreamStruct, destroy) == 24); -static_assert_64bit(sizeof(SignalFfiSyncInputStreamStruct) == 32); -static_assert_64bit(alignof(SignalFfiSyncInputStreamStruct) == 8); -typedef const SignalFfiSyncInputStreamStruct* SignalType_ConstPointer_SignalFfiSyncInputStreamStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiSyncInputStreamStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiSyncInputStreamStruct) == 8); -typedef struct SignalMessageBackupKey SignalMessageBackupKey; -typedef const SignalMessageBackupKey* SignalType_ConstPointer_SignalMessageBackupKey; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMessageBackupKey) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMessageBackupKey) == 8); -typedef struct SignalMessageBackupValidationOutcome SignalMessageBackupValidationOutcome; -typedef const SignalMessageBackupValidationOutcome* SignalType_ConstPointer_SignalMessageBackupValidationOutcome; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalMessageBackupValidationOutcome) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalMessageBackupValidationOutcome) == 8); -typedef const SignalCdsiLookup* SignalType_ConstPointer_SignalCdsiLookup; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalCdsiLookup) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalCdsiLookup) == 8); -typedef struct SignalLookupRequest SignalLookupRequest; -typedef const SignalLookupRequest* SignalType_ConstPointer_SignalLookupRequest; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalLookupRequest) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalLookupRequest) == 8); -typedef const SignalAuthenticatedChatConnection* SignalType_ConstPointer_SignalAuthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalAuthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalAuthenticatedChatConnection) == 8); -static_assert_64bit(sizeof(int64_t) == 8); -static_assert_64bit(alignof(int64_t) == 8); -typedef struct { - int32_t source_attachment_cdn; - const int8_t* source_key; - int64_t object_length; - const SignalType_FixedArray15_uint8_t* media_id; - const SignalType_FixedArray64_uint8_t* encryption_key; -} SignalBridgeCopyBackupMediaItemFfiArg; -static_assert_64bit(offsetof(SignalBridgeCopyBackupMediaItemFfiArg, source_attachment_cdn) == 0); -static_assert_64bit(offsetof(SignalBridgeCopyBackupMediaItemFfiArg, source_key) == 8); -static_assert_64bit(offsetof(SignalBridgeCopyBackupMediaItemFfiArg, object_length) == 16); -static_assert_64bit(offsetof(SignalBridgeCopyBackupMediaItemFfiArg, media_id) == 24); -static_assert_64bit(offsetof(SignalBridgeCopyBackupMediaItemFfiArg, encryption_key) == 32); -static_assert_64bit(sizeof(SignalBridgeCopyBackupMediaItemFfiArg) == 40); -static_assert_64bit(alignof(SignalBridgeCopyBackupMediaItemFfiArg) == 8); -typedef const SignalBridgeCopyBackupMediaItemFfiArg* SignalType_ConstPointer_SignalBridgeCopyBackupMediaItemFfiArg; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBridgeCopyBackupMediaItemFfiArg) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBridgeCopyBackupMediaItemFfiArg) == 8); -typedef struct { - const SignalType_FixedArray15_uint8_t* media_id; - int32_t cdn; -} SignalBridgeDeleteBackupMediaItemFfiArg; -static_assert_64bit(offsetof(SignalBridgeDeleteBackupMediaItemFfiArg, media_id) == 0); -static_assert_64bit(offsetof(SignalBridgeDeleteBackupMediaItemFfiArg, cdn) == 8); -static_assert_64bit(sizeof(SignalBridgeDeleteBackupMediaItemFfiArg) == 16); -static_assert_64bit(alignof(SignalBridgeDeleteBackupMediaItemFfiArg) == 8); -typedef const SignalBridgeDeleteBackupMediaItemFfiArg* SignalType_ConstPointer_SignalBridgeDeleteBackupMediaItemFfiArg; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBridgeDeleteBackupMediaItemFfiArg) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBridgeDeleteBackupMediaItemFfiArg) == 8); -typedef struct { - const int8_t* backup_dir; - const int8_t* media_dir; - int64_t used_space; -} SignalBridgeMediaBackupInfoFfiResult; -static_assert_64bit(offsetof(SignalBridgeMediaBackupInfoFfiResult, backup_dir) == 0); -static_assert_64bit(offsetof(SignalBridgeMediaBackupInfoFfiResult, media_dir) == 8); -static_assert_64bit(offsetof(SignalBridgeMediaBackupInfoFfiResult, used_space) == 16); -static_assert_64bit(sizeof(SignalBridgeMediaBackupInfoFfiResult) == 24); -static_assert_64bit(alignof(SignalBridgeMediaBackupInfoFfiResult) == 8); -typedef const SignalBridgeMediaBackupInfoFfiResult* SignalType_ConstPointer_SignalBridgeMediaBackupInfoFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBridgeMediaBackupInfoFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBridgeMediaBackupInfoFfiResult) == 8); -typedef struct { - const int8_t* backup_dir; - int32_t cdn; - const int8_t* backup_name; -} SignalBridgeMessageBackupInfoFfiResult; -static_assert_64bit(offsetof(SignalBridgeMessageBackupInfoFfiResult, backup_dir) == 0); -static_assert_64bit(offsetof(SignalBridgeMessageBackupInfoFfiResult, cdn) == 8); -static_assert_64bit(offsetof(SignalBridgeMessageBackupInfoFfiResult, backup_name) == 16); -static_assert_64bit(sizeof(SignalBridgeMessageBackupInfoFfiResult) == 24); -static_assert_64bit(alignof(SignalBridgeMessageBackupInfoFfiResult) == 8); -typedef const SignalBridgeMessageBackupInfoFfiResult* SignalType_ConstPointer_SignalBridgeMessageBackupInfoFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBridgeMessageBackupInfoFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBridgeMessageBackupInfoFfiResult) == 8); -typedef struct { - const int8_t* algorithm; - int32_t password_length; - int32_t time_step_seconds; -} SignalBridgeTotpParametersFfiResult; -static_assert_64bit(offsetof(SignalBridgeTotpParametersFfiResult, algorithm) == 0); -static_assert_64bit(offsetof(SignalBridgeTotpParametersFfiResult, password_length) == 8); -static_assert_64bit(offsetof(SignalBridgeTotpParametersFfiResult, time_step_seconds) == 12); -static_assert_64bit(sizeof(SignalBridgeTotpParametersFfiResult) == 16); -static_assert_64bit(alignof(SignalBridgeTotpParametersFfiResult) == 8); -typedef struct { - SignalOwnedBuffer key; - SignalBridgeTotpParametersFfiResult parameters; -} SignalBridgePendingTotpKeyFfiResult; -static_assert_64bit(offsetof(SignalBridgePendingTotpKeyFfiResult, key) == 0); -static_assert_64bit(offsetof(SignalBridgePendingTotpKeyFfiResult, parameters) == 16); -static_assert_64bit(sizeof(SignalBridgePendingTotpKeyFfiResult) == 32); -static_assert_64bit(alignof(SignalBridgePendingTotpKeyFfiResult) == 8); -typedef const SignalBridgePendingTotpKeyFfiResult* SignalType_ConstPointer_SignalBridgePendingTotpKeyFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBridgePendingTotpKeyFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBridgePendingTotpKeyFfiResult) == 8); -typedef struct { - int32_t aci_ec_pre_key_count; - int32_t aci_kem_pre_key_count; - int32_t pni_ec_pre_key_count; - int32_t pni_kem_pre_key_count; -} SignalBridgePreKeyCountsFfiResult; -static_assert_64bit(offsetof(SignalBridgePreKeyCountsFfiResult, aci_ec_pre_key_count) == 0); -static_assert_64bit(offsetof(SignalBridgePreKeyCountsFfiResult, aci_kem_pre_key_count) == 4); -static_assert_64bit(offsetof(SignalBridgePreKeyCountsFfiResult, pni_ec_pre_key_count) == 8); -static_assert_64bit(offsetof(SignalBridgePreKeyCountsFfiResult, pni_kem_pre_key_count) == 12); -static_assert_64bit(sizeof(SignalBridgePreKeyCountsFfiResult) == 16); -static_assert_64bit(alignof(SignalBridgePreKeyCountsFfiResult) == 4); -typedef const SignalBridgePreKeyCountsFfiResult* SignalType_ConstPointer_SignalBridgePreKeyCountsFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBridgePreKeyCountsFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBridgePreKeyCountsFfiResult) == 8); -typedef enum { - SignalBridgeCopyBackupMediaResultFfiResultSuccess, - SignalBridgeCopyBackupMediaResultFfiResultSourceNotFound, - SignalBridgeCopyBackupMediaResultFfiResultWrongSourceLength, - SignalBridgeCopyBackupMediaResultFfiResultOutOfSpace, -} SignalBridgeCopyBackupMediaResultFfiResult_Tag; -typedef struct { - int32_t cdn; -} SignalBridgeCopyBackupMediaResultFfiResultSignalSuccess_Body; -typedef struct { - SignalBridgeCopyBackupMediaResultFfiResult_Tag tag; - union { - SignalBridgeCopyBackupMediaResultFfiResultSignalSuccess_Body success; - }; -} SignalBridgeCopyBackupMediaResultFfiResult; -static_assert_64bit(sizeof(SignalBridgeCopyBackupMediaResultFfiResult) == 8); -static_assert_64bit(alignof(SignalBridgeCopyBackupMediaResultFfiResult) == 4); -typedef struct { - SignalType_FixedArray15_uint8_t media_id; - SignalBridgeCopyBackupMediaResultFfiResult result; -} SignalBridgeCopyBackupMediaOutcomeFfiResult; -static_assert_64bit(offsetof(SignalBridgeCopyBackupMediaOutcomeFfiResult, media_id) == 0); -static_assert_64bit(offsetof(SignalBridgeCopyBackupMediaOutcomeFfiResult, result) == 16); -static_assert_64bit(sizeof(SignalBridgeCopyBackupMediaOutcomeFfiResult) == 24); -static_assert_64bit(alignof(SignalBridgeCopyBackupMediaOutcomeFfiResult) == 4); -typedef SignalBridgeCopyBackupMediaOutcomeFfiResult* SignalType_MutPointer_SignalBridgeCopyBackupMediaOutcomeFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalBridgeCopyBackupMediaOutcomeFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalBridgeCopyBackupMediaOutcomeFfiResult) == 8); -typedef struct { - SignalBridgeCopyBackupMediaOutcomeFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedBridgeCopyBackupMediaOutcomeFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeCopyBackupMediaOutcomeFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeCopyBackupMediaOutcomeFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeCopyBackupMediaOutcomeFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedBridgeCopyBackupMediaOutcomeFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedBridgeCopyBackupMediaOutcomeFfiResult) == 8); -typedef SignalFfiError* SignalType_MutPointer_SignalFfiError; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalFfiError) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalFfiError) == 8); -typedef struct { - SignalFfiError* raw; -} SignalFfiBulkPolledStreamTerminationReason; -static_assert_64bit(offsetof(SignalFfiBulkPolledStreamTerminationReason, raw) == 0); -static_assert_64bit(sizeof(SignalFfiBulkPolledStreamTerminationReason) == 8); -static_assert_64bit(alignof(SignalFfiBulkPolledStreamTerminationReason) == 8); -typedef struct { - SignalOwnedBufferOfMaxAlignedBridgeCopyBackupMediaOutcomeFfiResult chunk; - SignalFfiBulkPolledStreamTerminationReason termination; -} SignalCopyBackupMediaNextChunkFfiResult; -static_assert_64bit(offsetof(SignalCopyBackupMediaNextChunkFfiResult, chunk) == 0); -static_assert_64bit(offsetof(SignalCopyBackupMediaNextChunkFfiResult, termination) == 24); -static_assert_64bit(sizeof(SignalCopyBackupMediaNextChunkFfiResult) == 32); -static_assert_64bit(alignof(SignalCopyBackupMediaNextChunkFfiResult) == 8); -typedef const SignalCopyBackupMediaNextChunkFfiResult* SignalType_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult) == 8); -typedef struct SignalCopyBackupMediaStream SignalCopyBackupMediaStream; -typedef const SignalCopyBackupMediaStream* SignalType_ConstPointer_SignalCopyBackupMediaStream; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalCopyBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalCopyBackupMediaStream) == 8); -typedef struct { - SignalType_FixedArray15_uint8_t media_id; - int32_t cdn; -} SignalBridgeDeleteBackupMediaItemFfiResult; -static_assert_64bit(offsetof(SignalBridgeDeleteBackupMediaItemFfiResult, media_id) == 0); -static_assert_64bit(offsetof(SignalBridgeDeleteBackupMediaItemFfiResult, cdn) == 16); -static_assert_64bit(sizeof(SignalBridgeDeleteBackupMediaItemFfiResult) == 20); -static_assert_64bit(alignof(SignalBridgeDeleteBackupMediaItemFfiResult) == 4); -typedef SignalBridgeDeleteBackupMediaItemFfiResult* SignalType_MutPointer_SignalBridgeDeleteBackupMediaItemFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalBridgeDeleteBackupMediaItemFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalBridgeDeleteBackupMediaItemFfiResult) == 8); -typedef struct { - SignalBridgeDeleteBackupMediaItemFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedBridgeDeleteBackupMediaItemFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeDeleteBackupMediaItemFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeDeleteBackupMediaItemFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedBridgeDeleteBackupMediaItemFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedBridgeDeleteBackupMediaItemFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedBridgeDeleteBackupMediaItemFfiResult) == 8); -typedef struct { - SignalOwnedBufferOfMaxAlignedBridgeDeleteBackupMediaItemFfiResult chunk; - SignalFfiBulkPolledStreamTerminationReason termination; -} SignalDeleteBackupMediaNextChunkFfiResult; -static_assert_64bit(offsetof(SignalDeleteBackupMediaNextChunkFfiResult, chunk) == 0); -static_assert_64bit(offsetof(SignalDeleteBackupMediaNextChunkFfiResult, termination) == 24); -static_assert_64bit(sizeof(SignalDeleteBackupMediaNextChunkFfiResult) == 32); -static_assert_64bit(alignof(SignalDeleteBackupMediaNextChunkFfiResult) == 8); -typedef const SignalDeleteBackupMediaNextChunkFfiResult* SignalType_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult) == 8); -typedef struct SignalDeleteBackupMediaStream SignalDeleteBackupMediaStream; -typedef const SignalDeleteBackupMediaStream* SignalType_ConstPointer_SignalDeleteBackupMediaStream; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalDeleteBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalDeleteBackupMediaStream) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void)(SignalType_MutPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalFfiError)(SignalType_MutPointer_void, SignalType_MutPointer_SignalFfiError); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalFfiError) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalFfiError) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_SignalBytestringArray)(SignalType_MutPointer_void, SignalBytestringArray); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalBytestringArray) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalBytestringArray) == 8); -typedef struct SignalServerMessageAck SignalServerMessageAck; -typedef SignalServerMessageAck* SignalType_MutPointer_SignalServerMessageAck; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalServerMessageAck) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalServerMessageAck) == 8); -typedef struct { - SignalServerMessageAck* raw; -} SignalMutPointerServerMessageAck; -static_assert_64bit(offsetof(SignalMutPointerServerMessageAck, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerServerMessageAck) == 8); -static_assert_64bit(alignof(SignalMutPointerServerMessageAck) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_uint64_t_SignalMutPointerServerMessageAck)(SignalType_MutPointer_void, SignalOwnedBuffer, uint64_t, SignalMutPointerServerMessageAck); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_uint64_t_SignalMutPointerServerMessageAck) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_uint64_t_SignalMutPointerServerMessageAck) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_uint64_t_SignalMutPointerServerMessageAck received_incoming_message; - SignalType_FunctionPointer_int32_t_MutPointer_void received_queue_empty; - SignalType_FunctionPointer_int32_t_MutPointer_void_SignalBytestringArray received_alerts; - SignalType_FunctionPointer_int32_t_MutPointer_void_uint64_t received_server_timestamp; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalFfiError connection_interrupted; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiChatListenerStruct; -static_assert_64bit(offsetof(SignalFfiChatListenerStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiChatListenerStruct, received_incoming_message) == 8); -static_assert_64bit(offsetof(SignalFfiChatListenerStruct, received_queue_empty) == 16); -static_assert_64bit(offsetof(SignalFfiChatListenerStruct, received_alerts) == 24); -static_assert_64bit(offsetof(SignalFfiChatListenerStruct, received_server_timestamp) == 32); -static_assert_64bit(offsetof(SignalFfiChatListenerStruct, connection_interrupted) == 40); -static_assert_64bit(offsetof(SignalFfiChatListenerStruct, destroy) == 48); -static_assert_64bit(sizeof(SignalFfiChatListenerStruct) == 56); -static_assert_64bit(alignof(SignalFfiChatListenerStruct) == 8); -typedef const SignalFfiChatListenerStruct* SignalType_ConstPointer_SignalFfiChatListenerStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiChatListenerStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiChatListenerStruct) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_SignalCStringPtr_SignalMutPointerServerMessageAck)(SignalType_MutPointer_void, SignalCStringPtr, SignalMutPointerServerMessageAck); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalCStringPtr_SignalMutPointerServerMessageAck) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalCStringPtr_SignalMutPointerServerMessageAck) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_SignalMutPointerServerMessageAck)(SignalType_MutPointer_void, SignalOwnedBuffer, SignalMutPointerServerMessageAck); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_SignalMutPointerServerMessageAck) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_SignalMutPointerServerMessageAck) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_SignalCStringPtr_SignalMutPointerServerMessageAck received_address; - SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_SignalMutPointerServerMessageAck received_envelope; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalFfiError connection_interrupted; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiProvisioningListenerStruct; -static_assert_64bit(offsetof(SignalFfiProvisioningListenerStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiProvisioningListenerStruct, received_address) == 8); -static_assert_64bit(offsetof(SignalFfiProvisioningListenerStruct, received_envelope) == 16); -static_assert_64bit(offsetof(SignalFfiProvisioningListenerStruct, connection_interrupted) == 24); -static_assert_64bit(offsetof(SignalFfiProvisioningListenerStruct, destroy) == 32); -static_assert_64bit(sizeof(SignalFfiProvisioningListenerStruct) == 40); -static_assert_64bit(alignof(SignalFfiProvisioningListenerStruct) == 8); -typedef const SignalFfiProvisioningListenerStruct* SignalType_ConstPointer_SignalFfiProvisioningListenerStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiProvisioningListenerStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiProvisioningListenerStruct) == 8); -typedef struct SignalHttpRequest SignalHttpRequest; -typedef const SignalHttpRequest* SignalType_ConstPointer_SignalHttpRequest; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalHttpRequest) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalHttpRequest) == 8); -typedef const SignalProvisioningChatConnection* SignalType_ConstPointer_SignalProvisioningChatConnection; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalProvisioningChatConnection) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalProvisioningChatConnection) == 8); -typedef const SignalServerMessageAck* SignalType_ConstPointer_SignalServerMessageAck; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalServerMessageAck) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalServerMessageAck) == 8); -typedef const SignalUnauthenticatedChatConnection* SignalType_ConstPointer_SignalUnauthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalUnauthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalUnauthenticatedChatConnection) == 8); -typedef SignalPairOfCStringPtrCStringPtr* SignalType_MutPointer_SignalPairOfCStringPtrCStringPtr; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPairOfCStringPtrCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPairOfCStringPtrCStringPtr) == 8); -typedef struct { - SignalPairOfCStringPtrCStringPtr* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedPairOfCStringPtrCStringPtr; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrCStringPtr, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrCStringPtr, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrCStringPtr, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrCStringPtr) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedPairOfCStringPtrCStringPtr) == 8); -typedef struct { - const int8_t* base; - SignalOwnedBufferOfMaxAlignedPairOfCStringPtrCStringPtr conversions; -} SignalCurrencyInternalFfiResult; -static_assert_64bit(offsetof(SignalCurrencyInternalFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalCurrencyInternalFfiResult, conversions) == 8); -static_assert_64bit(sizeof(SignalCurrencyInternalFfiResult) == 32); -static_assert_64bit(alignof(SignalCurrencyInternalFfiResult) == 8); -typedef SignalCurrencyInternalFfiResult* SignalType_MutPointer_SignalCurrencyInternalFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCurrencyInternalFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCurrencyInternalFfiResult) == 8); -typedef struct { - SignalCurrencyInternalFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedCurrencyInternalFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedCurrencyInternalFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedCurrencyInternalFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedCurrencyInternalFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedCurrencyInternalFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedCurrencyInternalFfiResult) == 8); -typedef struct { - uint64_t timestamp_ms; - SignalOwnedBufferOfMaxAlignedCurrencyInternalFfiResult currencies; -} SignalCurrencyConversionsInternalFfiResult; -static_assert_64bit(offsetof(SignalCurrencyConversionsInternalFfiResult, timestamp_ms) == 0); -static_assert_64bit(offsetof(SignalCurrencyConversionsInternalFfiResult, currencies) == 8); -static_assert_64bit(sizeof(SignalCurrencyConversionsInternalFfiResult) == 32); -static_assert_64bit(alignof(SignalCurrencyConversionsInternalFfiResult) == 8); -typedef const SignalCurrencyConversionsInternalFfiResult* SignalType_ConstPointer_SignalCurrencyConversionsInternalFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalCurrencyConversionsInternalFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalCurrencyConversionsInternalFfiResult) == 8); -typedef enum { - SignalDeviceCapabilityInternalFfiArgStorage, - SignalDeviceCapabilityInternalFfiArgTransfer, - SignalDeviceCapabilityInternalFfiArgAttachmentBackfill, - SignalDeviceCapabilityInternalFfiArgSparsePostQuantumRatchet, - SignalDeviceCapabilityInternalFfiArgProfilesV2, - SignalDeviceCapabilityInternalFfiArgUsernameChangeSyncMessage, - SignalDeviceCapabilityInternalFfiArgOptionalPhoneNumber, -} SignalDeviceCapabilityInternalFfiArg; -static_assert_64bit(sizeof(SignalDeviceCapabilityInternalFfiArg) == 4); -static_assert_64bit(alignof(SignalDeviceCapabilityInternalFfiArg) == 4); -typedef const SignalDeviceCapabilityInternalFfiArg* SignalType_ConstPointer_SignalDeviceCapabilityInternalFfiArg; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalDeviceCapabilityInternalFfiArg) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalDeviceCapabilityInternalFfiArg) == 8); -typedef struct { - const int8_t* key; - const int8_t* credential; - const int8_t* acl; - const int8_t* algorithm; - const int8_t* date; - const int8_t* policy; - const int8_t* signature; -} SignalS3UploadFormInternalFfiResult; -static_assert_64bit(offsetof(SignalS3UploadFormInternalFfiResult, key) == 0); -static_assert_64bit(offsetof(SignalS3UploadFormInternalFfiResult, credential) == 8); -static_assert_64bit(offsetof(SignalS3UploadFormInternalFfiResult, acl) == 16); -static_assert_64bit(offsetof(SignalS3UploadFormInternalFfiResult, algorithm) == 24); -static_assert_64bit(offsetof(SignalS3UploadFormInternalFfiResult, date) == 32); -static_assert_64bit(offsetof(SignalS3UploadFormInternalFfiResult, policy) == 40); -static_assert_64bit(offsetof(SignalS3UploadFormInternalFfiResult, signature) == 48); -static_assert_64bit(sizeof(SignalS3UploadFormInternalFfiResult) == 56); -static_assert_64bit(alignof(SignalS3UploadFormInternalFfiResult) == 8); -typedef SignalS3UploadFormInternalFfiResult* SignalType_MutPointer_SignalS3UploadFormInternalFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalS3UploadFormInternalFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalS3UploadFormInternalFfiResult) == 8); -typedef struct { - SignalS3UploadFormInternalFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedS3UploadFormInternalFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedS3UploadFormInternalFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedS3UploadFormInternalFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedS3UploadFormInternalFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedS3UploadFormInternalFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedS3UploadFormInternalFfiResult) == 8); -typedef struct { - const int8_t* pack_id; - SignalS3UploadFormInternalFfiResult manifest_upload_form; - SignalOwnedBufferOfMaxAlignedS3UploadFormInternalFfiResult sticker_upload_forms; -} SignalGetStickerUploadFormsResponseFfiResult; -static_assert_64bit(offsetof(SignalGetStickerUploadFormsResponseFfiResult, pack_id) == 0); -static_assert_64bit(offsetof(SignalGetStickerUploadFormsResponseFfiResult, manifest_upload_form) == 8); -static_assert_64bit(offsetof(SignalGetStickerUploadFormsResponseFfiResult, sticker_upload_forms) == 64); -static_assert_64bit(sizeof(SignalGetStickerUploadFormsResponseFfiResult) == 88); -static_assert_64bit(alignof(SignalGetStickerUploadFormsResponseFfiResult) == 8); -typedef const SignalGetStickerUploadFormsResponseFfiResult* SignalType_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult) == 8); -typedef struct { - int32_t cdn; - SignalType_FixedArray15_uint8_t media_id; - int64_t object_length; -} SignalListMediaItemFfiResult; -static_assert_64bit(offsetof(SignalListMediaItemFfiResult, cdn) == 0); -static_assert_64bit(offsetof(SignalListMediaItemFfiResult, media_id) == 4); -static_assert_64bit(offsetof(SignalListMediaItemFfiResult, object_length) == 24); -static_assert_64bit(sizeof(SignalListMediaItemFfiResult) == 32); -static_assert_64bit(alignof(SignalListMediaItemFfiResult) == 8); -typedef SignalListMediaItemFfiResult* SignalType_MutPointer_SignalListMediaItemFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalListMediaItemFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalListMediaItemFfiResult) == 8); -typedef struct { - SignalListMediaItemFfiResult* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedListMediaItemFfiResult; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedListMediaItemFfiResult, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedListMediaItemFfiResult, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedListMediaItemFfiResult, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedListMediaItemFfiResult) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedListMediaItemFfiResult) == 8); -typedef struct { - SignalOwnedBufferOfMaxAlignedListMediaItemFfiResult items; - const int8_t* backup_dir; - const int8_t* media_dir; - const int8_t* cursor; -} SignalListMediaResponseFfiResult; -static_assert_64bit(offsetof(SignalListMediaResponseFfiResult, items) == 0); -static_assert_64bit(offsetof(SignalListMediaResponseFfiResult, backup_dir) == 24); -static_assert_64bit(offsetof(SignalListMediaResponseFfiResult, media_dir) == 32); -static_assert_64bit(offsetof(SignalListMediaResponseFfiResult, cursor) == 40); -static_assert_64bit(sizeof(SignalListMediaResponseFfiResult) == 48); -static_assert_64bit(alignof(SignalListMediaResponseFfiResult) == 8); -typedef const SignalListMediaResponseFfiResult* SignalType_ConstPointer_SignalListMediaResponseFfiResult; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalListMediaResponseFfiResult) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalListMediaResponseFfiResult) == 8); -typedef struct SignalRegistrationAccountAttributes SignalRegistrationAccountAttributes; -typedef const SignalRegistrationAccountAttributes* SignalType_ConstPointer_SignalRegistrationAccountAttributes; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalRegistrationAccountAttributes) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalRegistrationAccountAttributes) == 8); -typedef struct SignalRegisterAccountRequest SignalRegisterAccountRequest; -typedef const SignalRegisterAccountRequest* SignalType_ConstPointer_SignalRegisterAccountRequest; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalRegisterAccountRequest) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalRegisterAccountRequest) == 8); -typedef const SignalRegistrationService* SignalType_ConstPointer_SignalRegistrationService; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalRegistrationService) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalRegistrationService) == 8); -typedef struct SignalTokioAsyncContext SignalTokioAsyncContext; -typedef const SignalTokioAsyncContext* SignalType_ConstPointer_SignalTokioAsyncContext; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalTokioAsyncContext) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalTokioAsyncContext) == 8); -typedef bool* SignalType_MutPointer_bool; -static_assert_64bit(sizeof(SignalType_MutPointer_bool) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_bool) == 8); -typedef SignalProtocolAddress* SignalType_MutPointer_SignalProtocolAddress; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalProtocolAddress) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalProtocolAddress) == 8); -typedef struct { - SignalProtocolAddress* raw; -} SignalMutPointerProtocolAddress; -static_assert_64bit(offsetof(SignalMutPointerProtocolAddress, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerProtocolAddress) == 8); -static_assert_64bit(alignof(SignalMutPointerProtocolAddress) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_bool_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey_uint32_t)(SignalType_MutPointer_void, SignalType_MutPointer_bool, SignalMutPointerProtocolAddress, SignalMutPointerPublicKey, uint32_t); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_bool_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_bool_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey_uint32_t) == 8); -typedef SignalMutPointerPublicKey* SignalType_MutPointer_SignalMutPointerPublicKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerPublicKey) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPublicKey_SignalMutPointerProtocolAddress)(SignalType_MutPointer_void, SignalType_MutPointer_SignalMutPointerPublicKey, SignalMutPointerProtocolAddress); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPublicKey_SignalMutPointerProtocolAddress) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPublicKey_SignalMutPointerProtocolAddress) == 8); -typedef struct SignalPrivateKey SignalPrivateKey; -typedef SignalPrivateKey* SignalType_MutPointer_SignalPrivateKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPrivateKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPrivateKey) == 8); -typedef struct { - SignalPrivateKey* raw; -} SignalMutPointerPrivateKey; -static_assert_64bit(offsetof(SignalMutPointerPrivateKey, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerPrivateKey) == 8); -static_assert_64bit(alignof(SignalMutPointerPrivateKey) == 8); -typedef struct { - SignalMutPointerPrivateKey first; - SignalMutPointerPublicKey second; -} SignalPairOfMutPointerPrivateKeyMutPointerPublicKey; -static_assert_64bit(offsetof(SignalPairOfMutPointerPrivateKeyMutPointerPublicKey, first) == 0); -static_assert_64bit(offsetof(SignalPairOfMutPointerPrivateKeyMutPointerPublicKey, second) == 8); -static_assert_64bit(sizeof(SignalPairOfMutPointerPrivateKeyMutPointerPublicKey) == 16); -static_assert_64bit(alignof(SignalPairOfMutPointerPrivateKeyMutPointerPublicKey) == 8); -typedef SignalPairOfMutPointerPrivateKeyMutPointerPublicKey* SignalType_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey)(SignalType_MutPointer_void, SignalType_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey) == 8); -typedef uint32_t* SignalType_MutPointer_uint32_t; -static_assert_64bit(sizeof(SignalType_MutPointer_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_uint32_t) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint32_t)(SignalType_MutPointer_void, SignalType_MutPointer_uint32_t); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint32_t) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint8_t_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey)(SignalType_MutPointer_void, SignalType_MutPointer_uint8_t, SignalMutPointerProtocolAddress, SignalMutPointerPublicKey); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint8_t_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint8_t_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey get_local_identity_key_pair; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint32_t get_local_registration_id; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPublicKey_SignalMutPointerProtocolAddress get_identity_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint8_t_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey save_identity_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_bool_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey_uint32_t is_trusted_identity; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiIdentityKeyStoreStruct; -static_assert_64bit(offsetof(SignalFfiIdentityKeyStoreStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiIdentityKeyStoreStruct, get_local_identity_key_pair) == 8); -static_assert_64bit(offsetof(SignalFfiIdentityKeyStoreStruct, get_local_registration_id) == 16); -static_assert_64bit(offsetof(SignalFfiIdentityKeyStoreStruct, get_identity_key) == 24); -static_assert_64bit(offsetof(SignalFfiIdentityKeyStoreStruct, save_identity_key) == 32); -static_assert_64bit(offsetof(SignalFfiIdentityKeyStoreStruct, is_trusted_identity) == 40); -static_assert_64bit(offsetof(SignalFfiIdentityKeyStoreStruct, destroy) == 48); -static_assert_64bit(sizeof(SignalFfiIdentityKeyStoreStruct) == 56); -static_assert_64bit(alignof(SignalFfiIdentityKeyStoreStruct) == 8); -typedef const SignalFfiIdentityKeyStoreStruct* SignalType_ConstPointer_SignalFfiIdentityKeyStoreStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiIdentityKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiIdentityKeyStoreStruct) == 8); -typedef struct SignalKyberPreKeyRecord SignalKyberPreKeyRecord; -typedef SignalKyberPreKeyRecord* SignalType_MutPointer_SignalKyberPreKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalKyberPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalKyberPreKeyRecord) == 8); -typedef struct { - SignalKyberPreKeyRecord* raw; -} SignalMutPointerKyberPreKeyRecord; -static_assert_64bit(offsetof(SignalMutPointerKyberPreKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerKyberPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalMutPointerKyberPreKeyRecord) == 8); -typedef SignalMutPointerKyberPreKeyRecord* SignalType_MutPointer_SignalMutPointerKyberPreKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerKyberPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerKyberPreKeyRecord) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerKyberPreKeyRecord_uint32_t)(SignalType_MutPointer_void, SignalType_MutPointer_SignalMutPointerKyberPreKeyRecord, uint32_t); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerKyberPreKeyRecord_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerKyberPreKeyRecord_uint32_t) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerKyberPreKeyRecord)(SignalType_MutPointer_void, uint32_t, SignalMutPointerKyberPreKeyRecord); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerKyberPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerKyberPreKeyRecord) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_uint32_t_SignalMutPointerPublicKey)(SignalType_MutPointer_void, uint32_t, uint32_t, SignalMutPointerPublicKey); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_uint32_t_SignalMutPointerPublicKey) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_uint32_t_SignalMutPointerPublicKey) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerKyberPreKeyRecord_uint32_t load_kyber_pre_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerKyberPreKeyRecord store_kyber_pre_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_uint32_t_SignalMutPointerPublicKey mark_kyber_pre_key_used; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiKyberPreKeyStoreStruct; -static_assert_64bit(offsetof(SignalFfiKyberPreKeyStoreStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiKyberPreKeyStoreStruct, load_kyber_pre_key) == 8); -static_assert_64bit(offsetof(SignalFfiKyberPreKeyStoreStruct, store_kyber_pre_key) == 16); -static_assert_64bit(offsetof(SignalFfiKyberPreKeyStoreStruct, mark_kyber_pre_key_used) == 24); -static_assert_64bit(offsetof(SignalFfiKyberPreKeyStoreStruct, destroy) == 32); -static_assert_64bit(sizeof(SignalFfiKyberPreKeyStoreStruct) == 40); -static_assert_64bit(alignof(SignalFfiKyberPreKeyStoreStruct) == 8); -typedef const SignalFfiKyberPreKeyStoreStruct* SignalType_ConstPointer_SignalFfiKyberPreKeyStoreStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiKyberPreKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiKyberPreKeyStoreStruct) == 8); -typedef struct SignalPreKeyRecord SignalPreKeyRecord; -typedef SignalPreKeyRecord* SignalType_MutPointer_SignalPreKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPreKeyRecord) == 8); -typedef struct { - SignalPreKeyRecord* raw; -} SignalMutPointerPreKeyRecord; -static_assert_64bit(offsetof(SignalMutPointerPreKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalMutPointerPreKeyRecord) == 8); -typedef SignalMutPointerPreKeyRecord* SignalType_MutPointer_SignalMutPointerPreKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerPreKeyRecord) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPreKeyRecord_uint32_t)(SignalType_MutPointer_void, SignalType_MutPointer_SignalMutPointerPreKeyRecord, uint32_t); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPreKeyRecord_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPreKeyRecord_uint32_t) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t)(SignalType_MutPointer_void, uint32_t); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerPreKeyRecord)(SignalType_MutPointer_void, uint32_t, SignalMutPointerPreKeyRecord); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerPreKeyRecord) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPreKeyRecord_uint32_t load_pre_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerPreKeyRecord store_pre_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t remove_pre_key; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiPreKeyStoreStruct; -static_assert_64bit(offsetof(SignalFfiPreKeyStoreStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiPreKeyStoreStruct, load_pre_key) == 8); -static_assert_64bit(offsetof(SignalFfiPreKeyStoreStruct, store_pre_key) == 16); -static_assert_64bit(offsetof(SignalFfiPreKeyStoreStruct, remove_pre_key) == 24); -static_assert_64bit(offsetof(SignalFfiPreKeyStoreStruct, destroy) == 32); -static_assert_64bit(sizeof(SignalFfiPreKeyStoreStruct) == 40); -static_assert_64bit(alignof(SignalFfiPreKeyStoreStruct) == 8); -typedef const SignalFfiPreKeyStoreStruct* SignalType_ConstPointer_SignalFfiPreKeyStoreStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiPreKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiPreKeyStoreStruct) == 8); -typedef struct SignalSenderKeyRecord SignalSenderKeyRecord; -typedef SignalSenderKeyRecord* SignalType_MutPointer_SignalSenderKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSenderKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSenderKeyRecord) == 8); -typedef struct { - SignalSenderKeyRecord* raw; -} SignalMutPointerSenderKeyRecord; -static_assert_64bit(offsetof(SignalMutPointerSenderKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSenderKeyRecord) == 8); -static_assert_64bit(alignof(SignalMutPointerSenderKeyRecord) == 8); -typedef SignalMutPointerSenderKeyRecord* SignalType_MutPointer_SignalMutPointerSenderKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSenderKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSenderKeyRecord) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSenderKeyRecord_SignalMutPointerProtocolAddress_SignalUuid)(SignalType_MutPointer_void, SignalType_MutPointer_SignalMutPointerSenderKeyRecord, SignalMutPointerProtocolAddress, SignalUuid); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSenderKeyRecord_SignalMutPointerProtocolAddress_SignalUuid) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSenderKeyRecord_SignalMutPointerProtocolAddress_SignalUuid) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalUuid_SignalMutPointerSenderKeyRecord)(SignalType_MutPointer_void, SignalMutPointerProtocolAddress, SignalUuid, SignalMutPointerSenderKeyRecord); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalUuid_SignalMutPointerSenderKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalUuid_SignalMutPointerSenderKeyRecord) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSenderKeyRecord_SignalMutPointerProtocolAddress_SignalUuid load_sender_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalUuid_SignalMutPointerSenderKeyRecord store_sender_key; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiSenderKeyStoreStruct; -static_assert_64bit(offsetof(SignalFfiSenderKeyStoreStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiSenderKeyStoreStruct, load_sender_key) == 8); -static_assert_64bit(offsetof(SignalFfiSenderKeyStoreStruct, store_sender_key) == 16); -static_assert_64bit(offsetof(SignalFfiSenderKeyStoreStruct, destroy) == 24); -static_assert_64bit(sizeof(SignalFfiSenderKeyStoreStruct) == 32); -static_assert_64bit(alignof(SignalFfiSenderKeyStoreStruct) == 8); -typedef const SignalFfiSenderKeyStoreStruct* SignalType_ConstPointer_SignalFfiSenderKeyStoreStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiSenderKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiSenderKeyStoreStruct) == 8); -typedef SignalSessionRecord* SignalType_MutPointer_SignalSessionRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSessionRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSessionRecord) == 8); -typedef struct { - SignalSessionRecord* raw; -} SignalMutPointerSessionRecord; -static_assert_64bit(offsetof(SignalMutPointerSessionRecord, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSessionRecord) == 8); -static_assert_64bit(alignof(SignalMutPointerSessionRecord) == 8); -typedef SignalMutPointerSessionRecord* SignalType_MutPointer_SignalMutPointerSessionRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSessionRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSessionRecord) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSessionRecord_SignalMutPointerProtocolAddress)(SignalType_MutPointer_void, SignalType_MutPointer_SignalMutPointerSessionRecord, SignalMutPointerProtocolAddress); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSessionRecord_SignalMutPointerProtocolAddress) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSessionRecord_SignalMutPointerProtocolAddress) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalMutPointerSessionRecord)(SignalType_MutPointer_void, SignalMutPointerProtocolAddress, SignalMutPointerSessionRecord); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalMutPointerSessionRecord) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalMutPointerSessionRecord) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSessionRecord_SignalMutPointerProtocolAddress load_session; - SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalMutPointerSessionRecord store_session; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiSessionStoreStruct; -static_assert_64bit(offsetof(SignalFfiSessionStoreStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiSessionStoreStruct, load_session) == 8); -static_assert_64bit(offsetof(SignalFfiSessionStoreStruct, store_session) == 16); -static_assert_64bit(offsetof(SignalFfiSessionStoreStruct, destroy) == 24); -static_assert_64bit(sizeof(SignalFfiSessionStoreStruct) == 32); -static_assert_64bit(alignof(SignalFfiSessionStoreStruct) == 8); -typedef const SignalFfiSessionStoreStruct* SignalType_ConstPointer_SignalFfiSessionStoreStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiSessionStoreStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiSessionStoreStruct) == 8); -typedef struct SignalSignedPreKeyRecord SignalSignedPreKeyRecord; -typedef SignalSignedPreKeyRecord* SignalType_MutPointer_SignalSignedPreKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSignedPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSignedPreKeyRecord) == 8); -typedef struct { - SignalSignedPreKeyRecord* raw; -} SignalMutPointerSignedPreKeyRecord; -static_assert_64bit(offsetof(SignalMutPointerSignedPreKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSignedPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalMutPointerSignedPreKeyRecord) == 8); -typedef SignalMutPointerSignedPreKeyRecord* SignalType_MutPointer_SignalMutPointerSignedPreKeyRecord; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSignedPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSignedPreKeyRecord) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSignedPreKeyRecord_uint32_t)(SignalType_MutPointer_void, SignalType_MutPointer_SignalMutPointerSignedPreKeyRecord, uint32_t); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSignedPreKeyRecord_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSignedPreKeyRecord_uint32_t) == 8); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerSignedPreKeyRecord)(SignalType_MutPointer_void, uint32_t, SignalMutPointerSignedPreKeyRecord); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerSignedPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerSignedPreKeyRecord) == 8); -typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSignedPreKeyRecord_uint32_t load_signed_pre_key; - SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerSignedPreKeyRecord store_signed_pre_key; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiSignedPreKeyStoreStruct; -static_assert_64bit(offsetof(SignalFfiSignedPreKeyStoreStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiSignedPreKeyStoreStruct, load_signed_pre_key) == 8); -static_assert_64bit(offsetof(SignalFfiSignedPreKeyStoreStruct, store_signed_pre_key) == 16); -static_assert_64bit(offsetof(SignalFfiSignedPreKeyStoreStruct, destroy) == 24); -static_assert_64bit(sizeof(SignalFfiSignedPreKeyStoreStruct) == 32); -static_assert_64bit(alignof(SignalFfiSignedPreKeyStoreStruct) == 8); -typedef const SignalFfiSignedPreKeyStoreStruct* SignalType_ConstPointer_SignalFfiSignedPreKeyStoreStruct; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFfiSignedPreKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFfiSignedPreKeyStoreStruct) == 8); -typedef struct SignalSgxClientState SignalSgxClientState; -typedef const SignalSgxClientState* SignalType_ConstPointer_SignalSgxClientState; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSgxClientState) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSgxClientState) == 8); -typedef struct SignalBridgedStringMap SignalBridgedStringMap; -typedef const SignalBridgedStringMap* SignalType_ConstPointer_SignalBridgedStringMap; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBridgedStringMap) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBridgedStringMap) == 8); -typedef const SignalPrivateKey* SignalType_ConstPointer_SignalPrivateKey; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPrivateKey) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPrivateKey) == 8); -typedef struct SignalChatConnectionInfo SignalChatConnectionInfo; -typedef const SignalChatConnectionInfo* SignalType_ConstPointer_SignalChatConnectionInfo; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalChatConnectionInfo) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalChatConnectionInfo) == 8); -typedef const SignalBackupRestoreResponse* SignalType_ConstPointer_SignalBackupRestoreResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBackupRestoreResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBackupRestoreResponse) == 8); -typedef const SignalBackupStoreResponse* SignalType_ConstPointer_SignalBackupStoreResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalBackupStoreResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalBackupStoreResponse) == 8); -typedef const SignalRegisterAccountResponse* SignalType_ConstPointer_SignalRegisterAccountResponse; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalRegisterAccountResponse) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalRegisterAccountResponse) == 8); -typedef struct SignalRegistrationSession SignalRegistrationSession; -typedef const SignalRegistrationSession* SignalType_ConstPointer_SignalRegistrationSession; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalRegistrationSession) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalRegistrationSession) == 8); -typedef struct SignalConnectionProxyConfig SignalConnectionProxyConfig; -typedef const SignalConnectionProxyConfig* SignalType_ConstPointer_SignalConnectionProxyConfig; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalConnectionProxyConfig) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalConnectionProxyConfig) == 8); -typedef struct SignalFingerprint SignalFingerprint; -typedef const SignalFingerprint* SignalType_ConstPointer_SignalFingerprint; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalFingerprint) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalFingerprint) == 8); -typedef struct SignalKyberPublicKey SignalKyberPublicKey; -typedef const SignalKyberPublicKey* SignalType_ConstPointer_SignalKyberPublicKey; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalKyberPublicKey) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalKyberPublicKey) == 8); -typedef struct SignalKyberSecretKey SignalKyberSecretKey; -typedef const SignalKyberSecretKey* SignalType_ConstPointer_SignalKyberSecretKey; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalKyberSecretKey) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalKyberSecretKey) == 8); -typedef struct SignalKyberKeyPair SignalKyberKeyPair; -typedef const SignalKyberKeyPair* SignalType_ConstPointer_SignalKyberKeyPair; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalKyberKeyPair) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalKyberKeyPair) == 8); -typedef struct SignalDecryptionErrorMessage SignalDecryptionErrorMessage; -typedef const SignalDecryptionErrorMessage* SignalType_ConstPointer_SignalDecryptionErrorMessage; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalDecryptionErrorMessage) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalDecryptionErrorMessage) == 8); -typedef struct SignalPlaintextContent SignalPlaintextContent; -typedef const SignalPlaintextContent* SignalType_ConstPointer_SignalPlaintextContent; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPlaintextContent) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPlaintextContent) == 8); -typedef struct SignalPreKeySignalMessage SignalPreKeySignalMessage; -typedef const SignalPreKeySignalMessage* SignalType_ConstPointer_SignalPreKeySignalMessage; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPreKeySignalMessage) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPreKeySignalMessage) == 8); -typedef struct SignalSenderKeyDistributionMessage SignalSenderKeyDistributionMessage; -typedef const SignalSenderKeyDistributionMessage* SignalType_ConstPointer_SignalSenderKeyDistributionMessage; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSenderKeyDistributionMessage) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSenderKeyDistributionMessage) == 8); -typedef struct SignalSenderKeyMessage SignalSenderKeyMessage; -typedef const SignalSenderKeyMessage* SignalType_ConstPointer_SignalSenderKeyMessage; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSenderKeyMessage) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSenderKeyMessage) == 8); -typedef struct SignalSignalMessage SignalSignalMessage; -typedef const SignalSignalMessage* SignalType_ConstPointer_SignalSignalMessage; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSignalMessage) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSignalMessage) == 8); -typedef struct SignalSenderCertificate SignalSenderCertificate; -typedef const SignalSenderCertificate* SignalType_ConstPointer_SignalSenderCertificate; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSenderCertificate) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSenderCertificate) == 8); -typedef struct SignalServerCertificate SignalServerCertificate; -typedef const SignalServerCertificate* SignalType_ConstPointer_SignalServerCertificate; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalServerCertificate) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalServerCertificate) == 8); -typedef struct SignalUnidentifiedSenderMessageContent SignalUnidentifiedSenderMessageContent; -typedef const SignalUnidentifiedSenderMessageContent* SignalType_ConstPointer_SignalUnidentifiedSenderMessageContent; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalUnidentifiedSenderMessageContent) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalUnidentifiedSenderMessageContent) == 8); -typedef const SignalSenderKeyRecord* SignalType_ConstPointer_SignalSenderKeyRecord; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSenderKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSenderKeyRecord) == 8); -typedef const SignalPreKeyBundle* SignalType_ConstPointer_SignalPreKeyBundle; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPreKeyBundle) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPreKeyBundle) == 8); -typedef const SignalKyberPreKeyRecord* SignalType_ConstPointer_SignalKyberPreKeyRecord; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalKyberPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalKyberPreKeyRecord) == 8); -typedef const SignalPreKeyRecord* SignalType_ConstPointer_SignalPreKeyRecord; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalPreKeyRecord) == 8); -typedef const SignalSignedPreKeyRecord* SignalType_ConstPointer_SignalSignedPreKeyRecord; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalSignedPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalSignedPreKeyRecord) == 8); -typedef const uint32_t* SignalType_ConstPointer_uint32_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_uint32_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_uint32_t) == 8); -typedef const size_t* SignalType_ConstPointer_size_t; -static_assert_64bit(sizeof(SignalType_ConstPointer_size_t) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_size_t) == 8); -typedef struct SignalServerPublicParams SignalServerPublicParams; -typedef const SignalServerPublicParams* SignalType_ConstPointer_SignalServerPublicParams; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalServerPublicParams) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalServerPublicParams) == 8); -typedef struct SignalServerSecretParams SignalServerSecretParams; -typedef const SignalServerSecretParams* SignalType_ConstPointer_SignalServerSecretParams; -static_assert_64bit(sizeof(SignalType_ConstPointer_SignalServerSecretParams) == 8); -static_assert_64bit(alignof(SignalType_ConstPointer_SignalServerSecretParams) == 8); -typedef SignalType_FixedArray129_uint8_t* SignalType_MutPointer_FixedArray129_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray129_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray129_uint8_t) == 8); -typedef SignalType_FixedArray153_uint8_t* SignalType_MutPointer_FixedArray153_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray153_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray153_uint8_t) == 8); -typedef SignalType_FixedArray15_uint8_t* SignalType_MutPointer_FixedArray15_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray15_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray15_uint8_t) == 8); -typedef SignalType_FixedArray16_uint8_t* SignalType_MutPointer_FixedArray16_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray16_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray16_uint8_t) == 8); -typedef SignalType_FixedArray177_uint8_t* SignalType_MutPointer_FixedArray177_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray177_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray177_uint8_t) == 8); -typedef SignalType_FixedArray289_uint8_t* SignalType_MutPointer_FixedArray289_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray289_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray289_uint8_t) == 8); -typedef SignalType_FixedArray329_uint8_t* SignalType_MutPointer_FixedArray329_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray329_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray329_uint8_t) == 8); -typedef SignalType_FixedArray32_uint8_t* SignalType_MutPointer_FixedArray32_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray32_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray32_uint8_t) == 8); -typedef SignalType_FixedArray409_uint8_t* SignalType_MutPointer_FixedArray409_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray409_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray409_uint8_t) == 8); -typedef SignalType_FixedArray473_uint8_t* SignalType_MutPointer_FixedArray473_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray473_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray473_uint8_t) == 8); -typedef SignalType_FixedArray497_uint8_t* SignalType_MutPointer_FixedArray497_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray497_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray497_uint8_t) == 8); -typedef SignalType_FixedArray64_uint8_t* SignalType_MutPointer_FixedArray64_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray64_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray64_uint8_t) == 8); -typedef SignalType_FixedArray65_uint8_t* SignalType_MutPointer_FixedArray65_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray65_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray65_uint8_t) == 8); -typedef SignalType_FixedArray97_uint8_t* SignalType_MutPointer_FixedArray97_uint8_t; -static_assert_64bit(sizeof(SignalType_MutPointer_FixedArray97_uint8_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_FixedArray97_uint8_t) == 8); -typedef SignalAes256GcmSiv* SignalType_MutPointer_SignalAes256GcmSiv; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalAes256GcmSiv) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalAes256GcmSiv) == 8); -typedef int32_t* SignalType_MutPointer_int32_t; -static_assert_64bit(sizeof(SignalType_MutPointer_int32_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_int32_t) == 8); -typedef SignalPinHash* SignalType_MutPointer_SignalPinHash; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPinHash) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPinHash) == 8); -typedef struct SignalAes256GcmDecryption SignalAes256GcmDecryption; -typedef SignalAes256GcmDecryption* SignalType_MutPointer_SignalAes256GcmDecryption; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalAes256GcmDecryption) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalAes256GcmDecryption) == 8); -typedef struct SignalAes256GcmEncryption SignalAes256GcmEncryption; -typedef SignalAes256GcmEncryption* SignalType_MutPointer_SignalAes256GcmEncryption; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalAes256GcmEncryption) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalAes256GcmEncryption) == 8); -typedef SignalBytestringArray* SignalType_MutPointer_SignalBytestringArray; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalBytestringArray) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalBytestringArray) == 8); -typedef struct { - uint32_t* base; - size_t length; -} SignalOwnedBufferOfu32; -static_assert_64bit(offsetof(SignalOwnedBufferOfu32, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfu32, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBufferOfu32) == 16); -static_assert_64bit(alignof(SignalOwnedBufferOfu32) == 8); -typedef struct { - SignalType_FixedArray17_uint8_t account; - SignalOwnedBufferOfu32 missing_devices; - SignalOwnedBufferOfu32 extra_devices; - SignalOwnedBufferOfu32 stale_devices; -} SignalFfiMismatchedDevicesError; -static_assert_64bit(offsetof(SignalFfiMismatchedDevicesError, account) == 0); -static_assert_64bit(offsetof(SignalFfiMismatchedDevicesError, missing_devices) == 24); -static_assert_64bit(offsetof(SignalFfiMismatchedDevicesError, extra_devices) == 40); -static_assert_64bit(offsetof(SignalFfiMismatchedDevicesError, stale_devices) == 56); -static_assert_64bit(sizeof(SignalFfiMismatchedDevicesError) == 72); -static_assert_64bit(alignof(SignalFfiMismatchedDevicesError) == 8); -typedef SignalFfiMismatchedDevicesError* SignalType_MutPointer_SignalFfiMismatchedDevicesError; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalFfiMismatchedDevicesError) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalFfiMismatchedDevicesError) == 8); -static_assert_64bit(sizeof(double) == 8); -static_assert_64bit(alignof(double) == 8); -typedef struct { - const int8_t* id; - bool visible; - double expiration_secs; -} SignalFfiRegisterResponseBadge; -static_assert_64bit(offsetof(SignalFfiRegisterResponseBadge, id) == 0); -static_assert_64bit(offsetof(SignalFfiRegisterResponseBadge, visible) == 8); -static_assert_64bit(offsetof(SignalFfiRegisterResponseBadge, expiration_secs) == 16); -static_assert_64bit(sizeof(SignalFfiRegisterResponseBadge) == 24); -static_assert_64bit(alignof(SignalFfiRegisterResponseBadge) == 8); -typedef SignalFfiRegisterResponseBadge* SignalType_MutPointer_SignalFfiRegisterResponseBadge; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalFfiRegisterResponseBadge) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalFfiRegisterResponseBadge) == 8); -typedef struct { - SignalAes256GcmSiv* raw; -} SignalMutPointerAes256GcmSiv; -static_assert_64bit(offsetof(SignalMutPointerAes256GcmSiv, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerAes256GcmSiv) == 8); -static_assert_64bit(alignof(SignalMutPointerAes256GcmSiv) == 8); -typedef SignalMutPointerAes256GcmSiv* SignalType_MutPointer_SignalMutPointerAes256GcmSiv; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerAes256GcmSiv) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerAes256GcmSiv) == 8); -typedef struct { - SignalPinHash* raw; -} SignalMutPointerPinHash; -static_assert_64bit(offsetof(SignalMutPointerPinHash, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerPinHash) == 8); -static_assert_64bit(alignof(SignalMutPointerPinHash) == 8); -typedef SignalMutPointerPinHash* SignalType_MutPointer_SignalMutPointerPinHash; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerPinHash) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerPinHash) == 8); -typedef struct { - SignalAes256GcmDecryption* raw; -} SignalMutPointerAes256GcmDecryption; -static_assert_64bit(offsetof(SignalMutPointerAes256GcmDecryption, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerAes256GcmDecryption) == 8); -static_assert_64bit(alignof(SignalMutPointerAes256GcmDecryption) == 8); -typedef SignalMutPointerAes256GcmDecryption* SignalType_MutPointer_SignalMutPointerAes256GcmDecryption; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerAes256GcmDecryption) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerAes256GcmDecryption) == 8); -typedef struct { - SignalAes256GcmEncryption* raw; -} SignalMutPointerAes256GcmEncryption; -static_assert_64bit(offsetof(SignalMutPointerAes256GcmEncryption, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerAes256GcmEncryption) == 8); -static_assert_64bit(alignof(SignalMutPointerAes256GcmEncryption) == 8); -typedef SignalMutPointerAes256GcmEncryption* SignalType_MutPointer_SignalMutPointerAes256GcmEncryption; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerAes256GcmEncryption) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerAes256GcmEncryption) == 8); -typedef SignalHsmEnclaveClient* SignalType_MutPointer_SignalHsmEnclaveClient; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalHsmEnclaveClient) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalHsmEnclaveClient) == 8); -typedef struct { - SignalHsmEnclaveClient* raw; -} SignalMutPointerHsmEnclaveClient; -static_assert_64bit(offsetof(SignalMutPointerHsmEnclaveClient, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerHsmEnclaveClient) == 8); -static_assert_64bit(alignof(SignalMutPointerHsmEnclaveClient) == 8); -typedef SignalMutPointerHsmEnclaveClient* SignalType_MutPointer_SignalMutPointerHsmEnclaveClient; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerHsmEnclaveClient) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerHsmEnclaveClient) == 8); -typedef struct SignalIncrementalMac SignalIncrementalMac; -typedef SignalIncrementalMac* SignalType_MutPointer_SignalIncrementalMac; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalIncrementalMac) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalIncrementalMac) == 8); -typedef struct { - SignalIncrementalMac* raw; -} SignalMutPointerIncrementalMac; -static_assert_64bit(offsetof(SignalMutPointerIncrementalMac, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerIncrementalMac) == 8); -static_assert_64bit(alignof(SignalMutPointerIncrementalMac) == 8); -typedef SignalMutPointerIncrementalMac* SignalType_MutPointer_SignalMutPointerIncrementalMac; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerIncrementalMac) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerIncrementalMac) == 8); -typedef struct SignalValidatingMac SignalValidatingMac; -typedef SignalValidatingMac* SignalType_MutPointer_SignalValidatingMac; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalValidatingMac) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalValidatingMac) == 8); -typedef struct { - SignalValidatingMac* raw; -} SignalMutPointerValidatingMac; -static_assert_64bit(offsetof(SignalMutPointerValidatingMac, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerValidatingMac) == 8); -static_assert_64bit(alignof(SignalMutPointerValidatingMac) == 8); -typedef SignalMutPointerValidatingMac* SignalType_MutPointer_SignalMutPointerValidatingMac; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerValidatingMac) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerValidatingMac) == 8); -typedef SignalMessageBackupKey* SignalType_MutPointer_SignalMessageBackupKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMessageBackupKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMessageBackupKey) == 8); -typedef struct { - SignalMessageBackupKey* raw; -} SignalMutPointerMessageBackupKey; -static_assert_64bit(offsetof(SignalMutPointerMessageBackupKey, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerMessageBackupKey) == 8); -static_assert_64bit(alignof(SignalMutPointerMessageBackupKey) == 8); -typedef SignalMutPointerMessageBackupKey* SignalType_MutPointer_SignalMutPointerMessageBackupKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerMessageBackupKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerMessageBackupKey) == 8); -typedef SignalMessageBackupValidationOutcome* SignalType_MutPointer_SignalMessageBackupValidationOutcome; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMessageBackupValidationOutcome) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMessageBackupValidationOutcome) == 8); -typedef struct { - SignalMessageBackupValidationOutcome* raw; -} SignalMutPointerMessageBackupValidationOutcome; -static_assert_64bit(offsetof(SignalMutPointerMessageBackupValidationOutcome, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerMessageBackupValidationOutcome) == 8); -static_assert_64bit(alignof(SignalMutPointerMessageBackupValidationOutcome) == 8); -typedef SignalMutPointerMessageBackupValidationOutcome* SignalType_MutPointer_SignalMutPointerMessageBackupValidationOutcome; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerMessageBackupValidationOutcome) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerMessageBackupValidationOutcome) == 8); -typedef struct SignalOnlineBackupValidator SignalOnlineBackupValidator; -typedef SignalOnlineBackupValidator* SignalType_MutPointer_SignalOnlineBackupValidator; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalOnlineBackupValidator) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalOnlineBackupValidator) == 8); -typedef struct { - SignalOnlineBackupValidator* raw; -} SignalMutPointerOnlineBackupValidator; -static_assert_64bit(offsetof(SignalMutPointerOnlineBackupValidator, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerOnlineBackupValidator) == 8); -static_assert_64bit(alignof(SignalMutPointerOnlineBackupValidator) == 8); -typedef SignalMutPointerOnlineBackupValidator* SignalType_MutPointer_SignalMutPointerOnlineBackupValidator; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerOnlineBackupValidator) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerOnlineBackupValidator) == 8); -typedef SignalConnectionManager* SignalType_MutPointer_SignalConnectionManager; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalConnectionManager) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalConnectionManager) == 8); -typedef struct { - SignalConnectionManager* raw; -} SignalMutPointerConnectionManager; -static_assert_64bit(offsetof(SignalMutPointerConnectionManager, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerConnectionManager) == 8); -static_assert_64bit(alignof(SignalMutPointerConnectionManager) == 8); -typedef SignalMutPointerConnectionManager* SignalType_MutPointer_SignalMutPointerConnectionManager; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerConnectionManager) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerConnectionManager) == 8); -typedef SignalLookupRequest* SignalType_MutPointer_SignalLookupRequest; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalLookupRequest) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalLookupRequest) == 8); -typedef struct { - SignalLookupRequest* raw; -} SignalMutPointerLookupRequest; -static_assert_64bit(offsetof(SignalMutPointerLookupRequest, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerLookupRequest) == 8); -static_assert_64bit(alignof(SignalMutPointerLookupRequest) == 8); -typedef SignalMutPointerLookupRequest* SignalType_MutPointer_SignalMutPointerLookupRequest; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerLookupRequest) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerLookupRequest) == 8); -typedef SignalCopyBackupMediaStream* SignalType_MutPointer_SignalCopyBackupMediaStream; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCopyBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCopyBackupMediaStream) == 8); -typedef struct { - SignalCopyBackupMediaStream* raw; -} SignalMutPointerCopyBackupMediaStream; -static_assert_64bit(offsetof(SignalMutPointerCopyBackupMediaStream, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerCopyBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalMutPointerCopyBackupMediaStream) == 8); -typedef SignalMutPointerCopyBackupMediaStream* SignalType_MutPointer_SignalMutPointerCopyBackupMediaStream; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerCopyBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerCopyBackupMediaStream) == 8); -typedef SignalDeleteBackupMediaStream* SignalType_MutPointer_SignalDeleteBackupMediaStream; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalDeleteBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalDeleteBackupMediaStream) == 8); -typedef struct { - SignalDeleteBackupMediaStream* raw; -} SignalMutPointerDeleteBackupMediaStream; -static_assert_64bit(offsetof(SignalMutPointerDeleteBackupMediaStream, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerDeleteBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalMutPointerDeleteBackupMediaStream) == 8); -typedef SignalMutPointerDeleteBackupMediaStream* SignalType_MutPointer_SignalMutPointerDeleteBackupMediaStream; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerDeleteBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerDeleteBackupMediaStream) == 8); -typedef SignalHttpRequest* SignalType_MutPointer_SignalHttpRequest; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalHttpRequest) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalHttpRequest) == 8); -typedef struct { - SignalHttpRequest* raw; -} SignalMutPointerHttpRequest; -static_assert_64bit(offsetof(SignalMutPointerHttpRequest, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerHttpRequest) == 8); -static_assert_64bit(alignof(SignalMutPointerHttpRequest) == 8); -typedef SignalMutPointerHttpRequest* SignalType_MutPointer_SignalMutPointerHttpRequest; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerHttpRequest) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerHttpRequest) == 8); -typedef SignalRegistrationAccountAttributes* SignalType_MutPointer_SignalRegistrationAccountAttributes; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalRegistrationAccountAttributes) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalRegistrationAccountAttributes) == 8); -typedef struct { - SignalRegistrationAccountAttributes* raw; -} SignalMutPointerRegistrationAccountAttributes; -static_assert_64bit(offsetof(SignalMutPointerRegistrationAccountAttributes, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerRegistrationAccountAttributes) == 8); -static_assert_64bit(alignof(SignalMutPointerRegistrationAccountAttributes) == 8); -typedef SignalMutPointerRegistrationAccountAttributes* SignalType_MutPointer_SignalMutPointerRegistrationAccountAttributes; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerRegistrationAccountAttributes) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerRegistrationAccountAttributes) == 8); -typedef SignalRegisterAccountRequest* SignalType_MutPointer_SignalRegisterAccountRequest; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalRegisterAccountRequest) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalRegisterAccountRequest) == 8); -typedef struct { - SignalRegisterAccountRequest* raw; -} SignalMutPointerRegisterAccountRequest; -static_assert_64bit(offsetof(SignalMutPointerRegisterAccountRequest, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerRegisterAccountRequest) == 8); -static_assert_64bit(alignof(SignalMutPointerRegisterAccountRequest) == 8); -typedef SignalMutPointerRegisterAccountRequest* SignalType_MutPointer_SignalMutPointerRegisterAccountRequest; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerRegisterAccountRequest) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerRegisterAccountRequest) == 8); -typedef SignalTokioAsyncContext* SignalType_MutPointer_SignalTokioAsyncContext; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalTokioAsyncContext) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalTokioAsyncContext) == 8); -typedef struct { - SignalTokioAsyncContext* raw; -} SignalMutPointerTokioAsyncContext; -static_assert_64bit(offsetof(SignalMutPointerTokioAsyncContext, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerTokioAsyncContext) == 8); -static_assert_64bit(alignof(SignalMutPointerTokioAsyncContext) == 8); -typedef SignalMutPointerTokioAsyncContext* SignalType_MutPointer_SignalMutPointerTokioAsyncContext; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerTokioAsyncContext) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerTokioAsyncContext) == 8); -typedef SignalSgxClientState* SignalType_MutPointer_SignalSgxClientState; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSgxClientState) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSgxClientState) == 8); -typedef struct { - SignalSgxClientState* raw; -} SignalMutPointerSgxClientState; -static_assert_64bit(offsetof(SignalMutPointerSgxClientState, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSgxClientState) == 8); -static_assert_64bit(alignof(SignalMutPointerSgxClientState) == 8); -typedef SignalMutPointerSgxClientState* SignalType_MutPointer_SignalMutPointerSgxClientState; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSgxClientState) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSgxClientState) == 8); -typedef SignalBridgedStringMap* SignalType_MutPointer_SignalBridgedStringMap; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalBridgedStringMap) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalBridgedStringMap) == 8); -typedef struct { - SignalBridgedStringMap* raw; -} SignalMutPointerBridgedStringMap; -static_assert_64bit(offsetof(SignalMutPointerBridgedStringMap, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerBridgedStringMap) == 8); -static_assert_64bit(alignof(SignalMutPointerBridgedStringMap) == 8); -typedef SignalMutPointerBridgedStringMap* SignalType_MutPointer_SignalMutPointerBridgedStringMap; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerBridgedStringMap) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerBridgedStringMap) == 8); -typedef SignalMutPointerProtocolAddress* SignalType_MutPointer_SignalMutPointerProtocolAddress; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerProtocolAddress) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerProtocolAddress) == 8); -typedef SignalMutPointerPrivateKey* SignalType_MutPointer_SignalMutPointerPrivateKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerPrivateKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerPrivateKey) == 8); -typedef SignalChatConnectionInfo* SignalType_MutPointer_SignalChatConnectionInfo; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalChatConnectionInfo) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalChatConnectionInfo) == 8); -typedef struct { - SignalChatConnectionInfo* raw; -} SignalMutPointerChatConnectionInfo; -static_assert_64bit(offsetof(SignalMutPointerChatConnectionInfo, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerChatConnectionInfo) == 8); -static_assert_64bit(alignof(SignalMutPointerChatConnectionInfo) == 8); -typedef SignalMutPointerChatConnectionInfo* SignalType_MutPointer_SignalMutPointerChatConnectionInfo; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerChatConnectionInfo) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerChatConnectionInfo) == 8); -typedef SignalRegistrationSession* SignalType_MutPointer_SignalRegistrationSession; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalRegistrationSession) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalRegistrationSession) == 8); -typedef struct { - SignalRegistrationSession* raw; -} SignalMutPointerRegistrationSession; -static_assert_64bit(offsetof(SignalMutPointerRegistrationSession, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerRegistrationSession) == 8); -static_assert_64bit(alignof(SignalMutPointerRegistrationSession) == 8); -typedef SignalMutPointerRegistrationSession* SignalType_MutPointer_SignalMutPointerRegistrationSession; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerRegistrationSession) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerRegistrationSession) == 8); -typedef SignalConnectionProxyConfig* SignalType_MutPointer_SignalConnectionProxyConfig; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalConnectionProxyConfig) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalConnectionProxyConfig) == 8); -typedef struct { - SignalConnectionProxyConfig* raw; -} SignalMutPointerConnectionProxyConfig; -static_assert_64bit(offsetof(SignalMutPointerConnectionProxyConfig, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerConnectionProxyConfig) == 8); -static_assert_64bit(alignof(SignalMutPointerConnectionProxyConfig) == 8); -typedef SignalMutPointerConnectionProxyConfig* SignalType_MutPointer_SignalMutPointerConnectionProxyConfig; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerConnectionProxyConfig) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerConnectionProxyConfig) == 8); -typedef SignalFingerprint* SignalType_MutPointer_SignalFingerprint; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalFingerprint) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalFingerprint) == 8); -typedef struct { - SignalFingerprint* raw; -} SignalMutPointerFingerprint; -static_assert_64bit(offsetof(SignalMutPointerFingerprint, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerFingerprint) == 8); -static_assert_64bit(alignof(SignalMutPointerFingerprint) == 8); -typedef SignalMutPointerFingerprint* SignalType_MutPointer_SignalMutPointerFingerprint; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerFingerprint) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerFingerprint) == 8); -typedef SignalKyberPublicKey* SignalType_MutPointer_SignalKyberPublicKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalKyberPublicKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalKyberPublicKey) == 8); -typedef struct { - SignalKyberPublicKey* raw; -} SignalMutPointerKyberPublicKey; -static_assert_64bit(offsetof(SignalMutPointerKyberPublicKey, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerKyberPublicKey) == 8); -static_assert_64bit(alignof(SignalMutPointerKyberPublicKey) == 8); -typedef SignalMutPointerKyberPublicKey* SignalType_MutPointer_SignalMutPointerKyberPublicKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerKyberPublicKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerKyberPublicKey) == 8); -typedef SignalKyberSecretKey* SignalType_MutPointer_SignalKyberSecretKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalKyberSecretKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalKyberSecretKey) == 8); -typedef struct { - SignalKyberSecretKey* raw; -} SignalMutPointerKyberSecretKey; -static_assert_64bit(offsetof(SignalMutPointerKyberSecretKey, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerKyberSecretKey) == 8); -static_assert_64bit(alignof(SignalMutPointerKyberSecretKey) == 8); -typedef SignalMutPointerKyberSecretKey* SignalType_MutPointer_SignalMutPointerKyberSecretKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerKyberSecretKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerKyberSecretKey) == 8); -typedef SignalKyberKeyPair* SignalType_MutPointer_SignalKyberKeyPair; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalKyberKeyPair) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalKyberKeyPair) == 8); -typedef struct { - SignalKyberKeyPair* raw; -} SignalMutPointerKyberKeyPair; -static_assert_64bit(offsetof(SignalMutPointerKyberKeyPair, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerKyberKeyPair) == 8); -static_assert_64bit(alignof(SignalMutPointerKyberKeyPair) == 8); -typedef SignalMutPointerKyberKeyPair* SignalType_MutPointer_SignalMutPointerKyberKeyPair; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerKyberKeyPair) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerKyberKeyPair) == 8); -typedef SignalCiphertextMessage* SignalType_MutPointer_SignalCiphertextMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCiphertextMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCiphertextMessage) == 8); -typedef struct { - SignalCiphertextMessage* raw; -} SignalMutPointerCiphertextMessage; -static_assert_64bit(offsetof(SignalMutPointerCiphertextMessage, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerCiphertextMessage) == 8); -static_assert_64bit(alignof(SignalMutPointerCiphertextMessage) == 8); -typedef SignalMutPointerCiphertextMessage* SignalType_MutPointer_SignalMutPointerCiphertextMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerCiphertextMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerCiphertextMessage) == 8); -typedef SignalDecryptionErrorMessage* SignalType_MutPointer_SignalDecryptionErrorMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalDecryptionErrorMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalDecryptionErrorMessage) == 8); -typedef struct { - SignalDecryptionErrorMessage* raw; -} SignalMutPointerDecryptionErrorMessage; -static_assert_64bit(offsetof(SignalMutPointerDecryptionErrorMessage, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerDecryptionErrorMessage) == 8); -static_assert_64bit(alignof(SignalMutPointerDecryptionErrorMessage) == 8); -typedef SignalMutPointerDecryptionErrorMessage* SignalType_MutPointer_SignalMutPointerDecryptionErrorMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerDecryptionErrorMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerDecryptionErrorMessage) == 8); -typedef SignalPlaintextContent* SignalType_MutPointer_SignalPlaintextContent; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPlaintextContent) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPlaintextContent) == 8); -typedef struct { - SignalPlaintextContent* raw; -} SignalMutPointerPlaintextContent; -static_assert_64bit(offsetof(SignalMutPointerPlaintextContent, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerPlaintextContent) == 8); -static_assert_64bit(alignof(SignalMutPointerPlaintextContent) == 8); -typedef SignalMutPointerPlaintextContent* SignalType_MutPointer_SignalMutPointerPlaintextContent; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerPlaintextContent) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerPlaintextContent) == 8); -typedef SignalPreKeySignalMessage* SignalType_MutPointer_SignalPreKeySignalMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPreKeySignalMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPreKeySignalMessage) == 8); -typedef struct { - SignalPreKeySignalMessage* raw; -} SignalMutPointerPreKeySignalMessage; -static_assert_64bit(offsetof(SignalMutPointerPreKeySignalMessage, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerPreKeySignalMessage) == 8); -static_assert_64bit(alignof(SignalMutPointerPreKeySignalMessage) == 8); -typedef SignalMutPointerPreKeySignalMessage* SignalType_MutPointer_SignalMutPointerPreKeySignalMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerPreKeySignalMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerPreKeySignalMessage) == 8); -typedef SignalSenderKeyDistributionMessage* SignalType_MutPointer_SignalSenderKeyDistributionMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSenderKeyDistributionMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSenderKeyDistributionMessage) == 8); -typedef struct { - SignalSenderKeyDistributionMessage* raw; -} SignalMutPointerSenderKeyDistributionMessage; -static_assert_64bit(offsetof(SignalMutPointerSenderKeyDistributionMessage, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSenderKeyDistributionMessage) == 8); -static_assert_64bit(alignof(SignalMutPointerSenderKeyDistributionMessage) == 8); -typedef SignalMutPointerSenderKeyDistributionMessage* SignalType_MutPointer_SignalMutPointerSenderKeyDistributionMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSenderKeyDistributionMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSenderKeyDistributionMessage) == 8); -typedef SignalSenderKeyMessage* SignalType_MutPointer_SignalSenderKeyMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSenderKeyMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSenderKeyMessage) == 8); -typedef struct { - SignalSenderKeyMessage* raw; -} SignalMutPointerSenderKeyMessage; -static_assert_64bit(offsetof(SignalMutPointerSenderKeyMessage, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSenderKeyMessage) == 8); -static_assert_64bit(alignof(SignalMutPointerSenderKeyMessage) == 8); -typedef SignalMutPointerSenderKeyMessage* SignalType_MutPointer_SignalMutPointerSenderKeyMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSenderKeyMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSenderKeyMessage) == 8); -typedef SignalSignalMessage* SignalType_MutPointer_SignalSignalMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSignalMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSignalMessage) == 8); -typedef struct { - SignalSignalMessage* raw; -} SignalMutPointerSignalMessage; -static_assert_64bit(offsetof(SignalMutPointerSignalMessage, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSignalMessage) == 8); -static_assert_64bit(alignof(SignalMutPointerSignalMessage) == 8); -typedef SignalMutPointerSignalMessage* SignalType_MutPointer_SignalMutPointerSignalMessage; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSignalMessage) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSignalMessage) == 8); -typedef SignalSenderCertificate* SignalType_MutPointer_SignalSenderCertificate; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalSenderCertificate) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalSenderCertificate) == 8); -typedef struct { - SignalSenderCertificate* raw; -} SignalMutPointerSenderCertificate; -static_assert_64bit(offsetof(SignalMutPointerSenderCertificate, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerSenderCertificate) == 8); -static_assert_64bit(alignof(SignalMutPointerSenderCertificate) == 8); -typedef SignalMutPointerSenderCertificate* SignalType_MutPointer_SignalMutPointerSenderCertificate; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerSenderCertificate) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerSenderCertificate) == 8); -typedef SignalServerCertificate* SignalType_MutPointer_SignalServerCertificate; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalServerCertificate) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalServerCertificate) == 8); -typedef struct { - SignalServerCertificate* raw; -} SignalMutPointerServerCertificate; -static_assert_64bit(offsetof(SignalMutPointerServerCertificate, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerServerCertificate) == 8); -static_assert_64bit(alignof(SignalMutPointerServerCertificate) == 8); -typedef SignalMutPointerServerCertificate* SignalType_MutPointer_SignalMutPointerServerCertificate; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerServerCertificate) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerServerCertificate) == 8); -typedef SignalUnidentifiedSenderMessageContent* SignalType_MutPointer_SignalUnidentifiedSenderMessageContent; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalUnidentifiedSenderMessageContent) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalUnidentifiedSenderMessageContent) == 8); -typedef struct { - SignalUnidentifiedSenderMessageContent* raw; -} SignalMutPointerUnidentifiedSenderMessageContent; -static_assert_64bit(offsetof(SignalMutPointerUnidentifiedSenderMessageContent, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerUnidentifiedSenderMessageContent) == 8); -static_assert_64bit(alignof(SignalMutPointerUnidentifiedSenderMessageContent) == 8); -typedef SignalMutPointerUnidentifiedSenderMessageContent* SignalType_MutPointer_SignalMutPointerUnidentifiedSenderMessageContent; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerUnidentifiedSenderMessageContent) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerUnidentifiedSenderMessageContent) == 8); -typedef struct SignalAes256Ctr32 SignalAes256Ctr32; -typedef SignalAes256Ctr32* SignalType_MutPointer_SignalAes256Ctr32; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalAes256Ctr32) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalAes256Ctr32) == 8); -typedef struct { - SignalAes256Ctr32* raw; -} SignalMutPointerAes256Ctr32; -static_assert_64bit(offsetof(SignalMutPointerAes256Ctr32, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerAes256Ctr32) == 8); -static_assert_64bit(alignof(SignalMutPointerAes256Ctr32) == 8); -typedef SignalMutPointerAes256Ctr32* SignalType_MutPointer_SignalMutPointerAes256Ctr32; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerAes256Ctr32) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerAes256Ctr32) == 8); -typedef SignalServerPublicParams* SignalType_MutPointer_SignalServerPublicParams; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalServerPublicParams) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalServerPublicParams) == 8); -typedef struct { - SignalServerPublicParams* raw; -} SignalMutPointerServerPublicParams; -static_assert_64bit(offsetof(SignalMutPointerServerPublicParams, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerServerPublicParams) == 8); -static_assert_64bit(alignof(SignalMutPointerServerPublicParams) == 8); -typedef SignalMutPointerServerPublicParams* SignalType_MutPointer_SignalMutPointerServerPublicParams; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerServerPublicParams) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerServerPublicParams) == 8); -typedef SignalServerSecretParams* SignalType_MutPointer_SignalServerSecretParams; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalServerSecretParams) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalServerSecretParams) == 8); -typedef struct { - SignalServerSecretParams* raw; -} SignalMutPointerServerSecretParams; -static_assert_64bit(offsetof(SignalMutPointerServerSecretParams, raw) == 0); -static_assert_64bit(sizeof(SignalMutPointerServerSecretParams) == 8); -static_assert_64bit(alignof(SignalMutPointerServerSecretParams) == 8); -typedef SignalMutPointerServerSecretParams* SignalType_MutPointer_SignalMutPointerServerSecretParams; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalMutPointerServerSecretParams) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalMutPointerServerSecretParams) == 8); -typedef enum { - SignalPaymentProviderFfiResultGooglePlayBilling, - SignalPaymentProviderFfiResultAppleAppStore, - SignalPaymentProviderFfiResultStripe, - SignalPaymentProviderFfiResultBraintree, -} SignalPaymentProviderFfiResult; -static_assert_64bit(sizeof(SignalPaymentProviderFfiResult) == 4); -static_assert_64bit(alignof(SignalPaymentProviderFfiResult) == 4); -typedef struct { - SignalPaymentProviderFfiResult processor; - const int8_t* code; - const int8_t* message; - const int8_t* outcome_network_status; - const int8_t* outcome_reason; - const int8_t* outcome_type; -} SignalChargeFailureFfiResult; -static_assert_64bit(offsetof(SignalChargeFailureFfiResult, processor) == 0); -static_assert_64bit(offsetof(SignalChargeFailureFfiResult, code) == 8); -static_assert_64bit(offsetof(SignalChargeFailureFfiResult, message) == 16); -static_assert_64bit(offsetof(SignalChargeFailureFfiResult, outcome_network_status) == 24); -static_assert_64bit(offsetof(SignalChargeFailureFfiResult, outcome_reason) == 32); -static_assert_64bit(offsetof(SignalChargeFailureFfiResult, outcome_type) == 40); -static_assert_64bit(sizeof(SignalChargeFailureFfiResult) == 48); -static_assert_64bit(alignof(SignalChargeFailureFfiResult) == 8); -typedef SignalChargeFailureFfiResult MaybeUninitOfChargeFailureFfiResult; -static_assert_64bit(sizeof(MaybeUninitOfChargeFailureFfiResult) == 48); -static_assert_64bit(alignof(MaybeUninitOfChargeFailureFfiResult) == 8); -typedef struct { - bool present; - MaybeUninitOfChargeFailureFfiResult value; -} SignalOptionalOfChargeFailureFfiResult; -static_assert_64bit(offsetof(SignalOptionalOfChargeFailureFfiResult, present) == 0); -static_assert_64bit(offsetof(SignalOptionalOfChargeFailureFfiResult, value) == 8); -static_assert_64bit(sizeof(SignalOptionalOfChargeFailureFfiResult) == 56); -static_assert_64bit(alignof(SignalOptionalOfChargeFailureFfiResult) == 8); -typedef SignalOptionalOfChargeFailureFfiResult* SignalType_MutPointer_SignalOptionalOfChargeFailureFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalOptionalOfChargeFailureFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalOptionalOfChargeFailureFfiResult) == 8); -typedef SignalOptionalUuid* SignalType_MutPointer_SignalOptionalUuid; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalOptionalUuid) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalOptionalUuid) == 8); -typedef struct { - SignalFfiMismatchedDevicesError* base; - size_t length; -} SignalOwnedBufferOfFfiMismatchedDevicesError; -static_assert_64bit(offsetof(SignalOwnedBufferOfFfiMismatchedDevicesError, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfFfiMismatchedDevicesError, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBufferOfFfiMismatchedDevicesError) == 16); -static_assert_64bit(alignof(SignalOwnedBufferOfFfiMismatchedDevicesError) == 8); -typedef SignalOwnedBufferOfFfiMismatchedDevicesError* SignalType_MutPointer_SignalOwnedBufferOfFfiMismatchedDevicesError; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalOwnedBufferOfFfiMismatchedDevicesError) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalOwnedBufferOfFfiMismatchedDevicesError) == 8); -typedef struct { - SignalFfiRegisterResponseBadge* base; - size_t length; -} SignalOwnedBufferOfFfiRegisterResponseBadge; -static_assert_64bit(offsetof(SignalOwnedBufferOfFfiRegisterResponseBadge, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfFfiRegisterResponseBadge, length) == 8); -static_assert_64bit(sizeof(SignalOwnedBufferOfFfiRegisterResponseBadge) == 16); -static_assert_64bit(alignof(SignalOwnedBufferOfFfiRegisterResponseBadge) == 8); -typedef SignalOwnedBufferOfFfiRegisterResponseBadge* SignalType_MutPointer_SignalOwnedBufferOfFfiRegisterResponseBadge; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalOwnedBufferOfFfiRegisterResponseBadge) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalOwnedBufferOfFfiRegisterResponseBadge) == 8); -typedef SignalOwnedBuffer* SignalType_MutPointer_SignalOwnedBuffer; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalOwnedBuffer) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalOwnedBuffer) == 8); -typedef struct { - const int8_t* first; - bool second; -} SignalPairOfCStringPtrbool; -static_assert_64bit(offsetof(SignalPairOfCStringPtrbool, first) == 0); -static_assert_64bit(offsetof(SignalPairOfCStringPtrbool, second) == 8); -static_assert_64bit(sizeof(SignalPairOfCStringPtrbool) == 16); -static_assert_64bit(alignof(SignalPairOfCStringPtrbool) == 8); -typedef SignalPairOfCStringPtrbool* SignalType_MutPointer_SignalPairOfCStringPtrbool; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPairOfCStringPtrbool) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPairOfCStringPtrbool) == 8); -typedef struct { - const int8_t* first; - uint32_t second; -} SignalPairOfCStringPtru32; -static_assert_64bit(offsetof(SignalPairOfCStringPtru32, first) == 0); -static_assert_64bit(offsetof(SignalPairOfCStringPtru32, second) == 8); -static_assert_64bit(sizeof(SignalPairOfCStringPtru32) == 16); -static_assert_64bit(alignof(SignalPairOfCStringPtru32) == 8); -typedef SignalPairOfCStringPtru32* SignalType_MutPointer_SignalPairOfCStringPtru32; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPairOfCStringPtru32) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPairOfCStringPtru32) == 8); -typedef struct { - SignalMutPointerPublicKey first; - SignalMutPointerPrivateKey second; -} SignalPairOfMutPointerPublicKeyMutPointerPrivateKey; -static_assert_64bit(offsetof(SignalPairOfMutPointerPublicKeyMutPointerPrivateKey, first) == 0); -static_assert_64bit(offsetof(SignalPairOfMutPointerPublicKeyMutPointerPrivateKey, second) == 8); -static_assert_64bit(sizeof(SignalPairOfMutPointerPublicKeyMutPointerPrivateKey) == 16); -static_assert_64bit(alignof(SignalPairOfMutPointerPublicKeyMutPointerPrivateKey) == 8); -typedef SignalPairOfMutPointerPublicKeyMutPointerPrivateKey* SignalType_MutPointer_SignalPairOfMutPointerPublicKeyMutPointerPrivateKey; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPairOfMutPointerPublicKeyMutPointerPrivateKey) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPairOfMutPointerPublicKeyMutPointerPrivateKey) == 8); -typedef struct { - const int8_t* first; - SignalOwnedBuffer second; -} SignalPairOfCStringPtrOwnedBuffer; -static_assert_64bit(offsetof(SignalPairOfCStringPtrOwnedBuffer, first) == 0); -static_assert_64bit(offsetof(SignalPairOfCStringPtrOwnedBuffer, second) == 8); -static_assert_64bit(sizeof(SignalPairOfCStringPtrOwnedBuffer) == 24); -static_assert_64bit(alignof(SignalPairOfCStringPtrOwnedBuffer) == 8); -typedef struct { - SignalPairOfCStringPtrOwnedBuffer first; - int64_t second; -} SignalPairOfPairOfCStringPtrOwnedBufferi64; -static_assert_64bit(offsetof(SignalPairOfPairOfCStringPtrOwnedBufferi64, first) == 0); -static_assert_64bit(offsetof(SignalPairOfPairOfCStringPtrOwnedBufferi64, second) == 24); -static_assert_64bit(sizeof(SignalPairOfPairOfCStringPtrOwnedBufferi64) == 32); -static_assert_64bit(alignof(SignalPairOfPairOfCStringPtrOwnedBufferi64) == 8); -typedef SignalPairOfPairOfCStringPtrOwnedBufferi64* SignalType_MutPointer_SignalPairOfPairOfCStringPtrOwnedBufferi64; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalPairOfPairOfCStringPtrOwnedBufferi64) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalPairOfPairOfCStringPtrOwnedBufferi64) == 8); -typedef SignalUuid* SignalType_MutPointer_SignalUuid; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalUuid) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalUuid) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_FixedArray32_uint8_t_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_FixedArray32_uint8_t, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_FixedArray32_uint8_t_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_FixedArray32_uint8_t_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_FixedArray32_uint8_t_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromisec_uchar32; -static_assert_64bit(offsetof(SignalCPromisec_uchar32, complete) == 0); -static_assert_64bit(offsetof(SignalCPromisec_uchar32, context) == 8); -static_assert_64bit(offsetof(SignalCPromisec_uchar32, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromisec_uchar32) == 24); -static_assert_64bit(alignof(SignalCPromisec_uchar32) == 8); -typedef SignalCPromisec_uchar32* SignalType_MutPointer_SignalCPromisec_uchar32; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromisec_uchar32) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromisec_uchar32) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_bool_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_bool, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_bool_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_bool_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_bool_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromisebool; -static_assert_64bit(offsetof(SignalCPromisebool, complete) == 0); -static_assert_64bit(offsetof(SignalCPromisebool, context) == 8); -static_assert_64bit(offsetof(SignalCPromisebool, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromisebool) == 24); -static_assert_64bit(alignof(SignalCPromisebool) == 8); -typedef SignalCPromisebool* SignalType_MutPointer_SignalCPromisebool; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromisebool) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromisebool) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_int32_t_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_int32_t, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_int32_t_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_int32_t_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_int32_t_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromisei32; -static_assert_64bit(offsetof(SignalCPromisei32, complete) == 0); -static_assert_64bit(offsetof(SignalCPromisei32, context) == 8); -static_assert_64bit(offsetof(SignalCPromisei32, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromisei32) == 24); -static_assert_64bit(alignof(SignalCPromisei32) == 8); -typedef SignalCPromisei32* SignalType_MutPointer_SignalCPromisei32; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromisei32) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromisei32) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCdsiLookupResponse_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalFfiCdsiLookupResponse, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCdsiLookupResponse_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCdsiLookupResponse_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCdsiLookupResponse_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseFfiCdsiLookupResponse; -static_assert_64bit(offsetof(SignalCPromiseFfiCdsiLookupResponse, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseFfiCdsiLookupResponse, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseFfiCdsiLookupResponse, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseFfiCdsiLookupResponse) == 24); -static_assert_64bit(alignof(SignalCPromiseFfiCdsiLookupResponse) == 8); -typedef SignalCPromiseFfiCdsiLookupResponse* SignalType_MutPointer_SignalCPromiseFfiCdsiLookupResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseFfiCdsiLookupResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseFfiCdsiLookupResponse) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiChatResponse_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalFfiChatResponse, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiChatResponse_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiChatResponse_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiChatResponse_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseFfiChatResponse; -static_assert_64bit(offsetof(SignalCPromiseFfiChatResponse, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseFfiChatResponse, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseFfiChatResponse, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseFfiChatResponse) == 24); -static_assert_64bit(alignof(SignalCPromiseFfiChatResponse) == 8); -typedef SignalCPromiseFfiChatResponse* SignalType_MutPointer_SignalCPromiseFfiChatResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseFfiChatResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseFfiChatResponse) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCheckSvr2CredentialsResponse_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalFfiCheckSvr2CredentialsResponse, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCheckSvr2CredentialsResponse_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCheckSvr2CredentialsResponse_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiCheckSvr2CredentialsResponse_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseFfiCheckSvr2CredentialsResponse; -static_assert_64bit(offsetof(SignalCPromiseFfiCheckSvr2CredentialsResponse, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseFfiCheckSvr2CredentialsResponse, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseFfiCheckSvr2CredentialsResponse, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseFfiCheckSvr2CredentialsResponse) == 24); -static_assert_64bit(alignof(SignalCPromiseFfiCheckSvr2CredentialsResponse) == 8); -typedef SignalCPromiseFfiCheckSvr2CredentialsResponse* SignalType_MutPointer_SignalCPromiseFfiCheckSvr2CredentialsResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseFfiCheckSvr2CredentialsResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseFfiCheckSvr2CredentialsResponse) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiPreKeysResponse_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalFfiPreKeysResponse, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiPreKeysResponse_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiPreKeysResponse_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiPreKeysResponse_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseFfiPreKeysResponse; -static_assert_64bit(offsetof(SignalCPromiseFfiPreKeysResponse, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseFfiPreKeysResponse, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseFfiPreKeysResponse, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseFfiPreKeysResponse) == 24); -static_assert_64bit(alignof(SignalCPromiseFfiPreKeysResponse) == 8); -typedef SignalCPromiseFfiPreKeysResponse* SignalType_MutPointer_SignalCPromiseFfiPreKeysResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseFfiPreKeysResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseFfiPreKeysResponse) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiUploadForm_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalFfiUploadForm, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiUploadForm_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiUploadForm_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalFfiUploadForm_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseFfiUploadForm; -static_assert_64bit(offsetof(SignalCPromiseFfiUploadForm, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseFfiUploadForm, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseFfiUploadForm, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseFfiUploadForm) == 24); -static_assert_64bit(alignof(SignalCPromiseFfiUploadForm) == 8); -typedef SignalCPromiseFfiUploadForm* SignalType_MutPointer_SignalCPromiseFfiUploadForm; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseFfiUploadForm) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseFfiUploadForm) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerCdsiLookup_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerCdsiLookup, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerCdsiLookup_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerCdsiLookup_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerCdsiLookup_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerCdsiLookup; -static_assert_64bit(offsetof(SignalCPromiseMutPointerCdsiLookup, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerCdsiLookup, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerCdsiLookup, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerCdsiLookup) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerCdsiLookup) == 8); -typedef SignalCPromiseMutPointerCdsiLookup* SignalType_MutPointer_SignalCPromiseMutPointerCdsiLookup; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerCdsiLookup) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerCdsiLookup) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerAuthenticatedChatConnection_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerAuthenticatedChatConnection, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerAuthenticatedChatConnection_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerAuthenticatedChatConnection_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerAuthenticatedChatConnection_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerAuthenticatedChatConnection; -static_assert_64bit(offsetof(SignalCPromiseMutPointerAuthenticatedChatConnection, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerAuthenticatedChatConnection, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerAuthenticatedChatConnection, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerAuthenticatedChatConnection) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerAuthenticatedChatConnection) == 8); -typedef SignalCPromiseMutPointerAuthenticatedChatConnection* SignalType_MutPointer_SignalCPromiseMutPointerAuthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerAuthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerAuthenticatedChatConnection) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerProvisioningChatConnection_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerProvisioningChatConnection, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerProvisioningChatConnection_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerProvisioningChatConnection_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerProvisioningChatConnection_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerProvisioningChatConnection; -static_assert_64bit(offsetof(SignalCPromiseMutPointerProvisioningChatConnection, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerProvisioningChatConnection, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerProvisioningChatConnection, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerProvisioningChatConnection) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerProvisioningChatConnection) == 8); -typedef SignalCPromiseMutPointerProvisioningChatConnection* SignalType_MutPointer_SignalCPromiseMutPointerProvisioningChatConnection; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerProvisioningChatConnection) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerProvisioningChatConnection) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerUnauthenticatedChatConnection_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerUnauthenticatedChatConnection, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerUnauthenticatedChatConnection_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerUnauthenticatedChatConnection_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerUnauthenticatedChatConnection_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerUnauthenticatedChatConnection; -static_assert_64bit(offsetof(SignalCPromiseMutPointerUnauthenticatedChatConnection, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerUnauthenticatedChatConnection, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerUnauthenticatedChatConnection, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerUnauthenticatedChatConnection) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerUnauthenticatedChatConnection) == 8); -typedef SignalCPromiseMutPointerUnauthenticatedChatConnection* SignalType_MutPointer_SignalCPromiseMutPointerUnauthenticatedChatConnection; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerUnauthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerUnauthenticatedChatConnection) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegistrationService_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerRegistrationService, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegistrationService_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegistrationService_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegistrationService_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerRegistrationService; -static_assert_64bit(offsetof(SignalCPromiseMutPointerRegistrationService, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerRegistrationService, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerRegistrationService, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerRegistrationService) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerRegistrationService) == 8); -typedef SignalCPromiseMutPointerRegistrationService* SignalType_MutPointer_SignalCPromiseMutPointerRegistrationService; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerRegistrationService) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerRegistrationService) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupRestoreResponse_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerBackupRestoreResponse, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupRestoreResponse_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupRestoreResponse_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupRestoreResponse_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerBackupRestoreResponse; -static_assert_64bit(offsetof(SignalCPromiseMutPointerBackupRestoreResponse, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerBackupRestoreResponse, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerBackupRestoreResponse, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerBackupRestoreResponse) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerBackupRestoreResponse) == 8); -typedef SignalCPromiseMutPointerBackupRestoreResponse* SignalType_MutPointer_SignalCPromiseMutPointerBackupRestoreResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerBackupRestoreResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerBackupRestoreResponse) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupStoreResponse_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerBackupStoreResponse, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupStoreResponse_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupStoreResponse_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerBackupStoreResponse_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerBackupStoreResponse; -static_assert_64bit(offsetof(SignalCPromiseMutPointerBackupStoreResponse, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerBackupStoreResponse, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerBackupStoreResponse, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerBackupStoreResponse) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerBackupStoreResponse) == 8); -typedef SignalCPromiseMutPointerBackupStoreResponse* SignalType_MutPointer_SignalCPromiseMutPointerBackupStoreResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerBackupStoreResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerBackupStoreResponse) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegisterAccountResponse_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalMutPointerRegisterAccountResponse, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegisterAccountResponse_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegisterAccountResponse_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalMutPointerRegisterAccountResponse_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseMutPointerRegisterAccountResponse; -static_assert_64bit(offsetof(SignalCPromiseMutPointerRegisterAccountResponse, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseMutPointerRegisterAccountResponse, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseMutPointerRegisterAccountResponse, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseMutPointerRegisterAccountResponse) == 24); -static_assert_64bit(alignof(SignalCPromiseMutPointerRegisterAccountResponse) == 8); -typedef SignalCPromiseMutPointerRegisterAccountResponse* SignalType_MutPointer_SignalCPromiseMutPointerRegisterAccountResponse; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseMutPointerRegisterAccountResponse) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseMutPointerRegisterAccountResponse) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalPairOfCStringPtrc_uchar32_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseOptionalPairOfCStringPtrc_uchar32; -static_assert_64bit(offsetof(SignalCPromiseOptionalPairOfCStringPtrc_uchar32, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseOptionalPairOfCStringPtrc_uchar32, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseOptionalPairOfCStringPtrc_uchar32, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseOptionalPairOfCStringPtrc_uchar32) == 24); -static_assert_64bit(alignof(SignalCPromiseOptionalPairOfCStringPtrc_uchar32) == 8); -typedef SignalCPromiseOptionalPairOfCStringPtrc_uchar32* SignalType_MutPointer_SignalCPromiseOptionalPairOfCStringPtrc_uchar32; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseOptionalPairOfCStringPtrc_uchar32) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseOptionalPairOfCStringPtrc_uchar32) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalUuid_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalOptionalUuid, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalUuid_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalUuid_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOptionalUuid_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseOptionalUuid; -static_assert_64bit(offsetof(SignalCPromiseOptionalUuid, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseOptionalUuid, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseOptionalUuid, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseOptionalUuid) == 24); -static_assert_64bit(alignof(SignalCPromiseOptionalUuid) == 8); -typedef SignalCPromiseOptionalUuid* SignalType_MutPointer_SignalCPromiseOptionalUuid; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseOptionalUuid) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseOptionalUuid) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfc_uchar17_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalOwnedBufferOfc_uchar17, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfc_uchar17_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfc_uchar17_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfc_uchar17_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseOwnedBufferOfc_uchar17; -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfc_uchar17, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfc_uchar17, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfc_uchar17, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseOwnedBufferOfc_uchar17) == 24); -static_assert_64bit(alignof(SignalCPromiseOwnedBufferOfc_uchar17) == 8); -typedef SignalCPromiseOwnedBufferOfc_uchar17* SignalType_MutPointer_SignalCPromiseOwnedBufferOfc_uchar17; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfc_uchar17) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfc_uchar17) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBuffer_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalOwnedBuffer, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBuffer_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBuffer_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBuffer_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseOwnedBuffer; -static_assert_64bit(offsetof(SignalCPromiseOwnedBuffer, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseOwnedBuffer, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseOwnedBuffer, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseOwnedBuffer) == 24); -static_assert_64bit(alignof(SignalCPromiseOwnedBuffer) == 8); -typedef SignalCPromiseOwnedBuffer* SignalType_MutPointer_SignalCPromiseOwnedBuffer; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseOwnedBuffer) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseOwnedBuffer) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult; -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 8); -typedef SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult* SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult; -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 8); -typedef SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult* SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult; -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 8); -typedef SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult* SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfCStringPtrCStringPtr_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalPairOfCStringPtrCStringPtr, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfCStringPtrCStringPtr_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfCStringPtrCStringPtr_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfCStringPtrCStringPtr_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromisePairOfCStringPtrCStringPtr; -static_assert_64bit(offsetof(SignalCPromisePairOfCStringPtrCStringPtr, complete) == 0); -static_assert_64bit(offsetof(SignalCPromisePairOfCStringPtrCStringPtr, context) == 8); -static_assert_64bit(offsetof(SignalCPromisePairOfCStringPtrCStringPtr, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromisePairOfCStringPtrCStringPtr) == 24); -static_assert_64bit(alignof(SignalCPromisePairOfCStringPtrCStringPtr) == 8); -typedef SignalCPromisePairOfCStringPtrCStringPtr* SignalType_MutPointer_SignalCPromisePairOfCStringPtrCStringPtr; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromisePairOfCStringPtrCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromisePairOfCStringPtrCStringPtr) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr; -static_assert_64bit(offsetof(SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr, complete) == 0); -static_assert_64bit(offsetof(SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr, context) == 8); -static_assert_64bit(offsetof(SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 24); -static_assert_64bit(alignof(SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 8); -typedef SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr* SignalType_MutPointer_SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalPairOfOwnedBufferOwnedBuffer_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromisePairOfOwnedBufferOwnedBuffer; -static_assert_64bit(offsetof(SignalCPromisePairOfOwnedBufferOwnedBuffer, complete) == 0); -static_assert_64bit(offsetof(SignalCPromisePairOfOwnedBufferOwnedBuffer, context) == 8); -static_assert_64bit(offsetof(SignalCPromisePairOfOwnedBufferOwnedBuffer, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromisePairOfOwnedBufferOwnedBuffer) == 24); -static_assert_64bit(alignof(SignalCPromisePairOfOwnedBufferOwnedBuffer) == 8); -typedef SignalCPromisePairOfOwnedBufferOwnedBuffer* SignalType_MutPointer_SignalCPromisePairOfOwnedBufferOwnedBuffer; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromisePairOfOwnedBufferOwnedBuffer) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromisePairOfOwnedBufferOwnedBuffer) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalUuid_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalUuid, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalUuid_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalUuid_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalUuid_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseUuid; -static_assert_64bit(offsetof(SignalCPromiseUuid, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseUuid, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseUuid, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseUuid) == 24); -static_assert_64bit(alignof(SignalCPromiseUuid) == 8); -typedef SignalCPromiseUuid* SignalType_MutPointer_SignalCPromiseUuid; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseUuid) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseUuid) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMediaBackupInfoFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalBridgeMediaBackupInfoFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMediaBackupInfoFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMediaBackupInfoFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMediaBackupInfoFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseBridgeMediaBackupInfoFfiResult; -static_assert_64bit(offsetof(SignalCPromiseBridgeMediaBackupInfoFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseBridgeMediaBackupInfoFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseBridgeMediaBackupInfoFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseBridgeMediaBackupInfoFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseBridgeMediaBackupInfoFfiResult) == 8); -typedef SignalCPromiseBridgeMediaBackupInfoFfiResult* SignalType_MutPointer_SignalCPromiseBridgeMediaBackupInfoFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseBridgeMediaBackupInfoFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseBridgeMediaBackupInfoFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMessageBackupInfoFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalBridgeMessageBackupInfoFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMessageBackupInfoFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMessageBackupInfoFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgeMessageBackupInfoFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseBridgeMessageBackupInfoFfiResult; -static_assert_64bit(offsetof(SignalCPromiseBridgeMessageBackupInfoFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseBridgeMessageBackupInfoFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseBridgeMessageBackupInfoFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseBridgeMessageBackupInfoFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseBridgeMessageBackupInfoFfiResult) == 8); -typedef SignalCPromiseBridgeMessageBackupInfoFfiResult* SignalType_MutPointer_SignalCPromiseBridgeMessageBackupInfoFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseBridgeMessageBackupInfoFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseBridgeMessageBackupInfoFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePendingTotpKeyFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalBridgePendingTotpKeyFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePendingTotpKeyFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePendingTotpKeyFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePendingTotpKeyFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseBridgePendingTotpKeyFfiResult; -static_assert_64bit(offsetof(SignalCPromiseBridgePendingTotpKeyFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseBridgePendingTotpKeyFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseBridgePendingTotpKeyFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseBridgePendingTotpKeyFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseBridgePendingTotpKeyFfiResult) == 8); -typedef SignalCPromiseBridgePendingTotpKeyFfiResult* SignalType_MutPointer_SignalCPromiseBridgePendingTotpKeyFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseBridgePendingTotpKeyFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseBridgePendingTotpKeyFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePreKeyCountsFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalBridgePreKeyCountsFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePreKeyCountsFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePreKeyCountsFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalBridgePreKeyCountsFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseBridgePreKeyCountsFfiResult; -static_assert_64bit(offsetof(SignalCPromiseBridgePreKeyCountsFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseBridgePreKeyCountsFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseBridgePreKeyCountsFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseBridgePreKeyCountsFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseBridgePreKeyCountsFfiResult) == 8); -typedef SignalCPromiseBridgePreKeyCountsFfiResult* SignalType_MutPointer_SignalCPromiseBridgePreKeyCountsFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseBridgePreKeyCountsFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseBridgePreKeyCountsFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCopyBackupMediaNextChunkFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseCopyBackupMediaNextChunkFfiResult; -static_assert_64bit(offsetof(SignalCPromiseCopyBackupMediaNextChunkFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseCopyBackupMediaNextChunkFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseCopyBackupMediaNextChunkFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseCopyBackupMediaNextChunkFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseCopyBackupMediaNextChunkFfiResult) == 8); -typedef SignalCPromiseCopyBackupMediaNextChunkFfiResult* SignalType_MutPointer_SignalCPromiseCopyBackupMediaNextChunkFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseCopyBackupMediaNextChunkFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseCopyBackupMediaNextChunkFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalDeleteBackupMediaNextChunkFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseDeleteBackupMediaNextChunkFfiResult; -static_assert_64bit(offsetof(SignalCPromiseDeleteBackupMediaNextChunkFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseDeleteBackupMediaNextChunkFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseDeleteBackupMediaNextChunkFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseDeleteBackupMediaNextChunkFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseDeleteBackupMediaNextChunkFfiResult) == 8); -typedef SignalCPromiseDeleteBackupMediaNextChunkFfiResult* SignalType_MutPointer_SignalCPromiseDeleteBackupMediaNextChunkFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseDeleteBackupMediaNextChunkFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseDeleteBackupMediaNextChunkFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCurrencyConversionsInternalFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalCurrencyConversionsInternalFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCurrencyConversionsInternalFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCurrencyConversionsInternalFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalCurrencyConversionsInternalFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseCurrencyConversionsInternalFfiResult; -static_assert_64bit(offsetof(SignalCPromiseCurrencyConversionsInternalFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseCurrencyConversionsInternalFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseCurrencyConversionsInternalFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseCurrencyConversionsInternalFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseCurrencyConversionsInternalFfiResult) == 8); -typedef SignalCPromiseCurrencyConversionsInternalFfiResult* SignalType_MutPointer_SignalCPromiseCurrencyConversionsInternalFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseCurrencyConversionsInternalFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseCurrencyConversionsInternalFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalGetStickerUploadFormsResponseFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseGetStickerUploadFormsResponseFfiResult; -static_assert_64bit(offsetof(SignalCPromiseGetStickerUploadFormsResponseFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseGetStickerUploadFormsResponseFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseGetStickerUploadFormsResponseFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseGetStickerUploadFormsResponseFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseGetStickerUploadFormsResponseFfiResult) == 8); -typedef SignalCPromiseGetStickerUploadFormsResponseFfiResult* SignalType_MutPointer_SignalCPromiseGetStickerUploadFormsResponseFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseGetStickerUploadFormsResponseFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseGetStickerUploadFormsResponseFfiResult) == 8); -typedef void (*SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalListMediaResponseFfiResult_ConstPointer_void)(SignalType_MutPointer_SignalFfiError, SignalType_ConstPointer_SignalListMediaResponseFfiResult, SignalType_ConstPointer_void); -static_assert_64bit(sizeof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalListMediaResponseFfiResult_ConstPointer_void) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalListMediaResponseFfiResult_ConstPointer_void) == 8); -typedef struct { - SignalType_FunctionPointer_void_MutPointer_SignalFfiError_ConstPointer_SignalListMediaResponseFfiResult_ConstPointer_void complete; - const void* context; - uint64_t cancellation_id; -} SignalCPromiseListMediaResponseFfiResult; -static_assert_64bit(offsetof(SignalCPromiseListMediaResponseFfiResult, complete) == 0); -static_assert_64bit(offsetof(SignalCPromiseListMediaResponseFfiResult, context) == 8); -static_assert_64bit(offsetof(SignalCPromiseListMediaResponseFfiResult, cancellation_id) == 16); -static_assert_64bit(sizeof(SignalCPromiseListMediaResponseFfiResult) == 24); -static_assert_64bit(alignof(SignalCPromiseListMediaResponseFfiResult) == 8); -typedef SignalCPromiseListMediaResponseFfiResult* SignalType_MutPointer_SignalCPromiseListMediaResponseFfiResult; -static_assert_64bit(sizeof(SignalType_MutPointer_SignalCPromiseListMediaResponseFfiResult) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_SignalCPromiseListMediaResponseFfiResult) == 8); -typedef uint16_t* SignalType_MutPointer_uint16_t; -static_assert_64bit(sizeof(SignalType_MutPointer_uint16_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_uint16_t) == 8); -typedef uint64_t* SignalType_MutPointer_uint64_t; -static_assert_64bit(sizeof(SignalType_MutPointer_uint64_t) == 8); -static_assert_64bit(alignof(SignalType_MutPointer_uint64_t) == 8); -static_assert_64bit(sizeof(float) == 4); -static_assert_64bit(alignof(float) == 4); -typedef float MaybeUninitOff32; -static_assert_64bit(sizeof(MaybeUninitOff32) == 4); -static_assert_64bit(alignof(MaybeUninitOff32) == 4); -typedef SignalBorrowedBuffer MaybeUninitOfBorrowedBuffer; -static_assert_64bit(sizeof(MaybeUninitOfBorrowedBuffer) == 16); -static_assert_64bit(alignof(MaybeUninitOfBorrowedBuffer) == 8); + SignalDirectionSending = 0, + SignalDirectionReceiving = 1, +} SignalDirection; + typedef enum { SignalLogLevelError = 1, - SignalLogLevelWarn = 2, - SignalLogLevelInfo = 3, - SignalLogLevelDebug = 4, - SignalLogLevelTrace = 5, + SignalLogLevelWarn, + SignalLogLevelInfo, + SignalLogLevelDebug, + SignalLogLevelTrace, } SignalLogLevel; -static_assert_64bit(sizeof(SignalLogLevel) == 4); -static_assert_64bit(alignof(SignalLogLevel) == 4); -typedef int32_t (*SignalType_FunctionPointer_int32_t_MutPointer_void_SignalLogLevel_SignalCStringPtr_uint32_t_SignalCStringPtr)(SignalType_MutPointer_void, SignalLogLevel, SignalCStringPtr, uint32_t, SignalCStringPtr); -static_assert_64bit(sizeof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalLogLevel_SignalCStringPtr_uint32_t_SignalCStringPtr) == 8); -static_assert_64bit(alignof(SignalType_FunctionPointer_int32_t_MutPointer_void_SignalLogLevel_SignalCStringPtr_uint32_t_SignalCStringPtr) == 8); -typedef struct { - const size_t* base; - size_t length; -} SignalBorrowedSliceOfusize; -static_assert_64bit(offsetof(SignalBorrowedSliceOfusize, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfusize, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfusize) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfusize) == 8); -typedef struct { - SignalBorrowedBuffer bytes; - SignalBorrowedSliceOfusize lengths; -} SignalBorrowedBytestringArray; -static_assert_64bit(offsetof(SignalBorrowedBytestringArray, bytes) == 0); -static_assert_64bit(offsetof(SignalBorrowedBytestringArray, lengths) == 16); -static_assert_64bit(sizeof(SignalBorrowedBytestringArray) == 32); -static_assert_64bit(alignof(SignalBorrowedBytestringArray) == 8); -typedef struct { - const SignalType_ConstPointer_FixedArray32_uint8_t* base; - size_t length; -} SignalBorrowedSliceOfc_uchar32; -static_assert_64bit(offsetof(SignalBorrowedSliceOfc_uchar32, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfc_uchar32, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfc_uchar32) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfc_uchar32) == 8); -typedef struct { - const SignalCStringPtr* base; - size_t length; -} SignalBorrowedSliceOfCStringPtr; -static_assert_64bit(offsetof(SignalBorrowedSliceOfCStringPtr, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfCStringPtr, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfCStringPtr) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfCStringPtr) == 8); -typedef struct { - const SignalBorrowedBuffer* base; - size_t length; -} SignalBorrowedSliceOfBuffers; -static_assert_64bit(offsetof(SignalBorrowedSliceOfBuffers, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfBuffers, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfBuffers) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfBuffers) == 8); -typedef struct { - const SignalConstPointerProtocolAddress* base; - size_t length; -} SignalBorrowedSliceOfConstPointerProtocolAddress; -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerProtocolAddress, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerProtocolAddress, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfConstPointerProtocolAddress) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfConstPointerProtocolAddress) == 8); -typedef struct { - const SignalConstPointerPublicKey* base; - size_t length; -} SignalBorrowedSliceOfConstPointerPublicKey; -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerPublicKey, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerPublicKey, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfConstPointerPublicKey) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfConstPointerPublicKey) == 8); -typedef struct { - const SignalConstPointerCiphertextMessage* base; - size_t length; -} SignalBorrowedSliceOfConstPointerCiphertextMessage; -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerCiphertextMessage, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerCiphertextMessage, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfConstPointerCiphertextMessage) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfConstPointerCiphertextMessage) == 8); -typedef struct { - const SignalConstPointerSessionRecord* base; - size_t length; -} SignalBorrowedSliceOfConstPointerSessionRecord; -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerSessionRecord, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfConstPointerSessionRecord, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfConstPointerSessionRecord) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfConstPointerSessionRecord) == 8); -typedef struct { - const SignalBridgeCopyBackupMediaItemFfiArg* base; - size_t length; -} SignalBorrowedSliceOfBridgeCopyBackupMediaItemFfiArg; -static_assert_64bit(offsetof(SignalBorrowedSliceOfBridgeCopyBackupMediaItemFfiArg, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfBridgeCopyBackupMediaItemFfiArg, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfBridgeCopyBackupMediaItemFfiArg) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfBridgeCopyBackupMediaItemFfiArg) == 8); -typedef struct { - const SignalBridgeDeleteBackupMediaItemFfiArg* base; - size_t length; -} SignalBorrowedSliceOfBridgeDeleteBackupMediaItemFfiArg; -static_assert_64bit(offsetof(SignalBorrowedSliceOfBridgeDeleteBackupMediaItemFfiArg, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfBridgeDeleteBackupMediaItemFfiArg, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfBridgeDeleteBackupMediaItemFfiArg) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfBridgeDeleteBackupMediaItemFfiArg) == 8); -typedef struct { - const SignalDeviceCapabilityInternalFfiArg* base; - size_t length; -} SignalBorrowedSliceOfDeviceCapabilityInternalFfiArg; -static_assert_64bit(offsetof(SignalBorrowedSliceOfDeviceCapabilityInternalFfiArg, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfDeviceCapabilityInternalFfiArg, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfDeviceCapabilityInternalFfiArg) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfDeviceCapabilityInternalFfiArg) == 8); -typedef struct { - const uint32_t* base; - size_t length; -} SignalBorrowedSliceOfu32; -static_assert_64bit(offsetof(SignalBorrowedSliceOfu32, base) == 0); -static_assert_64bit(offsetof(SignalBorrowedSliceOfu32, length) == 8); -static_assert_64bit(sizeof(SignalBorrowedSliceOfu32) == 16); -static_assert_64bit(alignof(SignalBorrowedSliceOfu32) == 8); -typedef struct { - const SignalAes256GcmSiv* raw; -} SignalConstPointerAes256GcmSiv; -static_assert_64bit(offsetof(SignalConstPointerAes256GcmSiv, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerAes256GcmSiv) == 8); -static_assert_64bit(alignof(SignalConstPointerAes256GcmSiv) == 8); -typedef struct { - const SignalPinHash* raw; -} SignalConstPointerPinHash; -static_assert_64bit(offsetof(SignalConstPointerPinHash, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerPinHash) == 8); -static_assert_64bit(alignof(SignalConstPointerPinHash) == 8); -typedef struct { - const SignalFfiConnectChatBridgeStruct* raw; -} SignalConstPointerFfiConnectChatBridgeStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiConnectChatBridgeStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiConnectChatBridgeStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiConnectChatBridgeStruct) == 8); -typedef struct { - const SignalHsmEnclaveClient* raw; -} SignalConstPointerHsmEnclaveClient; -static_assert_64bit(offsetof(SignalConstPointerHsmEnclaveClient, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerHsmEnclaveClient) == 8); -static_assert_64bit(alignof(SignalConstPointerHsmEnclaveClient) == 8); -typedef struct { - const SignalFfiSyncInputStreamStruct* raw; -} SignalConstPointerFfiSyncInputStreamStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiSyncInputStreamStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiSyncInputStreamStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiSyncInputStreamStruct) == 8); -typedef struct { - const SignalMessageBackupKey* raw; -} SignalConstPointerMessageBackupKey; -static_assert_64bit(offsetof(SignalConstPointerMessageBackupKey, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerMessageBackupKey) == 8); -static_assert_64bit(alignof(SignalConstPointerMessageBackupKey) == 8); -typedef struct { - const SignalMessageBackupValidationOutcome* raw; -} SignalConstPointerMessageBackupValidationOutcome; -static_assert_64bit(offsetof(SignalConstPointerMessageBackupValidationOutcome, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerMessageBackupValidationOutcome) == 8); -static_assert_64bit(alignof(SignalConstPointerMessageBackupValidationOutcome) == 8); -typedef struct { - const SignalConnectionManager* raw; -} SignalConstPointerConnectionManager; -static_assert_64bit(offsetof(SignalConstPointerConnectionManager, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerConnectionManager) == 8); -static_assert_64bit(alignof(SignalConstPointerConnectionManager) == 8); -typedef struct { - const SignalCdsiLookup* raw; -} SignalConstPointerCdsiLookup; -static_assert_64bit(offsetof(SignalConstPointerCdsiLookup, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerCdsiLookup) == 8); -static_assert_64bit(alignof(SignalConstPointerCdsiLookup) == 8); -typedef struct { - const SignalLookupRequest* raw; -} SignalConstPointerLookupRequest; -static_assert_64bit(offsetof(SignalConstPointerLookupRequest, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerLookupRequest) == 8); -static_assert_64bit(alignof(SignalConstPointerLookupRequest) == 8); -typedef struct { - const SignalAuthenticatedChatConnection* raw; -} SignalConstPointerAuthenticatedChatConnection; -static_assert_64bit(offsetof(SignalConstPointerAuthenticatedChatConnection, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerAuthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalConstPointerAuthenticatedChatConnection) == 8); -typedef struct { - const SignalCopyBackupMediaStream* raw; -} SignalConstPointerCopyBackupMediaStream; -static_assert_64bit(offsetof(SignalConstPointerCopyBackupMediaStream, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerCopyBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalConstPointerCopyBackupMediaStream) == 8); -typedef struct { - const SignalDeleteBackupMediaStream* raw; -} SignalConstPointerDeleteBackupMediaStream; -static_assert_64bit(offsetof(SignalConstPointerDeleteBackupMediaStream, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerDeleteBackupMediaStream) == 8); -static_assert_64bit(alignof(SignalConstPointerDeleteBackupMediaStream) == 8); -typedef struct { - const SignalFfiChatListenerStruct* raw; -} SignalConstPointerFfiChatListenerStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiChatListenerStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiChatListenerStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiChatListenerStruct) == 8); -typedef struct { - const SignalFfiProvisioningListenerStruct* raw; -} SignalConstPointerFfiProvisioningListenerStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiProvisioningListenerStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiProvisioningListenerStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiProvisioningListenerStruct) == 8); -typedef struct { - const SignalHttpRequest* raw; -} SignalConstPointerHttpRequest; -static_assert_64bit(offsetof(SignalConstPointerHttpRequest, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerHttpRequest) == 8); -static_assert_64bit(alignof(SignalConstPointerHttpRequest) == 8); -typedef struct { - const SignalProvisioningChatConnection* raw; -} SignalConstPointerProvisioningChatConnection; -static_assert_64bit(offsetof(SignalConstPointerProvisioningChatConnection, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerProvisioningChatConnection) == 8); -static_assert_64bit(alignof(SignalConstPointerProvisioningChatConnection) == 8); -typedef struct { - const SignalServerMessageAck* raw; -} SignalConstPointerServerMessageAck; -static_assert_64bit(offsetof(SignalConstPointerServerMessageAck, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerServerMessageAck) == 8); -static_assert_64bit(alignof(SignalConstPointerServerMessageAck) == 8); -typedef struct { - const SignalUnauthenticatedChatConnection* raw; -} SignalConstPointerUnauthenticatedChatConnection; -static_assert_64bit(offsetof(SignalConstPointerUnauthenticatedChatConnection, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerUnauthenticatedChatConnection) == 8); -static_assert_64bit(alignof(SignalConstPointerUnauthenticatedChatConnection) == 8); -typedef struct { - const SignalRegistrationAccountAttributes* raw; -} SignalConstPointerRegistrationAccountAttributes; -static_assert_64bit(offsetof(SignalConstPointerRegistrationAccountAttributes, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerRegistrationAccountAttributes) == 8); -static_assert_64bit(alignof(SignalConstPointerRegistrationAccountAttributes) == 8); -typedef struct { - const SignalRegisterAccountRequest* raw; -} SignalConstPointerRegisterAccountRequest; -static_assert_64bit(offsetof(SignalConstPointerRegisterAccountRequest, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerRegisterAccountRequest) == 8); -static_assert_64bit(alignof(SignalConstPointerRegisterAccountRequest) == 8); -typedef struct { - const SignalRegistrationService* raw; -} SignalConstPointerRegistrationService; -static_assert_64bit(offsetof(SignalConstPointerRegistrationService, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerRegistrationService) == 8); -static_assert_64bit(alignof(SignalConstPointerRegistrationService) == 8); -typedef struct { - const SignalTokioAsyncContext* raw; -} SignalConstPointerTokioAsyncContext; -static_assert_64bit(offsetof(SignalConstPointerTokioAsyncContext, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerTokioAsyncContext) == 8); -static_assert_64bit(alignof(SignalConstPointerTokioAsyncContext) == 8); -typedef struct { - const SignalFfiIdentityKeyStoreStruct* raw; -} SignalConstPointerFfiIdentityKeyStoreStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiIdentityKeyStoreStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiIdentityKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiIdentityKeyStoreStruct) == 8); -typedef struct { - const SignalFfiKyberPreKeyStoreStruct* raw; -} SignalConstPointerFfiKyberPreKeyStoreStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiKyberPreKeyStoreStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiKyberPreKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiKyberPreKeyStoreStruct) == 8); -typedef struct { - const SignalFfiPreKeyStoreStruct* raw; -} SignalConstPointerFfiPreKeyStoreStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiPreKeyStoreStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiPreKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiPreKeyStoreStruct) == 8); -typedef struct { - const SignalFfiSenderKeyStoreStruct* raw; -} SignalConstPointerFfiSenderKeyStoreStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiSenderKeyStoreStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiSenderKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiSenderKeyStoreStruct) == 8); -typedef struct { - const SignalFfiSessionStoreStruct* raw; -} SignalConstPointerFfiSessionStoreStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiSessionStoreStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiSessionStoreStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiSessionStoreStruct) == 8); -typedef struct { - const SignalFfiSignedPreKeyStoreStruct* raw; -} SignalConstPointerFfiSignedPreKeyStoreStruct; -static_assert_64bit(offsetof(SignalConstPointerFfiSignedPreKeyStoreStruct, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFfiSignedPreKeyStoreStruct) == 8); -static_assert_64bit(alignof(SignalConstPointerFfiSignedPreKeyStoreStruct) == 8); -typedef struct { - const SignalSgxClientState* raw; -} SignalConstPointerSgxClientState; -static_assert_64bit(offsetof(SignalConstPointerSgxClientState, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSgxClientState) == 8); -static_assert_64bit(alignof(SignalConstPointerSgxClientState) == 8); -typedef struct { - const SignalBridgedStringMap* raw; -} SignalConstPointerBridgedStringMap; -static_assert_64bit(offsetof(SignalConstPointerBridgedStringMap, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerBridgedStringMap) == 8); -static_assert_64bit(alignof(SignalConstPointerBridgedStringMap) == 8); -typedef struct { - const SignalPrivateKey* raw; -} SignalConstPointerPrivateKey; -static_assert_64bit(offsetof(SignalConstPointerPrivateKey, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerPrivateKey) == 8); -static_assert_64bit(alignof(SignalConstPointerPrivateKey) == 8); -typedef struct { - const SignalChatConnectionInfo* raw; -} SignalConstPointerChatConnectionInfo; -static_assert_64bit(offsetof(SignalConstPointerChatConnectionInfo, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerChatConnectionInfo) == 8); -static_assert_64bit(alignof(SignalConstPointerChatConnectionInfo) == 8); -typedef struct { - const SignalBackupRestoreResponse* raw; -} SignalConstPointerBackupRestoreResponse; -static_assert_64bit(offsetof(SignalConstPointerBackupRestoreResponse, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerBackupRestoreResponse) == 8); -static_assert_64bit(alignof(SignalConstPointerBackupRestoreResponse) == 8); -typedef struct { - const SignalBackupStoreResponse* raw; -} SignalConstPointerBackupStoreResponse; -static_assert_64bit(offsetof(SignalConstPointerBackupStoreResponse, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerBackupStoreResponse) == 8); -static_assert_64bit(alignof(SignalConstPointerBackupStoreResponse) == 8); -typedef struct { - const SignalRegisterAccountResponse* raw; -} SignalConstPointerRegisterAccountResponse; -static_assert_64bit(offsetof(SignalConstPointerRegisterAccountResponse, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerRegisterAccountResponse) == 8); -static_assert_64bit(alignof(SignalConstPointerRegisterAccountResponse) == 8); -typedef struct { - const SignalRegistrationSession* raw; -} SignalConstPointerRegistrationSession; -static_assert_64bit(offsetof(SignalConstPointerRegistrationSession, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerRegistrationSession) == 8); -static_assert_64bit(alignof(SignalConstPointerRegistrationSession) == 8); -typedef struct { - const SignalConnectionProxyConfig* raw; -} SignalConstPointerConnectionProxyConfig; -static_assert_64bit(offsetof(SignalConstPointerConnectionProxyConfig, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerConnectionProxyConfig) == 8); -static_assert_64bit(alignof(SignalConstPointerConnectionProxyConfig) == 8); -typedef struct { - const SignalFingerprint* raw; -} SignalConstPointerFingerprint; -static_assert_64bit(offsetof(SignalConstPointerFingerprint, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerFingerprint) == 8); -static_assert_64bit(alignof(SignalConstPointerFingerprint) == 8); -typedef struct { - const SignalKyberPublicKey* raw; -} SignalConstPointerKyberPublicKey; -static_assert_64bit(offsetof(SignalConstPointerKyberPublicKey, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerKyberPublicKey) == 8); -static_assert_64bit(alignof(SignalConstPointerKyberPublicKey) == 8); -typedef struct { - const SignalKyberSecretKey* raw; -} SignalConstPointerKyberSecretKey; -static_assert_64bit(offsetof(SignalConstPointerKyberSecretKey, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerKyberSecretKey) == 8); -static_assert_64bit(alignof(SignalConstPointerKyberSecretKey) == 8); -typedef struct { - const SignalKyberKeyPair* raw; -} SignalConstPointerKyberKeyPair; -static_assert_64bit(offsetof(SignalConstPointerKyberKeyPair, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerKyberKeyPair) == 8); -static_assert_64bit(alignof(SignalConstPointerKyberKeyPair) == 8); -typedef struct { - const SignalDecryptionErrorMessage* raw; -} SignalConstPointerDecryptionErrorMessage; -static_assert_64bit(offsetof(SignalConstPointerDecryptionErrorMessage, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerDecryptionErrorMessage) == 8); -static_assert_64bit(alignof(SignalConstPointerDecryptionErrorMessage) == 8); -typedef struct { - const SignalPlaintextContent* raw; -} SignalConstPointerPlaintextContent; -static_assert_64bit(offsetof(SignalConstPointerPlaintextContent, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerPlaintextContent) == 8); -static_assert_64bit(alignof(SignalConstPointerPlaintextContent) == 8); -typedef struct { - const SignalPreKeySignalMessage* raw; -} SignalConstPointerPreKeySignalMessage; -static_assert_64bit(offsetof(SignalConstPointerPreKeySignalMessage, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerPreKeySignalMessage) == 8); -static_assert_64bit(alignof(SignalConstPointerPreKeySignalMessage) == 8); -typedef struct { - const SignalSenderKeyDistributionMessage* raw; -} SignalConstPointerSenderKeyDistributionMessage; -static_assert_64bit(offsetof(SignalConstPointerSenderKeyDistributionMessage, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSenderKeyDistributionMessage) == 8); -static_assert_64bit(alignof(SignalConstPointerSenderKeyDistributionMessage) == 8); -typedef struct { - const SignalSenderKeyMessage* raw; -} SignalConstPointerSenderKeyMessage; -static_assert_64bit(offsetof(SignalConstPointerSenderKeyMessage, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSenderKeyMessage) == 8); -static_assert_64bit(alignof(SignalConstPointerSenderKeyMessage) == 8); -typedef struct { - const SignalSignalMessage* raw; -} SignalConstPointerSignalMessage; -static_assert_64bit(offsetof(SignalConstPointerSignalMessage, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSignalMessage) == 8); -static_assert_64bit(alignof(SignalConstPointerSignalMessage) == 8); -typedef struct { - const SignalSenderCertificate* raw; -} SignalConstPointerSenderCertificate; -static_assert_64bit(offsetof(SignalConstPointerSenderCertificate, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSenderCertificate) == 8); -static_assert_64bit(alignof(SignalConstPointerSenderCertificate) == 8); -typedef struct { - const SignalServerCertificate* raw; -} SignalConstPointerServerCertificate; -static_assert_64bit(offsetof(SignalConstPointerServerCertificate, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerServerCertificate) == 8); -static_assert_64bit(alignof(SignalConstPointerServerCertificate) == 8); -typedef struct { - const SignalUnidentifiedSenderMessageContent* raw; -} SignalConstPointerUnidentifiedSenderMessageContent; -static_assert_64bit(offsetof(SignalConstPointerUnidentifiedSenderMessageContent, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerUnidentifiedSenderMessageContent) == 8); -static_assert_64bit(alignof(SignalConstPointerUnidentifiedSenderMessageContent) == 8); -typedef struct { - const SignalSenderKeyRecord* raw; -} SignalConstPointerSenderKeyRecord; -static_assert_64bit(offsetof(SignalConstPointerSenderKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSenderKeyRecord) == 8); -static_assert_64bit(alignof(SignalConstPointerSenderKeyRecord) == 8); -typedef struct { - const SignalPreKeyBundle* raw; -} SignalConstPointerPreKeyBundle; -static_assert_64bit(offsetof(SignalConstPointerPreKeyBundle, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerPreKeyBundle) == 8); -static_assert_64bit(alignof(SignalConstPointerPreKeyBundle) == 8); -typedef struct { - const SignalKyberPreKeyRecord* raw; -} SignalConstPointerKyberPreKeyRecord; -static_assert_64bit(offsetof(SignalConstPointerKyberPreKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerKyberPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalConstPointerKyberPreKeyRecord) == 8); -typedef struct { - const SignalPreKeyRecord* raw; -} SignalConstPointerPreKeyRecord; -static_assert_64bit(offsetof(SignalConstPointerPreKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalConstPointerPreKeyRecord) == 8); -typedef struct { - const SignalSignedPreKeyRecord* raw; -} SignalConstPointerSignedPreKeyRecord; -static_assert_64bit(offsetof(SignalConstPointerSignedPreKeyRecord, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerSignedPreKeyRecord) == 8); -static_assert_64bit(alignof(SignalConstPointerSignedPreKeyRecord) == 8); -typedef struct { - const SignalServerPublicParams* raw; -} SignalConstPointerServerPublicParams; -static_assert_64bit(offsetof(SignalConstPointerServerPublicParams, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerServerPublicParams) == 8); -static_assert_64bit(alignof(SignalConstPointerServerPublicParams) == 8); -typedef struct { - const SignalServerSecretParams* raw; -} SignalConstPointerServerSecretParams; -static_assert_64bit(offsetof(SignalConstPointerServerSecretParams, raw) == 0); -static_assert_64bit(sizeof(SignalConstPointerServerSecretParams) == 8); -static_assert_64bit(alignof(SignalConstPointerServerSecretParams) == 8); -enum SignalFfiPublicKeyType { - SignalFfiPublicKeyTypeECC, - SignalFfiPublicKeyTypeKyber, -}; -typedef uint8_t SignalFfiPublicKeyType; -static_assert_64bit(sizeof(SignalFfiPublicKeyType) == 1); -static_assert_64bit(alignof(SignalFfiPublicKeyType) == 1); -typedef struct { - const int8_t* number; - const int8_t* push_token; - const int8_t* mcc; - const int8_t* mnc; -} SignalFfiRegistrationCreateSessionRequest; -static_assert_64bit(offsetof(SignalFfiRegistrationCreateSessionRequest, number) == 0); -static_assert_64bit(offsetof(SignalFfiRegistrationCreateSessionRequest, push_token) == 8); -static_assert_64bit(offsetof(SignalFfiRegistrationCreateSessionRequest, mcc) == 16); -static_assert_64bit(offsetof(SignalFfiRegistrationCreateSessionRequest, mnc) == 24); -static_assert_64bit(sizeof(SignalFfiRegistrationCreateSessionRequest) == 32); -static_assert_64bit(alignof(SignalFfiRegistrationCreateSessionRequest) == 8); -typedef struct { - uint32_t key_id; - SignalFfiPublicKeyType public_key_type; - const void* public_key; - SignalBorrowedBuffer signature; -} SignalFfiSignedPublicPreKey; -static_assert_64bit(offsetof(SignalFfiSignedPublicPreKey, key_id) == 0); -static_assert_64bit(offsetof(SignalFfiSignedPublicPreKey, public_key_type) == 4); -static_assert_64bit(offsetof(SignalFfiSignedPublicPreKey, public_key) == 8); -static_assert_64bit(offsetof(SignalFfiSignedPublicPreKey, signature) == 16); -static_assert_64bit(sizeof(SignalFfiSignedPublicPreKey) == 32); -static_assert_64bit(alignof(SignalFfiSignedPublicPreKey) == 8); -typedef struct { - bool present; - SignalBorrowedBuffer value; -} SignalOptionalBorrowedSliceOfc_uchar; -static_assert_64bit(offsetof(SignalOptionalBorrowedSliceOfc_uchar, present) == 0); -static_assert_64bit(offsetof(SignalOptionalBorrowedSliceOfc_uchar, value) == 8); -static_assert_64bit(sizeof(SignalOptionalBorrowedSliceOfc_uchar) == 24); -static_assert_64bit(alignof(SignalOptionalBorrowedSliceOfc_uchar) == 8); -typedef struct { - bool present; - MaybeUninitOff32 value; -} SignalOptionalOff32; -static_assert_64bit(offsetof(SignalOptionalOff32, present) == 0); -static_assert_64bit(offsetof(SignalOptionalOff32, value) == 4); -static_assert_64bit(sizeof(SignalOptionalOff32) == 8); -static_assert_64bit(alignof(SignalOptionalOff32) == 4); -typedef struct { - bool present; - MaybeUninitOfBorrowedBuffer value; -} SignalOptionalOfBorrowedBuffer; -static_assert_64bit(offsetof(SignalOptionalOfBorrowedBuffer, present) == 0); -static_assert_64bit(offsetof(SignalOptionalOfBorrowedBuffer, value) == 8); -static_assert_64bit(sizeof(SignalOptionalOfBorrowedBuffer) == 24); -static_assert_64bit(alignof(SignalOptionalOfBorrowedBuffer) == 8); -typedef struct { - void* base; - size_t length; - size_t size_bytes; -} SignalOwnedBufferOfMaxAlignedErased; -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedErased, base) == 0); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedErased, length) == 8); -static_assert_64bit(offsetof(SignalOwnedBufferOfMaxAlignedErased, size_bytes) == 16); -static_assert_64bit(sizeof(SignalOwnedBufferOfMaxAlignedErased) == 24); -static_assert_64bit(alignof(SignalOwnedBufferOfMaxAlignedErased) == 8); + typedef enum { SignalErrorCodeUnknownError = 1, SignalErrorCodeInvalidState = 2, @@ -3364,7 +145,6 @@ typedef enum { SignalErrorCodeInvalidArgument = 5, SignalErrorCodeInvalidType = 6, SignalErrorCodeInvalidUtf8String = 7, - SignalErrorCodeCancelled = 8, SignalErrorCodeProtobufError = 10, SignalErrorCodeLegacyCiphertextVersion = 21, SignalErrorCodeUnknownCiphertextVersion = 22, @@ -3382,7 +162,6 @@ typedef enum { SignalErrorCodeInvalidRegistrationId = 81, SignalErrorCodeInvalidSession = 82, SignalErrorCodeInvalidSenderKeySession = 83, - SignalErrorCodeInvalidProtocolAddress = 84, SignalErrorCodeDuplicatedMessage = 90, SignalErrorCodeCallbackError = 100, SignalErrorCodeVerificationFailure = 110, @@ -3395,3414 +174,1170 @@ typedef enum { SignalErrorCodeUsernameTooLong = 126, SignalErrorCodeUsernameLinkInvalidEntropyDataLength = 127, SignalErrorCodeUsernameLinkInvalid = 128, - SignalErrorCodeUsernameDiscriminatorCannotBeEmpty = 130, - SignalErrorCodeUsernameDiscriminatorCannotBeZero = 131, - SignalErrorCodeUsernameDiscriminatorCannotBeSingleDigit = 132, - SignalErrorCodeUsernameDiscriminatorCannotHaveLeadingZeros = 133, - SignalErrorCodeUsernameDiscriminatorTooLarge = 134, - SignalErrorCodeIoError = 140, - SignalErrorCodeInvalidMediaInput = 141, - SignalErrorCodeUnsupportedMediaInput = 142, - SignalErrorCodeConnectionTimedOut = 143, - SignalErrorCodeNetworkProtocol = 144, - SignalErrorCodeRateLimited = 145, - SignalErrorCodeWebSocket = 146, - SignalErrorCodeCdsiInvalidToken = 147, - SignalErrorCodeConnectionFailed = 148, - SignalErrorCodeChatServiceInactive = 149, - SignalErrorCodeRequestTimedOut = 150, - SignalErrorCodeRateLimitChallenge = 151, - SignalErrorCodePossibleCaptiveNetwork = 152, - SignalErrorCodeSvrDataMissing = 160, - SignalErrorCodeSvrRestoreFailed = 161, - SignalErrorCodeSvrRotationMachineTooManySteps = 162, - SignalErrorCodeSvrRequestFailed = 163, - SignalErrorCodeAppExpired = 170, - SignalErrorCodeDeviceDeregistered = 171, - SignalErrorCodeConnectionInvalidated = 172, - SignalErrorCodeConnectedElsewhere = 173, - SignalErrorCodeBackupValidation = 180, - SignalErrorCodeRegistrationInvalidSessionId = 190, - SignalErrorCodeRegistrationUnknown = 192, - SignalErrorCodeRegistrationSessionNotFound = 193, - SignalErrorCodeRegistrationNotReadyForVerification = 194, - SignalErrorCodeRegistrationSendVerificationCodeFailed = 195, - SignalErrorCodeRegistrationCodeNotDeliverable = 196, - SignalErrorCodeRegistrationSessionUpdateRejected = 197, - SignalErrorCodeRegistrationCredentialsCouldNotBeParsed = 198, - SignalErrorCodeRegistrationDeviceTransferPossible = 199, - SignalErrorCodeRegistrationRecoveryVerificationFailed = 200, - SignalErrorCodeRegistrationLock = 201, - SignalErrorCodeRegisterAccountRequestRejected = 202, - SignalErrorCodeRegistrationRecoveryPasswordRequired = 203, - SignalErrorCodeRegistrationOneTimePasswordRequired = 204, - SignalErrorCodeRegistrationInvalidSession = 205, - SignalErrorCodeRegistrationInvalidReceipt = 206, - SignalErrorCodeKeyTransparencyError = 210, - SignalErrorCodeKeyTransparencyVerificationFailed = 211, - SignalErrorCodeRequestUnauthorized = 220, - SignalErrorCodeMismatchedDevices = 221, - SignalErrorCodeServiceIdNotFound = 222, - SignalErrorCodeUploadTooLarge = 223, - SignalErrorCodeDeviceIdNotFound = 224, - SignalErrorCodeUsernameNotAvailable = 225, - SignalErrorCodeUsernameNotSet = 226, - SignalErrorCodeUsernameReservationNotFound = 227, - SignalErrorCodeInvalidReceipt = 228, - SignalErrorCodeMissingBackupId = 229, - SignalErrorCodeReceiptCredentialErrorPaymentStillProcessing = 230, - SignalErrorCodeReceiptCredentialErrorPaymentRequired = 231, - SignalErrorCodeReceiptCredentialErrorPaymentNotFound = 232, - SignalErrorCodeReceiptCredentialErrorReceiptAlreadyIssued = 233, - SignalErrorCodeTooManyTotpKeys = 234, - SignalErrorCodeTooManyMfaKeys = 235, - SignalErrorCodeOneTimePasswordNotVerified = 236, - SignalErrorCodeMfaKeyNotFound = 237, + SignalErrorCodeUsernameDiscriminatorCannotBeEmpty = 140, + SignalErrorCodeUsernameDiscriminatorCannotBeZero = 141, + SignalErrorCodeUsernameDiscriminatorCannotBeSingleDigit = 142, + SignalErrorCodeUsernameDiscriminatorCannotHaveLeadingZeros = 143, + SignalErrorCodeUsernameDiscriminatorTooLarge = 144, + SignalErrorCodeIoError = 130, + SignalErrorCodeInvalidMediaInput = 131, + SignalErrorCodeUnsupportedMediaInput = 132, } SignalErrorCode; -static_assert_64bit(sizeof(SignalErrorCode) == 4); -static_assert_64bit(alignof(SignalErrorCode) == 4); -typedef enum { - SignalChallengeOptionPushChallenge, - SignalChallengeOptionCaptcha, -} SignalChallengeOption; -static_assert_64bit(sizeof(SignalChallengeOption) == 4); -static_assert_64bit(alignof(SignalChallengeOption) == 4); -typedef enum { - SignalIdentityChangeNewOrUnchanged, - SignalIdentityChangeReplacedExisting, -} SignalIdentityChange; -static_assert_64bit(sizeof(SignalIdentityChange) == 4); -static_assert_64bit(alignof(SignalIdentityChange) == 4); -enum SignalSvr2CredentialsResult { - SignalSvr2CredentialsResultMatch, - SignalSvr2CredentialsResultNoMatch, - SignalSvr2CredentialsResultInvalid, -}; -typedef uint8_t SignalSvr2CredentialsResult; -static_assert_64bit(sizeof(SignalSvr2CredentialsResult) == 1); -static_assert_64bit(alignof(SignalSvr2CredentialsResult) == 1); + +/** + * A wrapper around [`ctr::Ctr32BE`] that uses a smaller nonce and supports an initial counter. + */ +typedef struct SignalAes256Ctr32 SignalAes256Ctr32; + +typedef struct SignalAes256GcmDecryption SignalAes256GcmDecryption; + +typedef struct SignalAes256GcmEncryption SignalAes256GcmEncryption; + +typedef struct SignalAes256GcmSiv SignalAes256GcmSiv; + +typedef struct SignalCiphertextMessage SignalCiphertextMessage; + +typedef struct SignalDecryptionErrorMessage SignalDecryptionErrorMessage; + +typedef struct SignalFingerprint SignalFingerprint; + +typedef struct SignalHsmEnclaveClient SignalHsmEnclaveClient; + +typedef struct SignalIncrementalMac SignalIncrementalMac; + +typedef struct SignalKeyPair SignalKeyPair; + +typedef struct SignalKeySecret SignalKeySecret; + +typedef struct SignalKyberPreKeyRecord SignalKyberPreKeyRecord; + +typedef struct SignalNonSuspendingBackgroundThreadRuntime SignalNonSuspendingBackgroundThreadRuntime; + +typedef struct SignalOtherTestingHandleType SignalOtherTestingHandleType; + +typedef struct SignalPinHash SignalPinHash; + +typedef struct SignalPlaintextContent SignalPlaintextContent; + +typedef struct SignalPreKeyBundle SignalPreKeyBundle; + +typedef struct SignalPreKeyRecord SignalPreKeyRecord; + +typedef struct SignalPreKeySignalMessage SignalPreKeySignalMessage; + +typedef struct SignalPrivateKey SignalPrivateKey; + +/** + * Represents a unique Signal client instance as `(, )` pair. + */ +typedef struct SignalProtocolAddress SignalProtocolAddress; + +typedef struct SignalPublicKey SignalPublicKey; + +/** + * Sanitized metadata returned by the sanitizer. + */ +typedef struct SignalSanitizedMetadata SignalSanitizedMetadata; + +typedef struct SignalSenderCertificate SignalSenderCertificate; + +typedef struct SignalSenderKeyDistributionMessage SignalSenderKeyDistributionMessage; + +typedef struct SignalSenderKeyMessage SignalSenderKeyMessage; + +typedef struct SignalSenderKeyRecord SignalSenderKeyRecord; + +typedef struct SignalServerCertificate SignalServerCertificate; + +typedef struct SignalSessionRecord SignalSessionRecord; + +typedef struct SignalSgxClientState SignalSgxClientState; + +/** + * The top-level error type (opaquely) returned to C clients when something goes wrong. + */ +typedef struct SignalFfiError SignalFfiError; + +typedef struct SignalMessage SignalMessage; + +typedef struct SignalSignedPreKeyRecord SignalSignedPreKeyRecord; + +typedef struct SignalTestingHandleType SignalTestingHandleType; + +typedef struct SignalUnidentifiedSenderMessageContent SignalUnidentifiedSenderMessageContent; + +typedef struct SignalValidatingMac SignalValidatingMac; + typedef struct { - bool user_satisfied; - SignalBorrowedSliceOfCStringPtr call_quality_issues; - const int8_t* additional_issues_description; - const int8_t* debug_log_url; - uint64_t start_timestamp; - uint64_t end_timestamp; - const int8_t* call_type; - bool success; - const int8_t* call_end_reason; - SignalOptionalOff32 connection_rtt_median; - SignalOptionalOff32 audio_rtt_median; - SignalOptionalOff32 video_rtt_median; - SignalOptionalOff32 audio_recv_jitter_median; - SignalOptionalOff32 video_recv_jitter_median; - SignalOptionalOff32 audio_send_jitter_median; - SignalOptionalOff32 video_send_jitter_median; - SignalOptionalOff32 audio_recv_packet_loss_fraction; - SignalOptionalOff32 video_recv_packet_loss_fraction; - SignalOptionalOff32 audio_send_packet_loss_fraction; - SignalOptionalOff32 video_send_packet_loss_fraction; - SignalOptionalOfBorrowedBuffer call_telemetry; - SignalOptionalOfBorrowedBuffer call_id_hash; -} SignalCallQualitySurveyInternalFfiArg; -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, user_satisfied) == 0); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, call_quality_issues) == 8); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, additional_issues_description) == 24); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, debug_log_url) == 32); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, start_timestamp) == 40); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, end_timestamp) == 48); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, call_type) == 56); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, success) == 64); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, call_end_reason) == 72); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, connection_rtt_median) == 80); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, audio_rtt_median) == 88); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, video_rtt_median) == 96); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, audio_recv_jitter_median) == 104); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, video_recv_jitter_median) == 112); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, audio_send_jitter_median) == 120); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, video_send_jitter_median) == 128); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, audio_recv_packet_loss_fraction) == 136); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, video_recv_packet_loss_fraction) == 144); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, audio_send_packet_loss_fraction) == 152); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, video_send_packet_loss_fraction) == 160); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, call_telemetry) == 168); -static_assert_64bit(offsetof(SignalCallQualitySurveyInternalFfiArg, call_id_hash) == 192); -static_assert_64bit(sizeof(SignalCallQualitySurveyInternalFfiArg) == 216); -static_assert_64bit(alignof(SignalCallQualitySurveyInternalFfiArg) == 8); -typedef enum { - SignalPaymentProviderFfiArgGooglePlayBilling, - SignalPaymentProviderFfiArgAppleAppStore, - SignalPaymentProviderFfiArgStripe, - SignalPaymentProviderFfiArgBraintree, -} SignalPaymentProviderFfiArg; -static_assert_64bit(sizeof(SignalPaymentProviderFfiArg) == 4); -static_assert_64bit(alignof(SignalPaymentProviderFfiArg) == 4); -typedef enum { - SignalCiphertextMessageTypeWhisper = 2, - SignalCiphertextMessageTypePreKey = 3, - SignalCiphertextMessageTypeSenderKey = 7, - SignalCiphertextMessageTypePlaintext = 8, -} SignalCiphertextMessageType; -static_assert_64bit(sizeof(SignalCiphertextMessageType) == 4); -static_assert_64bit(alignof(SignalCiphertextMessageType) == 4); -typedef enum { - SignalContentHintDefault, - SignalContentHintResendable, - SignalContentHintImplicit, -} SignalContentHint; -static_assert_64bit(sizeof(SignalContentHint) == 4); -static_assert_64bit(alignof(SignalContentHint) == 4); -typedef enum { - SignalDirectionSending, - SignalDirectionReceiving, -} SignalDirection; -static_assert_64bit(sizeof(SignalDirection) == 4); -static_assert_64bit(alignof(SignalDirection) == 4); + const unsigned char *base; + size_t length; +} SignalBorrowedBuffer; + typedef struct { - void* ctx; - SignalType_FunctionPointer_int32_t_MutPointer_void_SignalLogLevel_SignalCStringPtr_uint32_t_SignalCStringPtr log; - SignalType_FunctionPointer_int32_t_MutPointer_void flush; - SignalType_FunctionPointer_void_MutPointer_void destroy; -} SignalFfiLoggerStruct; -static_assert_64bit(offsetof(SignalFfiLoggerStruct, ctx) == 0); -static_assert_64bit(offsetof(SignalFfiLoggerStruct, log) == 8); -static_assert_64bit(offsetof(SignalFfiLoggerStruct, flush) == 16); -static_assert_64bit(offsetof(SignalFfiLoggerStruct, destroy) == 24); -static_assert_64bit(sizeof(SignalFfiLoggerStruct) == 32); -static_assert_64bit(alignof(SignalFfiLoggerStruct) == 8); -SignalFfiError* signal_account_entropy_pool_derive_backup_key( - SignalType_FixedArray32_uint8_t* out, - const int8_t* account_entropy -); -SignalFfiError* signal_account_entropy_pool_derive_svr_key( - SignalType_FixedArray32_uint8_t* out, - const int8_t* account_entropy -); -SignalFfiError* signal_account_entropy_pool_generate( - SignalCStringPtr* out -); -SignalFfiError* signal_account_entropy_pool_is_valid( - bool* out, - const int8_t* account_entropy -); -SignalFfiError* signal_address_clone( - SignalMutPointerProtocolAddress* new_obj, - SignalConstPointerProtocolAddress obj -); -SignalFfiError* signal_address_destroy( - SignalMutPointerProtocolAddress p -); -SignalFfiError* signal_address_get_device_id( - uint32_t* out, - SignalConstPointerProtocolAddress obj -); -SignalFfiError* signal_address_get_name( - SignalCStringPtr* out, - SignalConstPointerProtocolAddress obj -); -SignalFfiError* signal_address_new( - SignalMutPointerProtocolAddress* out, - const int8_t* name, - uint32_t device_id -); -SignalFfiError* signal_aes256_ctr32_destroy( - SignalMutPointerAes256Ctr32 p -); -SignalFfiError* signal_aes256_ctr32_new( - SignalMutPointerAes256Ctr32* out, - SignalBorrowedBuffer key, - SignalBorrowedBuffer nonce, - uint32_t initial_ctr -); -SignalFfiError* signal_aes256_ctr32_process( - SignalMutPointerAes256Ctr32 ctr, - SignalBorrowedMutableBuffer data, - uint32_t offset, - uint32_t length -); -SignalFfiError* signal_aes256_gcm_decryption_destroy( - SignalMutPointerAes256GcmDecryption p -); -SignalFfiError* signal_aes256_gcm_decryption_new( - SignalMutPointerAes256GcmDecryption* out, - SignalBorrowedBuffer key, - SignalBorrowedBuffer nonce, - SignalBorrowedBuffer associated_data -); -SignalFfiError* signal_aes256_gcm_decryption_update( - SignalMutPointerAes256GcmDecryption gcm, - SignalBorrowedMutableBuffer data, - uint32_t offset, - uint32_t length -); -SignalFfiError* signal_aes256_gcm_decryption_verify_tag( - bool* out, - SignalMutPointerAes256GcmDecryption gcm, - SignalBorrowedBuffer tag -); -SignalFfiError* signal_aes256_gcm_encryption_compute_tag( - SignalOwnedBuffer* out, - SignalMutPointerAes256GcmEncryption gcm -); -SignalFfiError* signal_aes256_gcm_encryption_destroy( - SignalMutPointerAes256GcmEncryption p -); -SignalFfiError* signal_aes256_gcm_encryption_new( - SignalMutPointerAes256GcmEncryption* out, - SignalBorrowedBuffer key, - SignalBorrowedBuffer nonce, - SignalBorrowedBuffer associated_data -); -SignalFfiError* signal_aes256_gcm_encryption_update( - SignalMutPointerAes256GcmEncryption gcm, - SignalBorrowedMutableBuffer data, - uint32_t offset, - uint32_t length -); -SignalFfiError* signal_aes256_gcm_siv_decrypt( - SignalOwnedBuffer* out, - SignalConstPointerAes256GcmSiv aes_gcm_siv, - SignalBorrowedBuffer ctext, - SignalBorrowedBuffer nonce, - SignalBorrowedBuffer associated_data -); -SignalFfiError* signal_aes256_gcm_siv_destroy( - SignalMutPointerAes256GcmSiv p -); -SignalFfiError* signal_aes256_gcm_siv_encrypt( - SignalOwnedBuffer* out, - SignalConstPointerAes256GcmSiv aes_gcm_siv_obj, - SignalBorrowedBuffer ptext, - SignalBorrowedBuffer nonce, - SignalBorrowedBuffer associated_data -); -SignalFfiError* signal_aes256_gcm_siv_new( - SignalMutPointerAes256GcmSiv* out, - SignalBorrowedBuffer key -); -SignalFfiError* signal_auth_credential_presentation_check_valid_contents( - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_auth_credential_presentation_get_pni_ciphertext( - SignalType_FixedArray65_uint8_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_auth_credential_presentation_get_redemption_time( - uint64_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_auth_credential_presentation_get_uuid_ciphertext( - SignalType_FixedArray65_uint8_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_auth_credential_with_pni_check_valid_contents( - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_auth_credential_with_pni_response_check_valid_contents( - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_authenticated_chat_connection_clear_push_token( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_clear_registration_lock( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_confirm_totp_key( - SignalCPromisei32* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - int32_t one_time_password, - const int8_t* name, - uint64_t created_at, - const SignalType_FixedArray32_uint8_t* svr_key, - int64_t rng -); -SignalFfiError* signal_authenticated_chat_connection_confirm_username( - SignalCPromiseUuid* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - const int8_t* username, - SignalBorrowedBuffer username_ciphertext, - int64_t rng -); -SignalFfiError* signal_authenticated_chat_connection_connect( - SignalCPromiseMutPointerAuthenticatedChatConnection* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerConnectionManager connection_manager, - const int8_t* username, - const int8_t* password, - bool receive_stories, - SignalBorrowedBytestringArray languages -); -SignalFfiError* signal_authenticated_chat_connection_delete_account( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_delete_username_hash( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_delete_username_link( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_destroy( - SignalMutPointerAuthenticatedChatConnection p -); -SignalFfiError* signal_authenticated_chat_connection_disconnect( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_generate_totp_key( - SignalCPromiseBridgePendingTotpKeyFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_get_currency_conversions( - SignalCPromiseCurrencyConversionsInternalFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_get_devices( - SignalCPromiseOwnedBufferOfMaxAlignedLinkedDeviceInternalFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_get_pre_key_count( - SignalCPromiseBridgePreKeyCountsFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat -); -SignalFfiError* signal_authenticated_chat_connection_get_sticker_upload_forms( - SignalCPromiseGetStickerUploadFormsResponseFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - int32_t number_of_stickers -); -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 -); -SignalFfiError* signal_authenticated_chat_connection_list_mfa_keys( - SignalCPromiseOwnedBufferOfMaxAlignedBridgeConfirmedMfaKeyFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - const SignalType_FixedArray32_uint8_t* svr_key -); -SignalFfiError* signal_authenticated_chat_connection_preconnect( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerConnectionManager connection_manager -); -SignalFfiError* signal_authenticated_chat_connection_redeem_backup_receipt( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - const SignalType_FixedArray329_uint8_t* presentation -); -SignalFfiError* signal_authenticated_chat_connection_remove_device( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - uint8_t device_id -); -SignalFfiError* signal_authenticated_chat_connection_remove_mfa_key( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - int32_t key_id -); -SignalFfiError* signal_authenticated_chat_connection_reserve_username_hash( - SignalCPromisec_uchar32* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - SignalBorrowedSliceOfc_uchar32 username_hashes -); -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 SignalType_FixedArray17_uint8_t* 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_authenticated_chat_connection_set_capabilities( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - SignalBorrowedSliceOfDeviceCapabilityInternalFfiArg capabilities -); -SignalFfiError* signal_authenticated_chat_connection_set_device_name( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - uint8_t device_id, - SignalBorrowedBuffer encrypted_name -); -SignalFfiError* signal_authenticated_chat_connection_set_discoverable_by_phone_number( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - bool discoverable -); -SignalFfiError* signal_authenticated_chat_connection_set_mfa_key_metadata( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - int32_t key_id, - const int8_t* name, - uint64_t created_at, - const SignalType_FixedArray32_uint8_t* svr_key, - int64_t rng -); -SignalFfiError* signal_authenticated_chat_connection_set_push_token_apns( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - const int8_t* apns_token -); -SignalFfiError* signal_authenticated_chat_connection_set_registration_lock( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - const SignalType_FixedArray32_uint8_t* svr_key -); -SignalFfiError* signal_authenticated_chat_connection_set_registration_recovery_password( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - const SignalType_FixedArray32_uint8_t* svr_key -); -SignalFfiError* signal_authenticated_chat_connection_set_username_link( - SignalCPromiseUuid* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerAuthenticatedChatConnection chat, - SignalBorrowedBuffer username_ciphertext, - bool keep_link_handle -); -SignalFfiError* signal_avatar_upload_credential_check_valid_contents( - SignalBorrowedBuffer credential_bytes -); -SignalFfiError* signal_avatar_upload_credential_get_cm( - SignalType_FixedArray32_uint8_t* out, - SignalBorrowedBuffer credential_bytes -); -SignalFfiError* signal_avatar_upload_credential_get_redemption_time( - uint64_t* out, - SignalBorrowedBuffer credential_bytes -); -SignalFfiError* signal_avatar_upload_credential_present_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer credential_bytes, - SignalBorrowedBuffer server_params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_avatar_upload_credential_presentation_check_valid_contents( - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_avatar_upload_credential_presentation_get_cm( - SignalType_FixedArray32_uint8_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_avatar_upload_credential_presentation_get_redemption_time( - uint64_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_avatar_upload_credential_presentation_verify( - SignalBorrowedBuffer presentation_bytes, - uint64_t current_time, - SignalBorrowedBuffer server_params_bytes -); -SignalFfiError* signal_avatar_upload_credential_request_check_valid_contents( - SignalBorrowedBuffer request_bytes -); -SignalFfiError* signal_avatar_upload_credential_request_context_check_valid_contents( - SignalBorrowedBuffer context_bytes -); -SignalFfiError* signal_avatar_upload_credential_request_context_get_request( - SignalOwnedBuffer* out, - SignalBorrowedBuffer context_bytes -); -SignalFfiError* signal_avatar_upload_credential_request_context_new( - SignalOwnedBuffer* out, - const SignalType_FixedArray17_uint8_t* aci, - SignalBorrowedBuffer zk_credential_key_pair_bytes, - uint64_t rotation_id, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_avatar_upload_credential_request_context_receive_response( - SignalOwnedBuffer* out, - SignalBorrowedBuffer context_bytes, - SignalBorrowedBuffer response_bytes, - uint64_t current_time, - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_avatar_upload_credential_request_issue_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer request_bytes, - const SignalType_FixedArray17_uint8_t* aci, - SignalBorrowedBuffer zk_credential_key_pub_bytes, - uint64_t rotation_id, - uint64_t redemption_time, - SignalBorrowedBuffer params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_avatar_upload_credential_response_check_valid_contents( - SignalBorrowedBuffer response_bytes -); -SignalFfiError* signal_backup_auth_credential_check_valid_contents( - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_backup_auth_credential_get_backup_id( - SignalType_FixedArray16_uint8_t* out, - SignalBorrowedBuffer credential_bytes -); -SignalFfiError* signal_backup_auth_credential_get_backup_level( - uint8_t* out, - SignalBorrowedBuffer credential_bytes -); -SignalFfiError* signal_backup_auth_credential_get_type( - uint8_t* out, - SignalBorrowedBuffer credential_bytes -); -SignalFfiError* signal_backup_auth_credential_present_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer credential_bytes, - SignalBorrowedBuffer server_params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_backup_auth_credential_presentation_check_valid_contents( - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_backup_auth_credential_presentation_verify( - SignalBorrowedBuffer presentation_bytes, - uint64_t now, - SignalBorrowedBuffer server_params_bytes -); -SignalFfiError* signal_backup_auth_credential_request_check_valid_contents( - SignalBorrowedBuffer request_bytes -); -SignalFfiError* signal_backup_auth_credential_request_context_check_valid_contents( - SignalBorrowedBuffer context_bytes -); -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 SignalType_FixedArray32_uint8_t* backup_key, - SignalUuid uuid -); -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 -); -SignalFfiError* signal_backup_auth_credential_request_issue_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer request_bytes, - uint64_t redemption_time, - uint8_t backup_level, - uint8_t credential_type, - SignalBorrowedBuffer params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_backup_auth_credential_response_check_valid_contents( - SignalBorrowedBuffer response_bytes -); -SignalFfiError* signal_backup_key_derive_backup_id( - SignalType_FixedArray16_uint8_t* out, - const SignalType_FixedArray32_uint8_t* backup_key, - const SignalType_FixedArray17_uint8_t* aci -); -SignalFfiError* signal_backup_key_derive_ec_key( - SignalMutPointerPrivateKey* out, - const SignalType_FixedArray32_uint8_t* backup_key, - const SignalType_FixedArray17_uint8_t* aci -); -SignalFfiError* signal_backup_key_derive_local_backup_metadata_key( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray32_uint8_t* backup_key -); -SignalFfiError* signal_backup_key_derive_media_encryption_key( - SignalType_FixedArray64_uint8_t* out, - const SignalType_FixedArray32_uint8_t* backup_key, - const SignalType_FixedArray15_uint8_t* media_id -); -SignalFfiError* signal_backup_key_derive_media_id( - SignalType_FixedArray15_uint8_t* out, - const SignalType_FixedArray32_uint8_t* backup_key, - const int8_t* media_name -); -SignalFfiError* signal_backup_key_derive_thumbnail_transit_encryption_key( - SignalType_FixedArray64_uint8_t* out, - const SignalType_FixedArray32_uint8_t* backup_key, - const SignalType_FixedArray15_uint8_t* media_id -); -SignalFfiError* signal_backup_restore_response_destroy( - SignalMutPointerBackupRestoreResponse p -); -SignalFfiError* signal_backup_restore_response_get_forward_secrecy_token( - SignalType_FixedArray32_uint8_t* out, - SignalConstPointerBackupRestoreResponse response -); -SignalFfiError* signal_backup_restore_response_get_next_backup_secret_data( - SignalOwnedBuffer* out, - SignalConstPointerBackupRestoreResponse response -); -SignalFfiError* signal_backup_store_response_destroy( - SignalMutPointerBackupStoreResponse p -); -SignalFfiError* signal_backup_store_response_get_forward_secrecy_token( - SignalType_FixedArray32_uint8_t* out, - SignalConstPointerBackupStoreResponse response -); -SignalFfiError* signal_backup_store_response_get_next_backup_secret_data( - SignalOwnedBuffer* out, - SignalConstPointerBackupStoreResponse response -); -SignalFfiError* signal_backup_store_response_get_opaque_metadata( - SignalOwnedBuffer* out, - SignalConstPointerBackupStoreResponse response -); -SignalFfiError* signal_bridged_string_map_clone( - SignalMutPointerBridgedStringMap* new_obj, - SignalConstPointerBridgedStringMap obj -); -SignalFfiError* signal_bridged_string_map_destroy( - SignalMutPointerBridgedStringMap p -); -SignalFfiError* signal_bridged_string_map_insert( - SignalMutPointerBridgedStringMap map, - const int8_t* key, - const int8_t* value -); -SignalFfiError* signal_bridged_string_map_new( - SignalMutPointerBridgedStringMap* out, - uint32_t initial_capacity -); -SignalFfiError* signal_call_link_auth_credential_check_valid_contents( - SignalBorrowedBuffer credential_bytes -); -SignalFfiError* signal_call_link_auth_credential_present_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer credential_bytes, - const SignalType_FixedArray17_uint8_t* user_id, - uint64_t redemption_time, - SignalBorrowedBuffer server_params_bytes, - SignalBorrowedBuffer call_link_params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_call_link_auth_credential_presentation_check_valid_contents( - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_call_link_auth_credential_presentation_get_user_id( - SignalType_FixedArray65_uint8_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_call_link_auth_credential_presentation_verify( - SignalBorrowedBuffer presentation_bytes, - uint64_t now, - SignalBorrowedBuffer server_params_bytes, - SignalBorrowedBuffer call_link_params_bytes -); -SignalFfiError* signal_call_link_auth_credential_response_check_valid_contents( - SignalBorrowedBuffer response_bytes -); -SignalFfiError* signal_call_link_auth_credential_response_issue_deterministic( - SignalOwnedBuffer* out, - const SignalType_FixedArray17_uint8_t* user_id, - uint64_t redemption_time, - SignalBorrowedBuffer params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_call_link_auth_credential_response_receive( - SignalOwnedBuffer* out, - SignalBorrowedBuffer response_bytes, - const SignalType_FixedArray17_uint8_t* user_id, - uint64_t redemption_time, - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_call_link_public_params_check_valid_contents( - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_call_link_secret_params_check_valid_contents( - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_call_link_secret_params_decrypt_user_id( - SignalType_FixedArray17_uint8_t* out, - SignalBorrowedBuffer params_bytes, - const SignalType_FixedArray65_uint8_t* user_id -); -SignalFfiError* signal_call_link_secret_params_derive_from_root_key( - SignalOwnedBuffer* out, - SignalBorrowedBuffer root_key -); -SignalFfiError* signal_call_link_secret_params_encrypt_user_id( - SignalType_FixedArray65_uint8_t* out, - SignalBorrowedBuffer params_bytes, - const SignalType_FixedArray17_uint8_t* user_id -); -SignalFfiError* signal_call_link_secret_params_get_public_params( - SignalOwnedBuffer* out, - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_cds2_client_state_new( - SignalMutPointerSgxClientState* out, - SignalBorrowedBuffer mrenclave, - SignalBorrowedBuffer attestation_msg, - uint64_t current_timestamp -); -SignalFfiError* signal_cdsi_lookup_complete( - SignalCPromiseFfiCdsiLookupResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerCdsiLookup lookup -); -SignalFfiError* signal_cdsi_lookup_destroy( - SignalMutPointerCdsiLookup p -); -SignalFfiError* signal_cdsi_lookup_new( - SignalCPromiseMutPointerCdsiLookup* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerConnectionManager connection_manager, - const int8_t* username, - const int8_t* password, - SignalConstPointerLookupRequest request -); -SignalFfiError* signal_cdsi_lookup_token( - SignalOwnedBuffer* out, - SignalConstPointerCdsiLookup lookup -); -SignalFfiError* signal_chat_connection_info_description( - SignalCStringPtr* out, - SignalConstPointerChatConnectionInfo connection_info -); -SignalFfiError* signal_chat_connection_info_destroy( - SignalMutPointerChatConnectionInfo p -); -SignalFfiError* signal_chat_connection_info_ip_version( - uint8_t* out, - SignalConstPointerChatConnectionInfo connection_info -); -SignalFfiError* signal_chat_connection_info_local_port( - uint16_t* out, - SignalConstPointerChatConnectionInfo connection_info -); -SignalFfiError* signal_ciphertext_message_destroy( - SignalMutPointerCiphertextMessage p -); -SignalFfiError* signal_ciphertext_message_from_plaintext_content( - SignalMutPointerCiphertextMessage* out, - SignalConstPointerPlaintextContent m -); -SignalFfiError* signal_ciphertext_message_serialize( - SignalOwnedBuffer* out, - SignalConstPointerCiphertextMessage obj -); -SignalFfiError* signal_ciphertext_message_type( - uint8_t* out, - SignalConstPointerCiphertextMessage msg -); -SignalFfiError* signal_connection_manager_clear_proxy( - SignalConstPointerConnectionManager connection_manager -); -SignalFfiError* signal_connection_manager_destroy( - SignalMutPointerConnectionManager p -); -SignalFfiError* signal_connection_manager_new( - SignalMutPointerConnectionManager* out, - uint8_t environment, - const int8_t* user_agent, - SignalMutPointerBridgedStringMap remote_config, - uint8_t build_variant -); -SignalFfiError* signal_connection_manager_on_network_change( - SignalConstPointerConnectionManager connection_manager -); -SignalFfiError* signal_connection_manager_set_censorship_circumvention_enabled( - SignalConstPointerConnectionManager connection_manager, - bool enabled -); -SignalFfiError* signal_connection_manager_set_invalid_proxy( - SignalConstPointerConnectionManager connection_manager -); -SignalFfiError* signal_connection_manager_set_proxy( - SignalConstPointerConnectionManager connection_manager, - SignalConstPointerConnectionProxyConfig proxy -); -SignalFfiError* signal_connection_manager_set_remote_config( - SignalConstPointerConnectionManager connection_manager, - SignalMutPointerBridgedStringMap remote_config, - uint8_t build_variant -); -SignalFfiError* signal_connection_proxy_config_clone( - SignalMutPointerConnectionProxyConfig* new_obj, - SignalConstPointerConnectionProxyConfig obj -); -SignalFfiError* signal_connection_proxy_config_destroy( - SignalMutPointerConnectionProxyConfig p -); -SignalFfiError* signal_connection_proxy_config_new( - SignalMutPointerConnectionProxyConfig* out, - const int8_t* scheme, - const int8_t* host, - int32_t port, - const int8_t* username, - const int8_t* password -); -SignalFfiError* signal_copy_backup_media_stream_cancel( - SignalConstPointerCopyBackupMediaStream stream -); -SignalFfiError* signal_copy_backup_media_stream_destroy( - SignalMutPointerCopyBackupMediaStream p -); -SignalFfiError* signal_copy_backup_media_stream_next( - SignalCPromiseCopyBackupMediaNextChunkFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerCopyBackupMediaStream stream -); -SignalFfiError* signal_create_call_link_credential_check_valid_contents( - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_create_call_link_credential_present_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer credential_bytes, - SignalBorrowedBuffer room_id, - const SignalType_FixedArray17_uint8_t* user_id, - SignalBorrowedBuffer server_params_bytes, - SignalBorrowedBuffer call_link_params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_create_call_link_credential_presentation_check_valid_contents( - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_create_call_link_credential_presentation_verify( - SignalBorrowedBuffer presentation_bytes, - SignalBorrowedBuffer room_id, - uint64_t now, - SignalBorrowedBuffer server_params_bytes, - SignalBorrowedBuffer call_link_params_bytes -); -SignalFfiError* signal_create_call_link_credential_request_check_valid_contents( - SignalBorrowedBuffer request_bytes -); -SignalFfiError* signal_create_call_link_credential_request_context_check_valid_contents( - SignalBorrowedBuffer context_bytes -); -SignalFfiError* signal_create_call_link_credential_request_context_get_request( - SignalOwnedBuffer* out, - SignalBorrowedBuffer context_bytes -); -SignalFfiError* signal_create_call_link_credential_request_context_new_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer room_id, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_create_call_link_credential_request_context_receive_response( - SignalOwnedBuffer* out, - SignalBorrowedBuffer context_bytes, - SignalBorrowedBuffer response_bytes, - const SignalType_FixedArray17_uint8_t* user_id, - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_create_call_link_credential_request_issue_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer request_bytes, - const SignalType_FixedArray17_uint8_t* user_id, - uint64_t timestamp, - SignalBorrowedBuffer params_bytes, - const SignalType_FixedArray32_uint8_t* randomness -); -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_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_decryption_error_message_clone( - SignalMutPointerDecryptionErrorMessage* new_obj, - SignalConstPointerDecryptionErrorMessage obj -); -SignalFfiError* signal_decryption_error_message_deserialize( - SignalMutPointerDecryptionErrorMessage* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_decryption_error_message_destroy( - SignalMutPointerDecryptionErrorMessage p -); -SignalFfiError* signal_decryption_error_message_extract_from_serialized_content( - SignalMutPointerDecryptionErrorMessage* out, - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_decryption_error_message_for_original_message( - SignalMutPointerDecryptionErrorMessage* out, - SignalBorrowedBuffer original_bytes, - uint8_t original_type, - uint64_t original_timestamp, - uint32_t original_sender_device_id -); -SignalFfiError* signal_decryption_error_message_get_device_id( - uint32_t* out, - SignalConstPointerDecryptionErrorMessage obj -); -SignalFfiError* signal_decryption_error_message_get_ratchet_key( - SignalMutPointerPublicKey* out, - SignalConstPointerDecryptionErrorMessage m -); -SignalFfiError* signal_decryption_error_message_get_timestamp( - uint64_t* out, - SignalConstPointerDecryptionErrorMessage obj -); -SignalFfiError* signal_decryption_error_message_serialize( - SignalOwnedBuffer* out, - SignalConstPointerDecryptionErrorMessage obj -); -SignalFfiError* signal_delete_backup_media_stream_cancel( - SignalConstPointerDeleteBackupMediaStream stream -); -SignalFfiError* signal_delete_backup_media_stream_destroy( - SignalMutPointerDeleteBackupMediaStream p -); -SignalFfiError* signal_delete_backup_media_stream_next( - SignalCPromiseDeleteBackupMediaNextChunkFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerDeleteBackupMediaStream stream -); -SignalFfiError* signal_device_transfer_generate_certificate( - SignalOwnedBuffer* out, - SignalBorrowedBuffer private_key, - const int8_t* name, - uint32_t days_to_expire -); -SignalFfiError* signal_device_transfer_generate_private_key( - SignalOwnedBuffer* out -); -SignalFfiError* signal_device_transfer_generate_private_key_with_format( - SignalOwnedBuffer* out, - uint8_t key_format -); -SignalFfiError* signal_donation_permit_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_donation_permit_derived_key_pair_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_donation_permit_derived_key_pair_for_expiration( - SignalOwnedBuffer* out, - uint64_t timestamp, - SignalConstPointerServerSecretParams root -); -SignalFfiError* signal_donation_permit_expiration( - uint64_t* out, - SignalBorrowedBuffer donation_permit -); -SignalFfiError* signal_donation_permit_request_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_donation_permit_request_context_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_donation_permit_request_context_new_deterministic( - SignalOwnedBuffer* out, - int32_t count, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_donation_permit_request_context_receive( - SignalBytestringArray* out, - SignalBorrowedBuffer context, - SignalBorrowedBuffer response, - SignalConstPointerServerPublicParams public_params, - uint64_t now -); -SignalFfiError* signal_donation_permit_request_context_request( - SignalOwnedBuffer* out, - SignalBorrowedBuffer ctx -); -SignalFfiError* signal_donation_permit_request_len( - int32_t* out, - SignalBorrowedBuffer donation_permit_request -); -SignalFfiError* signal_donation_permit_response_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_donation_permit_response_default_expiration( - uint64_t* out, - uint64_t current_time -); -SignalFfiError* signal_donation_permit_response_get_expiration( - uint64_t* out, - SignalBorrowedBuffer response -); -SignalFfiError* signal_donation_permit_response_issue_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer request, - SignalBorrowedBuffer key_pair, - const SignalType_FixedArray32_uint8_t* seed -); -SignalFfiError* signal_donation_permit_spend_id( - SignalOwnedBuffer* out, - SignalBorrowedBuffer donation_permit -); -SignalFfiError* signal_donation_permit_verify( - SignalBorrowedBuffer permit, - uint64_t now, - SignalBorrowedBuffer key_pair -); -SignalFfiError* signal_encrypt_message( - SignalMutPointerCiphertextMessage* out, - SignalBorrowedBuffer ptext, - SignalConstPointerProtocolAddress protocol_address, - SignalConstPointerProtocolAddress local_address, - SignalConstPointerFfiSessionStoreStruct session_store, - SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store, - uint64_t now -); -void signal_error_free( - SignalFfiError* err -); -SignalFfiError* signal_error_get_address( - SignalMutPointerProtocolAddress* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_charge_failure( - SignalOptionalOfChargeFailureFfiResult* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_invalid_protocol_address( - SignalPairOfCStringPtru32* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_message( - SignalCStringPtr* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_mismatched_device_errors( - SignalOwnedBufferOfFfiMismatchedDevicesError* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_our_fingerprint_version( - uint32_t* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_rate_limit_challenge( - SignalPairOfPairOfCStringPtrOwnedBufferi64* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_registration_error_not_deliverable( - SignalPairOfCStringPtrbool* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_registration_lock( - uint64_t* out_time_remaining_seconds, - SignalPairOfCStringPtrCStringPtr* out_svr2_credentials, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_retry_after_seconds( - uint32_t* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_their_fingerprint_version( - uint32_t* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_tries_remaining( - uint32_t* out, - const SignalFfiError* err -); -uint32_t signal_error_get_type( - const SignalFfiError* err -); -SignalFfiError* signal_error_get_unknown_fields( - SignalBytestringArray* out, - const SignalFfiError* err -); -SignalFfiError* signal_error_get_uuid( - SignalUuid* out, - const SignalFfiError* err -); -SignalFfiError* signal_expiring_profile_key_credential_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_expiring_profile_key_credential_get_expiration_time( - uint64_t* out, - const SignalType_FixedArray153_uint8_t* credential -); -SignalFfiError* signal_expiring_profile_key_credential_response_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_fingerprint_clone( - SignalMutPointerFingerprint* new_obj, - SignalConstPointerFingerprint obj -); -SignalFfiError* signal_fingerprint_compare( - bool* out, - SignalBorrowedBuffer fprint1, - SignalBorrowedBuffer fprint2 -); -SignalFfiError* signal_fingerprint_destroy( - SignalMutPointerFingerprint p -); -SignalFfiError* signal_fingerprint_display_string( - SignalCStringPtr* out, - SignalConstPointerFingerprint obj -); -SignalFfiError* signal_fingerprint_new( - SignalMutPointerFingerprint* out, - uint32_t iterations, - uint32_t version, - SignalBorrowedBuffer local_identifier, - SignalConstPointerPublicKey local_key, - SignalBorrowedBuffer remote_identifier, - SignalConstPointerPublicKey remote_key -); -SignalFfiError* signal_fingerprint_scannable_encoding( - SignalOwnedBuffer* out, - SignalConstPointerFingerprint obj -); -void signal_free_buffer( - const uint8_t* 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( - SignalOwnedBufferOfc_uchar17 buffer -); -void signal_free_list_of_strings( - SignalOwnedBufferOfCStringPtr buffer -); -void signal_free_lookup_response_entry_list( - SignalOwnedLookupResponseEntryList buffer -); -void signal_free_outer_buffer_list_of_prekey_bundles( - SignalOwnedBufferOfMutPointerPreKeyBundle buffer -); -void signal_free_owned_buffer_of_max_aligned( - SignalOwnedBufferOfMaxAlignedErased buffer -); -void signal_free_string( - const int8_t* buf -); -SignalFfiError* signal_generic_server_public_params_check_valid_contents( - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_generic_server_secret_params_check_valid_contents( - SignalBorrowedBuffer params_bytes -); -SignalFfiError* signal_generic_server_secret_params_generate_deterministic( - SignalOwnedBuffer* out, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_generic_server_secret_params_get_public_params( - SignalOwnedBuffer* out, - SignalBorrowedBuffer params_bytes -); -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_master_key_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_group_public_params_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_group_public_params_get_group_identifier( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray97_uint8_t* group_public_params -); -SignalFfiError* signal_group_secret_params_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_group_secret_params_decrypt_blob_with_padding( - SignalOwnedBuffer* out, - const SignalType_FixedArray289_uint8_t* params, - SignalBorrowedBuffer ciphertext -); -SignalFfiError* signal_group_secret_params_decrypt_profile_key( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray289_uint8_t* params, - const SignalType_FixedArray65_uint8_t* profile_key, - const SignalType_FixedArray17_uint8_t* user_id -); -SignalFfiError* signal_group_secret_params_decrypt_service_id( - SignalType_FixedArray17_uint8_t* out, - const SignalType_FixedArray289_uint8_t* params, - const SignalType_FixedArray65_uint8_t* ciphertext -); -SignalFfiError* signal_group_secret_params_derive_from_master_key( - SignalType_FixedArray289_uint8_t* out, - const SignalType_FixedArray32_uint8_t* master_key -); -SignalFfiError* signal_group_secret_params_encrypt_blob_with_padding_deterministic( - SignalOwnedBuffer* out, - const SignalType_FixedArray289_uint8_t* params, - const SignalType_FixedArray32_uint8_t* randomness, - SignalBorrowedBuffer plaintext, - uint32_t padding_len -); -SignalFfiError* signal_group_secret_params_encrypt_profile_key( - SignalType_FixedArray65_uint8_t* out, - const SignalType_FixedArray289_uint8_t* params, - const SignalType_FixedArray32_uint8_t* profile_key, - const SignalType_FixedArray17_uint8_t* user_id -); -SignalFfiError* signal_group_secret_params_encrypt_service_id( - SignalType_FixedArray65_uint8_t* out, - const SignalType_FixedArray289_uint8_t* params, - const SignalType_FixedArray17_uint8_t* service_id -); -SignalFfiError* signal_group_secret_params_generate_deterministic( - SignalType_FixedArray289_uint8_t* out, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_group_secret_params_get_master_key( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray289_uint8_t* params -); -SignalFfiError* signal_group_secret_params_get_public_params( - SignalType_FixedArray97_uint8_t* out, - const SignalType_FixedArray289_uint8_t* params -); -SignalFfiError* signal_group_send_derived_key_pair_check_valid_contents( - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_group_send_derived_key_pair_for_expiration( - SignalOwnedBuffer* out, - uint64_t expiration, - SignalConstPointerServerSecretParams server_params -); -SignalFfiError* signal_group_send_endorsement_call_link_params_to_token( - SignalOwnedBuffer* out, - SignalBorrowedBuffer endorsement, - SignalBorrowedBuffer call_link_secret_params_serialized -); -SignalFfiError* signal_group_send_endorsement_check_valid_contents( - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_group_send_endorsement_combine( - SignalOwnedBuffer* out, - SignalBorrowedSliceOfBuffers endorsements -); -SignalFfiError* signal_group_send_endorsement_remove( - SignalOwnedBuffer* out, - SignalBorrowedBuffer endorsement, - SignalBorrowedBuffer to_remove -); -SignalFfiError* signal_group_send_endorsement_to_token( - SignalOwnedBuffer* out, - SignalBorrowedBuffer endorsement, - const SignalType_FixedArray289_uint8_t* group_params -); -SignalFfiError* signal_group_send_endorsements_response_check_valid_contents( - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_group_send_endorsements_response_get_expiration( - uint64_t* out, - SignalBorrowedBuffer response_bytes -); -SignalFfiError* signal_group_send_endorsements_response_issue_deterministic( - SignalOwnedBuffer* out, - SignalBorrowedBuffer concatenated_group_member_ciphertexts, - SignalBorrowedBuffer key_pair, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_group_send_endorsements_response_receive_and_combine_with_ciphertexts( - SignalBytestringArray* out, - SignalBorrowedBuffer response_bytes, - SignalBorrowedBuffer concatenated_group_member_ciphertexts, - SignalBorrowedBuffer local_user_ciphertext, - uint64_t now, - SignalConstPointerServerPublicParams server_params -); -SignalFfiError* signal_group_send_endorsements_response_receive_and_combine_with_service_ids( - SignalBytestringArray* out, - SignalBorrowedBuffer response_bytes, - SignalBorrowedBuffer group_members, - const SignalType_FixedArray17_uint8_t* local_user, - uint64_t now, - const SignalType_FixedArray289_uint8_t* group_params, - SignalConstPointerServerPublicParams server_params -); -SignalFfiError* signal_group_send_full_token_check_valid_contents( - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_group_send_full_token_get_expiration( - uint64_t* out, - SignalBorrowedBuffer token -); -SignalFfiError* signal_group_send_full_token_verify( - SignalBorrowedBuffer token, - SignalBorrowedBuffer user_ids, - uint64_t now, - SignalBorrowedBuffer key_pair -); -SignalFfiError* signal_group_send_token_check_valid_contents( - SignalBorrowedBuffer bytes -); -SignalFfiError* signal_group_send_token_to_full_token( - SignalOwnedBuffer* out, - SignalBorrowedBuffer token, - uint64_t expiration -); -SignalFfiError* signal_hex_encode( - SignalBorrowedMutableBuffer output, - SignalBorrowedBuffer input -); -SignalFfiError* signal_hkdf_derive( - SignalBorrowedMutableBuffer output, - SignalBorrowedBuffer ikm, - SignalBorrowedBuffer label, - SignalBorrowedBuffer salt -); -SignalFfiError* signal_hsm_enclave_client_complete_handshake( - SignalMutPointerHsmEnclaveClient cli, - SignalBorrowedBuffer handshake_received -); -SignalFfiError* signal_hsm_enclave_client_destroy( - SignalMutPointerHsmEnclaveClient p -); -SignalFfiError* signal_hsm_enclave_client_established_recv( - SignalOwnedBuffer* out, - SignalMutPointerHsmEnclaveClient cli, - SignalBorrowedBuffer received_ciphertext -); -SignalFfiError* signal_hsm_enclave_client_established_send( - SignalOwnedBuffer* out, - SignalMutPointerHsmEnclaveClient cli, - SignalBorrowedBuffer plaintext_to_send -); -SignalFfiError* signal_hsm_enclave_client_initial_request( - SignalOwnedBuffer* out, - SignalConstPointerHsmEnclaveClient obj -); -SignalFfiError* signal_hsm_enclave_client_new( - SignalMutPointerHsmEnclaveClient* out, - SignalBorrowedBuffer trusted_public_key, - SignalBorrowedBuffer trusted_code_hashes -); -SignalFfiError* signal_http_request_add_header( - SignalConstPointerHttpRequest request, - const int8_t* name, - const int8_t* value -); -SignalFfiError* signal_http_request_destroy( - SignalMutPointerHttpRequest p -); -SignalFfiError* signal_http_request_new_with_body( - SignalMutPointerHttpRequest* out, - const int8_t* method, - const int8_t* path, - SignalBorrowedBuffer body_as_slice -); -SignalFfiError* signal_http_request_new_without_body( - SignalMutPointerHttpRequest* out, - const int8_t* method, - const int8_t* path -); -SignalFfiError* signal_identitykey_verify_alternate_identity( - bool* out, - SignalConstPointerPublicKey public_key, - SignalConstPointerPublicKey other_identity, - SignalBorrowedBuffer signature -); -SignalFfiError* signal_identitykeypair_deserialize( - SignalPairOfMutPointerPublicKeyMutPointerPrivateKey* out, - SignalBorrowedBuffer input -); -SignalFfiError* signal_identitykeypair_serialize( - SignalOwnedBuffer* out, - SignalConstPointerPublicKey public_key, - SignalConstPointerPrivateKey private_key -); -SignalFfiError* signal_identitykeypair_sign_alternate_identity( - SignalOwnedBuffer* out, - SignalConstPointerPublicKey public_key, - SignalConstPointerPrivateKey private_key, - SignalConstPointerPublicKey other_identity -); -SignalFfiError* signal_incremental_mac_calculate_chunk_size( - uint32_t* out, - uint32_t data_size -); -SignalFfiError* signal_incremental_mac_destroy( - SignalMutPointerIncrementalMac p -); -SignalFfiError* signal_incremental_mac_finalize( - SignalOwnedBuffer* out, - SignalMutPointerIncrementalMac mac -); -SignalFfiError* signal_incremental_mac_initialize( - SignalMutPointerIncrementalMac* out, - SignalBorrowedBuffer key, - uint32_t chunk_size -); -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 -); -SignalFfiError* signal_key_transparency_aci_search_key( - SignalOwnedBuffer* out, - const SignalType_FixedArray17_uint8_t* aci -); -SignalFfiError* signal_key_transparency_check( - SignalCPromisePairOfOwnedBufferOwnedBuffer* promise, - SignalConstPointerTokioAsyncContext async_runtime, - uint8_t environment, - SignalConstPointerUnauthenticatedChatConnection chat_connection, - const SignalType_FixedArray17_uint8_t* aci, - SignalConstPointerPublicKey aci_identity_key, - const int8_t* 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_e164_search_key( - SignalOwnedBuffer* out, - const int8_t* e164 -); -SignalFfiError* signal_key_transparency_reset_data_field( - SignalOwnedBuffer* out, - SignalBorrowedBuffer account_data, - uint8_t field -); -SignalFfiError* signal_key_transparency_username_hash_search_key( - SignalOwnedBuffer* out, - SignalBorrowedBuffer hash -); -SignalFfiError* signal_kyber_key_pair_clone( - SignalMutPointerKyberKeyPair* new_obj, - SignalConstPointerKyberKeyPair obj -); -SignalFfiError* signal_kyber_key_pair_destroy( - SignalMutPointerKyberKeyPair p -); -SignalFfiError* signal_kyber_key_pair_generate( - SignalMutPointerKyberKeyPair* out -); -SignalFfiError* signal_kyber_key_pair_get_public_key( - SignalMutPointerKyberPublicKey* out, - SignalConstPointerKyberKeyPair key_pair -); -SignalFfiError* signal_kyber_key_pair_get_secret_key( - SignalMutPointerKyberSecretKey* out, - SignalConstPointerKyberKeyPair key_pair -); -SignalFfiError* signal_kyber_pre_key_record_clone( - SignalMutPointerKyberPreKeyRecord* new_obj, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_pre_key_record_deserialize( - SignalMutPointerKyberPreKeyRecord* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_kyber_pre_key_record_destroy( - SignalMutPointerKyberPreKeyRecord p -); -SignalFfiError* signal_kyber_pre_key_record_get_id( - uint32_t* out, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_pre_key_record_get_key_pair( - SignalMutPointerKyberKeyPair* out, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_pre_key_record_get_public_key( - SignalMutPointerKyberPublicKey* out, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_pre_key_record_get_secret_key( - SignalMutPointerKyberSecretKey* out, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_pre_key_record_get_signature( - SignalOwnedBuffer* out, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_pre_key_record_get_timestamp( - uint64_t* out, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_pre_key_record_new( - SignalMutPointerKyberPreKeyRecord* out, - uint32_t id, - uint64_t timestamp, - SignalConstPointerKyberKeyPair key_pair, - SignalBorrowedBuffer signature -); -SignalFfiError* signal_kyber_pre_key_record_serialize( - SignalOwnedBuffer* out, - SignalConstPointerKyberPreKeyRecord obj -); -SignalFfiError* signal_kyber_public_key_clone( - SignalMutPointerKyberPublicKey* new_obj, - SignalConstPointerKyberPublicKey obj -); -SignalFfiError* signal_kyber_public_key_deserialize( - SignalMutPointerKyberPublicKey* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_kyber_public_key_destroy( - SignalMutPointerKyberPublicKey p -); -SignalFfiError* signal_kyber_public_key_equals( - bool* out, - SignalConstPointerKyberPublicKey lhs, - SignalConstPointerKyberPublicKey rhs -); -SignalFfiError* signal_kyber_public_key_serialize( - SignalOwnedBuffer* out, - SignalConstPointerKyberPublicKey obj -); -SignalFfiError* signal_kyber_secret_key_clone( - SignalMutPointerKyberSecretKey* new_obj, - SignalConstPointerKyberSecretKey obj -); -SignalFfiError* signal_kyber_secret_key_deserialize( - SignalMutPointerKyberSecretKey* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_kyber_secret_key_destroy( - SignalMutPointerKyberSecretKey p -); -SignalFfiError* signal_kyber_secret_key_serialize( - SignalOwnedBuffer* out, - SignalConstPointerKyberSecretKey obj -); -SignalFfiError* signal_lookup_request_add_aci_and_access_key( - SignalConstPointerLookupRequest request, - const SignalType_FixedArray17_uint8_t* aci, - SignalBorrowedBuffer access_key -); -SignalFfiError* signal_lookup_request_add_e164( - SignalConstPointerLookupRequest request, - const int8_t* e164 -); -SignalFfiError* signal_lookup_request_add_previous_e164( - SignalConstPointerLookupRequest request, - const int8_t* e164 -); -SignalFfiError* signal_lookup_request_destroy( - SignalMutPointerLookupRequest p -); -SignalFfiError* signal_lookup_request_new( - SignalMutPointerLookupRequest* out -); -SignalFfiError* signal_lookup_request_set_token( - SignalConstPointerLookupRequest request, - SignalBorrowedBuffer token -); -SignalFfiError* signal_message_backup_key_destroy( - SignalMutPointerMessageBackupKey p -); -SignalFfiError* signal_message_backup_key_from_account_entropy_pool( - SignalMutPointerMessageBackupKey* out, - const int8_t* account_entropy, - const SignalType_FixedArray17_uint8_t* aci, - const SignalType_FixedArray32_uint8_t* forward_secrecy_token -); -SignalFfiError* signal_message_backup_key_from_backup_key_and_backup_id( - SignalMutPointerMessageBackupKey* out, - const SignalType_FixedArray32_uint8_t* backup_key, - const SignalType_FixedArray16_uint8_t* backup_id, - const SignalType_FixedArray32_uint8_t* forward_secrecy_token -); -SignalFfiError* signal_message_backup_key_get_aes_key( - SignalType_FixedArray32_uint8_t* out, - SignalConstPointerMessageBackupKey key -); -SignalFfiError* signal_message_backup_key_get_hmac_key( - SignalType_FixedArray32_uint8_t* out, - SignalConstPointerMessageBackupKey key -); -SignalFfiError* signal_message_backup_sizing_flush_interval( - uint64_t* out, - uint64_t uncompressed_len, - uint64_t estimated_total_uncompressed_len -); -SignalFfiError* signal_message_backup_sizing_padding_size( - uint64_t* out, - uint64_t max_interval_bytes, - uint64_t compressed_len -); -SignalFfiError* signal_message_backup_validation_outcome_destroy( - SignalMutPointerMessageBackupValidationOutcome p -); -SignalFfiError* signal_message_backup_validation_outcome_get_error_message( - SignalCStringPtr* out, - SignalConstPointerMessageBackupValidationOutcome outcome -); -SignalFfiError* signal_message_backup_validation_outcome_get_unknown_fields( - SignalBytestringArray* out, - SignalConstPointerMessageBackupValidationOutcome outcome -); -SignalFfiError* signal_message_backup_validator_validate( - SignalMutPointerMessageBackupValidationOutcome* out, - SignalConstPointerMessageBackupKey key, - SignalConstPointerFfiSyncInputStreamStruct first_stream, - SignalConstPointerFfiSyncInputStreamStruct second_stream, - uint64_t len, - uint8_t purpose -); -SignalFfiError* signal_message_clone( - SignalMutPointerSignalMessage* new_obj, - SignalConstPointerSignalMessage obj -); -SignalFfiError* signal_message_deserialize( - SignalMutPointerSignalMessage* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_message_destroy( - SignalMutPointerSignalMessage p -); -SignalFfiError* signal_message_get_body( - SignalOwnedBuffer* out, - SignalConstPointerSignalMessage obj -); -SignalFfiError* signal_message_get_counter( - uint32_t* out, - SignalConstPointerSignalMessage obj -); -SignalFfiError* signal_message_get_message_version( - uint32_t* out, - SignalConstPointerSignalMessage obj -); -SignalFfiError* signal_message_get_pq_ratchet( - SignalOwnedBuffer* out, - SignalConstPointerSignalMessage msg -); -SignalFfiError* signal_message_get_sender_ratchet_key( - SignalMutPointerPublicKey* out, - SignalConstPointerSignalMessage m -); -SignalFfiError* signal_message_get_serialized( - SignalOwnedBuffer* out, - SignalConstPointerSignalMessage obj -); -SignalFfiError* signal_message_new( - SignalMutPointerSignalMessage* out, - uint8_t message_version, - SignalBorrowedBuffer mac_key, - SignalConstPointerPublicKey sender_ratchet_key, - uint32_t counter, - uint32_t previous_counter, - SignalBorrowedBuffer ciphertext, - SignalConstPointerPublicKey sender_identity_key, - SignalConstPointerPublicKey receiver_identity_key, - SignalBorrowedBuffer pq_ratchet -); -SignalFfiError* signal_online_backup_validator_add_frame( - SignalMutPointerOnlineBackupValidator backup, - SignalBorrowedBuffer frame -); -SignalFfiError* signal_online_backup_validator_destroy( - SignalMutPointerOnlineBackupValidator p -); -SignalFfiError* signal_online_backup_validator_finalize( - SignalMutPointerOnlineBackupValidator backup -); -SignalFfiError* signal_online_backup_validator_new( - SignalMutPointerOnlineBackupValidator* out, - SignalBorrowedBuffer backup_info_frame, - uint8_t purpose -); -SignalFfiError* signal_pin_hash_access_key( - SignalType_FixedArray32_uint8_t* out, - SignalConstPointerPinHash ph -); -SignalFfiError* signal_pin_hash_clone( - SignalMutPointerPinHash* new_obj, - SignalConstPointerPinHash obj -); -SignalFfiError* signal_pin_hash_destroy( - SignalMutPointerPinHash p -); -SignalFfiError* signal_pin_hash_encryption_key( - SignalType_FixedArray32_uint8_t* out, - SignalConstPointerPinHash ph -); -SignalFfiError* signal_pin_hash_from_salt( - SignalMutPointerPinHash* out, - SignalBorrowedBuffer pin, - const SignalType_FixedArray32_uint8_t* salt -); -SignalFfiError* signal_pin_hash_from_username_mrenclave( - SignalMutPointerPinHash* out, - SignalBorrowedBuffer pin, - const int8_t* username, - SignalBorrowedBuffer mrenclave -); -SignalFfiError* signal_pin_local_hash( - SignalCStringPtr* out, - SignalBorrowedBuffer pin -); -SignalFfiError* signal_pin_verify_local_hash( - bool* out, - const int8_t* encoded_hash, - SignalBorrowedBuffer pin -); -SignalFfiError* signal_plaintext_content_clone( - SignalMutPointerPlaintextContent* new_obj, - SignalConstPointerPlaintextContent obj -); -SignalFfiError* signal_plaintext_content_deserialize( - SignalMutPointerPlaintextContent* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_plaintext_content_destroy( - SignalMutPointerPlaintextContent p -); -SignalFfiError* signal_plaintext_content_from_decryption_error_message( - SignalMutPointerPlaintextContent* out, - SignalConstPointerDecryptionErrorMessage m -); -SignalFfiError* signal_plaintext_content_get_body( - SignalOwnedBuffer* out, - SignalConstPointerPlaintextContent obj -); -SignalFfiError* signal_plaintext_content_serialize( - SignalOwnedBuffer* out, - SignalConstPointerPlaintextContent obj -); -SignalFfiError* signal_pre_key_bundle_clone( - SignalMutPointerPreKeyBundle* new_obj, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_destroy( - SignalMutPointerPreKeyBundle p -); -SignalFfiError* signal_pre_key_bundle_get_device_id( - uint32_t* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_identity_key( - SignalMutPointerPublicKey* out, - SignalConstPointerPreKeyBundle p -); -SignalFfiError* signal_pre_key_bundle_get_kyber_pre_key_id( - uint32_t* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_kyber_pre_key_public( - SignalMutPointerKyberPublicKey* out, - SignalConstPointerPreKeyBundle bundle -); -SignalFfiError* signal_pre_key_bundle_get_kyber_pre_key_signature( - SignalOwnedBuffer* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_pre_key_id( - uint32_t* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_pre_key_public( - SignalMutPointerPublicKey* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_registration_id( - uint32_t* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_signed_pre_key_id( - uint32_t* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_signed_pre_key_public( - SignalMutPointerPublicKey* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_get_signed_pre_key_signature( - SignalOwnedBuffer* out, - SignalConstPointerPreKeyBundle obj -); -SignalFfiError* signal_pre_key_bundle_new( - SignalMutPointerPreKeyBundle* out, - uint32_t registration_id, - uint32_t device_id, - uint32_t prekey_id, - SignalConstPointerPublicKey prekey, - uint32_t signed_prekey_id, - SignalConstPointerPublicKey signed_prekey, - SignalBorrowedBuffer signed_prekey_signature, - SignalConstPointerPublicKey identity_key, - uint32_t kyber_prekey_id, - SignalConstPointerKyberPublicKey kyber_prekey, - SignalBorrowedBuffer kyber_prekey_signature -); -SignalFfiError* signal_pre_key_record_clone( - SignalMutPointerPreKeyRecord* new_obj, - SignalConstPointerPreKeyRecord obj -); -SignalFfiError* signal_pre_key_record_deserialize( - SignalMutPointerPreKeyRecord* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_pre_key_record_destroy( - SignalMutPointerPreKeyRecord p -); -SignalFfiError* signal_pre_key_record_get_id( - uint32_t* out, - SignalConstPointerPreKeyRecord obj -); -SignalFfiError* signal_pre_key_record_get_private_key( - SignalMutPointerPrivateKey* out, - SignalConstPointerPreKeyRecord obj -); -SignalFfiError* signal_pre_key_record_get_public_key( - SignalMutPointerPublicKey* out, - SignalConstPointerPreKeyRecord obj -); -SignalFfiError* signal_pre_key_record_new( - SignalMutPointerPreKeyRecord* out, - uint32_t id, - SignalConstPointerPublicKey pub_key, - SignalConstPointerPrivateKey priv_key -); -SignalFfiError* signal_pre_key_record_serialize( - SignalOwnedBuffer* out, - SignalConstPointerPreKeyRecord obj -); -SignalFfiError* signal_pre_key_signal_message_clone( - SignalMutPointerPreKeySignalMessage* new_obj, - SignalConstPointerPreKeySignalMessage obj -); -SignalFfiError* signal_pre_key_signal_message_deserialize( - SignalMutPointerPreKeySignalMessage* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_pre_key_signal_message_destroy( - SignalMutPointerPreKeySignalMessage p -); -SignalFfiError* signal_pre_key_signal_message_get_base_key( - SignalMutPointerPublicKey* out, - SignalConstPointerPreKeySignalMessage m -); -SignalFfiError* signal_pre_key_signal_message_get_identity_key( - SignalMutPointerPublicKey* out, - SignalConstPointerPreKeySignalMessage m -); -SignalFfiError* signal_pre_key_signal_message_get_pre_key_id( - uint32_t* out, - SignalConstPointerPreKeySignalMessage obj -); -SignalFfiError* signal_pre_key_signal_message_get_registration_id( - uint32_t* out, - SignalConstPointerPreKeySignalMessage obj -); -SignalFfiError* signal_pre_key_signal_message_get_signal_message( - SignalMutPointerSignalMessage* out, - SignalConstPointerPreKeySignalMessage m -); -SignalFfiError* signal_pre_key_signal_message_get_signed_pre_key_id( - uint32_t* out, - SignalConstPointerPreKeySignalMessage obj -); -SignalFfiError* signal_pre_key_signal_message_get_version( - uint32_t* out, - SignalConstPointerPreKeySignalMessage obj -); -SignalFfiError* signal_pre_key_signal_message_new( - SignalMutPointerPreKeySignalMessage* out, - uint8_t message_version, - uint32_t registration_id, - uint32_t pre_key_id, - uint32_t signed_pre_key_id, - SignalConstPointerPublicKey base_key, - SignalConstPointerPublicKey identity_key, - SignalConstPointerSignalMessage signal_message -); -SignalFfiError* signal_pre_key_signal_message_serialize( - SignalOwnedBuffer* out, - SignalConstPointerPreKeySignalMessage obj -); -void signal_print_ptr( - const void* p -); -SignalFfiError* signal_privatekey_agree( - SignalOwnedBuffer* out, - SignalConstPointerPrivateKey private_key, - SignalConstPointerPublicKey public_key -); -SignalFfiError* signal_privatekey_clone( - SignalMutPointerPrivateKey* new_obj, - SignalConstPointerPrivateKey obj -); -SignalFfiError* signal_privatekey_deserialize( - SignalMutPointerPrivateKey* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_privatekey_destroy( - SignalMutPointerPrivateKey p -); -SignalFfiError* signal_privatekey_generate( - SignalMutPointerPrivateKey* out -); -SignalFfiError* signal_privatekey_get_public_key( - SignalMutPointerPublicKey* out, - SignalConstPointerPrivateKey k -); -SignalFfiError* signal_privatekey_hpke_open( - SignalOwnedBuffer* out, - SignalConstPointerPrivateKey sk, - SignalBorrowedBuffer ciphertext, - SignalBorrowedBuffer info, - SignalBorrowedBuffer associated_data -); -SignalFfiError* signal_privatekey_serialize( - SignalOwnedBuffer* out, - SignalConstPointerPrivateKey obj -); -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_sender_key_distribution_message( - SignalConstPointerProtocolAddress sender, - SignalConstPointerSenderKeyDistributionMessage sender_key_distribution_message, - SignalConstPointerFfiSenderKeyStoreStruct store -); -SignalFfiError* signal_profile_key_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_profile_key_ciphertext_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_profile_key_commitment_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_profile_key_credential_presentation_check_valid_contents( - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_profile_key_credential_presentation_get_profile_key_ciphertext( - SignalType_FixedArray65_uint8_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_profile_key_credential_presentation_get_uuid_ciphertext( - SignalType_FixedArray65_uint8_t* out, - SignalBorrowedBuffer presentation_bytes -); -SignalFfiError* signal_profile_key_credential_request_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_profile_key_credential_request_context_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_profile_key_credential_request_context_get_request( - SignalType_FixedArray329_uint8_t* out, - const SignalType_FixedArray473_uint8_t* context -); -SignalFfiError* signal_profile_key_derive_access_key( - SignalType_FixedArray16_uint8_t* out, - const SignalType_FixedArray32_uint8_t* profile_key -); -SignalFfiError* signal_profile_key_get_commitment( - SignalType_FixedArray97_uint8_t* out, - const SignalType_FixedArray32_uint8_t* profile_key, - const SignalType_FixedArray17_uint8_t* user_id -); -SignalFfiError* signal_profile_key_get_profile_key_version( - SignalType_FixedArray64_uint8_t* out, - const SignalType_FixedArray32_uint8_t* profile_key, - const SignalType_FixedArray17_uint8_t* 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_deserialize( - SignalMutPointerPublicKey* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_publickey_destroy( - SignalMutPointerPublicKey p -); -SignalFfiError* signal_publickey_equals( - bool* out, - SignalConstPointerPublicKey lhs, - SignalConstPointerPublicKey rhs -); -SignalFfiError* signal_publickey_get_public_key_bytes( - SignalOwnedBuffer* out, - SignalConstPointerPublicKey obj -); -SignalFfiError* signal_publickey_hpke_seal( - SignalOwnedBuffer* out, - SignalConstPointerPublicKey pk, - SignalBorrowedBuffer plaintext, - SignalBorrowedBuffer info, - SignalBorrowedBuffer associated_data -); -SignalFfiError* signal_publickey_serialize( - SignalOwnedBuffer* out, - SignalConstPointerPublicKey obj -); -SignalFfiError* signal_publickey_verify( - bool* out, - SignalConstPointerPublicKey key, - SignalBorrowedBuffer message, - SignalBorrowedBuffer signature -); -SignalFfiError* signal_receipt_credential_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_receipt_credential_get_receipt_expiration_time( - uint64_t* out, - const SignalType_FixedArray129_uint8_t* receipt_credential -); -SignalFfiError* signal_receipt_credential_get_receipt_level( - uint64_t* out, - const SignalType_FixedArray129_uint8_t* receipt_credential -); -SignalFfiError* signal_receipt_credential_presentation_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_receipt_credential_presentation_get_receipt_expiration_time( - uint64_t* out, - const SignalType_FixedArray329_uint8_t* presentation -); -SignalFfiError* signal_receipt_credential_presentation_get_receipt_level( - uint64_t* out, - const SignalType_FixedArray329_uint8_t* presentation -); -SignalFfiError* signal_receipt_credential_presentation_get_receipt_serial( - SignalType_FixedArray16_uint8_t* out, - const SignalType_FixedArray329_uint8_t* presentation -); -SignalFfiError* signal_receipt_credential_request_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_receipt_credential_request_context_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_receipt_credential_request_context_get_request( - SignalType_FixedArray97_uint8_t* out, - const SignalType_FixedArray177_uint8_t* request_context -); -SignalFfiError* signal_receipt_credential_response_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_register_account_request_create( - SignalMutPointerRegisterAccountRequest* out -); -SignalFfiError* signal_register_account_request_destroy( - SignalMutPointerRegisterAccountRequest p -); -SignalFfiError* signal_register_account_request_set_account_password( - SignalConstPointerRegisterAccountRequest register_account, - const int8_t* account_password -); -SignalFfiError* signal_register_account_request_set_apn_push_token( - SignalConstPointerRegisterAccountRequest register_account, - const int8_t* apn_push_token -); -SignalFfiError* signal_register_account_request_set_identity_pq_last_resort_pre_key( - SignalConstPointerRegisterAccountRequest register_account, - uint8_t identity_type, - SignalFfiSignedPublicPreKey pq_last_resort_pre_key -); -SignalFfiError* signal_register_account_request_set_identity_public_key( - SignalConstPointerRegisterAccountRequest register_account, - uint8_t identity_type, - SignalConstPointerPublicKey identity_key -); -SignalFfiError* signal_register_account_request_set_identity_signed_pre_key( - SignalConstPointerRegisterAccountRequest register_account, - uint8_t identity_type, - SignalFfiSignedPublicPreKey signed_pre_key -); -SignalFfiError* signal_register_account_request_set_one_time_password( - SignalConstPointerRegisterAccountRequest register_account, - uint32_t one_time_password -); -SignalFfiError* signal_register_account_request_set_skip_device_transfer( - SignalConstPointerRegisterAccountRequest register_account -); -SignalFfiError* signal_register_account_response_destroy( - SignalMutPointerRegisterAccountResponse p -); -SignalFfiError* signal_register_account_response_get_aci( - SignalUuid* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_auth_credential_salt( - SignalOwnedBuffer* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_entitlement_backup_expiration_seconds( - uint64_t* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_entitlement_backup_level( - uint64_t* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_entitlement_badges( - SignalOwnedBufferOfFfiRegisterResponseBadge* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_number( - SignalCStringPtr* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_pni( - SignalOptionalUuid* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_reregistration( - bool* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_storage_capable( - bool* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_username_hash( - SignalOwnedBuffer* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_register_account_response_get_username_link_handle( - SignalOptionalUuid* out, - SignalConstPointerRegisterAccountResponse response -); -SignalFfiError* signal_registration_account_attributes_create( - SignalMutPointerRegistrationAccountAttributes* out, - SignalBorrowedBuffer recovery_password, - uint16_t aci_registration_id, - uint16_t pni_registration_id, - const int8_t* registration_lock, - const SignalType_FixedArray16_uint8_t* unidentified_access_key, - bool unrestricted_unidentified_access, - SignalBorrowedBytestringArray capabilities, - bool discoverable_by_phone_number -); -SignalFfiError* signal_registration_account_attributes_destroy( - SignalMutPointerRegistrationAccountAttributes p -); -SignalFfiError* signal_registration_service_check_svr2_credentials( - SignalCPromiseFfiCheckSvr2CredentialsResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerRegistrationService service, - SignalBorrowedBytestringArray svr_tokens -); -SignalFfiError* signal_registration_service_create_session( - SignalCPromiseMutPointerRegistrationService* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalFfiRegistrationCreateSessionRequest create_session, - SignalConstPointerFfiConnectChatBridgeStruct connect_chat -); -SignalFfiError* signal_registration_service_destroy( - SignalMutPointerRegistrationService p -); -SignalFfiError* signal_registration_service_register_account( - SignalCPromiseMutPointerRegisterAccountResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerRegistrationService service, - SignalConstPointerRegisterAccountRequest register_account, - SignalConstPointerRegistrationAccountAttributes account_attributes -); -SignalFfiError* signal_registration_service_register_account_without_number( - SignalCPromiseMutPointerRegisterAccountResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerFfiConnectChatBridgeStruct connect_chat, - SignalBorrowedBuffer receipt_credential_presentation, - SignalConstPointerRegisterAccountRequest register_account, - SignalConstPointerRegistrationAccountAttributes account_attributes -); -SignalFfiError* signal_registration_service_registration_session( - SignalMutPointerRegistrationSession* out, - SignalConstPointerRegistrationService service -); -SignalFfiError* signal_registration_service_request_push_challenge( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerRegistrationService service, - const int8_t* push_token -); -SignalFfiError* signal_registration_service_request_verification_code( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerRegistrationService service, - const int8_t* transport, - const int8_t* client, - SignalBorrowedBytestringArray languages -); -SignalFfiError* signal_registration_service_reregister_account( - SignalCPromiseMutPointerRegisterAccountResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerFfiConnectChatBridgeStruct connect_chat, - const int8_t* number, - SignalConstPointerRegisterAccountRequest register_account, - SignalConstPointerRegistrationAccountAttributes account_attributes -); -SignalFfiError* signal_registration_service_reregister_account_without_number( - SignalCPromiseMutPointerRegisterAccountResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerFfiConnectChatBridgeStruct connect_chat, - const SignalType_FixedArray17_uint8_t* aci, - SignalConstPointerRegisterAccountRequest register_account, - SignalConstPointerRegistrationAccountAttributes account_attributes -); -SignalFfiError* signal_registration_service_resume_session( - SignalCPromiseMutPointerRegistrationService* promise, - SignalConstPointerTokioAsyncContext async_runtime, - const int8_t* session_id, - const int8_t* number, - SignalConstPointerFfiConnectChatBridgeStruct connect_chat -); -SignalFfiError* signal_registration_service_session_id( - SignalCStringPtr* out, - SignalConstPointerRegistrationService service -); -SignalFfiError* signal_registration_service_submit_captcha( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerRegistrationService service, - const int8_t* captcha_value -); -SignalFfiError* signal_registration_service_submit_push_challenge( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerRegistrationService service, - const int8_t* push_challenge -); -SignalFfiError* signal_registration_service_submit_verification_code( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerRegistrationService service, - const int8_t* code -); -SignalFfiError* signal_registration_session_destroy( - SignalMutPointerRegistrationSession p -); -SignalFfiError* signal_registration_session_get_allowed_to_request_code( - bool* out, - SignalConstPointerRegistrationSession session -); -SignalFfiError* signal_registration_session_get_next_call_seconds( - uint32_t* out, - SignalConstPointerRegistrationSession session -); -SignalFfiError* signal_registration_session_get_next_sms_seconds( - uint32_t* out, - SignalConstPointerRegistrationSession session -); -SignalFfiError* signal_registration_session_get_next_verification_attempt_seconds( - uint32_t* out, - SignalConstPointerRegistrationSession session -); -SignalFfiError* signal_registration_session_get_requested_information( - SignalOwnedBuffer* out, - SignalConstPointerRegistrationSession session -); -SignalFfiError* signal_registration_session_get_verified( - bool* out, - SignalConstPointerRegistrationSession session -); -SignalFfiError* signal_sealed_sender_multi_recipient_encrypt( - SignalOwnedBuffer* out, - SignalBorrowedSliceOfConstPointerProtocolAddress recipients, - SignalBorrowedSliceOfConstPointerSessionRecord recipient_sessions, - SignalBorrowedBuffer excluded_recipients, - SignalConstPointerUnidentifiedSenderMessageContent content, - SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store -); -SignalFfiError* signal_sealed_sender_multi_recipient_message_for_single_recipient( - SignalOwnedBuffer* out, - SignalBorrowedBuffer encoded_multi_recipient_message -); -SignalFfiError* signal_sealed_session_cipher_decrypt_to_usmc( - SignalMutPointerUnidentifiedSenderMessageContent* out, - SignalBorrowedBuffer ctext, - SignalConstPointerFfiIdentityKeyStoreStruct identity_store -); -SignalFfiError* signal_sealed_session_cipher_encrypt( - SignalOwnedBuffer* out, - SignalConstPointerProtocolAddress destination, - SignalConstPointerUnidentifiedSenderMessageContent content, - SignalConstPointerFfiIdentityKeyStoreStruct identity_key_store -); -SignalFfiError* signal_secure_value_recovery_for_backups_create_new_backup_chain( - SignalOwnedBuffer* out, - uint8_t environment, - const SignalType_FixedArray32_uint8_t* backup_key -); -SignalFfiError* signal_secure_value_recovery_for_backups_remove_backup( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerConnectionManager connection_manager, - const int8_t* username, - const int8_t* password -); -SignalFfiError* signal_secure_value_recovery_for_backups_restore_backup_from_server( - SignalCPromiseMutPointerBackupRestoreResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - const SignalType_FixedArray32_uint8_t* backup_key, - SignalBorrowedBuffer metadata, - SignalConstPointerConnectionManager connection_manager, - const int8_t* username, - const int8_t* password -); -SignalFfiError* signal_secure_value_recovery_for_backups_store_backup( - SignalCPromiseMutPointerBackupStoreResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - const SignalType_FixedArray32_uint8_t* backup_key, - SignalBorrowedBuffer previous_secret_data, - SignalConstPointerConnectionManager connection_manager, - const int8_t* username, - const int8_t* password -); -SignalFfiError* signal_sender_certificate_clone( - SignalMutPointerSenderCertificate* new_obj, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_deserialize( - SignalMutPointerSenderCertificate* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_sender_certificate_destroy( - SignalMutPointerSenderCertificate p -); -SignalFfiError* signal_sender_certificate_get_certificate( - SignalOwnedBuffer* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_get_device_id( - uint32_t* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_get_expiration( - uint64_t* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_get_key( - SignalMutPointerPublicKey* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_get_sender_e164( - SignalCStringPtr* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_get_sender_uuid( - SignalCStringPtr* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_get_serialized( - SignalOwnedBuffer* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_get_server_certificate( - SignalMutPointerServerCertificate* out, - SignalConstPointerSenderCertificate cert -); -SignalFfiError* signal_sender_certificate_get_signature( - SignalOwnedBuffer* out, - SignalConstPointerSenderCertificate obj -); -SignalFfiError* signal_sender_certificate_new( - SignalMutPointerSenderCertificate* out, - const int8_t* sender_uuid, - const int8_t* sender_e164, - uint32_t sender_device_id, - SignalConstPointerPublicKey sender_key, - uint64_t expiration, - SignalConstPointerServerCertificate signer_cert, - SignalConstPointerPrivateKey signer_key -); -SignalFfiError* signal_sender_certificate_validate( - bool* out, - SignalConstPointerSenderCertificate cert, - SignalBorrowedSliceOfConstPointerPublicKey trust_roots, - uint64_t time -); -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_deserialize( - SignalMutPointerSenderKeyDistributionMessage* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_sender_key_distribution_message_destroy( - SignalMutPointerSenderKeyDistributionMessage p -); -SignalFfiError* signal_sender_key_distribution_message_get_chain_id( - uint32_t* out, - SignalConstPointerSenderKeyDistributionMessage obj -); -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_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_serialize( - SignalOwnedBuffer* out, - SignalConstPointerSenderKeyDistributionMessage obj -); -SignalFfiError* signal_sender_key_message_clone( - SignalMutPointerSenderKeyMessage* new_obj, - SignalConstPointerSenderKeyMessage obj -); -SignalFfiError* signal_sender_key_message_deserialize( - SignalMutPointerSenderKeyMessage* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_sender_key_message_destroy( - SignalMutPointerSenderKeyMessage p -); -SignalFfiError* signal_sender_key_message_get_chain_id( - uint32_t* out, - SignalConstPointerSenderKeyMessage obj -); -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_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_serialize( - SignalOwnedBuffer* out, - SignalConstPointerSenderKeyMessage obj -); -SignalFfiError* signal_sender_key_message_verify_signature( - bool* out, - SignalConstPointerSenderKeyMessage skm, - SignalConstPointerPublicKey pubkey -); -SignalFfiError* signal_sender_key_record_clone( - SignalMutPointerSenderKeyRecord* new_obj, - SignalConstPointerSenderKeyRecord obj -); -SignalFfiError* signal_sender_key_record_deserialize( - SignalMutPointerSenderKeyRecord* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_sender_key_record_destroy( - SignalMutPointerSenderKeyRecord p -); -SignalFfiError* signal_sender_key_record_serialize( - SignalOwnedBuffer* out, - SignalConstPointerSenderKeyRecord obj -); -SignalFfiError* signal_server_certificate_clone( - SignalMutPointerServerCertificate* new_obj, - SignalConstPointerServerCertificate obj -); -SignalFfiError* signal_server_certificate_deserialize( - SignalMutPointerServerCertificate* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_server_certificate_destroy( - SignalMutPointerServerCertificate p -); -SignalFfiError* signal_server_certificate_get_certificate( - SignalOwnedBuffer* out, - SignalConstPointerServerCertificate obj -); -SignalFfiError* signal_server_certificate_get_key( - SignalMutPointerPublicKey* out, - SignalConstPointerServerCertificate obj -); -SignalFfiError* signal_server_certificate_get_key_id( - uint32_t* out, - SignalConstPointerServerCertificate obj -); -SignalFfiError* signal_server_certificate_get_serialized( - SignalOwnedBuffer* out, - SignalConstPointerServerCertificate obj -); -SignalFfiError* signal_server_certificate_get_signature( - SignalOwnedBuffer* out, - SignalConstPointerServerCertificate obj -); -SignalFfiError* signal_server_certificate_new( - SignalMutPointerServerCertificate* out, - uint32_t key_id, - SignalConstPointerPublicKey server_key, - SignalConstPointerPrivateKey trust_root -); -SignalFfiError* signal_server_message_ack_destroy( - SignalMutPointerServerMessageAck p -); -SignalFfiError* signal_server_message_ack_send( - SignalConstPointerServerMessageAck ack -); -SignalFfiError* signal_server_public_params_create_auth_credential_with_pni_presentation_deterministic( - SignalOwnedBuffer* out, - SignalConstPointerServerPublicParams server_public_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray289_uint8_t* group_secret_params, - SignalBorrowedBuffer auth_credential_with_pni_bytes -); -SignalFfiError* signal_server_public_params_create_expiring_profile_key_credential_presentation_deterministic( - SignalOwnedBuffer* out, - SignalConstPointerServerPublicParams server_public_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray289_uint8_t* group_secret_params, - const SignalType_FixedArray153_uint8_t* profile_key_credential -); -SignalFfiError* signal_server_public_params_create_profile_key_credential_request_context_deterministic( - SignalType_FixedArray473_uint8_t* out, - SignalConstPointerServerPublicParams server_public_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray17_uint8_t* user_id, - const SignalType_FixedArray32_uint8_t* profile_key -); -SignalFfiError* signal_server_public_params_create_receipt_credential_presentation_deterministic( - SignalType_FixedArray329_uint8_t* out, - SignalConstPointerServerPublicParams server_public_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray129_uint8_t* receipt_credential -); -SignalFfiError* signal_server_public_params_create_receipt_credential_request_context_deterministic( - SignalType_FixedArray177_uint8_t* out, - SignalConstPointerServerPublicParams server_public_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray16_uint8_t* receipt_serial -); -SignalFfiError* signal_server_public_params_deserialize( - SignalMutPointerServerPublicParams* out, - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_server_public_params_destroy( - SignalMutPointerServerPublicParams p -); -SignalFfiError* signal_server_public_params_get_endorsement_public_key( - SignalOwnedBuffer* out, - SignalConstPointerServerPublicParams params -); -SignalFfiError* signal_server_public_params_receive_auth_credential_with_pni_as_service_id( - SignalOwnedBuffer* out, - SignalConstPointerServerPublicParams params, - const SignalType_FixedArray17_uint8_t* aci, - const SignalType_FixedArray17_uint8_t* pni, - uint64_t redemption_time, - SignalBorrowedBuffer auth_credential_with_pni_response_bytes -); -SignalFfiError* signal_server_public_params_receive_auth_credential_zkc_without_pni( - SignalOwnedBuffer* out, - SignalConstPointerServerPublicParams params, - const SignalType_FixedArray17_uint8_t* aci, - SignalBorrowedBuffer salt, - uint64_t redemption_time, - SignalBorrowedBuffer auth_credential_with_pni_response_bytes -); -SignalFfiError* signal_server_public_params_receive_expiring_profile_key_credential( - SignalType_FixedArray153_uint8_t* out, - SignalConstPointerServerPublicParams server_public_params, - const SignalType_FixedArray473_uint8_t* request_context, - const SignalType_FixedArray497_uint8_t* response, - uint64_t current_time_in_seconds -); -SignalFfiError* signal_server_public_params_receive_receipt_credential( - SignalType_FixedArray129_uint8_t* out, - SignalConstPointerServerPublicParams server_public_params, - const SignalType_FixedArray177_uint8_t* request_context, - const SignalType_FixedArray409_uint8_t* response -); -SignalFfiError* signal_server_public_params_serialize( - SignalOwnedBuffer* out, - SignalConstPointerServerPublicParams handle -); -SignalFfiError* signal_server_public_params_verify_signature( - SignalConstPointerServerPublicParams server_public_params, - SignalBorrowedBuffer message, - const SignalType_FixedArray64_uint8_t* notary_signature -); -SignalFfiError* signal_server_secret_params_deserialize( - SignalMutPointerServerSecretParams* out, - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_server_secret_params_destroy( - SignalMutPointerServerSecretParams p -); -SignalFfiError* signal_server_secret_params_generate_deterministic( - SignalMutPointerServerSecretParams* out, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_server_secret_params_get_public_params( - SignalMutPointerServerPublicParams* out, - SignalConstPointerServerSecretParams params -); -SignalFfiError* signal_server_secret_params_issue_auth_credential_with_pni_zkc_deterministic( - SignalOwnedBuffer* out, - SignalConstPointerServerSecretParams server_secret_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray17_uint8_t* aci, - const SignalType_FixedArray17_uint8_t* pni, - uint64_t redemption_time -); -SignalFfiError* signal_server_secret_params_issue_auth_credential_zkc_without_pni_deterministic( - SignalOwnedBuffer* out, - SignalConstPointerServerSecretParams server_secret_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray17_uint8_t* aci, - SignalBorrowedBuffer salt, - uint64_t redemption_time -); -SignalFfiError* signal_server_secret_params_issue_expiring_profile_key_credential_deterministic( - SignalType_FixedArray497_uint8_t* out, - SignalConstPointerServerSecretParams server_secret_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray329_uint8_t* request, - const SignalType_FixedArray17_uint8_t* user_id, - const SignalType_FixedArray97_uint8_t* commitment, - uint64_t expiration_in_seconds -); -SignalFfiError* signal_server_secret_params_issue_receipt_credential_deterministic( - SignalType_FixedArray409_uint8_t* out, - SignalConstPointerServerSecretParams server_secret_params, - const SignalType_FixedArray32_uint8_t* randomness, - const SignalType_FixedArray97_uint8_t* request, - uint64_t receipt_expiration_time, - uint64_t receipt_level -); -SignalFfiError* signal_server_secret_params_serialize( - SignalOwnedBuffer* out, - SignalConstPointerServerSecretParams handle -); -SignalFfiError* signal_server_secret_params_sign_deterministic( - SignalType_FixedArray64_uint8_t* out, - SignalConstPointerServerSecretParams params, - const SignalType_FixedArray32_uint8_t* randomness, - SignalBorrowedBuffer message -); -SignalFfiError* signal_server_secret_params_verify_auth_credential_presentation( - SignalConstPointerServerSecretParams server_secret_params, - const SignalType_FixedArray97_uint8_t* group_public_params, - SignalBorrowedBuffer presentation_bytes, - uint64_t current_time_in_seconds -); -SignalFfiError* signal_server_secret_params_verify_profile_key_credential_presentation( - SignalConstPointerServerSecretParams server_secret_params, - const SignalType_FixedArray97_uint8_t* group_public_params, - SignalBorrowedBuffer presentation_bytes, - uint64_t current_time_in_seconds -); -SignalFfiError* signal_server_secret_params_verify_receipt_credential_presentation( - SignalConstPointerServerSecretParams server_secret_params, - const SignalType_FixedArray329_uint8_t* presentation -); -SignalFfiError* signal_service_id_parse_from_service_id_binary( - SignalType_FixedArray17_uint8_t* out, - SignalBorrowedBuffer input -); -SignalFfiError* signal_service_id_parse_from_service_id_string( - SignalType_FixedArray17_uint8_t* out, - const int8_t* input -); -SignalFfiError* signal_service_id_service_id_binary( - SignalOwnedBuffer* out, - const SignalType_FixedArray17_uint8_t* value -); -SignalFfiError* signal_service_id_service_id_log( - SignalCStringPtr* out, - const SignalType_FixedArray17_uint8_t* value -); -SignalFfiError* signal_service_id_service_id_string( - SignalCStringPtr* out, - const SignalType_FixedArray17_uint8_t* value -); -SignalFfiError* signal_session_record_archive_current_state( - SignalMutPointerSessionRecord session_record -); -SignalFfiError* signal_session_record_clone( - SignalMutPointerSessionRecord* new_obj, - SignalConstPointerSessionRecord obj -); -SignalFfiError* signal_session_record_current_ratchet_key_matches( - bool* out, - SignalConstPointerSessionRecord s, - SignalConstPointerPublicKey key -); -SignalFfiError* signal_session_record_deserialize( - SignalMutPointerSessionRecord* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_session_record_destroy( - SignalMutPointerSessionRecord p -); -SignalFfiError* signal_session_record_get_local_registration_id( - uint32_t* out, - SignalConstPointerSessionRecord obj -); -SignalFfiError* signal_session_record_get_remote_registration_id( - uint32_t* out, - SignalConstPointerSessionRecord obj -); -SignalFfiError* signal_session_record_has_usable_sender_chain( - bool* out, - SignalConstPointerSessionRecord s, - uint64_t now -); -SignalFfiError* signal_session_record_serialize( - SignalOwnedBuffer* out, - SignalConstPointerSessionRecord obj -); -SignalFfiError* signal_sgx_client_state_complete_handshake( - SignalMutPointerSgxClientState cli, - SignalBorrowedBuffer handshake_received -); -SignalFfiError* signal_sgx_client_state_destroy( - SignalMutPointerSgxClientState p -); -SignalFfiError* signal_sgx_client_state_established_recv( - SignalOwnedBuffer* out, - SignalMutPointerSgxClientState cli, - SignalBorrowedBuffer received_ciphertext -); -SignalFfiError* signal_sgx_client_state_established_send( - SignalOwnedBuffer* out, - SignalMutPointerSgxClientState cli, - SignalBorrowedBuffer plaintext_to_send -); -SignalFfiError* signal_sgx_client_state_initial_request( - SignalOwnedBuffer* out, - SignalConstPointerSgxClientState obj -); -SignalFfiError* signal_signed_pre_key_record_clone( - SignalMutPointerSignedPreKeyRecord* new_obj, - SignalConstPointerSignedPreKeyRecord obj -); -SignalFfiError* signal_signed_pre_key_record_deserialize( - SignalMutPointerSignedPreKeyRecord* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_signed_pre_key_record_destroy( - SignalMutPointerSignedPreKeyRecord p -); -SignalFfiError* signal_signed_pre_key_record_get_id( - uint32_t* out, - SignalConstPointerSignedPreKeyRecord obj -); -SignalFfiError* signal_signed_pre_key_record_get_private_key( - SignalMutPointerPrivateKey* out, - SignalConstPointerSignedPreKeyRecord obj -); -SignalFfiError* signal_signed_pre_key_record_get_public_key( - SignalMutPointerPublicKey* out, - SignalConstPointerSignedPreKeyRecord obj -); -SignalFfiError* signal_signed_pre_key_record_get_signature( - SignalOwnedBuffer* out, - SignalConstPointerSignedPreKeyRecord obj -); -SignalFfiError* signal_signed_pre_key_record_get_timestamp( - uint64_t* out, - SignalConstPointerSignedPreKeyRecord obj -); -SignalFfiError* signal_signed_pre_key_record_new( - SignalMutPointerSignedPreKeyRecord* out, - uint32_t id, - uint64_t timestamp, - SignalConstPointerPublicKey pub_key, - SignalConstPointerPrivateKey priv_key, - SignalBorrowedBuffer signature -); -SignalFfiError* signal_signed_pre_key_record_serialize( - SignalOwnedBuffer* out, - SignalConstPointerSignedPreKeyRecord obj -); -SignalFfiError* signal_svr2_client_new( - SignalMutPointerSgxClientState* out, - SignalBorrowedBuffer mrenclave, - SignalBorrowedBuffer attestation_msg, - uint64_t current_timestamp -); -SignalFfiError* signal_svr_key_derive_logging_key( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray32_uint8_t* svr_key -); -SignalFfiError* signal_svr_key_derive_registration_lock( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray32_uint8_t* svr_key -); -SignalFfiError* signal_svr_key_derive_registration_recovery_password( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray32_uint8_t* svr_key -); -SignalFfiError* signal_svr_key_derive_storage_service_key( - SignalType_FixedArray32_uint8_t* out, - const SignalType_FixedArray32_uint8_t* svr_key -); -SignalFfiError* signal_tokio_async_context_cancel( - SignalConstPointerTokioAsyncContext context, - uint64_t raw_cancellation_id -); -SignalFfiError* signal_tokio_async_context_destroy( - SignalMutPointerTokioAsyncContext p -); -SignalFfiError* signal_tokio_async_context_new( - SignalMutPointerTokioAsyncContext* out -); -SignalFfiError* signal_unauthenticated_chat_connection_account_exists( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - const SignalType_FixedArray17_uint8_t* account -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_copy_media( - SignalMutPointerCopyBackupMediaStream* out, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - SignalBorrowedSliceOfBridgeCopyBackupMediaItemFfiArg items, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_delete_all( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_delete_media( - SignalMutPointerDeleteBackupMediaStream* out, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - SignalBorrowedSliceOfBridgeDeleteBackupMediaItemFfiArg items, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_get_cdn_credentials( - SignalCPromisePairOfOwnedBufferOfCStringPtrOwnedBufferOfCStringPtr* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - int32_t cdn, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_get_media_backup_info( - SignalCPromiseBridgeMediaBackupInfoFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - int64_t rng -); -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_message_backup_info( - SignalCPromiseBridgeMessageBackupInfoFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_get_svrb_credentials( - SignalCPromisePairOfCStringPtrCStringPtr* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - 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_backup_list_media( - SignalCPromiseListMediaResponseFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - const int8_t* cursor, - int32_t limit, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_refresh( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_backup_set_public_key( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer credential, - SignalBorrowedBuffer server_keys, - SignalConstPointerPrivateKey signing_key, - int64_t rng -); -SignalFfiError* signal_unauthenticated_chat_connection_check_svr_credentials( - SignalCPromiseOwnedBufferOfMaxAlignedPairOfCStringPtrAuthCheckResultFfiResult* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - const int8_t* number, - SignalBorrowedSliceOfCStringPtr credentials -); -SignalFfiError* signal_unauthenticated_chat_connection_connect( - SignalCPromiseMutPointerUnauthenticatedChatConnection* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerConnectionManager connection_manager, - SignalBorrowedBytestringArray languages -); -SignalFfiError* signal_unauthenticated_chat_connection_create_login_receipt_credential( - SignalCPromiseOwnedBuffer* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalPaymentProviderFfiArg payment_processor, - const int8_t* purchase_identifier, - SignalBorrowedBuffer receipt_credential_request_context, - SignalConstPointerServerPublicParams server_params, - uint64_t purchase_time -); -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 SignalType_FixedArray16_uint8_t* auth, - const SignalType_FixedArray17_uint8_t* target, - int32_t device -); -SignalFfiError* signal_unauthenticated_chat_connection_get_pre_keys_group_auth( - SignalCPromiseFfiPreKeysResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer auth, - const SignalType_FixedArray17_uint8_t* target, - int32_t device -); -SignalFfiError* signal_unauthenticated_chat_connection_get_pre_keys_unrestricted_auth( - SignalCPromiseFfiPreKeysResponse* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - const SignalType_FixedArray17_uint8_t* 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( - SignalCPromiseOptionalPairOfCStringPtrc_uchar32* 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 SignalType_FixedArray17_uint8_t* 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( - SignalCPromiseOwnedBufferOfc_uchar17* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalBorrowedBuffer payload, - uint64_t timestamp, - SignalBorrowedBuffer auth, - bool online_only, - bool is_urgent -); -SignalFfiError* signal_unauthenticated_chat_connection_submit_call_quality_survey( - SignalCPromisebool* promise, - SignalConstPointerTokioAsyncContext async_runtime, - SignalConstPointerUnauthenticatedChatConnection chat, - SignalCallQualitySurveyInternalFfiArg survey -); -SignalFfiError* signal_unidentified_sender_message_content_deserialize( - SignalMutPointerUnidentifiedSenderMessageContent* out, - SignalBorrowedBuffer data -); -SignalFfiError* signal_unidentified_sender_message_content_destroy( - SignalMutPointerUnidentifiedSenderMessageContent p -); -SignalFfiError* signal_unidentified_sender_message_content_get_content_hint( - uint32_t* out, - SignalConstPointerUnidentifiedSenderMessageContent m -); -SignalFfiError* signal_unidentified_sender_message_content_get_contents( - SignalOwnedBuffer* out, - SignalConstPointerUnidentifiedSenderMessageContent obj -); -SignalFfiError* signal_unidentified_sender_message_content_get_group_id_or_empty( - SignalOwnedBuffer* out, - SignalConstPointerUnidentifiedSenderMessageContent m -); -SignalFfiError* signal_unidentified_sender_message_content_get_msg_type( - uint8_t* out, - SignalConstPointerUnidentifiedSenderMessageContent m -); -SignalFfiError* signal_unidentified_sender_message_content_get_sender_cert( - SignalMutPointerSenderCertificate* out, - SignalConstPointerUnidentifiedSenderMessageContent m -); -SignalFfiError* signal_unidentified_sender_message_content_new( - SignalMutPointerUnidentifiedSenderMessageContent* out, - SignalConstPointerCiphertextMessage message, - SignalConstPointerSenderCertificate sender, - uint32_t content_hint, - SignalBorrowedBuffer group_id -); -SignalFfiError* signal_unidentified_sender_message_content_new_from_content_and_type( - SignalMutPointerUnidentifiedSenderMessageContent* out, - SignalBorrowedBuffer message_content, - uint8_t message_type, - SignalConstPointerSenderCertificate sender, - uint32_t content_hint, - SignalBorrowedBuffer group_id -); -SignalFfiError* signal_unidentified_sender_message_content_serialize( - SignalOwnedBuffer* out, - SignalConstPointerUnidentifiedSenderMessageContent obj -); -SignalFfiError* signal_username_candidates_from( - SignalBytestringArray* out, - const int8_t* nickname, - uint32_t min_len, - uint32_t max_len -); -SignalFfiError* signal_username_hash( - SignalType_FixedArray32_uint8_t* out, - const int8_t* username -); -SignalFfiError* signal_username_hash_from_parts( - SignalType_FixedArray32_uint8_t* out, - const int8_t* nickname, - const int8_t* discriminator, - uint32_t min_len, - uint32_t max_len -); -SignalFfiError* signal_username_link_create( - SignalOwnedBuffer* out, - const int8_t* username, - SignalBorrowedBuffer entropy -); -SignalFfiError* signal_username_link_decrypt_username( - SignalCStringPtr* out, - SignalBorrowedBuffer entropy, - SignalBorrowedBuffer encrypted_username -); -SignalFfiError* signal_username_proof( - SignalOwnedBuffer* out, - const int8_t* username, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_username_verify( - SignalBorrowedBuffer proof, - SignalBorrowedBuffer hash -); -SignalFfiError* signal_uuid_ciphertext_check_valid_contents( - SignalBorrowedBuffer buffer -); -SignalFfiError* signal_validating_mac_destroy( - SignalMutPointerValidatingMac p -); -SignalFfiError* signal_validating_mac_finalize( - int32_t* out, - SignalMutPointerValidatingMac mac -); -SignalFfiError* signal_validating_mac_initialize( - SignalMutPointerValidatingMac* out, - SignalBorrowedBuffer key, - uint32_t chunk_size, - SignalBorrowedBuffer digests -); -SignalFfiError* signal_validating_mac_update( - int32_t* out, - SignalMutPointerValidatingMac mac, - SignalBorrowedBuffer bytes, - uint32_t offset, - uint32_t length -); -SignalFfiError* signal_zk_credential_key_pair_check_valid_contents( - SignalBorrowedBuffer key_pair_bytes -); -SignalFfiError* signal_zk_credential_key_pair_generate_deterministic( - SignalOwnedBuffer* out, - const SignalType_FixedArray32_uint8_t* randomness -); -SignalFfiError* signal_zk_credential_key_pair_get_public_key( - SignalOwnedBuffer* out, - SignalBorrowedBuffer key_pair_bytes -); -SignalFfiError* signal_zk_credential_public_key_check_valid_contents( - SignalBorrowedBuffer public_key_bytes -); -typedef SignalBytestringArray SignalStringArray; -typedef SignalConstPointerFfiSyncInputStreamStruct SignalConstPointerFfiInputStreamStruct; -typedef SignalFfiIdentityKeyStoreStruct SignalIdentityKeyStore; -typedef SignalFfiKyberPreKeyStoreStruct SignalKyberPreKeyStore; -typedef SignalFfiPreKeyStoreStruct SignalPreKeyStore; -typedef SignalFfiSenderKeyStoreStruct SignalSenderKeyStore; -typedef SignalFfiSessionStoreStruct SignalSessionStore; -typedef SignalFfiSignedPreKeyStoreStruct SignalSignedPreKeyStore; -typedef SignalFfiSyncInputStreamStruct SignalFfiInputStreamStruct; -typedef SignalFfiSyncInputStreamStruct SignalInputStream; -typedef SignalFfiSyncInputStreamStruct SignalSyncInputStream; -typedef SignalOwnedBufferOfc_uchar17 SignalOwnedBufferOfServiceIdFixedWidthBinaryBytes; -typedef SignalRegistrationAccountAttributes SignalRegistrationAccountAttributes; -typedef SignalType_FixedArray16_uint8_t SignalReceiptSerialBytes; -typedef SignalType_FixedArray16_uint8_t SignalUidBytes; -typedef SignalType_FixedArray16_uint8_t SignalUnidentifiedAccessKey; -typedef SignalType_FixedArray17_uint8_t SignalServiceIdFixedWidthBinaryBytes; -typedef SignalType_FixedArray32_uint8_t SignalAesKeyBytes; -typedef SignalType_FixedArray32_uint8_t SignalBackupKeyBytes; -typedef SignalType_FixedArray32_uint8_t SignalGroupIdentifierBytes; -typedef SignalType_FixedArray32_uint8_t SignalGroupMasterKeyBytes; -typedef SignalType_FixedArray32_uint8_t SignalProfileKeyBytes; -typedef SignalType_FixedArray32_uint8_t SignalProfileKeyVersionBytes; -typedef SignalType_FixedArray32_uint8_t SignalRandomnessBytes; -typedef SignalType_FixedArray64_uint8_t SignalNotarySignatureBytes; -typedef SignalType_FixedArray64_uint8_t SignalProfileKeyVersionEncodedBytes; -typedef SignalType_FixedArray64_uint8_t SignalSignatureBytes; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void SignalFfiChatListenerReceivedQueueEmpty; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void SignalFfiLoggerFlush; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalFfiError SignalFfiChatListenerConnectionInterrupted; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalFfiError SignalFfiProvisioningListenerConnectionInterrupted; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerKyberPreKeyRecord_uint32_t SignalFfiKyberPreKeyStoreLoadKyberPreKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPreKeyRecord_uint32_t SignalFfiPreKeyStoreLoadPreKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerPublicKey_SignalMutPointerProtocolAddress SignalFfiIdentityKeyStoreGetIdentityKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSenderKeyRecord_SignalMutPointerProtocolAddress_SignalUuid SignalFfiSenderKeyStoreLoadSenderKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSessionRecord_SignalMutPointerProtocolAddress SignalFfiSessionStoreLoadSession; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalMutPointerSignedPreKeyRecord_uint32_t SignalFfiSignedPreKeyStoreLoadSignedPreKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_SignalPairOfMutPointerPrivateKeyMutPointerPublicKey SignalFfiIdentityKeyStoreGetLocalIdentityKeyPair; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_bool_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey_uint32_t SignalFfiIdentityKeyStoreIsTrustedIdentity; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_size_t_SignalBorrowedMutableBuffer SignalFfiSyncInputStreamRead; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint32_t SignalFfiIdentityKeyStoreGetLocalRegistrationId; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_MutPointer_uint8_t_SignalMutPointerProtocolAddress_SignalMutPointerPublicKey SignalFfiIdentityKeyStoreSaveIdentityKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_SignalBytestringArray SignalFfiChatListenerReceivedAlerts; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_SignalCStringPtr_SignalMutPointerServerMessageAck SignalFfiProvisioningListenerReceivedAddress; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_SignalLogLevel_SignalCStringPtr_uint32_t_SignalCStringPtr SignalFfiLoggerLog; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalMutPointerSessionRecord SignalFfiSessionStoreStoreSession; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_SignalMutPointerProtocolAddress_SignalUuid_SignalMutPointerSenderKeyRecord SignalFfiSenderKeyStoreStoreSenderKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_SignalMutPointerServerMessageAck SignalFfiProvisioningListenerReceivedEnvelope; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_SignalOwnedBuffer_uint64_t_SignalMutPointerServerMessageAck SignalFfiChatListenerReceivedIncomingMessage; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t SignalFfiPreKeyStoreRemovePreKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerKyberPreKeyRecord SignalFfiKyberPreKeyStoreStoreKyberPreKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerPreKeyRecord SignalFfiPreKeyStoreStorePreKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_SignalMutPointerSignedPreKeyRecord SignalFfiSignedPreKeyStoreStoreSignedPreKey; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_uint32_t_uint32_t_SignalMutPointerPublicKey SignalFfiKyberPreKeyStoreMarkKyberPreKeyUsed; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_uint64_t SignalFfiChatListenerReceivedServerTimestamp; -typedef SignalType_FunctionPointer_int32_t_MutPointer_void_uint64_t SignalFfiSyncInputStreamSkip; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiChatListenerDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiIdentityKeyStoreDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiKyberPreKeyStoreDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiLoggerDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiPreKeyStoreDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiProvisioningListenerDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiSenderKeyStoreDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiSessionStoreDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiSignedPreKeyStoreDestroy; -typedef SignalType_FunctionPointer_void_MutPointer_void SignalFfiSyncInputStreamDestroy; -typedef uint64_t SignalCancellationId; + unsigned char *base; + size_t length; +} SignalOwnedBuffer; + +typedef int (*SignalLoadSession)(void *store_ctx, SignalSessionRecord **recordp, const SignalProtocolAddress *address); + +typedef int (*SignalStoreSession)(void *store_ctx, const SignalProtocolAddress *address, const SignalSessionRecord *record); + +typedef struct { + void *ctx; + SignalLoadSession load_session; + SignalStoreSession store_session; +} SignalSessionStore; + +typedef int (*SignalGetIdentityKeyPair)(void *store_ctx, SignalPrivateKey **keyp); + +typedef int (*SignalGetLocalRegistrationId)(void *store_ctx, uint32_t *idp); + +typedef int (*SignalSaveIdentityKey)(void *store_ctx, const SignalProtocolAddress *address, const SignalPublicKey *public_key); + +typedef int (*SignalGetIdentityKey)(void *store_ctx, SignalPublicKey **public_keyp, const SignalProtocolAddress *address); + +typedef int (*SignalIsTrustedIdentity)(void *store_ctx, const SignalProtocolAddress *address, const SignalPublicKey *public_key, unsigned int direction); + +typedef struct { + void *ctx; + SignalGetIdentityKeyPair get_identity_key_pair; + SignalGetLocalRegistrationId get_local_registration_id; + SignalSaveIdentityKey save_identity; + SignalGetIdentityKey get_identity; + SignalIsTrustedIdentity is_trusted_identity; +} SignalIdentityKeyStore; + +typedef int (*SignalLoadPreKey)(void *store_ctx, SignalPreKeyRecord **recordp, uint32_t id); + +typedef int (*SignalStorePreKey)(void *store_ctx, uint32_t id, const SignalPreKeyRecord *record); + +typedef int (*SignalRemovePreKey)(void *store_ctx, uint32_t id); + +typedef struct { + void *ctx; + SignalLoadPreKey load_pre_key; + SignalStorePreKey store_pre_key; + SignalRemovePreKey remove_pre_key; +} SignalPreKeyStore; + +typedef int (*SignalLoadSignedPreKey)(void *store_ctx, SignalSignedPreKeyRecord **recordp, uint32_t id); + +typedef int (*SignalStoreSignedPreKey)(void *store_ctx, uint32_t id, const SignalSignedPreKeyRecord *record); + +typedef struct { + void *ctx; + SignalLoadSignedPreKey load_signed_pre_key; + SignalStoreSignedPreKey store_signed_pre_key; +} SignalSignedPreKeyStore; + +typedef bool (*SignalLogEnabledCallback)(const char *target, SignalLogLevel level); + +typedef void (*SignalLogCallback)(const char *target, SignalLogLevel level, const char *file, uint32_t line, const char *message); + +typedef void (*SignalLogFlushCallback)(void); + +typedef struct { + SignalLogEnabledCallback enabled; + SignalLogCallback log; + SignalLogFlushCallback flush; +} SignalFfiLogger; + +typedef struct { + unsigned char *base; + size_t length; +} SignalBorrowedMutableBuffer; + +typedef SignalKeyPair SignalKyberKeyPair; + +typedef SignalPublicKey SignalKyberPublicKey; + +/** + * A KEM secret key with the ability to decapsulate a shared secret. + */ +typedef SignalKeySecret SignalSecretKey; + +typedef SignalSecretKey SignalKyberSecretKey; + +/** + * The fixed-width binary representation of a ServiceId. + * + * Rarely used. The variable-width format that privileges ACIs is preferred. + */ +typedef uint8_t SignalServiceIdFixedWidthBinaryBytes[17]; + +typedef int (*SignalLoadKyberPreKey)(void *store_ctx, SignalKyberPreKeyRecord **recordp, uint32_t id); + +typedef int (*SignalStoreKyberPreKey)(void *store_ctx, uint32_t id, const SignalKyberPreKeyRecord *record); + +typedef int (*SignalMarkKyberPreKeyUsed)(void *store_ctx, uint32_t id); + +typedef struct { + void *ctx; + SignalLoadKyberPreKey load_kyber_pre_key; + SignalStoreKyberPreKey store_kyber_pre_key; + SignalMarkKyberPreKeyUsed mark_kyber_pre_key_used; +} SignalKyberPreKeyStore; + +typedef struct { + const SignalProtocolAddress *const *base; + size_t length; +} SignalBorrowedSliceOfProtocolAddress; + +typedef struct { + const SignalSessionRecord *const *base; + size_t length; +} SignalBorrowedSliceOfSessionRecord; + +typedef int (*SignalLoadSenderKey)(void *store_ctx, SignalSenderKeyRecord**, const SignalProtocolAddress*, const uint8_t (*distribution_id)[16]); + +typedef int (*SignalStoreSenderKey)(void *store_ctx, const SignalProtocolAddress*, const uint8_t (*distribution_id)[16], const SignalSenderKeyRecord*); + +typedef struct { + void *ctx; + SignalLoadSenderKey load_sender_key; + SignalStoreSenderKey store_sender_key; +} SignalSenderKeyStore; + +typedef int (*SignalRead)(void *ctx, uint8_t *buf, size_t buf_len, size_t *amount_read); + +typedef int (*SignalSkip)(void *ctx, uint64_t amount); + +typedef struct { + void *ctx; + SignalRead read; + SignalSkip skip; +} SignalInputStream; + +typedef SignalInputStream SignalSyncInputStream; + +/** + * A C callback used to report the results of Rust futures. + * + * cbindgen will produce independent C types like `SignalCPromisei32` and + * `SignalCPromiseProtocolAddress`. + */ +typedef void (*SignalCPromisei32)(SignalFfiError *error, const int32_t *result, const void *context); + +/** + * A C callback used to report the results of Rust futures. + * + * cbindgen will produce independent C types like `SignalCPromisei32` and + * `SignalCPromiseProtocolAddress`. + */ +typedef void (*SignalCPromiseTestingHandleType)(SignalFfiError *error, SignalTestingHandleType *const *result, const void *context); + +/** + * A C callback used to report the results of Rust futures. + * + * cbindgen will produce independent C types like `SignalCPromisei32` and + * `SignalCPromiseProtocolAddress`. + */ +typedef void (*SignalCPromiseOtherTestingHandleType)(SignalFfiError *error, SignalOtherTestingHandleType *const *result, const void *context); + +/** + * A C callback used to report the results of Rust futures. + * + * cbindgen will produce independent C types like `SignalCPromisei32` and + * `SignalCPromiseProtocolAddress`. + */ +typedef void (*SignalCPromisebool)(SignalFfiError *error, const bool *result, const void *context); + +/** + * A C callback used to report the results of Rust futures. + * + * cbindgen will produce independent C types like `SignalCPromisei32` and + * `SignalCPromiseProtocolAddress`. + */ +typedef void (*SignalCPromiseRawPointer)(SignalFfiError *error, const void *const *result, const void *context); + +typedef uint8_t SignalRandomnessBytes[SignalRANDOMNESS_LEN]; + +void signal_print_ptr(const void *p); + +void signal_free_string(const char *buf); + +void signal_free_buffer(const unsigned char *buf, size_t buf_len); + +SignalFfiError *signal_error_get_message(const SignalFfiError *err, const char **out); + +SignalFfiError *signal_error_get_address(const SignalFfiError *err, SignalProtocolAddress **out); + +SignalFfiError *signal_error_get_uuid(const SignalFfiError *err, uint8_t (*out)[16]); + +uint32_t signal_error_get_type(const SignalFfiError *err); + +void signal_error_free(SignalFfiError *err); + +SignalFfiError *signal_identitykeypair_deserialize(SignalPrivateKey **private_key, SignalPublicKey **public_key, SignalBorrowedBuffer input); + +SignalFfiError *signal_sealed_session_cipher_decrypt(SignalOwnedBuffer *out, const char **sender_e164, const char **sender_uuid, uint32_t *sender_device_id, SignalBorrowedBuffer ctext, const SignalPublicKey *trust_root, uint64_t timestamp, const char *local_e164, const char *local_uuid, unsigned int local_device_id, const SignalSessionStore *session_store, const SignalIdentityKeyStore *identity_store, const SignalPreKeyStore *prekey_store, const SignalSignedPreKeyStore *signed_prekey_store); + +void signal_init_logger(SignalLogLevel max_level, SignalFfiLogger logger); + +SignalFfiError *signal_aes256_gcm_siv_destroy(SignalAes256GcmSiv *p); + +SignalFfiError *signal_aes256_ctr32_destroy(SignalAes256Ctr32 *p); + +SignalFfiError *signal_aes256_gcm_encryption_destroy(SignalAes256GcmEncryption *p); + +SignalFfiError *signal_aes256_gcm_decryption_destroy(SignalAes256GcmDecryption *p); + +SignalFfiError *signal_aes256_ctr32_new(SignalAes256Ctr32 **out, SignalBorrowedBuffer key, SignalBorrowedBuffer nonce, uint32_t initial_ctr); + +SignalFfiError *signal_aes256_ctr32_process(SignalAes256Ctr32 *ctr, SignalBorrowedMutableBuffer data, uint32_t offset, uint32_t length); + +SignalFfiError *signal_aes256_gcm_encryption_new(SignalAes256GcmEncryption **out, SignalBorrowedBuffer key, SignalBorrowedBuffer nonce, SignalBorrowedBuffer associated_data); + +SignalFfiError *signal_aes256_gcm_encryption_update(SignalAes256GcmEncryption *gcm, SignalBorrowedMutableBuffer data, uint32_t offset, uint32_t length); + +SignalFfiError *signal_aes256_gcm_encryption_compute_tag(SignalOwnedBuffer *out, SignalAes256GcmEncryption *gcm); + +SignalFfiError *signal_aes256_gcm_decryption_new(SignalAes256GcmDecryption **out, SignalBorrowedBuffer key, SignalBorrowedBuffer nonce, SignalBorrowedBuffer associated_data); + +SignalFfiError *signal_aes256_gcm_decryption_update(SignalAes256GcmDecryption *gcm, SignalBorrowedMutableBuffer data, uint32_t offset, uint32_t length); + +SignalFfiError *signal_aes256_gcm_decryption_verify_tag(bool *out, SignalAes256GcmDecryption *gcm, SignalBorrowedBuffer tag); + +SignalFfiError *signal_aes256_gcm_siv_new(SignalAes256GcmSiv **out, SignalBorrowedBuffer key); + +SignalFfiError *signal_aes256_gcm_siv_encrypt(SignalOwnedBuffer *out, const SignalAes256GcmSiv *aes_gcm_siv_obj, SignalBorrowedBuffer ptext, SignalBorrowedBuffer nonce, SignalBorrowedBuffer associated_data); + +SignalFfiError *signal_aes256_gcm_siv_decrypt(SignalOwnedBuffer *out, const SignalAes256GcmSiv *aes_gcm_siv, SignalBorrowedBuffer ctext, SignalBorrowedBuffer nonce, SignalBorrowedBuffer associated_data); + +SignalFfiError *signal_ciphertext_message_destroy(SignalCiphertextMessage *p); + +SignalFfiError *signal_decryption_error_message_destroy(SignalDecryptionErrorMessage *p); + +SignalFfiError *signal_decryption_error_message_clone(SignalDecryptionErrorMessage **new_obj, const SignalDecryptionErrorMessage *obj); + +SignalFfiError *signal_fingerprint_destroy(SignalFingerprint *p); + +SignalFfiError *signal_fingerprint_clone(SignalFingerprint **new_obj, const SignalFingerprint *obj); + +SignalFfiError *signal_plaintext_content_destroy(SignalPlaintextContent *p); + +SignalFfiError *signal_plaintext_content_clone(SignalPlaintextContent **new_obj, const SignalPlaintextContent *obj); + +SignalFfiError *signal_pre_key_bundle_destroy(SignalPreKeyBundle *p); + +SignalFfiError *signal_pre_key_bundle_clone(SignalPreKeyBundle **new_obj, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_record_destroy(SignalPreKeyRecord *p); + +SignalFfiError *signal_pre_key_record_clone(SignalPreKeyRecord **new_obj, const SignalPreKeyRecord *obj); + +SignalFfiError *signal_pre_key_signal_message_destroy(SignalPreKeySignalMessage *p); + +SignalFfiError *signal_pre_key_signal_message_clone(SignalPreKeySignalMessage **new_obj, const SignalPreKeySignalMessage *obj); + +SignalFfiError *signal_privatekey_destroy(SignalPrivateKey *p); + +SignalFfiError *signal_privatekey_clone(SignalPrivateKey **new_obj, const SignalPrivateKey *obj); + +SignalFfiError *signal_address_destroy(SignalProtocolAddress *p); + +SignalFfiError *signal_address_clone(SignalProtocolAddress **new_obj, const SignalProtocolAddress *obj); + +SignalFfiError *signal_publickey_destroy(SignalPublicKey *p); + +SignalFfiError *signal_publickey_clone(SignalPublicKey **new_obj, const SignalPublicKey *obj); + +SignalFfiError *signal_sender_certificate_destroy(SignalSenderCertificate *p); + +SignalFfiError *signal_sender_certificate_clone(SignalSenderCertificate **new_obj, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_key_distribution_message_destroy(SignalSenderKeyDistributionMessage *p); + +SignalFfiError *signal_sender_key_distribution_message_clone(SignalSenderKeyDistributionMessage **new_obj, const SignalSenderKeyDistributionMessage *obj); + +SignalFfiError *signal_sender_key_message_destroy(SignalSenderKeyMessage *p); + +SignalFfiError *signal_sender_key_message_clone(SignalSenderKeyMessage **new_obj, const SignalSenderKeyMessage *obj); + +SignalFfiError *signal_sender_key_record_destroy(SignalSenderKeyRecord *p); + +SignalFfiError *signal_sender_key_record_clone(SignalSenderKeyRecord **new_obj, const SignalSenderKeyRecord *obj); + +SignalFfiError *signal_server_certificate_destroy(SignalServerCertificate *p); + +SignalFfiError *signal_server_certificate_clone(SignalServerCertificate **new_obj, const SignalServerCertificate *obj); + +SignalFfiError *signal_session_record_destroy(SignalSessionRecord *p); + +SignalFfiError *signal_session_record_clone(SignalSessionRecord **new_obj, const SignalSessionRecord *obj); + +SignalFfiError *signal_message_destroy(SignalMessage *p); + +SignalFfiError *signal_message_clone(SignalMessage **new_obj, const SignalMessage *obj); + +SignalFfiError *signal_signed_pre_key_record_destroy(SignalSignedPreKeyRecord *p); + +SignalFfiError *signal_signed_pre_key_record_clone(SignalSignedPreKeyRecord **new_obj, const SignalSignedPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_destroy(SignalKyberPreKeyRecord *p); + +SignalFfiError *signal_kyber_pre_key_record_clone(SignalKyberPreKeyRecord **new_obj, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_unidentified_sender_message_content_destroy(SignalUnidentifiedSenderMessageContent *p); + +SignalFfiError *signal_kyber_key_pair_destroy(SignalKyberKeyPair *p); + +SignalFfiError *signal_kyber_key_pair_clone(SignalKyberKeyPair **new_obj, const SignalKyberKeyPair *obj); + +SignalFfiError *signal_kyber_public_key_destroy(SignalKyberPublicKey *p); + +SignalFfiError *signal_kyber_public_key_clone(SignalKyberPublicKey **new_obj, const SignalKyberPublicKey *obj); + +SignalFfiError *signal_kyber_secret_key_destroy(SignalKyberSecretKey *p); + +SignalFfiError *signal_kyber_secret_key_clone(SignalKyberSecretKey **new_obj, const SignalKyberSecretKey *obj); + +SignalFfiError *signal_hkdf_derive(SignalBorrowedMutableBuffer output, SignalBorrowedBuffer ikm, SignalBorrowedBuffer label, SignalBorrowedBuffer salt); + +SignalFfiError *signal_service_id_service_id_binary(SignalOwnedBuffer *out, const SignalServiceIdFixedWidthBinaryBytes *value); + +SignalFfiError *signal_service_id_service_id_string(const char **out, const SignalServiceIdFixedWidthBinaryBytes *value); + +SignalFfiError *signal_service_id_service_id_log(const char **out, const SignalServiceIdFixedWidthBinaryBytes *value); + +SignalFfiError *signal_service_id_parse_from_service_id_binary(SignalServiceIdFixedWidthBinaryBytes *out, SignalBorrowedBuffer input); + +SignalFfiError *signal_service_id_parse_from_service_id_string(SignalServiceIdFixedWidthBinaryBytes *out, const char *input); + +SignalFfiError *signal_address_new(SignalProtocolAddress **out, const char *name, uint32_t device_id); + +SignalFfiError *signal_publickey_deserialize(SignalPublicKey **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_publickey_serialize(SignalOwnedBuffer *out, const SignalPublicKey *obj); + +SignalFfiError *signal_publickey_get_public_key_bytes(SignalOwnedBuffer *out, const SignalPublicKey *obj); + +SignalFfiError *signal_address_get_device_id(uint32_t *out, const SignalProtocolAddress *obj); + +SignalFfiError *signal_address_get_name(const char **out, const SignalProtocolAddress *obj); + +SignalFfiError *signal_publickey_equals(bool *out, const SignalPublicKey *lhs, const SignalPublicKey *rhs); + +SignalFfiError *signal_publickey_compare(int32_t *out, const SignalPublicKey *key1, const SignalPublicKey *key2); + +SignalFfiError *signal_publickey_verify(bool *out, const SignalPublicKey *key, SignalBorrowedBuffer message, SignalBorrowedBuffer signature); + +SignalFfiError *signal_privatekey_deserialize(SignalPrivateKey **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_privatekey_serialize(SignalOwnedBuffer *out, const SignalPrivateKey *obj); + +SignalFfiError *signal_privatekey_generate(SignalPrivateKey **out); + +SignalFfiError *signal_privatekey_get_public_key(SignalPublicKey **out, const SignalPrivateKey *k); + +SignalFfiError *signal_privatekey_sign(SignalOwnedBuffer *out, const SignalPrivateKey *key, SignalBorrowedBuffer message); + +SignalFfiError *signal_privatekey_agree(SignalOwnedBuffer *out, const SignalPrivateKey *private_key, const SignalPublicKey *public_key); + +SignalFfiError *signal_kyber_public_key_serialize(SignalOwnedBuffer *out, const SignalKyberPublicKey *obj); + +SignalFfiError *signal_kyber_public_key_deserialize(SignalKyberPublicKey **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_kyber_secret_key_serialize(SignalOwnedBuffer *out, const SignalKyberSecretKey *obj); + +SignalFfiError *signal_kyber_secret_key_deserialize(SignalKyberSecretKey **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_kyber_public_key_equals(bool *out, const SignalKyberPublicKey *lhs, const SignalKyberPublicKey *rhs); + +SignalFfiError *signal_kyber_key_pair_generate(SignalKyberKeyPair **out); + +SignalFfiError *signal_kyber_key_pair_get_public_key(SignalKyberPublicKey **out, const SignalKyberKeyPair *key_pair); + +SignalFfiError *signal_kyber_key_pair_get_secret_key(SignalKyberSecretKey **out, const SignalKyberKeyPair *key_pair); + +SignalFfiError *signal_identitykeypair_serialize(SignalOwnedBuffer *out, const SignalPublicKey *public_key, const SignalPrivateKey *private_key); + +SignalFfiError *signal_identitykeypair_sign_alternate_identity(SignalOwnedBuffer *out, const SignalPublicKey *public_key, const SignalPrivateKey *private_key, const SignalPublicKey *other_identity); + +SignalFfiError *signal_identitykey_verify_alternate_identity(bool *out, const SignalPublicKey *public_key, const SignalPublicKey *other_identity, SignalBorrowedBuffer signature); + +SignalFfiError *signal_fingerprint_new(SignalFingerprint **out, uint32_t iterations, uint32_t version, SignalBorrowedBuffer local_identifier, const SignalPublicKey *local_key, SignalBorrowedBuffer remote_identifier, const SignalPublicKey *remote_key); + +SignalFfiError *signal_fingerprint_scannable_encoding(SignalOwnedBuffer *out, const SignalFingerprint *obj); + +SignalFfiError *signal_fingerprint_display_string(const char **out, const SignalFingerprint *obj); + +SignalFfiError *signal_fingerprint_compare(bool *out, SignalBorrowedBuffer fprint1, SignalBorrowedBuffer fprint2); + +SignalFfiError *signal_message_deserialize(SignalMessage **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_message_get_body(SignalOwnedBuffer *out, const SignalMessage *obj); + +SignalFfiError *signal_message_get_serialized(SignalOwnedBuffer *out, const SignalMessage *obj); + +SignalFfiError *signal_message_get_counter(uint32_t *out, const SignalMessage *obj); + +SignalFfiError *signal_message_get_message_version(uint32_t *out, const SignalMessage *obj); + +SignalFfiError *signal_message_new(SignalMessage **out, uint8_t message_version, SignalBorrowedBuffer mac_key, const SignalPublicKey *sender_ratchet_key, uint32_t counter, uint32_t previous_counter, SignalBorrowedBuffer ciphertext, const SignalPublicKey *sender_identity_key, const SignalPublicKey *receiver_identity_key); + +SignalFfiError *signal_message_verify_mac(bool *out, const SignalMessage *msg, const SignalPublicKey *sender_identity_key, const SignalPublicKey *receiver_identity_key, SignalBorrowedBuffer mac_key); + +SignalFfiError *signal_message_get_sender_ratchet_key(SignalPublicKey **out, const SignalMessage *m); + +SignalFfiError *signal_pre_key_signal_message_new(SignalPreKeySignalMessage **out, uint8_t message_version, uint32_t registration_id, uint32_t pre_key_id, uint32_t signed_pre_key_id, const SignalPublicKey *base_key, const SignalPublicKey *identity_key, const SignalMessage *signal_message); + +SignalFfiError *signal_pre_key_signal_message_get_base_key(SignalPublicKey **out, const SignalPreKeySignalMessage *m); + +SignalFfiError *signal_pre_key_signal_message_get_identity_key(SignalPublicKey **out, const SignalPreKeySignalMessage *m); + +SignalFfiError *signal_pre_key_signal_message_get_signal_message(SignalMessage **out, const SignalPreKeySignalMessage *m); + +SignalFfiError *signal_pre_key_signal_message_deserialize(SignalPreKeySignalMessage **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_pre_key_signal_message_serialize(SignalOwnedBuffer *out, const SignalPreKeySignalMessage *obj); + +SignalFfiError *signal_pre_key_signal_message_get_registration_id(uint32_t *out, const SignalPreKeySignalMessage *obj); + +SignalFfiError *signal_pre_key_signal_message_get_signed_pre_key_id(uint32_t *out, const SignalPreKeySignalMessage *obj); + +SignalFfiError *signal_pre_key_signal_message_get_pre_key_id(uint32_t *out, const SignalPreKeySignalMessage *obj); + +SignalFfiError *signal_pre_key_signal_message_get_version(uint32_t *out, const SignalPreKeySignalMessage *obj); + +SignalFfiError *signal_sender_key_message_deserialize(SignalSenderKeyMessage **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_sender_key_message_get_cipher_text(SignalOwnedBuffer *out, const SignalSenderKeyMessage *obj); + +SignalFfiError *signal_sender_key_message_serialize(SignalOwnedBuffer *out, const SignalSenderKeyMessage *obj); + +SignalFfiError *signal_sender_key_message_get_distribution_id(uint8_t (*out)[16], const SignalSenderKeyMessage *obj); + +SignalFfiError *signal_sender_key_message_get_chain_id(uint32_t *out, const SignalSenderKeyMessage *obj); + +SignalFfiError *signal_sender_key_message_get_iteration(uint32_t *out, const SignalSenderKeyMessage *obj); + +SignalFfiError *signal_sender_key_message_new(SignalSenderKeyMessage **out, uint8_t message_version, const uint8_t (*distribution_id)[16], uint32_t chain_id, uint32_t iteration, SignalBorrowedBuffer ciphertext, const SignalPrivateKey *pk); + +SignalFfiError *signal_sender_key_message_verify_signature(bool *out, const SignalSenderKeyMessage *skm, const SignalPublicKey *pubkey); + +SignalFfiError *signal_sender_key_distribution_message_deserialize(SignalSenderKeyDistributionMessage **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_sender_key_distribution_message_get_chain_key(SignalOwnedBuffer *out, const SignalSenderKeyDistributionMessage *obj); + +SignalFfiError *signal_sender_key_distribution_message_serialize(SignalOwnedBuffer *out, const SignalSenderKeyDistributionMessage *obj); + +SignalFfiError *signal_sender_key_distribution_message_get_distribution_id(uint8_t (*out)[16], const SignalSenderKeyDistributionMessage *obj); + +SignalFfiError *signal_sender_key_distribution_message_get_chain_id(uint32_t *out, const SignalSenderKeyDistributionMessage *obj); + +SignalFfiError *signal_sender_key_distribution_message_get_iteration(uint32_t *out, const SignalSenderKeyDistributionMessage *obj); + +SignalFfiError *signal_sender_key_distribution_message_new(SignalSenderKeyDistributionMessage **out, uint8_t message_version, const uint8_t (*distribution_id)[16], uint32_t chain_id, uint32_t iteration, SignalBorrowedBuffer chainkey, const SignalPublicKey *pk); + +SignalFfiError *signal_sender_key_distribution_message_get_signature_key(SignalPublicKey **out, const SignalSenderKeyDistributionMessage *m); + +SignalFfiError *signal_decryption_error_message_deserialize(SignalDecryptionErrorMessage **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_decryption_error_message_get_timestamp(uint64_t *out, const SignalDecryptionErrorMessage *obj); + +SignalFfiError *signal_decryption_error_message_get_device_id(uint32_t *out, const SignalDecryptionErrorMessage *obj); + +SignalFfiError *signal_decryption_error_message_serialize(SignalOwnedBuffer *out, const SignalDecryptionErrorMessage *obj); + +SignalFfiError *signal_decryption_error_message_get_ratchet_key(SignalPublicKey **out, const SignalDecryptionErrorMessage *m); + +SignalFfiError *signal_decryption_error_message_for_original_message(SignalDecryptionErrorMessage **out, SignalBorrowedBuffer original_bytes, uint8_t original_type, uint64_t original_timestamp, uint32_t original_sender_device_id); + +SignalFfiError *signal_decryption_error_message_extract_from_serialized_content(SignalDecryptionErrorMessage **out, SignalBorrowedBuffer bytes); + +SignalFfiError *signal_plaintext_content_deserialize(SignalPlaintextContent **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_plaintext_content_serialize(SignalOwnedBuffer *out, const SignalPlaintextContent *obj); + +SignalFfiError *signal_plaintext_content_get_body(SignalOwnedBuffer *out, const SignalPlaintextContent *obj); + +SignalFfiError *signal_plaintext_content_from_decryption_error_message(SignalPlaintextContent **out, const SignalDecryptionErrorMessage *m); + +SignalFfiError *signal_pre_key_bundle_new(SignalPreKeyBundle **out, uint32_t registration_id, uint32_t device_id, uint32_t prekey_id, const SignalPublicKey *prekey, uint32_t signed_prekey_id, const SignalPublicKey *signed_prekey, SignalBorrowedBuffer signed_prekey_signature, const SignalPublicKey *identity_key, uint32_t kyber_prekey_id, const SignalKyberPublicKey *kyber_prekey, SignalBorrowedBuffer kyber_prekey_signature); + +SignalFfiError *signal_pre_key_bundle_get_identity_key(SignalPublicKey **out, const SignalPreKeyBundle *p); + +SignalFfiError *signal_pre_key_bundle_get_signed_pre_key_signature(SignalOwnedBuffer *out, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_bundle_get_registration_id(uint32_t *out, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_bundle_get_device_id(uint32_t *out, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_bundle_get_signed_pre_key_id(uint32_t *out, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_bundle_get_pre_key_id(uint32_t *out, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_bundle_get_pre_key_public(SignalPublicKey **out, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_bundle_get_signed_pre_key_public(SignalPublicKey **out, const SignalPreKeyBundle *obj); + +SignalFfiError *signal_pre_key_bundle_get_kyber_pre_key_public(SignalKyberPublicKey **out, const SignalPreKeyBundle *bundle); + +SignalFfiError *signal_pre_key_bundle_get_kyber_pre_key_signature(SignalOwnedBuffer *out, const SignalPreKeyBundle *bundle); + +SignalFfiError *signal_signed_pre_key_record_deserialize(SignalSignedPreKeyRecord **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_signed_pre_key_record_get_signature(SignalOwnedBuffer *out, const SignalSignedPreKeyRecord *obj); + +SignalFfiError *signal_signed_pre_key_record_serialize(SignalOwnedBuffer *out, const SignalSignedPreKeyRecord *obj); + +SignalFfiError *signal_signed_pre_key_record_get_id(uint32_t *out, const SignalSignedPreKeyRecord *obj); + +SignalFfiError *signal_signed_pre_key_record_get_timestamp(uint64_t *out, const SignalSignedPreKeyRecord *obj); + +SignalFfiError *signal_signed_pre_key_record_get_public_key(SignalPublicKey **out, const SignalSignedPreKeyRecord *obj); + +SignalFfiError *signal_signed_pre_key_record_get_private_key(SignalPrivateKey **out, const SignalSignedPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_deserialize(SignalKyberPreKeyRecord **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_kyber_pre_key_record_get_signature(SignalOwnedBuffer *out, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_serialize(SignalOwnedBuffer *out, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_get_id(uint32_t *out, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_get_timestamp(uint64_t *out, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_get_public_key(SignalKyberPublicKey **out, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_get_secret_key(SignalKyberSecretKey **out, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_kyber_pre_key_record_get_key_pair(SignalKyberKeyPair **out, const SignalKyberPreKeyRecord *obj); + +SignalFfiError *signal_signed_pre_key_record_new(SignalSignedPreKeyRecord **out, uint32_t id, uint64_t timestamp, const SignalPublicKey *pub_key, const SignalPrivateKey *priv_key, SignalBorrowedBuffer signature); + +SignalFfiError *signal_kyber_pre_key_record_new(SignalKyberPreKeyRecord **out, uint32_t id, uint64_t timestamp, const SignalKyberKeyPair *key_pair, SignalBorrowedBuffer signature); + +SignalFfiError *signal_pre_key_record_deserialize(SignalPreKeyRecord **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_pre_key_record_serialize(SignalOwnedBuffer *out, const SignalPreKeyRecord *obj); + +SignalFfiError *signal_pre_key_record_get_id(uint32_t *out, const SignalPreKeyRecord *obj); + +SignalFfiError *signal_pre_key_record_get_public_key(SignalPublicKey **out, const SignalPreKeyRecord *obj); + +SignalFfiError *signal_pre_key_record_get_private_key(SignalPrivateKey **out, const SignalPreKeyRecord *obj); + +SignalFfiError *signal_pre_key_record_new(SignalPreKeyRecord **out, uint32_t id, const SignalPublicKey *pub_key, const SignalPrivateKey *priv_key); + +SignalFfiError *signal_sender_key_record_deserialize(SignalSenderKeyRecord **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_sender_key_record_serialize(SignalOwnedBuffer *out, const SignalSenderKeyRecord *obj); + +SignalFfiError *signal_server_certificate_deserialize(SignalServerCertificate **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_server_certificate_get_serialized(SignalOwnedBuffer *out, const SignalServerCertificate *obj); + +SignalFfiError *signal_server_certificate_get_certificate(SignalOwnedBuffer *out, const SignalServerCertificate *obj); + +SignalFfiError *signal_server_certificate_get_signature(SignalOwnedBuffer *out, const SignalServerCertificate *obj); + +SignalFfiError *signal_server_certificate_get_key_id(uint32_t *out, const SignalServerCertificate *obj); + +SignalFfiError *signal_server_certificate_get_key(SignalPublicKey **out, const SignalServerCertificate *obj); + +SignalFfiError *signal_server_certificate_new(SignalServerCertificate **out, uint32_t key_id, const SignalPublicKey *server_key, const SignalPrivateKey *trust_root); + +SignalFfiError *signal_sender_certificate_deserialize(SignalSenderCertificate **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_sender_certificate_get_serialized(SignalOwnedBuffer *out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_get_certificate(SignalOwnedBuffer *out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_get_signature(SignalOwnedBuffer *out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_get_sender_uuid(const char **out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_get_sender_e164(const char **out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_get_expiration(uint64_t *out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_get_device_id(uint32_t *out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_get_key(SignalPublicKey **out, const SignalSenderCertificate *obj); + +SignalFfiError *signal_sender_certificate_validate(bool *out, const SignalSenderCertificate *cert, const SignalPublicKey *key, uint64_t time); + +SignalFfiError *signal_sender_certificate_get_server_certificate(SignalServerCertificate **out, const SignalSenderCertificate *cert); + +SignalFfiError *signal_sender_certificate_new(SignalSenderCertificate **out, const char *sender_uuid, const char *sender_e164, uint32_t sender_device_id, const SignalPublicKey *sender_key, uint64_t expiration, const SignalServerCertificate *signer_cert, const SignalPrivateKey *signer_key); + +SignalFfiError *signal_unidentified_sender_message_content_deserialize(SignalUnidentifiedSenderMessageContent **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_unidentified_sender_message_content_serialize(SignalOwnedBuffer *out, const SignalUnidentifiedSenderMessageContent *obj); + +SignalFfiError *signal_unidentified_sender_message_content_get_contents(SignalOwnedBuffer *out, const SignalUnidentifiedSenderMessageContent *obj); + +SignalFfiError *signal_unidentified_sender_message_content_get_group_id_or_empty(SignalOwnedBuffer *out, const SignalUnidentifiedSenderMessageContent *m); + +SignalFfiError *signal_unidentified_sender_message_content_get_sender_cert(SignalSenderCertificate **out, const SignalUnidentifiedSenderMessageContent *m); + +SignalFfiError *signal_unidentified_sender_message_content_get_msg_type(uint8_t *out, const SignalUnidentifiedSenderMessageContent *m); + +SignalFfiError *signal_unidentified_sender_message_content_get_content_hint(uint32_t *out, const SignalUnidentifiedSenderMessageContent *m); + +SignalFfiError *signal_unidentified_sender_message_content_new(SignalUnidentifiedSenderMessageContent **out, const SignalCiphertextMessage *message, const SignalSenderCertificate *sender, uint32_t content_hint, SignalBorrowedBuffer group_id); + +SignalFfiError *signal_ciphertext_message_type(uint8_t *out, const SignalCiphertextMessage *msg); + +SignalFfiError *signal_ciphertext_message_serialize(SignalOwnedBuffer *out, const SignalCiphertextMessage *obj); + +SignalFfiError *signal_ciphertext_message_from_plaintext_content(SignalCiphertextMessage **out, const SignalPlaintextContent *m); + +SignalFfiError *signal_session_record_archive_current_state(SignalSessionRecord *session_record); + +SignalFfiError *signal_session_record_has_usable_sender_chain(bool *out, const SignalSessionRecord *s, uint64_t now); + +SignalFfiError *signal_session_record_current_ratchet_key_matches(bool *out, const SignalSessionRecord *s, const SignalPublicKey *key); + +SignalFfiError *signal_session_record_deserialize(SignalSessionRecord **out, SignalBorrowedBuffer data); + +SignalFfiError *signal_session_record_serialize(SignalOwnedBuffer *out, const SignalSessionRecord *obj); + +SignalFfiError *signal_session_record_get_local_registration_id(uint32_t *out, const SignalSessionRecord *obj); + +SignalFfiError *signal_session_record_get_remote_registration_id(uint32_t *out, const SignalSessionRecord *obj); + +SignalFfiError *signal_process_prekey_bundle(const SignalPreKeyBundle *bundle, const SignalProtocolAddress *protocol_address, const SignalSessionStore *session_store, const SignalIdentityKeyStore *identity_key_store, uint64_t now); + +SignalFfiError *signal_encrypt_message(SignalCiphertextMessage **out, SignalBorrowedBuffer ptext, const SignalProtocolAddress *protocol_address, const SignalSessionStore *session_store, const SignalIdentityKeyStore *identity_key_store, uint64_t now); + +SignalFfiError *signal_decrypt_message(SignalOwnedBuffer *out, const SignalMessage *message, const SignalProtocolAddress *protocol_address, const SignalSessionStore *session_store, const SignalIdentityKeyStore *identity_key_store); + +SignalFfiError *signal_decrypt_pre_key_message(SignalOwnedBuffer *out, const SignalPreKeySignalMessage *message, const SignalProtocolAddress *protocol_address, const SignalSessionStore *session_store, const SignalIdentityKeyStore *identity_key_store, const SignalPreKeyStore *prekey_store, const SignalSignedPreKeyStore *signed_prekey_store, const SignalKyberPreKeyStore *kyber_prekey_store); + +SignalFfiError *signal_sealed_session_cipher_encrypt(SignalOwnedBuffer *out, const SignalProtocolAddress *destination, const SignalUnidentifiedSenderMessageContent *content, const SignalIdentityKeyStore *identity_key_store); + +SignalFfiError *signal_sealed_sender_multi_recipient_encrypt(SignalOwnedBuffer *out, SignalBorrowedSliceOfProtocolAddress recipients, SignalBorrowedSliceOfSessionRecord recipient_sessions, SignalBorrowedBuffer excluded_recipients, const SignalUnidentifiedSenderMessageContent *content, const SignalIdentityKeyStore *identity_key_store); + +SignalFfiError *signal_sealed_sender_multi_recipient_message_for_single_recipient(SignalOwnedBuffer *out, SignalBorrowedBuffer encoded_multi_recipient_message); + +SignalFfiError *signal_sealed_session_cipher_decrypt_to_usmc(SignalUnidentifiedSenderMessageContent **out, SignalBorrowedBuffer ctext, const SignalIdentityKeyStore *identity_store); + +SignalFfiError *signal_sender_key_distribution_message_create(SignalSenderKeyDistributionMessage **out, const SignalProtocolAddress *sender, const uint8_t (*distribution_id)[16], const SignalSenderKeyStore *store); + +SignalFfiError *signal_process_sender_key_distribution_message(const SignalProtocolAddress *sender, const SignalSenderKeyDistributionMessage *sender_key_distribution_message, const SignalSenderKeyStore *store); + +SignalFfiError *signal_group_encrypt_message(SignalCiphertextMessage **out, const SignalProtocolAddress *sender, const uint8_t (*distribution_id)[16], SignalBorrowedBuffer message, const SignalSenderKeyStore *store); + +SignalFfiError *signal_group_decrypt_message(SignalOwnedBuffer *out, const SignalProtocolAddress *sender, SignalBorrowedBuffer message, const SignalSenderKeyStore *store); + +SignalFfiError *signal_device_transfer_generate_private_key(SignalOwnedBuffer *out); + +SignalFfiError *signal_device_transfer_generate_private_key_with_format(SignalOwnedBuffer *out, uint8_t key_format); + +SignalFfiError *signal_device_transfer_generate_certificate(SignalOwnedBuffer *out, SignalBorrowedBuffer private_key, const char *name, uint32_t days_to_expire); + +SignalFfiError *signal_cds2_client_state_new(SignalSgxClientState **out, SignalBorrowedBuffer mrenclave, SignalBorrowedBuffer attestation_msg, uint64_t current_timestamp); + +SignalFfiError *signal_sgx_client_state_destroy(SignalSgxClientState *p); + +SignalFfiError *signal_sgx_client_state_initial_request(SignalOwnedBuffer *out, const SignalSgxClientState *obj); + +SignalFfiError *signal_sgx_client_state_complete_handshake(SignalSgxClientState *cli, SignalBorrowedBuffer handshake_received); + +SignalFfiError *signal_sgx_client_state_established_send(SignalOwnedBuffer *out, SignalSgxClientState *cli, SignalBorrowedBuffer plaintext_to_send); + +SignalFfiError *signal_sgx_client_state_established_recv(SignalOwnedBuffer *out, SignalSgxClientState *cli, SignalBorrowedBuffer received_ciphertext); + +SignalFfiError *signal_hsm_enclave_client_destroy(SignalHsmEnclaveClient *p); + +SignalFfiError *signal_hsm_enclave_client_new(SignalHsmEnclaveClient **out, SignalBorrowedBuffer trusted_public_key, SignalBorrowedBuffer trusted_code_hashes); + +SignalFfiError *signal_hsm_enclave_client_initial_request(SignalOwnedBuffer *out, const SignalHsmEnclaveClient *obj); + +SignalFfiError *signal_hsm_enclave_client_complete_handshake(SignalHsmEnclaveClient *cli, SignalBorrowedBuffer handshake_received); + +SignalFfiError *signal_hsm_enclave_client_established_send(SignalOwnedBuffer *out, SignalHsmEnclaveClient *cli, SignalBorrowedBuffer plaintext_to_send); + +SignalFfiError *signal_hsm_enclave_client_established_recv(SignalOwnedBuffer *out, SignalHsmEnclaveClient *cli, SignalBorrowedBuffer received_ciphertext); + +SignalFfiError *signal_auth_credential_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_auth_credential_response_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_auth_credential_with_pni_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_auth_credential_with_pni_response_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_expiring_profile_key_credential_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_expiring_profile_key_credential_response_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_group_master_key_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_group_public_params_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_group_secret_params_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_profile_key_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_profile_key_ciphertext_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_profile_key_commitment_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_profile_key_credential_request_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_profile_key_credential_request_context_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_receipt_credential_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_receipt_credential_presentation_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_receipt_credential_request_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_receipt_credential_request_context_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_receipt_credential_response_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_server_public_params_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_server_secret_params_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_uuid_ciphertext_check_valid_contents(SignalBorrowedBuffer buffer); + +SignalFfiError *signal_profile_key_get_commitment(unsigned char (*out)[SignalPROFILE_KEY_COMMITMENT_LEN], const unsigned char (*profile_key)[SignalPROFILE_KEY_LEN], const SignalServiceIdFixedWidthBinaryBytes *user_id); + +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_profile_key_derive_access_key(uint8_t (*out)[SignalACCESS_KEY_LEN], const unsigned char (*profile_key)[SignalPROFILE_KEY_LEN]); + +SignalFfiError *signal_group_secret_params_generate_deterministic(unsigned char (*out)[SignalGROUP_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_group_secret_params_derive_from_master_key(unsigned char (*out)[SignalGROUP_SECRET_PARAMS_LEN], const unsigned char (*master_key)[SignalGROUP_MASTER_KEY_LEN]); + +SignalFfiError *signal_group_secret_params_get_master_key(unsigned char (*out)[SignalGROUP_MASTER_KEY_LEN], const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN]); + +SignalFfiError *signal_group_secret_params_get_public_params(unsigned char (*out)[SignalGROUP_PUBLIC_PARAMS_LEN], const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN]); + +SignalFfiError *signal_group_secret_params_encrypt_service_id(unsigned char (*out)[SignalUUID_CIPHERTEXT_LEN], const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN], const SignalServiceIdFixedWidthBinaryBytes *service_id); + +SignalFfiError *signal_group_secret_params_decrypt_service_id(SignalServiceIdFixedWidthBinaryBytes *out, const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN], const unsigned char (*ciphertext)[SignalUUID_CIPHERTEXT_LEN]); + +SignalFfiError *signal_group_secret_params_encrypt_profile_key(unsigned char (*out)[SignalPROFILE_KEY_CIPHERTEXT_LEN], const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN], const unsigned char (*profile_key)[SignalPROFILE_KEY_LEN], const SignalServiceIdFixedWidthBinaryBytes *user_id); + +SignalFfiError *signal_group_secret_params_decrypt_profile_key(unsigned char (*out)[SignalPROFILE_KEY_LEN], const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN], const unsigned char (*profile_key)[SignalPROFILE_KEY_CIPHERTEXT_LEN], const SignalServiceIdFixedWidthBinaryBytes *user_id); + +SignalFfiError *signal_group_secret_params_encrypt_blob_with_padding_deterministic(SignalOwnedBuffer *out, const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], SignalBorrowedBuffer plaintext, uint32_t padding_len); + +SignalFfiError *signal_group_secret_params_decrypt_blob_with_padding(SignalOwnedBuffer *out, const unsigned char (*params)[SignalGROUP_SECRET_PARAMS_LEN], SignalBorrowedBuffer ciphertext); + +SignalFfiError *signal_server_secret_params_generate_deterministic(unsigned char (*out)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_server_secret_params_get_public_params(unsigned char (*out)[SignalSERVER_PUBLIC_PARAMS_LEN], const unsigned char (*params)[SignalSERVER_SECRET_PARAMS_LEN]); + +SignalFfiError *signal_server_secret_params_sign_deterministic(uint8_t (*out)[SignalSIGNATURE_LEN], const unsigned char (*params)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], SignalBorrowedBuffer message); + +SignalFfiError *signal_server_public_params_receive_auth_credential(unsigned char (*out)[SignalAUTH_CREDENTIAL_LEN], const unsigned char (*params)[SignalSERVER_PUBLIC_PARAMS_LEN], const SignalServiceIdFixedWidthBinaryBytes *aci, uint32_t redemption_time, const unsigned char (*response)[SignalAUTH_CREDENTIAL_RESPONSE_LEN]); + +SignalFfiError *signal_server_public_params_receive_auth_credential_with_pni_as_service_id(unsigned char (*out)[SignalAUTH_CREDENTIAL_WITH_PNI_LEN], const unsigned char (*params)[SignalSERVER_PUBLIC_PARAMS_LEN], const SignalServiceIdFixedWidthBinaryBytes *aci, const SignalServiceIdFixedWidthBinaryBytes *pni, uint64_t redemption_time, const unsigned char (*response)[SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN]); + +SignalFfiError *signal_server_public_params_receive_auth_credential_with_pni_as_aci(unsigned char (*out)[SignalAUTH_CREDENTIAL_WITH_PNI_LEN], const unsigned char (*params)[SignalSERVER_PUBLIC_PARAMS_LEN], const SignalServiceIdFixedWidthBinaryBytes *aci, const SignalServiceIdFixedWidthBinaryBytes *pni, uint64_t redemption_time, const unsigned char (*response)[SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN]); + +SignalFfiError *signal_server_public_params_create_auth_credential_presentation_deterministic(SignalOwnedBuffer *out, const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const unsigned char (*group_secret_params)[SignalGROUP_SECRET_PARAMS_LEN], const unsigned char (*auth_credential)[SignalAUTH_CREDENTIAL_LEN]); + +SignalFfiError *signal_server_public_params_create_auth_credential_with_pni_presentation_deterministic(SignalOwnedBuffer *out, const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const unsigned char (*group_secret_params)[SignalGROUP_SECRET_PARAMS_LEN], const unsigned char (*auth_credential)[SignalAUTH_CREDENTIAL_WITH_PNI_LEN]); + +SignalFfiError *signal_server_public_params_create_profile_key_credential_request_context_deterministic(unsigned char (*out)[SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN], const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const SignalServiceIdFixedWidthBinaryBytes *user_id, const unsigned char (*profile_key)[SignalPROFILE_KEY_LEN]); + +SignalFfiError *signal_server_public_params_receive_expiring_profile_key_credential(unsigned char (*out)[SignalEXPIRING_PROFILE_KEY_CREDENTIAL_LEN], const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const unsigned char (*request_context)[SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN], const unsigned char (*response)[SignalEXPIRING_PROFILE_KEY_CREDENTIAL_RESPONSE_LEN], uint64_t current_time_in_seconds); + +SignalFfiError *signal_server_public_params_create_expiring_profile_key_credential_presentation_deterministic(SignalOwnedBuffer *out, const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const unsigned char (*group_secret_params)[SignalGROUP_SECRET_PARAMS_LEN], const unsigned char (*profile_key_credential)[SignalEXPIRING_PROFILE_KEY_CREDENTIAL_LEN]); + +SignalFfiError *signal_server_public_params_create_receipt_credential_request_context_deterministic(unsigned char (*out)[SignalRECEIPT_CREDENTIAL_REQUEST_CONTEXT_LEN], const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const uint8_t (*receipt_serial)[SignalRECEIPT_SERIAL_LEN]); + +SignalFfiError *signal_server_public_params_receive_receipt_credential(unsigned char (*out)[SignalRECEIPT_CREDENTIAL_LEN], const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const unsigned char (*request_context)[SignalRECEIPT_CREDENTIAL_REQUEST_CONTEXT_LEN], const unsigned char (*response)[SignalRECEIPT_CREDENTIAL_RESPONSE_LEN]); + +SignalFfiError *signal_server_public_params_create_receipt_credential_presentation_deterministic(unsigned char (*out)[SignalRECEIPT_CREDENTIAL_PRESENTATION_LEN], const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const unsigned char (*receipt_credential)[SignalRECEIPT_CREDENTIAL_LEN]); + +SignalFfiError *signal_server_secret_params_issue_auth_credential_deterministic(unsigned char (*out)[SignalAUTH_CREDENTIAL_RESPONSE_LEN], const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const SignalServiceIdFixedWidthBinaryBytes *aci, uint32_t redemption_time); + +SignalFfiError *signal_server_secret_params_issue_auth_credential_with_pni_as_service_id_deterministic(unsigned char (*out)[SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN], const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const SignalServiceIdFixedWidthBinaryBytes *aci, const SignalServiceIdFixedWidthBinaryBytes *pni, uint64_t redemption_time); + +SignalFfiError *signal_server_secret_params_issue_auth_credential_with_pni_as_aci_deterministic(unsigned char (*out)[SignalAUTH_CREDENTIAL_WITH_PNI_RESPONSE_LEN], const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const SignalServiceIdFixedWidthBinaryBytes *aci, const SignalServiceIdFixedWidthBinaryBytes *pni, uint64_t redemption_time); + +SignalFfiError *signal_server_secret_params_verify_auth_credential_presentation(const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const unsigned char (*group_public_params)[SignalGROUP_PUBLIC_PARAMS_LEN], SignalBorrowedBuffer presentation_bytes, uint64_t current_time_in_seconds); + +SignalFfiError *signal_server_secret_params_issue_expiring_profile_key_credential_deterministic(unsigned char (*out)[SignalEXPIRING_PROFILE_KEY_CREDENTIAL_RESPONSE_LEN], const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const unsigned char (*request)[SignalPROFILE_KEY_CREDENTIAL_REQUEST_LEN], const SignalServiceIdFixedWidthBinaryBytes *user_id, const unsigned char (*commitment)[SignalPROFILE_KEY_COMMITMENT_LEN], uint64_t expiration_in_seconds); + +SignalFfiError *signal_server_secret_params_verify_profile_key_credential_presentation(const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const unsigned char (*group_public_params)[SignalGROUP_PUBLIC_PARAMS_LEN], SignalBorrowedBuffer presentation_bytes, uint64_t current_time_in_seconds); + +SignalFfiError *signal_server_secret_params_issue_receipt_credential_deterministic(unsigned char (*out)[SignalRECEIPT_CREDENTIAL_RESPONSE_LEN], const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN], const unsigned char (*request)[SignalRECEIPT_CREDENTIAL_REQUEST_LEN], uint64_t receipt_expiration_time, uint64_t receipt_level); + +SignalFfiError *signal_server_secret_params_verify_receipt_credential_presentation(const unsigned char (*server_secret_params)[SignalSERVER_SECRET_PARAMS_LEN], const unsigned char (*presentation)[SignalRECEIPT_CREDENTIAL_PRESENTATION_LEN]); + +SignalFfiError *signal_group_public_params_get_group_identifier(uint8_t (*out)[SignalGROUP_IDENTIFIER_LEN], const unsigned char (*group_public_params)[SignalGROUP_PUBLIC_PARAMS_LEN]); + +SignalFfiError *signal_server_public_params_verify_signature(const unsigned char (*server_public_params)[SignalSERVER_PUBLIC_PARAMS_LEN], SignalBorrowedBuffer message, const uint8_t (*notary_signature)[SignalSIGNATURE_LEN]); + +SignalFfiError *signal_auth_credential_presentation_check_valid_contents(SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_auth_credential_presentation_get_uuid_ciphertext(unsigned char (*out)[SignalUUID_CIPHERTEXT_LEN], SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_auth_credential_presentation_get_pni_ciphertext_or_empty(SignalOwnedBuffer *out, SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_auth_credential_presentation_get_redemption_time(uint64_t *out, SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_profile_key_credential_request_context_get_request(unsigned char (*out)[SignalPROFILE_KEY_CREDENTIAL_REQUEST_LEN], const unsigned char (*context)[SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN]); + +SignalFfiError *signal_expiring_profile_key_credential_get_expiration_time(uint64_t *out, const unsigned char (*credential)[SignalEXPIRING_PROFILE_KEY_CREDENTIAL_LEN]); + +SignalFfiError *signal_profile_key_credential_presentation_check_valid_contents(SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_profile_key_credential_presentation_get_uuid_ciphertext(unsigned char (*out)[SignalUUID_CIPHERTEXT_LEN], SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_profile_key_credential_presentation_get_profile_key_ciphertext(unsigned char (*out)[SignalPROFILE_KEY_CIPHERTEXT_LEN], SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_receipt_credential_request_context_get_request(unsigned char (*out)[SignalRECEIPT_CREDENTIAL_REQUEST_LEN], const unsigned char (*request_context)[SignalRECEIPT_CREDENTIAL_REQUEST_CONTEXT_LEN]); + +SignalFfiError *signal_receipt_credential_get_receipt_expiration_time(uint64_t *out, const unsigned char (*receipt_credential)[SignalRECEIPT_CREDENTIAL_LEN]); + +SignalFfiError *signal_receipt_credential_get_receipt_level(uint64_t *out, const unsigned char (*receipt_credential)[SignalRECEIPT_CREDENTIAL_LEN]); + +SignalFfiError *signal_receipt_credential_presentation_get_receipt_expiration_time(uint64_t *out, const unsigned char (*presentation)[SignalRECEIPT_CREDENTIAL_PRESENTATION_LEN]); + +SignalFfiError *signal_receipt_credential_presentation_get_receipt_level(uint64_t *out, const unsigned char (*presentation)[SignalRECEIPT_CREDENTIAL_PRESENTATION_LEN]); + +SignalFfiError *signal_receipt_credential_presentation_get_receipt_serial(uint8_t (*out)[SignalRECEIPT_SERIAL_LEN], const unsigned char (*presentation)[SignalRECEIPT_CREDENTIAL_PRESENTATION_LEN]); + +SignalFfiError *signal_generic_server_secret_params_check_valid_contents(SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_generic_server_secret_params_generate_deterministic(SignalOwnedBuffer *out, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_generic_server_secret_params_get_public_params(SignalOwnedBuffer *out, SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_generic_server_public_params_check_valid_contents(SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_call_link_secret_params_check_valid_contents(SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_call_link_secret_params_derive_from_root_key(SignalOwnedBuffer *out, SignalBorrowedBuffer root_key); + +SignalFfiError *signal_call_link_secret_params_get_public_params(SignalOwnedBuffer *out, SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_call_link_secret_params_decrypt_user_id(SignalServiceIdFixedWidthBinaryBytes *out, SignalBorrowedBuffer params_bytes, const unsigned char (*user_id)[SignalUUID_CIPHERTEXT_LEN]); + +SignalFfiError *signal_call_link_public_params_check_valid_contents(SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_create_call_link_credential_request_context_check_valid_contents(SignalBorrowedBuffer context_bytes); + +SignalFfiError *signal_create_call_link_credential_request_context_new_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer room_id, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_create_call_link_credential_request_context_get_request(SignalOwnedBuffer *out, SignalBorrowedBuffer context_bytes); + +SignalFfiError *signal_create_call_link_credential_request_check_valid_contents(SignalBorrowedBuffer request_bytes); + +SignalFfiError *signal_create_call_link_credential_request_issue_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer request_bytes, const SignalServiceIdFixedWidthBinaryBytes *user_id, uint64_t timestamp, SignalBorrowedBuffer params_bytes, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_create_call_link_credential_response_check_valid_contents(SignalBorrowedBuffer response_bytes); + +SignalFfiError *signal_create_call_link_credential_request_context_receive_response(SignalOwnedBuffer *out, SignalBorrowedBuffer context_bytes, SignalBorrowedBuffer response_bytes, const SignalServiceIdFixedWidthBinaryBytes *user_id, SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_create_call_link_credential_check_valid_contents(SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_create_call_link_credential_present_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer credential_bytes, SignalBorrowedBuffer room_id, const SignalServiceIdFixedWidthBinaryBytes *user_id, SignalBorrowedBuffer server_params_bytes, SignalBorrowedBuffer call_link_params_bytes, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_create_call_link_credential_presentation_check_valid_contents(SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_create_call_link_credential_presentation_verify(SignalBorrowedBuffer presentation_bytes, SignalBorrowedBuffer room_id, uint64_t now, SignalBorrowedBuffer server_params_bytes, SignalBorrowedBuffer call_link_params_bytes); + +SignalFfiError *signal_call_link_auth_credential_response_check_valid_contents(SignalBorrowedBuffer response_bytes); + +SignalFfiError *signal_call_link_auth_credential_response_issue_deterministic(SignalOwnedBuffer *out, const SignalServiceIdFixedWidthBinaryBytes *user_id, uint64_t redemption_time, SignalBorrowedBuffer params_bytes, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_call_link_auth_credential_response_receive(SignalOwnedBuffer *out, SignalBorrowedBuffer response_bytes, const SignalServiceIdFixedWidthBinaryBytes *user_id, uint64_t redemption_time, SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_call_link_auth_credential_check_valid_contents(SignalBorrowedBuffer credential_bytes); + +SignalFfiError *signal_call_link_auth_credential_present_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer credential_bytes, const SignalServiceIdFixedWidthBinaryBytes *user_id, uint64_t redemption_time, SignalBorrowedBuffer server_params_bytes, SignalBorrowedBuffer call_link_params_bytes, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_call_link_auth_credential_presentation_check_valid_contents(SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_call_link_auth_credential_presentation_verify(SignalBorrowedBuffer presentation_bytes, uint64_t now, SignalBorrowedBuffer server_params_bytes, SignalBorrowedBuffer call_link_params_bytes); + +SignalFfiError *signal_call_link_auth_credential_presentation_get_user_id(unsigned char (*out)[SignalUUID_CIPHERTEXT_LEN], SignalBorrowedBuffer presentation_bytes); + +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_check_valid_contents(SignalBorrowedBuffer context_bytes); + +SignalFfiError *signal_backup_auth_credential_request_context_get_request(SignalOwnedBuffer *out, SignalBorrowedBuffer context_bytes); + +SignalFfiError *signal_backup_auth_credential_request_check_valid_contents(SignalBorrowedBuffer request_bytes); + +SignalFfiError *signal_backup_auth_credential_request_issue_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer request_bytes, uint64_t redemption_time, uint64_t receipt_level, SignalBorrowedBuffer params_bytes, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_backup_auth_credential_response_check_valid_contents(SignalBorrowedBuffer response_bytes); + +SignalFfiError *signal_backup_auth_credential_request_context_receive_response(SignalOwnedBuffer *out, SignalBorrowedBuffer context_bytes, SignalBorrowedBuffer response_bytes, SignalBorrowedBuffer params_bytes, uint64_t expected_receipt_level); + +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); + +SignalFfiError *signal_backup_auth_credential_present_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer credential_bytes, SignalBorrowedBuffer server_params_bytes, const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_backup_auth_credential_presentation_check_valid_contents(SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_backup_auth_credential_presentation_verify(SignalBorrowedBuffer presentation_bytes, uint64_t now, SignalBorrowedBuffer server_params_bytes); + +SignalFfiError *signal_group_send_credential_response_default_expiration_based_on_current_time(uint64_t *out); + +SignalFfiError *signal_group_send_credential_response_issue_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer concatenated_group_member_ciphertexts, const unsigned char (*requester)[SignalUUID_CIPHERTEXT_LEN], uint64_t expiration, const unsigned char (*server_params)[SignalSERVER_SECRET_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_group_send_credential_response_check_valid_contents(SignalBorrowedBuffer response_bytes); + +SignalFfiError *signal_group_send_credential_response_receive(SignalOwnedBuffer *out, SignalBorrowedBuffer response_bytes, SignalBorrowedBuffer group_members, const SignalServiceIdFixedWidthBinaryBytes *local_aci, uint64_t now, const unsigned char (*server_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const unsigned char (*group_params)[SignalGROUP_SECRET_PARAMS_LEN]); + +SignalFfiError *signal_group_send_credential_check_valid_contents(SignalBorrowedBuffer params_bytes); + +SignalFfiError *signal_group_send_credential_present_deterministic(SignalOwnedBuffer *out, SignalBorrowedBuffer credential_bytes, const unsigned char (*server_params)[SignalSERVER_PUBLIC_PARAMS_LEN], const uint8_t (*randomness)[SignalRANDOMNESS_LEN]); + +SignalFfiError *signal_group_send_credential_presentation_check_valid_contents(SignalBorrowedBuffer presentation_bytes); + +SignalFfiError *signal_group_send_credential_presentation_verify(SignalBorrowedBuffer presentation_bytes, SignalBorrowedBuffer group_members, uint64_t now, const unsigned char (*server_params)[SignalSERVER_SECRET_PARAMS_LEN]); + +SignalFfiError *signal_verify_signature(bool *out, SignalBorrowedBuffer cert_pem, SignalBorrowedBuffer body, SignalBorrowedBuffer signature, uint64_t current_timestamp); + +SignalFfiError *signal_pin_hash_destroy(SignalPinHash *p); + +SignalFfiError *signal_pin_hash_clone(SignalPinHash **new_obj, const SignalPinHash *obj); + +SignalFfiError *signal_pin_hash_encryption_key(uint8_t (*out)[32], const SignalPinHash *ph); + +SignalFfiError *signal_pin_hash_access_key(uint8_t (*out)[32], const SignalPinHash *ph); + +SignalFfiError *signal_pin_hash_from_salt(SignalPinHash **out, SignalBorrowedBuffer pin, const uint8_t (*salt)[32]); + +SignalFfiError *signal_pin_hash_from_username_mrenclave(SignalPinHash **out, SignalBorrowedBuffer pin, const char *username, SignalBorrowedBuffer mrenclave); + +SignalFfiError *signal_pin_local_hash(const char **out, SignalBorrowedBuffer pin); + +SignalFfiError *signal_pin_verify_local_hash(bool *out, const char *encoded_hash, SignalBorrowedBuffer pin); + +SignalFfiError *signal_svr2_client_new(SignalSgxClientState **out, SignalBorrowedBuffer mrenclave, SignalBorrowedBuffer attestation_msg, uint64_t current_timestamp); + +SignalFfiError *signal_incremental_mac_calculate_chunk_size(uint32_t *out, uint32_t data_size); + +SignalFfiError *signal_incremental_mac_destroy(SignalIncrementalMac *p); + +SignalFfiError *signal_incremental_mac_initialize(SignalIncrementalMac **out, SignalBorrowedBuffer key, uint32_t chunk_size); + +SignalFfiError *signal_incremental_mac_update(SignalOwnedBuffer *out, SignalIncrementalMac *mac, SignalBorrowedBuffer bytes, uint32_t offset, uint32_t length); + +SignalFfiError *signal_incremental_mac_finalize(SignalOwnedBuffer *out, SignalIncrementalMac *mac); + +SignalFfiError *signal_validating_mac_destroy(SignalValidatingMac *p); + +SignalFfiError *signal_validating_mac_initialize(SignalValidatingMac **out, SignalBorrowedBuffer key, uint32_t chunk_size, SignalBorrowedBuffer digests); + +SignalFfiError *signal_validating_mac_update(int32_t *out, SignalValidatingMac *mac, SignalBorrowedBuffer bytes, uint32_t offset, uint32_t length); + +SignalFfiError *signal_validating_mac_finalize(int32_t *out, SignalValidatingMac *mac); + +SignalFfiError *signal_username_hash(uint8_t (*out)[32], const char *username); + +SignalFfiError *signal_username_proof(SignalOwnedBuffer *out, const char *username, SignalBorrowedBuffer randomness); + +SignalFfiError *signal_username_verify(SignalBorrowedBuffer proof, SignalBorrowedBuffer hash); + +SignalFfiError *signal_username_candidates_from(const char **out, const char *nickname, uint32_t min_len, uint32_t max_len); + +SignalFfiError *signal_username_hash_from_parts(uint8_t (*out)[32], const char *nickname, const char *discriminator, uint32_t min_len, uint32_t max_len); + +SignalFfiError *signal_username_link_create(SignalOwnedBuffer *out, const char *username, SignalBorrowedBuffer entropy); + +SignalFfiError *signal_username_link_decrypt_username(const char **out, SignalBorrowedBuffer entropy, SignalBorrowedBuffer encrypted_username); + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_signal_media_check_available(void); +#endif + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_mp4_sanitizer_sanitize(SignalSanitizedMetadata **out, const SignalInputStream *input, uint64_t len); +#endif + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_webp_sanitizer_sanitize(bool *out, const SignalSyncInputStream *input); +#endif + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_sanitized_metadata_destroy(SignalSanitizedMetadata *p); +#endif + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_sanitized_metadata_clone(SignalSanitizedMetadata **new_obj, const SignalSanitizedMetadata *obj); +#endif + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_sanitized_metadata_get_metadata(SignalOwnedBuffer *out, const SignalSanitizedMetadata *sanitized); +#endif + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_sanitized_metadata_get_data_offset(uint64_t *out, const SignalSanitizedMetadata *sanitized); +#endif + +#if defined(SIGNAL_MEDIA_SUPPORTED) +SignalFfiError *signal_sanitized_metadata_get_data_len(uint64_t *out, const SignalSanitizedMetadata *sanitized); +#endif + +SignalFfiError *signal_testing_NonSuspendingBackgroundThreadRuntime_destroy(SignalNonSuspendingBackgroundThreadRuntime *p); + +SignalFfiError *signal_testing_future_success(SignalCPromisei32 promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, uint8_t input); + +SignalFfiError *signal_testing_future_failure(SignalCPromisei32 promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, uint8_t _input); + +SignalFfiError *signal_testing_handle_type_destroy(SignalTestingHandleType *p); + +SignalFfiError *signal_testing_handle_type_clone(SignalTestingHandleType **new_obj, const SignalTestingHandleType *obj); + +SignalFfiError *signal_testing_testing_handle_type_get_value(uint8_t *out, const SignalTestingHandleType *handle); + +SignalFfiError *signal_testing_future_produces_pointer_type(SignalCPromiseTestingHandleType promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, uint8_t input); + +SignalFfiError *signal_other_testing_handle_type_destroy(SignalOtherTestingHandleType *p); + +SignalFfiError *signal_other_testing_handle_type_clone(SignalOtherTestingHandleType **new_obj, const SignalOtherTestingHandleType *obj); + +SignalFfiError *signal_testing_other_testing_handle_type_get_value(const char **out, const SignalOtherTestingHandleType *handle); + +SignalFfiError *signal_testing_future_produces_other_pointer_type(SignalCPromiseOtherTestingHandleType promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, const char *input); + +SignalFfiError *signal_testing_panic_on_borrow_sync(const void *_input); + +SignalFfiError *signal_testing_panic_on_borrow_async(const void *_input); + +SignalFfiError *signal_testing_panic_on_borrow_io(SignalCPromisebool promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, const void *_input); + +SignalFfiError *signal_testing_error_on_borrow_sync(const void *_input); + +SignalFfiError *signal_testing_error_on_borrow_async(const void *_input); + +SignalFfiError *signal_testing_error_on_borrow_io(SignalCPromisebool promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, const void *_input); + +SignalFfiError *signal_testing_panic_on_load_sync(const void *_needs_cleanup, const void *_input); + +SignalFfiError *signal_testing_panic_on_load_async(const void *_needs_cleanup, const void *_input); + +SignalFfiError *signal_testing_panic_on_load_io(SignalCPromisebool promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, const void *_needs_cleanup, const void *_input); + +SignalFfiError *signal_testing_panic_in_body_sync(const void *_input); + +SignalFfiError *signal_testing_panic_in_body_async(const void *_input); + +SignalFfiError *signal_testing_panic_in_body_io(SignalCPromisebool promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, const void *_input); + +SignalFfiError *signal_testing_panic_on_return_sync(const void **out, const void *_needs_cleanup); + +SignalFfiError *signal_testing_panic_on_return_async(const void **out, const void *_needs_cleanup); + +SignalFfiError *signal_testing_panic_on_return_io(SignalCPromiseRawPointer promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, const void *_needs_cleanup); + +SignalFfiError *signal_testing_error_on_return_sync(const void **out, const void *_needs_cleanup); + +SignalFfiError *signal_testing_error_on_return_async(const void **out, const void *_needs_cleanup); + +SignalFfiError *signal_testing_error_on_return_io(SignalCPromiseRawPointer promise, const void *promise_context, const SignalNonSuspendingBackgroundThreadRuntime *async_runtime, const void *_needs_cleanup); + +#endif /* SIGNAL_FFI_H_ */ diff --git a/pkg/libsignalgo/logging.go b/pkg/libsignalgo/logging.go index 6a35e4d..2fcf8ba 100644 --- a/pkg/libsignalgo/logging.go +++ b/pkg/libsignalgo/logging.go @@ -17,35 +17,31 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include <./libsignal-ffi.h> -extern int signal_log_callback(void *ctx, SignalLogLevel level, SignalCStringPtr file, uint32_t line, SignalCStringPtr message); -extern int signal_log_flush_callback(void *ctx); -extern void signal_log_destroy_callback(void *ctx); +extern bool signal_log_enabled_callback(char *target, SignalLogLevel level); +extern void signal_log_callback(char *target, SignalLogLevel level, char *file, uint32_t line, char *message); +extern void signal_log_flush_callback(); */ import "C" -import ( - "unsafe" -) // ffiLogger is the global logger object. var ffiLogger Logger +//export signal_log_enabled_callback +func signal_log_enabled_callback(target *C.char, level C.SignalLogLevel) C.bool { + return C.bool(ffiLogger.Enabled(C.GoString(target), LogLevel(int(level)))) +} + //export signal_log_callback -func signal_log_callback(ctx unsafe.Pointer, level C.SignalLogLevel, file C.SignalCStringPtr, line C.uint32_t, message C.SignalCStringPtr) C.int { - ffiLogger.Log(LogLevel(int(level)), CopyCStringToString(file), uint(line), CopyCStringToString(message)) - return 0 +func signal_log_callback(target *C.char, level C.SignalLogLevel, file *C.char, line C.uint32_t, message *C.char) { + ffiLogger.Log(C.GoString(target), LogLevel(int(level)), C.GoString(file), uint(line), C.GoString(message)) } //export signal_log_flush_callback -func signal_log_flush_callback(ctx unsafe.Pointer) C.int { +func signal_log_flush_callback() { ffiLogger.Flush() - return 0 -} - -//export signal_log_destroy_callback -func signal_log_destroy_callback(ctx unsafe.Pointer) { - ffiLogger.Destroy() } type LogLevel int @@ -59,16 +55,16 @@ const ( ) type Logger interface { - Log(level LogLevel, file string, line uint, message string) + Enabled(target string, level LogLevel) bool + Log(target string, 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{ + enabled: C.SignalLogEnabledCallback(C.signal_log_enabled_callback), + 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 91aa7f0..43a1a39 100644 --- a/pkg/libsignalgo/message.go +++ b/pkg/libsignalgo/message.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,53 +17,28 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" import ( "context" "runtime" - "time" ) -func Encrypt(ctx context.Context, plaintext []byte, forAddress, localAddress *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) - defer callbackCtx.Unref() - signalFfiError := C.signal_encrypt_message( - &ciphertextMessage, - BytesToBuffer(plaintext), - forAddress.constPtr(), - localAddress.constPtr(), - callbackCtx.wrapSessionStore(sessionStore), - callbackCtx.wrapIdentityKeyStore(identityKeyStore), - now, - ) - runtime.KeepAlive(plaintext) - runtime.KeepAlive(forAddress) - runtime.KeepAlive(localAddress) - if signalFfiError != nil { - return nil, callbackCtx.wrapError(signalFfiError) - } - 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{} signalFfiError := C.signal_decrypt_message( &decrypted, - message.constPtr(), - fromAddress.constPtr(), - localAddress.constPtr(), + message.ptr, + fromAddress.ptr, callbackCtx.wrapSessionStore(sessionStore), callbackCtx.wrapIdentityKeyStore(identityStore), ) runtime.KeepAlive(message) runtime.KeepAlive(fromAddress) - runtime.KeepAlive(localAddress) if signalFfiError != nil { return nil, callbackCtx.wrapError(signalFfiError) } @@ -73,46 +47,38 @@ func Decrypt(ctx context.Context, message *Message, fromAddress, localAddress *A type Message struct { nc noCopy - ptr *C.SignalSignalMessage + ptr *C.SignalMessage } -func wrapMessage(ptr *C.SignalSignalMessage) *Message { +func wrapMessage(ptr *C.SignalMessage) *Message { message := &Message{ptr: ptr} runtime.SetFinalizer(message, (*Message).Destroy) return message } func DeserializeMessage(serialized []byte) (*Message, error) { - var m C.SignalMutPointerSignalMessage + var m *C.SignalMessage signalFfiError := C.signal_message_deserialize(&m, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapMessage(m.raw), nil -} - -func (m *Message) mutPtr() C.SignalMutPointerSignalMessage { - return C.SignalMutPointerSignalMessage{m.ptr} -} - -func (m *Message) constPtr() C.SignalConstPointerSignalMessage { - return C.SignalConstPointerSignalMessage{m.ptr} + return wrapMessage(m), nil } func (m *Message) Clone() (*Message, error) { - var cloned C.SignalMutPointerSignalMessage - signalFfiError := C.signal_message_clone(&cloned, m.constPtr()) + var cloned *C.SignalMessage + signalFfiError := C.signal_message_clone(&cloned, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapMessage(cloned.raw), nil + return wrapMessage(cloned), nil } func (m *Message) Destroy() error { m.CancelFinalizer() - return wrapError(C.signal_message_destroy(m.mutPtr())) + return wrapError(C.signal_message_destroy(m.ptr)) } func (m *Message) CancelFinalizer() { @@ -121,7 +87,7 @@ func (m *Message) CancelFinalizer() { func (m *Message) GetBody() ([]byte, error) { var body C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_message_get_body(&body, m.constPtr()) + signalFfiError := C.signal_message_get_body(&body, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -131,7 +97,7 @@ func (m *Message) GetBody() ([]byte, error) { func (m *Message) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_message_get_serialized(&serialized, m.constPtr()) + signalFfiError := C.signal_message_get_serialized(&serialized, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -141,7 +107,7 @@ func (m *Message) Serialize() ([]byte, error) { func (m *Message) GetMessageVersion() (uint32, error) { var messageVersion C.uint32_t - signalFfiError := C.signal_message_get_message_version(&messageVersion, m.constPtr()) + signalFfiError := C.signal_message_get_message_version(&messageVersion, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -151,10 +117,23 @@ func (m *Message) GetMessageVersion() (uint32, error) { func (m *Message) GetCounter() (uint32, error) { var counter C.uint32_t - signalFfiError := C.signal_message_get_counter(&counter, m.constPtr()) + signalFfiError := C.signal_message_get_counter(&counter, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return 0, wrapError(signalFfiError) } return uint32(counter), nil } + +func (m *Message) VerifyMAC(sender, receiver *PublicKey, macKey []byte) (bool, error) { + var result C.bool + signalFfiError := C.signal_message_verify_mac(&result, m.ptr, sender.ptr, receiver.ptr, BytesToBuffer(macKey)) + runtime.KeepAlive(m) + runtime.KeepAlive(sender) + runtime.KeepAlive(receiver) + runtime.KeepAlive(macKey) + if signalFfiError != nil { + return false, wrapError(signalFfiError) + } + return bool(result), nil +} diff --git a/pkg/libsignalgo/messagebackupkey.go b/pkg/libsignalgo/messagebackupkey.go deleted file mode 100644 index 0bee04c..0000000 --- a/pkg/libsignalgo/messagebackupkey.go +++ /dev/null @@ -1,110 +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 "runtime" - -type MessageBackupKey struct { - nc noCopy - ptr *C.SignalMessageBackupKey -} - -const MessageBackupKeyBytesLength = 32 - -type messageBackupKeyBytes = fixedArray32 - -func wrapMessageBackupKey(ptr *C.SignalMessageBackupKey) *MessageBackupKey { - backupKey := &MessageBackupKey{ptr: ptr} - runtime.SetFinalizer(backupKey, (*MessageBackupKey).Destroy) - return backupKey -} - -func MessageBackupKeyFromAccountEntropyPool(aep AccountEntropyPool, aci ServiceID) (*MessageBackupKey, error) { - var bk C.SignalMutPointerMessageBackupKey - aepC, free := GoStringToCString(string(aep)) - defer free() - signalFfiError := C.signal_message_backup_key_from_account_entropy_pool( - &bk, - aepC, - aci.cConstFixedArray(), - nil, // TODO what's a forward secrecy token? - ) - runtime.KeepAlive(aep) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return wrapMessageBackupKey(bk.raw), nil -} - -func MessageBackupKeyFromBackupKeyAndID(backupKey *BackupKey, backupID *BackupID) (*MessageBackupKey, error) { - var bk C.SignalMutPointerMessageBackupKey - signalFfiError := C.signal_message_backup_key_from_backup_key_and_backup_id( - &bk, - backupKey.cConstFixedArray(), - backupID.cConstFixedArray(), - nil, // TODO what's a forward secrecy token? - ) - runtime.KeepAlive(backupKey) - runtime.KeepAlive(backupID) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return wrapMessageBackupKey(bk.raw), nil -} - -func (bk *MessageBackupKey) mutPtr() C.SignalMutPointerMessageBackupKey { - return C.SignalMutPointerMessageBackupKey{bk.ptr} -} - -func (bk *MessageBackupKey) constPtr() C.SignalConstPointerMessageBackupKey { - return C.SignalConstPointerMessageBackupKey{bk.ptr} -} - -func (bk *MessageBackupKey) Destroy() error { - runtime.SetFinalizer(bk, nil) - return wrapError(C.signal_message_backup_key_destroy(bk.mutPtr())) -} - -func (bk *MessageBackupKey) GetHMACKey() ([MessageBackupKeyBytesLength]byte, error) { - var out messageBackupKeyBytes - signalFfiError := C.signal_message_backup_key_get_hmac_key( - out.cFixedArray(), - bk.constPtr(), - ) - runtime.KeepAlive(bk) - if signalFfiError != nil { - return [MessageBackupKeyBytesLength]byte(out), wrapError(signalFfiError) - } - return [MessageBackupKeyBytesLength]byte(out), nil -} - -func (bk *MessageBackupKey) GetAESKey() ([MessageBackupKeyBytesLength]byte, error) { - var out messageBackupKeyBytes - signalFfiError := C.signal_message_backup_key_get_aes_key( - out.cFixedArray(), - bk.constPtr(), - ) - runtime.KeepAlive(bk) - if signalFfiError != nil { - return [MessageBackupKeyBytesLength]byte(out), wrapError(signalFfiError) - } - return [MessageBackupKeyBytesLength]byte(out), nil -} diff --git a/pkg/libsignalgo/plaintextcontent.go b/pkg/libsignalgo/plaintextcontent.go index 346f0c9..6503c5d 100644 --- a/pkg/libsignalgo/plaintextcontent.go +++ b/pkg/libsignalgo/plaintextcontent.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -35,52 +35,38 @@ func wrapPlaintextContent(ptr *C.SignalPlaintextContent) *PlaintextContent { } func PlaintextContentFromDecryptionErrorMessage(message *DecryptionErrorMessage) (*PlaintextContent, error) { - var pc C.SignalMutPointerPlaintextContent - signalFfiError := C.signal_plaintext_content_from_decryption_error_message( - &pc, - message.constPtr(), - ) + var pc *C.SignalPlaintextContent + signalFfiError := C.signal_plaintext_content_from_decryption_error_message(&pc, message.ptr) runtime.KeepAlive(message) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPlaintextContent(pc.raw), nil + return wrapPlaintextContent(pc), nil } func DeserializePlaintextContent(plaintextContentBytes []byte) (*PlaintextContent, error) { - var pc C.SignalMutPointerPlaintextContent + var pc *C.SignalPlaintextContent signalFfiError := C.signal_plaintext_content_deserialize(&pc, BytesToBuffer(plaintextContentBytes)) runtime.KeepAlive(plaintextContentBytes) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPlaintextContent(pc.raw), nil -} - -func (pc *PlaintextContent) mutPtr() C.SignalMutPointerPlaintextContent { - return C.SignalMutPointerPlaintextContent{pc.ptr} -} - -func (pc *PlaintextContent) constPtr() C.SignalConstPointerPlaintextContent { - return C.SignalConstPointerPlaintextContent{pc.ptr} + return wrapPlaintextContent(pc), nil } func (pc *PlaintextContent) Clone() (*PlaintextContent, error) { - var cloned C.SignalMutPointerPlaintextContent - signalFfiError := C.signal_plaintext_content_clone( - &cloned, - pc.constPtr(), - ) + var cloned *C.SignalPlaintextContent + signalFfiError := C.signal_plaintext_content_clone(&cloned, pc.ptr) runtime.KeepAlive(pc) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPlaintextContent(cloned.raw), nil + return wrapPlaintextContent(cloned), nil } func (pc *PlaintextContent) Destroy() error { pc.CancelFinalizer() - return wrapError(C.signal_plaintext_content_destroy(pc.mutPtr())) + return wrapError(C.signal_plaintext_content_destroy(pc.ptr)) } func (pc *PlaintextContent) CancelFinalizer() { @@ -89,7 +75,7 @@ func (pc *PlaintextContent) CancelFinalizer() { func (pc *PlaintextContent) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_plaintext_content_serialize(&serialized, pc.constPtr()) + signalFfiError := C.signal_plaintext_content_serialize(&serialized, pc.ptr) runtime.KeepAlive(pc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -99,7 +85,7 @@ func (pc *PlaintextContent) Serialize() ([]byte, error) { func (pc *PlaintextContent) GetBody() ([]byte, error) { var body C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_plaintext_content_get_body(&body, pc.constPtr()) + signalFfiError := C.signal_plaintext_content_get_body(&body, pc.ptr) runtime.KeepAlive(pc) if signalFfiError != nil { return nil, wrapError(signalFfiError) diff --git a/pkg/libsignalgo/prekey.go b/pkg/libsignalgo/prekey.go index e742ecd..7c4ed6b 100644 --- a/pkg/libsignalgo/prekey.go +++ b/pkg/libsignalgo/prekey.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -26,15 +26,14 @@ 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{} signalFfiError := C.signal_decrypt_pre_key_message( &decrypted, - preKeyMessage.constPtr(), - fromAddress.constPtr(), - localAddress.constPtr(), + preKeyMessage.ptr, + fromAddress.ptr, callbackCtx.wrapSessionStore(sessionStore), callbackCtx.wrapIdentityKeyStore(identityStore), callbackCtx.wrapPreKeyStore(preKeyStore), @@ -43,7 +42,6 @@ func DecryptPreKey(ctx context.Context, preKeyMessage *PreKeyMessage, fromAddres ) runtime.KeepAlive(preKeyMessage) runtime.KeepAlive(fromAddress) - runtime.KeepAlive(localAddress) if signalFfiError != nil { return nil, callbackCtx.wrapError(signalFfiError) } @@ -62,19 +60,14 @@ func wrapPreKeyRecord(ptr *C.SignalPreKeyRecord) *PreKeyRecord { } func NewPreKeyRecord(id uint32, publicKey *PublicKey, privateKey *PrivateKey) (*PreKeyRecord, error) { - var pkr C.SignalMutPointerPreKeyRecord - signalFfiError := C.signal_pre_key_record_new( - &pkr, - C.uint32_t(id), - publicKey.constPtr(), - privateKey.constPtr(), - ) + var pkr *C.SignalPreKeyRecord + signalFfiError := C.signal_pre_key_record_new(&pkr, C.uint32_t(id), publicKey.ptr, privateKey.ptr) runtime.KeepAlive(publicKey) runtime.KeepAlive(privateKey) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPreKeyRecord(pkr.raw), nil + return wrapPreKeyRecord(pkr), nil } func NewPreKeyRecordFromPrivateKey(id uint32, privateKey *PrivateKey) (*PreKeyRecord, error) { @@ -86,36 +79,28 @@ func NewPreKeyRecordFromPrivateKey(id uint32, privateKey *PrivateKey) (*PreKeyRe } func DeserializePreKeyRecord(serialized []byte) (*PreKeyRecord, error) { - var pkr C.SignalMutPointerPreKeyRecord + var pkr *C.SignalPreKeyRecord signalFfiError := C.signal_pre_key_record_deserialize(&pkr, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPreKeyRecord(pkr.raw), nil -} - -func (pkr *PreKeyRecord) mutPtr() C.SignalMutPointerPreKeyRecord { - return C.SignalMutPointerPreKeyRecord{pkr.ptr} -} - -func (pkr *PreKeyRecord) constPtr() C.SignalConstPointerPreKeyRecord { - return C.SignalConstPointerPreKeyRecord{pkr.ptr} + return wrapPreKeyRecord(pkr), nil } func (pkr *PreKeyRecord) Clone() (*PreKeyRecord, error) { - var cloned C.SignalMutPointerPreKeyRecord - signalFfiError := C.signal_pre_key_record_clone(&cloned, pkr.constPtr()) + var cloned *C.SignalPreKeyRecord + signalFfiError := C.signal_pre_key_record_clone(&cloned, pkr.ptr) runtime.KeepAlive(pkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPreKeyRecord(cloned.raw), nil + return wrapPreKeyRecord(cloned), nil } func (pkr *PreKeyRecord) Destroy() error { pkr.CancelFinalizer() - return wrapError(C.signal_pre_key_record_destroy(pkr.mutPtr())) + return wrapError(C.signal_pre_key_record_destroy(pkr.ptr)) } func (pkr *PreKeyRecord) CancelFinalizer() { @@ -124,7 +109,7 @@ func (pkr *PreKeyRecord) CancelFinalizer() { func (pkr *PreKeyRecord) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_pre_key_record_serialize(&serialized, pkr.constPtr()) + signalFfiError := C.signal_pre_key_record_serialize(&serialized, pkr.ptr) runtime.KeepAlive(pkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -132,32 +117,32 @@ func (pkr *PreKeyRecord) Serialize() ([]byte, error) { return CopySignalOwnedBufferToBytes(serialized), nil } -func (pkr *PreKeyRecord) GetID() (uint32, error) { +func (pkr *PreKeyRecord) GetID() (uint, error) { var id C.uint32_t - signalFfiError := C.signal_pre_key_record_get_id(&id, pkr.constPtr()) + signalFfiError := C.signal_pre_key_record_get_id(&id, pkr.ptr) runtime.KeepAlive(pkr) if signalFfiError != nil { return 0, wrapError(signalFfiError) } - return uint32(id), nil + return uint(id), nil } func (pkr *PreKeyRecord) GetPublicKey() (*PublicKey, error) { - var pub C.SignalMutPointerPublicKey - signalFfiError := C.signal_pre_key_record_get_public_key(&pub, pkr.constPtr()) + var pub *C.SignalPublicKey + signalFfiError := C.signal_pre_key_record_get_public_key(&pub, pkr.ptr) runtime.KeepAlive(pkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(pub.raw), nil + return wrapPublicKey(pub), nil } func (pkr *PreKeyRecord) GetPrivateKey() (*PrivateKey, error) { - var priv C.SignalMutPointerPrivateKey - signalFfiError := C.signal_pre_key_record_get_private_key(&priv, pkr.constPtr()) + var priv *C.SignalPrivateKey + signalFfiError := C.signal_pre_key_record_get_private_key(&priv, pkr.ptr) runtime.KeepAlive(pkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPrivateKey(priv.raw), nil + return wrapPrivateKey(priv), nil } diff --git a/pkg/libsignalgo/prekeybundle.go b/pkg/libsignalgo/prekeybundle.go index d8e2516..905496c 100644 --- a/pkg/libsignalgo/prekeybundle.go +++ b/pkg/libsignalgo/prekeybundle.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -27,21 +27,19 @@ 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(), + bundle.ptr, + forAddress.ptr, callbackCtx.wrapSessionStore(sessionStore), callbackCtx.wrapIdentityKeyStore(identityStore), now, ) runtime.KeepAlive(bundle) runtime.KeepAlive(forAddress) - runtime.KeepAlive(localAddress) return callbackCtx.wrapError(signalFfiError) } @@ -69,7 +67,7 @@ func NewPreKeyBundle( kyberPreKeySignature []byte, identityKey *IdentityKey, ) (*PreKeyBundle, error) { - var pkb C.SignalMutPointerPreKeyBundle + var pkb *C.SignalPreKeyBundle var zero uint32 = 0 var kyberSignatureBuffer = EmptyBorrowedBuffer() if preKey == nil { @@ -87,13 +85,13 @@ func NewPreKeyBundle( C.uint32_t(registrationID), C.uint32_t(deviceID), C.uint32_t(preKeyID), - preKey.constPtr(), + preKey.ptr, C.uint32_t(signedPreKeyID), - signedPreKey.constPtr(), + signedPreKey.ptr, BytesToBuffer(signedPreKeySignature), - identityKey.publicKey.constPtr(), + identityKey.publicKey.ptr, C.uint32_t(kyberPreKeyID), - kyberPreKey.constPtr(), + kyberPreKey.ptr, kyberSignatureBuffer, ) runtime.KeepAlive(preKey) @@ -105,30 +103,22 @@ func NewPreKeyBundle( if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPreKeyBundle(pkb.raw), nil -} - -func (pkb *PreKeyBundle) mutPtr() C.SignalMutPointerPreKeyBundle { - return C.SignalMutPointerPreKeyBundle{pkb.ptr} -} - -func (pkb *PreKeyBundle) constPtr() C.SignalConstPointerPreKeyBundle { - return C.SignalConstPointerPreKeyBundle{pkb.ptr} + return wrapPreKeyBundle(pkb), nil } func (pkb *PreKeyBundle) Clone() (*PreKeyBundle, error) { - var cloned C.SignalMutPointerPreKeyBundle - signalFfiError := C.signal_pre_key_bundle_clone(&cloned, pkb.constPtr()) - runtime.KeepAlive(pkb) + var cloned *C.SignalPreKeyBundle + signalFfiError := C.signal_pre_key_bundle_clone(&cloned, pkb.ptr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPreKeyBundle(cloned.raw), nil + runtime.KeepAlive(pkb) + return wrapPreKeyBundle(cloned), nil } func (pkb *PreKeyBundle) Destroy() error { pkb.CancelFinalizer() - return wrapError(C.signal_pre_key_bundle_destroy(pkb.mutPtr())) + return wrapError(C.signal_pre_key_bundle_destroy(pkb.ptr)) } func (pkb *PreKeyBundle) CancelFinalizer() { @@ -136,11 +126,11 @@ func (pkb *PreKeyBundle) CancelFinalizer() { } func (pkb *PreKeyBundle) GetIdentityKey() (*IdentityKey, error) { - var pk C.SignalMutPointerPublicKey - signalFfiError := C.signal_pre_key_bundle_get_identity_key(&pk, pkb.constPtr()) - runtime.KeepAlive(pkb) + var pk *C.SignalPublicKey + signalFfiError := C.signal_pre_key_bundle_get_identity_key(&pk, pkb.ptr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return NewIdentityKeyFromPublicKey(wrapPublicKey(pk.raw)) + runtime.KeepAlive(pkb) + return NewIdentityKeyFromPublicKey(wrapPublicKey(pk)) } diff --git a/pkg/libsignalgo/prekeymessage.go b/pkg/libsignalgo/prekeymessage.go index 7261933..435cf5e 100644 --- a/pkg/libsignalgo/prekeymessage.go +++ b/pkg/libsignalgo/prekeymessage.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -35,36 +35,28 @@ func wrapPreKeyMessage(ptr *C.SignalPreKeySignalMessage) *PreKeyMessage { } func DeserializePreKeyMessage(serialized []byte) (*PreKeyMessage, error) { - var m C.SignalMutPointerPreKeySignalMessage + var m *C.SignalPreKeySignalMessage signalFfiError := C.signal_pre_key_signal_message_deserialize(&m, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPreKeyMessage(m.raw), nil -} - -func (m *PreKeyMessage) mutPtr() C.SignalMutPointerPreKeySignalMessage { - return C.SignalMutPointerPreKeySignalMessage{m.ptr} -} - -func (m *PreKeyMessage) constPtr() C.SignalConstPointerPreKeySignalMessage { - return C.SignalConstPointerPreKeySignalMessage{m.ptr} + return wrapPreKeyMessage(m), nil } func (m *PreKeyMessage) Clone() (*PreKeyMessage, error) { - var cloned C.SignalMutPointerPreKeySignalMessage - signalFfiError := C.signal_pre_key_signal_message_clone(&cloned, m.constPtr()) + var cloned *C.SignalPreKeySignalMessage + signalFfiError := C.signal_pre_key_signal_message_clone(&cloned, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPreKeyMessage(cloned.raw), nil + return wrapPreKeyMessage(cloned), nil } func (m *PreKeyMessage) Destroy() error { m.CancelFinalizer() - return wrapError(C.signal_pre_key_signal_message_destroy(m.mutPtr())) + return wrapError(C.signal_pre_key_signal_message_destroy(m.ptr)) } func (m *PreKeyMessage) CancelFinalizer() { @@ -73,7 +65,7 @@ func (m *PreKeyMessage) CancelFinalizer() { func (m *PreKeyMessage) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_pre_key_signal_message_serialize(&serialized, m.constPtr()) + signalFfiError := C.signal_pre_key_signal_message_serialize(&serialized, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -83,7 +75,7 @@ func (m *PreKeyMessage) Serialize() ([]byte, error) { func (m *PreKeyMessage) GetVersion() (uint32, error) { var version C.uint - signalFfiError := C.signal_pre_key_signal_message_get_version(&version, m.constPtr()) + signalFfiError := C.signal_pre_key_signal_message_get_version(&version, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -93,7 +85,7 @@ func (m *PreKeyMessage) GetVersion() (uint32, error) { func (m *PreKeyMessage) GetRegistrationID() (uint32, error) { var registrationID C.uint - signalFfiError := C.signal_pre_key_signal_message_get_registration_id(®istrationID, m.constPtr()) + signalFfiError := C.signal_pre_key_signal_message_get_registration_id(®istrationID, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -103,7 +95,7 @@ func (m *PreKeyMessage) GetRegistrationID() (uint32, error) { func (m *PreKeyMessage) GetPreKeyID() (*uint32, error) { var preKeyID C.uint - signalFfiError := C.signal_pre_key_signal_message_get_pre_key_id(&preKeyID, m.constPtr()) + signalFfiError := C.signal_pre_key_signal_message_get_pre_key_id(&preKeyID, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -116,7 +108,7 @@ func (m *PreKeyMessage) GetPreKeyID() (*uint32, error) { func (m *PreKeyMessage) GetSignedPreKeyID() (uint32, error) { var signedPreKeyID C.uint - signalFfiError := C.signal_pre_key_signal_message_get_signed_pre_key_id(&signedPreKeyID, m.constPtr()) + signalFfiError := C.signal_pre_key_signal_message_get_signed_pre_key_id(&signedPreKeyID, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -125,31 +117,31 @@ func (m *PreKeyMessage) GetSignedPreKeyID() (uint32, error) { } func (m *PreKeyMessage) GetBaseKey() (*PublicKey, error) { - var publicKey C.SignalMutPointerPublicKey - signalFfiError := C.signal_pre_key_signal_message_get_base_key(&publicKey, m.constPtr()) + var publicKey *C.SignalPublicKey + signalFfiError := C.signal_pre_key_signal_message_get_base_key(&publicKey, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(publicKey.raw), nil + return wrapPublicKey(publicKey), nil } func (m *PreKeyMessage) GetIdentityKey() (*IdentityKey, error) { - var publicKey C.SignalMutPointerPublicKey - signalFfiError := C.signal_pre_key_signal_message_get_identity_key(&publicKey, m.constPtr()) + var publicKey *C.SignalPublicKey + signalFfiError := C.signal_pre_key_signal_message_get_identity_key(&publicKey, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return &IdentityKey{wrapPublicKey(publicKey.raw)}, nil + return &IdentityKey{wrapPublicKey(publicKey)}, nil } func (m *PreKeyMessage) GetSignalMessage() (*Message, error) { - var message C.SignalMutPointerSignalMessage - signalFfiError := C.signal_pre_key_signal_message_get_signal_message(&message, m.constPtr()) + var message *C.SignalMessage + signalFfiError := C.signal_pre_key_signal_message_get_signal_message(&message, m.ptr) runtime.KeepAlive(m) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapMessage(message.raw), nil + return wrapMessage(message), nil } diff --git a/pkg/libsignalgo/prekeystore.go b/pkg/libsignalgo/prekeystore.go index 8c3c36f..c678ade 100644 --- a/pkg/libsignalgo/prekeystore.go +++ b/pkg/libsignalgo/prekeystore.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,12 +17,14 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #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{ +func (ctx *CallbackContext) wrapPreKeyStore(store PreKeyStore) *C.SignalPreKeyStore { + return &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/privatekey.go b/pkg/libsignalgo/privatekey.go index 829d3f0..fa78a77 100644 --- a/pkg/libsignalgo/privatekey.go +++ b/pkg/libsignalgo/privatekey.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -35,45 +35,37 @@ func wrapPrivateKey(ptr *C.SignalPrivateKey) *PrivateKey { } func GeneratePrivateKey() (*PrivateKey, error) { - var pk C.SignalMutPointerPrivateKey + var pk *C.SignalPrivateKey signalFfiError := C.signal_privatekey_generate(&pk) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPrivateKey(pk.raw), nil + return wrapPrivateKey(pk), nil } func DeserializePrivateKey(keyData []byte) (*PrivateKey, error) { - var pk C.SignalMutPointerPrivateKey + var pk *C.SignalPrivateKey signalFfiError := C.signal_privatekey_deserialize(&pk, BytesToBuffer(keyData)) runtime.KeepAlive(keyData) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPrivateKey(pk.raw), nil -} - -func (pk *PrivateKey) mutPtr() C.SignalMutPointerPrivateKey { - return C.SignalMutPointerPrivateKey{pk.ptr} -} - -func (pk *PrivateKey) constPtr() C.SignalConstPointerPrivateKey { - return C.SignalConstPointerPrivateKey{pk.ptr} + return wrapPrivateKey(pk), nil } func (pk *PrivateKey) Clone() (*PrivateKey, error) { - var cloned C.SignalMutPointerPrivateKey - signalFfiError := C.signal_privatekey_clone(&cloned, pk.constPtr()) + var cloned *C.SignalPrivateKey + signalFfiError := C.signal_privatekey_clone(&cloned, pk.ptr) runtime.KeepAlive(pk) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPrivateKey(cloned.raw), nil + return wrapPrivateKey(cloned), nil } func (pk *PrivateKey) Destroy() error { pk.CancelFinalizer() - return wrapError(C.signal_privatekey_destroy(pk.mutPtr())) + return wrapError(C.signal_privatekey_destroy(pk.ptr)) } func (pk *PrivateKey) CancelFinalizer() { @@ -81,18 +73,18 @@ func (pk *PrivateKey) CancelFinalizer() { } func (pk *PrivateKey) GetPublicKey() (*PublicKey, error) { - var pub C.SignalMutPointerPublicKey - signalFfiError := C.signal_privatekey_get_public_key(&pub, pk.constPtr()) + var pub *C.SignalPublicKey + signalFfiError := C.signal_privatekey_get_public_key(&pub, pk.ptr) runtime.KeepAlive(pk) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(pub.raw), nil + return wrapPublicKey(pub), nil } func (pk *PrivateKey) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_privatekey_serialize(&serialized, pk.constPtr()) + signalFfiError := C.signal_privatekey_serialize(&serialized, pk.ptr) runtime.KeepAlive(pk) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -102,7 +94,7 @@ func (pk *PrivateKey) Serialize() ([]byte, error) { func (pk *PrivateKey) Sign(message []byte) ([]byte, error) { var signed C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_privatekey_sign(&signed, pk.constPtr(), BytesToBuffer(message)) + signalFfiError := C.signal_privatekey_sign(&signed, pk.ptr, BytesToBuffer(message)) runtime.KeepAlive(pk) runtime.KeepAlive(message) if signalFfiError != nil { @@ -113,7 +105,7 @@ func (pk *PrivateKey) Sign(message []byte) ([]byte, error) { func (pk *PrivateKey) Agree(publicKey *PublicKey) ([]byte, error) { var agreed C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_privatekey_agree(&agreed, pk.constPtr(), publicKey.constPtr()) + signalFfiError := C.signal_privatekey_agree(&agreed, pk.ptr, publicKey.ptr) runtime.KeepAlive(pk) runtime.KeepAlive(publicKey) if signalFfiError != nil { diff --git a/pkg/libsignalgo/profilekey.go b/pkg/libsignalgo/profilekey.go index 0c21aff..2cd1000 100644 --- a/pkg/libsignalgo/profilekey.go +++ b/pkg/libsignalgo/profilekey.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Scott Weber -// 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 @@ -18,14 +17,12 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" #include */ import "C" import ( - "encoding/base64" - "errors" - "fmt" "runtime" "unsafe" @@ -33,90 +30,37 @@ import ( "go.mau.fi/util/random" ) -const ProfileKeyLength = 32 -const AccessKeyLength = 16 -const ProfileKeyVersionLength = 64 +type ProfileKey [C.SignalPROFILE_KEY_LEN]byte +type ProfileKeyCommitment [C.SignalPROFILE_KEY_COMMITMENT_LEN]byte +type ProfileKeyVersion [C.SignalPROFILE_KEY_VERSION_ENCODED_LEN]byte +type AccessKey [C.SignalACCESS_KEY_LEN]byte -type ProfileKey [ProfileKeyLength]byte -type ProfileKeyCommitment = fixedArray97 -type ProfileKeyVersion [ProfileKeyVersionLength]byte -type AccessKey [AccessKeyLength]byte - -func (pk *ProfileKey) cFixedArray() *C.SignalType_FixedArray32_uint8_t { - return (*C.SignalType_FixedArray32_uint8_t)(unsafe.Pointer(pk)) -} - -func (pk *ProfileKey) cConstFixedArray() cFixedArray32Compat { - return cFixedArray32Compat(pk.cFixedArray()) -} - -func (pkv *ProfileKeyVersion) cFixedArray() *C.SignalType_FixedArray64_uint8_t { - return (*C.SignalType_FixedArray64_uint8_t)(unsafe.Pointer(pkv)) -} - -func (pkv *ProfileKeyVersion) cConstFixedArray() cFixedArray64Compat { - return cFixedArray64Compat(pkv.cFixedArray()) -} - -func (ak *AccessKey) cFixedArray() *C.SignalType_FixedArray16_uint8_t { - return (*C.SignalType_FixedArray16_uint8_t)(unsafe.Pointer(ak)) -} - -func (ak *AccessKey) cConstFixedArray() cFixedArray16Compat { - return cFixedArray16Compat(ak.cFixedArray()) -} - -func DeserializeProfileKey(bytes []byte) (*ProfileKey, error) { - if len(bytes) == 0 { - return nil, nil - } else if len(bytes) != ProfileKeyLength { - return nil, errors.New("invalid profile key length") - } - key := ProfileKey(bytes) - return &key, nil -} - -var blankProfileKey ProfileKey - -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[:]) + return string((*pv)[:]) } func (pk *ProfileKey) Slice() []byte { - if pk.IsEmpty() { + if pk == nil { return nil } - 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 < AccessKeyLength; i++ { - result[i] = ak[i] ^ other[i] - } - return &result -} - -func (ak *AccessKey) String() string { - return base64.StdEncoding.EncodeToString(ak[:]) + return (*pk)[:] } func (pk *ProfileKey) GetCommitment(u uuid.UUID) (*ProfileKeyCommitment, error) { - var result ProfileKeyCommitment - c_uuid := NewACIServiceID(u).cConstFixedArray() + c_result := [C.SignalPROFILE_KEY_COMMITMENT_LEN]C.uchar{} + c_profileKey := (*[C.SignalPROFILE_KEY_LEN]C.uchar)(unsafe.Pointer(pk)) + c_uuid, err := SignalServiceIDFromUUID(u) + if err != nil { + return nil, err + } signalFfiError := C.signal_profile_key_get_commitment( - result.cFixedArray(), - pk.cConstFixedArray(), + &c_result, + c_profileKey, c_uuid, ) runtime.KeepAlive(pk) @@ -126,16 +70,22 @@ func (pk *ProfileKey) GetCommitment(u uuid.UUID) (*ProfileKeyCommitment, error) return nil, wrapError(signalFfiError) } + var result ProfileKeyCommitment + copy(result[:], C.GoBytes(unsafe.Pointer(&c_result), C.int(C.SignalPROFILE_KEY_COMMITMENT_LEN))) return &result, nil } func (pk *ProfileKey) GetProfileKeyVersion(u uuid.UUID) (*ProfileKeyVersion, error) { - var result ProfileKeyVersion - c_uuid := NewACIServiceID(u).cConstFixedArray() + c_result := [C.SignalPROFILE_KEY_VERSION_ENCODED_LEN]C.uchar{} + c_profileKey := (*[C.SignalPROFILE_KEY_LEN]C.uchar)(unsafe.Pointer(pk)) + c_uuid, err := SignalServiceIDFromUUID(u) + if err != nil { + return nil, err + } signalFfiError := C.signal_profile_key_get_profile_key_version( - result.cFixedArray(), - pk.cConstFixedArray(), + &c_result, + c_profileKey, c_uuid, ) runtime.KeepAlive(pk) @@ -145,15 +95,18 @@ func (pk *ProfileKey) GetProfileKeyVersion(u uuid.UUID) (*ProfileKeyVersion, err return nil, wrapError(signalFfiError) } + var result ProfileKeyVersion + copy(result[:], C.GoBytes(unsafe.Pointer(&c_result), C.int(C.SignalPROFILE_KEY_VERSION_ENCODED_LEN))) return &result, nil } func (pk *ProfileKey) DeriveAccessKey() (*AccessKey, error) { - var result AccessKey + c_result := [C.SignalACCESS_KEY_LEN]C.uchar{} + c_profileKey := (*[C.SignalPROFILE_KEY_LEN]C.uchar)(unsafe.Pointer(pk)) signalFfiError := C.signal_profile_key_derive_access_key( - result.cFixedArray(), - pk.cConstFixedArray(), + &c_result, + c_profileKey, ) runtime.KeepAlive(pk) @@ -161,115 +114,93 @@ func (pk *ProfileKey) DeriveAccessKey() (*AccessKey, error) { return nil, wrapError(signalFfiError) } + var result AccessKey + copy(result[:], C.GoBytes(unsafe.Pointer(&c_result), C.int(C.SignalACCESS_KEY_LEN))) return &result, nil } -const ExpiringProfileKeyCredentialResponseLength = 497 - -type ProfileKeyCredentialRequestContext [473]byte -type ProfileKeyCredentialRequest = fixedArray329 +type ProfileKeyCredentialRequestContext [C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN]byte +type ProfileKeyCredentialRequest [C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_LEN]byte type ProfileKeyCredentialResponse []byte type ProfileKeyCredentialPresentation []byte -type ExpiringProfileKeyCredential = fixedArray153 -type ExpiringProfileKeyCredentialResponse = fixedArray497 +type ServerPublicParams [C.SignalSERVER_PUBLIC_PARAMS_LEN]byte -func (p *ProfileKeyCredentialRequestContext) cFixedArray() *C.SignalType_FixedArray473_uint8_t { - return (*C.SignalType_FixedArray473_uint8_t)(unsafe.Pointer(p)) -} - -func (p *ProfileKeyCredentialRequestContext) cConstFixedArray() cFixedArray473Compat { - return cFixedArray473Compat(p.cFixedArray()) -} - -func CreateProfileKeyCredentialRequestContext(serverPublicParams *ServerPublicParams, u uuid.UUID, profileKey ProfileKey) (*ProfileKeyCredentialRequestContext, error) { - var result ProfileKeyCredentialRequestContext - randBytes := Randomness(random.Bytes(RandomnessLength)) - c_uuid := NewACIServiceID(u).cConstFixedArray() +func CreateProfileKeyCredentialRequestContext(serverPublicParams ServerPublicParams, u uuid.UUID, profileKey ProfileKey) (*ProfileKeyCredentialRequestContext, error) { + c_result := [C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN]C.uchar{} + c_serverPublicParams := (*[C.SignalSERVER_PUBLIC_PARAMS_LEN]C.uchar)(unsafe.Pointer(&serverPublicParams[0])) + randBytes := [32]byte(random.Bytes(32)) + c_random := (*[32]C.uchar)(unsafe.Pointer(&randBytes[0])) + c_profileKey := (*[C.SignalPROFILE_KEY_LEN]C.uchar)(unsafe.Pointer(&profileKey[0])) + c_uuid, err := SignalServiceIDFromUUID(u) + if err != nil { + return nil, err + } signalFfiError := C.signal_server_public_params_create_profile_key_credential_request_context_deterministic( - result.cFixedArray(), - C.SignalConstPointerServerPublicParams{serverPublicParams}, - randBytes.cConstFixedArray(), + &c_result, + c_serverPublicParams, + c_random, c_uuid, - profileKey.cConstFixedArray(), + c_profileKey, ) + runtime.KeepAlive(serverPublicParams) runtime.KeepAlive(u) runtime.KeepAlive(profileKey) runtime.KeepAlive(randBytes) if signalFfiError != nil { return nil, wrapError(signalFfiError) } + result := ProfileKeyCredentialRequestContext(C.GoBytes(unsafe.Pointer(&c_result), C.int(C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN))) return &result, nil } func (p *ProfileKeyCredentialRequestContext) ProfileKeyCredentialRequestContextGetRequest() (*ProfileKeyCredentialRequest, error) { - var result ProfileKeyCredentialRequest + c_result := [C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_LEN]C.uchar{} + c_context := (*[C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_CONTEXT_LEN]C.uchar)(unsafe.Pointer(p)) signalFfiError := C.signal_profile_key_credential_request_context_get_request( - result.cFixedArray(), - p.cConstFixedArray(), + &c_result, + c_context, ) runtime.KeepAlive(p) if signalFfiError != nil { return nil, wrapError(signalFfiError) } + result := ProfileKeyCredentialRequest(C.GoBytes(unsafe.Pointer(&c_result), C.int(C.SignalPROFILE_KEY_CREDENTIAL_REQUEST_LEN))) return &result, nil } -func NewExpiringProfileKeyCredentialResponse(b []byte) (*ExpiringProfileKeyCredentialResponse, error) { - if len(b) != ExpiringProfileKeyCredentialResponseLength { - return nil, fmt.Errorf("invalid expiring profile key credential response length %d (expected %d)", len(b), ExpiringProfileKeyCredentialResponseLength) - } +func NewProfileKeyCredentialResponse(b []byte) (ProfileKeyCredentialResponse, error) { borrowedBuffer := BytesToBuffer(b) signalFfiError := C.signal_expiring_profile_key_credential_response_check_valid_contents(borrowedBuffer) runtime.KeepAlive(b) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - response := ExpiringProfileKeyCredentialResponse(b) - return &response, nil + return ProfileKeyCredentialResponse(b), nil } -func ReceiveExpiringProfileKeyCredential(spp *ServerPublicParams, requestContext *ProfileKeyCredentialRequestContext, response *ExpiringProfileKeyCredentialResponse, currentTimeInSeconds uint64) (*ExpiringProfileKeyCredential, error) { - var credential ExpiringProfileKeyCredential - signalFfiError := C.signal_server_public_params_receive_expiring_profile_key_credential( - credential.cFixedArray(), - C.SignalConstPointerServerPublicParams{spp}, - requestContext.cConstFixedArray(), - response.cConstFixedArray(), - (C.uint64_t)(currentTimeInSeconds), - ) - runtime.KeepAlive(requestContext) - runtime.KeepAlive(response) - runtime.KeepAlive(currentTimeInSeconds) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return &credential, nil -} - -func (a ProfileKeyCredentialPresentation) CheckValidContents() error { - signalFfiError := C.signal_profile_key_credential_presentation_check_valid_contents(BytesToBuffer(a)) - runtime.KeepAlive(a) - return wrapError(signalFfiError) -} - -func (a ProfileKeyCredentialPresentation) UUIDCiphertext() (UUIDCiphertext, error) { - var out UUIDCiphertext - signalFfiError := C.signal_profile_key_credential_presentation_get_uuid_ciphertext(out.cFixedArray(), BytesToBuffer(a)) - runtime.KeepAlive(a) - if signalFfiError != nil { - return UUIDCiphertext{}, wrapError(signalFfiError) - } - return out, nil -} - -func (a ProfileKeyCredentialPresentation) ProfileKeyCiphertext() (ProfileKeyCiphertext, error) { - var out ProfileKeyCiphertext - signalFfiError := C.signal_profile_key_credential_presentation_get_profile_key_ciphertext(out.cFixedArray(), BytesToBuffer(a)) - runtime.KeepAlive(a) - if signalFfiError != nil { - return ProfileKeyCiphertext{}, wrapError(signalFfiError) - } - return out, nil -} +//func NewProfileKeyCredentialPresentation(b []byte) (ProfileKeyCredentialPresentation, error) { +// C.signal_profile_key_credential_presentation_check_valid_contents(cBytes(b), cLen(b)) +// if res := C.FFI_ProfileKeyCredentialPresentation_checkValidContents(cBytes(b), cLen(b)); res != C.FFI_RETURN_OK { +// return nil, errFromCode(res) +// } +// return ProfileKeyCredentialPresentation(b), nil +//} +// +//func (a ProfileKeyCredentialPresentation) UUIDCiphertext() ([]byte, error) { +// out := make([]byte, C.UUID_CIPHERTEXT_LEN) +// if res := C.FFI_ProfileKeyCredentialPresentation_getUuidCiphertext(cBytes(a), cLen(a), cBytes(out), cLen(out)); res != C.FFI_RETURN_OK { +// return nil, errFromCode(res) +// } +// return out, nil +//} +// +//func (a ProfileKeyCredentialPresentation) ProfileKeyCiphertext() ([]byte, error) { +// out := make([]byte, C.PROFILE_KEY_CIPHERTEXT_LEN) +// if res := C.FFI_ProfileKeyCredentialPresentation_getProfileKeyCiphertext(cBytes(a), cLen(a), cBytes(out), cLen(out)); res != C.FFI_RETURN_OK { +// return nil, errFromCode(res) +// } +// return out, nil +//} +// diff --git a/pkg/libsignalgo/protocol.go b/pkg/libsignalgo/protocol.go new file mode 100644 index 0000000..4d834fe --- /dev/null +++ b/pkg/libsignalgo/protocol.go @@ -0,0 +1,49 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Sumner Evans +// +// 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 + +/* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm +#include "./libsignal-ffi.h" +*/ +import "C" +import ( + "context" + "runtime" + "time" +) + +func Encrypt(ctx context.Context, plaintext []byte, forAddress *Address, sessionStore SessionStore, identityKeyStore IdentityKeyStore) (*CiphertextMessage, error) { + var ciphertextMessage *C.SignalCiphertextMessage + var now C.uint64_t = C.uint64_t(time.Now().Unix()) + callbackCtx := NewCallbackContext(ctx) + defer callbackCtx.Unref() + signalFfiError := C.signal_encrypt_message( + &ciphertextMessage, + BytesToBuffer(plaintext), + forAddress.ptr, + callbackCtx.wrapSessionStore(sessionStore), + callbackCtx.wrapIdentityKeyStore(identityKeyStore), + now, + ) + runtime.KeepAlive(plaintext) + runtime.KeepAlive(forAddress) + if signalFfiError != nil { + return nil, callbackCtx.wrapError(signalFfiError) + } + return wrapCiphertextMessage(ciphertextMessage), nil +} diff --git a/pkg/libsignalgo/publickey.go b/pkg/libsignalgo/publickey.go index fdd76e5..5ce452d 100644 --- a/pkg/libsignalgo/publickey.go +++ b/pkg/libsignalgo/publickey.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -29,45 +29,34 @@ 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 } -func (pk *PublicKey) mutPtr() C.SignalMutPointerPublicKey { - return C.SignalMutPointerPublicKey{pk.ptr} -} - -func (pk *PublicKey) constPtr() C.SignalConstPointerPublicKey { - return C.SignalConstPointerPublicKey{pk.ptr} -} - func (pk *PublicKey) Clone() (*PublicKey, error) { - var cloned C.SignalMutPointerPublicKey - signalFfiError := C.signal_publickey_clone(&cloned, pk.constPtr()) + var cloned *C.SignalPublicKey + signalFfiError := C.signal_publickey_clone(&cloned, pk.ptr) runtime.KeepAlive(pk) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(cloned.raw), nil + return wrapPublicKey(cloned), nil } func DeserializePublicKey(keyData []byte) (*PublicKey, error) { - var pk C.SignalMutPointerPublicKey + var pk *C.SignalPublicKey signalFfiError := C.signal_publickey_deserialize(&pk, BytesToBuffer(keyData)) runtime.KeepAlive(keyData) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(pk.raw), nil + return wrapPublicKey(pk), nil } func (pk *PublicKey) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_publickey_serialize(&serialized, pk.constPtr()) + signalFfiError := C.signal_publickey_serialize(&serialized, pk.ptr) runtime.KeepAlive(pk) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -77,27 +66,27 @@ func (pk *PublicKey) Serialize() ([]byte, error) { func (k *PublicKey) Destroy() error { k.CancelFinalizer() - return wrapError(C.signal_publickey_destroy(k.mutPtr())) + return wrapError(C.signal_publickey_destroy(k.ptr)) } 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.ptr, other.ptr) 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) { var pub C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_publickey_get_public_key_bytes(&pub, k.constPtr()) + signalFfiError := C.signal_publickey_get_public_key_bytes(&pub, k.ptr) runtime.KeepAlive(k) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -107,12 +96,7 @@ func (k *PublicKey) Bytes() ([]byte, error) { func (k *PublicKey) Verify(message, signature []byte) (bool, error) { var verify C.bool - signalFfiError := C.signal_publickey_verify( - &verify, - k.constPtr(), - BytesToBuffer(message), - BytesToBuffer(signature), - ) + signalFfiError := C.signal_publickey_verify(&verify, k.ptr, BytesToBuffer(message), BytesToBuffer(signature)) runtime.KeepAlive(k) runtime.KeepAlive(message) runtime.KeepAlive(signature) diff --git a/pkg/libsignalgo/sealedsender.go b/pkg/libsignalgo/sealedsender.go index ac7a0a0..f747b35 100644 --- a/pkg/libsignalgo/sealedsender.go +++ b/pkg/libsignalgo/sealedsender.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Scott Weber -// 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 @@ -18,14 +17,14 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" import ( "context" - "fmt" "runtime" - "unsafe" + "time" "github.com/google/uuid" ) @@ -44,17 +43,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, forAddress *Address, fromSenderCert *SenderCertificate, sessionStore SessionStore, identityStore IdentityKeyStore) ([]byte, error) { + ciphertextMessage, err := Encrypt(ctx, message, forAddress, sessionStore, identityStore) if err != nil { return nil, err } @@ -62,8 +52,8 @@ func SealedSenderEncryptPlaintext( usmc, err := NewUnidentifiedSenderMessageContent( ciphertextMessage, fromSenderCert, - contentHint, - groupID, + UnidentifiedSenderMessageContentHintDefault, + nil, ) if err != nil { return nil, err @@ -77,8 +67,8 @@ func SealedSenderEncrypt(ctx context.Context, usmc *UnidentifiedSenderMessageCon defer callbackCtx.Unref() signalFfiError := C.signal_sealed_session_cipher_encrypt( &encrypted, - forRecipient.constPtr(), - usmc.constPtr(), + forRecipient.ptr, + usmc.ptr, callbackCtx.wrapIdentityKeyStore(identityStore), ) runtime.KeepAlive(usmc) @@ -89,51 +79,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 { @@ -148,7 +95,7 @@ func SealedSenderDecryptToUSMC( ) (*UnidentifiedSenderMessageContent, error) { callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() - var usmc C.SignalMutPointerUnidentifiedSenderMessageContent + var usmc *C.SignalUnidentifiedSenderMessageContent = nil signalFfiError := C.signal_sealed_session_cipher_decrypt_to_usmc( &usmc, BytesToBuffer(ciphertext), @@ -158,7 +105,62 @@ func SealedSenderDecryptToUSMC( if signalFfiError != nil { return nil, callbackCtx.wrapError(signalFfiError) } - return wrapUnidentifiedSenderMessageContent(usmc.raw), nil + return wrapUnidentifiedSenderMessageContent(usmc), nil +} + +func SealedSenderDecrypt( + ctx context.Context, + ciphertext []byte, + localAddress *SealedSenderAddress, + trustRoot *PublicKey, + timestamp time.Time, + sessionStore SessionStore, + identityStore IdentityKeyStore, + preKeyStore PreKeyStore, + signedPreKeyStore SignedPreKeyStore, +) (result SealedSenderResult, err error) { + callbackCtx := NewCallbackContext(ctx) + defer callbackCtx.Unref() + + var decrypted C.SignalOwnedBuffer = C.SignalOwnedBuffer{} + var senderE164 *C.char + var senderUUID *C.char + var senderDeviceID C.uint32_t + + signalFfiError := C.signal_sealed_session_cipher_decrypt( + &decrypted, + &senderE164, + &senderUUID, + &senderDeviceID, + BytesToBuffer(ciphertext), + trustRoot.ptr, + C.uint64_t(timestamp.UnixMilli()), + C.CString(localAddress.E164), + C.CString(localAddress.UUID.String()), + C.uint32_t(localAddress.DeviceID), + callbackCtx.wrapSessionStore(sessionStore), + callbackCtx.wrapIdentityKeyStore(identityStore), + callbackCtx.wrapPreKeyStore(preKeyStore), + callbackCtx.wrapSignedPreKeyStore(signedPreKeyStore), + ) + runtime.KeepAlive(localAddress) + runtime.KeepAlive(trustRoot) + if signalFfiError != nil { + err = callbackCtx.wrapError(signalFfiError) + return + } + + defer C.signal_free_string(senderE164) + defer C.signal_free_string(senderUUID) + + return SealedSenderResult{ + Message: CopySignalOwnedBufferToBytes(decrypted), + Sender: SealedSenderAddress{ + E164: C.GoString(senderE164), + UUID: uuid.MustParse(C.GoString(senderUUID)), + DeviceID: uint32(senderDeviceID), + }, + }, nil } type UnidentifiedSenderMessageContentHint uint32 @@ -169,19 +171,6 @@ const ( UnidentifiedSenderMessageContentHintImplicit UnidentifiedSenderMessageContentHint = 2 ) -func (hint UnidentifiedSenderMessageContentHint) String() string { - switch hint { - case UnidentifiedSenderMessageContentHintDefault: - return "Default" - case UnidentifiedSenderMessageContentHintResendable: - return "Resendable" - case UnidentifiedSenderMessageContentHintImplicit: - return "Implicit" - default: - return fmt.Sprintf("Unknown(%d)", hint) - } -} - type UnidentifiedSenderMessageContent struct { nc noCopy ptr *C.SignalUnidentifiedSenderMessageContent @@ -193,26 +182,16 @@ func wrapUnidentifiedSenderMessageContent(ptr *C.SignalUnidentifiedSenderMessage return messageContent } -func NewUnidentifiedSenderMessageContent(message *CiphertextMessage, senderCertificate *SenderCertificate, contentHint UnidentifiedSenderMessageContentHint, groupID *GroupIdentifier) (*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), - ) +func NewUnidentifiedSenderMessageContent(message *CiphertextMessage, senderCertificate *SenderCertificate, contentHint UnidentifiedSenderMessageContentHint, groupID []byte) (*UnidentifiedSenderMessageContent, error) { + var usmc *C.SignalUnidentifiedSenderMessageContent + signalFfiError := C.signal_unidentified_sender_message_content_new(&usmc, message.ptr, senderCertificate.ptr, C.uint32_t(contentHint), BytesToBuffer(groupID)) runtime.KeepAlive(message) runtime.KeepAlive(senderCertificate) - runtime.KeepAlive(groupIDBytes) + runtime.KeepAlive(groupID) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapUnidentifiedSenderMessageContent(usmc.raw), nil + return wrapUnidentifiedSenderMessageContent(usmc), nil } //func NewUnidentifiedSenderMessageContentFromMessage(sealedSenderMessage []byte, identityStore IdentityKeyStore, ctx *CallbackContext) (*UnidentifiedSenderMessageContent, error) { @@ -234,26 +213,18 @@ func NewUnidentifiedSenderMessageContent(message *CiphertextMessage, senderCerti //} func DeserializeUnidentifiedSenderMessageContent(serialized []byte) (*UnidentifiedSenderMessageContent, error) { - var usmc C.SignalMutPointerUnidentifiedSenderMessageContent + var usmc *C.SignalUnidentifiedSenderMessageContent signalFfiError := C.signal_unidentified_sender_message_content_deserialize(&usmc, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapUnidentifiedSenderMessageContent(usmc.raw), nil -} - -func (usmc *UnidentifiedSenderMessageContent) mutPtr() C.SignalMutPointerUnidentifiedSenderMessageContent { - return C.SignalMutPointerUnidentifiedSenderMessageContent{usmc.ptr} -} - -func (usmc *UnidentifiedSenderMessageContent) constPtr() C.SignalConstPointerUnidentifiedSenderMessageContent { - return C.SignalConstPointerUnidentifiedSenderMessageContent{usmc.ptr} + return wrapUnidentifiedSenderMessageContent(usmc), nil } func (usmc *UnidentifiedSenderMessageContent) Destroy() error { usmc.CancelFinalizer() - return wrapError(C.signal_unidentified_sender_message_content_destroy(usmc.mutPtr())) + return wrapError(C.signal_unidentified_sender_message_content_destroy(usmc.ptr)) } func (usmc *UnidentifiedSenderMessageContent) CancelFinalizer() { @@ -262,7 +233,7 @@ func (usmc *UnidentifiedSenderMessageContent) CancelFinalizer() { func (usmc *UnidentifiedSenderMessageContent) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_unidentified_sender_message_content_serialize(&serialized, usmc.constPtr()) + signalFfiError := C.signal_unidentified_sender_message_content_serialize(&serialized, usmc.ptr) runtime.KeepAlive(usmc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -272,7 +243,7 @@ func (usmc *UnidentifiedSenderMessageContent) Serialize() ([]byte, error) { func (usmc *UnidentifiedSenderMessageContent) GetContents() ([]byte, error) { var contents C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_unidentified_sender_message_content_get_contents(&contents, usmc.constPtr()) + signalFfiError := C.signal_unidentified_sender_message_content_get_contents(&contents, usmc.ptr) runtime.KeepAlive(usmc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -280,35 +251,32 @@ 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 - signalFfiError := C.signal_unidentified_sender_message_content_get_sender_cert(&senderCertificate, usmc.constPtr()) + var senderCertificate *C.SignalSenderCertificate + signalFfiError := C.signal_unidentified_sender_message_content_get_sender_cert(&senderCertificate, usmc.ptr) runtime.KeepAlive(usmc) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSenderCertificate(senderCertificate.raw), nil + return wrapSenderCertificate(senderCertificate), nil } func (usmc *UnidentifiedSenderMessageContent) GetMessageType() (CiphertextMessageType, error) { var messageType C.uint8_t - signalFfiError := C.signal_unidentified_sender_message_content_get_msg_type(&messageType, usmc.constPtr()) + signalFfiError := C.signal_unidentified_sender_message_content_get_msg_type(&messageType, usmc.ptr) runtime.KeepAlive(usmc) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -318,7 +286,7 @@ func (usmc *UnidentifiedSenderMessageContent) GetMessageType() (CiphertextMessag func (usmc *UnidentifiedSenderMessageContent) GetContentHint() (UnidentifiedSenderMessageContentHint, error) { var contentHint C.uint32_t - signalFfiError := C.signal_unidentified_sender_message_content_get_content_hint(&contentHint, usmc.constPtr()) + signalFfiError := C.signal_unidentified_sender_message_content_get_content_hint(&contentHint, usmc.ptr) runtime.KeepAlive(usmc) if signalFfiError != nil { return 0, wrapError(signalFfiError) diff --git a/pkg/libsignalgo/sendercertificate.go b/pkg/libsignalgo/sendercertificate.go index cf39fd6..a5d3f6f 100644 --- a/pkg/libsignalgo/sendercertificate.go +++ b/pkg/libsignalgo/sendercertificate.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,13 +17,13 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" import ( "runtime" "time" - "unsafe" "github.com/google/uuid" ) @@ -43,21 +42,8 @@ func wrapSenderCertificate(ptr *C.SignalSenderCertificate) *SenderCertificate { // NewSenderCertificate should only be used for testing (at least according to // the Swift bindings). func NewSenderCertificate(sender *SealedSenderAddress, publicKey *PublicKey, expiration time.Time, signerCertificate *ServerCertificate, signerKey *PrivateKey) (*SenderCertificate, error) { - var sc C.SignalMutPointerSenderCertificate - senderUUIDStr, freeSenderUUIDStr := GoStringToCString(sender.UUID.String()) - defer freeSenderUUIDStr() - senderE164Str, freeSenderE164Str := GoStringToCString(sender.E164) - defer freeSenderE164Str() - signalFfiError := C.signal_sender_certificate_new( - &sc, - senderUUIDStr, - senderE164Str, - C.uint32_t(sender.DeviceID), - publicKey.constPtr(), - C.uint64_t(expiration.UnixMilli()), - signerCertificate.constPtr(), - signerKey.constPtr(), - ) + var sc *C.SignalSenderCertificate + signalFfiError := C.signal_sender_certificate_new(&sc, C.CString(sender.UUID.String()), C.CString(sender.E164), C.uint32_t(sender.DeviceID), publicKey.ptr, C.uint64_t(expiration.UnixMilli()), signerCertificate.ptr, signerKey.ptr) runtime.KeepAlive(sender) runtime.KeepAlive(publicKey) runtime.KeepAlive(signerCertificate) @@ -65,43 +51,32 @@ func NewSenderCertificate(sender *SealedSenderAddress, publicKey *PublicKey, exp if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSenderCertificate(sc.raw), nil + return wrapSenderCertificate(sc), nil } func DeserializeSenderCertificate(serialized []byte) (*SenderCertificate, error) { - var sc C.SignalMutPointerSenderCertificate + var sc *C.SignalSenderCertificate signalFfiError := C.signal_sender_certificate_deserialize(&sc, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSenderCertificate(sc.raw), nil + return wrapSenderCertificate(sc), nil } func (sc *SenderCertificate) Clone() (*SenderCertificate, error) { - var cloned C.SignalMutPointerSenderCertificate - signalFfiError := C.signal_sender_certificate_clone( - &cloned, - sc.constPtr(), - ) + var cloned *C.SignalSenderCertificate + signalFfiError := C.signal_sender_certificate_clone(&cloned, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSenderCertificate(cloned.raw), nil -} - -func (sc *SenderCertificate) mutPtr() C.SignalMutPointerSenderCertificate { - return C.SignalMutPointerSenderCertificate{sc.ptr} -} - -func (sc *SenderCertificate) constPtr() C.SignalConstPointerSenderCertificate { - return C.SignalConstPointerSenderCertificate{sc.ptr} + return wrapSenderCertificate(cloned), nil } func (sc *SenderCertificate) Destroy() error { sc.CancelFinalizer() - return wrapError(C.signal_sender_certificate_destroy(sc.mutPtr())) + return wrapError(C.signal_sender_certificate_destroy(sc.ptr)) } func (sc *SenderCertificate) CancelFinalizer() { @@ -110,7 +85,7 @@ func (sc *SenderCertificate) CancelFinalizer() { func (sc *SenderCertificate) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_sender_certificate_get_serialized(&serialized, sc.constPtr()) + signalFfiError := C.signal_sender_certificate_get_serialized(&serialized, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -120,7 +95,7 @@ func (sc *SenderCertificate) Serialize() ([]byte, error) { func (sc *SenderCertificate) GetCertificate() ([]byte, error) { var certificate C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_sender_certificate_get_certificate(&certificate, sc.constPtr()) + signalFfiError := C.signal_sender_certificate_get_certificate(&certificate, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -130,7 +105,7 @@ func (sc *SenderCertificate) GetCertificate() ([]byte, error) { func (sc *SenderCertificate) GetSignature() ([]byte, error) { var signature C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_sender_certificate_get_signature(&signature, sc.constPtr()) + signalFfiError := C.signal_sender_certificate_get_signature(&signature, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -139,8 +114,8 @@ func (sc *SenderCertificate) GetSignature() ([]byte, error) { } func (sc *SenderCertificate) GetSenderUUID() (uuid.UUID, error) { - var rawUUID C.SignalCStringPtr - signalFfiError := C.signal_sender_certificate_get_sender_uuid(&rawUUID, sc.constPtr()) + var rawUUID *C.char + signalFfiError := C.signal_sender_certificate_get_sender_uuid(&rawUUID, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return uuid.UUID{}, wrapError(signalFfiError) @@ -149,8 +124,8 @@ func (sc *SenderCertificate) GetSenderUUID() (uuid.UUID, error) { } func (sc *SenderCertificate) GetSenderE164() (string, error) { - var e164 C.SignalCStringPtr - signalFfiError := C.signal_sender_certificate_get_sender_e164(&e164, sc.constPtr()) + var e164 *C.char + signalFfiError := C.signal_sender_certificate_get_sender_e164(&e164, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return "", wrapError(signalFfiError) @@ -163,7 +138,7 @@ func (sc *SenderCertificate) GetSenderE164() (string, error) { func (sc *SenderCertificate) GetExpiration() (time.Time, error) { var expiration C.uint64_t - signalFfiError := C.signal_sender_certificate_get_expiration(&expiration, sc.constPtr()) + signalFfiError := C.signal_sender_certificate_get_expiration(&expiration, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return time.Time{}, wrapError(signalFfiError) @@ -173,7 +148,7 @@ func (sc *SenderCertificate) GetExpiration() (time.Time, error) { func (sc *SenderCertificate) GetDeviceID() (uint32, error) { var deviceID C.uint32_t - signalFfiError := C.signal_sender_certificate_get_device_id(&deviceID, sc.constPtr()) + signalFfiError := C.signal_sender_certificate_get_device_id(&deviceID, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -182,34 +157,20 @@ func (sc *SenderCertificate) GetDeviceID() (uint32, error) { } func (sc *SenderCertificate) GetKey() (*PublicKey, error) { - var key C.SignalMutPointerPublicKey - signalFfiError := C.signal_sender_certificate_get_key(&key, sc.constPtr()) + var key *C.SignalPublicKey + signalFfiError := C.signal_sender_certificate_get_key(&key, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(key.raw), nil + return wrapPublicKey(key), nil } -func (sc *SenderCertificate) Validate(trustRoots []*PublicKey, ts time.Time) (bool, error) { +func (sc *SenderCertificate) Validate(trustRoot *PublicKey, ts time.Time) (bool, error) { var valid C.bool - constRoots := make([]C.SignalConstPointerPublicKey, len(trustRoots)) - for i, root := range trustRoots { - constRoots[i] = root.constPtr() - } - signalFfiError := C.signal_sender_certificate_validate( - &valid, - sc.constPtr(), - // TODO this might not be correct - C.SignalBorrowedSliceOfConstPointerPublicKey{ - base: unsafe.SliceData(constRoots), - length: C.size_t(len(constRoots)), - }, - C.uint64_t(ts.UnixMilli()), - ) + signalFfiError := C.signal_sender_certificate_validate(&valid, sc.ptr, trustRoot.ptr, C.uint64_t(ts.UnixMilli())) runtime.KeepAlive(sc) - runtime.KeepAlive(trustRoots) - runtime.KeepAlive(constRoots) + runtime.KeepAlive(trustRoot) if signalFfiError != nil { return false, wrapError(signalFfiError) } @@ -217,11 +178,11 @@ func (sc *SenderCertificate) Validate(trustRoots []*PublicKey, ts time.Time) (bo } func (sc *SenderCertificate) GetServerCertificate() (*ServerCertificate, error) { - var serverCertificate C.SignalMutPointerServerCertificate - signalFfiError := C.signal_sender_certificate_get_server_certificate(&serverCertificate, sc.constPtr()) + var serverCertificate *C.SignalServerCertificate + signalFfiError := C.signal_sender_certificate_get_server_certificate(&serverCertificate, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapServerCertificate(serverCertificate.raw), nil + return wrapServerCertificate(serverCertificate), nil } diff --git a/pkg/libsignalgo/senderkeydistributionmessage.go b/pkg/libsignalgo/senderkeydistributionmessage.go index 48c0226..60c5910 100644 --- a/pkg/libsignalgo/senderkeydistributionmessage.go +++ b/pkg/libsignalgo/senderkeydistributionmessage.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -33,8 +33,8 @@ func ProcessSenderKeyDistributionMessage(ctx context.Context, message *SenderKey callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() signalFfiError := C.signal_process_sender_key_distribution_message( - fromSender.constPtr(), - message.constPtr(), + fromSender.ptr, + message.ptr, callbackCtx.wrapSenderKeyStore(store), ) runtime.KeepAlive(message) @@ -56,11 +56,11 @@ func wrapSenderKeyDistributionMessage(ptr *C.SignalSenderKeyDistributionMessage) func NewSenderKeyDistributionMessage(ctx context.Context, sender *Address, distributionID uuid.UUID, store SenderKeyStore) (*SenderKeyDistributionMessage, error) { callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() - var skdm C.SignalMutPointerSenderKeyDistributionMessage + var skdm *C.SignalSenderKeyDistributionMessage signalFfiError := C.signal_sender_key_distribution_message_create( &skdm, - sender.constPtr(), - *(*C.SignalUuid)(unsafe.Pointer(&distributionID)), + sender.ptr, + (*[C.SignalUUID_LEN]C.uchar)(unsafe.Pointer(&distributionID)), callbackCtx.wrapSenderKeyStore(store), ) runtime.KeepAlive(sender) @@ -68,30 +68,22 @@ func NewSenderKeyDistributionMessage(ctx context.Context, sender *Address, distr if signalFfiError != nil { return nil, callbackCtx.wrapError(signalFfiError) } - return wrapSenderKeyDistributionMessage(skdm.raw), nil + return wrapSenderKeyDistributionMessage(skdm), nil } func DeserializeSenderKeyDistributionMessage(serialized []byte) (*SenderKeyDistributionMessage, error) { - var skdm C.SignalMutPointerSenderKeyDistributionMessage + var skdm *C.SignalSenderKeyDistributionMessage signalFfiError := C.signal_sender_key_distribution_message_deserialize(&skdm, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSenderKeyDistributionMessage(skdm.raw), nil -} - -func (sc *SenderKeyDistributionMessage) mutPtr() C.SignalMutPointerSenderKeyDistributionMessage { - return C.SignalMutPointerSenderKeyDistributionMessage{sc.ptr} -} - -func (sc *SenderKeyDistributionMessage) constPtr() C.SignalConstPointerSenderKeyDistributionMessage { - return C.SignalConstPointerSenderKeyDistributionMessage{sc.ptr} + return wrapSenderKeyDistributionMessage(skdm), nil } func (sc *SenderKeyDistributionMessage) Destroy() error { sc.CancelFinalizer() - return wrapError(C.signal_sender_key_distribution_message_destroy(sc.mutPtr())) + return wrapError(C.signal_sender_key_distribution_message_destroy(sc.ptr)) } func (sc *SenderKeyDistributionMessage) CancelFinalizer() { @@ -100,8 +92,7 @@ func (sc *SenderKeyDistributionMessage) CancelFinalizer() { func (sc *SenderKeyDistributionMessage) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_sender_key_distribution_message_serialize(&serialized, sc.constPtr()) - runtime.KeepAlive(sc) + signalFfiError := C.signal_sender_key_distribution_message_serialize(&serialized, sc.ptr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } @@ -112,12 +103,11 @@ func (sc *SenderKeyDistributionMessage) Process(ctx context.Context, sender *Add callbackCtx := NewCallbackContext(ctx) defer callbackCtx.Unref() signalFfiError := C.signal_process_sender_key_distribution_message( - sender.constPtr(), - sc.constPtr(), + sender.ptr, + sc.ptr, callbackCtx.wrapSenderKeyStore(store), ) runtime.KeepAlive(sender) - runtime.KeepAlive(sc) if signalFfiError != nil { return callbackCtx.wrapError(signalFfiError) } diff --git a/pkg/libsignalgo/senderkeyrecord.go b/pkg/libsignalgo/senderkeyrecord.go index b40c46f..cc487df 100644 --- a/pkg/libsignalgo/senderkeyrecord.go +++ b/pkg/libsignalgo/senderkeyrecord.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -37,18 +37,18 @@ func wrapSenderKeyRecord(ptr *C.SignalSenderKeyRecord) *SenderKeyRecord { } func DeserializeSenderKeyRecord(serialized []byte) (*SenderKeyRecord, error) { - var sc C.SignalMutPointerSenderKeyRecord + var sc *C.SignalSenderKeyRecord signalFfiError := C.signal_sender_key_record_deserialize(&sc, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSenderKeyRecord(sc.raw), nil + return wrapSenderKeyRecord(sc), nil } func (skr *SenderKeyRecord) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_sender_key_record_serialize(&serialized, skr.constPtr()) + signalFfiError := C.signal_sender_key_record_serialize(&serialized, skr.ptr) runtime.KeepAlive(skr) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -56,27 +56,19 @@ func (skr *SenderKeyRecord) Serialize() ([]byte, error) { return CopySignalOwnedBufferToBytes(serialized), nil } -func (skr *SenderKeyRecord) mutPtr() C.SignalMutPointerSenderKeyRecord { - return C.SignalMutPointerSenderKeyRecord{skr.ptr} -} - -func (skr *SenderKeyRecord) constPtr() C.SignalConstPointerSenderKeyRecord { - return C.SignalConstPointerSenderKeyRecord{skr.ptr} -} - func (skr *SenderKeyRecord) Clone() (*SenderKeyRecord, error) { - var cloned C.SignalMutPointerSenderKeyRecord - signalFfiError := C.signal_sender_key_record_clone(&cloned, skr.constPtr()) + var cloned *C.SignalSenderKeyRecord + signalFfiError := C.signal_sender_key_record_clone(&cloned, skr.ptr) runtime.KeepAlive(skr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSenderKeyRecord(cloned.raw), nil + return wrapSenderKeyRecord(cloned), nil } func (skr *SenderKeyRecord) Destroy() error { skr.CancelFinalizer() - return wrapError(C.signal_sender_key_record_destroy(skr.mutPtr())) + return wrapError(C.signal_sender_key_record_destroy(skr.ptr)) } func (skr *SenderKeyRecord) CancelFinalizer() { diff --git a/pkg/libsignalgo/senderkeystore.go b/pkg/libsignalgo/senderkeystore.go index 1649216..3d05fc2 100644 --- a/pkg/libsignalgo/senderkeystore.go +++ b/pkg/libsignalgo/senderkeystore.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,11 +17,16 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #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{ +func (ctx *CallbackContext) wrapSenderKeyStore(store SenderKeyStore) *C.SignalSenderKeyStore { + return &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/servercertificate.go b/pkg/libsignalgo/servercertificate.go index bf46009..64ba57a 100644 --- a/pkg/libsignalgo/servercertificate.go +++ b/pkg/libsignalgo/servercertificate.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -37,52 +37,39 @@ func wrapServerCertificate(ptr *C.SignalServerCertificate) *ServerCertificate { // NewServerCertificate should only be used for testing (at least according to // the Swift bindings). func NewServerCertificate(keyID uint32, publicKey *PublicKey, trustRoot *PrivateKey) (*ServerCertificate, error) { - var serverCertificate C.SignalMutPointerServerCertificate - signalFfiError := C.signal_server_certificate_new( - &serverCertificate, - C.uint32_t(keyID), - publicKey.constPtr(), - trustRoot.constPtr(), - ) + var serverCertificate *C.SignalServerCertificate + signalFfiError := C.signal_server_certificate_new(&serverCertificate, C.uint32_t(keyID), publicKey.ptr, trustRoot.ptr) runtime.KeepAlive(publicKey) runtime.KeepAlive(trustRoot) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapServerCertificate(serverCertificate.raw), nil + return wrapServerCertificate(serverCertificate), nil } func DeserializeServerCertificate(serialized []byte) (*ServerCertificate, error) { - var serverCertificate C.SignalMutPointerServerCertificate + var serverCertificate *C.SignalServerCertificate signalFfiError := C.signal_server_certificate_deserialize(&serverCertificate, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapServerCertificate(serverCertificate.raw), nil -} - -func (sc *ServerCertificate) mutPtr() C.SignalMutPointerServerCertificate { - return C.SignalMutPointerServerCertificate{sc.ptr} -} - -func (sc *ServerCertificate) constPtr() C.SignalConstPointerServerCertificate { - return C.SignalConstPointerServerCertificate{sc.ptr} + return wrapServerCertificate(serverCertificate), nil } func (sc *ServerCertificate) Clone() (*ServerCertificate, error) { - var cloned C.SignalMutPointerServerCertificate - signalFfiError := C.signal_server_certificate_clone(&cloned, sc.constPtr()) + var cloned *C.SignalServerCertificate + signalFfiError := C.signal_server_certificate_clone(&cloned, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapServerCertificate(cloned.raw), nil + return wrapServerCertificate(cloned), nil } func (sc *ServerCertificate) Destroy() error { sc.CancelFinalizer() - return wrapError(C.signal_server_certificate_destroy(sc.mutPtr())) + return wrapError(C.signal_server_certificate_destroy(sc.ptr)) } func (sc *ServerCertificate) CancelFinalizer() { @@ -91,7 +78,7 @@ func (sc *ServerCertificate) CancelFinalizer() { func (sc *ServerCertificate) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_server_certificate_get_serialized(&serialized, sc.constPtr()) + signalFfiError := C.signal_server_certificate_get_serialized(&serialized, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -101,7 +88,7 @@ func (sc *ServerCertificate) Serialize() ([]byte, error) { func (sc *ServerCertificate) GetCertificate() ([]byte, error) { var certificate C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_server_certificate_get_certificate(&certificate, sc.constPtr()) + signalFfiError := C.signal_server_certificate_get_certificate(&certificate, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -111,7 +98,7 @@ func (sc *ServerCertificate) GetCertificate() ([]byte, error) { func (sc *ServerCertificate) GetSignature() ([]byte, error) { var signature C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_server_certificate_get_signature(&signature, sc.constPtr()) + signalFfiError := C.signal_server_certificate_get_signature(&signature, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -121,7 +108,7 @@ func (sc *ServerCertificate) GetSignature() ([]byte, error) { func (sc *ServerCertificate) GetKeyID() (uint32, error) { var keyID C.uint32_t - signalFfiError := C.signal_server_certificate_get_key_id(&keyID, sc.constPtr()) + signalFfiError := C.signal_server_certificate_get_key_id(&keyID, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -130,11 +117,11 @@ func (sc *ServerCertificate) GetKeyID() (uint32, error) { } func (sc *ServerCertificate) GetKey() (*PublicKey, error) { - var key C.SignalMutPointerPublicKey - signalFfiError := C.signal_server_certificate_get_key(&key, sc.constPtr()) + var key *C.SignalPublicKey + signalFfiError := C.signal_server_certificate_get_key(&key, sc.ptr) runtime.KeepAlive(sc) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(key.raw), nil + return wrapPublicKey(key), nil } diff --git a/pkg/libsignalgo/serverpublicparams.go b/pkg/libsignalgo/serverpublicparams.go deleted file mode 100644 index 752bc2d..0000000 --- a/pkg/libsignalgo/serverpublicparams.go +++ /dev/null @@ -1,58 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2024 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" -#include -*/ -import "C" -import ( - "fmt" - "runtime" -) - -type ServerPublicParams = C.SignalServerPublicParams -type NotarySignature = fixedArray64 - -const ServerPublicParamsLength = 673 - -func DeserializeServerPublicParams(params []byte) (*ServerPublicParams, error) { - if len(params) != ServerPublicParamsLength { - return nil, fmt.Errorf("invalid server public params length: %d (expected %d)", len(params), ServerPublicParamsLength) - } - var out C.SignalMutPointerServerPublicParams - signalFfiError := C.signal_server_public_params_deserialize(&out, BytesToBuffer(params[:])) - if signalFfiError != nil { - return nil, wrapError(signalFfiError) - } - return out.raw, nil -} - -func ServerPublicParamsVerifySignature( - serverPublicParams *ServerPublicParams, - messageBytes []byte, - NotarySignature NotarySignature, -) error { - signalFfiError := C.signal_server_public_params_verify_signature( - C.SignalConstPointerServerPublicParams{serverPublicParams}, - BytesToBuffer(messageBytes), - NotarySignature.cConstFixedArray(), - ) - runtime.KeepAlive(messageBytes) - return wrapError(signalFfiError) -} diff --git a/pkg/libsignalgo/serviceid.go b/pkg/libsignalgo/serviceid.go index 38631ee..baffe22 100644 --- a/pkg/libsignalgo/serviceid.go +++ b/pkg/libsignalgo/serviceid.go @@ -1,5 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2024 Tulir Asokan +// Copyright (C) 2023 Scott Weber // // 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 @@ -17,177 +17,57 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" #include */ import "C" import ( - "database/sql/driver" - "fmt" - "strings" + "errors" + "runtime" "unsafe" "github.com/google/uuid" - "github.com/rs/zerolog" ) -type ServiceIDType byte - -const ( - ServiceIDTypeACI ServiceIDType = 0 - ServiceIDTypePNI ServiceIDType = 1 -) - -func (st ServiceIDType) String() string { - switch st { - case ServiceIDTypeACI: - return "ACI" - case ServiceIDTypePNI: - return "PNI" - default: - panic(fmt.Sprintf("invalid ServiceIDType: %d", st)) +func init() { + if C.SignalUUID_LEN != 16 { + panic("libsignal-ffi uuid type size mismatch") } } -func (st ServiceIDType) GoString() string { - return fmt.Sprintf("libsignalgo.ServiceIDType%s", st.String()) -} - -type ServiceID struct { - Type ServiceIDType - UUID uuid.UUID -} - -var EmptyServiceID ServiceID - -func NewPNIServiceID(uuid uuid.UUID) ServiceID { - return ServiceID{ - Type: ServiceIDTypePNI, - UUID: uuid, +func SignalServiceIDFromUUID(uuid uuid.UUID) (cPNIType, error) { + var result C.SignalServiceIdFixedWidthBinaryBytes + signalFfiError := C.signal_service_id_parse_from_service_id_binary(&result, BytesToBuffer(uuid[:])) + runtime.KeepAlive(uuid) + if signalFfiError != nil { + return nil, wrapError(signalFfiError) } + return cPNIType(unsafe.Pointer(&result)), nil } -func NewACIServiceID(uuid uuid.UUID) ServiceID { - return ServiceID{ - Type: ServiceIDTypeACI, - UUID: uuid, +func SignalPNIServiceIDFromUUID(uuid uuid.UUID) (cPNIType, error) { + var result C.SignalServiceIdFixedWidthBinaryBytes + // Prepend a 0x01 to the UUID to indicate that it is a PNI UUID + pniUUID := append([]byte{0x01}, uuid[:]...) + signalFfiError := C.signal_service_id_parse_from_service_id_binary(&result, BytesToBuffer(pniUUID)) + runtime.KeepAlive(pniUUID) + if signalFfiError != nil { + return nil, wrapError(signalFfiError) } + return cPNIType(unsafe.Pointer(&result)), nil } -func (s ServiceID) ToACIAndPNI() (aci, pni uuid.UUID) { - if s.Type == ServiceIDTypeACI { - return s.UUID, uuid.Nil - } else { - return uuid.Nil, s.UUID +func SignalServiceIDToUUID(serviceId *C.SignalServiceIdFixedWidthBinaryBytes) (uuid.UUID, error) { + result := C.SignalOwnedBuffer{} + serviceIdBytes := cPNIType(unsafe.Pointer(serviceId)) // Hack around gcc bug, not needed for clang + signalFfiError := C.signal_service_id_service_id_binary(&result, serviceIdBytes) + if signalFfiError != nil { + return uuid.UUID{}, wrapError(signalFfiError) } -} - -func (s ServiceID) IsEmpty() bool { - return s.UUID == uuid.Nil -} - -func (s ServiceID) Address(deviceID uint) (*Address, error) { - if s.IsEmpty() { - return nil, fmt.Errorf("cannot create address from empty ServiceID") + uuidBytes := CopySignalOwnedBufferToBytes(result) + if len(uuidBytes) != 16 { + return uuid.UUID{}, errors.New("invalid UUID length") } - return newAddress(s.String(), deviceID) -} - -func (s ServiceID) Bytes() []byte { - if s.Type == ServiceIDTypeACI { - return s.UUID[:] - } - return append([]byte{byte(s.Type)}, s.UUID[:]...) -} - -func (s ServiceID) Value() (driver.Value, error) { - return s.String(), nil -} - -func (s ServiceID) String() string { - if s.Type == ServiceIDTypeACI { - return s.UUID.String() - } - return fmt.Sprintf("%s:%s", s.Type, s.UUID) -} - -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) -} - -const ServiceIDUUIDLength = 16 -const ServiceIDFixedBytesLength = 17 - -type ServiceIDFixedBytes = fixedArray17 - -func (s ServiceID) FixedBytes() *ServiceIDFixedBytes { - var result ServiceIDFixedBytes - result[0] = byte(s.Type) - copy(result[1:], s.UUID[:]) - return &result -} - -func ServiceIDFromString(val string) (ServiceID, error) { - if len(val) < 36 { - return EmptyServiceID, fmt.Errorf("invalid UUID string: %s", val) - } - if strings.ToUpper(val[:4]) == "PNI:" { - parsed, err := uuid.Parse(val[4:]) - if err != nil { - return EmptyServiceID, err - } - return NewPNIServiceID(parsed), nil - } else { - parsed, err := uuid.Parse(val) - if err != nil { - return EmptyServiceID, err - } - return NewACIServiceID(parsed), nil - } -} - -func ServiceIDFromBytes(bytes []byte) (ServiceID, error) { - if len(bytes) == ServiceIDUUIDLength { - return NewACIServiceID(uuid.UUID(bytes)), nil - } else if len(bytes) == ServiceIDFixedBytesLength { - return ServiceID{ - Type: ServiceIDType(bytes[0]), - UUID: uuid.UUID(bytes[1:]), - }, nil - } - return EmptyServiceID, fmt.Errorf("invalid ServiceID byte length: %d (expected %d or %d)", len(bytes), ServiceIDUUIDLength, ServiceIDFixedBytesLength) -} - -func ServiceIDFromCFixedBytes(serviceID *C.SignalType_FixedArray17_uint8_t) ServiceID { - var id ServiceID - fixedBytes := (*ServiceIDFixedBytes)(unsafe.Pointer(serviceID)) - id.Type = ServiceIDType(fixedBytes[0]) - copy(id.UUID[:], fixedBytes[1:]) - return id -} - -func (s ServiceID) cFixedArray() *C.SignalType_FixedArray17_uint8_t { - return s.FixedBytes().cFixedArray() -} - -func (s ServiceID) cConstFixedArray() cFixedArray17Compat { - return cFixedArray17Compat(s.cFixedArray()) + return uuid.UUID(uuidBytes), nil } diff --git a/pkg/libsignalgo/serviceid_clang.go b/pkg/libsignalgo/serviceid_clang.go new file mode 100644 index 0000000..8de76b2 --- /dev/null +++ b/pkg/libsignalgo/serviceid_clang.go @@ -0,0 +1,12 @@ +//go:build darwin + +package libsignalgo + +/* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm +#include "./libsignal-ffi.h" +#include +*/ +import "C" + +type cPNIType = *C.SignalServiceIdFixedWidthBinaryBytes diff --git a/pkg/libsignalgo/serviceid_gcc.go b/pkg/libsignalgo/serviceid_gcc.go new file mode 100644 index 0000000..4152fba --- /dev/null +++ b/pkg/libsignalgo/serviceid_gcc.go @@ -0,0 +1,15 @@ +//go:build !darwin + +package libsignalgo + +/* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm +#include "./libsignal-ffi.h" +#include +*/ +import "C" + +// Hack for https://github.com/golang/go/issues/7270 +// The clang version is more correct, but doesn't work with gcc + +type cPNIType = *[17]C.uint8_t diff --git a/pkg/libsignalgo/session_test.go b/pkg/libsignalgo/session_test.go index dd05718..b557dfa 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) @@ -121,22 +121,20 @@ func initializeSessions(t *testing.T, aliceStore, bobStore *InMemorySignalProtoc // From SessionTests.swift:testSessionCipher func TestSessionCipher(t *testing.T) { ctx := context.TODO() - aliceACI := uuid.New() - bobACI := uuid.New() - aliceAddress, err := libsignalgo.NewACIServiceID(aliceACI).Address(1) + aliceAddress, err := libsignalgo.NewPhoneAddress("+14151111111", 1) assert.NoError(t, err) - bobAddress, err := libsignalgo.NewACIServiceID(bobACI).Address(1) + bobAddress, err := libsignalgo.NewPhoneAddress("+14151111112", 1) assert.NoError(t, err) 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 +145,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 +161,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) } @@ -172,22 +170,19 @@ func TestSessionCipher(t *testing.T) { func TestSessionCipherWithBadStore(t *testing.T) { ctx := context.TODO() - aliceACI := uuid.New() - bobACI := uuid.New() - - aliceAddress, err := libsignalgo.NewACIServiceID(aliceACI).Address(1) + aliceAddress, err := libsignalgo.NewPhoneAddress("+14151111111", 1) assert.NoError(t, err) - bobAddress, err := libsignalgo.NewACIServiceID(bobACI).Address(1) + bobAddress, err := libsignalgo.NewPhoneAddress("+14151111112", 1) assert.NoError(t, err) 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 +193,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 +211,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,29 +236,114 @@ 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, bobAddress, senderCert, aliceStore, aliceStore) require.NoError(t, err) assert.NotNil(t, ciphertext) } } +// From SessionTests.swift:testSealedSenderSession +func TestSealedSenderSession(t *testing.T) { + ctx := context.TODO() + + setupLogging() + + aliceAddress, err := libsignalgo.NewUUIDAddressFromString("9d0652a3-dcc3-4d11-975f-74d61598733f", 1) + assert.NoError(t, err) + bobAddress, err := libsignalgo.NewUUIDAddressFromString("6838237D-02F6-4098-B110-698253D15961", 1) + assert.NoError(t, err) + + aliceStore := NewInMemorySignalProtocolStore() + bobStore := NewInMemorySignalProtocolStore() + + initializeSessions(t, aliceStore, bobStore, bobAddress) + + trustRoot, err := libsignalgo.GenerateIdentityKeyPair() + assert.NoError(t, err) + serverKeys, err := libsignalgo.GenerateIdentityKeyPair() + assert.NoError(t, err) + serverCert, err := libsignalgo.NewServerCertificate(1, serverKeys.GetPublicKey(), trustRoot.GetPrivateKey()) + assert.NoError(t, err) + aliceName, err := aliceAddress.Name() + assert.NoError(t, err) + senderAddress := libsignalgo.NewSealedSenderAddress("+14151111111", uuid.MustParse(aliceName), 1) + + aliceIdentityKeyPair, err := aliceStore.GetIdentityKeyPair(ctx) + require.NoError(t, err) + senderCert, err := libsignalgo.NewSenderCertificate(senderAddress, aliceIdentityKeyPair.GetPublicKey(), time.UnixMilli(31337), serverCert, serverKeys.GetPrivateKey()) + assert.NoError(t, err) + + message := []byte("2020 vision") + ciphertext, err := libsignalgo.SealedSenderEncryptPlaintext(ctx, message, bobAddress, senderCert, aliceStore, aliceStore) + require.NoError(t, err) + assert.NotNil(t, ciphertext) + + bobName, err := bobAddress.Name() + require.NoError(t, err) + recipientAddress := libsignalgo.NewSealedSenderAddress("", uuid.MustParse(bobName), 1) + + t.Skip("This test is broken") // TODO fix + + plaintext, err := libsignalgo.SealedSenderDecrypt( + ctx, + ciphertext, + recipientAddress, + trustRoot.GetPublicKey(), + time.UnixMilli(31335), + bobStore, + bobStore, + bobStore, + bobStore, + ) + require.NoError(t, err) + assert.Equal(t, message, plaintext.Message) + assert.Equal(t, senderAddress.DeviceID, plaintext.Sender.DeviceID) + assert.Equal(t, senderAddress.E164, plaintext.Sender.E164) + assert.Equal(t, senderAddress.UUID, plaintext.Sender.UUID) + + innerMessage, err := libsignalgo.Encrypt(ctx, []byte{}, bobAddress, aliceStore, aliceStore) + require.NoError(t, err) + + hints := []libsignalgo.UnidentifiedSenderMessageContentHint{ + 200, + libsignalgo.UnidentifiedSenderMessageContentHintDefault, + libsignalgo.UnidentifiedSenderMessageContentHintResendable, + libsignalgo.UnidentifiedSenderMessageContentHintImplicit, + } + + for _, hint := range hints { + content, err := libsignalgo.NewUnidentifiedSenderMessageContent( + innerMessage, + senderCert, + hint, + []byte{}, + ) + require.NoError(t, err) + + _, err = libsignalgo.SealedSenderEncrypt(ctx, content, bobAddress, aliceStore) + require.NoError(t, err) + + // decryptedContent, err := libsignalgo.NewUnidentifiedSenderMessageContent(ciphertext) + + // let decryptedContent = try UnidentifiedSenderMessageContent(message: ciphertext, + // identityStore: bob_store, + // context: NullContext()) + // XCTAssertEqual(decryptedContent.contentHint, hint) + } +} + // From SessionTests.swift:testArchiveSession 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) + bobAddress, err := libsignalgo.NewPhoneAddress("+14151111112", 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 +398,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..f47e524 100644 --- a/pkg/libsignalgo/sessionrecord.go +++ b/pkg/libsignalgo/sessionrecord.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -38,39 +38,28 @@ func wrapSessionRecord(ptr *C.SignalSessionRecord) *SessionRecord { } func DeserializeSessionRecord(serialized []byte) (*SessionRecord, error) { - var ptr C.SignalMutPointerSessionRecord + var ptr *C.SignalSessionRecord signalFfiError := C.signal_session_record_deserialize(&ptr, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSessionRecord(ptr.raw), nil -} - -func (sr *SessionRecord) mutPtr() C.SignalMutPointerSessionRecord { - return C.SignalMutPointerSessionRecord{sr.ptr} -} - -func (sr *SessionRecord) constPtr() C.SignalConstPointerSessionRecord { - return C.SignalConstPointerSessionRecord{sr.ptr} + return wrapSessionRecord(ptr), nil } func (sr *SessionRecord) Clone() (*SessionRecord, error) { - var clone C.SignalMutPointerSessionRecord - signalFfiError := C.signal_session_record_clone( - &clone, - sr.constPtr(), - ) + var clone *C.SignalSessionRecord + signalFfiError := C.signal_session_record_clone(&clone, sr.ptr) runtime.KeepAlive(sr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSessionRecord(clone.raw), nil + return wrapSessionRecord(clone), nil } func (sr *SessionRecord) Destroy() error { sr.CancelFinalizer() - return wrapError(C.signal_session_record_destroy(sr.mutPtr())) + return wrapError(C.signal_session_record_destroy(sr.ptr)) } func (sr *SessionRecord) CancelFinalizer() { @@ -79,19 +68,12 @@ func (sr *SessionRecord) CancelFinalizer() { func (sr *SessionRecord) ArchiveCurrentState() error { defer runtime.KeepAlive(sr) - return wrapError(C.signal_session_record_archive_current_state(sr.mutPtr())) + return wrapError(C.signal_session_record_archive_current_state(sr.ptr)) } 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, - sr.constPtr(), - key.constPtr(), - ) + signalFfiError := C.signal_session_record_current_ratchet_key_matches(&result, sr.ptr, key.ptr) runtime.KeepAlive(sr) runtime.KeepAlive(key) if signalFfiError != nil { @@ -102,11 +84,7 @@ func (sr *SessionRecord) CurrentRatchetKeyMatches(key *PublicKey) (bool, error) func (sr *SessionRecord) HasCurrentState() (bool, error) { var result C.bool - signalFfiError := C.signal_session_record_has_usable_sender_chain( - &result, - sr.constPtr(), - C.uint64_t(time.Now().Unix()), - ) + signalFfiError := C.signal_session_record_has_usable_sender_chain(&result, sr.ptr, C.uint64_t(time.Now().Unix())) runtime.KeepAlive(sr) if signalFfiError != nil { return false, wrapError(signalFfiError) @@ -116,7 +94,7 @@ func (sr *SessionRecord) HasCurrentState() (bool, error) { func (sr *SessionRecord) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_session_record_serialize(&serialized, sr.constPtr()) + signalFfiError := C.signal_session_record_serialize(&serialized, sr.ptr) runtime.KeepAlive(sr) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -126,7 +104,7 @@ func (sr *SessionRecord) Serialize() ([]byte, error) { func (sr *SessionRecord) GetLocalRegistrationID() (uint32, error) { var result C.uint32_t - signalFfiError := C.signal_session_record_get_local_registration_id(&result, sr.constPtr()) + signalFfiError := C.signal_session_record_get_local_registration_id(&result, sr.ptr) runtime.KeepAlive(sr) if signalFfiError != nil { return 0, wrapError(signalFfiError) @@ -136,7 +114,7 @@ func (sr *SessionRecord) GetLocalRegistrationID() (uint32, error) { func (sr *SessionRecord) GetRemoteRegistrationID() (uint32, error) { var result C.uint32_t - signalFfiError := C.signal_session_record_get_remote_registration_id(&result, sr.constPtr()) + signalFfiError := C.signal_session_record_get_remote_registration_id(&result, sr.ptr) runtime.KeepAlive(sr) if signalFfiError != nil { return 0, wrapError(signalFfiError) diff --git a/pkg/libsignalgo/sessionstore.go b/pkg/libsignalgo/sessionstore.go index 99000e5..c02aa58 100644 --- a/pkg/libsignalgo/sessionstore.go +++ b/pkg/libsignalgo/sessionstore.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,11 +17,14 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #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{ +func (ctx *CallbackContext) wrapSessionStore(store SessionStore) *C.SignalSessionStore { + return &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..397238b 100644 --- a/pkg/libsignalgo/setup_test.go +++ b/pkg/libsignalgo/setup_test.go @@ -29,7 +29,7 @@ type FFILogger struct{} func (FFILogger) Enabled(target string, level libsignalgo.LogLevel) bool { return true } -func (FFILogger) Log(level libsignalgo.LogLevel, file string, line uint, message string) { +func (FFILogger) Log(target string, level libsignalgo.LogLevel, file string, line uint, message string) { var evt *zerolog.Event switch level { case libsignalgo.LogLevelError: @@ -47,6 +47,7 @@ func (FFILogger) Log(level libsignalgo.LogLevel, file string, line uint, message } evt.Str("component", "libsignal"). + Str("target", target). Str("file", file). Uint("line", line). Msg(message) @@ -54,8 +55,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/sgxclient.go b/pkg/libsignalgo/sgxclient.go index e2d817e..c85f058 100644 --- a/pkg/libsignalgo/sgxclient.go +++ b/pkg/libsignalgo/sgxclient.go @@ -17,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -37,7 +38,7 @@ func wrapSGXClientState(ptr *C.SignalSgxClientState) *SGXClientState { } func NewCDS2ClientState(mrenclave, attestationMessage []byte, currentTime time.Time) (*SGXClientState, error) { - var cds C.SignalMutPointerSgxClientState + var cds *C.SignalSgxClientState signalFfiError := C.signal_cds2_client_state_new( &cds, BytesToBuffer(mrenclave), @@ -49,25 +50,17 @@ func NewCDS2ClientState(mrenclave, attestationMessage []byte, currentTime time.T if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSGXClientState(cds.raw), nil -} - -func (cds *SGXClientState) mutPtr() C.SignalMutPointerSgxClientState { - return C.SignalMutPointerSgxClientState{cds.ptr} -} - -func (cds *SGXClientState) constPtr() C.SignalConstPointerSgxClientState { - return C.SignalConstPointerSgxClientState{cds.ptr} + return wrapSGXClientState(cds), nil } func (cds *SGXClientState) Destroy() error { runtime.SetFinalizer(cds, nil) - return wrapError(C.signal_sgx_client_state_destroy(cds.mutPtr())) + return wrapError(C.signal_sgx_client_state_destroy(cds.ptr)) } func (cds *SGXClientState) InitialRequest() ([]byte, error) { var resp C.SignalOwnedBuffer - signalFfiError := C.signal_sgx_client_state_initial_request(&resp, cds.constPtr()) + signalFfiError := C.signal_sgx_client_state_initial_request(&resp, cds.ptr) runtime.KeepAlive(cds) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -76,7 +69,7 @@ func (cds *SGXClientState) InitialRequest() ([]byte, error) { } func (cds *SGXClientState) CompleteHandshake(handshakeReceived []byte) error { - signalFfiError := C.signal_sgx_client_state_complete_handshake(cds.mutPtr(), BytesToBuffer(handshakeReceived)) + signalFfiError := C.signal_sgx_client_state_complete_handshake(cds.ptr, BytesToBuffer(handshakeReceived)) runtime.KeepAlive(cds) runtime.KeepAlive(handshakeReceived) return wrapError(signalFfiError) @@ -84,11 +77,7 @@ func (cds *SGXClientState) CompleteHandshake(handshakeReceived []byte) error { func (cds *SGXClientState) EstablishedSend(plaintext []byte) ([]byte, error) { var resp C.SignalOwnedBuffer - signalFfiError := C.signal_sgx_client_state_established_send( - &resp, - cds.mutPtr(), - BytesToBuffer(plaintext), - ) + signalFfiError := C.signal_sgx_client_state_established_send(&resp, cds.ptr, BytesToBuffer(plaintext)) runtime.KeepAlive(cds) runtime.KeepAlive(plaintext) if signalFfiError != nil { @@ -99,11 +88,7 @@ func (cds *SGXClientState) EstablishedSend(plaintext []byte) ([]byte, error) { func (cds *SGXClientState) EstablishedReceive(ciphertext []byte) ([]byte, error) { var resp C.SignalOwnedBuffer - signalFfiError := C.signal_sgx_client_state_established_recv( - &resp, - cds.mutPtr(), - BytesToBuffer(ciphertext), - ) + signalFfiError := C.signal_sgx_client_state_established_recv(&resp, cds.ptr, BytesToBuffer(ciphertext)) runtime.KeepAlive(cds) runtime.KeepAlive(ciphertext) if signalFfiError != nil { diff --git a/pkg/libsignalgo/signalversion/version.go b/pkg/libsignalgo/signalversion/version.go deleted file mode 100644 index d66cd3e..0000000 --- a/pkg/libsignalgo/signalversion/version.go +++ /dev/null @@ -1,5 +0,0 @@ -// Generated by update-ffi.sh; DO NOT EDIT. - -package signalversion - -const Version = "v0.102.2" diff --git a/pkg/libsignalgo/signedprekey.go b/pkg/libsignalgo/signedprekey.go index 32afc37..0b1daac 100644 --- a/pkg/libsignalgo/signedprekey.go +++ b/pkg/libsignalgo/signedprekey.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" @@ -38,22 +38,15 @@ func wrapSignedPreKeyRecord(ptr *C.SignalSignedPreKeyRecord) *SignedPreKeyRecord } func NewSignedPreKeyRecord(id uint32, timestamp time.Time, publicKey *PublicKey, privateKey *PrivateKey, signature []byte) (*SignedPreKeyRecord, error) { - var spkr C.SignalMutPointerSignedPreKeyRecord - signalFfiError := C.signal_signed_pre_key_record_new( - &spkr, - C.uint32_t(id), - C.uint64_t(timestamp.UnixMilli()), - publicKey.constPtr(), - privateKey.constPtr(), - BytesToBuffer(signature), - ) + var spkr *C.SignalSignedPreKeyRecord + signalFfiError := C.signal_signed_pre_key_record_new(&spkr, C.uint32_t(id), C.uint64_t(timestamp.UnixMilli()), publicKey.ptr, privateKey.ptr, BytesToBuffer(signature)) runtime.KeepAlive(publicKey) runtime.KeepAlive(privateKey) runtime.KeepAlive(signature) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSignedPreKeyRecord(spkr.raw), nil + return wrapSignedPreKeyRecord(spkr), nil } func NewSignedPreKeyRecordFromPrivateKey(id uint32, timestamp time.Time, privateKey *PrivateKey, signature []byte) (*SignedPreKeyRecord, error) { @@ -65,36 +58,28 @@ func NewSignedPreKeyRecordFromPrivateKey(id uint32, timestamp time.Time, private } func DeserializeSignedPreKeyRecord(serialized []byte) (*SignedPreKeyRecord, error) { - var spkr C.SignalMutPointerSignedPreKeyRecord + var spkr *C.SignalSignedPreKeyRecord signalFfiError := C.signal_signed_pre_key_record_deserialize(&spkr, BytesToBuffer(serialized)) runtime.KeepAlive(serialized) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSignedPreKeyRecord(spkr.raw), nil -} - -func (spkr *SignedPreKeyRecord) mutPtr() C.SignalMutPointerSignedPreKeyRecord { - return C.SignalMutPointerSignedPreKeyRecord{spkr.ptr} -} - -func (spkr *SignedPreKeyRecord) constPtr() C.SignalConstPointerSignedPreKeyRecord { - return C.SignalConstPointerSignedPreKeyRecord{spkr.ptr} + return wrapSignedPreKeyRecord(spkr), nil } func (spkr *SignedPreKeyRecord) Clone() (*SignedPreKeyRecord, error) { - var cloned C.SignalMutPointerSignedPreKeyRecord - signalFfiError := C.signal_signed_pre_key_record_clone(&cloned, spkr.constPtr()) + var cloned *C.SignalSignedPreKeyRecord + signalFfiError := C.signal_signed_pre_key_record_clone(&cloned, spkr.ptr) runtime.KeepAlive(spkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapSignedPreKeyRecord(cloned.raw), nil + return wrapSignedPreKeyRecord(cloned), nil } func (spkr *SignedPreKeyRecord) Destroy() error { spkr.CancelFinalizer() - return wrapError(C.signal_signed_pre_key_record_destroy(spkr.mutPtr())) + return wrapError(C.signal_signed_pre_key_record_destroy(spkr.ptr)) } func (spkr *SignedPreKeyRecord) CancelFinalizer() { @@ -103,7 +88,7 @@ func (spkr *SignedPreKeyRecord) CancelFinalizer() { func (spkr *SignedPreKeyRecord) Serialize() ([]byte, error) { var serialized C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_signed_pre_key_record_serialize(&serialized, spkr.constPtr()) + signalFfiError := C.signal_signed_pre_key_record_serialize(&serialized, spkr.ptr) runtime.KeepAlive(spkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -113,7 +98,7 @@ func (spkr *SignedPreKeyRecord) Serialize() ([]byte, error) { func (spkr *SignedPreKeyRecord) GetSignature() ([]byte, error) { var signature C.SignalOwnedBuffer = C.SignalOwnedBuffer{} - signalFfiError := C.signal_signed_pre_key_record_get_signature(&signature, spkr.constPtr()) + signalFfiError := C.signal_signed_pre_key_record_get_signature(&signature, spkr.ptr) runtime.KeepAlive(spkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) @@ -121,19 +106,19 @@ func (spkr *SignedPreKeyRecord) GetSignature() ([]byte, error) { return CopySignalOwnedBufferToBytes(signature), nil } -func (spkr *SignedPreKeyRecord) GetID() (uint32, error) { +func (spkr *SignedPreKeyRecord) GetID() (uint, error) { var id C.uint32_t - signalFfiError := C.signal_signed_pre_key_record_get_id(&id, spkr.constPtr()) + signalFfiError := C.signal_signed_pre_key_record_get_id(&id, spkr.ptr) runtime.KeepAlive(spkr) if signalFfiError != nil { return 0, wrapError(signalFfiError) } - return uint32(id), nil + return uint(id), nil } func (spkr *SignedPreKeyRecord) GetTimestamp() (time.Time, error) { var ts C.uint64_t - signalFfiError := C.signal_signed_pre_key_record_get_timestamp(&ts, spkr.constPtr()) + signalFfiError := C.signal_signed_pre_key_record_get_timestamp(&ts, spkr.ptr) runtime.KeepAlive(spkr) if signalFfiError != nil { return time.Time{}, wrapError(signalFfiError) @@ -142,24 +127,21 @@ func (spkr *SignedPreKeyRecord) GetTimestamp() (time.Time, error) { } func (spkr *SignedPreKeyRecord) GetPublicKey() (*PublicKey, error) { - var pub C.SignalMutPointerPublicKey - signalFfiError := C.signal_signed_pre_key_record_get_public_key( - &pub, - spkr.constPtr(), - ) + var pub *C.SignalPublicKey + signalFfiError := C.signal_signed_pre_key_record_get_public_key(&pub, spkr.ptr) runtime.KeepAlive(spkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPublicKey(pub.raw), nil + return wrapPublicKey(pub), nil } func (spkr *SignedPreKeyRecord) GetPrivateKey() (*PrivateKey, error) { - var priv C.SignalMutPointerPrivateKey - signalFfiError := C.signal_signed_pre_key_record_get_private_key(&priv, spkr.constPtr()) + var priv *C.SignalPrivateKey + signalFfiError := C.signal_signed_pre_key_record_get_private_key(&priv, spkr.ptr) runtime.KeepAlive(spkr) if signalFfiError != nil { return nil, wrapError(signalFfiError) } - return wrapPrivateKey(priv.raw), nil + return wrapPrivateKey(priv), nil } diff --git a/pkg/libsignalgo/signedprekeystore.go b/pkg/libsignalgo/signedprekeystore.go index b1306e2..cf3ecca 100644 --- a/pkg/libsignalgo/signedprekeystore.go +++ b/pkg/libsignalgo/signedprekeystore.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Sumner Evans -// 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 @@ -18,11 +17,13 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #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{ +func (ctx *CallbackContext) wrapSignedPreKeyStore(store SignedPreKeyStore) *C.SignalSignedPreKeyStore { + return &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/storeutil.go b/pkg/libsignalgo/storeutil.go index 4041c9b..cc99ddf 100644 --- a/pkg/libsignalgo/storeutil.go +++ b/pkg/libsignalgo/storeutil.go @@ -17,6 +17,7 @@ package libsignalgo /* +#cgo LDFLAGS: -lsignal_ffi -ldl -lm #include "./libsignal-ffi.h" */ import "C" diff --git a/pkg/libsignalgo/update-ffi-docker-inner.sh b/pkg/libsignalgo/update-ffi-docker-inner.sh deleted file mode 100755 index af8d851..0000000 --- a/pkg/libsignalgo/update-ffi-docker-inner.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/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 -cd libsignal -cargo build -p libsignal-ffi --release -cd .. -mv libsignal/target/release/libsignal_ffi.a . -cp libsignal/swift/Sources/SignalFfi/signal_ffi.h libsignal-ffi.h -chown 1000:1000 libsignal_ffi.a libsignal-ffi.h diff --git a/pkg/libsignalgo/update-ffi-docker.sh b/pkg/libsignalgo/update-ffi-docker.sh deleted file mode 100755 index 73f8947..0000000 --- a/pkg/libsignalgo/update-ffi-docker.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -docker run --rm -itv $(pwd):/data rust:1-alpine /data/update-ffi-docker-inner.sh - -echo "// Generated by update-ffi.sh; DO NOT EDIT." > signalversion/version.go -echo >> signalversion/version.go -echo "package signalversion" >> signalversion/version.go -echo >> signalversion/version.go -cd libsignal -echo "const Version = \"$(git describe --tags --always)\"" >> ../signalversion/version.go diff --git a/pkg/libsignalgo/update-ffi.sh b/pkg/libsignalgo/update-ffi.sh index d04986c..7561b61 100755 --- a/pkg/libsignalgo/update-ffi.sh +++ b/pkg/libsignalgo/update-ffi.sh @@ -12,10 +12,10 @@ if [ ! -d "$LIBSIGNAL_DIRECTORY" ]; then exit 1 fi -echo "// Generated by update-ffi.sh; DO NOT EDIT." > signalversion/version.go -echo >> signalversion/version.go -echo "package signalversion" >> signalversion/version.go -echo >> signalversion/version.go +echo "// Generated by update-ffi.sh; DO NOT EDIT." > version.go +echo >> version.go +echo "package libsignalgo" >> version.go +echo >> version.go # Store the current working directory ORIGINAL_DIR="$(pwd)" @@ -23,16 +23,19 @@ ORIGINAL_DIR="$(pwd)" # Navigate to libsignal directory cd "$LIBSIGNAL_DIRECTORY" -echo "const Version = \"$(git describe --tags --always)\"" >> ../signalversion/version.go +echo "const Version = \"$(git describe --tags --always)\"" >> ../version.go # Build libsignal cargo build -p libsignal-ffi --release +# Regenerate the header file +cbindgen --profile release rust/bridge/ffi -o libsignal-ffi.h + # Navigate back to the original directory cd "$ORIGINAL_DIR" # Copy files from the libsignal directory cp "${LIBSIGNAL_DIRECTORY}/target/release/libsignal_ffi.a" . -cp "${LIBSIGNAL_DIRECTORY}/swift/Sources/SignalFfi/signal_ffi.h" libsignal-ffi.h +cp "${LIBSIGNAL_DIRECTORY}/libsignal-ffi.h" . echo "Files copied successfully." diff --git a/pkg/libsignalgo/version.go b/pkg/libsignalgo/version.go new file mode 100644 index 0000000..ba75e00 --- /dev/null +++ b/pkg/libsignalgo/version.go @@ -0,0 +1,5 @@ +// Generated by update-ffi.sh; DO NOT EDIT. + +package libsignalgo + +const Version = "v0.39.2" diff --git a/pkg/msgconv/from-matrix.go b/pkg/msgconv/from-matrix.go deleted file mode 100644 index 3c8f840..0000000 --- a/pkg/msgconv/from-matrix.go +++ /dev/null @@ -1,229 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 ( - "context" - "fmt" - "net/http" - "strings" - - "github.com/rs/zerolog" - "go.mau.fi/util/exmime" - "go.mau.fi/util/ffmpeg" - "go.mau.fi/util/variationselector" - "golang.org/x/exp/constraints" - "google.golang.org/protobuf/proto" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/database" - "maunium.net/go/mautrix/event" - - "go.mau.fi/mautrix-signal/pkg/msgconv/matrixfmt" - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" -) - -func (mc *MessageConverter) ToSignal( - ctx context.Context, - client *signalmeow.Client, - portal *bridgev2.Portal, - evt *event.Event, - content *event.MessageEventContent, - relaybotFormatted bool, - replyTo *database.Message, -) (*signalpb.DataMessage, error) { - ctx = context.WithValue(ctx, contextKeyClient, client) - ctx = context.WithValue(ctx, contextKeyPortal, portal) - if evt.Type == event.EventSticker { - content.MsgType = event.MessageType(event.EventSticker.Type) - } - - dm := &signalpb.DataMessage{ - 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(), - } - if replyTo.Metadata.(*signalid.MessageMetadata).ContainsAttachments { - dm.Quote.Attachments = make([]*signalpb.DataMessage_Quote_QuotedAttachment, 1) - } - } - } - if content.BeeperDisappearingTimer != nil { - dm.ExpireTimer = proto.Uint32(uint32(content.BeeperDisappearingTimer.Timer.Seconds())) - } else if portal.Disappear.Timer > 0 { - dm.ExpireTimer = proto.Uint32(uint32(portal.Disappear.Timer.Seconds())) - } - if dm.ExpireTimer != nil && *dm.ExpireTimer != 0 { - timerVersion := portal.Metadata.(*signalid.PortalMetadata).ExpirationTimerVersion - if timerVersion > 0 { - dm.ExpireTimerVersion = &timerVersion - } - } - if content.MsgType == event.MsgEmote && !relaybotFormatted { - content.Body = "/me " + content.Body - if content.FormattedBody != "" { - content.FormattedBody = "/me " + content.FormattedBody - } - } - body, bodyRanges := matrixfmt.Parse(ctx, mc.MatrixFmtParams, content) - switch content.MsgType { - case event.MsgText, event.MsgNotice, event.MsgEmote: - dm.Body = proto.String(body) - dm.BodyRanges = bodyRanges - case event.MsgImage, event.MsgVideo, event.MsgAudio, event.MsgFile: - att, err := mc.convertFileToSignal(ctx, evt, content) - if err != nil { - return nil, fmt.Errorf("failed to convert attachment: %w", err) - } - if content.FileName != "" && (content.FileName != content.Body || content.Format == event.FormatHTML) { - dm.Body = proto.String(body) - dm.BodyRanges = bodyRanges - } - dm.Attachments = []*signalpb.AttachmentPointer{att} - case event.MessageType(event.EventSticker.Type): - if content.FileName == "" { - content.FileName = "sticker" + exmime.ExtensionFromMimetype(content.Info.MimeType) - } - att, err := mc.convertFileToSignal(ctx, evt, content) - if err != nil { - 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, - } - } - dm.Sticker.Data = att - case event.MsgLocation: - lat, lon, err := parseGeoURI(content.GeoURI) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Invalid geo URI") - return nil, err - } - locationString := fmt.Sprintf(mc.LocationFormat, lat, lon) - dm.Body = &locationString - default: - return nil, fmt.Errorf("%w %s", bridgev2.ErrUnsupportedMessageType, content.MsgType) - } - return dm, nil -} - -func maybeInt[T constraints.Integer](v T) *T { - if v == 0 { - return nil - } - return &v -} - -func (mc *MessageConverter) convertFileToSignal(ctx context.Context, evt *event.Event, content *event.MessageEventContent) (*signalpb.AttachmentPointer, error) { - log := zerolog.Ctx(ctx) - data, err := mc.Bridge.Bot.DownloadMedia(ctx, content.URL, content.File) - if err != nil { - return nil, fmt.Errorf("%w: %w", bridgev2.ErrMediaDownloadFailed, err) - } - fileName := content.Body - if content.FileName != "" { - fileName = content.FileName - } - mime := content.GetInfo().MimeType - if mime == "" { - mime = http.DetectContentType(data) - } - if content.MSC3245Voice != nil && mime != "audio/aac" && ffmpeg.Supported() { - data, err = ffmpeg.ConvertBytes(ctx, data, ".aac", []string{}, []string{"-c:a", "aac"}, mime) - if err != nil { - return nil, err - } - mime = "audio/aac" - fileName += ".aac" - } else if evt.Type == event.EventSticker { - switch mime { - case "image/webp", "image/png", "image/apng": - // allowed - case "image/gif": - if !ffmpeg.Supported() { - return nil, fmt.Errorf("converting gif stickers is not supported") - } - data, err = ffmpeg.ConvertBytes(ctx, data, ".apng", []string{}, []string{}, mime) - if err != nil { - return nil, fmt.Errorf("%w (gif to apng): %w", bridgev2.ErrMediaConvertFailed, err) - } - fileName += ".apng" - mime = "image/apng" - default: - return nil, fmt.Errorf("unsupported content type for sticker %s", mime) - } - } - att, err := getClient(ctx).UploadAttachment(ctx, data) - if err != nil { - log.Err(err).Msg("Failed to upload file") - return nil, fmt.Errorf("%w: %w", bridgev2.ErrMediaReuploadFailed, err) - } - if content.MSC3245Voice != nil && mime == "audio/aac" { - att.Flags = proto.Uint32(uint32(signalpb.AttachmentPointer_VOICE_MESSAGE)) - } - if content.Info.MauGIF { - att.Flags = proto.Uint32(uint32(signalpb.AttachmentPointer_GIF)) - } - att.ContentType = proto.String(mime) - att.FileName = &fileName - att.Height = maybeInt(uint32(content.Info.Height)) - att.Width = maybeInt(uint32(content.Info.Width)) - if content.Info.Blurhash != "" { - att.BlurHash = proto.String(content.Info.Blurhash) - } else if content.Info.AnoaBlurhash != "" { - att.BlurHash = proto.String(content.Info.AnoaBlurhash) - } - return att, nil -} - -func parseGeoURI(uri string) (lat, long string, err error) { - if !strings.HasPrefix(uri, "geo:") { - err = fmt.Errorf("uri doesn't have geo: prefix") - return - } - // Remove geo: prefix and anything after ; - coordinates := strings.Split(strings.TrimPrefix(uri, "geo:"), ";")[0] - splitCoordinates := strings.Split(coordinates, ",") - if len(splitCoordinates) != 2 { - err = fmt.Errorf("didn't find exactly two numbers separated by a comma") - } else { - lat = splitCoordinates[0] - long = splitCoordinates[1] - } - return -} diff --git a/pkg/msgconv/from-signal-backup.go b/pkg/msgconv/from-signal-backup.go deleted file mode 100644 index 372c9a4..0000000 --- a/pkg/msgconv/from-signal-backup.go +++ /dev/null @@ -1,256 +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 msgconv - -import ( - "slices" - - "github.com/google/uuid" - "go.mau.fi/util/exslices" - "go.mau.fi/util/ptr" - - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/backuppb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" -) - -func boolToInt(b bool) int { - if b { - return 1 - } - return 0 -} - -type AttachmentMap map[uuid.UUID]*backuppb.FilePointer_LocatorInfo - -func BackupToDataMessage(ci *backuppb.ChatItem, attMap AttachmentMap) (*signalpb.DataMessage, []*backuppb.Reaction) { - var dm signalpb.DataMessage - var reactions []*backuppb.Reaction - switch ti := ci.Item.(type) { - case *backuppb.ChatItem_StandardMessage: - reactions = ti.StandardMessage.Reactions - if text := ti.StandardMessage.Text; text != nil { - dm.Body = &text.Body - dm.BodyRanges = slices.DeleteFunc(exslices.CastFunc(text.BodyRanges, backupToSignalBodyRange), deleteNil) - } - dm.Attachments = make([]*signalpb.AttachmentPointer, 0, len(ti.StandardMessage.Attachments)+boolToInt(ti.StandardMessage.LongText != nil)) - if ti.StandardMessage.LongText != nil { - randomUUID := uuid.New() - dm.Attachments = append( - dm.Attachments, - backupToSignalAttachment(ti.StandardMessage.LongText, 0, randomUUID, attMap), - ) - } - for _, att := range ti.StandardMessage.Attachments { - var clientUUID uuid.UUID - if len(att.ClientUuid) == 16 { - clientUUID = uuid.UUID(att.ClientUuid) - } else { - clientUUID = uuid.New() - } - dm.Attachments = append( - dm.Attachments, - backupToSignalAttachment(att.Pointer, att.Flag, clientUUID, attMap), - ) - } - dm.Preview = exslices.CastFunc(ti.StandardMessage.LinkPreview, func(from *backuppb.LinkPreview) *signalpb.Preview { - return backupToSignalLinkPreview(from, attMap) - }) - case *backuppb.ChatItem_ContactMessage: - reactions = ti.ContactMessage.Reactions - dm.Contact = []*signalpb.DataMessage_Contact{backupToSignalContact(ti.ContactMessage.Contact, attMap)} - case *backuppb.ChatItem_StickerMessage: - reactions = ti.StickerMessage.Reactions - dm.Sticker = &signalpb.DataMessage_Sticker{ - PackId: ti.StickerMessage.Sticker.PackId, - PackKey: ti.StickerMessage.Sticker.PackKey, - StickerId: &ti.StickerMessage.Sticker.StickerId, - 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 - case *backuppb.ChatItem_PaymentNotification: - dm.Payment = &signalpb.DataMessage_Payment{ - Item: &signalpb.DataMessage_Payment_Notification_{ - Notification: &signalpb.DataMessage_Payment_Notification{ - Transaction: nil, - Note: ti.PaymentNotification.Note, - }, - }, - } - case *backuppb.ChatItem_GiftBadge: - dm.GiftBadge = &signalpb.DataMessage_GiftBadge{ - ReceiptCredentialPresentation: ti.GiftBadge.ReceiptCredentialPresentation, - } - case *backuppb.ChatItem_ViewOnceMessage: - reactions = ti.ViewOnceMessage.Reactions - if ti.ViewOnceMessage.Attachment == nil { - // TODO handle some other way? - return nil, reactions - } - dm.IsViewOnce = ptr.Ptr(true) - var clientUUID uuid.UUID - if len(ti.ViewOnceMessage.Attachment.ClientUuid) == 16 { - clientUUID = uuid.UUID(ti.ViewOnceMessage.Attachment.ClientUuid) - } else { - clientUUID = uuid.New() - } - dm.Attachments = []*signalpb.AttachmentPointer{backupToSignalAttachment( - ti.ViewOnceMessage.Attachment.Pointer, - ti.ViewOnceMessage.Attachment.Flag, - clientUUID, - attMap, - )} - } - return &dm, reactions -} - -func backupToSignalContact(from *backuppb.ContactAttachment, attMap AttachmentMap) *signalpb.DataMessage_Contact { - var contact signalpb.DataMessage_Contact - if from.Name != nil { - contact.Name = &signalpb.DataMessage_Contact_Name{ - GivenName: &from.Name.GivenName, - FamilyName: &from.Name.FamilyName, - Prefix: &from.Name.Prefix, - Suffix: &from.Name.Suffix, - MiddleName: &from.Name.MiddleName, - Nickname: &from.Name.Nickname, - } - } - contact.Number = exslices.CastFunc(from.Number, func(from *backuppb.ContactAttachment_Phone) *signalpb.DataMessage_Contact_Phone { - return &signalpb.DataMessage_Contact_Phone{ - Value: &from.Value, - Type: ptr.NonZero(signalpb.DataMessage_Contact_Phone_Type(from.Type)), - Label: &from.Label, - } - }) - contact.Email = exslices.CastFunc(from.Email, func(from *backuppb.ContactAttachment_Email) *signalpb.DataMessage_Contact_Email { - return &signalpb.DataMessage_Contact_Email{ - Value: &from.Value, - Type: ptr.NonZero(signalpb.DataMessage_Contact_Email_Type(from.Type)), - Label: &from.Label, - } - }) - contact.Address = exslices.CastFunc(from.Address, func(from *backuppb.ContactAttachment_PostalAddress) *signalpb.DataMessage_Contact_PostalAddress { - return &signalpb.DataMessage_Contact_PostalAddress{ - Type: ptr.NonZero(signalpb.DataMessage_Contact_PostalAddress_Type(from.Type)), - Label: &from.Label, - Street: &from.Street, - Pobox: &from.Pobox, - Neighborhood: &from.Neighborhood, - City: &from.City, - Region: &from.Region, - Postcode: &from.Postcode, - Country: &from.Country, - } - }) - if from.Avatar != nil { - contact.Avatar = &signalpb.DataMessage_Contact_Avatar{ - Avatar: backupToSignalAttachment(from.Avatar, 0, uuid.New(), attMap), - } - } - contact.Organization = ptr.NonZero(from.Organization) - return &contact -} - -func backupToSignalLinkPreview(from *backuppb.LinkPreview, attMap AttachmentMap) *signalpb.Preview { - var ap *signalpb.AttachmentPointer - if from.Image != nil { - ap = backupToSignalAttachment(from.Image, 0, uuid.New(), attMap) - } - return &signalpb.Preview{ - Url: &from.Url, - Title: from.Title, - Image: ap, - Description: from.Description, - Date: from.Date, - } -} - -func backupToSignalAttachment( - fp *backuppb.FilePointer, - flag backuppb.MessageAttachment_Flag, - clientUUID uuid.UUID, - atts AttachmentMap, -) *signalpb.AttachmentPointer { - sig := &signalpb.AttachmentPointer{ - //IncrementalMacChunkSize: fp.IncrementalMacChunkSize, - ContentType: fp.ContentType, - IncrementalMac: fp.IncrementalMac, - FileName: fp.FileName, - Flags: ptr.NonZero(uint32(backupToSignalAttachmentFlag(flag))), - Width: fp.Width, - Height: fp.Height, - Caption: nil, // is this field deprecated or something? - BlurHash: fp.BlurHash, - ClientUuid: clientUUID[:], - } - if fp.LocatorInfo != nil { - if fp.LocatorInfo.TransitCdnKey != nil { - sig.AttachmentIdentifier = &signalpb.AttachmentPointer_CdnKey{CdnKey: *fp.LocatorInfo.TransitCdnKey} - sig.Size = &fp.LocatorInfo.Size - sig.Digest = fp.LocatorInfo.GetEncryptedDigest() // Note: may be nil if plaintextHash is set instead - sig.CdnNumber = fp.LocatorInfo.TransitCdnNumber - } - sig.Key = fp.LocatorInfo.Key - atts[clientUUID] = fp.LocatorInfo - } - return sig -} - -func backupToSignalAttachmentFlag(flag backuppb.MessageAttachment_Flag) signalpb.AttachmentPointer_Flags { - switch flag { - case backuppb.MessageAttachment_VOICE_MESSAGE: - return signalpb.AttachmentPointer_VOICE_MESSAGE - case backuppb.MessageAttachment_BORDERLESS: - return signalpb.AttachmentPointer_BORDERLESS - case backuppb.MessageAttachment_GIF: - return signalpb.AttachmentPointer_GIF - case backuppb.MessageAttachment_NONE: - fallthrough - default: - return 0 - } -} - -func deleteNil(bodyRange *signalpb.BodyRange) bool { - return bodyRange == nil -} - -func backupToSignalBodyRange(from *backuppb.BodyRange) *signalpb.BodyRange { - var out signalpb.BodyRange - out.Start = &from.Start - out.Length = &from.Length - switch av := from.AssociatedValue.(type) { - case *backuppb.BodyRange_MentionAci: - out.AssociatedValue = &signalpb.BodyRange_MentionAciBinary{MentionAciBinary: av.MentionAci} - case *backuppb.BodyRange_Style_: - out.AssociatedValue = &signalpb.BodyRange_Style_{Style: signalpb.BodyRange_Style(av.Style)} - } - return &out -} diff --git a/pkg/msgconv/from-signal.go b/pkg/msgconv/from-signal.go deleted file mode 100644 index 3ec4fdb..0000000 --- a/pkg/msgconv/from-signal.go +++ /dev/null @@ -1,808 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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/base64" - "errors" - "fmt" - "io" - "mime" - "net/http" - "os" - "strconv" - "strings" - "time" - - "github.com/emersion/go-vcard" - "github.com/google/uuid" - "github.com/rs/zerolog" - "go.mau.fi/util/exmime" - "go.mau.fi/util/ffmpeg" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/database" - "maunium.net/go/mautrix/bridgev2/networkid" - "maunium.net/go/mautrix/event" - - "go.mau.fi/mautrix-signal/pkg/msgconv/signalfmt" - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" -) - -var ( - ErrAttachmentNotInBackup = errors.New("attachment not found in backup") - ErrBackupNotSupported = errors.New("downloading attachments from server-side backup is not yet supported") -) - -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 { - return 1 - } - length := len(dm.Attachments) + len(dm.Contact) - if dm.Body != nil { - length++ - } - if dm.Payment != nil { - length++ - } - if dm.GiftBadge != nil { - length++ - } - if length == 0 && dm.GetRequiredProtocolVersion() > uint32(signalpb.DataMessage_CURRENT) { - length = 1 - } - return length -} - -func CanConvertSignal(dm *signalpb.DataMessage) bool { - return calculateLength(dm) > 0 -} - -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, -) *bridgev2.ConvertedMessage { - ctx = context.WithValue(ctx, contextKeyClient, client) - ctx = context.WithValue(ctx, contextKeyPortal, portal) - ctx = context.WithValue(ctx, contextKeyIntent, intent) - cm := &bridgev2.ConvertedMessage{ - ReplyTo: nil, - ThreadRoot: nil, - Parts: make([]*bridgev2.ConvertedMessagePart, 0, calculateLength(dm)), - } - if dm.GetFlags()&uint32(signalpb.DataMessage_EXPIRATION_TIMER_UPDATE) != 0 { - cm.Parts = append(cm.Parts, mc.ConvertDisappearingTimerChangeToMatrix( - ctx, dm.GetExpireTimer(), dm.ExpireTimerVersion, time.UnixMilli(int64(dm.GetTimestamp())), attMap != nil, - )) - // Don't allow any other parts in a disappearing timer change message - return cm - } - if dm.GetExpireTimer() > 0 { - cm.Disappear.Type = event.DisappearingTypeAfterRead - cm.Disappear.Timer = time.Duration(dm.GetExpireTimer()) * time.Second - } - if dm.Sticker != nil { - cm.Parts = append(cm.Parts, mc.convertStickerToMatrix(ctx, dm.Sticker, attMap)) - // Don't allow any other parts in a sticker message - return cm - } - if dm.PollVote != nil { - cm.Parts = append(cm.Parts, mc.convertPollVoteToMatrix(ctx, sender, 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 { - cm.Parts = append(cm.Parts, mc.convertAttachmentToMatrix(ctx, i, att, attMap)) - } else { - longBody, err := mc.downloadSignalLongText(ctx, att, attMap) - if err == nil { - dm.Body = longBody - } else { - zerolog.Ctx(ctx).Err(err).Msg("Failed to download Signal long text") - } - } - } - for _, contact := range dm.GetContact() { - cm.Parts = append(cm.Parts, mc.convertContactToMatrix(ctx, contact, attMap)) - } - if dm.Payment != nil { - cm.Parts = append(cm.Parts, mc.convertPaymentToMatrix(ctx, dm.Payment)) - } - if dm.GiftBadge != nil { - cm.Parts = append(cm.Parts, mc.convertGiftBadgeToMatrix(ctx, dm.GiftBadge)) - } - if dm.Body != nil { - cm.Parts = append(cm.Parts, mc.convertTextToMatrix(ctx, dm, attMap)) - } - if len(cm.Parts) == 0 && dm.GetRequiredProtocolVersion() > uint32(signalpb.DataMessage_CURRENT) { - cm.Parts = append(cm.Parts, &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: "The bridge does not support this message type yet.", - }, - }) - } - if dm.GetIsViewOnce() && mc.DisappearViewOnce && (cm.Disappear.Timer == 0 || cm.Disappear.Timer > ViewOnceDisappearTimer) { - cm.Disappear.Type = event.DisappearingTypeAfterRead - cm.Disappear.Timer = ViewOnceDisappearTimer - cm.Parts = append(cm.Parts, &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgText, - Body: "This is a view-once message. It will disappear in 5 minutes.", - }, - }) - } - cm.MergeCaption() - for i, part := range cm.Parts { - part.ID = signalid.MakeMessagePartID(i) - part.DBMetadata = &signalid.MessageMetadata{ - ContainsAttachments: len(dm.GetAttachments()) > 0, - } - } - if dm.Quote != nil { - authorACI, err := signalmeow.ParseStringOrBinaryUUID(dm.Quote.GetAuthorAci(), dm.Quote.GetAuthorAciBinary()) - 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") - } else { - cm.ReplyTo = &networkid.MessageOptionalPartID{ - MessageID: signalid.MakeMessageID(authorACI, dm.Quote.GetId()), - } - } - } - return cm -} - -func (mc *MessageConverter) ConvertDisappearingTimerChangeToMatrix( - ctx context.Context, timer uint32, timerVersion *uint32, ts time.Time, isBackfill bool, -) *bridgev2.ConvertedMessagePart { - portal := getPortal(ctx) - setting := database.DisappearingSetting{ - Timer: time.Duration(timer) * time.Second, - Type: event.DisappearingTypeAfterRead, - } - if timer == 0 { - setting.Type = "" - } - part := &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: bridgev2.DisappearingMessageNotice(time.Duration(timer)*time.Second, false), - Extra: map[string]any{ - "com.beeper.action_message": map[string]any{ - "type": "disappearing_timer", - "timer": setting.Timer.Milliseconds(), - "timer_type": setting.Type, - "implicit": false, - "backfill": isBackfill, - }, - }, - DontBridge: setting == portal.Disappear, - } - if isBackfill { - return part - } - portalMeta := portal.Metadata.(*signalid.PortalMetadata) - if timerVersion != nil && portalMeta.ExpirationTimerVersion > *timerVersion { - zerolog.Ctx(ctx).Warn(). - Uint32("current_version", portalMeta.ExpirationTimerVersion). - Uint32("new_version", *timerVersion). - Msg("Ignoring outdated disappearing timer change") - part.Content.Body += " (change ignored)" - return part - } - if timerVersion != nil { - portalMeta.ExpirationTimerVersion = *timerVersion - } else { - portalMeta.ExpirationTimerVersion = 1 - } - portal.UpdateDisappearingSetting(ctx, setting, bridgev2.UpdateDisappearingSettingOpts{ - Sender: getIntent(ctx), - Timestamp: ts, - Save: true, - }) - return part -} - -func (mc *MessageConverter) convertTextToMatrix(ctx context.Context, dm *signalpb.DataMessage, attMap AttachmentMap) *bridgev2.ConvertedMessagePart { - content := signalfmt.Parse(ctx, dm.GetBody(), dm.GetBodyRanges(), mc.SignalFmtParams) - extra := map[string]any{} - if len(dm.Preview) > 0 { - content.BeeperLinkPreviews = mc.convertURLPreviewsToBeeper(ctx, dm.Preview, attMap) - } - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: content, - Extra: extra, - } -} - -func (mc *MessageConverter) convertPaymentToMatrix(_ context.Context, payment *signalpb.DataMessage_Payment) *bridgev2.ConvertedMessagePart { - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: "Payments are not yet supported", - }, - Extra: map[string]any{ - "fi.mau.signal.payment": payment, - }, - } -} - -func (mc *MessageConverter) convertGiftBadgeToMatrix(_ context.Context, giftBadge *signalpb.DataMessage_GiftBadge) *bridgev2.ConvertedMessagePart { - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: "Gift badges are not yet supported", - }, - Extra: map[string]any{ - "fi.mau.signal.gift_badge": giftBadge, - }, - } -} - -func (mc *MessageConverter) convertContactToVCard(ctx context.Context, contact *signalpb.DataMessage_Contact, attMap AttachmentMap) vcard.Card { - card := make(vcard.Card) - card.SetValue(vcard.FieldVersion, "4.0") - name := contact.GetName() - if name.GetFamilyName() != "" || name.GetGivenName() != "" { - card.SetName(&vcard.Name{ - FamilyName: name.GetFamilyName(), - GivenName: name.GetGivenName(), - AdditionalName: name.GetMiddleName(), - HonorificPrefix: name.GetPrefix(), - HonorificSuffix: name.GetSuffix(), - }) - } - if name.GetNickname() != "" { - card.SetValue(vcard.FieldNickname, name.GetNickname()) - } - if contact.GetOrganization() != "" { - card.SetValue(vcard.FieldOrganization, contact.GetOrganization()) - } - for _, addr := range contact.GetAddress() { - field := vcard.Field{ - Value: strings.Join([]string{ - addr.GetPobox(), - "", // extended address, - addr.GetStreet(), - addr.GetCity(), - addr.GetRegion(), - addr.GetPostcode(), - addr.GetCountry(), - // TODO put neighborhood somewhere? - }, ";"), - Params: make(vcard.Params), - } - if addr.GetLabel() != "" { - field.Params.Set("LABEL", addr.GetLabel()) - } - field.Params.Set(vcard.ParamType, strings.ToLower(addr.GetType().String())) - card.Add(vcard.FieldAddress, &field) - } - for _, email := range contact.GetEmail() { - field := vcard.Field{ - Value: email.GetValue(), - Params: make(vcard.Params), - } - field.Params.Set(vcard.ParamType, strings.ToLower(email.GetType().String())) - if email.GetLabel() != "" { - field.Params.Set("LABEL", email.GetLabel()) - } - card.Add(vcard.FieldEmail, &field) - } - for _, phone := range contact.GetNumber() { - field := vcard.Field{ - Value: phone.GetValue(), - Params: make(vcard.Params), - } - field.Params.Set(vcard.ParamType, strings.ToLower(phone.GetType().String())) - if phone.GetLabel() != "" { - field.Params.Set("LABEL", phone.GetLabel()) - } - card.Add(vcard.FieldTelephone, &field) - } - if contact.GetAvatar().GetAvatar() != nil { - avatarData, err := mc.downloadAttachment(ctx, contact.GetAvatar().GetAvatar(), attMap, nil) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to download contact avatar") - } else { - mimeType := contact.GetAvatar().GetAvatar().GetContentType() - if mimeType == "" { - mimeType = http.DetectContentType(avatarData) - } - card.SetValue(vcard.FieldPhoto, fmt.Sprintf("data:%s;base64,%s", mimeType, base64.StdEncoding.EncodeToString(avatarData))) - } - } - return card -} - -func (mc *MessageConverter) convertContactToMatrix(ctx context.Context, contact *signalpb.DataMessage_Contact, attMap AttachmentMap) *bridgev2.ConvertedMessagePart { - card := mc.convertContactToVCard(ctx, contact, attMap) - contact.Avatar = nil - extraData := map[string]any{ - "fi.mau.signal.contact": contact, - } - var buf bytes.Buffer - err := vcard.NewEncoder(&buf).Encode(card) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to encode vCard") - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: "Failed to encode vCard", - }, - Extra: extraData, - } - } - data := buf.Bytes() - displayName := contact.GetName().GetNickname() - if displayName == "" { - displayName = contact.GetName().GetGivenName() - if contact.GetName().GetFamilyName() != "" { - if displayName != "" { - displayName += " " - } - displayName += contact.GetName().GetFamilyName() - } - } - if displayName == "" { - displayName = "contact" - } - content := &event.MessageEventContent{ - MsgType: event.MsgFile, - Body: displayName + ".vcf", - Info: &event.FileInfo{ - MimeType: "text/vcf", - Size: len(data), - }, - } - content.URL, content.File, err = getIntent(ctx).UploadMedia(ctx, getPortal(ctx).MXID, data, content.Info.MimeType, content.Body) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to upload vCard") - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: "Failed to upload vCard", - }, - Extra: extraData, - } - } - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: content, - Extra: extraData, - } -} - -func (mc *MessageConverter) convertAttachmentToMatrix(ctx context.Context, index int, att *signalpb.AttachmentPointer, attMap AttachmentMap) *bridgev2.ConvertedMessagePart { - part, err := mc.reuploadAttachment(ctx, att, attMap) - if err != nil { - if (errors.Is(err, signalmeow.ErrAttachmentNotFound) || errors.Is(err, ErrAttachmentNotInBackup)) && attMap != nil { - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: fmt.Sprintf("Attachment no longer available %s", att.GetFileName()), - }, - } - } else if errors.Is(err, ErrBackupNotSupported) { - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: "Downloading attachments from backup is not yet supported", - }, - } - } - zerolog.Ctx(ctx).Err(err).Int("attachment_index", index).Msg("Failed to handle attachment") - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: fmt.Sprintf("Failed to handle attachment %s: %v", att.GetFileName(), err), - }, - } - } - return part -} - -func (mc *MessageConverter) convertStickerToMatrix(ctx context.Context, sticker *signalpb.DataMessage_Sticker, attMap AttachmentMap) *bridgev2.ConvertedMessagePart { - converted, err := mc.reuploadAttachment(ctx, sticker.GetData(), attMap) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to handle sticker") - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: &event.MessageEventContent{ - MsgType: event.MsgNotice, - Body: fmt.Sprintf("Failed to handle sticker: %v", err), - }, - } - } - // 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 - if converted.Content.Info.Width == 512 && converted.Content.Info.Height == 512 { - converted.Content.Info.Width = 200 - converted.Content.Info.Height = 200 - } - 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 = "" - return converted -} - -func (mc *MessageConverter) downloadSignalLongText(ctx context.Context, att *signalpb.AttachmentPointer, attMap AttachmentMap) (*string, error) { - data, err := mc.downloadAttachment(ctx, att, attMap, nil) - if err != nil { - return nil, err - } - longBody := string(data) - return &longBody, nil -} - -func checkIfAttachmentExists(att *signalpb.AttachmentPointer, attMap AttachmentMap) error { - if att.AttachmentIdentifier == nil { - if len(att.GetClientUuid()) != 16 { - return fmt.Errorf("no attachment identifier found") - } - target, ok := attMap[uuid.UUID(att.GetClientUuid())] - if !ok { - return fmt.Errorf("no attachment identifier and attachment not found in map") - } else if target == nil || target.MediaTierCdnNumber == nil { - return ErrAttachmentNotInBackup - } else { - // TODO add support for downloading attachments from backup - return ErrBackupNotSupported - } - } - return nil -} - -func (mc *MessageConverter) downloadAttachment( - ctx context.Context, att *signalpb.AttachmentPointer, attMap AttachmentMap, into *os.File, -) ([]byte, error) { - if err := checkIfAttachmentExists(att, attMap); err != nil { - return nil, err - } - var plaintextHash []byte - if len(att.GetClientUuid()) == 16 { - target, ok := attMap[uuid.UUID(att.GetClientUuid())] - if ok { - plaintextHash = target.GetPlaintextHash() - } - } - return signalmeow.DownloadAttachmentWithPointer(ctx, att, plaintextHash, into) -} - -func (mc *MessageConverter) reuploadAttachment(ctx context.Context, att *signalpb.AttachmentPointer, attMap AttachmentMap) (*bridgev2.ConvertedMessagePart, error) { - content := &event.MessageEventContent{ - Body: att.GetFileName(), - Info: &event.FileInfo{ - MimeType: att.GetContentType(), - Width: int(att.GetWidth()), - Height: int(att.GetHeight()), - Size: int(att.GetSize()), - }, - } - if err := checkIfAttachmentExists(att, attMap); err != nil { - return nil, err - } else if mc.DirectMedia { - digest := att.Digest - var plaintextDigest bool - if digest == nil && len(att.GetClientUuid()) == 16 { - locatorInfo, ok := attMap[uuid.UUID(att.GetClientUuid())] - if ok { - digest = locatorInfo.GetPlaintextHash() - plaintextDigest = true - } - } - mediaID, err := signalid.DirectMediaAttachment{ - CDNID: att.GetCdnId(), - CDNKey: att.GetCdnKey(), - CDNNumber: att.GetCdnNumber(), - Key: att.Key, - Digest: digest, - PlaintextDigest: plaintextDigest, - Size: att.GetSize(), - }.AsMediaID() - if err != nil { - return nil, err - } - content.URL, err = mc.Bridge.Matrix.GenerateContentURI(ctx, mediaID) - } else { - err = mc.actuallyReuploadAttachment(ctx, content, att, attMap) - if err != nil { - return nil, err - } - } - if att.GetBlurHash() != "" { - content.Info.Blurhash = att.GetBlurHash() - content.Info.AnoaBlurhash = att.GetBlurHash() - } - plainMime, _, _ := mime.ParseMediaType(content.Info.MimeType) - // Supported mime types from https://github.com/signalapp/Signal-Desktop/blob/main/ts/util/GoogleChrome.std.ts - switch plainMime { - case "image/avif", "image/bmp", "image/gif", "image/jpeg", "image/webp", "image/x-xbitmap", - "image/vnd.microsoft.icon", "image/ico", "image/icon", "image/x-icon", "image/png", "image/apng": - content.MsgType = event.MsgImage - case "video/mp4", "video/ogg", "video/webm": - content.MsgType = event.MsgVideo - default: - if strings.HasPrefix(plainMime, "audio/") && !strings.HasSuffix(plainMime, "aiff") { - content.MsgType = event.MsgAudio - } else { - content.MsgType = event.MsgFile - } - } - var extra map[string]any - if att.GetFlags()&uint32(signalpb.AttachmentPointer_GIF) != 0 { - content.Info.MauGIF = true - extra = map[string]any{ - "info": map[string]any{ - "fi.mau.loop": true, - "fi.mau.autoplay": true, - "fi.mau.hide_controls": true, - "fi.mau.no_audio": true, - }, - } - } - if content.Body == "" { - content.Body = strings.TrimPrefix(string(content.MsgType), "m.") + exmime.ExtensionFromMimetype(content.Info.MimeType) - } - return &bridgev2.ConvertedMessagePart{ - Type: event.EventMessage, - Content: content, - 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, senderACI uuid.UUID, 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 - } - meta := pollMessage.Metadata.(*signalid.MessageMetadata) - if prevCount, ok := meta.VoteCount[senderACI.String()]; ok && vote.GetVoteCount() <= prevCount { - zerolog.Ctx(ctx).Debug(). - Stringer("sender_aci", senderACI). - Uint32("vote_count", vote.GetVoteCount()). - Uint32("previous_vote_count", prevCount). - Msg("Ignoring poll vote with lower vote count") - return invalidPollVote - } - if meta.VoteCount == nil { - meta.VoteCount = make(map[string]uint32) - } - meta.VoteCount[senderACI.String()] = vote.GetVoteCount() - err = mc.Bridge.DB.Message.Update(ctx, pollMessage) - if err != nil { - zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to update poll message with new vote count") - } - mxOptionIDs := meta.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 310f810..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" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" -) - -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 deleted file mode 100644 index e312a1f..0000000 --- a/pkg/msgconv/msgconv.go +++ /dev/null @@ -1,110 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2024 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 ( - "context" - - "github.com/google/uuid" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/networkid" - "maunium.net/go/mautrix/id" - - "go.mau.fi/mautrix-signal/pkg/msgconv/matrixfmt" - "go.mau.fi/mautrix-signal/pkg/msgconv/signalfmt" - "go.mau.fi/mautrix-signal/pkg/signalid" - "go.mau.fi/mautrix-signal/pkg/signalmeow" -) - -type contextKey int - -const ( - contextKeyPortal contextKey = iota - contextKeyClient - contextKeyIntent -) - -type MessageConverter struct { - Bridge *bridgev2.Bridge - - SignalFmtParams *signalfmt.FormatParams - MatrixFmtParams *matrixfmt.HTMLParser - - MaxFileSize int64 - LocationFormat string - DisappearViewOnce bool - DirectMedia bool - ExtEvPolls bool -} - -func NewMessageConverter(br *bridgev2.Bridge) *MessageConverter { - return &MessageConverter{ - Bridge: br, - SignalFmtParams: &signalfmt.FormatParams{ - GetUserInfo: func(ctx context.Context, uuid uuid.UUID) signalfmt.UserInfo { - ghost, err := br.GetGhostByID(ctx, signalid.MakeUserID(uuid)) - if err != nil { - // TODO log? - return signalfmt.UserInfo{} - } - userInfo := signalfmt.UserInfo{ - MXID: ghost.Intent.GetMXID(), - Name: ghost.Name, - } - userLogin := br.GetCachedUserLoginByID(networkid.UserLoginID(uuid.String())) - portal := getPortal(ctx) - if userLogin != nil && (portal.Receiver == "" || portal.Receiver == userLogin.ID) { - userInfo.MXID = userLogin.UserMXID - // TODO find matrix user displayname? - } - return userInfo - }, - }, - MatrixFmtParams: &matrixfmt.HTMLParser{ - GetUUIDFromMXID: func(ctx context.Context, userID id.UserID) uuid.UUID { - parsed, ok := br.Matrix.ParseGhostMXID(userID) - if ok { - u, _ := signalid.ParseUserID(parsed) - return u - } - user, _ := br.GetExistingUserByMXID(ctx, userID) - // TODO log errors? - if user != nil { - preferredLogin, _, _ := getPortal(ctx).FindPreferredLogin(ctx, user, true) - if preferredLogin != nil { - u, _ := signalid.ParseUserLoginID(preferredLogin.ID) - return u - } - } - return uuid.Nil - }, - }, - MaxFileSize: 50 * 1024 * 1024, - } -} - -func getClient(ctx context.Context) *signalmeow.Client { - return ctx.Value(contextKeyClient).(*signalmeow.Client) -} - -func getPortal(ctx context.Context) *bridgev2.Portal { - return ctx.Value(contextKeyPortal).(*bridgev2.Portal) -} - -func getIntent(ctx context.Context) bridgev2.MatrixAPI { - return ctx.Value(contextKeyIntent).(bridgev2.MatrixAPI) -} diff --git a/pkg/msgconv/urlpreview.go b/pkg/msgconv/urlpreview.go deleted file mode 100644 index 3b3bd06..0000000 --- a/pkg/msgconv/urlpreview.go +++ /dev/null @@ -1,93 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 ( - "context" - "time" - - "github.com/rs/zerolog" - "google.golang.org/protobuf/proto" - "maunium.net/go/mautrix/event" - - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" -) - -func (mc *MessageConverter) convertURLPreviewsToBeeper(ctx context.Context, preview []*signalpb.Preview, attMap AttachmentMap) []*event.BeeperLinkPreview { - output := make([]*event.BeeperLinkPreview, len(preview)) - for i, p := range preview { - output[i] = mc.convertURLPreviewToBeeper(ctx, p, attMap) - } - return output -} - -func (mc *MessageConverter) convertURLPreviewToBeeper(ctx context.Context, preview *signalpb.Preview, attMap AttachmentMap) *event.BeeperLinkPreview { - output := &event.BeeperLinkPreview{ - MatchedURL: preview.GetUrl(), - LinkPreview: event.LinkPreview{ - CanonicalURL: preview.GetUrl(), - Title: preview.GetTitle(), - Description: preview.GetDescription(), - }, - } - if preview.Image != nil { - msg, err := mc.reuploadAttachment(ctx, preview.Image, attMap) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to reupload link preview image") - } else { - output.ImageURL = msg.Content.URL - output.ImageEncryption = msg.Content.File - output.ImageType = msg.Content.Info.MimeType - output.ImageSize = event.IntOrString(msg.Content.Info.Size) - output.ImageHeight = event.IntOrString(msg.Content.Info.Height) - output.ImageWidth = event.IntOrString(msg.Content.Info.Width) - } - } - return output -} - -func (mc *MessageConverter) convertURLPreviewToSignal(ctx context.Context, content *event.MessageEventContent) []*signalpb.Preview { - if len(content.BeeperLinkPreviews) == 0 { - return nil - } - output := make([]*signalpb.Preview, len(content.BeeperLinkPreviews)) - for i, preview := range content.BeeperLinkPreviews { - output[i] = &signalpb.Preview{ - Url: proto.String(preview.MatchedURL), - Title: proto.String(preview.Title), - Description: proto.String(preview.Description), - Date: proto.Uint64(uint64(time.Now().UnixMilli())), - } - if preview.ImageURL != "" || preview.ImageEncryption != nil { - data, err := mc.Bridge.Bot.DownloadMedia(ctx, preview.ImageURL, preview.ImageEncryption) - if err != nil { - zerolog.Ctx(ctx).Err(err).Int("preview_index", i).Msg("Failed to download URL preview image") - continue - } - uploaded, err := getClient(ctx).UploadAttachment(ctx, data) - if err != nil { - zerolog.Ctx(ctx).Err(err).Int("preview_index", i).Msg("Failed to reupload URL preview image") - continue - } - uploaded.ContentType = proto.String(preview.ImageType) - uploaded.Width = proto.Uint32(uint32(preview.ImageWidth)) - uploaded.Height = proto.Uint32(uint32(preview.ImageHeight)) - output[i].Image = uploaded - } - } - return output -} diff --git a/pkg/signalid/dbmeta.go b/pkg/signalid/dbmeta.go deleted file mode 100644 index 35893c0..0000000 --- a/pkg/signalid/dbmeta.go +++ /dev/null @@ -1,43 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 signalid - -import ( - "go.mau.fi/util/jsontime" -) - -type PortalMetadata struct { - Revision uint32 `json:"revision,omitempty"` - ExpirationTimerVersion uint32 `json:"expiration_timer_version,omitempty"` - // Lazy resync tracking - LastSync jsontime.Unix `json:"last_sync,omitempty"` -} - -type MessageMetadata struct { - ContainsAttachments bool `json:"contains_attachments,omitempty"` - MatrixPollOptionIDs []string `json:"matrix_poll_option_ids,omitempty"` - VoteCount map[string]uint32 `json:"vote_count,omitempty"` -} - -type UserLoginMetadata struct { - ChatsSynced bool `json:"chats_synced,omitempty"` - LastContactSync jsontime.UnixMilli `json:"last_contact_sync,omitempty"` -} - -type GhostMetadata struct { - ProfileFetchedAt jsontime.UnixMilli `json:"profile_fetched_at"` -} diff --git a/pkg/signalid/ids.go b/pkg/signalid/ids.go deleted file mode 100644 index daa9200..0000000 --- a/pkg/signalid/ids.go +++ /dev/null @@ -1,139 +0,0 @@ -// mautrix-signal - A Matrix-Signal puppeting bridge. -// Copyright (C) 2024 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 signalid - -import ( - "fmt" - "strconv" - "strings" - - "github.com/google/uuid" - "maunium.net/go/mautrix/bridgev2" - "maunium.net/go/mautrix/bridgev2/networkid" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -func ParseUserID(userID networkid.UserID) (uuid.UUID, error) { - serviceID, err := ParseUserIDAsServiceID(userID) - if err != nil { - return uuid.Nil, err - } else if serviceID.Type != libsignalgo.ServiceIDTypeACI { - return uuid.Nil, fmt.Errorf("invalid user ID: expected ACI type") - } else { - return serviceID.UUID, nil - } -} - -func ParseUserLoginID(userLoginID networkid.UserLoginID) (uuid.UUID, error) { - userID, err := uuid.Parse(string(userLoginID)) - if err != nil { - return uuid.Nil, err - } - return userID, nil -} - -func toServiceID(id uuid.UUID, err error) (libsignalgo.ServiceID, error) { - if err != nil { - return libsignalgo.ServiceID{}, err - } - return libsignalgo.NewACIServiceID(id), nil -} - -func ParseGhostOrUserLoginID(ghostOrUserLogin bridgev2.GhostOrUserLogin) (libsignalgo.ServiceID, error) { - switch ghostOrUserLogin := ghostOrUserLogin.(type) { - case *bridgev2.UserLogin: - return toServiceID(ParseUserLoginID(ghostOrUserLogin.ID)) - case *bridgev2.Ghost: - return ParseUserIDAsServiceID(ghostOrUserLogin.ID) - default: - return libsignalgo.ServiceID{}, fmt.Errorf("cannot parse ID: unknown type: %T", ghostOrUserLogin) - } -} - -const pniUserIDPrefix = "pni_" -const pniServiceIDPrefix = "PNI:" - -func ParseUserIDAsServiceID(userID networkid.UserID) (libsignalgo.ServiceID, error) { - userIDStr := string(userID) - if strings.HasPrefix(userIDStr, pniUserIDPrefix) { - userIDStr = pniServiceIDPrefix + userIDStr[len(pniUserIDPrefix):] - } - return libsignalgo.ServiceIDFromString(userIDStr) -} - -func ParsePortalID(portalID networkid.PortalID) (userID libsignalgo.ServiceID, groupID types.GroupIdentifier, err error) { - if len(portalID) == 44 { - groupID = types.GroupIdentifier(portalID) - } else { - userID, err = libsignalgo.ServiceIDFromString(string(portalID)) - } - return -} - -func ParseMessageID(messageID networkid.MessageID) (sender uuid.UUID, timestamp uint64, err error) { - parts := strings.Split(string(messageID), "|") - if len(parts) != 2 { - err = fmt.Errorf("invalid message ID: expected two pipe-separated parts") - return - } - sender, err = uuid.Parse(parts[0]) - if err != nil { - return - } - timestamp, err = strconv.ParseUint(parts[1], 10, 64) - return -} - -func MakeGroupPortalID(groupID types.GroupIdentifier) networkid.PortalID { - return networkid.PortalID(groupID) -} - -func MakeDMPortalID(serviceID libsignalgo.ServiceID) networkid.PortalID { - return networkid.PortalID(serviceID.String()) -} - -func MakeMessageID(sender uuid.UUID, timestamp uint64) networkid.MessageID { - return networkid.MessageID(fmt.Sprintf("%s|%d", sender, timestamp)) -} - -func MakeUserID(user uuid.UUID) networkid.UserID { - return networkid.UserID(user.String()) -} - -func MakeUserIDFromServiceID(user libsignalgo.ServiceID) networkid.UserID { - switch user.Type { - case libsignalgo.ServiceIDTypeACI: - return MakeUserID(user.UUID) - case libsignalgo.ServiceIDTypePNI: - return networkid.UserID(pniUserIDPrefix + user.UUID.String()) - default: - panic(fmt.Errorf("invalid service ID type %d", user.Type)) - } -} - -func MakeUserLoginID(user uuid.UUID) networkid.UserLoginID { - return networkid.UserLoginID(user.String()) -} - -func MakeMessagePartID(index int) networkid.PartID { - if index == 0 { - return "" - } - return networkid.PartID(strconv.Itoa(index)) -} diff --git a/pkg/signalid/media.go b/pkg/signalid/media.go deleted file mode 100644 index a530c22..0000000 --- a/pkg/signalid/media.go +++ /dev/null @@ -1,278 +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 signalid - -import ( - "bytes" - "crypto/sha256" - "encoding/binary" - "fmt" - "io" - - "github.com/google/uuid" - "maunium.net/go/mautrix/bridgev2/networkid" -) - -type directMediaType byte - -const ( - directMediaTypeAttachment directMediaType = 0 - directMediaTypeGroupAvatar directMediaType = 1 - directMediaTypeProfileAvatar directMediaType = 2 - directMediaTypePlaintextDigestAttachment directMediaType = 3 - directMediaTypeSticker directMediaType = 4 -) - -type DirectMediaInfo interface { - AsMediaID() (networkid.MediaID, error) -} - -var ( - _ DirectMediaInfo = (*DirectMediaAttachment)(nil) - _ DirectMediaInfo = (*DirectMediaGroupAvatar)(nil) - _ DirectMediaInfo = (*DirectMediaProfileAvatar)(nil) - _ DirectMediaInfo = (*DirectMediaSticker)(nil) -) - -type DirectMediaAttachment struct { - CDNID uint64 - CDNKey string - CDNNumber uint32 - Key []byte - PlaintextDigest bool - Digest []byte - Size uint32 -} - -func (m DirectMediaAttachment) AsMediaID() (mediaID networkid.MediaID, err error) { - buf := &bytes.Buffer{} - - attType := directMediaTypeAttachment - if m.PlaintextDigest { - attType = directMediaTypePlaintextDigestAttachment - } - - if err = binary.Write(buf, binary.BigEndian, attType); err != nil { - return - } else if err = writeUvarint(buf, m.CDNID); err != nil { - return - } else if err = writeByteSlice(buf, []byte(m.CDNKey)); err != nil { - return - } else if err = writeUvarint(buf, uint64(m.CDNNumber)); err != nil { - return - } else if err = writeByteSlice(buf, m.Key); err != nil { - return - } else if err = writeByteSlice(buf, m.Digest); err != nil { - return - } else if err = writeUvarint(buf, uint64(m.Size)); err != nil { - return - } - - return networkid.MediaID(buf.Bytes()), nil -} - -type DirectMediaGroupAvatar struct { - UserID uuid.UUID - GroupID [32]byte - GroupAvatarPath string -} - -func (m DirectMediaGroupAvatar) AsMediaID() (mediaID networkid.MediaID, err error) { - buf := &bytes.Buffer{} - - if err = binary.Write(buf, binary.BigEndian, directMediaTypeGroupAvatar); err != nil { - return - } else if err = binary.Write(buf, binary.BigEndian, m.UserID); err != nil { - return - } else if err = binary.Write(buf, binary.BigEndian, m.GroupID); err != nil { - return - } else if err = writeByteSlice(buf, []byte(m.GroupAvatarPath)); err != nil { - return - } - - return networkid.MediaID(buf.Bytes()), nil -} - -type DirectMediaProfileAvatar struct { - UserID uuid.UUID - ContactID uuid.UUID - ProfileAvatarPath string -} - -func (m DirectMediaProfileAvatar) AsMediaID() (mediaID networkid.MediaID, err error) { - buf := &bytes.Buffer{} - - if err = binary.Write(buf, binary.BigEndian, directMediaTypeProfileAvatar); err != nil { - return - } else if err = binary.Write(buf, binary.BigEndian, m.UserID); err != nil { - return - } else if err = binary.Write(buf, binary.BigEndian, m.ContactID); err != nil { - return - } else if err = writeByteSlice(buf, []byte(m.ProfileAvatarPath)); err != nil { - return - } - - 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 { - return nil, fmt.Errorf("empty media ID") - } - - buf := bytes.NewReader(mediaID) - - // type byte - var mediaType directMediaType - if err := binary.Read(buf, binary.BigEndian, &mediaType); err != nil { - return nil, fmt.Errorf("failed to read media type: %w", err) - } - - switch mediaType { - case directMediaTypeAttachment, directMediaTypePlaintextDigestAttachment: - var info DirectMediaAttachment - info.PlaintextDigest = mediaType == directMediaTypePlaintextDigestAttachment - - if info.CDNID, err = binary.ReadUvarint(buf); err != nil { - return info, fmt.Errorf("failed to read cdn id: %w", err) - } - if cdnKey, err := readByteSlice(buf, mediaIDLen); err != nil { - return info, fmt.Errorf("failed to read cdn key: %w", err) - } else { - info.CDNKey = string(cdnKey) - } - if cdnNumber, err := binary.ReadUvarint(buf); err != nil { - return info, fmt.Errorf("failed to read cdn number: %w", err) - } else { - info.CDNNumber = uint32(cdnNumber) - } - if info.Key, err = readByteSlice(buf, mediaIDLen); err != nil { - return info, fmt.Errorf("failed to read key: %w", err) - } else if info.Digest, err = readByteSlice(buf, mediaIDLen); err != nil { - return info, fmt.Errorf("failed to read digest: %w", err) - } - if size, err := binary.ReadUvarint(buf); err != nil { - return info, fmt.Errorf("failed to read cdn id: %w", err) - } else { - info.Size = uint32(size) - } - - return &info, nil - case directMediaTypeGroupAvatar: - var info DirectMediaGroupAvatar - - if err = binary.Read(buf, binary.BigEndian, &info.UserID); err != nil { - return info, fmt.Errorf("failed to read user id: %w", err) - } else if err = binary.Read(buf, binary.BigEndian, &info.GroupID); err != nil { - return info, fmt.Errorf("failed to read group id: %w", err) - } - if groupAvatarPath, err := readByteSlice(buf, mediaIDLen); err != nil { - return info, fmt.Errorf("failed to read group avatar path: %w", err) - } else { - info.GroupAvatarPath = string(groupAvatarPath) - } - - return &info, nil - case directMediaTypeProfileAvatar: - var info DirectMediaProfileAvatar - - if err = binary.Read(buf, binary.BigEndian, &info.UserID); err != nil { - return info, fmt.Errorf("failed to read user id: %w", err) - } else if err = binary.Read(buf, binary.BigEndian, &info.ContactID); err != nil { - return info, fmt.Errorf("failed to read contact id: %w", err) - } - if profileAvatarPath, err := readByteSlice(buf, mediaIDLen); err != nil { - return info, fmt.Errorf("failed to read profile avatar path: %w", err) - } else { - 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) -} - -func HashMediaID(mediaID networkid.MediaID) [32]byte { - return sha256.Sum256(mediaID) -} - -func writeUvarint(w io.Writer, i uint64) error { - _, err := w.Write(binary.AppendUvarint(nil, i)) - return err -} - -func writeByteSlice(w io.Writer, b []byte) error { - if err := writeUvarint(w, uint64(len(b))); err != nil { - return err - } - _, err := w.Write(b) - return err -} - -type byteReader interface { - io.ByteReader - io.Reader -} - -func readByteSlice(r byteReader, maxLength int) ([]byte, error) { - length, err := binary.ReadUvarint(r) - if err != nil { - return nil, fmt.Errorf("reading uvarint failed: %w", err) - } else if int(length) > maxLength { - return nil, fmt.Errorf("byte slice size larger than expected: %d > %d", length, maxLength) - } else if length == 0 { - return nil, nil - } - - buf := make([]byte, length) - _, err = io.ReadFull(r, buf) - return buf, err -} diff --git a/pkg/signalmeow/attachments.go b/pkg/signalmeow/attachments.go index de89fb2..2095d1e 100644 --- a/pkg/signalmeow/attachments.go +++ b/pkg/signalmeow/attachments.go @@ -23,25 +23,16 @@ import ( "crypto/cipher" "crypto/hmac" "crypto/sha256" - "encoding/base64" - "encoding/json" "errors" "fmt" "io" "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" - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) @@ -50,180 +41,58 @@ const ( attachmentIDDownloadPath = "/attachments/%d" ) -func getAttachmentPath(id uint64, key string) string { +func getAttachmentPath(id uint64, key string, cdnNumber uint32) (string, error) { if id != 0 { - return fmt.Sprintf(attachmentIDDownloadPath, id) + return fmt.Sprintf(attachmentIDDownloadPath, id), nil } - return fmt.Sprintf(attachmentKeyDownloadPath, key) + return fmt.Sprintf(attachmentKeyDownloadPath, key), nil } // ErrInvalidMACForAttachment signals that the downloaded attachment has an invalid MAC. 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) { - 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, - ) -} - -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, a *signalpb.AttachmentPointer) ([]byte, error) { + path, err := getAttachmentPath(a.GetCdnId(), a.GetCdnKey(), a.GetCdnNumber()) if err != nil { return nil, err } - defer func() { - _ = resp.Body.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) - } + resp, err := web.GetAttachment(ctx, path, a.GetCdnNumber(), nil) if err != nil { return nil, err } - if resp.StatusCode > 400 { - if json.Valid(body) && len(body) < 4096 { - zerolog.Ctx(ctx).Debug().RawJSON("response_data", body).Msg("Failed download response json") - } else if len(body) < 1024 { - zerolog.Ctx(ctx).Debug().Bytes("response_data", body).Msg("Failed download response data") - } - if resp.StatusCode == http.StatusNotFound { - return nil, ErrAttachmentNotFound - } - return nil, fmt.Errorf("unexpected status code %d", resp.StatusCode) + bodyReader := resp.Body + defer bodyReader.Close() + + body, err := io.ReadAll(bodyReader) + if err != nil { + return nil, err } - 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) + return decryptAttachment(body, a.Key, a.Digest, *a.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:]) { +func decryptAttachment(body, key, digest []byte, size uint32) ([]byte, error) { + hash := sha256.Sum256(body) + if !hmac.Equal(hash[:], digest) { + return nil, ErrInvalidDigestForAttachment + } + l := len(body) - 32 + if !verifyMAC(key[32:], 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) - if !hmac.Equal(hash[:], digest) { - return nil, ErrInvalidDigestForAttachment - } - } - decrypted, err := macAndAESDecrypt(body, key) + decrypted, err := aesDecrypt(key[:32], body[:l]) if err != nil { return nil, err } if len(decrypted) < int(size) { return nil, fmt.Errorf("decrypted attachment length %v < expected %v", len(decrypted), size) } - decrypted = decrypted[:size] - if plaintextDigest { - hash := sha256.Sum256(decrypted) - if !hmac.Equal(hash[:], digest) { - return nil, fmt.Errorf("%w (plaintext hash)", ErrInvalidDigestForAttachment) - } - } - return decrypted, nil + return decrypted[:size], 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 { +type attachmentV3UploadAttributes struct { Cdn uint32 `json:"cdn"` Key string `json:"key"` Headers map[string]string `json:"headers"` @@ -245,14 +114,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,35 +129,61 @@ 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 := "/v3/attachments/form/upload" + 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("Error sending request fetching upload attributes") + return nil, err + } + var uploadAttributes attachmentV3UploadAttributes + err = web.DecodeHTTPResponseBody(ctx, &uploadAttributes, resp) + if err != nil { + log.Err(err).Msg("Error decoding response body fetching upload attributes") + return nil, err + } - // Get upload attributes from Signal server - attributesPath := "/v4/attachments/form/upload" - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, attributesPath, nil, nil) + // Allocate attachment on CDN + resp, err = web.SendHTTPRequest(ctx, http.MethodPost, "", &web.HTTPReqOpt{ + OverrideURL: uploadAttributes.SignedUploadLocation, + ContentType: web.ContentTypeOctetStream, + Headers: uploadAttributes.Headers, + Username: &username, + Password: &password, + }) 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) - if err != nil { - log.Err(err).Msg("Failed to decode upload attributes") - return nil, fmt.Errorf("failed to decode upload attributes: %w", err) - } - if uploadAttributes.Cdn == 3 { - log.Trace().Msg("Using TUS upload") - err = cli.uploadAttachmentTUS(ctx, uploadAttributes, encryptedWithMAC) - } else { - log.Trace().Msg("Using legacy upload") - err = cli.uploadAttachmentLegacy(ctx, uploadAttributes, encryptedWithMAC) - } - if err != nil { - log.Err(err).Msg("Failed to upload attachment") + log.Err(err).Msg("Error sending request allocating attachment") return nil, err } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + log.Error().Int("status_code", resp.StatusCode).Msg("Error allocating attachment") + return nil, fmt.Errorf("error allocating attachment: %s", resp.Status) + } + + // Upload attachment to CDN + resp, err = web.SendHTTPRequest(ctx, http.MethodPut, "", &web.HTTPReqOpt{ + OverrideURL: resp.Header.Get("Location"), + Body: encryptedWithMAC, + ContentType: web.ContentTypeOctetStream, + Username: &username, + Password: &password, + }) + if err != nil { + log.Err(err).Msg("Error sending request uploading attachment") + return nil, err + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + log.Error().Int("status_code", resp.StatusCode).Msg("Error uploading attachment") + return nil, fmt.Errorf("error uploading attachment: %s", resp.Status) + } digest := sha256.Sum256(encryptedWithMAC) @@ -313,155 +200,6 @@ func (cli *Client) UploadAttachment(ctx context.Context, body []byte) (*signalpb return attachmentPointer, nil } -func (cli *Client) uploadAttachmentLegacy( - ctx context.Context, - uploadAttributes attachmentV4UploadAttributes, - encryptedWithMAC []byte, -) error { - username, password := cli.Store.BasicAuthCreds() - // Allocate attachment on CDN - 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 { - return fmt.Errorf("allocate request returned HTTP %d", resp.StatusCode) - } - - // Upload attachment to CDN - 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 { - return fmt.Errorf("upload request returned HTTP %d", resp.StatusCode) - } - return nil -} - -func (cli *Client) uploadAttachmentTUS( - ctx context.Context, - uploadAttributes attachmentV4UploadAttributes, - encryptedWithMAC []byte, -) error { - uploadAttributes.Headers["Tus-Resumable"] = "1.0.0" - 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{ - 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) - } else if resp.StatusCode < 200 || resp.StatusCode >= 300 { - zerolog.Ctx(ctx).Debug(). - Any("request_headers", uploadAttributes.Headers). - Any("response_headers", resp.Header). - Str("location", uploadAttributes.SignedUploadLocation). - Msg("TUS upload failed") - return fmt.Errorf("upload request returned HTTP %d", resp.StatusCode) - } - return nil -} - -func (cli *Client) UploadGroupAvatar(ctx context.Context, avatarBytes []byte, gid types.GroupIdentifier, groupMasterKey types.SerializedGroupMasterKey) (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) - } - } - groupAuth, err := cli.GetAuthorizationForToday(ctx, masterKeyToBytes(groupMasterKey)) - if err != nil { - log.Err(err).Msg("Failed to get Authorization for today") - return "", err - } - groupSecretParams, err := libsignalgo.DeriveGroupSecretParamsFromMasterKey(masterKeyToBytes(groupMasterKey)) - if err != nil { - log.Err(err).Msg("Could not get groupSecretParams from master key") - return "", err - } - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_Avatar{Avatar: avatarBytes}} - encryptedAvatar, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) - if err != nil { - log.Err(err).Msg("Could not encrypt avatar into Group Property") - return "", err - } - - // 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) - 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 - } - uploadForm := signalpb.AvatarUploadAttributes{} - err = proto.Unmarshal(body, &uploadForm) - if err != nil { - log.Err(err).Msg("failed to unmarshal group avatar upload form") - return "", err - } - requestBody := &bytes.Buffer{} - w := multipart.NewWriter(requestBody) - w.WriteField("key", uploadForm.Key) - w.WriteField("x-amz-credential", uploadForm.Credential) - w.WriteField("acl", uploadForm.Acl) - w.WriteField("x-amz-algorithm", uploadForm.Algorithm) - w.WriteField("x-amz-date", uploadForm.Date) - w.WriteField("policy", uploadForm.Policy) - w.WriteField("x-amz-signature", uploadForm.Signature) - w.WriteField("Content-Type", "application/octet-stream") - filewriter, _ := w.CreateFormFile("file", "file") - filewriter.Write(*encryptedAvatar) - w.Close() - - // Upload avatar to CDN - resp, err = web.SendHTTPRequest(ctx, web.CDN1Hostname, http.MethodPost, "", &web.HTTPReqOpt{ - Body: requestBody.Bytes(), - ContentType: web.ContentType(w.FormDataContentType()), - }) - web.CloseBody(resp) - if err != nil { - log.Err(err).Msg("Error sending request uploading attachment") - return "", err - } - if resp.StatusCode < 200 || resp.StatusCode >= 300 { - log.Error().Int("status_code", resp.StatusCode).Msg("Error uploading attachment") - return "", fmt.Errorf("error uploading attachment: %s", resp.Status) - } - - return uploadForm.Key, nil -} - func verifyMAC(key, body, mac []byte) bool { m := hmac.New(sha256.New, key) m.Write(body) @@ -478,56 +216,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 +238,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/attachments_stream.go b/pkg/signalmeow/attachments_stream.go deleted file mode 100644 index 1dcd9f9..0000000 --- a/pkg/signalmeow/attachments_stream.go +++ /dev/null @@ -1,178 +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 ( - "bufio" - "crypto/aes" - "crypto/cipher" - "crypto/hmac" - "crypto/sha256" - "encoding/binary" - "errors" - "fmt" - "hash" - "io" - "os" - - "google.golang.org/protobuf/proto" -) - -func verifyMACStream(hmacKey [32]byte, input io.Reader, totalSize int64) (bool, error) { - if totalSize <= 0 { - file, ok := input.(*os.File) - if ok { - stat, err := file.Stat() - if err != nil { - return false, fmt.Errorf("failed to stat file: %w", err) - } - totalSize = stat.Size() - } else { - return false, fmt.Errorf("total size is unknown") - } - } - hasher := hmac.New(sha256.New, hmacKey[:]) - _, err := io.CopyN(hasher, input, totalSize-MACLength) - if err != nil { - return false, fmt.Errorf("failed to hash file: %w", err) - } - actualHash := hasher.Sum(nil) - expectedHash := make([]byte, MACLength) - _, err = io.ReadFull(input, expectedHash) - if err != nil { - return false, fmt.Errorf("failed to read hash: %w", err) - } - return hmac.Equal(expectedHash, actualHash), nil -} - -type decryptingReader struct { - input io.Reader - cipher cipher.BlockMode - hasher hash.Hash - aesKey *[32]byte - remainingSize int64 -} - -func (dr *decryptingReader) Read(p []byte) (int, error) { - if dr.remainingSize == 0 { - return 0, io.EOF - } else if len(p) < aes.BlockSize { - return 0, fmt.Errorf("buffer too small (must be at least %d bytes)", aes.BlockSize) - } - if dr.cipher == nil { - iv := make([]byte, IVLength) - _, err := io.ReadFull(dr.input, iv) - if err != nil { - return 0, fmt.Errorf("failed to read IV: %w", err) - } - block, err := aes.NewCipher(dr.aesKey[:]) - if err != nil { - return 0, fmt.Errorf("failed to create cipher: %w", err) - } - dr.cipher = cipher.NewCBCDecrypter(block, iv) - dr.hasher.Write(iv) - } - maxLen := int64(len(p) - len(p)%aes.BlockSize) - if maxLen > dr.remainingSize { - maxLen = dr.remainingSize - } - p = p[:maxLen] - _, err := io.ReadFull(dr.input, p) - if err != nil { - return 0, err - } - dr.remainingSize -= maxLen - dr.hasher.Write(p) - dr.cipher.CryptBlocks(p, p) - if dr.remainingSize == 0 { - p, err = UnpadPKCS7(p) - if err != nil { - return 0, fmt.Errorf("failed to unpad: %w", err) - } - expectedMAC := make([]byte, MACLength) - _, err = io.ReadFull(dr.input, expectedMAC) - if err != nil { - return 0, fmt.Errorf("failed to read MAC: %w", err) - } - actualMAC := dr.hasher.Sum(nil) - if !hmac.Equal(expectedMAC, actualMAC) { - return 0, fmt.Errorf("hmac mismatch") - } - } - return len(p), nil -} - -func (dr *decryptingReader) Close() error { - if dr.remainingSize != 0 { - return fmt.Errorf("unexpected remaining size %d", dr.remainingSize) - } - return nil -} - -func aesDecryptStream(aesKey, macKey [32]byte, input io.Reader, totalSize int64) io.ReadCloser { - return &decryptingReader{ - aesKey: &aesKey, - hasher: hmac.New(sha256.New, macKey[:]), - input: input, - remainingSize: totalSize - MACLength - IVLength, - } -} - -func splitChunksStream(input io.Reader, callback func([]byte) error) error { - byteReader, ok := input.(io.ByteReader) - if !ok { - bufInput := bufio.NewReader(input) - byteReader = bufInput - input = bufInput - } - var cachedBuf []byte - for { - msgLen, err := binary.ReadUvarint(byteReader) - if errors.Is(err, io.EOF) { - return nil - } else if err != nil { - return fmt.Errorf("failed to read chunk length: %w", err) - } - if msgLen == 0 { - continue - } - if msgLen > uint64(len(cachedBuf)) { - cachedBuf = make([]byte, max(msgLen, 8192)) - } - buf := cachedBuf[:msgLen] - _, err = io.ReadFull(input, buf) - if err != nil { - return fmt.Errorf("failed to read chunk: %w", err) - } - err = callback(buf) - if err != nil { - return err - } - } -} - -func splitProtoChunksStream[ChunkType proto.Message](input io.Reader, callback func(ChunkType) error) error { - protoReflect := (*new(ChunkType)).ProtoReflect() - return splitChunksStream(input, func(buf []byte) error { - msg := protoReflect.New().Interface().(ChunkType) - err := proto.Unmarshal(buf, msg) - if err != nil { - return fmt.Errorf("failed to unmarshal chunk: %w", err) - } - return callback(msg) - }) -} diff --git a/pkg/signalmeow/backup.go b/pkg/signalmeow/backup.go deleted file mode 100644 index f003e19..0000000 --- a/pkg/signalmeow/backup.go +++ /dev/null @@ -1,310 +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 ( - "bufio" - "compress/gzip" - "context" - "crypto/hmac" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "os" - "strconv" - "time" - - "github.com/rs/zerolog" - "google.golang.org/protobuf/proto" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/backuppb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/web" -) - -const transferArchiveFetchTimeout = 1 * time.Hour - -var ( - ErrNoEphemeralBackupKey = errors.New("no ephemeral backup key") -) - -const ( - TransferErrorRelinkRequested = "RELINK_REQUESTED" - TransferErrorContinueWithoutUpload = "CONTINUE_WITHOUT_UPLOAD" -) - -type TransferArchiveMetadata struct { - CDN uint32 `json:"cdn"` - Key string `json:"key"` - Error string `json:"error"` // RELINK_REQUESTED or CONTINUE_WITHOUT_UPLOAD -} - -func (cli *Client) FetchAndProcessTransfer(ctx context.Context, meta *TransferArchiveMetadata) error { - if meta.Error != "" { - return fmt.Errorf("transfer archive error: %s", meta.Error) - } - aesKey, hmacKey, err := cli.deriveTransferKeys() - if err != nil { - return fmt.Errorf("failed to derive transfer keys: %w", err) - } - file, err := os.CreateTemp("", "signalmeow-transfer-archive-*") - if err != nil { - return fmt.Errorf("failed to create temporary file: %w", err) - } - defer func() { - _ = file.Close() - _ = os.Remove(file.Name()) - }() - err = downloadTransferArchive(ctx, meta, file) - if err != nil { - return err - } - _, err = file.Seek(0, io.SeekStart) - if err != nil { - return fmt.Errorf("failed to seek to start of file: %w", err) - } - stat, err := file.Stat() - if err != nil { - return fmt.Errorf("failed to stat file: %w", err) - } - ok, err := verifyMACStream(hmacKey, file, stat.Size()) - if err != nil { - return fmt.Errorf("failed to verify MAC: %w", err) - } else if !ok { - return fmt.Errorf("checksum mismatch") - } - _, err = file.Seek(0, io.SeekStart) - if err != nil { - return fmt.Errorf("failed to seek to start of file: %w", err) - } - err = cli.Store.DoContactTxn(ctx, func(ctx context.Context) error { - err = cli.Store.BackupStore.ClearBackup(ctx) - if err != nil { - return fmt.Errorf("failed to clear backup: %w", err) - } - err = cli.processTransferArchive(ctx, aesKey, hmacKey, file, stat.Size()) - if err != nil { - return err - } - err = cli.Store.BackupStore.RecalculateChatCounts(ctx) - if err != nil { - return fmt.Errorf("failed to calculate message counts: %w", err) - } - cli.Store.EphemeralBackupKey = nil - err = cli.Store.DeviceStore.PutDevice(ctx, &cli.Store.DeviceData) - if err != nil { - return fmt.Errorf("failed to save device data after clearing ephemeral backup key: %w", err) - } - return nil - }) - if err != nil { - return err - } - return nil -} - -func (cli *Client) processTransferArchive(ctx context.Context, aesKey, hmacKey [32]byte, file io.Reader, size int64) error { - decrypter := aesDecryptStream(aesKey, hmacKey, file, size) - bufDecrypted := bufio.NewReader(decrypter) - decompressor, err := gzip.NewReader(bufDecrypted) - if err != nil { - return fmt.Errorf("failed to create gzip reader: %w", err) - } - // There's an unknown amount of zero padding after the gzip stream, - // so tell gzip not to try to read another stream after the first one. - decompressor.Multistream(false) - err = splitChunksStream(decompressor, (&archiveChunkProcessor{cli: cli, ctx: ctx}).processChunk) - if err != nil { - return err - } - err = decompressor.Close() - if err != nil { - return fmt.Errorf("failed to close gzip reader: %w", err) - } - zeroBuf := make([]byte, 256) - var n int - // Validate that the zero padding is really all zeroes. This will also finish the hmac checking. - for { - n, err = bufDecrypted.Read(zeroBuf) - if errors.Is(err, io.EOF) && n == 0 { - break - } else if err != nil { - return fmt.Errorf("failed to read zero buffer: %w", err) - } - for i := 0; i < n; i++ { - if zeroBuf[i] != 0 { - return fmt.Errorf("unexpected data after decompression") - } - } - } - err = decrypter.Close() - if err != nil { - return fmt.Errorf("failed to close decryption reader: %w", err) - } - return nil -} - -type archiveChunkProcessor struct { - cli *Client - ctx context.Context - info *backuppb.BackupInfo -} - -const BackupVersion = 1 - -func (acp *archiveChunkProcessor) processChunk(buf []byte) error { - if acp.ctx.Err() != nil { - return acp.ctx.Err() - } - if acp.info == nil { - acp.info = &backuppb.BackupInfo{} - err := proto.Unmarshal(buf, acp.info) - if err != nil { - return fmt.Errorf("failed to unmarshal backup info: %w", err) - } else if acp.info.GetVersion() != BackupVersion { - return fmt.Errorf("unsupported backup version: %d", acp.info.GetVersion()) - } else if !hmac.Equal(acp.info.GetMediaRootBackupKey(), acp.cli.Store.MediaRootBackupKey[:]) { - return fmt.Errorf("media root backup key mismatch") - } - zerolog.Ctx(acp.ctx).Info().Any("backup_info", acp.info).Msg("Received backup info") - return nil - } - var frame backuppb.Frame - err := proto.Unmarshal(buf, &frame) - if err != nil { - return fmt.Errorf("failed to unmarshal frame: %w", err) - } - return acp.processFrame(&frame) -} - -func (acp *archiveChunkProcessor) processFrame(frame *backuppb.Frame) error { - acp.cli.Log.Trace().Any("backup_frame", frame).Msg("Processing backup frame") - switch item := frame.Item.(type) { - case *backuppb.Frame_Recipient: - if item.Recipient.Destination == nil { - zerolog.Ctx(acp.ctx).Debug().Msg("Ignoring recipient frame with no destination") - return nil - } - return acp.cli.Store.BackupStore.AddBackupRecipient(acp.ctx, item.Recipient) - case *backuppb.Frame_Chat: - return acp.cli.Store.BackupStore.AddBackupChat(acp.ctx, item.Chat) - case *backuppb.Frame_ChatItem: - switch item.ChatItem.Item.(type) { - case *backuppb.ChatItem_DirectStoryReplyMessage, *backuppb.ChatItem_UpdateMessage, nil: - zerolog.Ctx(acp.ctx).Debug(). - Uint64("chat_id", item.ChatItem.ChatId). - Uint64("message_id", item.ChatItem.DateSent). - Type("frame_type", item). - Msg("Not saving unsupported chat item type") - return nil - } - return acp.cli.Store.BackupStore.AddBackupChatItem(acp.ctx, item.ChatItem) - default: - zerolog.Ctx(acp.ctx).Debug().Type("frame_type", item).Msg("Ignoring backup frame") - return nil - } -} - -func (cli *Client) deriveTransferKeys() (aesKey, hmacKey [32]byte, err error) { - var backupID *libsignalgo.BackupID - var mbk *libsignalgo.MessageBackupKey - if cli.Store.EphemeralBackupKey == nil { - err = ErrNoEphemeralBackupKey - } else if backupID, err = cli.Store.EphemeralBackupKey.DeriveBackupID(cli.Store.ACIServiceID()); err != nil { - err = fmt.Errorf("failed to derive backup ID: %w", err) - } else if mbk, err = libsignalgo.MessageBackupKeyFromBackupKeyAndID(cli.Store.EphemeralBackupKey, backupID); err != nil { - err = fmt.Errorf("failed to derive message backup key: %w", err) - } else if aesKey, err = mbk.GetAESKey(); err != nil { - err = fmt.Errorf("failed to get AES key: %w", err) - } else if hmacKey, err = mbk.GetHMACKey(); err != nil { - err = fmt.Errorf("failed to get HMAC key: %w", err) - } - return -} - -func downloadTransferArchive(ctx context.Context, meta *TransferArchiveMetadata, writeTo io.Writer) error { - resp, err := web.GetAttachment(ctx, getAttachmentPath(0, meta.Key), meta.CDN) - if err != nil { - return fmt.Errorf("failed to download transfer archive: %w", err) - } - if writeToFile, ok := writeTo.(*os.File); ok { - fileInfo, err := writeToFile.Stat() - if err != nil { - return fmt.Errorf("failed to stat destination file: %w", err) - } - if size := fileInfo.Size(); size > 0 { - zerolog.Ctx(ctx).Debug().Int64("skip_count", size).Msg("Transfer archive already exists, skipping bytes") - _, err = io.CopyN(io.Discard, resp.Body, size) - if err != nil { - return fmt.Errorf("failed to skip existing bytes: %w", err) - } - } - } - _, err = io.Copy(writeTo, resp.Body) - if err != nil { - return fmt.Errorf("failed to write transfer archive to disk: %w", err) - } - return nil -} - -func (cli *Client) WaitForTransfer(ctx context.Context) (*TransferArchiveMetadata, error) { - if cli.Store.EphemeralBackupKey == nil { - return nil, ErrNoEphemeralBackupKey - } - timeout := time.Now().Add(transferArchiveFetchTimeout) - - for { - remainingTime := time.Until(timeout) - if remainingTime < 0 { - return nil, fmt.Errorf("timed out") - } - reqStart := time.Now() - reqTimeout := min(remainingTime, 5*time.Minute) - resp, err := cli.tryRequestTransferArchive(ctx, reqTimeout) - if resp != nil || err != nil { - return resp, err - } - reqDuration := time.Since(reqStart) - if reqDuration < reqTimeout-10*time.Second { - select { - case <-time.After(15 * time.Second): - case <-ctx.Done(): - return nil, ctx.Err() - } - } - } -} - -func (cli *Client) tryRequestTransferArchive(ctx context.Context, timeout time.Duration) (respBody *TransferArchiveMetadata, err error) { - 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) - if err != nil { - return nil, err - } else if resp.GetStatus() == 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 { - 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 b72e33b..de1a8cd 100644 --- a/pkg/signalmeow/client.go +++ b/pkg/signalmeow/client.go @@ -18,84 +18,49 @@ 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" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" "go.mau.fi/mautrix-signal/pkg/signalmeow/store" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) type Client struct { Store *store.Device - Log zerolog.Logger - - senderCertificateWithE164 *libsignalgo.SenderCertificate - senderCertificateNoE164 *libsignalgo.SenderCertificate - senderCertificateCache sync.Mutex - - sendCache *exsync.RingBuffer[sendCacheKey, *signalpb.Content] + SenderCertificate *libsignalgo.SenderCertificate + GroupCredentials *GroupCredentials GroupCache *GroupCache ProfileCache *ProfileCache - LastContactRequestTime time.Time - SyncContactsOnConnect bool + GroupCallCache *map[string]bool + LastContactRequestTime *int64 encryptionLock sync.Mutex - AuthedWS *web.SignalWebsocket - UnauthedWS *web.SignalWebsocket - GRPC *web.GRPCClient - lastConnectionStatus SignalConnectionStatus + AuthedWS *web.SignalWebsocket + UnauthedWS *web.SignalWebsocket + WSCancel context.CancelFunc - loopCancel context.CancelFunc - loopWg sync.WaitGroup - - EventHandler func(events.SignalEvent) bool + EventHandler func(events.SignalEvent) storageAuthLock sync.Mutex storageAuth *basicExpiringCredentials cdAuthLock sync.Mutex cdAuth *basicExpiringCredentials cdToken []byte - - 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) { + if cli.EventHandler != nil { + cli.EventHandler(evt) } } -func (cli *Client) handleEvent(evt events.SignalEvent) bool { - return cli.EventHandler(evt) -} - func (cli *Client) IsConnected() bool { if cli == nil { return false @@ -103,7 +68,7 @@ func (cli *Client) IsConnected() bool { return cli.AuthedWS.IsConnected() && cli.UnauthedWS.IsConnected() } -func (cli *Client) connectAuthedWS(ctx context.Context, requestHandler web.RequestHandlerFunc) (chan web.SignalWebsocketConnectionStatus, error) { +func (cli *Client) ConnectAuthedWS(ctx context.Context, requestHandler web.RequestHandlerFunc) (chan web.SignalWebsocketConnectionStatus, error) { if cli.AuthedWS != nil { return nil, errors.New("authed websocket already connected") } @@ -114,13 +79,18 @@ func (cli *Client) connectAuthedWS(ctx context.Context, requestHandler web.Reque Str("username", username). Logger() ctx = log.WithContext(ctx) - authedWS := web.NewSignalWebsocket(url.UserPassword(username, password)) - statusChan := authedWS.Connect(ctx, requestHandler) + username = url.QueryEscape(username) + password = url.QueryEscape(password) + path := web.WebsocketPath + + "?login=" + username + + "&password=" + password + authedWS := web.NewSignalWebsocket(path, &username, &password) + statusChan := authedWS.Connect(ctx, &requestHandler) cli.AuthedWS = authedWS return statusChan, nil } -func (cli *Client) connectUnauthedWS(ctx context.Context) (chan web.SignalWebsocketConnectionStatus, error) { +func (cli *Client) ConnectUnauthedWS(ctx context.Context) (chan web.SignalWebsocketConnectionStatus, error) { if cli.UnauthedWS != nil { return nil, errors.New("unauthed websocket already connected") } @@ -129,7 +99,7 @@ func (cli *Client) connectUnauthedWS(ctx context.Context) (chan web.SignalWebsoc Str("websocket_type", "unauthed"). Logger() ctx = log.WithContext(ctx) - unauthedWS := web.NewSignalWebsocket(nil) + unauthedWS := web.NewSignalWebsocket(web.WebsocketPath, nil, nil) statusChan := unauthedWS.Connect(ctx, nil) cli.UnauthedWS = unauthedWS return statusChan, nil @@ -138,11 +108,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 616434d..5ec22c3 100644 --- a/pkg/signalmeow/contact.go +++ b/pkg/signalmeow/contact.go @@ -25,87 +25,170 @@ import ( "fmt" "net/http" "strings" - "time" "github.com/google/uuid" "github.com/rs/zerolog" "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + "go.mau.fi/mautrix-signal/pkg/libsignalgo" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/types" ) -func (cli *Client) StoreContactDetailsAsContact(ctx context.Context, contactDetails *signalpb.ContactDetails, avatar *[]byte) (*types.Recipient, error) { - parsedUUID, err := ParseStringOrBinaryUUID(contactDetails.GetAci(), contactDetails.GetAciBinary()) +func (cli *Client) StoreContactDetailsAsContact(ctx context.Context, contactDetails *signalpb.ContactDetails, avatar *[]byte) (*types.Contact, error) { + parsedUUID, err := uuid.Parse(contactDetails.GetAci()) if err != nil { return nil, err } - ctx = zerolog.Ctx(ctx).With(). + log := zerolog.Ctx(ctx).With(). Str("action", "store contact details as contact"). - Stringer("uuid", parsedUUID). - Logger().WithContext(ctx) - return cli.Store.RecipientStore.LoadAndUpdateRecipient(ctx, parsedUUID, uuid.Nil, func(recipient *types.Recipient) (bool, error) { - if contactDetails.GetNumber() != "" { - recipient.E164 = contactDetails.GetNumber() + Str("uuid", parsedUUID.String()). + Logger() + existingContact, err := cli.Store.ContactStore.LoadContact(ctx, parsedUUID) + if err != nil { + log.Err(err).Msg("error loading contact") + return nil, err + } + if existingContact == nil { + log.Debug().Msg("creating new contact") + existingContact = &types.Contact{ + UUID: parsedUUID, } - recipient.ContactName = contactDetails.GetName() - //if profileKeyString := contactDetails.GetProfileKey(); profileKeyString != nil { - // profileKey := libsignalgo.ProfileKey(profileKeyString) - // recipient.Profile.Key = profileKey - //} - if avatar != nil && *avatar != nil && len(*avatar) > 0 { - rawHash := sha256.Sum256(*avatar) - avatarHash := hex.EncodeToString(rawHash[:]) - var contentType string - if avatarDetails := contactDetails.GetAvatar(); avatarDetails != nil && !strings.HasSuffix(avatarDetails.GetContentType(), "/*") { - contentType = *avatarDetails.ContentType - } else { - contentType = http.DetectContentType(*avatar) - } - recipient.ContactAvatar = types.ContactAvatar{ - Image: *avatar, - ContentType: contentType, - Hash: avatarHash, - } + } else { + log.Debug().Msg("updating existing contact") + } + + existingContact.E164 = contactDetails.GetNumber() + existingContact.ContactName = contactDetails.GetName() + if profileKeyString := contactDetails.GetProfileKey(); profileKeyString != nil { + profileKey := libsignalgo.ProfileKey(profileKeyString) + existingContact.ProfileKey = &profileKey + err = cli.Store.ProfileKeyStore.StoreProfileKey(ctx, existingContact.UUID, profileKey) + if err != nil { + log.Err(err).Msg("storing profile key") + //return *existingContact, nil, err } - return true, nil - }) + } + + if avatar != nil && *avatar != nil && len(*avatar) > 0 { + rawHash := sha256.Sum256(*avatar) + avatarHash := hex.EncodeToString(rawHash[:]) + var contentType string + if avatarDetails := contactDetails.GetAvatar(); avatarDetails != nil && !strings.HasSuffix(avatarDetails.GetContentType(), "/*") { + contentType = *avatarDetails.ContentType + } else { + contentType = http.DetectContentType(*avatar) + } + existingContact.ContactAvatar = types.ContactAvatar{ + Image: *avatar, + ContentType: contentType, + Hash: avatarHash, + } + } + + log.Debug().Msg("storing contact") + storeErr := cli.Store.ContactStore.StoreContact(ctx, *existingContact) + if storeErr != nil { + log.Err(storeErr).Msg("error storing contact") + return existingContact, storeErr + } + return existingContact, nil } -func (cli *Client) fetchContactThenTryAndUpdateWithProfile(ctx context.Context, aci uuid.UUID, refreshAfter time.Duration) (*types.Recipient, error) { +func (cli *Client) fetchContactThenTryAndUpdateWithProfile(ctx context.Context, profileUUID uuid.UUID) (*types.Contact, error) { log := zerolog.Ctx(ctx).With(). Str("action", "fetch contact then try and update with profile"). - Stringer("profile_aci", aci). + Stringer("profile_uuid", profileUUID). Logger() - ctx = log.WithContext(ctx) + contactChanged := false - profile, err := cli.RetrieveProfileByID(ctx, aci, refreshAfter) + existingContact, err := cli.Store.ContactStore.LoadContact(ctx, profileUUID) if err != nil { - log.Debug().Err(err).Msg("Failed to fetch profile") - // Continue to return contact without profile + log.Err(err).Msg("error loading contact") + return nil, err } - return cli.Store.RecipientStore.LoadAndUpdateRecipient(ctx, aci, uuid.Nil, func(recipient *types.Recipient) (changed bool, err error) { - if profile != nil { - // Don't bother saving every fetched timestamp to the database, but save if anything else changed - if !recipient.Profile.Equals(profile) || recipient.Profile.FetchedAt.IsZero() { - changed = true - } - recipient.Profile = *profile + if existingContact == nil { + log.Debug().Msg("creating new contact") + existingContact = &types.Contact{ + UUID: profileUUID, } - return - }) + contactChanged = true + } else { + log.Debug().Msg("updating existing contact") + } + profile, err := cli.RetrieveProfileByID(ctx, profileUUID) + if err != nil { + log.Err(err).Msg("error retrieving profile") + //return nil, nil, err + // Don't return here, we still want to return what we have + } + + if profile != nil { + if existingContact.ProfileName != profile.Name { + existingContact.ProfileName = profile.Name + contactChanged = true + } + if existingContact.ProfileAbout != profile.About { + existingContact.ProfileAbout = profile.About + contactChanged = true + } + if existingContact.ProfileAboutEmoji != profile.AboutEmoji { + existingContact.ProfileAboutEmoji = profile.AboutEmoji + contactChanged = true + } + if existingContact.ProfileAvatarPath != profile.AvatarPath { + existingContact.ProfileAvatarPath = profile.AvatarPath + contactChanged = true + } + if existingContact.ProfileKey == nil || *existingContact.ProfileKey != profile.Key { + existingContact.ProfileKey = &profile.Key + contactChanged = true + } + } + + if contactChanged { + err := cli.Store.ContactStore.StoreContact(ctx, *existingContact) + if err != nil { + log.Err(err).Msg("error storing contact") + return nil, err + } + } + return existingContact, nil } -func (cli *Client) ContactByACI(ctx context.Context, aci uuid.UUID) (*types.Recipient, error) { - return cli.fetchContactThenTryAndUpdateWithProfile(ctx, aci, DefaultProfileRefreshAfter) +func (cli *Client) UpdateContactE164(ctx context.Context, uuid uuid.UUID, e164 string) error { + log := zerolog.Ctx(ctx).With(). + Str("action", "update contact e164"). + Stringer("uuid", uuid). + Str("e164", e164). + Logger() + existingContact, err := cli.Store.ContactStore.LoadContact(ctx, uuid) + if err != nil { + log.Err(err).Msg("error loading contact") + return err + } + if existingContact == nil { + log.Debug().Msg("creating new contact") + existingContact = &types.Contact{ + UUID: uuid, + } + } else { + log.Debug().Msg("found existing contact") + } + if existingContact.E164 == e164 { + return nil + } + log.Debug().Msg("e164 changed for contact") + existingContact.E164 = e164 + return cli.Store.ContactStore.StoreContact(ctx, *existingContact) } -func (cli *Client) ContactByACIWithRefreshAfter(ctx context.Context, aci uuid.UUID, refreshAfter time.Duration) (*types.Recipient, error) { - return cli.fetchContactThenTryAndUpdateWithProfile(ctx, aci, refreshAfter) +func (cli *Client) ContactByID(ctx context.Context, uuid uuid.UUID) (*types.Contact, error) { + return cli.fetchContactThenTryAndUpdateWithProfile(ctx, uuid) } -func (cli *Client) ContactByE164(ctx context.Context, e164 string) (*types.Recipient, error) { - contact, err := cli.Store.RecipientStore.LoadRecipientByE164(ctx, e164) +func (cli *Client) ContactByE164(ctx context.Context, e164 string) (*types.Contact, error) { + contact, err := cli.Store.ContactStore.LoadContactByE164(ctx, e164) if err != nil { zerolog.Ctx(ctx).Err(err).Msg("ContactByE164 error loading contact") return nil, err @@ -113,9 +196,7 @@ func (cli *Client) ContactByE164(ctx context.Context, e164 string) (*types.Recip if contact == nil { return nil, nil } - if contact.ACI != uuid.Nil { - contact, err = cli.fetchContactThenTryAndUpdateWithProfile(ctx, contact.ACI, DefaultProfileRefreshAfter) - } + contact, err = cli.fetchContactThenTryAndUpdateWithProfile(ctx, contact.UUID) return contact, err } diff --git a/pkg/signalmeow/contactdiscovery.go b/pkg/signalmeow/contactdiscovery.go index 14b7fd6..5d5bce2 100644 --- a/pkg/signalmeow/contactdiscovery.go +++ b/pkg/signalmeow/contactdiscovery.go @@ -27,22 +27,20 @@ import ( "sync" "time" - "github.com/coder/websocket" "github.com/google/uuid" "github.com/rs/zerolog" "github.com/tidwall/gjson" "go.mau.fi/util/exerrors" "google.golang.org/protobuf/proto" + "nhooyr.io/websocket" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/cds2pb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) -// ProdContactDiscoveryMrenclave should always match ENCLAVE_ID_CDSI_PROD from libsignal -// https://github.com/signalapp/libsignal/blob/main/rust/attest/src/constants.rs#L69 -const ProdContactDiscoveryMrenclave = "15637fa1e54fe655176d3df1a9f94b87c01ed377acaa570682dc5d72c95ef07b" const ProdContactDiscoveryServer = "cdsi.signal.org" +const ProdContactDiscoveryMrenclave = "0f6fd79cdfdaa5b2e6337f534d3baf999318b0c462a7ac1f41297a3e4b424a57" const ContactDiscoveryAuthTTL = 23 * time.Hour const rateLimitCloseCode = websocket.StatusCode(4008) @@ -83,11 +81,13 @@ func (cli *Client) LookupPhone(ctx context.Context, e164s ...uint64) (ContactDis } ctx, cancel := context.WithTimeout(ctx, 20*time.Second) defer cancel() - resp, token, err := cli.doContactDiscovery(ctx, &cds2pb.ClientRequest{ + resp, token, err := cli.doContactDiscovery(ctx, &signalpb.CDSClientRequest{ // TODO figure out if tokens are useful // (it's meant for old_e164s) //Token: cli.cdToken, NewE164S: requestData, + + ReturnAcisWithoutUaks: proto.Bool(true), }) if token != nil { cli.cdToken = token @@ -95,7 +95,7 @@ func (cli *Client) LookupPhone(ctx context.Context, e164s ...uint64) (ContactDis return resp, err } -func (cli *Client) doContactDiscovery(ctx context.Context, req *cds2pb.ClientRequest) (ContactDiscoveryResponse, []byte, error) { +func (cli *Client) doContactDiscovery(ctx context.Context, req *signalpb.CDSClientRequest) (ContactDiscoveryResponse, []byte, error) { creds, err := cli.getContactDiscoveryCredentials(ctx) if err != nil { return nil, nil, fmt.Errorf("failed to fetch contact discovery auth: %w", err) @@ -113,7 +113,7 @@ func (cli *Client) doContactDiscovery(ctx context.Context, req *cds2pb.ClientReq Path: path.Join("v1", ProdContactDiscoveryMrenclave, "discovery"), }).String() log.Trace().Msg("Connecting to contact discovery websocket") - ws, _, err := web.OpenWebsocket(ctx, addr) + ws, _, err := web.OpenWebsocketURL(ctx, addr) if err != nil { var closeErr websocket.CloseError if errors.As(err, &closeErr) && closeErr.Code == rateLimitCloseCode { @@ -187,7 +187,7 @@ func (cdc *ContactDiscoveryClient) Handshake(ctx context.Context) error { return nil } -func (cdc *ContactDiscoveryClient) SendRequest(ctx context.Context, req *cds2pb.ClientRequest) error { +func (cdc *ContactDiscoveryClient) SendRequest(ctx context.Context, req *signalpb.CDSClientRequest) error { plaintext, err := proto.Marshal(req) if err != nil { return fmt.Errorf("failed to marshal request: %w", err) @@ -224,15 +224,15 @@ func (cdc *ContactDiscoveryClient) handleResponse(ctx context.Context, msg []byt if err != nil { return fmt.Errorf("failed to decrypt message: %w", err) } - var cdsClientResp cds2pb.ClientResponse + var cdsClientResp signalpb.CDSClientResponse err = proto.Unmarshal(decrypted, &cdsClientResp) if err != nil { return fmt.Errorf("failed to unmarshal message: %w", err) } if cdsClientResp.Token != nil { cdc.Token = cdsClientResp.Token - err = cdc.SendRequest(ctx, &cds2pb.ClientRequest{ - TokenAck: true, + err = cdc.SendRequest(ctx, &signalpb.CDSClientRequest{ + TokenAck: proto.Bool(true), }) if err != nil { return fmt.Errorf("failed to send token ack request: %w", err) diff --git a/pkg/signalmeow/devicename.go b/pkg/signalmeow/devicename.go index 03e4a9c..c22e94d 100644 --- a/pkg/signalmeow/devicename.go +++ b/pkg/signalmeow/devicename.go @@ -29,7 +29,8 @@ import ( "google.golang.org/protobuf/proto" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + 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 475ac02..6fa73fb 100644 --- a/pkg/signalmeow/events/message.go +++ b/pkg/signalmeow/events/message.go @@ -19,8 +19,7 @@ package events import ( "github.com/google/uuid" - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/types" ) @@ -28,24 +27,17 @@ 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 (*Receipt) isSignalEvent() {} +func (*ReadSelf) isSignalEvent() {} +func (*Call) isSignalEvent() {} +func (*ContactList) isSignalEvent() {} type MessageInfo struct { Sender uuid.UUID ChatID string - GroupRevision uint32 - ServerTimestamp uint64 + GroupRevision uint32 } type ChatEvent struct { @@ -53,20 +45,13 @@ type ChatEvent struct { Event signalpb.ChatEventContent } -type DecryptionError struct { - Sender uuid.UUID - Err error - Timestamp uint64 -} - type Receipt struct { Sender uuid.UUID Content *signalpb.ReceiptMessage } type ReadSelf struct { - Timestamp uint64 - Messages []*signalpb.SyncMessage_Read + Messages []*signalpb.SyncMessage_Read } type Call struct { @@ -76,28 +61,5 @@ type Call struct { } type ContactList struct { - Contacts []*types.Recipient - IsFromDB bool + Contacts []*types.Contact } - -type ACIFound struct { - PNI libsignalgo.ServiceID - ACI libsignalgo.ServiceID -} - -type DeleteForMe struct { - Timestamp uint64 - *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 cafe4d3..d485264 100644 --- a/pkg/signalmeow/groups.go +++ b/pkg/signalmeow/groups.go @@ -1,5 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2023 Scott Weber, Malte Eggers +// Copyright (C) 2023 Scott Weber // // 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 @@ -21,7 +21,6 @@ import ( "encoding/base64" "encoding/hex" "encoding/json" - "errors" "fmt" "io" "net/http" @@ -31,13 +30,10 @@ 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" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/types" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) @@ -51,29 +47,16 @@ const ( GroupMember_ADMINISTRATOR GroupMemberRole = 2 ) -type AccessControl int32 - -const ( - AccessControl_UNKNOWN AccessControl = 0 - AccessControl_ANY AccessControl = 1 - AccessControl_MEMBER AccessControl = 2 - AccessControl_ADMINISTRATOR AccessControl = 3 - AccessControl_UNSATISFIABLE AccessControl = 4 -) - type GroupMember struct { - ACI uuid.UUID + UserID uuid.UUID Role GroupMemberRole ProfileKey libsignalgo.ProfileKey JoinedAtRevision uint32 -} - -func (gm *GroupMember) UserServiceID() libsignalgo.ServiceID { - return libsignalgo.NewACIServiceID(gm.ACI) + //Presentation []byte } type Group struct { - GroupMasterKey types.SerializedGroupMasterKey // We should keep this relatively private + groupMasterKey types.SerializedGroupMasterKey // We should keep this relatively private GroupIdentifier types.GroupIdentifier // This is what we should use to identify a group outside this file Title string @@ -83,239 +66,12 @@ type Group struct { AnnouncementsOnly bool Revision uint32 DisappearingMessagesDuration uint32 - AccessControl *GroupAccessControl - PendingMembers []*PendingMember - RequestingMembers []*RequestingMember - BannedMembers []*BannedMember - InviteLinkPassword *types.SerializedInviteLinkPassword //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") - } - masterKeyBytes := masterKeyToBytes(group.GroupMasterKey) - inviteLinkPasswordBytes, err := inviteLinkPasswordToBytes(*group.InviteLinkPassword) - if err != nil { - return "", fmt.Errorf("couldn't decode invite link password") - } - inviteLinkContents := signalpb.GroupInviteLink_ContentsV1{ - ContentsV1: &signalpb.GroupInviteLink_GroupInviteLinkContentsV1{ - GroupMasterKey: masterKeyBytes[:], - InviteLinkPassword: inviteLinkPasswordBytes, - }, - } - inviteLink := signalpb.GroupInviteLink{Contents: &inviteLinkContents} - inviteLinkEncoded, err := proto.Marshal(&inviteLink) - if err != nil { - return "", fmt.Errorf("failed to marshal invite link") - } - inviteLinkPath := base64.URLEncoding.EncodeToString(inviteLinkEncoded) - 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 - Attributes AccessControl -} - -type AddMember struct { - GroupMember - JoinFromInviteLink bool -} - -type PendingMember struct { - ServiceID libsignalgo.ServiceID - Role GroupMemberRole - AddedByUserID uuid.UUID - Timestamp uint64 -} - -type ProfileKeyMember struct { - ACI uuid.UUID - ProfileKey libsignalgo.ProfileKey -} - -type RequestingMember struct { - ACI uuid.UUID - ProfileKey libsignalgo.ProfileKey - Timestamp uint64 -} - -type PromotePendingMember struct { - ACI uuid.UUID - ProfileKey libsignalgo.ProfileKey -} - -type PromotePendingPniAciMember struct { - ACI uuid.UUID - ProfileKey libsignalgo.ProfileKey - PNI uuid.UUID -} - -type RoleMember struct { - ACI uuid.UUID - Role GroupMemberRole -} - -type BannedMember struct { - ServiceID libsignalgo.ServiceID - Timestamp uint64 -} - -type GroupChange struct { - GroupMasterKey types.SerializedGroupMasterKey - SourceServiceID libsignalgo.ServiceID - Revision uint32 - AddMembers []*AddMember - DeleteMembers []*uuid.UUID - ModifyMemberRoles []*RoleMember - ModifyMemberProfileKeys []*ProfileKeyMember - AddPendingMembers []*PendingMember - DeletePendingMembers []*libsignalgo.ServiceID - PromotePendingMembers []*PromotePendingMember - ModifyTitle *string - ModifyAvatar *string - ModifyDisappearingMessagesDuration *uint32 - ModifyAttributesAccess *AccessControl - ModifyMemberAccess *AccessControl - ModifyAddFromInviteLinkAccess *AccessControl - AddRequestingMembers []*RequestingMember - DeleteRequestingMembers []*uuid.UUID - PromoteRequestingMembers []*RoleMember - ModifyDescription *string - ModifyAnnouncementsOnly *bool - AddBannedMembers []*BannedMember - DeleteBannedMembers []*libsignalgo.ServiceID - PromotePendingPniAciMembers []*PromotePendingPniAciMember - ModifyInviteLinkPassword *types.SerializedInviteLinkPassword -} - -func (groupChange *GroupChange) isEmpty() bool { - return len(groupChange.AddMembers) == 0 && - len(groupChange.DeleteMembers) == 0 && - len(groupChange.ModifyMemberRoles) == 0 && - len(groupChange.ModifyMemberProfileKeys) == 0 && - len(groupChange.AddPendingMembers) == 0 && - len(groupChange.PromotePendingMembers) == 0 && - groupChange.ModifyTitle == nil && - groupChange.ModifyAvatar == nil && - groupChange.ModifyDisappearingMessagesDuration == nil && - groupChange.ModifyAttributesAccess == nil && - groupChange.ModifyMemberAccess == nil && - groupChange.ModifyAddFromInviteLinkAccess == nil && - len(groupChange.AddRequestingMembers) == 0 && - len(groupChange.DeleteRequestingMembers) == 0 && - len(groupChange.PromoteRequestingMembers) == 0 && - groupChange.ModifyDescription == nil && - groupChange.ModifyAnnouncementsOnly == nil && - len(groupChange.AddBannedMembers) == 0 -} - -func (groupChange *GroupChange) resolveConflict(group *Group) { - if *groupChange.ModifyTitle == group.Title { - groupChange.ModifyTitle = nil - } - if *groupChange.ModifyDescription == group.Description { - groupChange.ModifyDescription = nil - } - if *groupChange.ModifyAvatar == group.AvatarPath { - groupChange.ModifyAvatar = nil - } - if *groupChange.ModifyDisappearingMessagesDuration == group.DisappearingMessagesDuration { - groupChange.ModifyDisappearingMessagesDuration = nil - } - if *groupChange.ModifyAttributesAccess == group.AccessControl.Attributes { - groupChange.ModifyAttributesAccess = nil - } - if *groupChange.ModifyMemberAccess == group.AccessControl.Members { - groupChange.ModifyAttributesAccess = nil - } - if *groupChange.ModifyAddFromInviteLinkAccess == group.AccessControl.AddFromInviteLink { - groupChange.ModifyAddFromInviteLinkAccess = nil - } - if *groupChange.ModifyAnnouncementsOnly == group.AnnouncementsOnly { - groupChange.ModifyAnnouncementsOnly = nil - } - members := make(map[uuid.UUID]GroupMemberRole) - for _, member := range group.Members { - members[member.ACI] = member.Role - } - pendingMembers := make(map[libsignalgo.ServiceID]bool) - for _, pendingMember := range group.PendingMembers { - pendingMembers[pendingMember.ServiceID] = true - } - requestingMembers := make(map[uuid.UUID]bool) - for _, requestingMember := range group.RequestingMembers { - requestingMembers[requestingMember.ACI] = true - } - for i, member := range groupChange.AddMembers { - if _, ok := members[member.GroupMember.ACI]; ok { - groupChange.AddMembers = append(groupChange.AddMembers[:i], groupChange.AddMembers[i+1:]...) - } - } - for i, promotePendingMember := range groupChange.PromotePendingMembers { - if _, ok := members[promotePendingMember.ACI]; ok { - groupChange.PromotePendingMembers = append(groupChange.PromotePendingMembers[:i], groupChange.PromotePendingMembers[i+1:]...) - } - } - for i, promoteRequestingMember := range groupChange.PromotePendingMembers { - if _, ok := members[promoteRequestingMember.ACI]; ok { - groupChange.PromoteRequestingMembers = append(groupChange.PromoteRequestingMembers[:i], groupChange.PromoteRequestingMembers[i+1:]...) - } - } - for i, pendingMember := range groupChange.AddPendingMembers { - if pendingMembers[pendingMember.ServiceID] { - groupChange.AddPendingMembers = append(groupChange.AddPendingMembers[:i], groupChange.AddPendingMembers[i+1:]...) - } - } - for i, requestingMember := range groupChange.AddRequestingMembers { - if requestingMembers[requestingMember.ACI] { - groupChange.AddRequestingMembers = append(groupChange.AddRequestingMembers[:i], groupChange.AddRequestingMembers[i+1:]...) - } - } - for i, deletePendingMember := range groupChange.DeletePendingMembers { - if !pendingMembers[*deletePendingMember] { - groupChange.DeletePendingMembers = append(groupChange.DeletePendingMembers[:i], groupChange.DeletePendingMembers[i+1:]...) - } - } - for i, deleteRequestingMember := range groupChange.DeleteRequestingMembers { - if !requestingMembers[*deleteRequestingMember] { - groupChange.DeleteRequestingMembers = append(groupChange.DeleteRequestingMembers[:i], groupChange.DeleteRequestingMembers[i+1:]...) - } - } - for i, deleteMember := range groupChange.DeleteMembers { - if _, ok := members[*deleteMember]; !ok { - groupChange.DeleteMembers = append(groupChange.DeleteMembers[:i], groupChange.DeleteMembers[i+1:]...) - } - } - for i, modifyMemberRole := range groupChange.ModifyMemberRoles { - if members[modifyMemberRole.ACI] == modifyMemberRole.Role { - groupChange.ModifyMemberRoles = append(groupChange.ModifyMemberRoles[:i], groupChange.ModifyMemberRoles[i+1:]...) - } - } -} - -type GroupChangeState struct { - GroupState *Group - GroupChange *GroupChange + //AccessControl *AccessControl + //PendingMembers []*PendingMember + //RequestingMembers []*RequestingMember + //InviteLinkPassword []byte + //BannedMembers []*BannedMember } type GroupAuth struct { @@ -328,8 +84,9 @@ func (cli *Client) fetchNewGroupCreds(ctx context.Context, today time.Time) (*Gr Str("action", "fetch new group creds"). 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) + path := fmt.Sprintf("/v1/certificate/auth/group?redemptionStartSeconds=%d&redemptionEndSeconds=%d", today.Unix(), sevenDaysOut.Unix()) + 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 +100,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) @@ -421,30 +207,29 @@ func masterKeyFromBytes(masterKey libsignalgo.GroupMasterKey) types.SerializedGr return types.SerializedGroupMasterKey(base64.StdEncoding.EncodeToString(masterKey[:])) } -func inviteLinkPasswordToBytes(inviteLinkPassword types.SerializedInviteLinkPassword) ([]byte, error) { - inviteLinkPasswordBytes, err := base64.StdEncoding.DecodeString((string(inviteLinkPassword))) - if err != nil { - return nil, err - } - return inviteLinkPasswordBytes, nil -} - -func InviteLinkPasswordFromBytes(inviteLinkPassword []byte) types.SerializedInviteLinkPassword { - return types.SerializedInviteLinkPassword(base64.StdEncoding.EncodeToString(inviteLinkPassword)) -} - func groupIdentifierFromMasterKey(masterKey types.SerializedGroupMasterKey) (types.GroupIdentifier, error) { - groupIdentifier, err := masterKeyToBytes(masterKey).GroupIdentifier() + groupSecretParams, err := libsignalgo.DeriveGroupSecretParamsFromMasterKey(masterKeyToBytes(masterKey)) if err != nil { - return "", err + return "", fmt.Errorf("DeriveGroupSecretParamsFromMasterKey error: %w", err) } - return types.BytesToGroupIdentifier(groupIdentifier), nil + // Get the "group identifier" that isn't just the master key + groupPublicParams, err := groupSecretParams.GetPublicParams() + if err != nil { + return "", fmt.Errorf("GetPublicParams error: %w", err) + } + groupIdentifier, err := libsignalgo.GetGroupIdentifier(*groupPublicParams) + if err != nil { + return "", fmt.Errorf("GetGroupIdentifier error: %w", err) + } + base64GroupIdentifier := base64.StdEncoding.EncodeToString(groupIdentifier[:]) + gid := types.GroupIdentifier(base64GroupIdentifier) + return gid, nil } func decryptGroup(ctx context.Context, encryptedGroup *signalpb.Group, groupMasterKey types.SerializedGroupMasterKey) (*Group, error) { log := zerolog.Ctx(ctx).With().Str("action", "decrypt group").Logger() decryptedGroup := &Group{ - GroupMasterKey: groupMasterKey, + groupMasterKey: groupMasterKey, } groupSecretParams, err := libsignalgo.DeriveGroupSecretParamsFromMasterKey(masterKeyToBytes(groupMasterKey)) @@ -470,7 +255,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,71 +267,35 @@ 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 + decryptedGroup.Members = make([]*GroupMember, 0) for _, member := range encryptedGroup.Members { if member == nil { continue } - decryptedMember, err := decryptMember(ctx, member, groupSecretParams) - if err != nil { - return nil, err - } - decryptedGroup.Members = append(decryptedGroup.Members, decryptedMember) - } - - for _, pendingMember := range encryptedGroup.MembersPendingProfileKey { - if pendingMember == nil { - continue - } - decryptedPendingMember, err := decryptPendingMember(ctx, pendingMember, groupSecretParams) - if err != nil { - continue - // decryptPendingMember returns an error if the userID is a PNI, keep decrypting - } - decryptedGroup.PendingMembers = append(decryptedGroup.PendingMembers, decryptedPendingMember) - } - - for _, requestingMember := range encryptedGroup.MembersPendingAdminApproval { - if requestingMember == nil { - continue - } - decryptedRequestingMember, err := decryptRequestingMember(ctx, requestingMember, groupSecretParams) - if err != nil { - return nil, err - } - decryptedGroup.RequestingMembers = append(decryptedGroup.RequestingMembers, decryptedRequestingMember) - } - - for _, bannedMember := range encryptedGroup.MembersBanned { - if bannedMember == nil { - continue - } - encryptedUserID := libsignalgo.UUIDCiphertext(bannedMember.UserId) - serviceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) + encryptedUserID := libsignalgo.UUIDCiphertext(member.UserId) + userID, err := groupSecretParams.DecryptUUID(encryptedUserID) if err != nil { log.Err(err).Msg("DecryptUUID UserId error") return nil, err } - decryptedGroup.BannedMembers = append(decryptedGroup.BannedMembers, &BannedMember{ - ServiceID: serviceID, - Timestamp: bannedMember.Timestamp, + encryptedProfileKey := libsignalgo.ProfileKeyCiphertext(member.ProfileKey) + profileKey, err := groupSecretParams.DecryptProfileKey(encryptedProfileKey, userID) + if err != nil { + log.Err(err).Msg("DecryptProfileKey ProfileKey error") + return nil, err + } + decryptedGroup.Members = append(decryptedGroup.Members, &GroupMember{ + UserID: userID, + ProfileKey: *profileKey, + Role: GroupMemberRole(member.Role), + JoinedAtRevision: member.JoinedAtRevision, }) } - if encryptedGroup.AccessControl != nil { - decryptedGroup.AccessControl = &GroupAccessControl{ - Members: (AccessControl)(encryptedGroup.AccessControl.Members), - Attributes: (AccessControl)(encryptedGroup.AccessControl.Attributes), - AddFromInviteLink: (AccessControl)(encryptedGroup.AccessControl.AddFromInviteLink), - } - } - if len(encryptedGroup.InviteLinkPassword) > 0 { - inviteLinkPassword := InviteLinkPasswordFromBytes(encryptedGroup.InviteLinkPassword) - decryptedGroup.InviteLinkPassword = &inviteLinkPassword - } return decryptedGroup, nil } @@ -563,18 +312,6 @@ func decryptGroupPropertyIntoBlob(groupSecretParams libsignalgo.GroupSecretParam return &propertyBlob, nil } -func encryptBlobIntoGroupProperty(groupSecretParams libsignalgo.GroupSecretParams, attributeBlob *signalpb.GroupAttributeBlob) (*[]byte, error) { - decryptedProperty, err := proto.Marshal(attributeBlob) - if err != nil { - return nil, fmt.Errorf("error marshalling groupProperty: %w", err) - } - encryptedProperty, err := groupSecretParams.EncryptBlobWithPaddingDeterministic(libsignalgo.GenerateRandomness(), decryptedProperty, 0) - if err != nil { - return nil, fmt.Errorf("error encrypting blob with padding: %w", err) - } - return &encryptedProperty, nil -} - func cleanupStringProperty(property string) string { // strip non-printable characters from the string property = strings.Map(cleanupStringMapping, property) @@ -605,7 +342,7 @@ func decryptGroupAvatar(encryptedAvatar []byte, groupMasterKey types.SerializedG } func groupMetadataForDataMessage(group Group) *signalpb.GroupContextV2 { - masterKey := masterKeyToBytes(group.GroupMasterKey) + masterKey := masterKeyToBytes(group.groupMasterKey) masterKeyBytes := masterKey[:] return &signalpb.GroupContextV2{ MasterKey: masterKeyBytes, @@ -619,12 +356,8 @@ 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) -} - -func (cli *Client) fetchGroupWithMasterKey(ctx context.Context, groupMasterKey types.SerializedGroupMasterKey) (*Group, error) { masterKeyBytes := masterKeyToBytes(groupMasterKey) groupAuth, err := cli.GetAuthorizationForToday(ctx, masterKeyBytes) if err != nil { @@ -634,47 +367,33 @@ 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, "/v1/groups", opts) if err != nil { return nil, err } if response.StatusCode != 200 { - return nil, fmt.Errorf("unexpected response status: %d", response.StatusCode) + return nil, fmt.Errorf("fetchGroupByID SendHTTPRequest bad status: %d", response.StatusCode) } - return cli.parseGroupResponse(ctx, response, groupMasterKey) -} - -func (cli *Client) parseGroupResponse(ctx context.Context, response *http.Response, masterKey types.SerializedGroupMasterKey) (*Group, error) { - var groupResponse signalpb.GroupResponse + var encryptedGroup signalpb.Group groupBytes, err := io.ReadAll(response.Body) if err != nil { return nil, err } - err = proto.Unmarshal(groupBytes, &groupResponse) + err = proto.Unmarshal(groupBytes, &encryptedGroup) if err != nil { return nil, fmt.Errorf("failed to unmarshal group: %w", err) } - group, err := decryptGroup(ctx, groupResponse.Group, masterKey) + group, err := decryptGroup(ctx, &encryptedGroup, groupMasterKey) 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 { - err = cli.Store.RecipientStore.StoreProfileKey(ctx, member.ACI, member.ProfileKey) - if err != nil { - return nil, fmt.Errorf("failed to store profile key: %w", err) - } - } - for _, requestingMember := range group.RequestingMembers { - err = cli.Store.RecipientStore.StoreProfileKey(ctx, requestingMember.ACI, requestingMember.ProfileKey) + err = cli.Store.ProfileKeyStore.StoreProfileKey(ctx, member.UserID, member.ProfileKey) if err != nil { return nil, fmt.Errorf("failed to store profile key: %w", err) } @@ -682,14 +401,14 @@ func (cli *Client) parseGroupResponse(ctx context.Context, response *http.Respon return group, nil } -func (cli *Client) DownloadGroupAvatar(ctx context.Context, avatarPath string, groupMasterKey types.SerializedGroupMasterKey) ([]byte, error) { +func (cli *Client) DownloadGroupAvatar(ctx context.Context, group *Group) ([]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, group.AvatarPath, opts) if err != nil { return nil, fmt.Errorf("failed to send request: %w", err) } @@ -701,28 +420,30 @@ func (cli *Client) DownloadGroupAvatar(ctx context.Context, avatarPath string, g return nil, fmt.Errorf("failed to read response: %w", err) } - decrypted, err := decryptGroupAvatar(encryptedAvatar, groupMasterKey) + decrypted, err := decryptGroupAvatar(encryptedAvatar, group.groupMasterKey) if err != nil { return nil, fmt.Errorf("failed to decrypt avatar: %w", err) } 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, @@ -735,1098 +456,41 @@ func (cli *Client) StoreMasterKey(ctx context.Context, groupMasterKey types.Seri } err = cli.Store.GroupStore.StoreMasterKey(ctx, groupIdentifier, groupMasterKey) if err != nil { - return groupIdentifier, fmt.Errorf("StoreMasterKey error: %w", err) + return "", fmt.Errorf("StoreMasterKey error: %w", err) } return groupIdentifier, nil } -func (cli *Client) DecryptGroupChange(ctx context.Context, groupContext *signalpb.GroupContextV2) (*GroupChange, error) { - masterKeyBytes := libsignalgo.GroupMasterKey(groupContext.MasterKey) - groupMasterKey := masterKeyFromBytes(masterKeyBytes) - - groupChangeBytes := groupContext.GroupChange - encryptedGroupChange := &signalpb.GroupChange{} - err := proto.Unmarshal(groupChangeBytes, encryptedGroupChange) - if err != nil { - return nil, fmt.Errorf("Error unmarshalling group change: %w", err) +// 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 + } } - return cli.decryptGroupChange(ctx, encryptedGroupChange, groupMasterKey, true) + cli.GroupCache.activeCalls[gid] = callID + return true } -func (cli *Client) decryptGroupChange(ctx context.Context, encryptedGroupChange *signalpb.GroupChange, groupMasterKey types.SerializedGroupMasterKey, verifySignature bool) (*GroupChange, error) { - 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 { - err = libsignalgo.ServerPublicParamsVerifySignature(prodServerPublicParams, encryptedActionsBytes, libsignalgo.NotarySignature(serverSignature)) - if err != nil { - return nil, fmt.Errorf("Failed to verify Server Signature: %w", err) +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), } } - - encryptedActions := signalpb.GroupChange_Actions{} - - err = proto.Unmarshal(encryptedActionsBytes, &encryptedActions) - if err != nil { - return nil, fmt.Errorf("Error unmashalling group change actions: %w", err) - } - - groupSecretParams, err := libsignalgo.DeriveGroupSecretParamsFromMasterKey(masterKeyToBytes(groupMasterKey)) - if err != nil { - log.Err(err).Msg("DeriveGroupSecretParamsFromMasterKey error") - return nil, err - } - - sourceServiceID, err := groupSecretParams.DecryptServiceID(libsignalgo.UUIDCiphertext(encryptedActions.SourceUserId)) - if err != nil { - log.Err(err).Msg("Couldn't decrypt source serviceID") - return nil, err - } - decryptedGroupChange := &GroupChange{ - GroupMasterKey: groupMasterKey, - Revision: encryptedActions.Version, - SourceServiceID: sourceServiceID, - } - - if encryptedActions.ModifyTitle != nil { - titleBlob, err := decryptGroupPropertyIntoBlob(groupSecretParams, encryptedActions.ModifyTitle.Title) - if err != nil { - return nil, err - } - // The actual title is in the blob - newTitle := cleanupStringProperty(titleBlob.GetTitle()) - decryptedGroupChange.ModifyTitle = &newTitle - } - if encryptedActions.ModifyAvatar != nil { - decryptedGroupChange.ModifyAvatar = &encryptedActions.ModifyAvatar.Avatar - } - if encryptedActions.ModifyDescription != nil { - descriptionBlob, err := decryptGroupPropertyIntoBlob(groupSecretParams, encryptedActions.ModifyDescription.Description) - if err == nil { - // treat a failure in obtaining the description as non-fatal - newDescription := cleanupStringProperty(descriptionBlob.GetDescriptionText()) - decryptedGroupChange.ModifyDescription = &newDescription - } - } - - for _, addMember := range encryptedActions.AddMembers { - if addMember == nil { - continue - } - decryptedMember, err := decryptMember(ctx, addMember.Added, groupSecretParams) - if err != nil { - return nil, err - } - decryptedGroupChange.AddMembers = append(decryptedGroupChange.AddMembers, &AddMember{ - GroupMember: *decryptedMember, - JoinFromInviteLink: addMember.JoinFromInviteLink, - }) - err = cli.Store.RecipientStore.StoreProfileKey(ctx, decryptedMember.ACI, decryptedMember.ProfileKey) - if err != nil { - log.Err(err).Msg("failed to store profile key") - return nil, err - } - } - - for _, deleteMember := range encryptedActions.DeleteMembers { - if deleteMember == nil { - continue - } - encryptedUserID := libsignalgo.UUIDCiphertext(deleteMember.DeletedUserId) - serviceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for deleteMember") - return nil, err - } - if serviceID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("wrong ServiceID kind for delete member: expected ACI, got PNI") - } - decryptedGroupChange.DeleteMembers = append(decryptedGroupChange.DeleteMembers, &serviceID.UUID) - } - - for _, modifyMemberRole := range encryptedActions.ModifyMemberRoles { - encryptedUserID := libsignalgo.UUIDCiphertext(modifyMemberRole.UserId) - serviceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for modifyMemberRole") - return nil, err - } - if serviceID.Type != libsignalgo.ServiceIDTypeACI { - return nil, fmt.Errorf("wrong ServiceID kind for modify member: expected ACI, got PNI") - } - decryptedGroupChange.ModifyMemberRoles = append(decryptedGroupChange.ModifyMemberRoles, &RoleMember{ - ACI: serviceID.UUID, - Role: GroupMemberRole(modifyMemberRole.Role), - }) - } - - for _, modifyProfileKey := range encryptedActions.ModifyMemberProfileKeys { - if modifyProfileKey == nil { - continue - } - aci, profileKey, err := decryptPKeyAndIDorPresentation(ctx, modifyProfileKey.UserId, modifyProfileKey.ProfileKey, modifyProfileKey.Presentation, groupSecretParams) - if err != nil { - return nil, err - } - decryptedGroupChange.ModifyMemberProfileKeys = append(decryptedGroupChange.ModifyMemberProfileKeys, &ProfileKeyMember{ - ACI: *aci, - ProfileKey: *profileKey, - }) - err = cli.Store.RecipientStore.StoreProfileKey(ctx, *aci, *profileKey) - if err != nil { - log.Err(err).Msg("failed to store profile key") - return nil, err - } - } - - for _, addPendingMember := range encryptedActions.AddMembersPendingProfileKey { - if addPendingMember == nil { - continue - } - pendingMember := addPendingMember.Added - decryptedPendingMember, err := decryptPendingMember(ctx, pendingMember, groupSecretParams) - if err != nil { - continue - // decryptPendingMember returns an error if the userID is a PNI, keep decrypting - } - decryptedGroupChange.AddPendingMembers = append(decryptedGroupChange.AddPendingMembers, decryptedPendingMember) - } - - for _, deletePendingMember := range encryptedActions.DeleteMembersPendingProfileKey { - if deletePendingMember == nil { - continue - } - encryptedUserID := libsignalgo.UUIDCiphertext(deletePendingMember.DeletedUserId) - userID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for deletePendingMember") - return nil, err - } - decryptedGroupChange.DeletePendingMembers = append(decryptedGroupChange.DeletePendingMembers, &userID) - } - - for _, promotePendingMember := range encryptedActions.PromoteMembersPendingProfileKey { - if promotePendingMember == nil { - continue - } - aci, profileKey, err := decryptPKeyAndIDorPresentation(ctx, promotePendingMember.UserId, promotePendingMember.ProfileKey, promotePendingMember.Presentation, groupSecretParams) - if err != nil { - return nil, err - } - decryptedGroupChange.PromotePendingMembers = append(decryptedGroupChange.PromotePendingMembers, &PromotePendingMember{ - ACI: *aci, - ProfileKey: *profileKey, - }) - err = cli.Store.RecipientStore.StoreProfileKey(ctx, *aci, *profileKey) - if err != nil { - log.Err(err).Msg("failed to store profile key") - return nil, err - } - } - - for _, promotePendingPniAciMember := range encryptedActions.PromoteMembersPendingPniAciProfileKey { - // 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 - } - aci, profileKey, err := decryptPKeyAndIDorPresentation(ctx, promotePendingPniAciMember.UserId, promotePendingPniAciMember.ProfileKey, promotePendingPniAciMember.Presentation, groupSecretParams) - if err != nil { - return nil, err - } - encryptedUserID := libsignalgo.UUIDCiphertext(promotePendingPniAciMember.Pni) - pniServiceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID Pni error for promotePendingPniAciMember") - return nil, err - } - if pniServiceID.Type != libsignalgo.ServiceIDTypePNI { - return nil, fmt.Errorf("wrong ServiceID kind for promote pending pni->aci: expected PNI, got ACI") - } - decryptedGroupChange.PromotePendingPniAciMembers = append(decryptedGroupChange.PromotePendingPniAciMembers, &PromotePendingPniAciMember{ - ACI: *aci, - ProfileKey: *profileKey, - PNI: pniServiceID.UUID, - }) - err = cli.Store.RecipientStore.StoreProfileKey(ctx, *aci, *profileKey) - if err != nil { - log.Err(err).Msg("failed to store profile key") - return nil, err - } - } - - for _, addRequestingMember := range encryptedActions.AddMembersPendingAdminApproval { - if addRequestingMember == nil { - continue - } - decryptedRequestingMember, err := decryptRequestingMember(ctx, addRequestingMember.Added, groupSecretParams) - if err != nil { - return nil, err - } - decryptedGroupChange.AddRequestingMembers = append(decryptedGroupChange.AddRequestingMembers, decryptedRequestingMember) - err = cli.Store.RecipientStore.StoreProfileKey(ctx, decryptedRequestingMember.ACI, decryptedRequestingMember.ProfileKey) - if err != nil { - log.Err(err).Msg("failed to store profile key") - return nil, err - } - } - - for _, deleteRequestingMember := range encryptedActions.DeleteMembersPendingAdminApproval { - if deleteRequestingMember == nil { - continue - } - encryptedUserID := libsignalgo.UUIDCiphertext(deleteRequestingMember.DeletedUserId) - serviceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for deleteRequestingMember") - return nil, err - } - decryptedGroupChange.DeleteRequestingMembers = append(decryptedGroupChange.DeleteRequestingMembers, &serviceID.UUID) - } - - for _, promoteRequestingMember := range encryptedActions.PromoteMembersPendingAdminApproval { - if promoteRequestingMember == nil { - continue - } - encryptedUserID := libsignalgo.UUIDCiphertext(promoteRequestingMember.UserId) - serviceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for promoteRequestingMember") - return nil, err - } - decryptedGroupChange.PromoteRequestingMembers = append(decryptedGroupChange.PromoteRequestingMembers, &RoleMember{ - ACI: serviceID.UUID, - Role: GroupMemberRole(promoteRequestingMember.Role), - }) - } - - for _, addBannedMember := range encryptedActions.AddMembersBanned { - if addBannedMember == nil { - continue - } - bannedMember := addBannedMember.Added - encryptedUserID := libsignalgo.UUIDCiphertext(bannedMember.UserId) - serviceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for addBannedMember") - return nil, err - } - decryptedGroupChange.AddBannedMembers = append(decryptedGroupChange.AddBannedMembers, &BannedMember{ - ServiceID: serviceID, - Timestamp: bannedMember.Timestamp, - }) - } - - for _, deleteBannedMember := range encryptedActions.DeleteMembersBanned { - if deleteBannedMember == nil { - continue - } - encryptedUserID := libsignalgo.UUIDCiphertext(deleteBannedMember.DeletedUserId) - userID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for deleteBannedMember") - return nil, err - } - decryptedGroupChange.DeleteBannedMembers = append(decryptedGroupChange.DeleteBannedMembers, &userID) - } - - if encryptedActions.ModifyAttributesAccess != nil { - decryptedGroupChange.ModifyAttributesAccess = (*AccessControl)(&encryptedActions.ModifyAttributesAccess.AttributesAccess) - } - - if encryptedActions.ModifyMemberAccess != nil { - decryptedGroupChange.ModifyMemberAccess = (*AccessControl)(&encryptedActions.ModifyMemberAccess.MembersAccess) - } - - if encryptedActions.ModifyAddFromInviteLinkAccess != nil { - decryptedGroupChange.ModifyAddFromInviteLinkAccess = (*AccessControl)(&encryptedActions.ModifyAddFromInviteLinkAccess.AddFromInviteLinkAccess) - } - - 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 err != nil { - return nil, err - } - newDisappaeringMessagesDuration := timerBlob.GetDisappearingMessagesDuration() - decryptedGroupChange.ModifyDisappearingMessagesDuration = &newDisappaeringMessagesDuration - } - if encryptedActions.ModifyInviteLinkPassword != nil { - inviteLinkPassword := InviteLinkPasswordFromBytes(encryptedActions.ModifyInviteLinkPassword.InviteLinkPassword) - 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 } -func decryptPKeyAndIDorPresentation(ctx context.Context, userID []byte, profileKeyBytes []byte, presentationBytes []byte, groupSecretParams libsignalgo.GroupSecretParams) (*uuid.UUID, *libsignalgo.ProfileKey, error) { - log := zerolog.Ctx(ctx) - var encryptedUserID libsignalgo.UUIDCiphertext - var encryptedProfileKey libsignalgo.ProfileKeyCiphertext - if len(userID) == 0 || len(profileKeyBytes) == 0 { - presentation := libsignalgo.ProfileKeyCredentialPresentation(presentationBytes) - err := presentation.CheckValidContents() - if err != nil { - log.Err(err).Msg("Invalid presentation contents") - return nil, nil, err - } - encryptedUserID, err = presentation.UUIDCiphertext() - if err != nil { - log.Err(err).Msg("unable to get UUID from presentation") - return nil, nil, err - } - encryptedProfileKey, err = presentation.ProfileKeyCiphertext() - if err != nil { - log.Err(err).Msg("unable to get ProfileKey from presentation") - return nil, nil, err - } - } else { - encryptedUserID = libsignalgo.UUIDCiphertext(userID) - encryptedProfileKey = libsignalgo.ProfileKeyCiphertext(profileKeyBytes) - } - serviceID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("Failed to decrypt ServiceID") - return nil, nil, err - } - profileKey, err := groupSecretParams.DecryptProfileKey(encryptedProfileKey, serviceID.UUID) - if err != nil { - return nil, nil, err - } - if serviceID.Type == libsignalgo.ServiceIDTypePNI { - return nil, nil, fmt.Errorf("wrong serviceid kind for profile key: expected ACI, got PNI") - } - return &serviceID.UUID, profileKey, nil - -} - -func decryptMember(ctx context.Context, member *signalpb.Member, groupSecretParams libsignalgo.GroupSecretParams) (*GroupMember, error) { - aci, profileKey, err := decryptPKeyAndIDorPresentation(ctx, member.UserId, member.ProfileKey, member.Presentation, groupSecretParams) - if err != nil { - return nil, err - } - return &GroupMember{ - ACI: *aci, - ProfileKey: *profileKey, - Role: GroupMemberRole(member.Role), - JoinedAtRevision: member.JoinedAtVersion, - }, nil -} - -func decryptPendingMember(ctx context.Context, pendingMember *signalpb.MemberPendingProfileKey, groupSecretParams libsignalgo.GroupSecretParams) (*PendingMember, error) { - log := zerolog.Ctx(ctx) - encryptedUserID := libsignalgo.UUIDCiphertext(pendingMember.Member.UserId) - userID, err := groupSecretParams.DecryptServiceID(encryptedUserID) - if err != nil { - log.Err(err).Msg("DecryptUUID UserId error for pendingMember") - return nil, err - } - // pendingMembers don't have profile keys - encryptedAddedByUserID := pendingMember.AddedByUserId - addedByServiceId, err := groupSecretParams.DecryptServiceID(libsignalgo.UUIDCiphertext(encryptedAddedByUserID)) - if err != nil { - log.Err(err).Msg("DecryptUUID addedByUserId error for pendingMember") - return nil, err - } - return &PendingMember{ - ServiceID: userID, - Role: GroupMemberRole(pendingMember.Member.Role), - AddedByUserID: addedByServiceId.UUID, - Timestamp: pendingMember.Timestamp, - }, nil -} - -func decryptRequestingMember(ctx context.Context, requestingMember *signalpb.MemberPendingAdminApproval, groupSecretParams libsignalgo.GroupSecretParams) (*RequestingMember, error) { - aci, profileKey, err := decryptPKeyAndIDorPresentation(ctx, requestingMember.UserId, requestingMember.ProfileKey, requestingMember.Presentation, groupSecretParams) - if err != nil { - return nil, err - } - return &RequestingMember{ - ACI: *aci, - ProfileKey: *profileKey, - Timestamp: requestingMember.Timestamp, - }, nil -} - -func (cli *Client) EncryptAndSignGroupChange(ctx context.Context, decryptedGroupChange *GroupChange) (*signalpb.GroupChangeResponse, error) { - log := zerolog.Ctx(ctx).With().Str("action", "EncryptGroupChange").Logger() - groupMasterKey := decryptedGroupChange.GroupMasterKey - masterKeyBytes := masterKeyToBytes(groupMasterKey) - groupSecretParams, err := libsignalgo.DeriveGroupSecretParamsFromMasterKey(masterKeyBytes) - if err != nil { - log.Err(err).Msg("Could not get groupSecretParams from master key") - return nil, err - } - groupChangeActions := &signalpb.GroupChange_Actions{Version: decryptedGroupChange.Revision} - if decryptedGroupChange.ModifyTitle != nil { - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_Title{Title: *decryptedGroupChange.ModifyTitle}} - encryptedTitle, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) - if err != nil { - log.Err(err).Msg("Could not get encrypt Title") - return nil, err - } - groupChangeActions.ModifyTitle = &signalpb.GroupChange_Actions_ModifyTitleAction{Title: *encryptedTitle} - } - if decryptedGroupChange.ModifyDescription != nil { - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_DescriptionText{DescriptionText: *decryptedGroupChange.ModifyDescription}} - encryptedDescription, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) - if err != nil { - log.Err(err).Msg("Could not get encrypt description") - return nil, err - } - groupChangeActions.ModifyDescription = &signalpb.GroupChange_Actions_ModifyDescriptionAction{Description: *encryptedDescription} - } - if decryptedGroupChange.ModifyAvatar != nil { - groupChangeActions.ModifyAvatar = &signalpb.GroupChange_Actions_ModifyAvatarAction{Avatar: *decryptedGroupChange.ModifyAvatar} - } - for _, addMember := range decryptedGroupChange.AddMembers { - encryptedMember, encryptedPendingMember, err := cli.encryptMember(ctx, &addMember.GroupMember, &groupSecretParams) - if err != nil { - log.Err(err).Msg("Failed to encrypt GroupMember") - } - if encryptedMember != nil { - groupChangeActions.AddMembers = append(groupChangeActions.AddMembers, &signalpb.GroupChange_Actions_AddMemberAction{ - Added: encryptedMember, - JoinFromInviteLink: addMember.JoinFromInviteLink, - }) - } else { - groupChangeActions.AddMembersPendingProfileKey = append(groupChangeActions.AddMembersPendingProfileKey, &signalpb.GroupChange_Actions_AddMemberPendingProfileKeyAction{ - Added: encryptedPendingMember, - }) - } - } - for _, deleteMember := range decryptedGroupChange.DeleteMembers { - encryptedUserID, err := groupSecretParams.EncryptServiceID(libsignalgo.NewACIServiceID(*deleteMember)) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for deleteMember") - return nil, err - } - groupChangeActions.DeleteMembers = append(groupChangeActions.DeleteMembers, &signalpb.GroupChange_Actions_DeleteMemberAction{ - DeletedUserId: encryptedUserID[:], - }) - } - for _, modifyMemberRoles := range decryptedGroupChange.ModifyMemberRoles { - encryptedUserID, err := groupSecretParams.EncryptServiceID(libsignalgo.NewACIServiceID(modifyMemberRoles.ACI)) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for modifyMemberRoles") - return nil, err - } - groupChangeActions.ModifyMemberRoles = append(groupChangeActions.ModifyMemberRoles, &signalpb.GroupChange_Actions_ModifyMemberRoleAction{ - UserId: encryptedUserID[:], - Role: signalpb.Member_Role(modifyMemberRoles.Role), - }) - } - for _, addPendingMember := range decryptedGroupChange.AddPendingMembers { - encryptedPendingMember, err := cli.encryptPendingMember(ctx, addPendingMember, &groupSecretParams) - if err != nil { - log.Err(err).Msg("Failed to encrypt pendingMember") - return nil, err - } - groupChangeActions.AddMembersPendingProfileKey = append(groupChangeActions.AddMembersPendingProfileKey, &signalpb.GroupChange_Actions_AddMemberPendingProfileKeyAction{ - Added: encryptedPendingMember, - }) - } - for _, deletePendingMember := range decryptedGroupChange.DeletePendingMembers { - encryptedUserID, err := groupSecretParams.EncryptServiceID(*deletePendingMember) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for deletePendingMember") - return nil, err - } - groupChangeActions.DeleteMembersPendingProfileKey = append(groupChangeActions.DeleteMembersPendingProfileKey, &signalpb.GroupChange_Actions_DeleteMemberPendingProfileKeyAction{ - DeletedUserId: encryptedUserID[:], - }) - } - for _, promotePendingMember := range decryptedGroupChange.PromotePendingMembers { - expiringProfileKeyCredential, err := cli.FetchExpiringProfileKeyCredentialById(ctx, promotePendingMember.ACI) - if err != nil { - log.Err(err).Msg("failed getting expiring profile key credential for addMember") - return nil, err - } - presentation, err := groupSecretParams.CreateExpiringProfileKeyCredentialPresentation( - prodServerPublicParams, - *expiringProfileKeyCredential, - ) - if err != nil { - 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{ - Presentation: *presentation, - }) - } - for _, addRequestingMember := range decryptedGroupChange.AddRequestingMembers { - expiringProfileKeyCredential, err := cli.FetchExpiringProfileKeyCredentialById(ctx, addRequestingMember.ACI) - if err != nil { - log.Err(err).Msg("failed getting expiring profile key credential for addMember") - return nil, err - } - presentation, err := groupSecretParams.CreateExpiringProfileKeyCredentialPresentation( - prodServerPublicParams, - *expiringProfileKeyCredential, - ) - if err != nil { - 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{ - Presentation: *presentation, - }, - }) - } - for _, deleteRequestingMember := range decryptedGroupChange.DeleteRequestingMembers { - encryptedUserID, err := groupSecretParams.EncryptServiceID(libsignalgo.NewACIServiceID(*deleteRequestingMember)) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for deleteRequestingMember") - return nil, err - } - groupChangeActions.DeleteMembersPendingAdminApproval = append(groupChangeActions.DeleteMembersPendingAdminApproval, &signalpb.GroupChange_Actions_DeleteMemberPendingAdminApprovalAction{ - DeletedUserId: encryptedUserID[:], - }) - } - for _, promoteRequestingMember := range decryptedGroupChange.PromoteRequestingMembers { - encryptedUserID, err := groupSecretParams.EncryptServiceID(libsignalgo.NewACIServiceID(promoteRequestingMember.ACI)) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for promoteRequestingMember") - return nil, err - } - - groupChangeActions.PromoteMembersPendingAdminApproval = append(groupChangeActions.PromoteMembersPendingAdminApproval, &signalpb.GroupChange_Actions_PromoteMemberPendingAdminApprovalAction{ - UserId: encryptedUserID[:], - Role: signalpb.Member_Role(promoteRequestingMember.Role), - }) - } - for _, addBannedMember := range decryptedGroupChange.AddBannedMembers { - encryptedUserID, err := groupSecretParams.EncryptServiceID(addBannedMember.ServiceID) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for promoteRequestingMember") - return nil, err - } - groupChangeActions.AddMembersBanned = append(groupChangeActions.AddMembersBanned, &signalpb.GroupChange_Actions_AddMemberBannedAction{ - Added: &signalpb.MemberBanned{ - UserId: encryptedUserID[:], - Timestamp: addBannedMember.Timestamp, - }, - }) - } - for _, deleteBannedMember := range decryptedGroupChange.DeleteBannedMembers { - encryptedUserID, err := groupSecretParams.EncryptServiceID(*deleteBannedMember) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for promoteRequestingMember") - return nil, err - } - groupChangeActions.DeleteMembersBanned = append(groupChangeActions.DeleteMembersBanned, &signalpb.GroupChange_Actions_DeleteMemberBannedAction{ - DeletedUserId: encryptedUserID[:], - }) - } - if decryptedGroupChange.ModifyAnnouncementsOnly != nil { - groupChangeActions.ModifyAnnouncementsOnly = &signalpb.GroupChange_Actions_ModifyAnnouncementsOnlyAction{ - AnnouncementsOnly: *decryptedGroupChange.ModifyAnnouncementsOnly, - } - } - if decryptedGroupChange.ModifyAttributesAccess != nil { - groupChangeActions.ModifyAttributesAccess = &signalpb.GroupChange_Actions_ModifyAttributesAccessControlAction{ - AttributesAccess: signalpb.AccessControl_AccessRequired(*decryptedGroupChange.ModifyAttributesAccess), - } - } - if decryptedGroupChange.ModifyMemberAccess != nil { - groupChangeActions.ModifyMemberAccess = &signalpb.GroupChange_Actions_ModifyMembersAccessControlAction{ - MembersAccess: signalpb.AccessControl_AccessRequired(*decryptedGroupChange.ModifyMemberAccess), - } - } - if decryptedGroupChange.ModifyAddFromInviteLinkAccess != nil { - groupChangeActions.ModifyAddFromInviteLinkAccess = &signalpb.GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction{ - AddFromInviteLinkAccess: signalpb.AccessControl_AccessRequired(*decryptedGroupChange.ModifyAddFromInviteLinkAccess), - } - } - if decryptedGroupChange.ModifyDisappearingMessagesDuration != nil { - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_DisappearingMessagesDuration{DisappearingMessagesDuration: *decryptedGroupChange.ModifyDisappearingMessagesDuration}} - encryptedTimer, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) - if err != nil { - log.Err(err).Msg("Could not get encrypt Title") - return nil, err - } - groupChangeActions.ModifyDisappearingMessageTimer = &signalpb.GroupChange_Actions_ModifyDisappearingMessageTimerAction{Timer: *encryptedTimer} - } - if decryptedGroupChange.ModifyInviteLinkPassword != nil { - inviteLinkPasswordBytes, err := inviteLinkPasswordToBytes(*decryptedGroupChange.ModifyInviteLinkPassword) - if err != nil { - log.Err(err).Msg("Failed to decode invite link password") - } - groupChangeActions.ModifyInviteLinkPassword = &signalpb.GroupChange_Actions_ModifyInviteLinkPasswordAction{ - InviteLinkPassword: inviteLinkPasswordBytes, - } - } - - return cli.patchGroup(ctx, groupChangeActions, groupMasterKey, nil) -} - -func (cli *Client) encryptMember(ctx context.Context, member *GroupMember, groupSecretParams *libsignalgo.GroupSecretParams) (*signalpb.Member, *signalpb.MemberPendingProfileKey, error) { - log := zerolog.Ctx(ctx) - expiringProfileKeyCredential, err := cli.FetchExpiringProfileKeyCredentialById(ctx, member.ACI) - if err != nil { - log.Err(err).Msg("failed getting expiring profile key credential for member, trying to encrypt as PendingMember") - pendingMember := PendingMember{ - ServiceID: member.UserServiceID(), - Role: member.Role, - AddedByUserID: cli.Store.ACI, - } - encryptedPendingMember, err := cli.encryptPendingMember(ctx, &pendingMember, groupSecretParams) - return nil, encryptedPendingMember, err - } - presentation, err := groupSecretParams.CreateExpiringProfileKeyCredentialPresentation( - prodServerPublicParams, - *expiringProfileKeyCredential, - ) - if err != nil { - log.Err(err).Msg("failed creating expiring profile key credential presentation for addMember") - return nil, nil, err - } - encryptedMember := signalpb.Member{ - Presentation: *presentation, - Role: signalpb.Member_Role(member.Role), - } - return &encryptedMember, nil, nil -} - -func (cli *Client) encryptPendingMember(ctx context.Context, pendingMember *PendingMember, groupSecretParams *libsignalgo.GroupSecretParams) (*signalpb.MemberPendingProfileKey, error) { - log := zerolog.Ctx(ctx) - encryptedUserID, err := groupSecretParams.EncryptServiceID(pendingMember.ServiceID) - if err != nil { - log.Err(err).Msg("Encrypt UserId error for addPendingMember") - return nil, err - } - encryptedAddedByUserID, err := groupSecretParams.EncryptServiceID(libsignalgo.NewACIServiceID(pendingMember.AddedByUserID)) - if err != nil { - log.Err(err).Msg("Encrypt AddedByUserId error for addPendingMember") - return nil, err - } - encryptedPendingMember := signalpb.MemberPendingProfileKey{ - AddedByUserId: encryptedAddedByUserID[:], - Member: &signalpb.Member{ - UserId: encryptedUserID[:], - Role: signalpb.Member_Role(pendingMember.Role), - }, - } - return &encryptedPendingMember, nil -} - -var ( - NoContentError = RespError{Err: "NoContentError"} - GroupPatchNotAcceptedError = RespError{Err: "GroupPatchNotAcceptedError"} - ConflictError = RespError{Err: "ConflictError"} - AuthorizationFailedError = RespError{Err: "AuthorizationFailedError"} - NotFoundError = RespError{Err: "NotFoundError"} - ContactManifestMismatchError = RespError{Err: "ContactManifestMismatchError"} - RateLimitError = RespError{Err: "RateLimitError"} - DeprecatedVersionError = RespError{Err: "DeprecatedVersionError"} - GroupExistsError = RespError{Err: "GroupExistsError"} -) - -type RespError struct { - Err string -} - -func (e RespError) Error() string { - return e.Err -} - -func (cli *Client) patchGroup(ctx context.Context, groupChange *signalpb.GroupChange_Actions, groupMasterKey types.SerializedGroupMasterKey, groupLinkPassword []byte) (*signalpb.GroupChangeResponse, error) { - log := zerolog.Ctx(ctx).With().Str("action", "patchGroup").Logger() - groupAuth, err := cli.GetAuthorizationForToday(ctx, masterKeyToBytes(groupMasterKey)) - if err != nil { - log.Err(err).Msg("Failed to get Authorization for today") - return nil, err - } - var path string - if groupLinkPassword == nil { - path = "/v2/groups/" - } else { - path = fmt.Sprintf("/v2/groups/?inviteLinkPassword=%s", base64.StdEncoding.EncodeToString(groupLinkPassword)) - } - requestBody, err := proto.Marshal(groupChange) - if err != nil { - log.Err(err).Msg("Failed to marshal request") - return nil, err - } - opts := &web.HTTPReqOpt{ - Username: &groupAuth.Username, - Password: &groupAuth.Password, - ContentType: web.ContentTypeProtobuf, - Body: requestBody, - } - resp, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodPatch, path, opts) - defer web.CloseBody(resp) - if err != nil { - return nil, fmt.Errorf("SendRequest error: %w", err) - } - switch resp.StatusCode { - case http.StatusNoContent: - return nil, NoContentError - case http.StatusBadRequest: - return nil, GroupPatchNotAcceptedError - case http.StatusForbidden: - return nil, AuthorizationFailedError - case http.StatusNotFound: - return nil, NotFoundError - case http.StatusConflict: - if resp.Body != nil { - return nil, ContactManifestMismatchError - } else { - return nil, ConflictError - } - case http.StatusTooManyRequests: - return nil, RateLimitError - case 499: - return nil, DeprecatedVersionError - } - if resp.Body == nil { - return nil, errors.New("no response body") - } - body, err := io.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("failed to read storage manifest response: %w", err) - } - var changeResp signalpb.GroupChangeResponse - err = proto.Unmarshal(body, &changeResp) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal signed groupChange: %w", err) - } - 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) - if err != nil { - return 0, fmt.Errorf("failed to fetch group info to update: %w", err) - } - if group.InviteLinkPassword == nil && groupChange.ModifyAddFromInviteLinkAccess != nil && groupChange.ModifyInviteLinkPassword != nil { - groupChange.ModifyInviteLinkPassword = ptr.Ptr(GenerateInviteLinkPassword()) - } - groupChange.Revision = group.Revision + 1 - for attempt := 0; ; attempt++ { - signedGroupChange, err = cli.EncryptAndSignGroupChange(ctx, groupChange) - if err == nil { - break - } else if attempt >= 5 { - return 0, fmt.Errorf("failed to encrypt and sign group change after multiple retries: %w", err) - } else if errors.Is(err, GroupPatchNotAcceptedError) { - log.Err(err).Msg("Failed to apply group change, retrying...") - if len(groupChange.AddMembers) > 0 && !refetchedAddMemberCredentials { - refetchedAddMemberCredentials = true - // change = refetchAddMemberCredentials(change); TODO - } else { - 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) - if err != nil { - return 0, fmt.Errorf("failed to fetch group after conflict: %w", err) - } - groupChange.resolveConflict(group) - if groupChange.isEmpty() { - log.Debug().Msg("Change is empty after conflict resolution") - } - groupChange.Revision = group.Revision + 1 - } else { - return 0, fmt.Errorf("unknown error encrypting and signing group change: %w", err) - } - } - 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) - } - groupContext := &signalpb.GroupContextV2{ - Revision: &groupChange.Revision, - GroupChange: groupChangeBytes, - MasterKey: masterKeyBytes[:], - } - _, err = cli.SendGroupUpdate(ctx, group, groupContext, groupChange) - if err != nil { - log.Err(err).Msg("Error sending GroupChange to group members") - } - return groupChange.Revision, nil -} - -func (cli *Client) EncryptGroup(ctx context.Context, decryptedGroup *Group, groupSecretParams libsignalgo.GroupSecretParams) (*signalpb.Group, error) { - log := zerolog.Ctx(ctx) - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_Title{Title: decryptedGroup.Title}} - encryptedTitle, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) - if err != nil { - log.Err(err).Msg("Could not get encrypt Title") - return nil, err - } - groupPublicParams, err := groupSecretParams.GetPublicParams() - if err != nil { - log.Err(err).Msg("Couldn't get public params from GroupSecretParams") - return nil, err - } - encryptedGroup := &signalpb.Group{ - PublicKey: groupPublicParams[:], - Title: *encryptedTitle, - AvatarUrl: decryptedGroup.AvatarPath, - AnnouncementsOnly: decryptedGroup.AnnouncementsOnly, - Version: 0, - } - if decryptedGroup.Description != "" { - attributeBlob := signalpb.GroupAttributeBlob{Content: &signalpb.GroupAttributeBlob_DescriptionText{DescriptionText: decryptedGroup.Description}} - encryptedDescription, err := encryptBlobIntoGroupProperty(groupSecretParams, &attributeBlob) - if err != nil { - log.Err(err).Msg("Could not get encrypt Description") - return nil, err - } - encryptedGroup.Description = *encryptedDescription - } - if decryptedGroup.AccessControl != nil { - encryptedGroup.AccessControl = &signalpb.AccessControl{ - Members: signalpb.AccessControl_AccessRequired(decryptedGroup.AccessControl.Members), - Attributes: signalpb.AccessControl_AccessRequired(decryptedGroup.AccessControl.Attributes), - AddFromInviteLink: signalpb.AccessControl_AccessRequired(decryptedGroup.AccessControl.AddFromInviteLink), - } - if decryptedGroup.AccessControl.AddFromInviteLink != AccessControl_UNSATISFIABLE { - encryptedGroup.InviteLinkPassword = random.Bytes(16) - } - } - for _, member := range decryptedGroup.Members { - encryptedMember, encryptedPendingMember, err := cli.encryptMember(ctx, member, &groupSecretParams) - if err != nil { - log.Err(err).Msg("Failed to encrypt GroupMember") - } - if encryptedMember != nil { - encryptedGroup.Members = append(encryptedGroup.Members, encryptedMember) - } else { - encryptedGroup.MembersPendingProfileKey = append(encryptedGroup.MembersPendingProfileKey, encryptedPendingMember) - } - } - for _, pendingMember := range decryptedGroup.PendingMembers { - encryptedPendingMember, err := cli.encryptPendingMember(ctx, pendingMember, &groupSecretParams) - if err != nil { - log.Err(err).Msg("Failed to encrypt pendingMember") - return nil, err - } - encryptedGroup.MembersPendingProfileKey = append(encryptedGroup.MembersPendingProfileKey, encryptedPendingMember) - } - return encryptedGroup, nil -} - -func PrepareGroupCreation(decryptedGroup *Group) (libsignalgo.GroupMasterKey, error) { - var masterKeyBytes libsignalgo.GroupMasterKey - if decryptedGroup.GroupMasterKey == "" { - masterKeyBytes = libsignalgo.GroupMasterKey(random.Bytes(32)) - decryptedGroup.GroupMasterKey = masterKeyFromBytes(masterKeyBytes) - } else { - masterKeyBytes = masterKeyToBytes(decryptedGroup.GroupMasterKey) - } - if decryptedGroup.GroupIdentifier == "" { - var err error - decryptedGroup.GroupIdentifier, err = groupIdentifierFromMasterKey(decryptedGroup.GroupMasterKey) - if err != nil { - return masterKeyBytes, err - } - } - return masterKeyBytes, nil -} - -func (cli *Client) createGroupOnServer(ctx context.Context, decryptedGroup *Group) (*Group, error) { - log := zerolog.Ctx(ctx).With().Str("action", "CreateGroupOnServer").Logger() - masterKeyBytes, err := PrepareGroupCreation(decryptedGroup) - if err != nil { - return nil, err - } - err = cli.Store.GroupStore.StoreMasterKey(ctx, decryptedGroup.GroupIdentifier, decryptedGroup.GroupMasterKey) - if err != nil { - return nil, fmt.Errorf("StoreMasterKey error: %w", err) - } - groupSecretParams, err := libsignalgo.DeriveGroupSecretParamsFromMasterKey(masterKeyBytes) - if err != nil { - log.Err(err).Msg("DeriveGroupSecretParamsFromMasterKey error") - return nil, err - } - encryptedGroup, err := cli.EncryptGroup(ctx, decryptedGroup, groupSecretParams) - if err != nil { - log.Err(err).Msg("Failed to encrypt group") - return nil, err - } - groupAuth, err := cli.GetAuthorizationForToday(ctx, masterKeyBytes) - if err != nil { - log.Err(err).Msg("Failed to get Authorization for today") - return nil, err - } - path := "/v2/groups/" - requestBody, err := proto.Marshal(encryptedGroup) - if err != nil { - log.Err(err).Msg("Failed to marshal request") - return nil, err - } - opts := &web.HTTPReqOpt{ - Username: &groupAuth.Username, - Password: &groupAuth.Password, - ContentType: web.ContentTypeProtobuf, - Body: requestBody, - } - resp, err := web.SendHTTPRequest(ctx, web.StorageHostname, http.MethodPut, path, opts) - defer web.CloseBody(resp) - if err != nil { - return nil, fmt.Errorf("SendRequest error: %w", err) - } - switch resp.StatusCode { - case http.StatusNoContent: - return nil, NoContentError - case http.StatusForbidden: - return nil, AuthorizationFailedError - case http.StatusNotFound: - return nil, NotFoundError - case http.StatusConflict: - return nil, GroupExistsError - case http.StatusTooManyRequests: - return nil, RateLimitError - case 499: - return nil, DeprecatedVersionError - case http.StatusBadRequest: - return nil, fmt.Errorf("failed to put new group: bad request") - } - return cli.parseGroupResponse(ctx, resp, decryptedGroup.GroupMasterKey) -} - -func GenerateInviteLinkPassword() types.SerializedInviteLinkPassword { - return InviteLinkPasswordFromBytes(random.Bytes(16)) -} - -func (cli *Client) CreateGroup(ctx context.Context, decryptedGroup *Group) (*Group, error) { - log := zerolog.Ctx(ctx).With().Str("action", "CreateGroup").Logger() - group, err := cli.createGroupOnServer(ctx, decryptedGroup) - if err != nil { - log.Err(err).Msg("Error creating group on server") - return nil, err - } - masterKeyBytes := masterKeyToBytes(group.GroupMasterKey) - groupContext := &signalpb.GroupContextV2{Revision: &group.Revision, MasterKey: masterKeyBytes[:]} - _, err = cli.SendGroupUpdate(ctx, group, groupContext, nil) - if err != nil { - log.Err(err).Msg("Error sending GroupUpdate to group members") - return nil, err - } - return group, nil -} - -func (cli *Client) GetGroupHistoryPage(ctx context.Context, gid types.GroupIdentifier, fromRevision uint32, includeFirstState bool) ([]*GroupChangeState, error) { - log := zerolog.Ctx(ctx).With().Str("action", "GetGroupHistoryPage").Logger() - groupMasterKey, err := cli.Store.GroupStore.MasterKeyFromGroupIdentifier(ctx, gid) - if err != nil { - log.Err(err).Msg("Failed to get group master key") - return nil, err - } - if groupMasterKey == "" { - return nil, ErrGroupMasterKeyNotFound - } - masterKeyBytes := masterKeyToBytes(groupMasterKey) - groupAuth, err := cli.GetAuthorizationForToday(ctx, masterKeyBytes) - if err != nil { - return nil, err - } - opts := &web.HTTPReqOpt{ - Username: &groupAuth.Username, - Password: &groupAuth.Password, - ContentType: web.ContentTypeProtobuf, - Headers: map[string]string{ - // TODO actually cache the data and provide real expiry timestamp - "Cached-Send-Endorsements": "0", - }, - } - // 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) - if err != nil { - return nil, err - } - if response.StatusCode != 200 { - return nil, fmt.Errorf("unexpected response status: %d", response.StatusCode) - } - var encryptedGroupChanges signalpb.GroupChanges - groupChangesBytes, err := io.ReadAll(response.Body) - if err != nil { - return nil, err - } - err = proto.Unmarshal(groupChangesBytes, &encryptedGroupChanges) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal group: %w", err) - } - - groupChanges, err := cli.decryptGroupChanges(ctx, &encryptedGroupChanges, groupMasterKey) - if err != nil { - return nil, fmt.Errorf("failed to decrypt group: %w", err) - } - return groupChanges, nil -} - -func (cli *Client) decryptGroupChanges(ctx context.Context, encryptedGroupChanges *signalpb.GroupChanges, groupMasterKey types.SerializedGroupMasterKey) ([]*GroupChangeState, error) { - log := zerolog.Ctx(ctx).With().Str("action", "decryptGroupChanges").Logger() - var groupChanges []*GroupChangeState - for _, groupChangeState := range encryptedGroupChanges.GroupChanges { - var group *Group - var err error - // GroupState == nil is normal, except for first and last, depending on the parameters it was fetched with - if groupChangeState.GroupState != nil { - group, err = decryptGroup(ctx, groupChangeState.GroupState, groupMasterKey) - if err != nil { - log.Err(err).Msg("Failed to decrypt Group") - return nil, err - } - } - var groupChange *GroupChange - // GroupChange shouldn't be nil - if it is, something will probably go wrong - if groupChangeState.GroupChange == nil { - return nil, fmt.Errorf("received group change state without group change") - } - groupChange, err = cli.decryptGroupChange(ctx, groupChangeState.GroupChange, groupMasterKey, false) - if err != nil { - log.Err(err).Msg("Failed to decrypt GroupChange") - return nil, err - } - groupChanges = append(groupChanges, &GroupChangeState{ - GroupState: group, - GroupChange: groupChange, - }) - } - return groupChanges, nil +type GroupCache struct { + groups map[types.GroupIdentifier]*Group + lastFetched map[types.GroupIdentifier]time.Time + activeCalls map[types.GroupIdentifier]string } diff --git a/pkg/signalmeow/keys.go b/pkg/signalmeow/keys.go index 5439755..48a70a9 100644 --- a/pkg/signalmeow/keys.go +++ b/pkg/signalmeow/keys.go @@ -20,18 +20,17 @@ import ( "context" "encoding/base64" "encoding/json" - "errors" "fmt" - "math/rand/v2" + "math/rand" "net/http" "strings" "time" + "github.com/google/uuid" "github.com/rs/zerolog" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/events" - "go.mau.fi/mautrix-signal/pkg/signalmeow/store" + "go.mau.fi/mautrix-signal/pkg/signalmeow/types" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) @@ -43,22 +42,39 @@ type GeneratedPreKeys struct { IdentityKey []uint8 } -func (cli *Client) RegisterAllPreKeys(ctx context.Context, pks store.PreKeyStore) error { +func (cli *Client) GenerateAndRegisterPreKeys(ctx context.Context, uuidKind types.UUIDKind) error { + _, err := cli.GenerateAndSaveNextPreKeyBatch(ctx, uuidKind) + if err != nil { + return fmt.Errorf("failed to generate and save next prekey batch: %w", err) + } + _, err = cli.GenerateAndSaveNextKyberPreKeyBatch(ctx, uuidKind) + 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, uuidKind) + if err != nil { + return fmt.Errorf("failed to register prekey batches: %w", err) + } + + return err +} + +func (cli *Client) RegisterAllPreKeys(ctx context.Context, uuidKind types.UUIDKind) error { var identityKeyPair *libsignalgo.IdentityKeyPair - var pni bool - if pks.GetServiceID().Type == libsignalgo.ServiceIDTypePNI { - pni = true + if uuidKind == types.UUIDKindPNI { identityKeyPair = cli.Store.PNIIdentityKeyPair } else { identityKeyPair = cli.Store.ACIIdentityKeyPair } // Get all prekeys and kyber prekeys from the database - preKeys, err := pks.AllPreKeys(ctx) + preKeys, err := cli.Store.PreKeyStoreExtras.AllPreKeys(ctx, uuidKind) if err != nil { return fmt.Errorf("failed to get all prekeys: %w", err) } - kyberPreKeys, err := pks.AllNormalKyberPreKeys(ctx) + kyberPreKeys, err := cli.Store.PreKeyStoreExtras.AllNormalKyberPreKeys(ctx, uuidKind) if err != nil { return fmt.Errorf("failed to get all kyber prekeys: %w", err) } @@ -78,117 +94,78 @@ 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 := cli.Store.Number + if cli.Store.ACI != uuid.Nil { + preKeyUsername = cli.Store.ACI.String() + } + preKeyUsername = fmt.Sprintf("%s.%d", preKeyUsername, 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, uuidKind, preKeyUsername, cli.Store.Password) if err != nil { return fmt.Errorf("failed to register prekeys: %w", err) } + // Mark prekeys as registered + // (kyber prekeys don't have "mark as uploaded" we just assume they always are) + // TODO: we don't need to mark prekeys as uploaded, since we just upload all unused prekeys each time. + // So we can drop this column and remove these methods + lastPreKeyID, err := preKeys[len(preKeys)-1].GetID() + if err != nil { + return fmt.Errorf("failed to get last prekey ID: %w", err) + } + err = cli.Store.PreKeyStoreExtras.MarkPreKeysAsUploaded(ctx, uuidKind, lastPreKeyID) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to mark prekeys as uploaded") + } + return err } -func (cli *Client) GenerateAndSaveNextPreKeyBatch(ctx context.Context, pks store.PreKeyStore, serverCount int) (bool, error) { - storeCount, nextPreKeyID, err := pks.GetNextPreKeyID(ctx) +func (cli *Client) GenerateAndSaveNextPreKeyBatch(ctx context.Context, uuidKind types.UUIDKind) ([]*libsignalgo.PreKeyRecord, error) { + nextPreKeyID, err := cli.Store.PreKeyStoreExtras.GetNextPreKeyID(ctx, uuidKind) if err != nil { - return false, fmt.Errorf("failed to get next prekey ID: %w", err) + return nil, fmt.Errorf("failed to get next prekey ID: %w", err) } - if serverCount < PREKEY_BATCH_SIZE/2 { - if storeCount >= PREKEY_BATCH_SIZE { - zerolog.Ctx(ctx).Warn(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("Store is full, but server is not, reuploading EC prekeys without generating more") - } else { - zerolog.Ctx(ctx).Info(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("Generating and uploading EC prekeys") - } - } else if uint32(serverCount) > storeCount { - zerolog.Ctx(ctx).Warn(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("Server has more EC prekeys than store, reuploading") - } else { - zerolog.Ctx(ctx).Debug(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("EC prekey count is good") - return false, nil - } - if storeCount < PREKEY_BATCH_SIZE { - preKeys := GeneratePreKeys(nextPreKeyID, PREKEY_BATCH_SIZE-storeCount) - for _, preKey := range preKeys { - err = pks.StorePreKey(ctx, 0, preKey) - if err != nil { - return false, fmt.Errorf("failed to save prekey: %w", err) - } + preKeys := GeneratePreKeys(nextPreKeyID, PREKEY_BATCH_SIZE, uuidKind) + for _, preKey := range preKeys { + err = cli.Store.PreKeyStoreExtras.SavePreKey(ctx, uuidKind, preKey, false) + if err != nil { + return nil, fmt.Errorf("failed to save prekey: %w", err) } } - return true, nil + return preKeys, nil } -func (cli *Client) GenerateAndSaveNextKyberPreKeyBatch(ctx context.Context, pks store.PreKeyStore, serverCount int) (bool, error) { +func (cli *Client) GenerateAndSaveNextKyberPreKeyBatch(ctx context.Context, uuidKind types.UUIDKind) ([]*libsignalgo.KyberPreKeyRecord, error) { var identityKeyPair *libsignalgo.IdentityKeyPair - if pks.GetServiceID().Type == libsignalgo.ServiceIDTypePNI { + if uuidKind == types.UUIDKindPNI { identityKeyPair = cli.Store.PNIIdentityKeyPair } else { identityKeyPair = cli.Store.ACIIdentityKeyPair } - storeCount, nextKyberPreKeyID, err := pks.GetNextKyberPreKeyID(ctx) + nextKyberPreKeyID, err := cli.Store.PreKeyStoreExtras.GetNextKyberPreKeyID(ctx, uuidKind) if err != nil { - return false, fmt.Errorf("failed to get next kyber prekey ID: %w", err) + return nil, fmt.Errorf("failed to get next kyber prekey ID: %w", err) } - if serverCount < PREKEY_BATCH_SIZE/2 { - if storeCount >= PREKEY_BATCH_SIZE { - zerolog.Ctx(ctx).Warn(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("Store is full, but server is not, reuploading kyber prekeys without generating more") - } else { - zerolog.Ctx(ctx).Info(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("Generating and uploading kyber prekeys") - } - } else if uint32(serverCount) > storeCount { - zerolog.Ctx(ctx).Warn(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("Server has more kyber prekeys than store, reuploading") - } else { - zerolog.Ctx(ctx).Debug(). - Int("server_count", serverCount). - Uint32("store_count", storeCount). - Msg("Kyber prekey count is good") - return false, nil - } - if storeCount < PREKEY_BATCH_SIZE { - kyberPreKeys := GenerateKyberPreKeys(nextKyberPreKeyID, PREKEY_BATCH_SIZE-storeCount, identityKeyPair) - for _, kyberPreKey := range kyberPreKeys { - err = pks.StoreKyberPreKey(ctx, 0, kyberPreKey) - if err != nil { - return false, fmt.Errorf("failed to save kyber prekey: %w", err) - } + kyberPreKeys := GenerateKyberPreKeys(nextKyberPreKeyID, PREKEY_BATCH_SIZE, uuidKind, identityKeyPair) + for _, kyberPreKey := range kyberPreKeys { + err = cli.Store.PreKeyStoreExtras.SaveKyberPreKey(ctx, uuidKind, kyberPreKey, false) + if err != nil { + return nil, fmt.Errorf("failed to save kyber prekey: %w", err) } } - return true, nil + return kyberPreKeys, nil } -func GeneratePreKeys(startKeyID uint32, count uint32) []*libsignalgo.PreKeyRecord { - if count > PREKEY_BATCH_SIZE { - panic("count must be less than or equal to PREKEY_BATCH_SIZE") - } - generatedPreKeys := make([]*libsignalgo.PreKeyRecord, 0, count) - for keyID := startKeyID; keyID < startKeyID+count; keyID++ { +func GeneratePreKeys(startKeyId uint, count uint, uuidKind types.UUIDKind) []*libsignalgo.PreKeyRecord { + generatedPreKeys := []*libsignalgo.PreKeyRecord{} + for i := startKeyId; i < startKeyId+count; i++ { privateKey, err := libsignalgo.GeneratePrivateKey() if err != nil { panic(fmt.Errorf("error generating private key: %w", err)) } - preKey, err := libsignalgo.NewPreKeyRecordFromPrivateKey(keyID, privateKey) + preKey, err := libsignalgo.NewPreKeyRecordFromPrivateKey(uint32(i), privateKey) if err != nil { panic(fmt.Errorf("error creating prekey record: %w", err)) } @@ -197,12 +174,9 @@ func GeneratePreKeys(startKeyID uint32, count uint32) []*libsignalgo.PreKeyRecor return generatedPreKeys } -func GenerateKyberPreKeys(startKeyID uint32, count uint32, identityKeyPair *libsignalgo.IdentityKeyPair) []*libsignalgo.KyberPreKeyRecord { - if count > PREKEY_BATCH_SIZE { - panic("count must be less than or equal to PREKEY_BATCH_SIZE") - } - generatedKyberPreKeys := make([]*libsignalgo.KyberPreKeyRecord, 0, count) - for keyID := startKeyID; keyID < startKeyID+count; keyID++ { +func GenerateKyberPreKeys(startKeyId uint, count uint, uuidKind types.UUIDKind, identityKeyPair *libsignalgo.IdentityKeyPair) []*libsignalgo.KyberPreKeyRecord { + generatedKyberPreKeys := []*libsignalgo.KyberPreKeyRecord{} + for i := startKeyId; i < startKeyId+count; i++ { kyberPreKeyPair, err := libsignalgo.KyberKeyPairGenerate() if err != nil { panic(fmt.Errorf("error generating kyber key pair: %w", err)) @@ -219,7 +193,7 @@ func GenerateKyberPreKeys(startKeyID uint32, count uint32, identityKeyPair *libs if err != nil { panic(fmt.Errorf("error signing kyber public key: %w", err)) } - preKey, err := libsignalgo.NewKyberPreKeyRecord(keyID, time.Now(), kyberPreKeyPair, signature) + preKey, err := libsignalgo.NewKyberPreKeyRecord(uint32(i), time.Now(), kyberPreKeyPair, signature) if err != nil { panic(fmt.Errorf("error creating kyber prekey record: %w", err)) @@ -229,7 +203,7 @@ func GenerateKyberPreKeys(startKeyID uint32, count uint32, identityKeyPair *libs return generatedKyberPreKeys } -func GenerateSignedPreKey(startSignedKeyId uint32, identityKeyPair *libsignalgo.IdentityKeyPair) *libsignalgo.SignedPreKeyRecord { +func GenerateSignedPreKey(startSignedKeyId uint32, uuidKind types.UUIDKind, identityKeyPair *libsignalgo.IdentityKeyPair) *libsignalgo.SignedPreKeyRecord { // Generate a signed prekey privateKey, err := libsignalgo.GeneratePrivateKey() if err != nil { @@ -256,120 +230,83 @@ func GenerateSignedPreKey(startSignedKeyId uint32, identityKeyPair *libsignalgo. return signedPreKey } -func PreKeyToJSON(preKey *libsignalgo.PreKeyRecord) (map[string]interface{}, error) { - id, err := preKey.GetID() - if err != nil { - return nil, fmt.Errorf("failed to get ID: %w", err) - } - publicKey, err := preKey.GetPublicKey() - if err != nil { - return nil, fmt.Errorf("failed to get public key: %w", err) - } - serializedKey, err := publicKey.Serialize() - if err != nil { - return nil, fmt.Errorf("failed to serialize public key: %w", err) - } +func PreKeyToJSON(preKey *libsignalgo.PreKeyRecord) map[string]interface{} { + id, _ := preKey.GetID() + publicKey, _ := preKey.GetPublicKey() + serializedKey, _ := publicKey.Serialize() preKeyJson := map[string]interface{}{ "keyId": id, "publicKey": base64.StdEncoding.EncodeToString(serializedKey), } - return preKeyJson, nil + return preKeyJson } -func SignedPreKeyToJSON(signedPreKey *libsignalgo.SignedPreKeyRecord) (map[string]interface{}, error) { - id, err := signedPreKey.GetID() - if err != nil { - return nil, fmt.Errorf("failed to get ID: %w", err) - } - publicKey, err := signedPreKey.GetPublicKey() - if err != nil { - return nil, fmt.Errorf("failed to get public key: %w", err) - } - serializedKey, err := publicKey.Serialize() - if err != nil { - return nil, fmt.Errorf("failed to serialize public key: %w", err) - } - signature, err := signedPreKey.GetSignature() - if err != nil { - return nil, fmt.Errorf("failed to get signature: %w", err) - } +func SignedPreKeyToJSON(signedPreKey *libsignalgo.SignedPreKeyRecord) map[string]interface{} { + id, _ := signedPreKey.GetID() + publicKey, _ := signedPreKey.GetPublicKey() + serializedKey, _ := publicKey.Serialize() + signature, _ := signedPreKey.GetSignature() signedPreKeyJson := map[string]interface{}{ "keyId": id, "publicKey": base64.StdEncoding.EncodeToString(serializedKey), "signature": base64.StdEncoding.EncodeToString(signature), } - return signedPreKeyJson, nil + return signedPreKeyJson } -func KyberPreKeyToJSON(kyberPreKey *libsignalgo.KyberPreKeyRecord) (map[string]interface{}, error) { - id, err := kyberPreKey.GetID() - if err != nil { - return nil, fmt.Errorf("failed to get ID: %w", err) - } - publicKey, err := kyberPreKey.GetPublicKey() - if err != nil { - return nil, fmt.Errorf("failed to get public key: %w", err) - } - serializedKey, err := publicKey.Serialize() - if err != nil { - return nil, fmt.Errorf("failed to serialize public key: %w", err) - } - signature, err := kyberPreKey.GetSignature() - if err != nil { - return nil, fmt.Errorf("failed to get signature: %w", err) - } +func KyberPreKeyToJSON(kyberPreKey *libsignalgo.KyberPreKeyRecord) map[string]interface{} { + id, _ := kyberPreKey.GetID() + publicKey, _ := kyberPreKey.GetPublicKey() + serializedKey, _ := publicKey.Serialize() + signature, _ := kyberPreKey.GetSignature() kyberPreKeyJson := map[string]interface{}{ "keyId": id, "publicKey": base64.StdEncoding.EncodeToString(serializedKey), "signature": base64.StdEncoding.EncodeToString(signature), } - return kyberPreKeyJson, nil + return kyberPreKeyJson } -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, uuidKind types.UUIDKind, 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 { - return fmt.Errorf("failed to convert prekey to JSON: %w", err) - } + preKeyJson := PreKeyToJSON(preKey) preKeysJson = append(preKeysJson, preKeyJson) } for _, kyberPreKey := range generatedPreKeys.KyberPreKeys { - kyberPreKeyJson, err := KyberPreKeyToJSON(kyberPreKey) - if err != nil { - return fmt.Errorf("failed to convert kyber prekey to JSON: %w", err) - } + kyberPreKeyJson := KyberPreKeyToJSON(kyberPreKey) kyberPreKeysJson = append(kyberPreKeysJson, kyberPreKeyJson) } 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) + keysPath := "/v2/keys?identity=" + string(uuidKind) + 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, opts) if err != nil { log.Err(err).Msg("Error sending request") return err } - if resp.GetStatus() == 422 { - return errPrekeyUpload422 + defer resp.Body.Close() + // status code not 2xx + 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 +341,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) - } +func (cli *Client) FetchAndProcessPreKey(ctx context.Context, theirUUID uuid.UUID, specificDeviceID int) error { // 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) + path := "/v2/keys/" + theirUUID.String() + deviceIDPath + "?pq=true" + 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 +372,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 { @@ -514,7 +436,7 @@ func (cli *Client) FetchAndProcessPreKey(ctx context.Context, theirServiceID lib if err != nil { return fmt.Errorf("error creating prekey bundle: %w", err) } - address, err := theirServiceID.Address(uint(d.DeviceID)) + address, err := libsignalgo.NewUUIDAddress(theirUUID, uint(d.DeviceID)) if err != nil { return fmt.Errorf("error creating address: %w", err) } @@ -522,9 +444,8 @@ func (cli *Client) FetchAndProcessPreKey(ctx context.Context, theirServiceID lib ctx, preKeyBundle, address, - localAddress, - cli.Store.ACISessionStore, - cli.Store.ACIIdentityStore, + cli.Store.SessionStore, + cli.Store.IdentityStore, ) if err != nil { return fmt.Errorf("error processing prekey bundle: %w", err) @@ -534,57 +455,57 @@ func (cli *Client) FetchAndProcessPreKey(ctx context.Context, theirServiceID lib return err } -const ( - aciKeysPath = "/v2/keys?identity=aci" - pniKeysPath = "/v2/keys?identity=pni" -) - -func keysPath(pni bool) string { - if pni { - return pniKeysPath - } - return aciKeysPath -} - -func (cli *Client) GetMyKeyCounts(ctx context.Context, pni bool) (int, int, error) { +func (cli *Client) GetMyKeyCounts(ctx context.Context, uuidKind types.UUIDKind) (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() + path := "/v2/keys?identity=" + string(uuidKind) + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, path, &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 { +func (cli *Client) CheckAndUploadNewPreKeys(ctx context.Context, uuidKind types.UUIDKind) error { log := zerolog.Ctx(ctx).With().Str("action", "check and upload new prekeys").Logger() // Check if we need to upload prekeys - preKeyCount, kyberPreKeyCount, err := cli.GetMyKeyCounts(ctx, pks.GetServiceID().Type == libsignalgo.ServiceIDTypePNI) + preKeyCount, kyberPreKeyCount, err := cli.GetMyKeyCounts(ctx, uuidKind) if err != nil { log.Err(err).Msg("Error getting prekey counts") return err } - doECUpload, err := cli.GenerateAndSaveNextPreKeyBatch(ctx, pks, preKeyCount) - if err != nil { - log.Err(err).Msg("Error generating and saving next prekey batch") - return err + log.Debug().Int("preKeyCount", preKeyCount).Int("kyberPreKeyCount", kyberPreKeyCount).Msg("Checking prekey counts") + + var preKeys []*libsignalgo.PreKeyRecord + var kyberPreKeys []*libsignalgo.KyberPreKeyRecord + if preKeyCount < 10 { + log.Info().Int("preKeyCount", preKeyCount).Msg("Generating and saving new prekeys") + preKeys, err = cli.GenerateAndSaveNextPreKeyBatch(ctx, uuidKind) + if err != nil { + log.Err(err).Msg("Error generating and saving next prekey batch") + return err + } } - doKyberUpload, err := cli.GenerateAndSaveNextKyberPreKeyBatch(ctx, pks, kyberPreKeyCount) - if err != nil { - log.Err(err).Msg("Error generating and saving next kyber prekey batch") - return err + if kyberPreKeyCount < 10 { + log.Info().Int("kyberPreKeyCount", kyberPreKeyCount).Msg("Generating and saving new kyber prekeys") + kyberPreKeys, err = cli.GenerateAndSaveNextKyberPreKeyBatch(ctx, uuidKind) + if err != nil { + log.Err(err).Msg("Error generating and saving next kyber prekey batch") + return err + } } - if !doECUpload && !doKyberUpload { + if len(preKeys) == 0 && len(kyberPreKeys) == 0 { log.Debug().Msg("No new prekeys to upload") return nil } - err = cli.RegisterAllPreKeys(ctx, pks) + err = cli.RegisterAllPreKeys(ctx, uuidKind) if err != nil { log.Err(err).Msg("Error registering prekey batches") return err @@ -592,55 +513,33 @@ func (cli *Client) CheckAndUploadNewPreKeys(ctx context.Context, pks store.PreKe return nil } -func (cli *Client) keyCheckLoop(ctx context.Context) { +func (cli *Client) StartKeyCheckLoop(ctx context.Context, uuidKind types.UUIDKind) { log := zerolog.Ctx(ctx).With().Str("action", "start key check loop").Logger() + go func() { + // Do the initial check within an hour of starting the loop + window_start := 0 + window_size := 1 + for { + 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") - // Do the initial check in 5-10 minutes after starting the loop - windowStart := 0 - windowSize := 1 - firstRun := true - 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") - } - - select { - case <-ctx.Done(): - return - case <-time.After(checkTime): - 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 - continue - } - err = cli.CheckAndUploadNewPreKeys(ctx, cli.Store.PNIPreKeyStore) - if err != nil { - if errors.Is(err, errPrekeyUpload422) { - log.Err(err).Msg("Got 422 error while uploading PNI prekeys, deleting session") - disconnectErr := cli.ClearKeysAndDisconnect(ctx) - if disconnectErr != nil { - log.Err(disconnectErr).Msg("ClearKeysAndDisconnect error") - } - cli.handleEvent(&events.LoggedOut{Error: err}) - return + select { + case <-ctx.Done(): + return + case <-time.After(check_time): + err := cli.CheckAndUploadNewPreKeys(ctx, uuidKind) + if err != nil { + log.Err(err).Msg("Error checking and uploading new prekeys") + // Retry within half an hour + window_start = 5 + window_size = 25 + continue } - log.Err(err).Msg("Error checking and uploading new prekeys for PNI identity") - // Retry within half an hour - windowStart = 5 - windowSize = 25 - continue + // After a successful check, check again in 36 to 60 hours + window_start = 36 * 60 + window_size = 24 * 60 } - // After a successful check, check again in 36 to 60 hours - windowStart = 36 * 60 - windowSize = 24 * 60 } - } + }() } diff --git a/pkg/signalmeow/misc.go b/pkg/signalmeow/misc.go index 70d3ba5..0c305ee 100644 --- a/pkg/signalmeow/misc.go +++ b/pkg/signalmeow/misc.go @@ -18,12 +18,8 @@ package signalmeow import ( _ "embed" - "errors" - "fmt" - "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/util/exerrors" "go.mau.fi/mautrix-signal/pkg/libsignalgo" ) @@ -44,7 +40,9 @@ type FFILogger struct { logger zerolog.Logger } -func (l FFILogger) Log(level libsignalgo.LogLevel, file string, line uint, message string) { +func (FFILogger) Enabled(target string, level libsignalgo.LogLevel) bool { return true } + +func (l FFILogger) Log(target string, level libsignalgo.LogLevel, file string, line uint, message string) { var evt *zerolog.Event switch level { case libsignalgo.LogLevelError: @@ -62,6 +60,7 @@ func (l FFILogger) Log(level libsignalgo.LogLevel, file string, line uint, messa } evt.Str("component", "libsignal"). + Str("target", target). Str("file", file). Uint("line", line). Msg(message) @@ -69,40 +68,13 @@ 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{} //go:embed prod-server-public-params.dat var prodServerPublicParamsSlice []byte -var prodServerPublicParams *libsignalgo.ServerPublicParams +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 + prodServerPublicParams = libsignalgo.ServerPublicParams(prodServerPublicParamsSlice) } diff --git a/pkg/signalmeow/prod-server-public-params.dat b/pkg/signalmeow/prod-server-public-params.dat index 9391895..bffaafb 100644 Binary files a/pkg/signalmeow/prod-server-public-params.dat and b/pkg/signalmeow/prod-server-public-params.dat differ diff --git a/pkg/signalmeow/profile.go b/pkg/signalmeow/profile.go index a515f5a..69cb240 100644 --- a/pkg/signalmeow/profile.go +++ b/pkg/signalmeow/profile.go @@ -17,10 +17,10 @@ package signalmeow import ( - "bytes" "context" "crypto/aes" "crypto/cipher" + "crypto/rand" "encoding/base64" "encoding/hex" "encoding/json" @@ -29,20 +29,15 @@ import ( "io" "net/http" "strings" - "sync" "time" "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/util/random" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) -const DefaultProfileRefreshAfter = 1 * time.Hour - type Capabilities struct { SenderKey bool `json:"senderKey"` AnnouncementGroup bool `json:"announcementGroup"` @@ -75,11 +70,18 @@ type ProfileResponse struct { //PaymentAddress []byte `json:"paymentAddress"` } +type Profile struct { + Name string + About string + AboutEmoji string + AvatarPath string + Key libsignalgo.ProfileKey +} + type ProfileCache struct { - profiles map[string]*types.Profile + profiles map[string]*Profile errors map[string]*error lastFetched map[string]time.Time - lock sync.RWMutex } func (cli *Client) ProfileKeyCredentialRequest(ctx context.Context, signalACI uuid.UUID) ([]byte, error) { @@ -107,7 +109,7 @@ func (cli *Client) ProfileKeyCredentialRequest(ctx context.Context, signalACI uu } func (cli *Client) ProfileKeyForSignalID(ctx context.Context, signalACI uuid.UUID) (*libsignalgo.ProfileKey, error) { - profileKey, err := cli.Store.RecipientStore.LoadProfileKey(ctx, signalACI) + profileKey, err := cli.Store.ProfileKeyStore.LoadProfileKey(ctx, signalACI) if err != nil { return nil, fmt.Errorf("error getting profile key: %w", err) } @@ -116,77 +118,61 @@ func (cli *Client) ProfileKeyForSignalID(ctx context.Context, signalACI uuid.UUI var errProfileKeyNotFound = errors.New("profile key not found") -func (cli *Client) getCachedProfileByID(signalID uuid.UUID, refreshAfter time.Duration) (*types.Profile, error) { - cli.ProfileCache.lock.RLock() - defer cli.ProfileCache.lock.RUnlock() +func (cli *Client) RetrieveProfileByID(ctx context.Context, signalID uuid.UUID) (*Profile, error) { + if cli.ProfileCache == nil { + cli.ProfileCache = &ProfileCache{ + profiles: make(map[string]*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 lastFetched, ok := cli.ProfileCache.lastFetched[signalID.String()] - if ok && time.Since(lastFetched) < refreshAfter { + if ok && time.Since(lastFetched) < 1*time.Hour { profile, ok := cli.ProfileCache.profiles[signalID.String()] if ok { return profile, nil } err, ok := cli.ProfileCache.errors[signalID.String()] if ok { - return nil, fmt.Errorf("%w: %w", ErrCachedError, *err) + return nil, *err } } - return nil, nil -} - -func (cli *Client) RetrieveProfileByID(ctx context.Context, signalID uuid.UUID, refreshAfter time.Duration) (*types.Profile, error) { - // 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) - if err != nil || profile != nil { - return profile, err - } // If we get here, we don't have a cached profile, so fetch it - profile, err = cli.fetchProfileByID(ctx, signalID) + profile, err := cli.fetchProfileByID(ctx, signalID) if err != nil { // If we get a 401 or 5xx error, we should not retry until the cache expires - if errors.Is(err, ErrProfileUnauthorized) || errors.Is(err, ErrProfileInternalError) { - cli.ProfileCache.lock.Lock() - defer cli.ProfileCache.lock.Unlock() + if strings.HasPrefix(err.Error(), "401") || strings.HasPrefix(err.Error(), "5") { cli.ProfileCache.errors[signalID.String()] = &err cli.ProfileCache.lastFetched[signalID.String()] = time.Now() } return nil, err } + if profile == nil { + return nil, errProfileKeyNotFound + } // If we get here, we have a valid profile, so cache it - cli.ProfileCache.lock.Lock() - defer cli.ProfileCache.lock.Unlock() cli.ProfileCache.profiles[signalID.String()] = profile cli.ProfileCache.lastFetched[signalID.String()] = time.Now() return profile, nil } -func (cli *Client) fetchProfileByID(ctx context.Context, signalID uuid.UUID) (*types.Profile, error) { +func (cli *Client) fetchProfileByID(ctx context.Context, signalID uuid.UUID) (*Profile, error) { + log := zerolog.Ctx(ctx) profileKey, err := cli.ProfileKeyForSignalID(ctx, signalID) if err != nil { return nil, fmt.Errorf("error getting profile key: %w", err) - } else if profileKey == nil { - return nil, errProfileKeyNotFound + } + if profileKey == nil { + log.Warn().Msg("profileKey is nil") + return nil, nil } - credentialRequest, err := cli.ProfileKeyCredentialRequest(ctx, signalID) - if err != nil { - return nil, fmt.Errorf("error getting profile key credential request: %w", err) - } - return cli.fetchProfileWithRequestAndKey(ctx, signalID, credentialRequest, profileKey) -} - -var ( - ErrCachedError = errors.New("cached error") - ErrProfileUnauthorized = errors.New("profile get returned 401") - ErrProfileNotFound = errors.New("profile get returned 404") - ErrProfileInternalError = errors.New("profile get returned") -) - -func (cli *Client) fetchProfileWithRequestAndKey(ctx context.Context, signalID uuid.UUID, credentialRequest []byte, profileKey *libsignalgo.ProfileKey) (*types.Profile, error) { - log := zerolog.Ctx(ctx) profileKeyVersion, err := profileKey.GetProfileKeyVersion(signalID) if err != nil { return nil, fmt.Errorf("error getting profile key version: %w", err) @@ -197,6 +183,12 @@ func (cli *Client) fetchProfileWithRequestAndKey(ctx context.Context, signalID u return nil, fmt.Errorf("error deriving access key: %w", err) } base64AccessKey := base64.StdEncoding.EncodeToString(accessKey[:]) + + credentialRequest, err := cli.ProfileKeyCredentialRequest(ctx, signalID) + if err != nil { + return nil, fmt.Errorf("error getting profile key credential request: %w", err) + } + path := "/v1/profile/" + signalID.String() useUnidentified := profileKeyVersion != nil && accessKey != nil if useUnidentified { @@ -210,41 +202,25 @@ 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()) - if logEvt.Enabled() { - if json.Valid(resp.Body) { - logEvt.RawJSON("response_data", resp.Body) - } else { - logEvt.Str("invalid_response_data", base64.StdEncoding.EncodeToString(resp.Body)) - } - } - logEvt.Msg("Got profile response") + log.Trace().Msg("Got profile response") if *resp.Status < 200 || *resp.Status >= 300 { - if *resp.Status == 401 { - return nil, ErrProfileUnauthorized - } else if *resp.Status == 404 { - return nil, ErrProfileNotFound - } else if *resp.Status >= 500 { - return nil, fmt.Errorf("%w %d", ErrProfileInternalError, *resp.Status) - } - return nil, fmt.Errorf("unexpected status code %d", *resp.Status) + return nil, fmt.Errorf("error getting profile (unsuccessful status code %d)", *resp.Status) } var profileResponse ProfileResponse err = json.Unmarshal(resp.Body, &profileResponse) if err != nil { return nil, fmt.Errorf("error unmarshalling profile response: %w", err) } + var profile Profile if len(profileResponse.Name) > 0 { profile.Name, err = decryptString(profileKey, profileResponse.Name) if err != nil { @@ -265,29 +241,24 @@ func (cli *Client) fetchProfileWithRequestAndKey(ctx context.Context, signalID u return nil, fmt.Errorf("error decrypting profile aboutEmoji: %w", err) } } - // TODO store other metadata fields? - if profileResponse.Avatar == "" { - profile.AvatarPath = "clear" - } else { - profile.AvatarPath = profileResponse.Avatar - } - profile.Credential = profileResponse.Credential + profile.AvatarPath = profileResponse.Avatar profile.Key = *profileKey return &profile, nil } -func (cli *Client) DownloadUserAvatar(ctx context.Context, avatarPath string, profileKey libsignalgo.ProfileKey) ([]byte, error) { +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) } @@ -308,19 +279,25 @@ func decryptBytes(key []byte, encryptedText []byte) ([]byte, error) { } nonce := encryptedText[:NONCE_LENGTH] ciphertext := encryptedText[NONCE_LENGTH:] - decrypted, err := AesgcmDecrypt(key, nonce, ciphertext, []byte{}) + padded, err := AesgcmDecrypt(key, nonce, ciphertext, []byte{}) if err != nil { return nil, err } - return decrypted, nil + paddedLength := len(padded) + plaintextLength := 0 + for i := paddedLength - 1; i >= 0; i-- { + if padded[i] != byte(0) { + plaintextLength = i + 1 + break + } + } + returnString := padded[:plaintextLength] + return returnString, nil } func decryptString(key *libsignalgo.ProfileKey, encryptedText []byte) (string, error) { data, err := decryptBytes(key[:], encryptedText) - if err != nil { - return "", err - } - return string(bytes.TrimRight(data, "\x00")), nil + return string(data), err } func encryptString(key libsignalgo.ProfileKey, plaintext string, paddedLength int) ([]byte, error) { @@ -329,7 +306,8 @@ func encryptString(key libsignalgo.ProfileKey, plaintext string, paddedLength in return nil, errors.New("plaintext longer than paddedLength") } padded := append([]byte(plaintext), make([]byte, paddedLength-inputLength)...) - nonce := random.Bytes(NONCE_LENGTH) + nonce := make([]byte, NONCE_LENGTH) + rand.Read(nonce) keyBytes := key[:] ciphertext, err := AesgcmEncrypt(keyBytes, nonce, padded) if err != nil { @@ -367,43 +345,3 @@ func AesgcmEncrypt(key, nonce, plaintext []byte) ([]byte, error) { } return aesgcm.Seal(nil, nonce, plaintext, nil), nil } - -func (cli *Client) FetchExpiringProfileKeyCredentialById(ctx context.Context, signalACI uuid.UUID) (*libsignalgo.ExpiringProfileKeyCredential, error) { - profileKey, err := cli.ProfileKeyForSignalID(ctx, signalACI) - if err != nil { - return nil, fmt.Errorf("error getting profile key for ACI: %w", err) - } else if profileKey == nil { - return nil, errProfileKeyNotFound - } - requestContext, err := libsignalgo.CreateProfileKeyCredentialRequestContext( - prodServerPublicParams, - signalACI, - *profileKey, - ) - if err != nil { - return nil, fmt.Errorf("error creating profile key credential request context: %w", err) - } - - request, err := requestContext.ProfileKeyCredentialRequestContextGetRequest() - if err != nil { - return nil, fmt.Errorf("error getting profile key credential request: %w", err) - } - - // convert request bytes to hexidecimal representation - hexRequest := hex.EncodeToString(request[:]) - credentialRequest := []byte(hexRequest) - - profile, err := cli.fetchProfileWithRequestAndKey(ctx, signalACI, credentialRequest, profileKey) - if err != nil { - return nil, fmt.Errorf("failed to fetch profile: %w", err) - } - response, err := libsignalgo.NewExpiringProfileKeyCredentialResponse(profile.Credential) - if err != nil { - return nil, fmt.Errorf("failed to get expiring profile key credential response: %w", err) - } - epkc, err := libsignalgo.ReceiveExpiringProfileKeyCredential(prodServerPublicParams, requestContext, response, uint64(time.Now().Unix())) - if err != nil { - return nil, fmt.Errorf("failed to receive expiring profile key credential: %w", err) - } - return epkc, nil -} diff --git a/pkg/signalmeow/protobuf/ContactDiscovery.pb.go b/pkg/signalmeow/protobuf/ContactDiscovery.pb.go new file mode 100644 index 0000000..282d9a8 --- /dev/null +++ b/pkg/signalmeow/protobuf/ContactDiscovery.pb.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: ContactDiscovery.proto + +// Copyright 2021 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CDSClientRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Each ACI/UAK pair is a 32-byte buffer, containing the 16-byte ACI followed + // by its 16-byte UAK. + AciUakPairs []byte `protobuf:"bytes,1,opt,name=aci_uak_pairs,json=aciUakPairs" json:"aci_uak_pairs,omitempty"` + // Each E164 is an 8-byte big-endian number, as 8 bytes. + PrevE164S []byte `protobuf:"bytes,2,opt,name=prev_e164s,json=prevE164s" json:"prev_e164s,omitempty"` + NewE164S []byte `protobuf:"bytes,3,opt,name=new_e164s,json=newE164s" json:"new_e164s,omitempty"` + DiscardE164S []byte `protobuf:"bytes,4,opt,name=discard_e164s,json=discardE164s" json:"discard_e164s,omitempty"` + // If true, the client has more pairs or e164s to send. If false or unset, + // this is the client's last request, and processing should commence. + HasMore *bool `protobuf:"varint,5,opt,name=has_more,json=hasMore" json:"has_more,omitempty"` + // If set, a token which allows rate limiting to discount the e164s in + // the request's prev_e164s, only counting new_e164s. If not set, then + // rate limiting considers both prev_e164s' and new_e164s' size. + Token []byte `protobuf:"bytes,6,opt,name=token" json:"token,omitempty"` + // After receiving a new token from the server, send back a message just + // containing a token_ack. + TokenAck *bool `protobuf:"varint,7,opt,name=token_ack,json=tokenAck" json:"token_ack,omitempty"` + // Request that, if the server allows, both ACI and PNI be returned even + // if the aci_uak_pairs don't match. + ReturnAcisWithoutUaks *bool `protobuf:"varint,8,opt,name=return_acis_without_uaks,json=returnAcisWithoutUaks" json:"return_acis_without_uaks,omitempty"` +} + +func (x *CDSClientRequest) Reset() { + *x = CDSClientRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ContactDiscovery_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CDSClientRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CDSClientRequest) ProtoMessage() {} + +func (x *CDSClientRequest) ProtoReflect() protoreflect.Message { + mi := &file_ContactDiscovery_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CDSClientRequest.ProtoReflect.Descriptor instead. +func (*CDSClientRequest) Descriptor() ([]byte, []int) { + return file_ContactDiscovery_proto_rawDescGZIP(), []int{0} +} + +func (x *CDSClientRequest) GetAciUakPairs() []byte { + if x != nil { + return x.AciUakPairs + } + return nil +} + +func (x *CDSClientRequest) GetPrevE164S() []byte { + if x != nil { + return x.PrevE164S + } + return nil +} + +func (x *CDSClientRequest) GetNewE164S() []byte { + if x != nil { + return x.NewE164S + } + return nil +} + +func (x *CDSClientRequest) GetDiscardE164S() []byte { + if x != nil { + return x.DiscardE164S + } + return nil +} + +func (x *CDSClientRequest) GetHasMore() bool { + if x != nil && x.HasMore != nil { + return *x.HasMore + } + return false +} + +func (x *CDSClientRequest) GetToken() []byte { + if x != nil { + return x.Token + } + return nil +} + +func (x *CDSClientRequest) GetTokenAck() bool { + if x != nil && x.TokenAck != nil { + return *x.TokenAck + } + return false +} + +func (x *CDSClientRequest) GetReturnAcisWithoutUaks() bool { + if x != nil && x.ReturnAcisWithoutUaks != nil { + return *x.ReturnAcisWithoutUaks + } + return false +} + +type CDSClientResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Each triple is an 8-byte e164, a 16-byte PNI, and a 16-byte ACI. + // If the e164 was not found, PNI and ACI are all zeros. If the PNI + // was found but the ACI was not, the PNI will be non-zero and the ACI + // will be all zeros. ACI will be returned if one of the returned + // PNIs has an ACI/UAK pair that matches. + // + // Should the request be successful (IE: a successful status returned), + // |e164_pni_aci_triple| will always equal |e164| of the request, + // so the entire marshalled size of the response will be (2+32)*|e164|, + // where the additional 2 bytes are the id/type/length additions of the + // protobuf marshaling added to each byte array. This avoids any data + // leakage based on the size of the encrypted output. + E164PniAciTriples []byte `protobuf:"bytes,1,opt,name=e164_pni_aci_triples,json=e164PniAciTriples" json:"e164_pni_aci_triples,omitempty"` + // A token which allows subsequent calls' rate limiting to discount the + // e164s sent up in this request, only counting those in the next + // request's new_e164s. + Token []byte `protobuf:"bytes,3,opt,name=token" json:"token,omitempty"` +} + +func (x *CDSClientResponse) Reset() { + *x = CDSClientResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ContactDiscovery_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CDSClientResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CDSClientResponse) ProtoMessage() {} + +func (x *CDSClientResponse) ProtoReflect() protoreflect.Message { + mi := &file_ContactDiscovery_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CDSClientResponse.ProtoReflect.Descriptor instead. +func (*CDSClientResponse) Descriptor() ([]byte, []int) { + return file_ContactDiscovery_proto_rawDescGZIP(), []int{1} +} + +func (x *CDSClientResponse) GetE164PniAciTriples() []byte { + if x != nil { + return x.E164PniAciTriples + } + return nil +} + +func (x *CDSClientResponse) GetToken() []byte { + if x != nil { + return x.Token + } + return nil +} + +var File_ContactDiscovery_proto protoreflect.FileDescriptor + +var file_ContactDiscovery_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x9e, 0x02, 0x0a, 0x10, 0x43, 0x44, 0x53, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0d, + 0x61, 0x63, 0x69, 0x5f, 0x75, 0x61, 0x6b, 0x5f, 0x70, 0x61, 0x69, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x61, 0x63, 0x69, 0x55, 0x61, 0x6b, 0x50, 0x61, 0x69, 0x72, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x65, 0x31, 0x36, 0x34, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x72, 0x65, 0x76, 0x45, 0x31, 0x36, 0x34, 0x73, 0x12, + 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x65, 0x31, 0x36, 0x34, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x45, 0x31, 0x36, 0x34, 0x73, 0x12, 0x23, 0x0a, 0x0d, + 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x65, 0x31, 0x36, 0x34, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x45, 0x31, 0x36, 0x34, + 0x73, 0x12, 0x19, 0x0a, 0x08, 0x68, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x68, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x61, 0x63, 0x6b, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x63, 0x6b, 0x12, + 0x37, 0x0a, 0x18, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x61, 0x63, 0x69, 0x73, 0x5f, 0x77, + 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x5f, 0x75, 0x61, 0x6b, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x15, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x41, 0x63, 0x69, 0x73, 0x57, 0x69, 0x74, + 0x68, 0x6f, 0x75, 0x74, 0x55, 0x61, 0x6b, 0x73, 0x22, 0x5a, 0x0a, 0x11, 0x43, 0x44, 0x53, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, + 0x14, 0x65, 0x31, 0x36, 0x34, 0x5f, 0x70, 0x6e, 0x69, 0x5f, 0x61, 0x63, 0x69, 0x5f, 0x74, 0x72, + 0x69, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x65, 0x31, 0x36, + 0x34, 0x50, 0x6e, 0x69, 0x41, 0x63, 0x69, 0x54, 0x72, 0x69, 0x70, 0x6c, 0x65, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, +} + +var ( + file_ContactDiscovery_proto_rawDescOnce sync.Once + file_ContactDiscovery_proto_rawDescData = file_ContactDiscovery_proto_rawDesc +) + +func file_ContactDiscovery_proto_rawDescGZIP() []byte { + file_ContactDiscovery_proto_rawDescOnce.Do(func() { + file_ContactDiscovery_proto_rawDescData = protoimpl.X.CompressGZIP(file_ContactDiscovery_proto_rawDescData) + }) + return file_ContactDiscovery_proto_rawDescData +} + +var file_ContactDiscovery_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_ContactDiscovery_proto_goTypes = []interface{}{ + (*CDSClientRequest)(nil), // 0: signalservice.CDSClientRequest + (*CDSClientResponse)(nil), // 1: signalservice.CDSClientResponse +} +var file_ContactDiscovery_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_ContactDiscovery_proto_init() } +func file_ContactDiscovery_proto_init() { + if File_ContactDiscovery_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ContactDiscovery_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CDSClientRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ContactDiscovery_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CDSClientResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_ContactDiscovery_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ContactDiscovery_proto_goTypes, + DependencyIndexes: file_ContactDiscovery_proto_depIdxs, + MessageInfos: file_ContactDiscovery_proto_msgTypes, + }.Build() + File_ContactDiscovery_proto = out.File + file_ContactDiscovery_proto_rawDesc = nil + file_ContactDiscovery_proto_goTypes = nil + file_ContactDiscovery_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/cds2pb/cds2.proto b/pkg/signalmeow/protobuf/ContactDiscovery.proto similarity index 70% rename from pkg/signalmeow/protobuf/cds2pb/cds2.proto rename to pkg/signalmeow/protobuf/ContactDiscovery.proto index 0b5cd3f..d1f5e04 100644 --- a/pkg/signalmeow/protobuf/cds2pb/cds2.proto +++ b/pkg/signalmeow/protobuf/ContactDiscovery.proto @@ -1,36 +1,37 @@ -syntax = "proto3"; +// Copyright 2021 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only -package org.signal.cdsi; +package signalservice; -message ClientRequest { +message CDSClientRequest { // Each ACI/UAK pair is a 32-byte buffer, containing the 16-byte ACI followed // by its 16-byte UAK. - bytes aci_uak_pairs = 1; + optional bytes aci_uak_pairs = 1; // Each E164 is an 8-byte big-endian number, as 8 bytes. - bytes prev_e164s = 2; - bytes new_e164s = 3; - bytes discard_e164s = 4; + optional bytes prev_e164s = 2; + optional bytes new_e164s = 3; + optional bytes discard_e164s = 4; // If true, the client has more pairs or e164s to send. If false or unset, // this is the client's last request, and processing should commence. - // bool has_more = 5; - reserved 5; + optional bool has_more = 5; // If set, a token which allows rate limiting to discount the e164s in // the request's prev_e164s, only counting new_e164s. If not set, then // rate limiting considers both prev_e164s' and new_e164s' size. - bytes token = 6; + optional bytes token = 6; // After receiving a new token from the server, send back a message just // containing a token_ack. - bool token_ack = 7; + optional bool token_ack = 7; - // [deprecated] bool return_acis_without_uaks = 8 - reserved 8; + // Request that, if the server allows, both ACI and PNI be returned even + // if the aci_uak_pairs don't match. + optional bool return_acis_without_uaks = 8; } -message ClientResponse { +message CDSClientResponse { // Each triple is an 8-byte e164, a 16-byte PNI, and a 16-byte ACI. // If the e164 was not found, PNI and ACI are all zeros. If the PNI // was found but the ACI was not, the PNI will be non-zero and the ACI @@ -43,18 +44,10 @@ message ClientResponse { // where the additional 2 bytes are the id/type/length additions of the // protobuf marshaling added to each byte array. This avoids any data // leakage based on the size of the encrypted output. - bytes e164_pni_aci_triples = 1; - - // int32 retry_after_secs = 2 [deprecated] - reserved 2; + optional bytes e164_pni_aci_triples = 1; // A token which allows subsequent calls' rate limiting to discount the // e164s sent up in this request, only counting those in the next // request's new_e164s. - bytes token = 3; - - // On a successful response to a token_ack request, the number of permits - // that were deducted from the user's rate-limit in order to process the - // request - int32 debug_permits_used = 4; + optional bytes token = 3; } diff --git a/pkg/signalmeow/protobuf/DeviceName.pb.go b/pkg/signalmeow/protobuf/DeviceName.pb.go new file mode 100644 index 0000000..657dcf5 --- /dev/null +++ b/pkg/signalmeow/protobuf/DeviceName.pb.go @@ -0,0 +1,165 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: DeviceName.proto + +// Copyright 2018 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type DeviceName struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EphemeralPublic []byte `protobuf:"bytes,1,opt,name=ephemeralPublic" json:"ephemeralPublic,omitempty"` + SyntheticIv []byte `protobuf:"bytes,2,opt,name=syntheticIv" json:"syntheticIv,omitempty"` + Ciphertext []byte `protobuf:"bytes,3,opt,name=ciphertext" json:"ciphertext,omitempty"` +} + +func (x *DeviceName) Reset() { + *x = DeviceName{} + if protoimpl.UnsafeEnabled { + mi := &file_DeviceName_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceName) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceName) ProtoMessage() {} + +func (x *DeviceName) ProtoReflect() protoreflect.Message { + mi := &file_DeviceName_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceName.ProtoReflect.Descriptor instead. +func (*DeviceName) Descriptor() ([]byte, []int) { + return file_DeviceName_proto_rawDescGZIP(), []int{0} +} + +func (x *DeviceName) GetEphemeralPublic() []byte { + if x != nil { + return x.EphemeralPublic + } + return nil +} + +func (x *DeviceName) GetSyntheticIv() []byte { + if x != nil { + return x.SyntheticIv + } + return nil +} + +func (x *DeviceName) GetCiphertext() []byte { + if x != nil { + return x.Ciphertext + } + return nil +} + +var File_DeviceName_proto protoreflect.FileDescriptor + +var file_DeviceName_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x22, 0x78, 0x0a, 0x0a, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x28, 0x0a, 0x0f, 0x65, 0x70, 0x68, 0x65, 0x6d, 0x65, 0x72, 0x61, 0x6c, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x70, 0x68, 0x65, 0x6d, 0x65, + 0x72, 0x61, 0x6c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x79, 0x6e, + 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x49, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, + 0x73, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x49, 0x76, 0x12, 0x1e, 0x0a, 0x0a, 0x63, + 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0a, 0x63, 0x69, 0x70, 0x68, 0x65, 0x72, 0x74, 0x65, 0x78, 0x74, +} + +var ( + file_DeviceName_proto_rawDescOnce sync.Once + file_DeviceName_proto_rawDescData = file_DeviceName_proto_rawDesc +) + +func file_DeviceName_proto_rawDescGZIP() []byte { + file_DeviceName_proto_rawDescOnce.Do(func() { + file_DeviceName_proto_rawDescData = protoimpl.X.CompressGZIP(file_DeviceName_proto_rawDescData) + }) + return file_DeviceName_proto_rawDescData +} + +var file_DeviceName_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_DeviceName_proto_goTypes = []interface{}{ + (*DeviceName)(nil), // 0: signalservice.DeviceName +} +var file_DeviceName_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_DeviceName_proto_init() } +func file_DeviceName_proto_init() { + if File_DeviceName_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_DeviceName_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceName); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_DeviceName_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_DeviceName_proto_goTypes, + DependencyIndexes: file_DeviceName_proto_depIdxs, + MessageInfos: file_DeviceName_proto_msgTypes, + }.Build() + File_DeviceName_proto = out.File + file_DeviceName_proto_rawDesc = nil + file_DeviceName_proto_goTypes = nil + file_DeviceName_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/DeviceName.proto b/pkg/signalmeow/protobuf/DeviceName.proto new file mode 100644 index 0000000..af14c1b --- /dev/null +++ b/pkg/signalmeow/protobuf/DeviceName.proto @@ -0,0 +1,10 @@ +// Copyright 2018 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +package signalservice; + +message DeviceName { + optional bytes ephemeralPublic = 1; + optional bytes syntheticIv = 2; + optional bytes ciphertext = 3; +} diff --git a/pkg/signalmeow/protobuf/Groups.pb.go b/pkg/signalmeow/protobuf/Groups.pb.go new file mode 100644 index 0000000..a49ea9f --- /dev/null +++ b/pkg/signalmeow/protobuf/Groups.pb.go @@ -0,0 +1,3635 @@ +//* +// Copyright (C) 2019 Open Whisper Systems +// +// Licensed according to the LICENSE file in this repository. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: Groups.proto + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Member_Role int32 + +const ( + Member_UNKNOWN Member_Role = 0 + Member_DEFAULT Member_Role = 1 + Member_ADMINISTRATOR Member_Role = 2 +) + +// Enum value maps for Member_Role. +var ( + Member_Role_name = map[int32]string{ + 0: "UNKNOWN", + 1: "DEFAULT", + 2: "ADMINISTRATOR", + } + Member_Role_value = map[string]int32{ + "UNKNOWN": 0, + "DEFAULT": 1, + "ADMINISTRATOR": 2, + } +) + +func (x Member_Role) Enum() *Member_Role { + p := new(Member_Role) + *p = x + return p +} + +func (x Member_Role) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Member_Role) Descriptor() protoreflect.EnumDescriptor { + return file_Groups_proto_enumTypes[0].Descriptor() +} + +func (Member_Role) Type() protoreflect.EnumType { + return &file_Groups_proto_enumTypes[0] +} + +func (x Member_Role) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Member_Role.Descriptor instead. +func (Member_Role) EnumDescriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{1, 0} +} + +type AccessControl_AccessRequired int32 + +const ( + AccessControl_UNKNOWN AccessControl_AccessRequired = 0 + AccessControl_ANY AccessControl_AccessRequired = 1 + AccessControl_MEMBER AccessControl_AccessRequired = 2 + AccessControl_ADMINISTRATOR AccessControl_AccessRequired = 3 + AccessControl_UNSATISFIABLE AccessControl_AccessRequired = 4 +) + +// Enum value maps for AccessControl_AccessRequired. +var ( + AccessControl_AccessRequired_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ANY", + 2: "MEMBER", + 3: "ADMINISTRATOR", + 4: "UNSATISFIABLE", + } + AccessControl_AccessRequired_value = map[string]int32{ + "UNKNOWN": 0, + "ANY": 1, + "MEMBER": 2, + "ADMINISTRATOR": 3, + "UNSATISFIABLE": 4, + } +) + +func (x AccessControl_AccessRequired) Enum() *AccessControl_AccessRequired { + p := new(AccessControl_AccessRequired) + *p = x + return p +} + +func (x AccessControl_AccessRequired) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AccessControl_AccessRequired) Descriptor() protoreflect.EnumDescriptor { + return file_Groups_proto_enumTypes[1].Descriptor() +} + +func (AccessControl_AccessRequired) Type() protoreflect.EnumType { + return &file_Groups_proto_enumTypes[1] +} + +func (x AccessControl_AccessRequired) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AccessControl_AccessRequired.Descriptor instead. +func (AccessControl_AccessRequired) EnumDescriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{5, 0} +} + +type AvatarUploadAttributes struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"` + Acl string `protobuf:"bytes,3,opt,name=acl,proto3" json:"acl,omitempty"` + Algorithm string `protobuf:"bytes,4,opt,name=algorithm,proto3" json:"algorithm,omitempty"` + Date string `protobuf:"bytes,5,opt,name=date,proto3" json:"date,omitempty"` + Policy string `protobuf:"bytes,6,opt,name=policy,proto3" json:"policy,omitempty"` + Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (x *AvatarUploadAttributes) Reset() { + *x = AvatarUploadAttributes{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AvatarUploadAttributes) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AvatarUploadAttributes) ProtoMessage() {} + +func (x *AvatarUploadAttributes) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AvatarUploadAttributes.ProtoReflect.Descriptor instead. +func (*AvatarUploadAttributes) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{0} +} + +func (x *AvatarUploadAttributes) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *AvatarUploadAttributes) GetCredential() string { + if x != nil { + return x.Credential + } + return "" +} + +func (x *AvatarUploadAttributes) GetAcl() string { + if x != nil { + return x.Acl + } + return "" +} + +func (x *AvatarUploadAttributes) GetAlgorithm() string { + if x != nil { + return x.Algorithm + } + return "" +} + +func (x *AvatarUploadAttributes) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *AvatarUploadAttributes) GetPolicy() string { + if x != nil { + return x.Policy + } + return "" +} + +func (x *AvatarUploadAttributes) GetSignature() string { + if x != nil { + return x.Signature + } + return "" +} + +type Member struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *Member) Reset() { + *x = Member{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Member) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Member) ProtoMessage() {} + +func (x *Member) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Member.ProtoReflect.Descriptor instead. +func (*Member) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{1} +} + +func (x *Member) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *Member) GetRole() Member_Role { + if x != nil { + return x.Role + } + return Member_UNKNOWN +} + +func (x *Member) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *Member) GetPresentation() []byte { + if x != nil { + return x.Presentation + } + return nil +} + +func (x *Member) GetJoinedAtRevision() uint32 { + if x != nil { + return x.JoinedAtRevision + } + return 0 +} + +type PendingMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *PendingMember) Reset() { + *x = PendingMember{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PendingMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PendingMember) ProtoMessage() {} + +func (x *PendingMember) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PendingMember.ProtoReflect.Descriptor instead. +func (*PendingMember) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{2} +} + +func (x *PendingMember) GetMember() *Member { + if x != nil { + return x.Member + } + return nil +} + +func (x *PendingMember) GetAddedByUserId() []byte { + if x != nil { + return x.AddedByUserId + } + return nil +} + +func (x *PendingMember) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type RequestingMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` // Only set when sending to server + Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *RequestingMember) Reset() { + *x = RequestingMember{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RequestingMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestingMember) ProtoMessage() {} + +func (x *RequestingMember) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestingMember.ProtoReflect.Descriptor instead. +func (*RequestingMember) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{3} +} + +func (x *RequestingMember) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *RequestingMember) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *RequestingMember) GetPresentation() []byte { + if x != nil { + return x.Presentation + } + return nil +} + +func (x *RequestingMember) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type BannedMember struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *BannedMember) Reset() { + *x = BannedMember{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BannedMember) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BannedMember) ProtoMessage() {} + +func (x *BannedMember) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BannedMember.ProtoReflect.Descriptor instead. +func (*BannedMember) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{4} +} + +func (x *BannedMember) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *BannedMember) GetTimestamp() uint64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type AccessControl struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *AccessControl) Reset() { + *x = AccessControl{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccessControl) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccessControl) ProtoMessage() {} + +func (x *AccessControl) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccessControl.ProtoReflect.Descriptor instead. +func (*AccessControl) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{5} +} + +func (x *AccessControl) GetAttributes() AccessControl_AccessRequired { + if x != nil { + return x.Attributes + } + return AccessControl_UNKNOWN +} + +func (x *AccessControl) GetMembers() AccessControl_AccessRequired { + if x != nil { + return x.Members + } + return AccessControl_UNKNOWN +} + +func (x *AccessControl) GetAddFromInviteLink() AccessControl_AccessRequired { + if x != nil { + return x.AddFromInviteLink + } + return AccessControl_UNKNOWN +} + +type Group struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *Group) Reset() { + *x = Group{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Group) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Group) ProtoMessage() {} + +func (x *Group) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Group.ProtoReflect.Descriptor instead. +func (*Group) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{6} +} + +func (x *Group) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *Group) GetTitle() []byte { + if x != nil { + return x.Title + } + return nil +} + +func (x *Group) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *Group) GetDisappearingMessagesTimer() []byte { + if x != nil { + return x.DisappearingMessagesTimer + } + return nil +} + +func (x *Group) GetAccessControl() *AccessControl { + if x != nil { + return x.AccessControl + } + return nil +} + +func (x *Group) GetRevision() uint32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *Group) GetMembers() []*Member { + if x != nil { + return x.Members + } + return nil +} + +func (x *Group) GetPendingMembers() []*PendingMember { + if x != nil { + return x.PendingMembers + } + return nil +} + +func (x *Group) GetRequestingMembers() []*RequestingMember { + if x != nil { + return x.RequestingMembers + } + return nil +} + +func (x *Group) GetInviteLinkPassword() []byte { + if x != nil { + return x.InviteLinkPassword + } + 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 + } + return false +} + +func (x *Group) GetBannedMembers() []*BannedMember { + if x != nil { + return x.BannedMembers + } + return nil +} + +type GroupChange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *GroupChange) Reset() { + *x = GroupChange{} + if protoimpl.UnsafeEnabled { + 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 protoimpl.UnsafeEnabled && 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{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 GroupChanges struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupChanges []*GroupChanges_GroupChangeState `protobuf:"bytes,1,rep,name=groupChanges,proto3" json:"groupChanges,omitempty"` +} + +func (x *GroupChanges) Reset() { + *x = GroupChanges{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[8] + 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[8] + if protoimpl.UnsafeEnabled && 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{8} +} + +func (x *GroupChanges) GetGroupChanges() []*GroupChanges_GroupChangeState { + if x != nil { + return x.GroupChanges + } + return nil +} + +type GroupAttributeBlob struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Content: + // + // *GroupAttributeBlob_Title + // *GroupAttributeBlob_Avatar + // *GroupAttributeBlob_DisappearingMessagesDuration + // *GroupAttributeBlob_Description + Content isGroupAttributeBlob_Content `protobuf_oneof:"content"` +} + +func (x *GroupAttributeBlob) Reset() { + *x = GroupAttributeBlob{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupAttributeBlob) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupAttributeBlob) ProtoMessage() {} + +func (x *GroupAttributeBlob) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupAttributeBlob.ProtoReflect.Descriptor instead. +func (*GroupAttributeBlob) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{9} +} + +func (m *GroupAttributeBlob) GetContent() isGroupAttributeBlob_Content { + if m != nil { + return m.Content + } + return nil +} + +func (x *GroupAttributeBlob) GetTitle() string { + if x, ok := x.GetContent().(*GroupAttributeBlob_Title); ok { + return x.Title + } + return "" +} + +func (x *GroupAttributeBlob) GetAvatar() []byte { + if x, ok := x.GetContent().(*GroupAttributeBlob_Avatar); ok { + return x.Avatar + } + return nil +} + +func (x *GroupAttributeBlob) GetDisappearingMessagesDuration() uint32 { + if x, ok := x.GetContent().(*GroupAttributeBlob_DisappearingMessagesDuration); ok { + return x.DisappearingMessagesDuration + } + return 0 +} + +func (x *GroupAttributeBlob) GetDescription() string { + if x, ok := x.GetContent().(*GroupAttributeBlob_Description); ok { + return x.Description + } + return "" +} + +type isGroupAttributeBlob_Content interface { + isGroupAttributeBlob_Content() +} + +type GroupAttributeBlob_Title struct { + Title string `protobuf:"bytes,1,opt,name=title,proto3,oneof"` +} + +type GroupAttributeBlob_Avatar struct { + Avatar []byte `protobuf:"bytes,2,opt,name=avatar,proto3,oneof"` +} + +type GroupAttributeBlob_DisappearingMessagesDuration struct { + DisappearingMessagesDuration uint32 `protobuf:"varint,3,opt,name=disappearingMessagesDuration,proto3,oneof"` +} + +type GroupAttributeBlob_Description struct { + Description string `protobuf:"bytes,4,opt,name=description,proto3,oneof"` +} + +func (*GroupAttributeBlob_Title) isGroupAttributeBlob_Content() {} + +func (*GroupAttributeBlob_Avatar) isGroupAttributeBlob_Content() {} + +func (*GroupAttributeBlob_DisappearingMessagesDuration) isGroupAttributeBlob_Content() {} + +func (*GroupAttributeBlob_Description) isGroupAttributeBlob_Content() {} + +type GroupInviteLink struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Contents: + // + // *GroupInviteLink_V1Contents + Contents isGroupInviteLink_Contents `protobuf_oneof:"contents"` +} + +func (x *GroupInviteLink) Reset() { + *x = GroupInviteLink{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupInviteLink) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupInviteLink) ProtoMessage() {} + +func (x *GroupInviteLink) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && 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.ProtoReflect.Descriptor instead. +func (*GroupInviteLink) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{10} +} + +func (m *GroupInviteLink) GetContents() isGroupInviteLink_Contents { + if m != nil { + return m.Contents + } + return nil +} + +func (x *GroupInviteLink) GetV1Contents() *GroupInviteLink_GroupInviteLinkContentsV1 { + if x, ok := x.GetContents().(*GroupInviteLink_V1Contents); ok { + return x.V1Contents + } + return nil +} + +type isGroupInviteLink_Contents interface { + isGroupInviteLink_Contents() +} + +type GroupInviteLink_V1Contents struct { + V1Contents *GroupInviteLink_GroupInviteLinkContentsV1 `protobuf:"bytes,1,opt,name=v1Contents,proto3,oneof"` +} + +func (*GroupInviteLink_V1Contents) isGroupInviteLink_Contents() {} + +type GroupJoinInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` + MemberCount uint32 `protobuf:"varint,4,opt,name=memberCount,proto3" json:"memberCount,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"` +} + +func (x *GroupJoinInfo) Reset() { + *x = GroupJoinInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupJoinInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupJoinInfo) ProtoMessage() {} + +func (x *GroupJoinInfo) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupJoinInfo.ProtoReflect.Descriptor instead. +func (*GroupJoinInfo) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{11} +} + +func (x *GroupJoinInfo) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *GroupJoinInfo) GetTitle() []byte { + if x != nil { + return x.Title + } + return nil +} + +func (x *GroupJoinInfo) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *GroupJoinInfo) GetMemberCount() uint32 { + if x != nil { + return x.MemberCount + } + return 0 +} + +func (x *GroupJoinInfo) GetAddFromInviteLink() AccessControl_AccessRequired { + if x != nil { + return x.AddFromInviteLink + } + return AccessControl_UNKNOWN +} + +func (x *GroupJoinInfo) GetRevision() uint32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *GroupJoinInfo) GetPendingAdminApproval() bool { + if x != nil { + return x.PendingAdminApproval + } + return false +} + +func (x *GroupJoinInfo) GetDescription() []byte { + if x != nil { + return x.Description + } + return nil +} + +type GroupExternalCredential struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *GroupExternalCredential) Reset() { + *x = GroupExternalCredential{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupExternalCredential) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupExternalCredential) ProtoMessage() {} + +func (x *GroupExternalCredential) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupExternalCredential.ProtoReflect.Descriptor instead. +func (*GroupExternalCredential) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{12} +} + +func (x *GroupExternalCredential) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type GroupChange_Actions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SourceServiceId []byte `protobuf:"bytes,1,opt,name=sourceServiceId,proto3" json:"sourceServiceId,omitempty"` + 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"` +} + +func (x *GroupChange_Actions) Reset() { + *x = GroupChange_Actions{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions) ProtoMessage() {} + +func (x *GroupChange_Actions) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && 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.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *GroupChange_Actions) GetSourceServiceId() []byte { + if x != nil { + return x.SourceServiceId + } + return nil +} + +func (x *GroupChange_Actions) GetRevision() uint32 { + if x != nil { + return x.Revision + } + return 0 +} + +func (x *GroupChange_Actions) GetAddMembers() []*GroupChange_Actions_AddMemberAction { + if x != nil { + return x.AddMembers + } + return nil +} + +func (x *GroupChange_Actions) GetDeleteMembers() []*GroupChange_Actions_DeleteMemberAction { + if x != nil { + return x.DeleteMembers + } + return nil +} + +func (x *GroupChange_Actions) GetModifyMemberRoles() []*GroupChange_Actions_ModifyMemberRoleAction { + if x != nil { + return x.ModifyMemberRoles + } + return nil +} + +func (x *GroupChange_Actions) GetModifyMemberProfileKeys() []*GroupChange_Actions_ModifyMemberProfileKeyAction { + if x != nil { + return x.ModifyMemberProfileKeys + } + return nil +} + +func (x *GroupChange_Actions) GetAddPendingMembers() []*GroupChange_Actions_AddPendingMemberAction { + if x != nil { + return x.AddPendingMembers + } + return nil +} + +func (x *GroupChange_Actions) GetDeletePendingMembers() []*GroupChange_Actions_DeletePendingMemberAction { + if x != nil { + return x.DeletePendingMembers + } + return nil +} + +func (x *GroupChange_Actions) GetPromotePendingMembers() []*GroupChange_Actions_PromotePendingMemberAction { + if x != nil { + return x.PromotePendingMembers + } + return nil +} + +func (x *GroupChange_Actions) GetModifyTitle() *GroupChange_Actions_ModifyTitleAction { + if x != nil { + return x.ModifyTitle + } + return nil +} + +func (x *GroupChange_Actions) GetModifyAvatar() *GroupChange_Actions_ModifyAvatarAction { + if x != nil { + return x.ModifyAvatar + } + return nil +} + +func (x *GroupChange_Actions) GetModifyDisappearingMessagesTimer() *GroupChange_Actions_ModifyDisappearingMessagesTimerAction { + if x != nil { + return x.ModifyDisappearingMessagesTimer + } + return nil +} + +func (x *GroupChange_Actions) GetModifyAttributesAccess() *GroupChange_Actions_ModifyAttributesAccessControlAction { + if x != nil { + return x.ModifyAttributesAccess + } + return nil +} + +func (x *GroupChange_Actions) GetModifyMemberAccess() *GroupChange_Actions_ModifyMembersAccessControlAction { + if x != nil { + return x.ModifyMemberAccess + } + return nil +} + +func (x *GroupChange_Actions) GetModifyAddFromInviteLinkAccess() *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction { + if x != nil { + return x.ModifyAddFromInviteLinkAccess + } + return nil +} + +func (x *GroupChange_Actions) GetAddRequestingMembers() []*GroupChange_Actions_AddRequestingMemberAction { + if x != nil { + return x.AddRequestingMembers + } + return nil +} + +func (x *GroupChange_Actions) GetDeleteRequestingMembers() []*GroupChange_Actions_DeleteRequestingMemberAction { + if x != nil { + return x.DeleteRequestingMembers + } + return nil +} + +func (x *GroupChange_Actions) GetPromoteRequestingMembers() []*GroupChange_Actions_PromoteRequestingMemberAction { + if x != nil { + return x.PromoteRequestingMembers + } + return nil +} + +func (x *GroupChange_Actions) GetModifyInviteLinkPassword() *GroupChange_Actions_ModifyInviteLinkPasswordAction { + if x != nil { + return x.ModifyInviteLinkPassword + } + return nil +} + +func (x *GroupChange_Actions) GetModifyDescription() *GroupChange_Actions_ModifyDescriptionAction { + if x != nil { + return x.ModifyDescription + } + return nil +} + +func (x *GroupChange_Actions) GetModifyAnnouncementsOnly() *GroupChange_Actions_ModifyAnnouncementsOnlyAction { + if x != nil { + return x.ModifyAnnouncementsOnly + } + return nil +} + +func (x *GroupChange_Actions) GetAddBannedMembers() []*GroupChange_Actions_AddBannedMemberAction { + if x != nil { + return x.AddBannedMembers + } + return nil +} + +func (x *GroupChange_Actions) GetDeleteBannedMembers() []*GroupChange_Actions_DeleteBannedMemberAction { + if x != nil { + return x.DeleteBannedMembers + } + return nil +} + +func (x *GroupChange_Actions) GetPromotePendingPniAciMembers() []*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction { + if x != nil { + return x.PromotePendingPniAciMembers + } + return nil +} + +type GroupChange_Actions_AddMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Added *Member `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` + JoinFromInviteLink bool `protobuf:"varint,2,opt,name=joinFromInviteLink,proto3" json:"joinFromInviteLink,omitempty"` +} + +func (x *GroupChange_Actions_AddMemberAction) Reset() { + *x = GroupChange_Actions_AddMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_AddMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_AddMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_AddMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && 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_AddMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_AddMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 0} +} + +func (x *GroupChange_Actions_AddMemberAction) GetAdded() *Member { + if x != nil { + return x.Added + } + return nil +} + +func (x *GroupChange_Actions_AddMemberAction) GetJoinFromInviteLink() bool { + if x != nil { + return x.JoinFromInviteLink + } + return false +} + +type GroupChange_Actions_DeleteMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeletedUserId []byte `protobuf:"bytes,1,opt,name=deletedUserId,proto3" json:"deletedUserId,omitempty"` +} + +func (x *GroupChange_Actions_DeleteMemberAction) Reset() { + *x = GroupChange_Actions_DeleteMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_DeleteMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_DeleteMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_DeleteMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && 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_DeleteMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_DeleteMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 1} +} + +func (x *GroupChange_Actions_DeleteMemberAction) GetDeletedUserId() []byte { + if x != nil { + return x.DeletedUserId + } + return nil +} + +type GroupChange_Actions_ModifyMemberRoleAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *GroupChange_Actions_ModifyMemberRoleAction) Reset() { + *x = GroupChange_Actions_ModifyMemberRoleAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyMemberRoleAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyMemberRoleAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyMemberRoleAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && 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_ModifyMemberRoleAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyMemberRoleAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 2} +} + +func (x *GroupChange_Actions_ModifyMemberRoleAction) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *GroupChange_Actions_ModifyMemberRoleAction) GetRole() Member_Role { + if x != nil { + return x.Role + } + return Member_UNKNOWN +} + +type GroupChange_Actions_ModifyMemberProfileKeyAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 +} + +func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) Reset() { + *x = GroupChange_Actions_ModifyMemberProfileKeyAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyMemberProfileKeyAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && 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_ModifyMemberProfileKeyAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyMemberProfileKeyAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 3} +} + +func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetPresentation() []byte { + if x != nil { + return x.Presentation + } + return nil +} + +func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +type GroupChange_Actions_AddPendingMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Added *PendingMember `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` +} + +func (x *GroupChange_Actions_AddPendingMemberAction) Reset() { + *x = GroupChange_Actions_AddPendingMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_AddPendingMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_AddPendingMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_AddPendingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && 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_AddPendingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_AddPendingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 4} +} + +func (x *GroupChange_Actions_AddPendingMemberAction) GetAdded() *PendingMember { + if x != nil { + return x.Added + } + return nil +} + +type GroupChange_Actions_DeletePendingMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeletedUserId []byte `protobuf:"bytes,1,opt,name=deletedUserId,proto3" json:"deletedUserId,omitempty"` +} + +func (x *GroupChange_Actions_DeletePendingMemberAction) Reset() { + *x = GroupChange_Actions_DeletePendingMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_DeletePendingMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_DeletePendingMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_DeletePendingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && 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_DeletePendingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_DeletePendingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 5} +} + +func (x *GroupChange_Actions_DeletePendingMemberAction) GetDeletedUserId() []byte { + if x != nil { + return x.DeletedUserId + } + return nil +} + +type GroupChange_Actions_PromotePendingMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 +} + +func (x *GroupChange_Actions_PromotePendingMemberAction) Reset() { + *x = GroupChange_Actions_PromotePendingMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_PromotePendingMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_PromotePendingMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_PromotePendingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && 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_PromotePendingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_PromotePendingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 6} +} + +func (x *GroupChange_Actions_PromotePendingMemberAction) GetPresentation() []byte { + if x != nil { + return x.Presentation + } + return nil +} + +func (x *GroupChange_Actions_PromotePendingMemberAction) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *GroupChange_Actions_PromotePendingMemberAction) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +type GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 +} + +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) Reset() { + *x = GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) ProtoMessage() {} + +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && 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_PromotePendingPniAciMemberProfileKeyAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 7} +} + +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetPresentation() []byte { + if x != nil { + return x.Presentation + } + return nil +} + +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetPni() []byte { + if x != nil { + return x.Pni + } + return nil +} + +func (x *GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +type GroupChange_Actions_AddRequestingMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Added *RequestingMember `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` +} + +func (x *GroupChange_Actions_AddRequestingMemberAction) Reset() { + *x = GroupChange_Actions_AddRequestingMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_AddRequestingMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_AddRequestingMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_AddRequestingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && 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_AddRequestingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_AddRequestingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 8} +} + +func (x *GroupChange_Actions_AddRequestingMemberAction) GetAdded() *RequestingMember { + if x != nil { + return x.Added + } + return nil +} + +type GroupChange_Actions_DeleteRequestingMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeletedUserId []byte `protobuf:"bytes,1,opt,name=deletedUserId,proto3" json:"deletedUserId,omitempty"` +} + +func (x *GroupChange_Actions_DeleteRequestingMemberAction) Reset() { + *x = GroupChange_Actions_DeleteRequestingMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_DeleteRequestingMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_DeleteRequestingMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_DeleteRequestingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && 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_DeleteRequestingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_DeleteRequestingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 9} +} + +func (x *GroupChange_Actions_DeleteRequestingMemberAction) GetDeletedUserId() []byte { + if x != nil { + return x.DeletedUserId + } + return nil +} + +type GroupChange_Actions_PromoteRequestingMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *GroupChange_Actions_PromoteRequestingMemberAction) Reset() { + *x = GroupChange_Actions_PromoteRequestingMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_PromoteRequestingMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_PromoteRequestingMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_PromoteRequestingMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && 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_PromoteRequestingMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_PromoteRequestingMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 10} +} + +func (x *GroupChange_Actions_PromoteRequestingMemberAction) GetUserId() []byte { + if x != nil { + return x.UserId + } + return nil +} + +func (x *GroupChange_Actions_PromoteRequestingMemberAction) GetRole() Member_Role { + if x != nil { + return x.Role + } + return Member_UNKNOWN +} + +type GroupChange_Actions_AddBannedMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Added *BannedMember `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` +} + +func (x *GroupChange_Actions_AddBannedMemberAction) Reset() { + *x = GroupChange_Actions_AddBannedMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_AddBannedMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_AddBannedMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_AddBannedMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && 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_AddBannedMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_AddBannedMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 11} +} + +func (x *GroupChange_Actions_AddBannedMemberAction) GetAdded() *BannedMember { + if x != nil { + return x.Added + } + return nil +} + +type GroupChange_Actions_DeleteBannedMemberAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeletedUserId []byte `protobuf:"bytes,1,opt,name=deletedUserId,proto3" json:"deletedUserId,omitempty"` +} + +func (x *GroupChange_Actions_DeleteBannedMemberAction) Reset() { + *x = GroupChange_Actions_DeleteBannedMemberAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_DeleteBannedMemberAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_DeleteBannedMemberAction) ProtoMessage() {} + +func (x *GroupChange_Actions_DeleteBannedMemberAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && 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_DeleteBannedMemberAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_DeleteBannedMemberAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 12} +} + +func (x *GroupChange_Actions_DeleteBannedMemberAction) GetDeletedUserId() []byte { + if x != nil { + return x.DeletedUserId + } + return nil +} + +type GroupChange_Actions_ModifyTitleAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title []byte `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` +} + +func (x *GroupChange_Actions_ModifyTitleAction) Reset() { + *x = GroupChange_Actions_ModifyTitleAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyTitleAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyTitleAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyTitleAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && 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_ModifyTitleAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyTitleAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 13} +} + +func (x *GroupChange_Actions_ModifyTitleAction) GetTitle() []byte { + if x != nil { + return x.Title + } + return nil +} + +type GroupChange_Actions_ModifyDescriptionAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Description []byte `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *GroupChange_Actions_ModifyDescriptionAction) Reset() { + *x = GroupChange_Actions_ModifyDescriptionAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyDescriptionAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyDescriptionAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyDescriptionAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && 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_ModifyDescriptionAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyDescriptionAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 14} +} + +func (x *GroupChange_Actions_ModifyDescriptionAction) GetDescription() []byte { + if x != nil { + return x.Description + } + return nil +} + +type GroupChange_Actions_ModifyAvatarAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar,omitempty"` +} + +func (x *GroupChange_Actions_ModifyAvatarAction) Reset() { + *x = GroupChange_Actions_ModifyAvatarAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyAvatarAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyAvatarAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyAvatarAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && 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_ModifyAvatarAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyAvatarAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 15} +} + +func (x *GroupChange_Actions_ModifyAvatarAction) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +type GroupChange_Actions_ModifyDisappearingMessagesTimerAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timer []byte `protobuf:"bytes,1,opt,name=timer,proto3" json:"timer,omitempty"` +} + +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) Reset() { + *x = GroupChange_Actions_ModifyDisappearingMessagesTimerAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyDisappearingMessagesTimerAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && 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_ModifyDisappearingMessagesTimerAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyDisappearingMessagesTimerAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 16} +} + +func (x *GroupChange_Actions_ModifyDisappearingMessagesTimerAction) GetTimer() []byte { + if x != nil { + return x.Timer + } + return nil +} + +type GroupChange_Actions_ModifyAttributesAccessControlAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AttributesAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=attributesAccess,proto3,enum=AccessControl_AccessRequired" json:"attributesAccess,omitempty"` +} + +func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) Reset() { + *x = GroupChange_Actions_ModifyAttributesAccessControlAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyAttributesAccessControlAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && 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_ModifyAttributesAccessControlAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyAttributesAccessControlAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 17} +} + +func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) GetAttributesAccess() AccessControl_AccessRequired { + if x != nil { + return x.AttributesAccess + } + return AccessControl_UNKNOWN +} + +type GroupChange_Actions_ModifyMembersAccessControlAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MembersAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=membersAccess,proto3,enum=AccessControl_AccessRequired" json:"membersAccess,omitempty"` +} + +func (x *GroupChange_Actions_ModifyMembersAccessControlAction) Reset() { + *x = GroupChange_Actions_ModifyMembersAccessControlAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyMembersAccessControlAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyMembersAccessControlAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyMembersAccessControlAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && 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_ModifyMembersAccessControlAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyMembersAccessControlAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 18} +} + +func (x *GroupChange_Actions_ModifyMembersAccessControlAction) GetMembersAccess() AccessControl_AccessRequired { + if x != nil { + return x.MembersAccess + } + return AccessControl_UNKNOWN +} + +type GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AddFromInviteLinkAccess AccessControl_AccessRequired `protobuf:"varint,1,opt,name=addFromInviteLinkAccess,proto3,enum=AccessControl_AccessRequired" json:"addFromInviteLinkAccess,omitempty"` +} + +func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) Reset() { + *x = GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && 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_ModifyAddFromInviteLinkAccessControlAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 19} +} + +func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) GetAddFromInviteLinkAccess() AccessControl_AccessRequired { + if x != nil { + return x.AddFromInviteLinkAccess + } + return AccessControl_UNKNOWN +} + +type GroupChange_Actions_ModifyInviteLinkPasswordAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InviteLinkPassword []byte `protobuf:"bytes,1,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` +} + +func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) Reset() { + *x = GroupChange_Actions_ModifyInviteLinkPasswordAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyInviteLinkPasswordAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && 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_ModifyInviteLinkPasswordAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyInviteLinkPasswordAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 20} +} + +func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) GetInviteLinkPassword() []byte { + if x != nil { + return x.InviteLinkPassword + } + return nil +} + +type GroupChange_Actions_ModifyAnnouncementsOnlyAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AnnouncementsOnly bool `protobuf:"varint,1,opt,name=announcementsOnly,proto3" json:"announcementsOnly,omitempty"` +} + +func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) Reset() { + *x = GroupChange_Actions_ModifyAnnouncementsOnlyAction{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChange_Actions_ModifyAnnouncementsOnlyAction) ProtoMessage() {} + +func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && 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_ModifyAnnouncementsOnlyAction.ProtoReflect.Descriptor instead. +func (*GroupChange_Actions_ModifyAnnouncementsOnlyAction) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{7, 0, 21} +} + +func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) GetAnnouncementsOnly() bool { + if x != nil { + return x.AnnouncementsOnly + } + return false +} + +type GroupChanges_GroupChangeState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupChange *GroupChange `protobuf:"bytes,1,opt,name=groupChange,proto3" json:"groupChange,omitempty"` + GroupState *Group `protobuf:"bytes,2,opt,name=groupState,proto3" json:"groupState,omitempty"` +} + +func (x *GroupChanges_GroupChangeState) Reset() { + *x = GroupChanges_GroupChangeState{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupChanges_GroupChangeState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupChanges_GroupChangeState) ProtoMessage() {} + +func (x *GroupChanges_GroupChangeState) ProtoReflect() protoreflect.Message { + mi := &file_Groups_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && 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_GroupChangeState.ProtoReflect.Descriptor instead. +func (*GroupChanges_GroupChangeState) Descriptor() ([]byte, []int) { + return file_Groups_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *GroupChanges_GroupChangeState) GetGroupChange() *GroupChange { + if x != nil { + return x.GroupChange + } + return nil +} + +func (x *GroupChanges_GroupChangeState) GetGroupState() *Group { + if x != nil { + return x.GroupState + } + return nil +} + +type GroupInviteLink_GroupInviteLinkContentsV1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GroupMasterKey []byte `protobuf:"bytes,1,opt,name=groupMasterKey,proto3" json:"groupMasterKey,omitempty"` + InviteLinkPassword []byte `protobuf:"bytes,2,opt,name=inviteLinkPassword,proto3" json:"inviteLinkPassword,omitempty"` +} + +func (x *GroupInviteLink_GroupInviteLinkContentsV1) Reset() { + *x = GroupInviteLink_GroupInviteLinkContentsV1{} + if protoimpl.UnsafeEnabled { + mi := &file_Groups_proto_msgTypes[37] + 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[37] + if protoimpl.UnsafeEnabled && 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{10, 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 + +var file_Groups_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc4, + 0x01, 0x0a, 0x16, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x63, + 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x61, + 0x63, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xe7, 0x01, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, + 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, + 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, + 0x0a, 0x10, 0x6a, 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x6a, 0x6f, 0x69, 0x6e, 0x65, 0x64, + 0x41, 0x74, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x04, 0x52, 0x6f, + 0x6c, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, + 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x49, 0x53, 0x54, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x02, 0x22, + 0x74, 0x0a, 0x0d, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x1f, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x65, 0x64, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, 0x64, 0x64, 0x65, 0x64, 0x42, + 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x8c, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, + 0x65, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x22, 0x44, 0x0a, 0x0c, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xae, 0x02, 0x0a, 0x0d, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x3d, 0x0a, 0x0a, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1d, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x07, 0x6d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x12, 0x4b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x49, + 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1d, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x11, + 0x61, 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, + 0x6b, 0x22, 0x58, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x69, + 0x72, 0x65, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x45, 0x4d, + 0x42, 0x45, 0x52, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x49, 0x53, + 0x54, 0x52, 0x41, 0x54, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x53, 0x41, + 0x54, 0x49, 0x53, 0x46, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x22, 0xb4, 0x04, 0x0a, 0x05, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x12, 0x3c, 0x0a, 0x19, 0x64, 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x19, 0x64, 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, + 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x12, + 0x34, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x21, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x12, 0x36, 0x0a, 0x0e, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0e, 0x70, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x3f, 0x0a, 0x11, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x2e, 0x0a, + 0x12, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x2c, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6e, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x33, 0x0a, + 0x0d, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x0d, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x52, 0x0d, 0x62, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x22, 0xcc, 0x21, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x0f, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x45, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x1a, 0xd6, 0x20, 0x0a, 0x07, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x0a, 0x61, 0x64, + 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, + 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x61, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x12, 0x4d, 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, + 0x59, 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, + 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x6f, 0x6c, + 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x6b, 0x0a, 0x17, 0x6d, 0x6f, + 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x17, + 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x59, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x50, 0x65, + 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x11, 0x61, 0x64, 0x64, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x12, 0x62, 0x0a, 0x14, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x14, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, + 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x65, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, + 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, + 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x6d, + 0x6f, 0x74, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x48, 0x0a, + 0x0b, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x69, + 0x66, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x6d, 0x6f, 0x64, 0x69, 0x66, + 0x79, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x76, + 0x61, 0x74, 0x61, 0x72, 0x12, 0x84, 0x01, 0x0a, 0x1f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x44, + 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, + 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x44, 0x69, 0x73, 0x61, 0x70, + 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x54, + 0x69, 0x6d, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x1f, 0x6d, 0x6f, 0x64, 0x69, + 0x66, 0x79, 0x44, 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x12, 0x70, 0x0a, 0x16, 0x6d, + 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x65, 0x0a, + 0x12, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x12, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x12, 0x85, 0x01, 0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, + 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x1d, 0x6d, + 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x62, 0x0a, 0x14, + 0x61, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x61, 0x64, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x12, 0x6b, 0x0a, 0x17, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x17, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x6e, 0x0a, + 0x18, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x32, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x18, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x6f, 0x0a, + 0x18, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, + 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x18, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x76, 0x69, + 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x5a, + 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x6c, 0x0a, 0x17, 0x6d, 0x6f, + 0x64, 0x69, 0x66, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4f, 0x6e, 0x6c, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x17, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x56, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x42, + 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x16, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x42, 0x61, 0x6e, 0x6e, + 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10, + 0x61, 0x64, 0x64, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x12, 0x5f, 0x0a, 0x13, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x12, 0x81, 0x01, 0x0a, 0x1b, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x65, 0x6e, + 0x64, 0x69, 0x6e, 0x67, 0x50, 0x6e, 0x69, 0x41, 0x63, 0x69, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x50, 0x72, + 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x6e, 0x69, 0x41, + 0x63, 0x69, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, + 0x65, 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x1b, 0x70, 0x72, 0x6f, 0x6d, 0x6f, 0x74, + 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x6e, 0x69, 0x41, 0x63, 0x69, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x1a, 0x60, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x4d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x52, 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x6a, 0x6f, 0x69, 0x6e, 0x46, + 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x12, 0x6a, 0x6f, 0x69, 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x76, + 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x1a, 0x3a, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, + 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x1a, 0x52, 0x0a, 0x16, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, + 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x1a, 0x7c, 0x0a, 0x1c, 0x4d, 0x6f, 0x64, 0x69, 0x66, + 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, + 0x79, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x73, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x1a, 0x3e, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x50, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x24, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x05, + 0x61, 0x64, 0x64, 0x65, 0x64, 0x1a, 0x41, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, + 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x1a, 0x7a, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x6d, + 0x6f, 0x74, 0x65, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, + 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x4b, 0x65, 0x79, 0x1a, 0x9a, 0x01, 0x0a, 0x2a, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, + 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x50, 0x6e, 0x69, 0x41, 0x63, 0x69, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x70, 0x72, 0x65, 0x73, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x10, 0x0a, 0x03, 0x70, 0x6e, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x70, 0x6e, + 0x69, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, + 0x79, 0x1a, 0x44, 0x0a, 0x19, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, + 0x0a, 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x52, 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x1a, 0x44, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x1a, 0x59, 0x0a, + 0x1d, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x67, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x52, 0x6f, + 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x1a, 0x3c, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x42, + 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x23, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, + 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x1a, 0x40, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x42, 0x61, 0x6e, 0x6e, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x1a, 0x29, 0x0a, 0x11, 0x4d, 0x6f, 0x64, 0x69, + 0x66, 0x79, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x69, + 0x74, 0x6c, 0x65, 0x1a, 0x3b, 0x0a, 0x17, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x2c, 0x0a, 0x12, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x1a, 0x3d, + 0x0a, 0x25, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x44, 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, + 0x72, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x1a, 0x70, 0x0a, + 0x23, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x41, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x10, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, + 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x10, 0x61, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, + 0x67, 0x0a, 0x20, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0d, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x0d, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x85, 0x01, 0x0a, 0x2a, 0x4d, 0x6f, 0x64, + 0x69, 0x66, 0x79, 0x41, 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, 0x0a, 0x17, 0x61, 0x64, 0x64, 0x46, 0x72, + 0x6f, 0x6d, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x17, 0x61, 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x1a, 0x50, 0x0a, 0x1e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x41, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x2e, 0x0a, 0x12, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, + 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x1a, 0x4d, 0x0a, 0x1d, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x6e, 0x6e, 0x6f, + 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4f, 0x6e, 0x6c, 0x79, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x4f, 0x6e, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, + 0x61, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x4f, 0x6e, 0x6c, + 0x79, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x12, 0x42, 0x0a, 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x1a, 0x6a, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x0b, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0b, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, + 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x22, 0xbb, 0x01, 0x0a, 0x12, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x74, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x16, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x18, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x48, 0x00, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x44, 0x0a, 0x1c, 0x64, + 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x48, 0x00, 0x52, 0x1c, 0x64, 0x69, 0x73, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x22, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x22, 0xe0, 0x01, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, + 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x4c, 0x0a, 0x0a, 0x76, 0x31, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x56, 0x31, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x31, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x73, 0x1a, 0x73, 0x0a, 0x19, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x12, + 0x26, 0x0a, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x61, + 0x73, 0x74, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x12, 0x69, 0x6e, 0x76, 0x69, 0x74, + 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x12, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x50, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x73, 0x22, 0xbc, 0x02, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4a, 0x6f, 0x69, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, + 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x43, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x4b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, + 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, + 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x52, 0x11, 0x61, + 0x64, 0x64, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x65, 0x4c, 0x69, 0x6e, 0x6b, + 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x32, 0x0a, 0x14, + 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x72, + 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x70, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x17, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x78, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x42, 0x2b, 0x0a, 0x27, 0x6f, 0x72, 0x67, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x50, 0x01, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_Groups_proto_rawDescOnce sync.Once + file_Groups_proto_rawDescData = file_Groups_proto_rawDesc +) + +func file_Groups_proto_rawDescGZIP() []byte { + file_Groups_proto_rawDescOnce.Do(func() { + file_Groups_proto_rawDescData = protoimpl.X.CompressGZIP(file_Groups_proto_rawDescData) + }) + return file_Groups_proto_rawDescData +} + +var file_Groups_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_Groups_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_Groups_proto_goTypes = []interface{}{ + (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 + (*GroupChanges)(nil), // 10: GroupChanges + (*GroupAttributeBlob)(nil), // 11: GroupAttributeBlob + (*GroupInviteLink)(nil), // 12: GroupInviteLink + (*GroupJoinInfo)(nil), // 13: GroupJoinInfo + (*GroupExternalCredential)(nil), // 14: GroupExternalCredential + (*GroupChange_Actions)(nil), // 15: GroupChange.Actions + (*GroupChange_Actions_AddMemberAction)(nil), // 16: GroupChange.Actions.AddMemberAction + (*GroupChange_Actions_DeleteMemberAction)(nil), // 17: GroupChange.Actions.DeleteMemberAction + (*GroupChange_Actions_ModifyMemberRoleAction)(nil), // 18: GroupChange.Actions.ModifyMemberRoleAction + (*GroupChange_Actions_ModifyMemberProfileKeyAction)(nil), // 19: GroupChange.Actions.ModifyMemberProfileKeyAction + (*GroupChange_Actions_AddPendingMemberAction)(nil), // 20: GroupChange.Actions.AddPendingMemberAction + (*GroupChange_Actions_DeletePendingMemberAction)(nil), // 21: GroupChange.Actions.DeletePendingMemberAction + (*GroupChange_Actions_PromotePendingMemberAction)(nil), // 22: GroupChange.Actions.PromotePendingMemberAction + (*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction)(nil), // 23: GroupChange.Actions.PromotePendingPniAciMemberProfileKeyAction + (*GroupChange_Actions_AddRequestingMemberAction)(nil), // 24: GroupChange.Actions.AddRequestingMemberAction + (*GroupChange_Actions_DeleteRequestingMemberAction)(nil), // 25: GroupChange.Actions.DeleteRequestingMemberAction + (*GroupChange_Actions_PromoteRequestingMemberAction)(nil), // 26: GroupChange.Actions.PromoteRequestingMemberAction + (*GroupChange_Actions_AddBannedMemberAction)(nil), // 27: GroupChange.Actions.AddBannedMemberAction + (*GroupChange_Actions_DeleteBannedMemberAction)(nil), // 28: GroupChange.Actions.DeleteBannedMemberAction + (*GroupChange_Actions_ModifyTitleAction)(nil), // 29: GroupChange.Actions.ModifyTitleAction + (*GroupChange_Actions_ModifyDescriptionAction)(nil), // 30: GroupChange.Actions.ModifyDescriptionAction + (*GroupChange_Actions_ModifyAvatarAction)(nil), // 31: GroupChange.Actions.ModifyAvatarAction + (*GroupChange_Actions_ModifyDisappearingMessagesTimerAction)(nil), // 32: GroupChange.Actions.ModifyDisappearingMessagesTimerAction + (*GroupChange_Actions_ModifyAttributesAccessControlAction)(nil), // 33: GroupChange.Actions.ModifyAttributesAccessControlAction + (*GroupChange_Actions_ModifyMembersAccessControlAction)(nil), // 34: GroupChange.Actions.ModifyMembersAccessControlAction + (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction)(nil), // 35: GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction + (*GroupChange_Actions_ModifyInviteLinkPasswordAction)(nil), // 36: GroupChange.Actions.ModifyInviteLinkPasswordAction + (*GroupChange_Actions_ModifyAnnouncementsOnlyAction)(nil), // 37: GroupChange.Actions.ModifyAnnouncementsOnlyAction + (*GroupChanges_GroupChangeState)(nil), // 38: GroupChanges.GroupChangeState + (*GroupInviteLink_GroupInviteLinkContentsV1)(nil), // 39: GroupInviteLink.GroupInviteLinkContentsV1 +} +var file_Groups_proto_depIdxs = []int32{ + 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 + 38, // 10: GroupChanges.groupChanges:type_name -> GroupChanges.GroupChangeState + 39, // 11: GroupInviteLink.v1Contents:type_name -> GroupInviteLink.GroupInviteLinkContentsV1 + 1, // 12: GroupJoinInfo.addFromInviteLink:type_name -> AccessControl.AccessRequired + 16, // 13: GroupChange.Actions.addMembers:type_name -> GroupChange.Actions.AddMemberAction + 17, // 14: GroupChange.Actions.deleteMembers:type_name -> GroupChange.Actions.DeleteMemberAction + 18, // 15: GroupChange.Actions.modifyMemberRoles:type_name -> GroupChange.Actions.ModifyMemberRoleAction + 19, // 16: GroupChange.Actions.modifyMemberProfileKeys:type_name -> GroupChange.Actions.ModifyMemberProfileKeyAction + 20, // 17: GroupChange.Actions.addPendingMembers:type_name -> GroupChange.Actions.AddPendingMemberAction + 21, // 18: GroupChange.Actions.deletePendingMembers:type_name -> GroupChange.Actions.DeletePendingMemberAction + 22, // 19: GroupChange.Actions.promotePendingMembers:type_name -> GroupChange.Actions.PromotePendingMemberAction + 29, // 20: GroupChange.Actions.modifyTitle:type_name -> GroupChange.Actions.ModifyTitleAction + 31, // 21: GroupChange.Actions.modifyAvatar:type_name -> GroupChange.Actions.ModifyAvatarAction + 32, // 22: GroupChange.Actions.modifyDisappearingMessagesTimer:type_name -> GroupChange.Actions.ModifyDisappearingMessagesTimerAction + 33, // 23: GroupChange.Actions.modifyAttributesAccess:type_name -> GroupChange.Actions.ModifyAttributesAccessControlAction + 34, // 24: GroupChange.Actions.modifyMemberAccess:type_name -> GroupChange.Actions.ModifyMembersAccessControlAction + 35, // 25: GroupChange.Actions.modifyAddFromInviteLinkAccess:type_name -> GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction + 24, // 26: GroupChange.Actions.addRequestingMembers:type_name -> GroupChange.Actions.AddRequestingMemberAction + 25, // 27: GroupChange.Actions.deleteRequestingMembers:type_name -> GroupChange.Actions.DeleteRequestingMemberAction + 26, // 28: GroupChange.Actions.promoteRequestingMembers:type_name -> GroupChange.Actions.PromoteRequestingMemberAction + 36, // 29: GroupChange.Actions.modifyInviteLinkPassword:type_name -> GroupChange.Actions.ModifyInviteLinkPasswordAction + 30, // 30: GroupChange.Actions.modifyDescription:type_name -> GroupChange.Actions.ModifyDescriptionAction + 37, // 31: GroupChange.Actions.modifyAnnouncementsOnly:type_name -> GroupChange.Actions.ModifyAnnouncementsOnlyAction + 27, // 32: GroupChange.Actions.addBannedMembers:type_name -> GroupChange.Actions.AddBannedMemberAction + 28, // 33: GroupChange.Actions.deleteBannedMembers:type_name -> GroupChange.Actions.DeleteBannedMemberAction + 23, // 34: GroupChange.Actions.promotePendingPniAciMembers:type_name -> GroupChange.Actions.PromotePendingPniAciMemberProfileKeyAction + 3, // 35: GroupChange.Actions.AddMemberAction.added:type_name -> Member + 0, // 36: GroupChange.Actions.ModifyMemberRoleAction.role:type_name -> Member.Role + 4, // 37: GroupChange.Actions.AddPendingMemberAction.added:type_name -> PendingMember + 5, // 38: GroupChange.Actions.AddRequestingMemberAction.added:type_name -> RequestingMember + 0, // 39: GroupChange.Actions.PromoteRequestingMemberAction.role:type_name -> Member.Role + 6, // 40: GroupChange.Actions.AddBannedMemberAction.added:type_name -> BannedMember + 1, // 41: GroupChange.Actions.ModifyAttributesAccessControlAction.attributesAccess:type_name -> AccessControl.AccessRequired + 1, // 42: GroupChange.Actions.ModifyMembersAccessControlAction.membersAccess:type_name -> AccessControl.AccessRequired + 1, // 43: GroupChange.Actions.ModifyAddFromInviteLinkAccessControlAction.addFromInviteLinkAccess:type_name -> AccessControl.AccessRequired + 9, // 44: GroupChanges.GroupChangeState.groupChange:type_name -> GroupChange + 8, // 45: GroupChanges.GroupChangeState.groupState:type_name -> Group + 46, // [46:46] is the sub-list for method output_type + 46, // [46:46] is the sub-list for method input_type + 46, // [46:46] is the sub-list for extension type_name + 46, // [46:46] is the sub-list for extension extendee + 0, // [0:46] is the sub-list for field type_name +} + +func init() { file_Groups_proto_init() } +func file_Groups_proto_init() { + if File_Groups_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_Groups_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AvatarUploadAttributes); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Member); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PendingMember); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RequestingMember); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BannedMember); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccessControl); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Group); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChanges); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupAttributeBlob); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupInviteLink); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupJoinInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupExternalCredential); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_AddMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_DeleteMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyMemberRoleAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyMemberProfileKeyAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_AddPendingMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_DeletePendingMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_PromotePendingMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_PromotePendingPniAciMemberProfileKeyAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_AddRequestingMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_DeleteRequestingMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_PromoteRequestingMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_AddBannedMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_DeleteBannedMemberAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyTitleAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyDescriptionAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyAvatarAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyDisappearingMessagesTimerAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyAttributesAccessControlAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyMembersAccessControlAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyInviteLinkPasswordAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChange_Actions_ModifyAnnouncementsOnlyAction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupChanges_GroupChangeState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Groups_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupInviteLink_GroupInviteLinkContentsV1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_Groups_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*GroupAttributeBlob_Title)(nil), + (*GroupAttributeBlob_Avatar)(nil), + (*GroupAttributeBlob_DisappearingMessagesDuration)(nil), + (*GroupAttributeBlob_Description)(nil), + } + file_Groups_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*GroupInviteLink_V1Contents)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_Groups_proto_rawDesc, + NumEnums: 2, + NumMessages: 38, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_Groups_proto_goTypes, + DependencyIndexes: file_Groups_proto_depIdxs, + EnumInfos: file_Groups_proto_enumTypes, + MessageInfos: file_Groups_proto_msgTypes, + }.Build() + File_Groups_proto = out.File + file_Groups_proto_rawDesc = nil + file_Groups_proto_goTypes = nil + file_Groups_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/Groups.proto b/pkg/signalmeow/protobuf/Groups.proto new file mode 100644 index 0000000..3f0b730 --- /dev/null +++ b/pkg/signalmeow/protobuf/Groups.proto @@ -0,0 +1,258 @@ +/** + * Copyright (C) 2019 Open Whisper Systems + * + * Licensed according to the LICENSE file in this repository. + */ +syntax = "proto3"; + +option java_package = "org.signal.storageservice.protos.groups"; +option java_multiple_files = true; + +message AvatarUploadAttributes { + string key = 1; + string credential = 2; + string acl = 3; + string algorithm = 4; + string date = 5; + string policy = 6; + string signature = 7; +} + +message Member { + enum Role { + UNKNOWN = 0; + DEFAULT = 1; + ADMINISTRATOR = 2; + } + + bytes userId = 1; + Role role = 2; + bytes profileKey = 3; + bytes presentation = 4; // Only set when sending to server + uint32 joinedAtRevision = 5; +} + +message PendingMember { + Member member = 1; + bytes addedByUserId = 2; + uint64 timestamp = 3; +} + +message RequestingMember { + bytes userId = 1; + bytes profileKey = 2; + bytes presentation = 3; // Only set when sending to server + uint64 timestamp = 4; +} + +message BannedMember { + bytes userId = 1; + uint64 timestamp = 2; +} + +message AccessControl { + enum AccessRequired { + UNKNOWN = 0; + ANY = 1; + MEMBER = 2; + ADMINISTRATOR = 3; + UNSATISFIABLE = 4; + } + + AccessRequired attributes = 1; + AccessRequired members = 2; + AccessRequired addFromInviteLink = 3; +} + +message Group { + 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 GroupChange { + + message Actions { + + message AddMemberAction { + Member added = 1; + bool joinFromInviteLink = 2; + } + + message DeleteMemberAction { + bytes deletedUserId = 1; + } + + message ModifyMemberRoleAction { + bytes userId = 1; + Member.Role role = 2; + } + + message ModifyMemberProfileKeyAction { + 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 AddPendingMemberAction { + PendingMember added = 1; + } + + message DeletePendingMemberAction { + bytes deletedUserId = 1; + } + + 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 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 AddRequestingMemberAction { + RequestingMember added = 1; + } + + message DeleteRequestingMemberAction { + bytes deletedUserId = 1; + } + + message PromoteRequestingMemberAction { + bytes userId = 1; + Member.Role role = 2; + } + + message AddBannedMemberAction { + BannedMember added = 1; + } + + message DeleteBannedMemberAction { + bytes deletedUserId = 1; + } + + message ModifyTitleAction { + bytes title = 1; + } + + message ModifyDescriptionAction { + bytes description = 1; + } + + message ModifyAvatarAction { + string avatar = 1; + } + + message ModifyDisappearingMessagesTimerAction { + bytes timer = 1; + } + + message ModifyAttributesAccessControlAction { + AccessControl.AccessRequired attributesAccess = 1; + } + + message ModifyMembersAccessControlAction { + AccessControl.AccessRequired membersAccess = 1; + } + + message ModifyAddFromInviteLinkAccessControlAction { + AccessControl.AccessRequired addFromInviteLinkAccess = 1; + } + + message ModifyInviteLinkPasswordAction { + bytes inviteLinkPassword = 1; + } + + message ModifyAnnouncementsOnlyAction { + bool announcementsOnly = 1; + } + + bytes sourceServiceId = 1; + 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; +} + +message GroupChanges { + message GroupChangeState { + GroupChange groupChange = 1; + Group groupState = 2; + } + + repeated GroupChangeState groupChanges = 1; +} + +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 new file mode 100644 index 0000000..446162e --- /dev/null +++ b/pkg/signalmeow/protobuf/Provisioning.pb.go @@ -0,0 +1,478 @@ +//* +// Copyright (C) 2014-2016 Open Whisper Systems +// +// Licensed according to the LICENSE file in this repository. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: Provisioning.proto + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ProvisioningVersion int32 + +const ( + ProvisioningVersion_INITIAL ProvisioningVersion = 0 + ProvisioningVersion_TABLET_SUPPORT ProvisioningVersion = 1 + ProvisioningVersion_CURRENT ProvisioningVersion = 1 +) + +// Enum value maps for ProvisioningVersion. +var ( + ProvisioningVersion_name = map[int32]string{ + 0: "INITIAL", + 1: "TABLET_SUPPORT", + // Duplicate value: 1: "CURRENT", + } + ProvisioningVersion_value = map[string]int32{ + "INITIAL": 0, + "TABLET_SUPPORT": 1, + "CURRENT": 1, + } +) + +func (x ProvisioningVersion) Enum() *ProvisioningVersion { + p := new(ProvisioningVersion) + *p = x + return p +} + +func (x ProvisioningVersion) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ProvisioningVersion) Descriptor() protoreflect.EnumDescriptor { + return file_Provisioning_proto_enumTypes[0].Descriptor() +} + +func (ProvisioningVersion) Type() protoreflect.EnumType { + return &file_Provisioning_proto_enumTypes[0] +} + +func (x ProvisioningVersion) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *ProvisioningVersion) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = ProvisioningVersion(num) + return nil +} + +// Deprecated: Use ProvisioningVersion.Descriptor instead. +func (ProvisioningVersion) EnumDescriptor() ([]byte, []int) { + return file_Provisioning_proto_rawDescGZIP(), []int{0} +} + +type ProvisioningUuid struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uuid *string `protobuf:"bytes,1,opt,name=uuid" json:"uuid,omitempty"` +} + +func (x *ProvisioningUuid) Reset() { + *x = ProvisioningUuid{} + if protoimpl.UnsafeEnabled { + mi := &file_Provisioning_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProvisioningUuid) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProvisioningUuid) ProtoMessage() {} + +func (x *ProvisioningUuid) ProtoReflect() protoreflect.Message { + mi := &file_Provisioning_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProvisioningUuid.ProtoReflect.Descriptor instead. +func (*ProvisioningUuid) Descriptor() ([]byte, []int) { + return file_Provisioning_proto_rawDescGZIP(), []int{0} +} + +func (x *ProvisioningUuid) GetUuid() string { + if x != nil && x.Uuid != nil { + return *x.Uuid + } + return "" +} + +type ProvisionEnvelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PublicKey []byte `protobuf:"bytes,1,opt,name=publicKey" json:"publicKey,omitempty"` + Body []byte `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"` // Encrypted ProvisionMessage +} + +func (x *ProvisionEnvelope) Reset() { + *x = ProvisionEnvelope{} + if protoimpl.UnsafeEnabled { + mi := &file_Provisioning_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProvisionEnvelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProvisionEnvelope) ProtoMessage() {} + +func (x *ProvisionEnvelope) ProtoReflect() protoreflect.Message { + mi := &file_Provisioning_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProvisionEnvelope.ProtoReflect.Descriptor instead. +func (*ProvisionEnvelope) Descriptor() ([]byte, []int) { + return file_Provisioning_proto_rawDescGZIP(), []int{1} +} + +func (x *ProvisionEnvelope) GetPublicKey() []byte { + if x != nil { + return x.PublicKey + } + return nil +} + +func (x *ProvisionEnvelope) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +type ProvisionMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AciIdentityKeyPublic []byte `protobuf:"bytes,1,opt,name=aciIdentityKeyPublic" json:"aciIdentityKeyPublic,omitempty"` + AciIdentityKeyPrivate []byte `protobuf:"bytes,2,opt,name=aciIdentityKeyPrivate" json:"aciIdentityKeyPrivate,omitempty"` + PniIdentityKeyPublic []byte `protobuf:"bytes,11,opt,name=pniIdentityKeyPublic" json:"pniIdentityKeyPublic,omitempty"` + PniIdentityKeyPrivate []byte `protobuf:"bytes,12,opt,name=pniIdentityKeyPrivate" json:"pniIdentityKeyPrivate,omitempty"` + Aci *string `protobuf:"bytes,8,opt,name=aci" json:"aci,omitempty"` + Pni *string `protobuf:"bytes,10,opt,name=pni" json:"pni,omitempty"` + Number *string `protobuf:"bytes,3,opt,name=number" json:"number,omitempty"` + ProvisioningCode *string `protobuf:"bytes,4,opt,name=provisioningCode" json:"provisioningCode,omitempty"` + UserAgent *string `protobuf:"bytes,5,opt,name=userAgent" json:"userAgent,omitempty"` + 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"` // NEXT ID: 14 +} + +func (x *ProvisionMessage) Reset() { + *x = ProvisionMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_Provisioning_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProvisionMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProvisionMessage) ProtoMessage() {} + +func (x *ProvisionMessage) ProtoReflect() protoreflect.Message { + mi := &file_Provisioning_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProvisionMessage.ProtoReflect.Descriptor instead. +func (*ProvisionMessage) Descriptor() ([]byte, []int) { + return file_Provisioning_proto_rawDescGZIP(), []int{2} +} + +func (x *ProvisionMessage) GetAciIdentityKeyPublic() []byte { + if x != nil { + return x.AciIdentityKeyPublic + } + return nil +} + +func (x *ProvisionMessage) GetAciIdentityKeyPrivate() []byte { + if x != nil { + return x.AciIdentityKeyPrivate + } + return nil +} + +func (x *ProvisionMessage) GetPniIdentityKeyPublic() []byte { + if x != nil { + return x.PniIdentityKeyPublic + } + return nil +} + +func (x *ProvisionMessage) GetPniIdentityKeyPrivate() []byte { + if x != nil { + return x.PniIdentityKeyPrivate + } + return nil +} + +func (x *ProvisionMessage) GetAci() string { + if x != nil && x.Aci != nil { + return *x.Aci + } + return "" +} + +func (x *ProvisionMessage) GetPni() string { + if x != nil && x.Pni != nil { + return *x.Pni + } + return "" +} + +func (x *ProvisionMessage) GetNumber() string { + if x != nil && x.Number != nil { + return *x.Number + } + return "" +} + +func (x *ProvisionMessage) GetProvisioningCode() string { + if x != nil && x.ProvisioningCode != nil { + return *x.ProvisioningCode + } + return "" +} + +func (x *ProvisionMessage) GetUserAgent() string { + if x != nil && x.UserAgent != nil { + return *x.UserAgent + } + return "" +} + +func (x *ProvisionMessage) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *ProvisionMessage) GetReadReceipts() bool { + if x != nil && x.ReadReceipts != nil { + return *x.ReadReceipts + } + return false +} + +func (x *ProvisionMessage) GetProvisioningVersion() uint32 { + if x != nil && x.ProvisioningVersion != nil { + return *x.ProvisioningVersion + } + return 0 +} + +func (x *ProvisionMessage) GetMasterKey() []byte { + if x != nil { + return x.MasterKey + } + return nil +} + +var File_Provisioning_proto protoreflect.FileDescriptor + +var file_Provisioning_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x22, 0x26, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x69, 0x6e, 0x67, 0x55, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x22, 0x45, 0x0a, 0x11, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, + 0x64, 0x79, 0x22, 0x80, 0x04, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x14, 0x61, 0x63, 0x69, 0x49, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x61, 0x63, 0x69, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x4b, 0x65, 0x79, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x34, 0x0a, 0x15, 0x61, + 0x63, 0x69, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x69, + 0x76, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x61, 0x63, 0x69, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, + 0x65, 0x12, 0x32, 0x0a, 0x14, 0x70, 0x6e, 0x69, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x4b, 0x65, 0x79, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x14, 0x70, 0x6e, 0x69, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x34, 0x0a, 0x15, 0x70, 0x6e, 0x69, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x0c, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x15, 0x70, 0x6e, 0x69, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x4b, 0x65, 0x79, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, + 0x63, 0x69, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x63, 0x69, 0x12, 0x10, 0x0a, + 0x03, 0x70, 0x6e, 0x69, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6e, 0x69, 0x12, + 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x43, + 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, + 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, + 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x73, 0x74, 0x65, + 0x72, 0x4b, 0x65, 0x79, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x4b, 0x65, 0x79, 0x2a, 0x47, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, + 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x41, 0x42, + 0x4c, 0x45, 0x54, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x43, 0x55, 0x52, 0x52, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x1a, 0x02, 0x10, 0x01, 0x42, 0x44, + 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x68, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x75, 0x73, 0x68, + 0x42, 0x12, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, +} + +var ( + file_Provisioning_proto_rawDescOnce sync.Once + file_Provisioning_proto_rawDescData = file_Provisioning_proto_rawDesc +) + +func file_Provisioning_proto_rawDescGZIP() []byte { + file_Provisioning_proto_rawDescOnce.Do(func() { + file_Provisioning_proto_rawDescData = protoimpl.X.CompressGZIP(file_Provisioning_proto_rawDescData) + }) + return file_Provisioning_proto_rawDescData +} + +var file_Provisioning_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_Provisioning_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_Provisioning_proto_goTypes = []interface{}{ + (ProvisioningVersion)(0), // 0: signalservice.ProvisioningVersion + (*ProvisioningUuid)(nil), // 1: signalservice.ProvisioningUuid + (*ProvisionEnvelope)(nil), // 2: signalservice.ProvisionEnvelope + (*ProvisionMessage)(nil), // 3: signalservice.ProvisionMessage +} +var file_Provisioning_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_Provisioning_proto_init() } +func file_Provisioning_proto_init() { + if File_Provisioning_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_Provisioning_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProvisioningUuid); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Provisioning_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProvisionEnvelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_Provisioning_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProvisionMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_Provisioning_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_Provisioning_proto_goTypes, + DependencyIndexes: file_Provisioning_proto_depIdxs, + EnumInfos: file_Provisioning_proto_enumTypes, + MessageInfos: file_Provisioning_proto_msgTypes, + }.Build() + File_Provisioning_proto = out.File + file_Provisioning_proto_rawDesc = nil + file_Provisioning_proto_goTypes = nil + file_Provisioning_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/Provisioning.proto b/pkg/signalmeow/protobuf/Provisioning.proto new file mode 100644 index 0000000..2b9bef4 --- /dev/null +++ b/pkg/signalmeow/protobuf/Provisioning.proto @@ -0,0 +1,45 @@ +/** + * Copyright (C) 2014-2016 Open Whisper Systems + * + * Licensed according to the LICENSE file in this repository. + */ +syntax = "proto2"; + +package signalservice; + +option java_package = "org.whispersystems.signalservice.internal.push"; +option java_outer_classname = "ProvisioningProtos"; + +message ProvisioningUuid { + optional string uuid = 1; +} + +message ProvisionEnvelope { + optional bytes publicKey = 1; + optional bytes body = 2; // Encrypted ProvisionMessage +} + +message ProvisionMessage { + optional bytes aciIdentityKeyPublic = 1; + optional bytes aciIdentityKeyPrivate = 2; + optional bytes pniIdentityKeyPublic = 11; + optional bytes pniIdentityKeyPrivate = 12; + optional string aci = 8; + optional string pni = 10; + optional string number = 3; + optional string provisioningCode = 4; + optional string userAgent = 5; + optional bytes profileKey = 6; + optional bool readReceipts = 7; + optional uint32 provisioningVersion = 9; + optional bytes masterKey = 13; + // NEXT ID: 14 +} + +enum ProvisioningVersion { + option allow_alias = true; + + INITIAL = 0; + TABLET_SUPPORT = 1; + CURRENT = 1; +} diff --git a/pkg/signalmeow/protobuf/SignalService.pb.go b/pkg/signalmeow/protobuf/SignalService.pb.go new file mode 100644 index 0000000..c27e635 --- /dev/null +++ b/pkg/signalmeow/protobuf/SignalService.pb.go @@ -0,0 +1,9455 @@ +//* +// Copyright (C) 2014-2016 Open Whisper Systems +// +// Licensed according to the LICENSE file in this repository. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: SignalService.proto + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Envelope_Type int32 + +const ( + Envelope_UNKNOWN Envelope_Type = 0 + Envelope_CIPHERTEXT Envelope_Type = 1 + Envelope_KEY_EXCHANGE Envelope_Type = 2 + Envelope_PREKEY_BUNDLE Envelope_Type = 3 + Envelope_RECEIPT Envelope_Type = 5 + Envelope_UNIDENTIFIED_SENDER Envelope_Type = 6 + Envelope_PLAINTEXT_CONTENT Envelope_Type = 8 +) + +// Enum value maps for Envelope_Type. +var ( + Envelope_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CIPHERTEXT", + 2: "KEY_EXCHANGE", + 3: "PREKEY_BUNDLE", + 5: "RECEIPT", + 6: "UNIDENTIFIED_SENDER", + 8: "PLAINTEXT_CONTENT", + } + Envelope_Type_value = map[string]int32{ + "UNKNOWN": 0, + "CIPHERTEXT": 1, + "KEY_EXCHANGE": 2, + "PREKEY_BUNDLE": 3, + "RECEIPT": 5, + "UNIDENTIFIED_SENDER": 6, + "PLAINTEXT_CONTENT": 8, + } +) + +func (x Envelope_Type) Enum() *Envelope_Type { + p := new(Envelope_Type) + *p = x + return p +} + +func (x Envelope_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Envelope_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[0].Descriptor() +} + +func (Envelope_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[0] +} + +func (x Envelope_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *Envelope_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = Envelope_Type(num) + return nil +} + +// Deprecated: Use Envelope_Type.Descriptor instead. +func (Envelope_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{0, 0} +} + +type CallMessage_Offer_Type int32 + +const ( + CallMessage_Offer_OFFER_AUDIO_CALL CallMessage_Offer_Type = 0 + CallMessage_Offer_OFFER_VIDEO_CALL CallMessage_Offer_Type = 1 +) + +// Enum value maps for CallMessage_Offer_Type. +var ( + CallMessage_Offer_Type_name = map[int32]string{ + 0: "OFFER_AUDIO_CALL", + 1: "OFFER_VIDEO_CALL", + } + CallMessage_Offer_Type_value = map[string]int32{ + "OFFER_AUDIO_CALL": 0, + "OFFER_VIDEO_CALL": 1, + } +) + +func (x CallMessage_Offer_Type) Enum() *CallMessage_Offer_Type { + p := new(CallMessage_Offer_Type) + *p = x + return p +} + +func (x CallMessage_Offer_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CallMessage_Offer_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[1].Descriptor() +} + +func (CallMessage_Offer_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[1] +} + +func (x CallMessage_Offer_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *CallMessage_Offer_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = CallMessage_Offer_Type(num) + return nil +} + +// Deprecated: Use CallMessage_Offer_Type.Descriptor instead. +func (CallMessage_Offer_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 0, 0} +} + +type CallMessage_Hangup_Type int32 + +const ( + CallMessage_Hangup_HANGUP_NORMAL CallMessage_Hangup_Type = 0 + CallMessage_Hangup_HANGUP_ACCEPTED CallMessage_Hangup_Type = 1 + CallMessage_Hangup_HANGUP_DECLINED CallMessage_Hangup_Type = 2 + CallMessage_Hangup_HANGUP_BUSY CallMessage_Hangup_Type = 3 + CallMessage_Hangup_HANGUP_NEED_PERMISSION CallMessage_Hangup_Type = 4 +) + +// Enum value maps for CallMessage_Hangup_Type. +var ( + CallMessage_Hangup_Type_name = map[int32]string{ + 0: "HANGUP_NORMAL", + 1: "HANGUP_ACCEPTED", + 2: "HANGUP_DECLINED", + 3: "HANGUP_BUSY", + 4: "HANGUP_NEED_PERMISSION", + } + CallMessage_Hangup_Type_value = map[string]int32{ + "HANGUP_NORMAL": 0, + "HANGUP_ACCEPTED": 1, + "HANGUP_DECLINED": 2, + "HANGUP_BUSY": 3, + "HANGUP_NEED_PERMISSION": 4, + } +) + +func (x CallMessage_Hangup_Type) Enum() *CallMessage_Hangup_Type { + p := new(CallMessage_Hangup_Type) + *p = x + return p +} + +func (x CallMessage_Hangup_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CallMessage_Hangup_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[2].Descriptor() +} + +func (CallMessage_Hangup_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[2] +} + +func (x CallMessage_Hangup_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *CallMessage_Hangup_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = CallMessage_Hangup_Type(num) + return nil +} + +// Deprecated: Use CallMessage_Hangup_Type.Descriptor instead. +func (CallMessage_Hangup_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 4, 0} +} + +type CallMessage_Opaque_Urgency int32 + +const ( + CallMessage_Opaque_DROPPABLE CallMessage_Opaque_Urgency = 0 + CallMessage_Opaque_HANDLE_IMMEDIATELY CallMessage_Opaque_Urgency = 1 +) + +// Enum value maps for CallMessage_Opaque_Urgency. +var ( + CallMessage_Opaque_Urgency_name = map[int32]string{ + 0: "DROPPABLE", + 1: "HANDLE_IMMEDIATELY", + } + CallMessage_Opaque_Urgency_value = map[string]int32{ + "DROPPABLE": 0, + "HANDLE_IMMEDIATELY": 1, + } +) + +func (x CallMessage_Opaque_Urgency) Enum() *CallMessage_Opaque_Urgency { + p := new(CallMessage_Opaque_Urgency) + *p = x + return p +} + +func (x CallMessage_Opaque_Urgency) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CallMessage_Opaque_Urgency) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[3].Descriptor() +} + +func (CallMessage_Opaque_Urgency) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[3] +} + +func (x CallMessage_Opaque_Urgency) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *CallMessage_Opaque_Urgency) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = CallMessage_Opaque_Urgency(num) + return nil +} + +// Deprecated: Use CallMessage_Opaque_Urgency.Descriptor instead. +func (CallMessage_Opaque_Urgency) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 5, 0} +} + +type BodyRange_Style int32 + +const ( + BodyRange_NONE BodyRange_Style = 0 + BodyRange_BOLD BodyRange_Style = 1 + BodyRange_ITALIC BodyRange_Style = 2 + BodyRange_SPOILER BodyRange_Style = 3 + BodyRange_STRIKETHROUGH BodyRange_Style = 4 + BodyRange_MONOSPACE BodyRange_Style = 5 +) + +// Enum value maps for BodyRange_Style. +var ( + BodyRange_Style_name = map[int32]string{ + 0: "NONE", + 1: "BOLD", + 2: "ITALIC", + 3: "SPOILER", + 4: "STRIKETHROUGH", + 5: "MONOSPACE", + } + BodyRange_Style_value = map[string]int32{ + "NONE": 0, + "BOLD": 1, + "ITALIC": 2, + "SPOILER": 3, + "STRIKETHROUGH": 4, + "MONOSPACE": 5, + } +) + +func (x BodyRange_Style) Enum() *BodyRange_Style { + p := new(BodyRange_Style) + *p = x + return p +} + +func (x BodyRange_Style) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (BodyRange_Style) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[4].Descriptor() +} + +func (BodyRange_Style) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[4] +} + +func (x BodyRange_Style) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *BodyRange_Style) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = BodyRange_Style(num) + return nil +} + +// Deprecated: Use BodyRange_Style.Descriptor instead. +func (BodyRange_Style) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{3, 0} +} + +type DataMessage_Flags int32 + +const ( + DataMessage_END_SESSION DataMessage_Flags = 1 + DataMessage_EXPIRATION_TIMER_UPDATE DataMessage_Flags = 2 + DataMessage_PROFILE_KEY_UPDATE DataMessage_Flags = 4 +) + +// Enum value maps for DataMessage_Flags. +var ( + DataMessage_Flags_name = map[int32]string{ + 1: "END_SESSION", + 2: "EXPIRATION_TIMER_UPDATE", + 4: "PROFILE_KEY_UPDATE", + } + DataMessage_Flags_value = map[string]int32{ + "END_SESSION": 1, + "EXPIRATION_TIMER_UPDATE": 2, + "PROFILE_KEY_UPDATE": 4, + } +) + +func (x DataMessage_Flags) Enum() *DataMessage_Flags { + p := new(DataMessage_Flags) + *p = x + return p +} + +func (x DataMessage_Flags) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataMessage_Flags) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[5].Descriptor() +} + +func (DataMessage_Flags) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[5] +} + +func (x DataMessage_Flags) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DataMessage_Flags) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = DataMessage_Flags(num) + return nil +} + +// Deprecated: Use DataMessage_Flags.Descriptor instead. +func (DataMessage_Flags) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 0} +} + +type DataMessage_ProtocolVersion int32 + +const ( + DataMessage_INITIAL DataMessage_ProtocolVersion = 0 + DataMessage_MESSAGE_TIMERS DataMessage_ProtocolVersion = 1 + DataMessage_VIEW_ONCE DataMessage_ProtocolVersion = 2 + DataMessage_VIEW_ONCE_VIDEO DataMessage_ProtocolVersion = 3 + DataMessage_REACTIONS DataMessage_ProtocolVersion = 4 + DataMessage_CDN_SELECTOR_ATTACHMENTS DataMessage_ProtocolVersion = 5 + DataMessage_MENTIONS DataMessage_ProtocolVersion = 6 + DataMessage_PAYMENTS DataMessage_ProtocolVersion = 7 + DataMessage_CURRENT DataMessage_ProtocolVersion = 7 +) + +// Enum value maps for DataMessage_ProtocolVersion. +var ( + DataMessage_ProtocolVersion_name = map[int32]string{ + 0: "INITIAL", + 1: "MESSAGE_TIMERS", + 2: "VIEW_ONCE", + 3: "VIEW_ONCE_VIDEO", + 4: "REACTIONS", + 5: "CDN_SELECTOR_ATTACHMENTS", + 6: "MENTIONS", + 7: "PAYMENTS", + // Duplicate value: 7: "CURRENT", + } + DataMessage_ProtocolVersion_value = map[string]int32{ + "INITIAL": 0, + "MESSAGE_TIMERS": 1, + "VIEW_ONCE": 2, + "VIEW_ONCE_VIDEO": 3, + "REACTIONS": 4, + "CDN_SELECTOR_ATTACHMENTS": 5, + "MENTIONS": 6, + "PAYMENTS": 7, + "CURRENT": 7, + } +) + +func (x DataMessage_ProtocolVersion) Enum() *DataMessage_ProtocolVersion { + p := new(DataMessage_ProtocolVersion) + *p = x + return p +} + +func (x DataMessage_ProtocolVersion) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataMessage_ProtocolVersion) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[6].Descriptor() +} + +func (DataMessage_ProtocolVersion) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[6] +} + +func (x DataMessage_ProtocolVersion) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DataMessage_ProtocolVersion) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = DataMessage_ProtocolVersion(num) + return nil +} + +// Deprecated: Use DataMessage_ProtocolVersion.Descriptor instead. +func (DataMessage_ProtocolVersion) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1} +} + +type DataMessage_Quote_Type int32 + +const ( + DataMessage_Quote_NORMAL DataMessage_Quote_Type = 0 + DataMessage_Quote_GIFT_BADGE DataMessage_Quote_Type = 1 +) + +// Enum value maps for DataMessage_Quote_Type. +var ( + DataMessage_Quote_Type_name = map[int32]string{ + 0: "NORMAL", + 1: "GIFT_BADGE", + } + DataMessage_Quote_Type_value = map[string]int32{ + "NORMAL": 0, + "GIFT_BADGE": 1, + } +) + +func (x DataMessage_Quote_Type) Enum() *DataMessage_Quote_Type { + p := new(DataMessage_Quote_Type) + *p = x + return p +} + +func (x DataMessage_Quote_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataMessage_Quote_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[7].Descriptor() +} + +func (DataMessage_Quote_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[7] +} + +func (x DataMessage_Quote_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DataMessage_Quote_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = DataMessage_Quote_Type(num) + return nil +} + +// Deprecated: Use DataMessage_Quote_Type.Descriptor instead. +func (DataMessage_Quote_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 0, 0} +} + +type DataMessage_Contact_Phone_Type int32 + +const ( + DataMessage_Contact_Phone_HOME DataMessage_Contact_Phone_Type = 1 + DataMessage_Contact_Phone_MOBILE DataMessage_Contact_Phone_Type = 2 + DataMessage_Contact_Phone_WORK DataMessage_Contact_Phone_Type = 3 + DataMessage_Contact_Phone_CUSTOM DataMessage_Contact_Phone_Type = 4 +) + +// Enum value maps for DataMessage_Contact_Phone_Type. +var ( + DataMessage_Contact_Phone_Type_name = map[int32]string{ + 1: "HOME", + 2: "MOBILE", + 3: "WORK", + 4: "CUSTOM", + } + DataMessage_Contact_Phone_Type_value = map[string]int32{ + "HOME": 1, + "MOBILE": 2, + "WORK": 3, + "CUSTOM": 4, + } +) + +func (x DataMessage_Contact_Phone_Type) Enum() *DataMessage_Contact_Phone_Type { + p := new(DataMessage_Contact_Phone_Type) + *p = x + return p +} + +func (x DataMessage_Contact_Phone_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataMessage_Contact_Phone_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[8].Descriptor() +} + +func (DataMessage_Contact_Phone_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[8] +} + +func (x DataMessage_Contact_Phone_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DataMessage_Contact_Phone_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = DataMessage_Contact_Phone_Type(num) + return nil +} + +// Deprecated: Use DataMessage_Contact_Phone_Type.Descriptor instead. +func (DataMessage_Contact_Phone_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 1, 0} +} + +type DataMessage_Contact_Email_Type int32 + +const ( + DataMessage_Contact_Email_HOME DataMessage_Contact_Email_Type = 1 + DataMessage_Contact_Email_MOBILE DataMessage_Contact_Email_Type = 2 + DataMessage_Contact_Email_WORK DataMessage_Contact_Email_Type = 3 + DataMessage_Contact_Email_CUSTOM DataMessage_Contact_Email_Type = 4 +) + +// Enum value maps for DataMessage_Contact_Email_Type. +var ( + DataMessage_Contact_Email_Type_name = map[int32]string{ + 1: "HOME", + 2: "MOBILE", + 3: "WORK", + 4: "CUSTOM", + } + DataMessage_Contact_Email_Type_value = map[string]int32{ + "HOME": 1, + "MOBILE": 2, + "WORK": 3, + "CUSTOM": 4, + } +) + +func (x DataMessage_Contact_Email_Type) Enum() *DataMessage_Contact_Email_Type { + p := new(DataMessage_Contact_Email_Type) + *p = x + return p +} + +func (x DataMessage_Contact_Email_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataMessage_Contact_Email_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[9].Descriptor() +} + +func (DataMessage_Contact_Email_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[9] +} + +func (x DataMessage_Contact_Email_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DataMessage_Contact_Email_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = DataMessage_Contact_Email_Type(num) + return nil +} + +// Deprecated: Use DataMessage_Contact_Email_Type.Descriptor instead. +func (DataMessage_Contact_Email_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 2, 0} +} + +type DataMessage_Contact_PostalAddress_Type int32 + +const ( + DataMessage_Contact_PostalAddress_HOME DataMessage_Contact_PostalAddress_Type = 1 + DataMessage_Contact_PostalAddress_WORK DataMessage_Contact_PostalAddress_Type = 2 + DataMessage_Contact_PostalAddress_CUSTOM DataMessage_Contact_PostalAddress_Type = 3 +) + +// Enum value maps for DataMessage_Contact_PostalAddress_Type. +var ( + DataMessage_Contact_PostalAddress_Type_name = map[int32]string{ + 1: "HOME", + 2: "WORK", + 3: "CUSTOM", + } + DataMessage_Contact_PostalAddress_Type_value = map[string]int32{ + "HOME": 1, + "WORK": 2, + "CUSTOM": 3, + } +) + +func (x DataMessage_Contact_PostalAddress_Type) Enum() *DataMessage_Contact_PostalAddress_Type { + p := new(DataMessage_Contact_PostalAddress_Type) + *p = x + return p +} + +func (x DataMessage_Contact_PostalAddress_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataMessage_Contact_PostalAddress_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[10].Descriptor() +} + +func (DataMessage_Contact_PostalAddress_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[10] +} + +func (x DataMessage_Contact_PostalAddress_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DataMessage_Contact_PostalAddress_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = DataMessage_Contact_PostalAddress_Type(num) + return nil +} + +// Deprecated: Use DataMessage_Contact_PostalAddress_Type.Descriptor instead. +func (DataMessage_Contact_PostalAddress_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 3, 0} +} + +type DataMessage_Payment_Activation_Type int32 + +const ( + DataMessage_Payment_Activation_REQUEST DataMessage_Payment_Activation_Type = 0 + DataMessage_Payment_Activation_ACTIVATED DataMessage_Payment_Activation_Type = 1 +) + +// Enum value maps for DataMessage_Payment_Activation_Type. +var ( + DataMessage_Payment_Activation_Type_name = map[int32]string{ + 0: "REQUEST", + 1: "ACTIVATED", + } + DataMessage_Payment_Activation_Type_value = map[string]int32{ + "REQUEST": 0, + "ACTIVATED": 1, + } +) + +func (x DataMessage_Payment_Activation_Type) Enum() *DataMessage_Payment_Activation_Type { + p := new(DataMessage_Payment_Activation_Type) + *p = x + return p +} + +func (x DataMessage_Payment_Activation_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (DataMessage_Payment_Activation_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[11].Descriptor() +} + +func (DataMessage_Payment_Activation_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[11] +} + +func (x DataMessage_Payment_Activation_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *DataMessage_Payment_Activation_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = DataMessage_Payment_Activation_Type(num) + return nil +} + +// Deprecated: Use DataMessage_Payment_Activation_Type.Descriptor instead. +func (DataMessage_Payment_Activation_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 7, 2, 0} +} + +type ReceiptMessage_Type int32 + +const ( + ReceiptMessage_DELIVERY ReceiptMessage_Type = 0 + ReceiptMessage_READ ReceiptMessage_Type = 1 + ReceiptMessage_VIEWED ReceiptMessage_Type = 2 +) + +// Enum value maps for ReceiptMessage_Type. +var ( + ReceiptMessage_Type_name = map[int32]string{ + 0: "DELIVERY", + 1: "READ", + 2: "VIEWED", + } + ReceiptMessage_Type_value = map[string]int32{ + "DELIVERY": 0, + "READ": 1, + "VIEWED": 2, + } +) + +func (x ReceiptMessage_Type) Enum() *ReceiptMessage_Type { + p := new(ReceiptMessage_Type) + *p = x + return p +} + +func (x ReceiptMessage_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ReceiptMessage_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[12].Descriptor() +} + +func (ReceiptMessage_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[12] +} + +func (x ReceiptMessage_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *ReceiptMessage_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = ReceiptMessage_Type(num) + return nil +} + +// Deprecated: Use ReceiptMessage_Type.Descriptor instead. +func (ReceiptMessage_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{6, 0} +} + +type TypingMessage_Action int32 + +const ( + TypingMessage_STARTED TypingMessage_Action = 0 + TypingMessage_STOPPED TypingMessage_Action = 1 +) + +// Enum value maps for TypingMessage_Action. +var ( + TypingMessage_Action_name = map[int32]string{ + 0: "STARTED", + 1: "STOPPED", + } + TypingMessage_Action_value = map[string]int32{ + "STARTED": 0, + "STOPPED": 1, + } +) + +func (x TypingMessage_Action) Enum() *TypingMessage_Action { + p := new(TypingMessage_Action) + *p = x + return p +} + +func (x TypingMessage_Action) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TypingMessage_Action) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[13].Descriptor() +} + +func (TypingMessage_Action) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[13] +} + +func (x TypingMessage_Action) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *TypingMessage_Action) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = TypingMessage_Action(num) + return nil +} + +// Deprecated: Use TypingMessage_Action.Descriptor instead. +func (TypingMessage_Action) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{7, 0} +} + +type TextAttachment_Style int32 + +const ( + TextAttachment_DEFAULT TextAttachment_Style = 0 + TextAttachment_REGULAR TextAttachment_Style = 1 + TextAttachment_BOLD TextAttachment_Style = 2 + TextAttachment_SERIF TextAttachment_Style = 3 + TextAttachment_SCRIPT TextAttachment_Style = 4 + TextAttachment_CONDENSED TextAttachment_Style = 5 +) + +// Enum value maps for TextAttachment_Style. +var ( + TextAttachment_Style_name = map[int32]string{ + 0: "DEFAULT", + 1: "REGULAR", + 2: "BOLD", + 3: "SERIF", + 4: "SCRIPT", + 5: "CONDENSED", + } + TextAttachment_Style_value = map[string]int32{ + "DEFAULT": 0, + "REGULAR": 1, + "BOLD": 2, + "SERIF": 3, + "SCRIPT": 4, + "CONDENSED": 5, + } +) + +func (x TextAttachment_Style) Enum() *TextAttachment_Style { + p := new(TextAttachment_Style) + *p = x + return p +} + +func (x TextAttachment_Style) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TextAttachment_Style) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[14].Descriptor() +} + +func (TextAttachment_Style) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[14] +} + +func (x TextAttachment_Style) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *TextAttachment_Style) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = TextAttachment_Style(num) + return nil +} + +// Deprecated: Use TextAttachment_Style.Descriptor instead. +func (TextAttachment_Style) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{10, 0} +} + +type Verified_State int32 + +const ( + Verified_DEFAULT Verified_State = 0 + Verified_VERIFIED Verified_State = 1 + Verified_UNVERIFIED Verified_State = 2 +) + +// Enum value maps for Verified_State. +var ( + Verified_State_name = map[int32]string{ + 0: "DEFAULT", + 1: "VERIFIED", + 2: "UNVERIFIED", + } + Verified_State_value = map[string]int32{ + "DEFAULT": 0, + "VERIFIED": 1, + "UNVERIFIED": 2, + } +) + +func (x Verified_State) Enum() *Verified_State { + p := new(Verified_State) + *p = x + return p +} + +func (x Verified_State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Verified_State) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[15].Descriptor() +} + +func (Verified_State) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[15] +} + +func (x Verified_State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *Verified_State) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = Verified_State(num) + return nil +} + +// Deprecated: Use Verified_State.Descriptor instead. +func (Verified_State) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{11, 0} +} + +type SyncMessage_Request_Type int32 + +const ( + SyncMessage_Request_UNKNOWN SyncMessage_Request_Type = 0 + SyncMessage_Request_CONTACTS SyncMessage_Request_Type = 1 + // GROUPS = 2; + SyncMessage_Request_BLOCKED SyncMessage_Request_Type = 3 + SyncMessage_Request_CONFIGURATION SyncMessage_Request_Type = 4 + SyncMessage_Request_KEYS SyncMessage_Request_Type = 5 + SyncMessage_Request_PNI_IDENTITY SyncMessage_Request_Type = 6 +) + +// Enum value maps for SyncMessage_Request_Type. +var ( + SyncMessage_Request_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CONTACTS", + 3: "BLOCKED", + 4: "CONFIGURATION", + 5: "KEYS", + 6: "PNI_IDENTITY", + } + SyncMessage_Request_Type_value = map[string]int32{ + "UNKNOWN": 0, + "CONTACTS": 1, + "BLOCKED": 3, + "CONFIGURATION": 4, + "KEYS": 5, + "PNI_IDENTITY": 6, + } +) + +func (x SyncMessage_Request_Type) Enum() *SyncMessage_Request_Type { + p := new(SyncMessage_Request_Type) + *p = x + return p +} + +func (x SyncMessage_Request_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_Request_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[16].Descriptor() +} + +func (SyncMessage_Request_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[16] +} + +func (x SyncMessage_Request_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_Request_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_Request_Type(num) + return nil +} + +// Deprecated: Use SyncMessage_Request_Type.Descriptor instead. +func (SyncMessage_Request_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 3, 0} +} + +type SyncMessage_StickerPackOperation_Type int32 + +const ( + SyncMessage_StickerPackOperation_INSTALL SyncMessage_StickerPackOperation_Type = 0 + SyncMessage_StickerPackOperation_REMOVE SyncMessage_StickerPackOperation_Type = 1 +) + +// Enum value maps for SyncMessage_StickerPackOperation_Type. +var ( + SyncMessage_StickerPackOperation_Type_name = map[int32]string{ + 0: "INSTALL", + 1: "REMOVE", + } + SyncMessage_StickerPackOperation_Type_value = map[string]int32{ + "INSTALL": 0, + "REMOVE": 1, + } +) + +func (x SyncMessage_StickerPackOperation_Type) Enum() *SyncMessage_StickerPackOperation_Type { + p := new(SyncMessage_StickerPackOperation_Type) + *p = x + return p +} + +func (x SyncMessage_StickerPackOperation_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_StickerPackOperation_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[17].Descriptor() +} + +func (SyncMessage_StickerPackOperation_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[17] +} + +func (x SyncMessage_StickerPackOperation_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_StickerPackOperation_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_StickerPackOperation_Type(num) + return nil +} + +// Deprecated: Use SyncMessage_StickerPackOperation_Type.Descriptor instead. +func (SyncMessage_StickerPackOperation_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 7, 0} +} + +type SyncMessage_FetchLatest_Type int32 + +const ( + SyncMessage_FetchLatest_UNKNOWN SyncMessage_FetchLatest_Type = 0 + SyncMessage_FetchLatest_LOCAL_PROFILE SyncMessage_FetchLatest_Type = 1 + SyncMessage_FetchLatest_STORAGE_MANIFEST SyncMessage_FetchLatest_Type = 2 + SyncMessage_FetchLatest_SUBSCRIPTION_STATUS SyncMessage_FetchLatest_Type = 3 +) + +// Enum value maps for SyncMessage_FetchLatest_Type. +var ( + SyncMessage_FetchLatest_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "LOCAL_PROFILE", + 2: "STORAGE_MANIFEST", + 3: "SUBSCRIPTION_STATUS", + } + SyncMessage_FetchLatest_Type_value = map[string]int32{ + "UNKNOWN": 0, + "LOCAL_PROFILE": 1, + "STORAGE_MANIFEST": 2, + "SUBSCRIPTION_STATUS": 3, + } +) + +func (x SyncMessage_FetchLatest_Type) Enum() *SyncMessage_FetchLatest_Type { + p := new(SyncMessage_FetchLatest_Type) + *p = x + return p +} + +func (x SyncMessage_FetchLatest_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_FetchLatest_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[18].Descriptor() +} + +func (SyncMessage_FetchLatest_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[18] +} + +func (x SyncMessage_FetchLatest_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_FetchLatest_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_FetchLatest_Type(num) + return nil +} + +// Deprecated: Use SyncMessage_FetchLatest_Type.Descriptor instead. +func (SyncMessage_FetchLatest_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 9, 0} +} + +type SyncMessage_MessageRequestResponse_Type int32 + +const ( + SyncMessage_MessageRequestResponse_UNKNOWN SyncMessage_MessageRequestResponse_Type = 0 + SyncMessage_MessageRequestResponse_ACCEPT SyncMessage_MessageRequestResponse_Type = 1 + SyncMessage_MessageRequestResponse_DELETE SyncMessage_MessageRequestResponse_Type = 2 + SyncMessage_MessageRequestResponse_BLOCK SyncMessage_MessageRequestResponse_Type = 3 + SyncMessage_MessageRequestResponse_BLOCK_AND_DELETE SyncMessage_MessageRequestResponse_Type = 4 +) + +// Enum value maps for SyncMessage_MessageRequestResponse_Type. +var ( + SyncMessage_MessageRequestResponse_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ACCEPT", + 2: "DELETE", + 3: "BLOCK", + 4: "BLOCK_AND_DELETE", + } + SyncMessage_MessageRequestResponse_Type_value = map[string]int32{ + "UNKNOWN": 0, + "ACCEPT": 1, + "DELETE": 2, + "BLOCK": 3, + "BLOCK_AND_DELETE": 4, + } +) + +func (x SyncMessage_MessageRequestResponse_Type) Enum() *SyncMessage_MessageRequestResponse_Type { + p := new(SyncMessage_MessageRequestResponse_Type) + *p = x + return p +} + +func (x SyncMessage_MessageRequestResponse_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_MessageRequestResponse_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[19].Descriptor() +} + +func (SyncMessage_MessageRequestResponse_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[19] +} + +func (x SyncMessage_MessageRequestResponse_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_MessageRequestResponse_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_MessageRequestResponse_Type(num) + return nil +} + +// Deprecated: Use SyncMessage_MessageRequestResponse_Type.Descriptor instead. +func (SyncMessage_MessageRequestResponse_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 11, 0} +} + +type SyncMessage_CallEvent_Type int32 + +const ( + SyncMessage_CallEvent_UNKNOWN_TYPE SyncMessage_CallEvent_Type = 0 + SyncMessage_CallEvent_AUDIO_CALL SyncMessage_CallEvent_Type = 1 + SyncMessage_CallEvent_VIDEO_CALL SyncMessage_CallEvent_Type = 2 + SyncMessage_CallEvent_GROUP_CALL SyncMessage_CallEvent_Type = 3 + SyncMessage_CallEvent_AD_HOC_CALL SyncMessage_CallEvent_Type = 4 +) + +// Enum value maps for SyncMessage_CallEvent_Type. +var ( + SyncMessage_CallEvent_Type_name = map[int32]string{ + 0: "UNKNOWN_TYPE", + 1: "AUDIO_CALL", + 2: "VIDEO_CALL", + 3: "GROUP_CALL", + 4: "AD_HOC_CALL", + } + SyncMessage_CallEvent_Type_value = map[string]int32{ + "UNKNOWN_TYPE": 0, + "AUDIO_CALL": 1, + "VIDEO_CALL": 2, + "GROUP_CALL": 3, + "AD_HOC_CALL": 4, + } +) + +func (x SyncMessage_CallEvent_Type) Enum() *SyncMessage_CallEvent_Type { + p := new(SyncMessage_CallEvent_Type) + *p = x + return p +} + +func (x SyncMessage_CallEvent_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_CallEvent_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[20].Descriptor() +} + +func (SyncMessage_CallEvent_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[20] +} + +func (x SyncMessage_CallEvent_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_CallEvent_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_CallEvent_Type(num) + return nil +} + +// Deprecated: Use SyncMessage_CallEvent_Type.Descriptor instead. +func (SyncMessage_CallEvent_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 14, 0} +} + +type SyncMessage_CallEvent_Direction int32 + +const ( + SyncMessage_CallEvent_UNKNOWN_DIRECTION SyncMessage_CallEvent_Direction = 0 + SyncMessage_CallEvent_INCOMING SyncMessage_CallEvent_Direction = 1 + SyncMessage_CallEvent_OUTGOING SyncMessage_CallEvent_Direction = 2 +) + +// Enum value maps for SyncMessage_CallEvent_Direction. +var ( + SyncMessage_CallEvent_Direction_name = map[int32]string{ + 0: "UNKNOWN_DIRECTION", + 1: "INCOMING", + 2: "OUTGOING", + } + SyncMessage_CallEvent_Direction_value = map[string]int32{ + "UNKNOWN_DIRECTION": 0, + "INCOMING": 1, + "OUTGOING": 2, + } +) + +func (x SyncMessage_CallEvent_Direction) Enum() *SyncMessage_CallEvent_Direction { + p := new(SyncMessage_CallEvent_Direction) + *p = x + return p +} + +func (x SyncMessage_CallEvent_Direction) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_CallEvent_Direction) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[21].Descriptor() +} + +func (SyncMessage_CallEvent_Direction) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[21] +} + +func (x SyncMessage_CallEvent_Direction) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_CallEvent_Direction) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_CallEvent_Direction(num) + return nil +} + +// Deprecated: Use SyncMessage_CallEvent_Direction.Descriptor instead. +func (SyncMessage_CallEvent_Direction) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 14, 1} +} + +type SyncMessage_CallEvent_Event int32 + +const ( + SyncMessage_CallEvent_UNKNOWN_ACTION SyncMessage_CallEvent_Event = 0 + SyncMessage_CallEvent_ACCEPTED SyncMessage_CallEvent_Event = 1 + SyncMessage_CallEvent_NOT_ACCEPTED SyncMessage_CallEvent_Event = 2 + SyncMessage_CallEvent_DELETE SyncMessage_CallEvent_Event = 3 +) + +// Enum value maps for SyncMessage_CallEvent_Event. +var ( + SyncMessage_CallEvent_Event_name = map[int32]string{ + 0: "UNKNOWN_ACTION", + 1: "ACCEPTED", + 2: "NOT_ACCEPTED", + 3: "DELETE", + } + SyncMessage_CallEvent_Event_value = map[string]int32{ + "UNKNOWN_ACTION": 0, + "ACCEPTED": 1, + "NOT_ACCEPTED": 2, + "DELETE": 3, + } +) + +func (x SyncMessage_CallEvent_Event) Enum() *SyncMessage_CallEvent_Event { + p := new(SyncMessage_CallEvent_Event) + *p = x + return p +} + +func (x SyncMessage_CallEvent_Event) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_CallEvent_Event) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[22].Descriptor() +} + +func (SyncMessage_CallEvent_Event) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[22] +} + +func (x SyncMessage_CallEvent_Event) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_CallEvent_Event) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_CallEvent_Event(num) + return nil +} + +// Deprecated: Use SyncMessage_CallEvent_Event.Descriptor instead. +func (SyncMessage_CallEvent_Event) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 14, 2} +} + +type SyncMessage_CallLogEvent_Type int32 + +const ( + SyncMessage_CallLogEvent_CLEAR SyncMessage_CallLogEvent_Type = 0 +) + +// Enum value maps for SyncMessage_CallLogEvent_Type. +var ( + SyncMessage_CallLogEvent_Type_name = map[int32]string{ + 0: "CLEAR", + } + SyncMessage_CallLogEvent_Type_value = map[string]int32{ + "CLEAR": 0, + } +) + +func (x SyncMessage_CallLogEvent_Type) Enum() *SyncMessage_CallLogEvent_Type { + p := new(SyncMessage_CallLogEvent_Type) + *p = x + return p +} + +func (x SyncMessage_CallLogEvent_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SyncMessage_CallLogEvent_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[23].Descriptor() +} + +func (SyncMessage_CallLogEvent_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[23] +} + +func (x SyncMessage_CallLogEvent_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SyncMessage_CallLogEvent_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SyncMessage_CallLogEvent_Type(num) + return nil +} + +// Deprecated: Use SyncMessage_CallLogEvent_Type.Descriptor instead. +func (SyncMessage_CallLogEvent_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 16, 0} +} + +type AttachmentPointer_Flags int32 + +const ( + AttachmentPointer_VOICE_MESSAGE AttachmentPointer_Flags = 1 + AttachmentPointer_BORDERLESS AttachmentPointer_Flags = 2 + AttachmentPointer_GIF AttachmentPointer_Flags = 4 +) + +// Enum value maps for AttachmentPointer_Flags. +var ( + AttachmentPointer_Flags_name = map[int32]string{ + 1: "VOICE_MESSAGE", + 2: "BORDERLESS", + 4: "GIF", + } + AttachmentPointer_Flags_value = map[string]int32{ + "VOICE_MESSAGE": 1, + "BORDERLESS": 2, + "GIF": 4, + } +) + +func (x AttachmentPointer_Flags) Enum() *AttachmentPointer_Flags { + p := new(AttachmentPointer_Flags) + *p = x + return p +} + +func (x AttachmentPointer_Flags) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AttachmentPointer_Flags) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[24].Descriptor() +} + +func (AttachmentPointer_Flags) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[24] +} + +func (x AttachmentPointer_Flags) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *AttachmentPointer_Flags) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = AttachmentPointer_Flags(num) + return nil +} + +// Deprecated: Use AttachmentPointer_Flags.Descriptor instead. +func (AttachmentPointer_Flags) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{13, 0} +} + +type GroupContext_Type int32 + +const ( + GroupContext_UNKNOWN GroupContext_Type = 0 + GroupContext_UPDATE GroupContext_Type = 1 + GroupContext_DELIVER GroupContext_Type = 2 + GroupContext_QUIT GroupContext_Type = 3 + GroupContext_REQUEST_INFO GroupContext_Type = 4 +) + +// Enum value maps for GroupContext_Type. +var ( + GroupContext_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "UPDATE", + 2: "DELIVER", + 3: "QUIT", + 4: "REQUEST_INFO", + } + GroupContext_Type_value = map[string]int32{ + "UNKNOWN": 0, + "UPDATE": 1, + "DELIVER": 2, + "QUIT": 3, + "REQUEST_INFO": 4, + } +) + +func (x GroupContext_Type) Enum() *GroupContext_Type { + p := new(GroupContext_Type) + *p = x + return p +} + +func (x GroupContext_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GroupContext_Type) Descriptor() protoreflect.EnumDescriptor { + return file_SignalService_proto_enumTypes[25].Descriptor() +} + +func (GroupContext_Type) Type() protoreflect.EnumType { + return &file_SignalService_proto_enumTypes[25] +} + +func (x GroupContext_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *GroupContext_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = GroupContext_Type(num) + return nil +} + +// Deprecated: Use GroupContext_Type.Descriptor instead. +func (GroupContext_Type) EnumDescriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{14, 0} +} + +type Envelope struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` + Urgent *bool `protobuf:"varint,14,opt,name=urgent,def=1" json:"urgent,omitempty"` + Story *bool `protobuf:"varint,16,opt,name=story" json:"story,omitempty"` + ReportingToken []byte `protobuf:"bytes,17,opt,name=reportingToken" json:"reportingToken,omitempty"` // NEXT ID: 18 +} + +// Default values for Envelope fields. +const ( + Default_Envelope_Urgent = bool(true) +) + +func (x *Envelope) Reset() { + *x = Envelope{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Envelope) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Envelope) ProtoMessage() {} + +func (x *Envelope) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Envelope.ProtoReflect.Descriptor instead. +func (*Envelope) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{0} +} + +func (x *Envelope) GetType() Envelope_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return Envelope_UNKNOWN +} + +func (x *Envelope) GetSourceServiceId() string { + if x != nil && x.SourceServiceId != nil { + return *x.SourceServiceId + } + return "" +} + +func (x *Envelope) GetSourceDevice() uint32 { + if x != nil && x.SourceDevice != nil { + return *x.SourceDevice + } + return 0 +} + +func (x *Envelope) GetDestinationServiceId() string { + if x != nil && x.DestinationServiceId != nil { + return *x.DestinationServiceId + } + return "" +} + +func (x *Envelope) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +func (x *Envelope) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *Envelope) GetServerGuid() string { + if x != nil && x.ServerGuid != nil { + return *x.ServerGuid + } + return "" +} + +func (x *Envelope) GetServerTimestamp() uint64 { + if x != nil && x.ServerTimestamp != nil { + return *x.ServerTimestamp + } + return 0 +} + +func (x *Envelope) GetUrgent() bool { + if x != nil && x.Urgent != nil { + return *x.Urgent + } + return Default_Envelope_Urgent +} + +func (x *Envelope) GetStory() bool { + if x != nil && x.Story != nil { + return *x.Story + } + return false +} + +func (x *Envelope) GetReportingToken() []byte { + if x != nil { + return x.ReportingToken + } + return nil +} + +type Content struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *Content) Reset() { + *x = Content{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Content) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Content) ProtoMessage() {} + +func (x *Content) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Content.ProtoReflect.Descriptor instead. +func (*Content) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{1} +} + +func (x *Content) GetDataMessage() *DataMessage { + if x != nil { + return x.DataMessage + } + return nil +} + +func (x *Content) GetSyncMessage() *SyncMessage { + if x != nil { + return x.SyncMessage + } + return nil +} + +func (x *Content) GetCallMessage() *CallMessage { + if x != nil { + return x.CallMessage + } + return nil +} + +func (x *Content) GetNullMessage() *NullMessage { + if x != nil { + return x.NullMessage + } + return nil +} + +func (x *Content) GetReceiptMessage() *ReceiptMessage { + if x != nil { + return x.ReceiptMessage + } + return nil +} + +func (x *Content) GetTypingMessage() *TypingMessage { + if x != nil { + return x.TypingMessage + } + return nil +} + +func (x *Content) GetSenderKeyDistributionMessage() []byte { + if x != nil { + return x.SenderKeyDistributionMessage + } + 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 + } + return nil +} + +func (x *Content) GetEditMessage() *EditMessage { + if x != nil { + return x.EditMessage + } + return nil +} + +type CallMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Offer *CallMessage_Offer `protobuf:"bytes,1,opt,name=offer" json:"offer,omitempty"` + Answer *CallMessage_Answer `protobuf:"bytes,2,opt,name=answer" json:"answer,omitempty"` + IceUpdate []*CallMessage_IceUpdate `protobuf:"bytes,3,rep,name=iceUpdate" json:"iceUpdate,omitempty"` + Busy *CallMessage_Busy `protobuf:"bytes,5,opt,name=busy" json:"busy,omitempty"` + Hangup *CallMessage_Hangup `protobuf:"bytes,7,opt,name=hangup" json:"hangup,omitempty"` + DestinationDeviceId *uint32 `protobuf:"varint,9,opt,name=destinationDeviceId" json:"destinationDeviceId,omitempty"` + Opaque *CallMessage_Opaque `protobuf:"bytes,10,opt,name=opaque" json:"opaque,omitempty"` +} + +func (x *CallMessage) Reset() { + *x = CallMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallMessage) ProtoMessage() {} + +func (x *CallMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallMessage.ProtoReflect.Descriptor instead. +func (*CallMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2} +} + +func (x *CallMessage) GetOffer() *CallMessage_Offer { + if x != nil { + return x.Offer + } + return nil +} + +func (x *CallMessage) GetAnswer() *CallMessage_Answer { + if x != nil { + return x.Answer + } + return nil +} + +func (x *CallMessage) GetIceUpdate() []*CallMessage_IceUpdate { + if x != nil { + return x.IceUpdate + } + return nil +} + +func (x *CallMessage) GetBusy() *CallMessage_Busy { + if x != nil { + return x.Busy + } + return nil +} + +func (x *CallMessage) GetHangup() *CallMessage_Hangup { + if x != nil { + return x.Hangup + } + return nil +} + +func (x *CallMessage) GetDestinationDeviceId() uint32 { + if x != nil && x.DestinationDeviceId != nil { + return *x.DestinationDeviceId + } + return 0 +} + +func (x *CallMessage) GetOpaque() *CallMessage_Opaque { + if x != nil { + return x.Opaque + } + return nil +} + +type BodyRange struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Start *uint32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` + // Types that are assignable to AssociatedValue: + // + // *BodyRange_MentionAci + // *BodyRange_Style_ + AssociatedValue isBodyRange_AssociatedValue `protobuf_oneof:"associatedValue"` +} + +func (x *BodyRange) Reset() { + *x = BodyRange{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BodyRange) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BodyRange) ProtoMessage() {} + +func (x *BodyRange) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BodyRange.ProtoReflect.Descriptor instead. +func (*BodyRange) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{3} +} + +func (x *BodyRange) GetStart() uint32 { + if x != nil && x.Start != nil { + return *x.Start + } + return 0 +} + +func (x *BodyRange) GetLength() uint32 { + if x != nil && x.Length != nil { + return *x.Length + } + return 0 +} + +func (m *BodyRange) GetAssociatedValue() isBodyRange_AssociatedValue { + if m != nil { + return m.AssociatedValue + } + return nil +} + +func (x *BodyRange) GetMentionAci() string { + if x, ok := x.GetAssociatedValue().(*BodyRange_MentionAci); ok { + return x.MentionAci + } + return "" +} + +func (x *BodyRange) GetStyle() BodyRange_Style { + if x, ok := x.GetAssociatedValue().(*BodyRange_Style_); ok { + return x.Style + } + return BodyRange_NONE +} + +type isBodyRange_AssociatedValue interface { + isBodyRange_AssociatedValue() +} + +type BodyRange_MentionAci struct { + MentionAci string `protobuf:"bytes,3,opt,name=mentionAci,oneof"` +} + +type BodyRange_Style_ struct { + Style BodyRange_Style `protobuf:"varint,4,opt,name=style,enum=signalservice.BodyRange_Style,oneof"` +} + +func (*BodyRange_MentionAci) isBodyRange_AssociatedValue() {} + +func (*BodyRange_Style_) isBodyRange_AssociatedValue() {} + +type DataMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Body *string `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` + Attachments []*AttachmentPointer `protobuf:"bytes,2,rep,name=attachments" json:"attachments,omitempty"` + GroupV2 *GroupContextV2 `protobuf:"bytes,15,opt,name=groupV2" json:"groupV2,omitempty"` + Flags *uint32 `protobuf:"varint,4,opt,name=flags" json:"flags,omitempty"` + ExpireTimer *uint32 `protobuf:"varint,5,opt,name=expireTimer" json:"expireTimer,omitempty"` + ProfileKey []byte `protobuf:"bytes,6,opt,name=profileKey" json:"profileKey,omitempty"` + Timestamp *uint64 `protobuf:"varint,7,opt,name=timestamp" json:"timestamp,omitempty"` + Quote *DataMessage_Quote `protobuf:"bytes,8,opt,name=quote" json:"quote,omitempty"` + Contact []*DataMessage_Contact `protobuf:"bytes,9,rep,name=contact" json:"contact,omitempty"` + Preview []*Preview `protobuf:"bytes,10,rep,name=preview" json:"preview,omitempty"` + Sticker *DataMessage_Sticker `protobuf:"bytes,11,opt,name=sticker" json:"sticker,omitempty"` + RequiredProtocolVersion *uint32 `protobuf:"varint,12,opt,name=requiredProtocolVersion" json:"requiredProtocolVersion,omitempty"` + IsViewOnce *bool `protobuf:"varint,14,opt,name=isViewOnce" json:"isViewOnce,omitempty"` + Reaction *DataMessage_Reaction `protobuf:"bytes,16,opt,name=reaction" json:"reaction,omitempty"` + Delete *DataMessage_Delete `protobuf:"bytes,17,opt,name=delete" json:"delete,omitempty"` + BodyRanges []*BodyRange `protobuf:"bytes,18,rep,name=bodyRanges" json:"bodyRanges,omitempty"` + 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"` +} + +func (x *DataMessage) Reset() { + *x = DataMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage) ProtoMessage() {} + +func (x *DataMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && 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.ProtoReflect.Descriptor instead. +func (*DataMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4} +} + +func (x *DataMessage) GetBody() string { + if x != nil && x.Body != nil { + return *x.Body + } + return "" +} + +func (x *DataMessage) GetAttachments() []*AttachmentPointer { + if x != nil { + return x.Attachments + } + return nil +} + +func (x *DataMessage) GetGroupV2() *GroupContextV2 { + if x != nil { + return x.GroupV2 + } + return nil +} + +func (x *DataMessage) GetFlags() uint32 { + if x != nil && x.Flags != nil { + return *x.Flags + } + return 0 +} + +func (x *DataMessage) GetExpireTimer() uint32 { + if x != nil && x.ExpireTimer != nil { + return *x.ExpireTimer + } + return 0 +} + +func (x *DataMessage) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *DataMessage) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +func (x *DataMessage) GetQuote() *DataMessage_Quote { + if x != nil { + return x.Quote + } + return nil +} + +func (x *DataMessage) GetContact() []*DataMessage_Contact { + if x != nil { + return x.Contact + } + return nil +} + +func (x *DataMessage) GetPreview() []*Preview { + if x != nil { + return x.Preview + } + return nil +} + +func (x *DataMessage) GetSticker() *DataMessage_Sticker { + if x != nil { + return x.Sticker + } + return nil +} + +func (x *DataMessage) GetRequiredProtocolVersion() uint32 { + if x != nil && x.RequiredProtocolVersion != nil { + return *x.RequiredProtocolVersion + } + return 0 +} + +func (x *DataMessage) GetIsViewOnce() bool { + if x != nil && x.IsViewOnce != nil { + return *x.IsViewOnce + } + return false +} + +func (x *DataMessage) GetReaction() *DataMessage_Reaction { + if x != nil { + return x.Reaction + } + return nil +} + +func (x *DataMessage) GetDelete() *DataMessage_Delete { + if x != nil { + return x.Delete + } + return nil +} + +func (x *DataMessage) GetBodyRanges() []*BodyRange { + if x != nil { + return x.BodyRanges + } + return nil +} + +func (x *DataMessage) GetGroupCallUpdate() *DataMessage_GroupCallUpdate { + if x != nil { + return x.GroupCallUpdate + } + return nil +} + +func (x *DataMessage) GetPayment() *DataMessage_Payment { + if x != nil { + return x.Payment + } + return nil +} + +func (x *DataMessage) GetStoryContext() *DataMessage_StoryContext { + if x != nil { + return x.StoryContext + } + return nil +} + +func (x *DataMessage) GetGiftBadge() *DataMessage_GiftBadge { + if x != nil { + return x.GiftBadge + } + return nil +} + +type NullMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Padding []byte `protobuf:"bytes,1,opt,name=padding" json:"padding,omitempty"` +} + +func (x *NullMessage) Reset() { + *x = NullMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NullMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NullMessage) ProtoMessage() {} + +func (x *NullMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NullMessage.ProtoReflect.Descriptor instead. +func (*NullMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{5} +} + +func (x *NullMessage) GetPadding() []byte { + if x != nil { + return x.Padding + } + return nil +} + +type ReceiptMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *ReceiptMessage_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.ReceiptMessage_Type" json:"type,omitempty"` + Timestamp []uint64 `protobuf:"varint,2,rep,name=timestamp" json:"timestamp,omitempty"` +} + +func (x *ReceiptMessage) Reset() { + *x = ReceiptMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReceiptMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReceiptMessage) ProtoMessage() {} + +func (x *ReceiptMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReceiptMessage.ProtoReflect.Descriptor instead. +func (*ReceiptMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{6} +} + +func (x *ReceiptMessage) GetType() ReceiptMessage_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return ReceiptMessage_DELIVERY +} + +func (x *ReceiptMessage) GetTimestamp() []uint64 { + if x != nil { + return x.Timestamp + } + return nil +} + +type TypingMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` + Action *TypingMessage_Action `protobuf:"varint,2,opt,name=action,enum=signalservice.TypingMessage_Action" json:"action,omitempty"` + GroupId []byte `protobuf:"bytes,3,opt,name=groupId" json:"groupId,omitempty"` +} + +func (x *TypingMessage) Reset() { + *x = TypingMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TypingMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TypingMessage) ProtoMessage() {} + +func (x *TypingMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TypingMessage.ProtoReflect.Descriptor instead. +func (*TypingMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{7} +} + +func (x *TypingMessage) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +func (x *TypingMessage) GetAction() TypingMessage_Action { + if x != nil && x.Action != nil { + return *x.Action + } + return TypingMessage_STARTED +} + +func (x *TypingMessage) GetGroupId() []byte { + if x != nil { + return x.GroupId + } + return nil +} + +type StoryMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProfileKey []byte `protobuf:"bytes,1,opt,name=profileKey" json:"profileKey,omitempty"` + Group *GroupContextV2 `protobuf:"bytes,2,opt,name=group" json:"group,omitempty"` + // Types that are assignable to Attachment: + // + // *StoryMessage_FileAttachment + // *StoryMessage_TextAttachment + Attachment isStoryMessage_Attachment `protobuf_oneof:"attachment"` + AllowsReplies *bool `protobuf:"varint,5,opt,name=allowsReplies" json:"allowsReplies,omitempty"` + BodyRanges []*BodyRange `protobuf:"bytes,6,rep,name=bodyRanges" json:"bodyRanges,omitempty"` +} + +func (x *StoryMessage) Reset() { + *x = StoryMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoryMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoryMessage) ProtoMessage() {} + +func (x *StoryMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StoryMessage.ProtoReflect.Descriptor instead. +func (*StoryMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{8} +} + +func (x *StoryMessage) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *StoryMessage) GetGroup() *GroupContextV2 { + if x != nil { + return x.Group + } + return nil +} + +func (m *StoryMessage) GetAttachment() isStoryMessage_Attachment { + if m != nil { + return m.Attachment + } + return nil +} + +func (x *StoryMessage) GetFileAttachment() *AttachmentPointer { + if x, ok := x.GetAttachment().(*StoryMessage_FileAttachment); ok { + return x.FileAttachment + } + return nil +} + +func (x *StoryMessage) GetTextAttachment() *TextAttachment { + if x, ok := x.GetAttachment().(*StoryMessage_TextAttachment); ok { + return x.TextAttachment + } + return nil +} + +func (x *StoryMessage) GetAllowsReplies() bool { + if x != nil && x.AllowsReplies != nil { + return *x.AllowsReplies + } + return false +} + +func (x *StoryMessage) GetBodyRanges() []*BodyRange { + if x != nil { + return x.BodyRanges + } + return nil +} + +type isStoryMessage_Attachment interface { + isStoryMessage_Attachment() +} + +type StoryMessage_FileAttachment struct { + FileAttachment *AttachmentPointer `protobuf:"bytes,3,opt,name=fileAttachment,oneof"` +} + +type StoryMessage_TextAttachment struct { + TextAttachment *TextAttachment `protobuf:"bytes,4,opt,name=textAttachment,oneof"` +} + +func (*StoryMessage_FileAttachment) isStoryMessage_Attachment() {} + +func (*StoryMessage_TextAttachment) isStoryMessage_Attachment() {} + +type Preview struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` + Title *string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + Image *AttachmentPointer `protobuf:"bytes,3,opt,name=image" json:"image,omitempty"` + Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` + Date *uint64 `protobuf:"varint,5,opt,name=date" json:"date,omitempty"` +} + +func (x *Preview) Reset() { + *x = Preview{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Preview) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Preview) ProtoMessage() {} + +func (x *Preview) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Preview.ProtoReflect.Descriptor instead. +func (*Preview) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{9} +} + +func (x *Preview) GetUrl() string { + if x != nil && x.Url != nil { + return *x.Url + } + return "" +} + +func (x *Preview) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title + } + return "" +} + +func (x *Preview) GetImage() *AttachmentPointer { + if x != nil { + return x.Image + } + return nil +} + +func (x *Preview) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *Preview) GetDate() uint64 { + if x != nil && x.Date != nil { + return *x.Date + } + return 0 +} + +type TextAttachment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Text *string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + TextStyle *TextAttachment_Style `protobuf:"varint,2,opt,name=textStyle,enum=signalservice.TextAttachment_Style" json:"textStyle,omitempty"` + TextForegroundColor *uint32 `protobuf:"varint,3,opt,name=textForegroundColor" json:"textForegroundColor,omitempty"` // integer representation of hex color + TextBackgroundColor *uint32 `protobuf:"varint,4,opt,name=textBackgroundColor" json:"textBackgroundColor,omitempty"` + Preview *Preview `protobuf:"bytes,5,opt,name=preview" json:"preview,omitempty"` + // Types that are assignable to Background: + // + // *TextAttachment_Gradient_ + // *TextAttachment_Color + Background isTextAttachment_Background `protobuf_oneof:"background"` +} + +func (x *TextAttachment) Reset() { + *x = TextAttachment{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TextAttachment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextAttachment) ProtoMessage() {} + +func (x *TextAttachment) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextAttachment.ProtoReflect.Descriptor instead. +func (*TextAttachment) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{10} +} + +func (x *TextAttachment) GetText() string { + if x != nil && x.Text != nil { + return *x.Text + } + return "" +} + +func (x *TextAttachment) GetTextStyle() TextAttachment_Style { + if x != nil && x.TextStyle != nil { + return *x.TextStyle + } + return TextAttachment_DEFAULT +} + +func (x *TextAttachment) GetTextForegroundColor() uint32 { + if x != nil && x.TextForegroundColor != nil { + return *x.TextForegroundColor + } + return 0 +} + +func (x *TextAttachment) GetTextBackgroundColor() uint32 { + if x != nil && x.TextBackgroundColor != nil { + return *x.TextBackgroundColor + } + return 0 +} + +func (x *TextAttachment) GetPreview() *Preview { + if x != nil { + return x.Preview + } + return nil +} + +func (m *TextAttachment) GetBackground() isTextAttachment_Background { + if m != nil { + return m.Background + } + return nil +} + +func (x *TextAttachment) GetGradient() *TextAttachment_Gradient { + if x, ok := x.GetBackground().(*TextAttachment_Gradient_); ok { + return x.Gradient + } + return nil +} + +func (x *TextAttachment) GetColor() uint32 { + if x, ok := x.GetBackground().(*TextAttachment_Color); ok { + return x.Color + } + return 0 +} + +type isTextAttachment_Background interface { + isTextAttachment_Background() +} + +type TextAttachment_Gradient_ struct { + Gradient *TextAttachment_Gradient `protobuf:"bytes,6,opt,name=gradient,oneof"` +} + +type TextAttachment_Color struct { + Color uint32 `protobuf:"varint,7,opt,name=color,oneof"` +} + +func (*TextAttachment_Gradient_) isTextAttachment_Background() {} + +func (*TextAttachment_Color) isTextAttachment_Background() {} + +type Verified struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *Verified) Reset() { + *x = Verified{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Verified) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Verified) ProtoMessage() {} + +func (x *Verified) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Verified.ProtoReflect.Descriptor instead. +func (*Verified) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{11} +} + +func (x *Verified) GetDestinationAci() string { + if x != nil && x.DestinationAci != nil { + return *x.DestinationAci + } + return "" +} + +func (x *Verified) GetIdentityKey() []byte { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *Verified) GetState() Verified_State { + if x != nil && x.State != nil { + return *x.State + } + return Verified_DEFAULT +} + +func (x *Verified) GetNullMessage() []byte { + if x != nil { + return x.NullMessage + } + return nil +} + +type SyncMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *SyncMessage) Reset() { + *x = SyncMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage) ProtoMessage() {} + +func (x *SyncMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage.ProtoReflect.Descriptor instead. +func (*SyncMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12} +} + +func (x *SyncMessage) GetSent() *SyncMessage_Sent { + if x != nil { + return x.Sent + } + return nil +} + +func (x *SyncMessage) GetContacts() *SyncMessage_Contacts { + if x != nil { + return x.Contacts + } + return nil +} + +func (x *SyncMessage) GetRequest() *SyncMessage_Request { + if x != nil { + return x.Request + } + return nil +} + +func (x *SyncMessage) GetRead() []*SyncMessage_Read { + if x != nil { + return x.Read + } + return nil +} + +func (x *SyncMessage) GetBlocked() *SyncMessage_Blocked { + if x != nil { + return x.Blocked + } + return nil +} + +func (x *SyncMessage) GetVerified() *Verified { + if x != nil { + return x.Verified + } + return nil +} + +func (x *SyncMessage) GetConfiguration() *SyncMessage_Configuration { + if x != nil { + return x.Configuration + } + return nil +} + +func (x *SyncMessage) GetPadding() []byte { + if x != nil { + return x.Padding + } + return nil +} + +func (x *SyncMessage) GetStickerPackOperation() []*SyncMessage_StickerPackOperation { + if x != nil { + return x.StickerPackOperation + } + return nil +} + +func (x *SyncMessage) GetViewOnceOpen() *SyncMessage_ViewOnceOpen { + if x != nil { + return x.ViewOnceOpen + } + return nil +} + +func (x *SyncMessage) GetFetchLatest() *SyncMessage_FetchLatest { + if x != nil { + return x.FetchLatest + } + return nil +} + +func (x *SyncMessage) GetKeys() *SyncMessage_Keys { + if x != nil { + return x.Keys + } + return nil +} + +func (x *SyncMessage) GetMessageRequestResponse() *SyncMessage_MessageRequestResponse { + if x != nil { + return x.MessageRequestResponse + } + return nil +} + +func (x *SyncMessage) GetOutgoingPayment() *SyncMessage_OutgoingPayment { + if x != nil { + return x.OutgoingPayment + } + return nil +} + +func (x *SyncMessage) GetViewed() []*SyncMessage_Viewed { + if x != nil { + return x.Viewed + } + return nil +} + +func (x *SyncMessage) GetPniChangeNumber() *SyncMessage_PniChangeNumber { + if x != nil { + return x.PniChangeNumber + } + return nil +} + +func (x *SyncMessage) GetCallEvent() *SyncMessage_CallEvent { + if x != nil { + return x.CallEvent + } + return nil +} + +func (x *SyncMessage) GetCallLinkUpdate() *SyncMessage_CallLinkUpdate { + if x != nil { + return x.CallLinkUpdate + } + return nil +} + +func (x *SyncMessage) GetCallLogEvent() *SyncMessage_CallLogEvent { + if x != nil { + return x.CallLogEvent + } + return nil +} + +type AttachmentPointer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to AttachmentIdentifier: + // + // *AttachmentPointer_CdnId + // *AttachmentPointer_CdnKey + AttachmentIdentifier isAttachmentPointer_AttachmentIdentifier `protobuf_oneof:"attachment_identifier"` + ContentType *string `protobuf:"bytes,2,opt,name=contentType" json:"contentType,omitempty"` + Key []byte `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` + Size *uint32 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"` + Thumbnail []byte `protobuf:"bytes,5,opt,name=thumbnail" json:"thumbnail,omitempty"` + Digest []byte `protobuf:"bytes,6,opt,name=digest" json:"digest,omitempty"` + IncrementalMac []byte `protobuf:"bytes,18,opt,name=incrementalMac" json:"incrementalMac,omitempty"` + IncrementalMacChunkSize *uint32 `protobuf:"varint,17,opt,name=incrementalMacChunkSize" json:"incrementalMacChunkSize,omitempty"` + FileName *string `protobuf:"bytes,7,opt,name=fileName" json:"fileName,omitempty"` + Flags *uint32 `protobuf:"varint,8,opt,name=flags" json:"flags,omitempty"` + Width *uint32 `protobuf:"varint,9,opt,name=width" json:"width,omitempty"` + Height *uint32 `protobuf:"varint,10,opt,name=height" json:"height,omitempty"` + Caption *string `protobuf:"bytes,11,opt,name=caption" json:"caption,omitempty"` + BlurHash *string `protobuf:"bytes,12,opt,name=blurHash" json:"blurHash,omitempty"` + UploadTimestamp *uint64 `protobuf:"varint,13,opt,name=uploadTimestamp" json:"uploadTimestamp,omitempty"` + CdnNumber *uint32 `protobuf:"varint,14,opt,name=cdnNumber" json:"cdnNumber,omitempty"` // Next ID: 19 +} + +func (x *AttachmentPointer) Reset() { + *x = AttachmentPointer{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AttachmentPointer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AttachmentPointer) ProtoMessage() {} + +func (x *AttachmentPointer) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AttachmentPointer.ProtoReflect.Descriptor instead. +func (*AttachmentPointer) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{13} +} + +func (m *AttachmentPointer) GetAttachmentIdentifier() isAttachmentPointer_AttachmentIdentifier { + if m != nil { + return m.AttachmentIdentifier + } + return nil +} + +func (x *AttachmentPointer) GetCdnId() uint64 { + if x, ok := x.GetAttachmentIdentifier().(*AttachmentPointer_CdnId); ok { + return x.CdnId + } + return 0 +} + +func (x *AttachmentPointer) GetCdnKey() string { + if x, ok := x.GetAttachmentIdentifier().(*AttachmentPointer_CdnKey); ok { + return x.CdnKey + } + return "" +} + +func (x *AttachmentPointer) GetContentType() string { + if x != nil && x.ContentType != nil { + return *x.ContentType + } + return "" +} + +func (x *AttachmentPointer) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *AttachmentPointer) GetSize() uint32 { + if x != nil && x.Size != nil { + return *x.Size + } + return 0 +} + +func (x *AttachmentPointer) GetThumbnail() []byte { + if x != nil { + return x.Thumbnail + } + return nil +} + +func (x *AttachmentPointer) GetDigest() []byte { + if x != nil { + return x.Digest + } + return nil +} + +func (x *AttachmentPointer) GetIncrementalMac() []byte { + if x != nil { + return x.IncrementalMac + } + return nil +} + +func (x *AttachmentPointer) GetIncrementalMacChunkSize() uint32 { + if x != nil && x.IncrementalMacChunkSize != nil { + return *x.IncrementalMacChunkSize + } + return 0 +} + +func (x *AttachmentPointer) GetFileName() string { + if x != nil && x.FileName != nil { + return *x.FileName + } + return "" +} + +func (x *AttachmentPointer) GetFlags() uint32 { + if x != nil && x.Flags != nil { + return *x.Flags + } + return 0 +} + +func (x *AttachmentPointer) GetWidth() uint32 { + if x != nil && x.Width != nil { + return *x.Width + } + return 0 +} + +func (x *AttachmentPointer) GetHeight() uint32 { + if x != nil && x.Height != nil { + return *x.Height + } + return 0 +} + +func (x *AttachmentPointer) GetCaption() string { + if x != nil && x.Caption != nil { + return *x.Caption + } + return "" +} + +func (x *AttachmentPointer) GetBlurHash() string { + if x != nil && x.BlurHash != nil { + return *x.BlurHash + } + return "" +} + +func (x *AttachmentPointer) GetUploadTimestamp() uint64 { + if x != nil && x.UploadTimestamp != nil { + return *x.UploadTimestamp + } + return 0 +} + +func (x *AttachmentPointer) GetCdnNumber() uint32 { + if x != nil && x.CdnNumber != nil { + return *x.CdnNumber + } + return 0 +} + +type isAttachmentPointer_AttachmentIdentifier interface { + isAttachmentPointer_AttachmentIdentifier() +} + +type AttachmentPointer_CdnId struct { + CdnId uint64 `protobuf:"fixed64,1,opt,name=cdnId,oneof"` +} + +type AttachmentPointer_CdnKey struct { + CdnKey string `protobuf:"bytes,15,opt,name=cdnKey,oneof"` +} + +func (*AttachmentPointer_CdnId) isAttachmentPointer_AttachmentIdentifier() {} + +func (*AttachmentPointer_CdnKey) isAttachmentPointer_AttachmentIdentifier() {} + +type GroupContext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Type *GroupContext_Type `protobuf:"varint,2,opt,name=type,enum=signalservice.GroupContext_Type" json:"type,omitempty"` + Name *string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"` + MembersE164 []string `protobuf:"bytes,4,rep,name=membersE164" json:"membersE164,omitempty"` + Members []*GroupContext_Member `protobuf:"bytes,6,rep,name=members" json:"members,omitempty"` + Avatar *AttachmentPointer `protobuf:"bytes,5,opt,name=avatar" json:"avatar,omitempty"` +} + +func (x *GroupContext) Reset() { + *x = GroupContext{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupContext) ProtoMessage() {} + +func (x *GroupContext) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupContext.ProtoReflect.Descriptor instead. +func (*GroupContext) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{14} +} + +func (x *GroupContext) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *GroupContext) GetType() GroupContext_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return GroupContext_UNKNOWN +} + +func (x *GroupContext) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *GroupContext) GetMembersE164() []string { + if x != nil { + return x.MembersE164 + } + return nil +} + +func (x *GroupContext) GetMembers() []*GroupContext_Member { + if x != nil { + return x.Members + } + return nil +} + +func (x *GroupContext) GetAvatar() *AttachmentPointer { + if x != nil { + return x.Avatar + } + return nil +} + +type GroupContextV2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MasterKey []byte `protobuf:"bytes,1,opt,name=masterKey" json:"masterKey,omitempty"` + Revision *uint32 `protobuf:"varint,2,opt,name=revision" json:"revision,omitempty"` + GroupChange []byte `protobuf:"bytes,3,opt,name=groupChange" json:"groupChange,omitempty"` +} + +func (x *GroupContextV2) Reset() { + *x = GroupContextV2{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupContextV2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupContextV2) ProtoMessage() {} + +func (x *GroupContextV2) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupContextV2.ProtoReflect.Descriptor instead. +func (*GroupContextV2) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{15} +} + +func (x *GroupContextV2) GetMasterKey() []byte { + if x != nil { + return x.MasterKey + } + return nil +} + +func (x *GroupContextV2) GetRevision() uint32 { + if x != nil && x.Revision != nil { + return *x.Revision + } + return 0 +} + +func (x *GroupContextV2) GetGroupChange() []byte { + if x != nil { + return x.GroupChange + } + return nil +} + +type ContactDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Number *string `protobuf:"bytes,1,opt,name=number" json:"number,omitempty"` + Aci *string `protobuf:"bytes,9,opt,name=aci" json:"aci,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Avatar *ContactDetails_Avatar `protobuf:"bytes,3,opt,name=avatar" json:"avatar,omitempty"` + Color *string `protobuf:"bytes,4,opt,name=color" json:"color,omitempty"` + Verified *Verified `protobuf:"bytes,5,opt,name=verified" json:"verified,omitempty"` + ProfileKey []byte `protobuf:"bytes,6,opt,name=profileKey" json:"profileKey,omitempty"` + Blocked *bool `protobuf:"varint,7,opt,name=blocked" json:"blocked,omitempty"` + ExpireTimer *uint32 `protobuf:"varint,8,opt,name=expireTimer" json:"expireTimer,omitempty"` + InboxPosition *uint32 `protobuf:"varint,10,opt,name=inboxPosition" json:"inboxPosition,omitempty"` + Archived *bool `protobuf:"varint,11,opt,name=archived" json:"archived,omitempty"` +} + +func (x *ContactDetails) Reset() { + *x = ContactDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContactDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContactDetails) ProtoMessage() {} + +func (x *ContactDetails) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContactDetails.ProtoReflect.Descriptor instead. +func (*ContactDetails) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{16} +} + +func (x *ContactDetails) GetNumber() string { + if x != nil && x.Number != nil { + return *x.Number + } + return "" +} + +func (x *ContactDetails) GetAci() string { + if x != nil && x.Aci != nil { + return *x.Aci + } + return "" +} + +func (x *ContactDetails) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *ContactDetails) GetAvatar() *ContactDetails_Avatar { + if x != nil { + return x.Avatar + } + return nil +} + +func (x *ContactDetails) GetColor() string { + if x != nil && x.Color != nil { + return *x.Color + } + return "" +} + +func (x *ContactDetails) GetVerified() *Verified { + if x != nil { + return x.Verified + } + return nil +} + +func (x *ContactDetails) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *ContactDetails) GetBlocked() bool { + if x != nil && x.Blocked != nil { + return *x.Blocked + } + return false +} + +func (x *ContactDetails) GetExpireTimer() uint32 { + if x != nil && x.ExpireTimer != nil { + return *x.ExpireTimer + } + return 0 +} + +func (x *ContactDetails) GetInboxPosition() uint32 { + if x != nil && x.InboxPosition != nil { + return *x.InboxPosition + } + return 0 +} + +func (x *ContactDetails) GetArchived() bool { + if x != nil && x.Archived != nil { + return *x.Archived + } + return false +} + +type GroupDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []byte `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + MembersE164 []string `protobuf:"bytes,3,rep,name=membersE164" json:"membersE164,omitempty"` + Members []*GroupDetails_Member `protobuf:"bytes,9,rep,name=members" json:"members,omitempty"` + Avatar *GroupDetails_Avatar `protobuf:"bytes,4,opt,name=avatar" json:"avatar,omitempty"` + Active *bool `protobuf:"varint,5,opt,name=active,def=1" json:"active,omitempty"` + ExpireTimer *uint32 `protobuf:"varint,6,opt,name=expireTimer" json:"expireTimer,omitempty"` + Color *string `protobuf:"bytes,7,opt,name=color" json:"color,omitempty"` + Blocked *bool `protobuf:"varint,8,opt,name=blocked" json:"blocked,omitempty"` + InboxPosition *uint32 `protobuf:"varint,10,opt,name=inboxPosition" json:"inboxPosition,omitempty"` + Archived *bool `protobuf:"varint,11,opt,name=archived" json:"archived,omitempty"` +} + +// Default values for GroupDetails fields. +const ( + Default_GroupDetails_Active = bool(true) +) + +func (x *GroupDetails) Reset() { + *x = GroupDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupDetails) ProtoMessage() {} + +func (x *GroupDetails) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupDetails.ProtoReflect.Descriptor instead. +func (*GroupDetails) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{17} +} + +func (x *GroupDetails) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *GroupDetails) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *GroupDetails) GetMembersE164() []string { + if x != nil { + return x.MembersE164 + } + return nil +} + +func (x *GroupDetails) GetMembers() []*GroupDetails_Member { + if x != nil { + return x.Members + } + return nil +} + +func (x *GroupDetails) GetAvatar() *GroupDetails_Avatar { + if x != nil { + return x.Avatar + } + return nil +} + +func (x *GroupDetails) GetActive() bool { + if x != nil && x.Active != nil { + return *x.Active + } + return Default_GroupDetails_Active +} + +func (x *GroupDetails) GetExpireTimer() uint32 { + if x != nil && x.ExpireTimer != nil { + return *x.ExpireTimer + } + return 0 +} + +func (x *GroupDetails) GetColor() string { + if x != nil && x.Color != nil { + return *x.Color + } + return "" +} + +func (x *GroupDetails) GetBlocked() bool { + if x != nil && x.Blocked != nil { + return *x.Blocked + } + return false +} + +func (x *GroupDetails) GetInboxPosition() uint32 { + if x != nil && x.InboxPosition != nil { + return *x.InboxPosition + } + return 0 +} + +func (x *GroupDetails) GetArchived() bool { + if x != nil && x.Archived != nil { + return *x.Archived + } + return false +} + +type PaymentAddress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Address: + // + // *PaymentAddress_MobileCoinAddress_ + Address isPaymentAddress_Address `protobuf_oneof:"Address"` +} + +func (x *PaymentAddress) Reset() { + *x = PaymentAddress{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaymentAddress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentAddress) ProtoMessage() {} + +func (x *PaymentAddress) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaymentAddress.ProtoReflect.Descriptor instead. +func (*PaymentAddress) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{18} +} + +func (m *PaymentAddress) GetAddress() isPaymentAddress_Address { + if m != nil { + return m.Address + } + return nil +} + +func (x *PaymentAddress) GetMobileCoinAddress() *PaymentAddress_MobileCoinAddress { + if x, ok := x.GetAddress().(*PaymentAddress_MobileCoinAddress_); ok { + return x.MobileCoinAddress + } + return nil +} + +type isPaymentAddress_Address interface { + isPaymentAddress_Address() +} + +type PaymentAddress_MobileCoinAddress_ struct { + MobileCoinAddress *PaymentAddress_MobileCoinAddress `protobuf:"bytes,1,opt,name=mobileCoinAddress,oneof"` +} + +func (*PaymentAddress_MobileCoinAddress_) isPaymentAddress_Address() {} + +type DecryptionErrorMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RatchetKey []byte `protobuf:"bytes,1,opt,name=ratchetKey" json:"ratchetKey,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` + DeviceId *uint32 `protobuf:"varint,3,opt,name=deviceId" json:"deviceId,omitempty"` +} + +func (x *DecryptionErrorMessage) Reset() { + *x = DecryptionErrorMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DecryptionErrorMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecryptionErrorMessage) ProtoMessage() {} + +func (x *DecryptionErrorMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DecryptionErrorMessage.ProtoReflect.Descriptor instead. +func (*DecryptionErrorMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{19} +} + +func (x *DecryptionErrorMessage) GetRatchetKey() []byte { + if x != nil { + return x.RatchetKey + } + return nil +} + +func (x *DecryptionErrorMessage) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +func (x *DecryptionErrorMessage) GetDeviceId() uint32 { + if x != nil && x.DeviceId != nil { + return *x.DeviceId + } + return 0 +} + +type PniSignatureMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Pni []byte `protobuf:"bytes,1,opt,name=pni" json:"pni,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` +} + +func (x *PniSignatureMessage) Reset() { + *x = PniSignatureMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PniSignatureMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PniSignatureMessage) ProtoMessage() {} + +func (x *PniSignatureMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PniSignatureMessage.ProtoReflect.Descriptor instead. +func (*PniSignatureMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{20} +} + +func (x *PniSignatureMessage) GetPni() []byte { + if x != nil { + return x.Pni + } + return nil +} + +func (x *PniSignatureMessage) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type EditMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetSentTimestamp *uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` + DataMessage *DataMessage `protobuf:"bytes,2,opt,name=dataMessage" json:"dataMessage,omitempty"` +} + +func (x *EditMessage) Reset() { + *x = EditMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EditMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EditMessage) ProtoMessage() {} + +func (x *EditMessage) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EditMessage.ProtoReflect.Descriptor instead. +func (*EditMessage) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{21} +} + +func (x *EditMessage) GetTargetSentTimestamp() uint64 { + if x != nil && x.TargetSentTimestamp != nil { + return *x.TargetSentTimestamp + } + return 0 +} + +func (x *EditMessage) GetDataMessage() *DataMessage { + if x != nil { + return x.DataMessage + } + return nil +} + +type CallMessage_Offer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Type *CallMessage_Offer_Type `protobuf:"varint,3,opt,name=type,enum=signalservice.CallMessage_Offer_Type" json:"type,omitempty"` + Opaque []byte `protobuf:"bytes,4,opt,name=opaque" json:"opaque,omitempty"` +} + +func (x *CallMessage_Offer) Reset() { + *x = CallMessage_Offer{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallMessage_Offer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallMessage_Offer) ProtoMessage() {} + +func (x *CallMessage_Offer) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallMessage_Offer.ProtoReflect.Descriptor instead. +func (*CallMessage_Offer) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *CallMessage_Offer) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *CallMessage_Offer) GetType() CallMessage_Offer_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return CallMessage_Offer_OFFER_AUDIO_CALL +} + +func (x *CallMessage_Offer) GetOpaque() []byte { + if x != nil { + return x.Opaque + } + return nil +} + +type CallMessage_Answer struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Opaque []byte `protobuf:"bytes,3,opt,name=opaque" json:"opaque,omitempty"` +} + +func (x *CallMessage_Answer) Reset() { + *x = CallMessage_Answer{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallMessage_Answer) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallMessage_Answer) ProtoMessage() {} + +func (x *CallMessage_Answer) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallMessage_Answer.ProtoReflect.Descriptor instead. +func (*CallMessage_Answer) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *CallMessage_Answer) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *CallMessage_Answer) GetOpaque() []byte { + if x != nil { + return x.Opaque + } + return nil +} + +type CallMessage_IceUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Opaque []byte `protobuf:"bytes,5,opt,name=opaque" json:"opaque,omitempty"` +} + +func (x *CallMessage_IceUpdate) Reset() { + *x = CallMessage_IceUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallMessage_IceUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallMessage_IceUpdate) ProtoMessage() {} + +func (x *CallMessage_IceUpdate) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[24] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallMessage_IceUpdate.ProtoReflect.Descriptor instead. +func (*CallMessage_IceUpdate) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 2} +} + +func (x *CallMessage_IceUpdate) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *CallMessage_IceUpdate) GetOpaque() []byte { + if x != nil { + return x.Opaque + } + return nil +} + +type CallMessage_Busy struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` +} + +func (x *CallMessage_Busy) Reset() { + *x = CallMessage_Busy{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallMessage_Busy) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallMessage_Busy) ProtoMessage() {} + +func (x *CallMessage_Busy) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[25] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallMessage_Busy.ProtoReflect.Descriptor instead. +func (*CallMessage_Busy) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 3} +} + +func (x *CallMessage_Busy) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +type CallMessage_Hangup struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Type *CallMessage_Hangup_Type `protobuf:"varint,2,opt,name=type,enum=signalservice.CallMessage_Hangup_Type" json:"type,omitempty"` + DeviceId *uint32 `protobuf:"varint,3,opt,name=deviceId" json:"deviceId,omitempty"` +} + +func (x *CallMessage_Hangup) Reset() { + *x = CallMessage_Hangup{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallMessage_Hangup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallMessage_Hangup) ProtoMessage() {} + +func (x *CallMessage_Hangup) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallMessage_Hangup.ProtoReflect.Descriptor instead. +func (*CallMessage_Hangup) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 4} +} + +func (x *CallMessage_Hangup) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *CallMessage_Hangup) GetType() CallMessage_Hangup_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return CallMessage_Hangup_HANGUP_NORMAL +} + +func (x *CallMessage_Hangup) GetDeviceId() uint32 { + if x != nil && x.DeviceId != nil { + return *x.DeviceId + } + return 0 +} + +type CallMessage_Opaque struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` + Urgency *CallMessage_Opaque_Urgency `protobuf:"varint,2,opt,name=urgency,enum=signalservice.CallMessage_Opaque_Urgency" json:"urgency,omitempty"` +} + +func (x *CallMessage_Opaque) Reset() { + *x = CallMessage_Opaque{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CallMessage_Opaque) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CallMessage_Opaque) ProtoMessage() {} + +func (x *CallMessage_Opaque) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CallMessage_Opaque.ProtoReflect.Descriptor instead. +func (*CallMessage_Opaque) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{2, 5} +} + +func (x *CallMessage_Opaque) GetData() []byte { + if x != nil { + return x.Data + } + return nil +} + +func (x *CallMessage_Opaque) GetUrgency() CallMessage_Opaque_Urgency { + if x != nil && x.Urgency != nil { + return *x.Urgency + } + return CallMessage_Opaque_DROPPABLE +} + +type DataMessage_Quote struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *DataMessage_Quote) Reset() { + *x = DataMessage_Quote{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Quote) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Quote) ProtoMessage() {} + +func (x *DataMessage_Quote) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[28] + if protoimpl.UnsafeEnabled && 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_Quote.ProtoReflect.Descriptor instead. +func (*DataMessage_Quote) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *DataMessage_Quote) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *DataMessage_Quote) GetAuthorAci() string { + if x != nil && x.AuthorAci != nil { + return *x.AuthorAci + } + return "" +} + +func (x *DataMessage_Quote) GetText() string { + if x != nil && x.Text != nil { + return *x.Text + } + return "" +} + +func (x *DataMessage_Quote) GetAttachments() []*DataMessage_Quote_QuotedAttachment { + if x != nil { + return x.Attachments + } + return nil +} + +func (x *DataMessage_Quote) GetBodyRanges() []*BodyRange { + if x != nil { + return x.BodyRanges + } + return nil +} + +func (x *DataMessage_Quote) GetType() DataMessage_Quote_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return DataMessage_Quote_NORMAL +} + +type DataMessage_Contact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *DataMessage_Contact_Name `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Number []*DataMessage_Contact_Phone `protobuf:"bytes,3,rep,name=number" json:"number,omitempty"` + Email []*DataMessage_Contact_Email `protobuf:"bytes,4,rep,name=email" json:"email,omitempty"` + Address []*DataMessage_Contact_PostalAddress `protobuf:"bytes,5,rep,name=address" json:"address,omitempty"` + Avatar *DataMessage_Contact_Avatar `protobuf:"bytes,6,opt,name=avatar" json:"avatar,omitempty"` + Organization *string `protobuf:"bytes,7,opt,name=organization" json:"organization,omitempty"` +} + +func (x *DataMessage_Contact) Reset() { + *x = DataMessage_Contact{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Contact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Contact) ProtoMessage() {} + +func (x *DataMessage_Contact) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && 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_Contact.ProtoReflect.Descriptor instead. +func (*DataMessage_Contact) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1} +} + +func (x *DataMessage_Contact) GetName() *DataMessage_Contact_Name { + if x != nil { + return x.Name + } + return nil +} + +func (x *DataMessage_Contact) GetNumber() []*DataMessage_Contact_Phone { + if x != nil { + return x.Number + } + return nil +} + +func (x *DataMessage_Contact) GetEmail() []*DataMessage_Contact_Email { + if x != nil { + return x.Email + } + return nil +} + +func (x *DataMessage_Contact) GetAddress() []*DataMessage_Contact_PostalAddress { + if x != nil { + return x.Address + } + return nil +} + +func (x *DataMessage_Contact) GetAvatar() *DataMessage_Contact_Avatar { + if x != nil { + return x.Avatar + } + return nil +} + +func (x *DataMessage_Contact) GetOrganization() string { + if x != nil && x.Organization != nil { + return *x.Organization + } + return "" +} + +type DataMessage_Sticker struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackId []byte `protobuf:"bytes,1,opt,name=packId" json:"packId,omitempty"` + PackKey []byte `protobuf:"bytes,2,opt,name=packKey" json:"packKey,omitempty"` + StickerId *uint32 `protobuf:"varint,3,opt,name=stickerId" json:"stickerId,omitempty"` + Data *AttachmentPointer `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` + Emoji *string `protobuf:"bytes,5,opt,name=emoji" json:"emoji,omitempty"` +} + +func (x *DataMessage_Sticker) Reset() { + *x = DataMessage_Sticker{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Sticker) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Sticker) ProtoMessage() {} + +func (x *DataMessage_Sticker) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[30] + if protoimpl.UnsafeEnabled && 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_Sticker.ProtoReflect.Descriptor instead. +func (*DataMessage_Sticker) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 2} +} + +func (x *DataMessage_Sticker) GetPackId() []byte { + if x != nil { + return x.PackId + } + return nil +} + +func (x *DataMessage_Sticker) GetPackKey() []byte { + if x != nil { + return x.PackKey + } + return nil +} + +func (x *DataMessage_Sticker) GetStickerId() uint32 { + if x != nil && x.StickerId != nil { + return *x.StickerId + } + return 0 +} + +func (x *DataMessage_Sticker) GetData() *AttachmentPointer { + if x != nil { + return x.Data + } + return nil +} + +func (x *DataMessage_Sticker) GetEmoji() string { + if x != nil && x.Emoji != nil { + return *x.Emoji + } + return "" +} + +type DataMessage_Reaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *DataMessage_Reaction) Reset() { + *x = DataMessage_Reaction{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Reaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Reaction) ProtoMessage() {} + +func (x *DataMessage_Reaction) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[31] + if protoimpl.UnsafeEnabled && 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_Reaction.ProtoReflect.Descriptor instead. +func (*DataMessage_Reaction) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 3} +} + +func (x *DataMessage_Reaction) GetEmoji() string { + if x != nil && x.Emoji != nil { + return *x.Emoji + } + return "" +} + +func (x *DataMessage_Reaction) GetRemove() bool { + if x != nil && x.Remove != nil { + return *x.Remove + } + return false +} + +func (x *DataMessage_Reaction) GetTargetAuthorAci() string { + if x != nil && x.TargetAuthorAci != nil { + return *x.TargetAuthorAci + } + return "" +} + +func (x *DataMessage_Reaction) GetTargetSentTimestamp() uint64 { + if x != nil && x.TargetSentTimestamp != nil { + return *x.TargetSentTimestamp + } + return 0 +} + +type DataMessage_Delete struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TargetSentTimestamp *uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` +} + +func (x *DataMessage_Delete) Reset() { + *x = DataMessage_Delete{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Delete) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Delete) ProtoMessage() {} + +func (x *DataMessage_Delete) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && 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_Delete.ProtoReflect.Descriptor instead. +func (*DataMessage_Delete) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 4} +} + +func (x *DataMessage_Delete) GetTargetSentTimestamp() uint64 { + if x != nil && x.TargetSentTimestamp != nil { + return *x.TargetSentTimestamp + } + return 0 +} + +type DataMessage_GroupCallUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EraId *string `protobuf:"bytes,1,opt,name=eraId" json:"eraId,omitempty"` +} + +func (x *DataMessage_GroupCallUpdate) Reset() { + *x = DataMessage_GroupCallUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_GroupCallUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_GroupCallUpdate) ProtoMessage() {} + +func (x *DataMessage_GroupCallUpdate) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && 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_GroupCallUpdate.ProtoReflect.Descriptor instead. +func (*DataMessage_GroupCallUpdate) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 5} +} + +func (x *DataMessage_GroupCallUpdate) GetEraId() string { + if x != nil && x.EraId != nil { + return *x.EraId + } + return "" +} + +type DataMessage_StoryContext struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AuthorAci *string `protobuf:"bytes,1,opt,name=authorAci" json:"authorAci,omitempty"` + SentTimestamp *uint64 `protobuf:"varint,2,opt,name=sentTimestamp" json:"sentTimestamp,omitempty"` +} + +func (x *DataMessage_StoryContext) Reset() { + *x = DataMessage_StoryContext{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_StoryContext) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_StoryContext) ProtoMessage() {} + +func (x *DataMessage_StoryContext) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && 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_StoryContext.ProtoReflect.Descriptor instead. +func (*DataMessage_StoryContext) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 6} +} + +func (x *DataMessage_StoryContext) GetAuthorAci() string { + if x != nil && x.AuthorAci != nil { + return *x.AuthorAci + } + return "" +} + +func (x *DataMessage_StoryContext) GetSentTimestamp() uint64 { + if x != nil && x.SentTimestamp != nil { + return *x.SentTimestamp + } + return 0 +} + +type DataMessage_Payment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Item: + // + // *DataMessage_Payment_Notification_ + // *DataMessage_Payment_Activation_ + Item isDataMessage_Payment_Item `protobuf_oneof:"Item"` +} + +func (x *DataMessage_Payment) Reset() { + *x = DataMessage_Payment{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Payment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Payment) ProtoMessage() {} + +func (x *DataMessage_Payment) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && 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_Payment.ProtoReflect.Descriptor instead. +func (*DataMessage_Payment) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 7} +} + +func (m *DataMessage_Payment) GetItem() isDataMessage_Payment_Item { + if m != nil { + return m.Item + } + return nil +} + +func (x *DataMessage_Payment) GetNotification() *DataMessage_Payment_Notification { + if x, ok := x.GetItem().(*DataMessage_Payment_Notification_); ok { + return x.Notification + } + return nil +} + +func (x *DataMessage_Payment) GetActivation() *DataMessage_Payment_Activation { + if x, ok := x.GetItem().(*DataMessage_Payment_Activation_); ok { + return x.Activation + } + return nil +} + +type isDataMessage_Payment_Item interface { + isDataMessage_Payment_Item() +} + +type DataMessage_Payment_Notification_ struct { + Notification *DataMessage_Payment_Notification `protobuf:"bytes,1,opt,name=notification,oneof"` +} + +type DataMessage_Payment_Activation_ struct { + Activation *DataMessage_Payment_Activation `protobuf:"bytes,2,opt,name=activation,oneof"` +} + +func (*DataMessage_Payment_Notification_) isDataMessage_Payment_Item() {} + +func (*DataMessage_Payment_Activation_) isDataMessage_Payment_Item() {} + +type DataMessage_GiftBadge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReceiptCredentialPresentation []byte `protobuf:"bytes,1,opt,name=receiptCredentialPresentation" json:"receiptCredentialPresentation,omitempty"` +} + +func (x *DataMessage_GiftBadge) Reset() { + *x = DataMessage_GiftBadge{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_GiftBadge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_GiftBadge) ProtoMessage() {} + +func (x *DataMessage_GiftBadge) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && 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_GiftBadge.ProtoReflect.Descriptor instead. +func (*DataMessage_GiftBadge) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 8} +} + +func (x *DataMessage_GiftBadge) GetReceiptCredentialPresentation() []byte { + if x != nil { + return x.ReceiptCredentialPresentation + } + return nil +} + +type DataMessage_Quote_QuotedAttachment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentType *string `protobuf:"bytes,1,opt,name=contentType" json:"contentType,omitempty"` + FileName *string `protobuf:"bytes,2,opt,name=fileName" json:"fileName,omitempty"` + Thumbnail *AttachmentPointer `protobuf:"bytes,3,opt,name=thumbnail" json:"thumbnail,omitempty"` +} + +func (x *DataMessage_Quote_QuotedAttachment) Reset() { + *x = DataMessage_Quote_QuotedAttachment{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Quote_QuotedAttachment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Quote_QuotedAttachment) ProtoMessage() {} + +func (x *DataMessage_Quote_QuotedAttachment) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && 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_Quote_QuotedAttachment.ProtoReflect.Descriptor instead. +func (*DataMessage_Quote_QuotedAttachment) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 0, 0} +} + +func (x *DataMessage_Quote_QuotedAttachment) GetContentType() string { + if x != nil && x.ContentType != nil { + return *x.ContentType + } + return "" +} + +func (x *DataMessage_Quote_QuotedAttachment) GetFileName() string { + if x != nil && x.FileName != nil { + return *x.FileName + } + return "" +} + +func (x *DataMessage_Quote_QuotedAttachment) GetThumbnail() *AttachmentPointer { + if x != nil { + return x.Thumbnail + } + return nil +} + +type DataMessage_Contact_Name struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + GivenName *string `protobuf:"bytes,1,opt,name=givenName" json:"givenName,omitempty"` + FamilyName *string `protobuf:"bytes,2,opt,name=familyName" json:"familyName,omitempty"` + Prefix *string `protobuf:"bytes,3,opt,name=prefix" json:"prefix,omitempty"` + Suffix *string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"` + MiddleName *string `protobuf:"bytes,5,opt,name=middleName" json:"middleName,omitempty"` + DisplayName *string `protobuf:"bytes,6,opt,name=displayName" json:"displayName,omitempty"` +} + +func (x *DataMessage_Contact_Name) Reset() { + *x = DataMessage_Contact_Name{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Contact_Name) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Contact_Name) ProtoMessage() {} + +func (x *DataMessage_Contact_Name) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && 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_Contact_Name.ProtoReflect.Descriptor instead. +func (*DataMessage_Contact_Name) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 0} +} + +func (x *DataMessage_Contact_Name) GetGivenName() string { + if x != nil && x.GivenName != nil { + return *x.GivenName + } + return "" +} + +func (x *DataMessage_Contact_Name) GetFamilyName() string { + if x != nil && x.FamilyName != nil { + return *x.FamilyName + } + return "" +} + +func (x *DataMessage_Contact_Name) GetPrefix() string { + if x != nil && x.Prefix != nil { + return *x.Prefix + } + return "" +} + +func (x *DataMessage_Contact_Name) GetSuffix() string { + if x != nil && x.Suffix != nil { + return *x.Suffix + } + return "" +} + +func (x *DataMessage_Contact_Name) GetMiddleName() string { + if x != nil && x.MiddleName != nil { + return *x.MiddleName + } + return "" +} + +func (x *DataMessage_Contact_Name) GetDisplayName() string { + if x != nil && x.DisplayName != nil { + return *x.DisplayName + } + return "" +} + +type DataMessage_Contact_Phone struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + Type *DataMessage_Contact_Phone_Type `protobuf:"varint,2,opt,name=type,enum=signalservice.DataMessage_Contact_Phone_Type" json:"type,omitempty"` + Label *string `protobuf:"bytes,3,opt,name=label" json:"label,omitempty"` +} + +func (x *DataMessage_Contact_Phone) Reset() { + *x = DataMessage_Contact_Phone{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Contact_Phone) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Contact_Phone) ProtoMessage() {} + +func (x *DataMessage_Contact_Phone) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && 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_Contact_Phone.ProtoReflect.Descriptor instead. +func (*DataMessage_Contact_Phone) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 1} +} + +func (x *DataMessage_Contact_Phone) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *DataMessage_Contact_Phone) GetType() DataMessage_Contact_Phone_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return DataMessage_Contact_Phone_HOME +} + +func (x *DataMessage_Contact_Phone) GetLabel() string { + if x != nil && x.Label != nil { + return *x.Label + } + return "" +} + +type DataMessage_Contact_Email struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` + Type *DataMessage_Contact_Email_Type `protobuf:"varint,2,opt,name=type,enum=signalservice.DataMessage_Contact_Email_Type" json:"type,omitempty"` + Label *string `protobuf:"bytes,3,opt,name=label" json:"label,omitempty"` +} + +func (x *DataMessage_Contact_Email) Reset() { + *x = DataMessage_Contact_Email{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[40] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Contact_Email) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Contact_Email) ProtoMessage() {} + +func (x *DataMessage_Contact_Email) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[40] + if protoimpl.UnsafeEnabled && 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_Contact_Email.ProtoReflect.Descriptor instead. +func (*DataMessage_Contact_Email) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 2} +} + +func (x *DataMessage_Contact_Email) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + +func (x *DataMessage_Contact_Email) GetType() DataMessage_Contact_Email_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return DataMessage_Contact_Email_HOME +} + +func (x *DataMessage_Contact_Email) GetLabel() string { + if x != nil && x.Label != nil { + return *x.Label + } + return "" +} + +type DataMessage_Contact_PostalAddress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *DataMessage_Contact_PostalAddress_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.DataMessage_Contact_PostalAddress_Type" json:"type,omitempty"` + Label *string `protobuf:"bytes,2,opt,name=label" json:"label,omitempty"` + Street *string `protobuf:"bytes,3,opt,name=street" json:"street,omitempty"` + Pobox *string `protobuf:"bytes,4,opt,name=pobox" json:"pobox,omitempty"` + Neighborhood *string `protobuf:"bytes,5,opt,name=neighborhood" json:"neighborhood,omitempty"` + City *string `protobuf:"bytes,6,opt,name=city" json:"city,omitempty"` + Region *string `protobuf:"bytes,7,opt,name=region" json:"region,omitempty"` + Postcode *string `protobuf:"bytes,8,opt,name=postcode" json:"postcode,omitempty"` + Country *string `protobuf:"bytes,9,opt,name=country" json:"country,omitempty"` +} + +func (x *DataMessage_Contact_PostalAddress) Reset() { + *x = DataMessage_Contact_PostalAddress{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Contact_PostalAddress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Contact_PostalAddress) ProtoMessage() {} + +func (x *DataMessage_Contact_PostalAddress) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[41] + if protoimpl.UnsafeEnabled && 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_Contact_PostalAddress.ProtoReflect.Descriptor instead. +func (*DataMessage_Contact_PostalAddress) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 3} +} + +func (x *DataMessage_Contact_PostalAddress) GetType() DataMessage_Contact_PostalAddress_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return DataMessage_Contact_PostalAddress_HOME +} + +func (x *DataMessage_Contact_PostalAddress) GetLabel() string { + if x != nil && x.Label != nil { + return *x.Label + } + return "" +} + +func (x *DataMessage_Contact_PostalAddress) GetStreet() string { + if x != nil && x.Street != nil { + return *x.Street + } + return "" +} + +func (x *DataMessage_Contact_PostalAddress) GetPobox() string { + if x != nil && x.Pobox != nil { + return *x.Pobox + } + return "" +} + +func (x *DataMessage_Contact_PostalAddress) GetNeighborhood() string { + if x != nil && x.Neighborhood != nil { + return *x.Neighborhood + } + return "" +} + +func (x *DataMessage_Contact_PostalAddress) GetCity() string { + if x != nil && x.City != nil { + return *x.City + } + return "" +} + +func (x *DataMessage_Contact_PostalAddress) GetRegion() string { + if x != nil && x.Region != nil { + return *x.Region + } + return "" +} + +func (x *DataMessage_Contact_PostalAddress) GetPostcode() string { + if x != nil && x.Postcode != nil { + return *x.Postcode + } + return "" +} + +func (x *DataMessage_Contact_PostalAddress) GetCountry() string { + if x != nil && x.Country != nil { + return *x.Country + } + return "" +} + +type DataMessage_Contact_Avatar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Avatar *AttachmentPointer `protobuf:"bytes,1,opt,name=avatar" json:"avatar,omitempty"` + IsProfile *bool `protobuf:"varint,2,opt,name=isProfile" json:"isProfile,omitempty"` +} + +func (x *DataMessage_Contact_Avatar) Reset() { + *x = DataMessage_Contact_Avatar{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[42] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Contact_Avatar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Contact_Avatar) ProtoMessage() {} + +func (x *DataMessage_Contact_Avatar) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[42] + if protoimpl.UnsafeEnabled && 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_Contact_Avatar.ProtoReflect.Descriptor instead. +func (*DataMessage_Contact_Avatar) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 1, 4} +} + +func (x *DataMessage_Contact_Avatar) GetAvatar() *AttachmentPointer { + if x != nil { + return x.Avatar + } + return nil +} + +func (x *DataMessage_Contact_Avatar) GetIsProfile() bool { + if x != nil && x.IsProfile != nil { + return *x.IsProfile + } + return false +} + +type DataMessage_Payment_Amount struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Amount: + // + // *DataMessage_Payment_Amount_MobileCoin_ + Amount isDataMessage_Payment_Amount_Amount `protobuf_oneof:"Amount"` +} + +func (x *DataMessage_Payment_Amount) Reset() { + *x = DataMessage_Payment_Amount{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Payment_Amount) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Payment_Amount) ProtoMessage() {} + +func (x *DataMessage_Payment_Amount) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[43] + if protoimpl.UnsafeEnabled && 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_Payment_Amount.ProtoReflect.Descriptor instead. +func (*DataMessage_Payment_Amount) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 7, 0} +} + +func (m *DataMessage_Payment_Amount) GetAmount() isDataMessage_Payment_Amount_Amount { + if m != nil { + return m.Amount + } + return nil +} + +func (x *DataMessage_Payment_Amount) GetMobileCoin() *DataMessage_Payment_Amount_MobileCoin { + if x, ok := x.GetAmount().(*DataMessage_Payment_Amount_MobileCoin_); ok { + return x.MobileCoin + } + return nil +} + +type isDataMessage_Payment_Amount_Amount interface { + isDataMessage_Payment_Amount_Amount() +} + +type DataMessage_Payment_Amount_MobileCoin_ struct { + MobileCoin *DataMessage_Payment_Amount_MobileCoin `protobuf:"bytes,1,opt,name=mobileCoin,oneof"` +} + +func (*DataMessage_Payment_Amount_MobileCoin_) isDataMessage_Payment_Amount_Amount() {} + +type DataMessage_Payment_Notification struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Transaction: + // + // *DataMessage_Payment_Notification_MobileCoin_ + Transaction isDataMessage_Payment_Notification_Transaction `protobuf_oneof:"Transaction"` + Note *string `protobuf:"bytes,2,opt,name=note" json:"note,omitempty"` +} + +func (x *DataMessage_Payment_Notification) Reset() { + *x = DataMessage_Payment_Notification{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[44] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Payment_Notification) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Payment_Notification) ProtoMessage() {} + +func (x *DataMessage_Payment_Notification) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[44] + if protoimpl.UnsafeEnabled && 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_Payment_Notification.ProtoReflect.Descriptor instead. +func (*DataMessage_Payment_Notification) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 7, 1} +} + +func (m *DataMessage_Payment_Notification) GetTransaction() isDataMessage_Payment_Notification_Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (x *DataMessage_Payment_Notification) GetMobileCoin() *DataMessage_Payment_Notification_MobileCoin { + if x, ok := x.GetTransaction().(*DataMessage_Payment_Notification_MobileCoin_); ok { + return x.MobileCoin + } + return nil +} + +func (x *DataMessage_Payment_Notification) GetNote() string { + if x != nil && x.Note != nil { + return *x.Note + } + return "" +} + +type isDataMessage_Payment_Notification_Transaction interface { + isDataMessage_Payment_Notification_Transaction() +} + +type DataMessage_Payment_Notification_MobileCoin_ struct { + MobileCoin *DataMessage_Payment_Notification_MobileCoin `protobuf:"bytes,1,opt,name=mobileCoin,oneof"` +} + +func (*DataMessage_Payment_Notification_MobileCoin_) isDataMessage_Payment_Notification_Transaction() { +} + +type DataMessage_Payment_Activation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *DataMessage_Payment_Activation_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.DataMessage_Payment_Activation_Type" json:"type,omitempty"` +} + +func (x *DataMessage_Payment_Activation) Reset() { + *x = DataMessage_Payment_Activation{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[45] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Payment_Activation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Payment_Activation) ProtoMessage() {} + +func (x *DataMessage_Payment_Activation) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[45] + if protoimpl.UnsafeEnabled && 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_Payment_Activation.ProtoReflect.Descriptor instead. +func (*DataMessage_Payment_Activation) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 7, 2} +} + +func (x *DataMessage_Payment_Activation) GetType() DataMessage_Payment_Activation_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return DataMessage_Payment_Activation_REQUEST +} + +type DataMessage_Payment_Amount_MobileCoin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PicoMob *uint64 `protobuf:"varint,1,opt,name=picoMob" json:"picoMob,omitempty"` +} + +func (x *DataMessage_Payment_Amount_MobileCoin) Reset() { + *x = DataMessage_Payment_Amount_MobileCoin{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[46] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Payment_Amount_MobileCoin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Payment_Amount_MobileCoin) ProtoMessage() {} + +func (x *DataMessage_Payment_Amount_MobileCoin) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[46] + if protoimpl.UnsafeEnabled && 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_Payment_Amount_MobileCoin.ProtoReflect.Descriptor instead. +func (*DataMessage_Payment_Amount_MobileCoin) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 7, 0, 0} +} + +func (x *DataMessage_Payment_Amount_MobileCoin) GetPicoMob() uint64 { + if x != nil && x.PicoMob != nil { + return *x.PicoMob + } + return 0 +} + +type DataMessage_Payment_Notification_MobileCoin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Receipt []byte `protobuf:"bytes,1,opt,name=receipt" json:"receipt,omitempty"` +} + +func (x *DataMessage_Payment_Notification_MobileCoin) Reset() { + *x = DataMessage_Payment_Notification_MobileCoin{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DataMessage_Payment_Notification_MobileCoin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DataMessage_Payment_Notification_MobileCoin) ProtoMessage() {} + +func (x *DataMessage_Payment_Notification_MobileCoin) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[47] + if protoimpl.UnsafeEnabled && 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_Payment_Notification_MobileCoin.ProtoReflect.Descriptor instead. +func (*DataMessage_Payment_Notification_MobileCoin) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{4, 7, 1, 0} +} + +func (x *DataMessage_Payment_Notification_MobileCoin) GetReceipt() []byte { + if x != nil { + return x.Receipt + } + return nil +} + +type TextAttachment_Gradient struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StartColor *uint32 `protobuf:"varint,1,opt,name=startColor" json:"startColor,omitempty"` // deprecated: this field will be removed in a future release. + EndColor *uint32 `protobuf:"varint,2,opt,name=endColor" json:"endColor,omitempty"` // deprecated: this field will be removed in a future release. + Angle *uint32 `protobuf:"varint,3,opt,name=angle" json:"angle,omitempty"` // degrees + Colors []uint32 `protobuf:"varint,4,rep,name=colors" json:"colors,omitempty"` + Positions []float32 `protobuf:"fixed32,5,rep,name=positions" json:"positions,omitempty"` // percent from 0 to 1 +} + +func (x *TextAttachment_Gradient) Reset() { + *x = TextAttachment_Gradient{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TextAttachment_Gradient) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TextAttachment_Gradient) ProtoMessage() {} + +func (x *TextAttachment_Gradient) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[48] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TextAttachment_Gradient.ProtoReflect.Descriptor instead. +func (*TextAttachment_Gradient) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *TextAttachment_Gradient) GetStartColor() uint32 { + if x != nil && x.StartColor != nil { + return *x.StartColor + } + return 0 +} + +func (x *TextAttachment_Gradient) GetEndColor() uint32 { + if x != nil && x.EndColor != nil { + return *x.EndColor + } + return 0 +} + +func (x *TextAttachment_Gradient) GetAngle() uint32 { + if x != nil && x.Angle != nil { + return *x.Angle + } + return 0 +} + +func (x *TextAttachment_Gradient) GetColors() []uint32 { + if x != nil { + return x.Colors + } + return nil +} + +func (x *TextAttachment_Gradient) GetPositions() []float32 { + if x != nil { + return x.Positions + } + return nil +} + +type SyncMessage_Sent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +// Default values for SyncMessage_Sent fields. +const ( + Default_SyncMessage_Sent_IsRecipientUpdate = bool(false) +) + +func (x *SyncMessage_Sent) Reset() { + *x = SyncMessage_Sent{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Sent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Sent) ProtoMessage() {} + +func (x *SyncMessage_Sent) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Sent.ProtoReflect.Descriptor instead. +func (*SyncMessage_Sent) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *SyncMessage_Sent) GetDestinationE164() string { + if x != nil && x.DestinationE164 != nil { + return *x.DestinationE164 + } + return "" +} + +func (x *SyncMessage_Sent) GetDestinationServiceId() string { + if x != nil && x.DestinationServiceId != nil { + return *x.DestinationServiceId + } + return "" +} + +func (x *SyncMessage_Sent) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +func (x *SyncMessage_Sent) GetMessage() *DataMessage { + if x != nil { + return x.Message + } + return nil +} + +func (x *SyncMessage_Sent) GetExpirationStartTimestamp() uint64 { + if x != nil && x.ExpirationStartTimestamp != nil { + return *x.ExpirationStartTimestamp + } + return 0 +} + +func (x *SyncMessage_Sent) GetUnidentifiedStatus() []*SyncMessage_Sent_UnidentifiedDeliveryStatus { + if x != nil { + return x.UnidentifiedStatus + } + return nil +} + +func (x *SyncMessage_Sent) GetIsRecipientUpdate() bool { + if x != nil && x.IsRecipientUpdate != nil { + return *x.IsRecipientUpdate + } + return Default_SyncMessage_Sent_IsRecipientUpdate +} + +func (x *SyncMessage_Sent) GetStoryMessage() *StoryMessage { + if x != nil { + return x.StoryMessage + } + return nil +} + +func (x *SyncMessage_Sent) GetStoryMessageRecipients() []*SyncMessage_Sent_StoryMessageRecipient { + if x != nil { + return x.StoryMessageRecipients + } + return nil +} + +func (x *SyncMessage_Sent) GetEditMessage() *EditMessage { + if x != nil { + return x.EditMessage + } + return nil +} + +type SyncMessage_Contacts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Blob *AttachmentPointer `protobuf:"bytes,1,opt,name=blob" json:"blob,omitempty"` + Complete *bool `protobuf:"varint,2,opt,name=complete,def=0" json:"complete,omitempty"` +} + +// Default values for SyncMessage_Contacts fields. +const ( + Default_SyncMessage_Contacts_Complete = bool(false) +) + +func (x *SyncMessage_Contacts) Reset() { + *x = SyncMessage_Contacts{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[50] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Contacts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Contacts) ProtoMessage() {} + +func (x *SyncMessage_Contacts) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[50] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Contacts.ProtoReflect.Descriptor instead. +func (*SyncMessage_Contacts) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 1} +} + +func (x *SyncMessage_Contacts) GetBlob() *AttachmentPointer { + if x != nil { + return x.Blob + } + return nil +} + +func (x *SyncMessage_Contacts) GetComplete() bool { + if x != nil && x.Complete != nil { + return *x.Complete + } + return Default_SyncMessage_Contacts_Complete +} + +type SyncMessage_Blocked struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *SyncMessage_Blocked) Reset() { + *x = SyncMessage_Blocked{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[51] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Blocked) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Blocked) ProtoMessage() {} + +func (x *SyncMessage_Blocked) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[51] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Blocked.ProtoReflect.Descriptor instead. +func (*SyncMessage_Blocked) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 2} +} + +func (x *SyncMessage_Blocked) GetNumbers() []string { + if x != nil { + return x.Numbers + } + return nil +} + +func (x *SyncMessage_Blocked) GetAcis() []string { + if x != nil { + return x.Acis + } + return nil +} + +func (x *SyncMessage_Blocked) GetGroupIds() [][]byte { + if x != nil { + return x.GroupIds + } + return nil +} + +type SyncMessage_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *SyncMessage_Request_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.SyncMessage_Request_Type" json:"type,omitempty"` +} + +func (x *SyncMessage_Request) Reset() { + *x = SyncMessage_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[52] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Request) ProtoMessage() {} + +func (x *SyncMessage_Request) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[52] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Request.ProtoReflect.Descriptor instead. +func (*SyncMessage_Request) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 3} +} + +func (x *SyncMessage_Request) GetType() SyncMessage_Request_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return SyncMessage_Request_UNKNOWN +} + +type SyncMessage_Read struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` +} + +func (x *SyncMessage_Read) Reset() { + *x = SyncMessage_Read{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[53] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Read) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Read) ProtoMessage() {} + +func (x *SyncMessage_Read) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[53] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Read.ProtoReflect.Descriptor instead. +func (*SyncMessage_Read) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 4} +} + +func (x *SyncMessage_Read) GetSenderAci() string { + if x != nil && x.SenderAci != nil { + return *x.SenderAci + } + return "" +} + +func (x *SyncMessage_Read) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +type SyncMessage_Viewed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` +} + +func (x *SyncMessage_Viewed) Reset() { + *x = SyncMessage_Viewed{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[54] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Viewed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Viewed) ProtoMessage() {} + +func (x *SyncMessage_Viewed) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[54] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Viewed.ProtoReflect.Descriptor instead. +func (*SyncMessage_Viewed) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 5} +} + +func (x *SyncMessage_Viewed) GetSenderAci() string { + if x != nil && x.SenderAci != nil { + return *x.SenderAci + } + return "" +} + +func (x *SyncMessage_Viewed) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +type SyncMessage_Configuration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *SyncMessage_Configuration) Reset() { + *x = SyncMessage_Configuration{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[55] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Configuration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Configuration) ProtoMessage() {} + +func (x *SyncMessage_Configuration) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[55] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Configuration.ProtoReflect.Descriptor instead. +func (*SyncMessage_Configuration) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 6} +} + +func (x *SyncMessage_Configuration) GetReadReceipts() bool { + if x != nil && x.ReadReceipts != nil { + return *x.ReadReceipts + } + return false +} + +func (x *SyncMessage_Configuration) GetUnidentifiedDeliveryIndicators() bool { + if x != nil && x.UnidentifiedDeliveryIndicators != nil { + return *x.UnidentifiedDeliveryIndicators + } + return false +} + +func (x *SyncMessage_Configuration) GetTypingIndicators() bool { + if x != nil && x.TypingIndicators != nil { + return *x.TypingIndicators + } + 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 + } + return false +} + +type SyncMessage_StickerPackOperation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PackId []byte `protobuf:"bytes,1,opt,name=packId" json:"packId,omitempty"` + PackKey []byte `protobuf:"bytes,2,opt,name=packKey" json:"packKey,omitempty"` + Type *SyncMessage_StickerPackOperation_Type `protobuf:"varint,3,opt,name=type,enum=signalservice.SyncMessage_StickerPackOperation_Type" json:"type,omitempty"` +} + +func (x *SyncMessage_StickerPackOperation) Reset() { + *x = SyncMessage_StickerPackOperation{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[56] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_StickerPackOperation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_StickerPackOperation) ProtoMessage() {} + +func (x *SyncMessage_StickerPackOperation) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[56] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_StickerPackOperation.ProtoReflect.Descriptor instead. +func (*SyncMessage_StickerPackOperation) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 7} +} + +func (x *SyncMessage_StickerPackOperation) GetPackId() []byte { + if x != nil { + return x.PackId + } + return nil +} + +func (x *SyncMessage_StickerPackOperation) GetPackKey() []byte { + if x != nil { + return x.PackKey + } + return nil +} + +func (x *SyncMessage_StickerPackOperation) GetType() SyncMessage_StickerPackOperation_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return SyncMessage_StickerPackOperation_INSTALL +} + +type SyncMessage_ViewOnceOpen struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderAci *string `protobuf:"bytes,3,opt,name=senderAci" json:"senderAci,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` +} + +func (x *SyncMessage_ViewOnceOpen) Reset() { + *x = SyncMessage_ViewOnceOpen{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_ViewOnceOpen) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_ViewOnceOpen) ProtoMessage() {} + +func (x *SyncMessage_ViewOnceOpen) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[57] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_ViewOnceOpen.ProtoReflect.Descriptor instead. +func (*SyncMessage_ViewOnceOpen) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 8} +} + +func (x *SyncMessage_ViewOnceOpen) GetSenderAci() string { + if x != nil && x.SenderAci != nil { + return *x.SenderAci + } + return "" +} + +func (x *SyncMessage_ViewOnceOpen) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +type SyncMessage_FetchLatest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *SyncMessage_FetchLatest_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.SyncMessage_FetchLatest_Type" json:"type,omitempty"` +} + +func (x *SyncMessage_FetchLatest) Reset() { + *x = SyncMessage_FetchLatest{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[58] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_FetchLatest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_FetchLatest) ProtoMessage() {} + +func (x *SyncMessage_FetchLatest) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[58] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_FetchLatest.ProtoReflect.Descriptor instead. +func (*SyncMessage_FetchLatest) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 9} +} + +func (x *SyncMessage_FetchLatest) GetType() SyncMessage_FetchLatest_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return SyncMessage_FetchLatest_UNKNOWN +} + +type SyncMessage_Keys struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // @deprecated + StorageService []byte `protobuf:"bytes,1,opt,name=storageService" json:"storageService,omitempty"` + Master []byte `protobuf:"bytes,2,opt,name=master" json:"master,omitempty"` +} + +func (x *SyncMessage_Keys) Reset() { + *x = SyncMessage_Keys{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[59] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Keys) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Keys) ProtoMessage() {} + +func (x *SyncMessage_Keys) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[59] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Keys.ProtoReflect.Descriptor instead. +func (*SyncMessage_Keys) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 10} +} + +func (x *SyncMessage_Keys) GetStorageService() []byte { + if x != nil { + return x.StorageService + } + return nil +} + +func (x *SyncMessage_Keys) GetMaster() []byte { + if x != nil { + return x.Master + } + return nil +} + +type SyncMessage_MessageRequestResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *SyncMessage_MessageRequestResponse) Reset() { + *x = SyncMessage_MessageRequestResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[60] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_MessageRequestResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_MessageRequestResponse) ProtoMessage() {} + +func (x *SyncMessage_MessageRequestResponse) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[60] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_MessageRequestResponse.ProtoReflect.Descriptor instead. +func (*SyncMessage_MessageRequestResponse) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 11} +} + +func (x *SyncMessage_MessageRequestResponse) GetThreadAci() string { + if x != nil && x.ThreadAci != nil { + return *x.ThreadAci + } + return "" +} + +func (x *SyncMessage_MessageRequestResponse) GetGroupId() []byte { + if x != nil { + return x.GroupId + } + return nil +} + +func (x *SyncMessage_MessageRequestResponse) GetType() SyncMessage_MessageRequestResponse_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return SyncMessage_MessageRequestResponse_UNKNOWN +} + +type SyncMessage_OutgoingPayment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RecipientServiceId *string `protobuf:"bytes,1,opt,name=recipientServiceId" json:"recipientServiceId,omitempty"` + Note *string `protobuf:"bytes,2,opt,name=note" json:"note,omitempty"` + // Types that are assignable to PaymentDetail: + // + // *SyncMessage_OutgoingPayment_MobileCoin_ + PaymentDetail isSyncMessage_OutgoingPayment_PaymentDetail `protobuf_oneof:"paymentDetail"` +} + +func (x *SyncMessage_OutgoingPayment) Reset() { + *x = SyncMessage_OutgoingPayment{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[61] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_OutgoingPayment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_OutgoingPayment) ProtoMessage() {} + +func (x *SyncMessage_OutgoingPayment) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[61] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_OutgoingPayment.ProtoReflect.Descriptor instead. +func (*SyncMessage_OutgoingPayment) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 12} +} + +func (x *SyncMessage_OutgoingPayment) GetRecipientServiceId() string { + if x != nil && x.RecipientServiceId != nil { + return *x.RecipientServiceId + } + return "" +} + +func (x *SyncMessage_OutgoingPayment) GetNote() string { + if x != nil && x.Note != nil { + return *x.Note + } + return "" +} + +func (m *SyncMessage_OutgoingPayment) GetPaymentDetail() isSyncMessage_OutgoingPayment_PaymentDetail { + if m != nil { + return m.PaymentDetail + } + return nil +} + +func (x *SyncMessage_OutgoingPayment) GetMobileCoin() *SyncMessage_OutgoingPayment_MobileCoin { + if x, ok := x.GetPaymentDetail().(*SyncMessage_OutgoingPayment_MobileCoin_); ok { + return x.MobileCoin + } + return nil +} + +type isSyncMessage_OutgoingPayment_PaymentDetail interface { + isSyncMessage_OutgoingPayment_PaymentDetail() +} + +type SyncMessage_OutgoingPayment_MobileCoin_ struct { + MobileCoin *SyncMessage_OutgoingPayment_MobileCoin `protobuf:"bytes,3,opt,name=mobileCoin,oneof"` +} + +func (*SyncMessage_OutgoingPayment_MobileCoin_) isSyncMessage_OutgoingPayment_PaymentDetail() {} + +type SyncMessage_PniChangeNumber struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IdentityKeyPair []byte `protobuf:"bytes,1,opt,name=identityKeyPair" json:"identityKeyPair,omitempty"` // Serialized libsignal-client IdentityKeyPair + SignedPreKey []byte `protobuf:"bytes,2,opt,name=signedPreKey" json:"signedPreKey,omitempty"` // Serialized libsignal-client SignedPreKeyRecord + LastResortKyberPreKey []byte `protobuf:"bytes,5,opt,name=lastResortKyberPreKey" json:"lastResortKyberPreKey,omitempty"` // Serialized libsignal-client KyberPreKeyRecord + RegistrationId *uint32 `protobuf:"varint,3,opt,name=registrationId" json:"registrationId,omitempty"` + NewE164 *string `protobuf:"bytes,4,opt,name=newE164" json:"newE164,omitempty"` // The e164 we have changed our number to +} + +func (x *SyncMessage_PniChangeNumber) Reset() { + *x = SyncMessage_PniChangeNumber{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[62] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_PniChangeNumber) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_PniChangeNumber) ProtoMessage() {} + +func (x *SyncMessage_PniChangeNumber) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[62] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_PniChangeNumber.ProtoReflect.Descriptor instead. +func (*SyncMessage_PniChangeNumber) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 13} +} + +func (x *SyncMessage_PniChangeNumber) GetIdentityKeyPair() []byte { + if x != nil { + return x.IdentityKeyPair + } + return nil +} + +func (x *SyncMessage_PniChangeNumber) GetSignedPreKey() []byte { + if x != nil { + return x.SignedPreKey + } + return nil +} + +func (x *SyncMessage_PniChangeNumber) GetLastResortKyberPreKey() []byte { + if x != nil { + return x.LastResortKyberPreKey + } + return nil +} + +func (x *SyncMessage_PniChangeNumber) GetRegistrationId() uint32 { + if x != nil && x.RegistrationId != nil { + return *x.RegistrationId + } + return 0 +} + +func (x *SyncMessage_PniChangeNumber) GetNewE164() string { + if x != nil && x.NewE164 != nil { + return *x.NewE164 + } + return "" +} + +type SyncMessage_CallEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ConversationId []byte `protobuf:"bytes,1,opt,name=conversationId" json:"conversationId,omitempty"` + Id *uint64 `protobuf:"varint,2,opt,name=id" json:"id,omitempty"` + Timestamp *uint64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` + Type *SyncMessage_CallEvent_Type `protobuf:"varint,4,opt,name=type,enum=signalservice.SyncMessage_CallEvent_Type" json:"type,omitempty"` + Direction *SyncMessage_CallEvent_Direction `protobuf:"varint,5,opt,name=direction,enum=signalservice.SyncMessage_CallEvent_Direction" json:"direction,omitempty"` + Event *SyncMessage_CallEvent_Event `protobuf:"varint,6,opt,name=event,enum=signalservice.SyncMessage_CallEvent_Event" json:"event,omitempty"` +} + +func (x *SyncMessage_CallEvent) Reset() { + *x = SyncMessage_CallEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[63] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_CallEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_CallEvent) ProtoMessage() {} + +func (x *SyncMessage_CallEvent) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[63] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_CallEvent.ProtoReflect.Descriptor instead. +func (*SyncMessage_CallEvent) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 14} +} + +func (x *SyncMessage_CallEvent) GetConversationId() []byte { + if x != nil { + return x.ConversationId + } + return nil +} + +func (x *SyncMessage_CallEvent) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *SyncMessage_CallEvent) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +func (x *SyncMessage_CallEvent) GetType() SyncMessage_CallEvent_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return SyncMessage_CallEvent_UNKNOWN_TYPE +} + +func (x *SyncMessage_CallEvent) GetDirection() SyncMessage_CallEvent_Direction { + if x != nil && x.Direction != nil { + return *x.Direction + } + return SyncMessage_CallEvent_UNKNOWN_DIRECTION +} + +func (x *SyncMessage_CallEvent) GetEvent() SyncMessage_CallEvent_Event { + if x != nil && x.Event != nil { + return *x.Event + } + return SyncMessage_CallEvent_UNKNOWN_ACTION +} + +type SyncMessage_CallLinkUpdate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RootKey []byte `protobuf:"bytes,1,opt,name=rootKey" json:"rootKey,omitempty"` + AdminPassKey []byte `protobuf:"bytes,2,opt,name=adminPassKey" json:"adminPassKey,omitempty"` +} + +func (x *SyncMessage_CallLinkUpdate) Reset() { + *x = SyncMessage_CallLinkUpdate{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_CallLinkUpdate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_CallLinkUpdate) ProtoMessage() {} + +func (x *SyncMessage_CallLinkUpdate) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[64] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_CallLinkUpdate.ProtoReflect.Descriptor instead. +func (*SyncMessage_CallLinkUpdate) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 15} +} + +func (x *SyncMessage_CallLinkUpdate) GetRootKey() []byte { + if x != nil { + return x.RootKey + } + return nil +} + +func (x *SyncMessage_CallLinkUpdate) GetAdminPassKey() []byte { + if x != nil { + return x.AdminPassKey + } + return nil +} + +type SyncMessage_CallLogEvent struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *SyncMessage_CallLogEvent_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.SyncMessage_CallLogEvent_Type" json:"type,omitempty"` + Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` +} + +func (x *SyncMessage_CallLogEvent) Reset() { + *x = SyncMessage_CallLogEvent{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[65] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_CallLogEvent) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_CallLogEvent) ProtoMessage() {} + +func (x *SyncMessage_CallLogEvent) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[65] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_CallLogEvent.ProtoReflect.Descriptor instead. +func (*SyncMessage_CallLogEvent) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 16} +} + +func (x *SyncMessage_CallLogEvent) GetType() SyncMessage_CallLogEvent_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return SyncMessage_CallLogEvent_CLEAR +} + +func (x *SyncMessage_CallLogEvent) GetTimestamp() uint64 { + if x != nil && x.Timestamp != nil { + return *x.Timestamp + } + return 0 +} + +type SyncMessage_Sent_UnidentifiedDeliveryStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DestinationServiceId *string `protobuf:"bytes,3,opt,name=destinationServiceId" json:"destinationServiceId,omitempty"` + Unidentified *bool `protobuf:"varint,2,opt,name=unidentified" json:"unidentified,omitempty"` +} + +func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) Reset() { + *x = SyncMessage_Sent_UnidentifiedDeliveryStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[66] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Sent_UnidentifiedDeliveryStatus) ProtoMessage() {} + +func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[66] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Sent_UnidentifiedDeliveryStatus.ProtoReflect.Descriptor instead. +func (*SyncMessage_Sent_UnidentifiedDeliveryStatus) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 0, 0} +} + +func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) GetDestinationServiceId() string { + if x != nil && x.DestinationServiceId != nil { + return *x.DestinationServiceId + } + return "" +} + +func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) GetUnidentified() bool { + if x != nil && x.Unidentified != nil { + return *x.Unidentified + } + return false +} + +type SyncMessage_Sent_StoryMessageRecipient struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *SyncMessage_Sent_StoryMessageRecipient) Reset() { + *x = SyncMessage_Sent_StoryMessageRecipient{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[67] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_Sent_StoryMessageRecipient) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_Sent_StoryMessageRecipient) ProtoMessage() {} + +func (x *SyncMessage_Sent_StoryMessageRecipient) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[67] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_Sent_StoryMessageRecipient.ProtoReflect.Descriptor instead. +func (*SyncMessage_Sent_StoryMessageRecipient) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 0, 1} +} + +func (x *SyncMessage_Sent_StoryMessageRecipient) GetDestinationServiceId() string { + if x != nil && x.DestinationServiceId != nil { + return *x.DestinationServiceId + } + return "" +} + +func (x *SyncMessage_Sent_StoryMessageRecipient) GetDistributionListIds() []string { + if x != nil { + return x.DistributionListIds + } + return nil +} + +func (x *SyncMessage_Sent_StoryMessageRecipient) GetIsAllowedToReply() bool { + if x != nil && x.IsAllowedToReply != nil { + return *x.IsAllowedToReply + } + return false +} + +type SyncMessage_OutgoingPayment_MobileCoin struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipientAddress" json:"recipientAddress,omitempty"` + // @required + AmountPicoMob *uint64 `protobuf:"varint,2,opt,name=amountPicoMob" json:"amountPicoMob,omitempty"` + // @required + FeePicoMob *uint64 `protobuf:"varint,3,opt,name=feePicoMob" json:"feePicoMob,omitempty"` + Receipt []byte `protobuf:"bytes,4,opt,name=receipt" json:"receipt,omitempty"` + LedgerBlockTimestamp *uint64 `protobuf:"varint,5,opt,name=ledgerBlockTimestamp" json:"ledgerBlockTimestamp,omitempty"` + // @required + LedgerBlockIndex *uint64 `protobuf:"varint,6,opt,name=ledgerBlockIndex" json:"ledgerBlockIndex,omitempty"` + SpentKeyImages [][]byte `protobuf:"bytes,7,rep,name=spentKeyImages" json:"spentKeyImages,omitempty"` + OutputPublicKeys [][]byte `protobuf:"bytes,8,rep,name=outputPublicKeys" json:"outputPublicKeys,omitempty"` +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) Reset() { + *x = SyncMessage_OutgoingPayment_MobileCoin{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[68] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncMessage_OutgoingPayment_MobileCoin) ProtoMessage() {} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[68] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SyncMessage_OutgoingPayment_MobileCoin.ProtoReflect.Descriptor instead. +func (*SyncMessage_OutgoingPayment_MobileCoin) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{12, 12, 0} +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetRecipientAddress() []byte { + if x != nil { + return x.RecipientAddress + } + return nil +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetAmountPicoMob() uint64 { + if x != nil && x.AmountPicoMob != nil { + return *x.AmountPicoMob + } + return 0 +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetFeePicoMob() uint64 { + if x != nil && x.FeePicoMob != nil { + return *x.FeePicoMob + } + return 0 +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetReceipt() []byte { + if x != nil { + return x.Receipt + } + return nil +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetLedgerBlockTimestamp() uint64 { + if x != nil && x.LedgerBlockTimestamp != nil { + return *x.LedgerBlockTimestamp + } + return 0 +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetLedgerBlockIndex() uint64 { + if x != nil && x.LedgerBlockIndex != nil { + return *x.LedgerBlockIndex + } + return 0 +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetSpentKeyImages() [][]byte { + if x != nil { + return x.SpentKeyImages + } + return nil +} + +func (x *SyncMessage_OutgoingPayment_MobileCoin) GetOutputPublicKeys() [][]byte { + if x != nil { + return x.OutputPublicKeys + } + return nil +} + +type GroupContext_Member struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + E164 *string `protobuf:"bytes,2,opt,name=e164" json:"e164,omitempty"` +} + +func (x *GroupContext_Member) Reset() { + *x = GroupContext_Member{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[69] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupContext_Member) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupContext_Member) ProtoMessage() {} + +func (x *GroupContext_Member) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[69] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupContext_Member.ProtoReflect.Descriptor instead. +func (*GroupContext_Member) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{14, 0} +} + +func (x *GroupContext_Member) GetE164() string { + if x != nil && x.E164 != nil { + return *x.E164 + } + return "" +} + +type ContactDetails_Avatar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentType *string `protobuf:"bytes,1,opt,name=contentType" json:"contentType,omitempty"` + Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` +} + +func (x *ContactDetails_Avatar) Reset() { + *x = ContactDetails_Avatar{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[70] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContactDetails_Avatar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContactDetails_Avatar) ProtoMessage() {} + +func (x *ContactDetails_Avatar) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[70] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContactDetails_Avatar.ProtoReflect.Descriptor instead. +func (*ContactDetails_Avatar) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{16, 0} +} + +func (x *ContactDetails_Avatar) GetContentType() string { + if x != nil && x.ContentType != nil { + return *x.ContentType + } + return "" +} + +func (x *ContactDetails_Avatar) GetLength() uint32 { + if x != nil && x.Length != nil { + return *x.Length + } + return 0 +} + +type GroupDetails_Avatar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentType *string `protobuf:"bytes,1,opt,name=contentType" json:"contentType,omitempty"` + Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` +} + +func (x *GroupDetails_Avatar) Reset() { + *x = GroupDetails_Avatar{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupDetails_Avatar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupDetails_Avatar) ProtoMessage() {} + +func (x *GroupDetails_Avatar) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[71] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupDetails_Avatar.ProtoReflect.Descriptor instead. +func (*GroupDetails_Avatar) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{17, 0} +} + +func (x *GroupDetails_Avatar) GetContentType() string { + if x != nil && x.ContentType != nil { + return *x.ContentType + } + return "" +} + +func (x *GroupDetails_Avatar) GetLength() uint32 { + if x != nil && x.Length != nil { + return *x.Length + } + return 0 +} + +type GroupDetails_Member struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + E164 *string `protobuf:"bytes,2,opt,name=e164" json:"e164,omitempty"` +} + +func (x *GroupDetails_Member) Reset() { + *x = GroupDetails_Member{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[72] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupDetails_Member) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupDetails_Member) ProtoMessage() {} + +func (x *GroupDetails_Member) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[72] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupDetails_Member.ProtoReflect.Descriptor instead. +func (*GroupDetails_Member) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{17, 1} +} + +func (x *GroupDetails_Member) GetE164() string { + if x != nil && x.E164 != nil { + return *x.E164 + } + return "" +} + +type PaymentAddress_MobileCoinAddress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address []byte `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` +} + +func (x *PaymentAddress_MobileCoinAddress) Reset() { + *x = PaymentAddress_MobileCoinAddress{} + if protoimpl.UnsafeEnabled { + mi := &file_SignalService_proto_msgTypes[73] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaymentAddress_MobileCoinAddress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentAddress_MobileCoinAddress) ProtoMessage() {} + +func (x *PaymentAddress_MobileCoinAddress) ProtoReflect() protoreflect.Message { + mi := &file_SignalService_proto_msgTypes[73] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaymentAddress_MobileCoinAddress.ProtoReflect.Descriptor instead. +func (*PaymentAddress_MobileCoinAddress) Descriptor() ([]byte, []int) { + return file_SignalService_proto_rawDescGZIP(), []int{18, 0} +} + +func (x *PaymentAddress_MobileCoinAddress) GetAddress() []byte { + if x != nil { + return x.Address + } + return nil +} + +func (x *PaymentAddress_MobileCoinAddress) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +var File_SignalService_proto protoreflect.FileDescriptor + +var file_SignalService_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x22, 0xc2, 0x04, 0x0a, 0x08, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, + 0x65, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x22, 0x0a, + 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x32, 0x0a, 0x14, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x14, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, + 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x75, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x75, 0x69, 0x64, 0x12, 0x28, 0x0a, + 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x06, 0x75, 0x72, 0x67, 0x65, 0x6e, + 0x74, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x52, 0x06, 0x75, + 0x72, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x11, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x22, 0x8b, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x49, 0x50, + 0x48, 0x45, 0x52, 0x54, 0x45, 0x58, 0x54, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, + 0x5f, 0x45, 0x58, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x50, + 0x52, 0x45, 0x4b, 0x45, 0x59, 0x5f, 0x42, 0x55, 0x4e, 0x44, 0x4c, 0x45, 0x10, 0x03, 0x12, 0x0b, + 0x0a, 0x07, 0x52, 0x45, 0x43, 0x45, 0x49, 0x50, 0x54, 0x10, 0x05, 0x12, 0x17, 0x0a, 0x13, 0x55, + 0x4e, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x53, 0x45, 0x4e, 0x44, + 0x45, 0x52, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x58, + 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, 0x10, 0x08, 0x22, 0x04, 0x08, 0x07, 0x10, + 0x07, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, + 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x0f, 0x10, 0x10, 0x22, 0xdd, 0x05, 0x0a, 0x07, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x73, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x3c, 0x0a, 0x0b, 0x6e, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4e, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x0b, 0x6e, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x45, 0x0a, + 0x0e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x74, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x69, + 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0d, 0x74, 0x79, 0x70, 0x69, 0x6e, + 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x42, 0x0a, 0x1c, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x4b, 0x65, 0x79, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1c, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x16, + 0x64, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x16, 0x64, 0x65, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x79, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x54, 0x0a, 0x13, 0x70, 0x6e, 0x69, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x50, 0x6e, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x13, 0x70, 0x6e, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x65, + 0x64, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x45, 0x64, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0b, 0x65, 0x64, + 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xf2, 0x08, 0x0a, 0x0b, 0x43, 0x61, + 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x6f, 0x66, 0x66, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x66, 0x66, 0x65, + 0x72, 0x12, 0x39, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x6e, + 0x73, 0x77, 0x65, 0x72, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x09, + 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x24, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x49, 0x63, 0x65, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x09, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x33, 0x0a, 0x04, 0x62, 0x75, 0x73, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, + 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x42, 0x75, 0x73, 0x79, 0x52, + 0x04, 0x62, 0x75, 0x73, 0x79, 0x12, 0x39, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x67, 0x75, 0x70, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x48, 0x61, 0x6e, 0x67, 0x75, 0x70, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x67, 0x75, 0x70, + 0x12, 0x30, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x49, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4f, + 0x70, 0x61, 0x71, 0x75, 0x65, 0x52, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x1a, 0xaa, 0x01, + 0x0a, 0x05, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x22, 0x38, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x46, 0x46, 0x45, 0x52, 0x5f, 0x41, 0x55, 0x44, 0x49, + 0x4f, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x46, 0x46, 0x45, + 0x52, 0x5f, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x22, 0x04, + 0x08, 0x02, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x1a, 0x36, 0x0a, 0x06, 0x41, 0x6e, + 0x73, 0x77, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x4a, 0x04, 0x08, 0x02, + 0x10, 0x03, 0x1a, 0x45, 0x0a, 0x09, 0x49, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, + 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x1a, 0x16, 0x0a, 0x04, 0x42, 0x75, 0x73, + 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, + 0x64, 0x1a, 0xe2, 0x01, 0x0a, 0x06, 0x48, 0x61, 0x6e, 0x67, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3a, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x48, 0x61, 0x6e, 0x67, 0x75, 0x70, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x22, 0x70, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x11, 0x0a, 0x0d, + 0x48, 0x41, 0x4e, 0x47, 0x55, 0x50, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, + 0x13, 0x0a, 0x0f, 0x48, 0x41, 0x4e, 0x47, 0x55, 0x50, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x48, 0x41, 0x4e, 0x47, 0x55, 0x50, 0x5f, 0x44, + 0x45, 0x43, 0x4c, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x41, 0x4e, + 0x47, 0x55, 0x50, 0x5f, 0x42, 0x55, 0x53, 0x59, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x48, 0x41, + 0x4e, 0x47, 0x55, 0x50, 0x5f, 0x4e, 0x45, 0x45, 0x44, 0x5f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, + 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x1a, 0x93, 0x01, 0x0a, 0x06, 0x4f, 0x70, 0x61, 0x71, 0x75, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x43, 0x0a, 0x07, 0x75, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x79, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2e, 0x4f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x2e, 0x55, 0x72, 0x67, 0x65, 0x6e, 0x63, + 0x79, 0x52, 0x07, 0x75, 0x72, 0x67, 0x65, 0x6e, 0x63, 0x79, 0x22, 0x30, 0x0a, 0x07, 0x55, 0x72, + 0x67, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x52, 0x4f, 0x50, 0x50, 0x41, 0x42, + 0x4c, 0x45, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x48, 0x41, 0x4e, 0x44, 0x4c, 0x45, 0x5f, 0x49, + 0x4d, 0x4d, 0x45, 0x44, 0x49, 0x41, 0x54, 0x45, 0x4c, 0x59, 0x10, 0x01, 0x4a, 0x04, 0x08, 0x04, + 0x10, 0x05, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x22, 0xfe, + 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x20, 0x0a, 0x0a, 0x6d, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x0a, 0x6d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x69, 0x12, 0x36, 0x0a, 0x05, + 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x05, 0x73, + 0x74, 0x79, 0x6c, 0x65, 0x22, 0x56, 0x0a, 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x08, 0x0a, + 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4c, 0x44, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x54, 0x41, 0x4c, 0x49, 0x43, 0x10, 0x02, 0x12, 0x0b, 0x0a, + 0x07, 0x53, 0x50, 0x4f, 0x49, 0x4c, 0x45, 0x52, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, + 0x52, 0x49, 0x4b, 0x45, 0x54, 0x48, 0x52, 0x4f, 0x55, 0x47, 0x48, 0x10, 0x04, 0x12, 0x0d, 0x0a, + 0x09, 0x4d, 0x4f, 0x4e, 0x4f, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x05, 0x42, 0x11, 0x0a, 0x0f, + 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0xba, 0x22, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x12, 0x42, 0x0a, 0x0b, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x61, + 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x56, 0x32, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x56, 0x32, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x32, + 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x36, 0x0a, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x52, 0x05, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x3c, + 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x30, 0x0a, 0x07, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x72, + 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x3c, + 0x0a, 0x07, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x69, 0x63, + 0x6b, 0x65, 0x72, 0x52, 0x07, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x17, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x17, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x73, 0x56, 0x69, 0x65, 0x77, + 0x4f, 0x6e, 0x63, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x56, 0x69, + 0x65, 0x77, 0x4f, 0x6e, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, + 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x12, 0x38, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x0f, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, + 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x52, 0x0f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x14, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x4b, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, + 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x42, 0x0a, + 0x09, 0x67, 0x69, 0x66, 0x74, 0x42, 0x61, 0x64, 0x67, 0x65, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x47, 0x69, 0x66, + 0x74, 0x42, 0x61, 0x64, 0x67, 0x65, 0x52, 0x09, 0x67, 0x69, 0x66, 0x74, 0x42, 0x61, 0x64, 0x67, + 0x65, 0x1a, 0xd0, 0x03, 0x0a, 0x05, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x41, 0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x41, 0x63, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x53, 0x0a, + 0x0b, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x51, + 0x75, 0x6f, 0x74, 0x65, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x64, 0x41, 0x74, 0x74, 0x61, 0x63, + 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0b, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x1a, 0x90, 0x01, 0x0a, 0x10, 0x51, 0x75, 0x6f, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x68, + 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x52, + 0x09, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x22, 0x22, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0e, + 0x0a, 0x0a, 0x47, 0x49, 0x46, 0x54, 0x5f, 0x42, 0x41, 0x44, 0x47, 0x45, 0x10, 0x01, 0x4a, 0x04, + 0x08, 0x02, 0x10, 0x03, 0x1a, 0xbf, 0x0a, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, + 0x12, 0x3b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, + 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x3e, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, + 0x4a, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x61, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x41, 0x0a, 0x06, 0x61, + 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, + 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x22, + 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0xb6, 0x01, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x67, + 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x67, 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x66, 0x61, 0x6d, + 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, + 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x69, 0x64, + 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, + 0x69, 0x64, 0x64, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x69, 0x73, + 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0xaa, 0x01, 0x0a, 0x05, + 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x50, 0x68, + 0x6f, 0x6e, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x22, 0x32, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, + 0x48, 0x4f, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x4f, 0x42, 0x49, 0x4c, 0x45, + 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x4f, 0x52, 0x4b, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, + 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x10, 0x04, 0x1a, 0xaa, 0x01, 0x0a, 0x05, 0x45, 0x6d, 0x61, + 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x41, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x22, 0x32, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x4d, + 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d, 0x4f, 0x42, 0x49, 0x4c, 0x45, 0x10, 0x02, 0x12, + 0x08, 0x0a, 0x04, 0x57, 0x4f, 0x52, 0x4b, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x55, 0x53, + 0x54, 0x4f, 0x4d, 0x10, 0x04, 0x1a, 0xcc, 0x02, 0x0a, 0x0d, 0x50, 0x6f, 0x73, 0x74, 0x61, 0x6c, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x49, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x2e, 0x50, 0x6f, 0x73, 0x74, 0x61, 0x6c, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x65, + 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x62, 0x6f, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x70, 0x6f, 0x62, 0x6f, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x6e, 0x65, 0x69, 0x67, 0x68, 0x62, + 0x6f, 0x72, 0x68, 0x6f, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x65, + 0x69, 0x67, 0x68, 0x62, 0x6f, 0x72, 0x68, 0x6f, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, + 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, 0x16, + 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x63, 0x6f, + 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x26, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x08, + 0x0a, 0x04, 0x57, 0x4f, 0x52, 0x4b, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x55, 0x53, 0x54, + 0x4f, 0x4d, 0x10, 0x03, 0x1a, 0x60, 0x0a, 0x06, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x38, + 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x1a, 0xa5, 0x01, 0x0a, 0x07, 0x53, 0x74, 0x69, 0x63, 0x6b, + 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, + 0x63, 0x6b, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x63, + 0x6b, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x49, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x6f, 0x6a, + 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x1a, 0x9a, + 0x01, 0x0a, 0x08, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x6f, 0x6a, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x6f, 0x6a, + 0x69, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x41, 0x63, 0x69, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x41, 0x63, 0x69, 0x12, 0x30, 0x0a, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6e, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x1a, 0x3a, 0x0a, 0x06, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x1a, 0x27, 0x0a, 0x0f, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x43, 0x61, 0x6c, 0x6c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x61, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x61, 0x49, 0x64, + 0x1a, 0x52, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x41, 0x63, 0x69, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x41, 0x63, 0x69, 0x12, 0x24, + 0x0a, 0x0d, 0x73, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x1a, 0x9a, 0x05, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x55, 0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x0a, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x92, 0x01, 0x0a, 0x06, 0x41, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x12, 0x56, 0x0a, 0x0a, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x41, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, + 0x0a, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x1a, 0x26, 0x0a, 0x0a, 0x4d, + 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x69, 0x63, + 0x6f, 0x4d, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x70, 0x69, 0x63, 0x6f, + 0x4d, 0x6f, 0x62, 0x42, 0x08, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x1a, 0xbf, 0x01, + 0x0a, 0x0c, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5c, + 0x0a, 0x0a, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x48, 0x00, + 0x52, 0x0a, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x6f, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, + 0x1a, 0x26, 0x0a, 0x0a, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x18, + 0x0a, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x42, 0x0d, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x06, 0x08, 0xeb, 0x07, 0x10, 0xec, 0x07, 0x1a, + 0x78, 0x0a, 0x0a, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x22, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, + 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x41, 0x43, + 0x54, 0x49, 0x56, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x49, 0x74, 0x65, + 0x6d, 0x4a, 0x06, 0x08, 0xea, 0x07, 0x10, 0xeb, 0x07, 0x4a, 0x06, 0x08, 0xeb, 0x07, 0x10, 0xec, + 0x07, 0x1a, 0x51, 0x0a, 0x09, 0x47, 0x69, 0x66, 0x74, 0x42, 0x61, 0x64, 0x67, 0x65, 0x12, 0x44, + 0x0a, 0x1d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x61, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x43, 0x72, + 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4d, 0x0a, 0x05, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x0f, 0x0a, + 0x0b, 0x45, 0x4e, 0x44, 0x5f, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1b, + 0x0a, 0x17, 0x45, 0x58, 0x50, 0x49, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x49, 0x4d, + 0x45, 0x52, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x50, + 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, + 0x45, 0x10, 0x04, 0x22, 0xb0, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x49, 0x54, 0x49, + 0x41, 0x4c, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, + 0x54, 0x49, 0x4d, 0x45, 0x52, 0x53, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x49, 0x45, 0x57, + 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x49, 0x45, 0x57, 0x5f, + 0x4f, 0x4e, 0x43, 0x45, 0x5f, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, + 0x52, 0x45, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, 0x43, + 0x44, 0x4e, 0x5f, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x5f, 0x41, 0x54, 0x54, 0x41, + 0x43, 0x48, 0x4d, 0x45, 0x4e, 0x54, 0x53, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x45, 0x4e, + 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x41, 0x59, 0x4d, 0x45, + 0x4e, 0x54, 0x53, 0x10, 0x07, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x55, 0x52, 0x52, 0x45, 0x4e, 0x54, + 0x10, 0x07, 0x1a, 0x02, 0x10, 0x01, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x27, 0x0a, 0x0b, + 0x4e, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, + 0x64, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x92, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x2a, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x45, 0x4c, 0x49, 0x56, 0x45, + 0x52, 0x59, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x56, 0x49, 0x45, 0x57, 0x45, 0x44, 0x10, 0x02, 0x22, 0xa8, 0x01, 0x0a, 0x0d, 0x54, + 0x79, 0x70, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x3b, 0x0a, 0x06, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x69, 0x6e, + 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x22, 0x22, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x53, + 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x50, + 0x50, 0x45, 0x44, 0x10, 0x01, 0x22, 0xe6, 0x02, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x56, 0x32, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x4a, 0x0a, 0x0e, 0x66, + 0x69, 0x6c, 0x65, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x41, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x0e, 0x74, 0x65, 0x78, 0x74, 0x41, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x54, 0x65, 0x78, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, + 0x52, 0x0e, 0x74, 0x65, 0x78, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, + 0x42, 0x0c, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x9f, + 0x01, 0x0a, 0x07, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, + 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, + 0x22, 0xd1, 0x04, 0x0a, 0x0e, 0x54, 0x65, 0x78, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, + 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x41, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x53, + 0x74, 0x79, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x41, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, + 0x09, 0x74, 0x65, 0x78, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x74, 0x65, + 0x78, 0x74, 0x46, 0x6f, 0x72, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, + 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x74, 0x65, 0x78, 0x74, 0x46, 0x6f, 0x72, + 0x65, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x13, + 0x74, 0x65, 0x78, 0x74, 0x42, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, + 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x74, 0x65, 0x78, 0x74, 0x42, + 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x30, + 0x0a, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x52, 0x07, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, + 0x12, 0x44, 0x0a, 0x08, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x2e, 0x47, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x08, 0x67, 0x72, + 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x1a, 0x92, + 0x01, 0x0a, 0x08, 0x47, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x65, + 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x65, + 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x16, 0x0a, + 0x06, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x02, 0x52, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x51, 0x0a, 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x47, + 0x55, 0x4c, 0x41, 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4f, 0x4c, 0x44, 0x10, 0x02, + 0x12, 0x09, 0x0a, 0x05, 0x53, 0x45, 0x52, 0x49, 0x46, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, + 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x44, 0x45, + 0x4e, 0x53, 0x45, 0x44, 0x10, 0x05, 0x42, 0x0c, 0x0a, 0x0a, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x22, 0xe5, 0x01, 0x0a, 0x08, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x12, 0x26, 0x0a, 0x0e, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x63, 0x69, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x69, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x6e, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6e, 0x75, 0x6c, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x32, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, + 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x56, 0x45, 0x52, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xb3, 0x29, 0x0a, + 0x0b, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x04, + 0x73, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x52, 0x04, 0x73, 0x65, 0x6e, + 0x74, 0x12, 0x3f, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x73, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, + 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x33, 0x0a, 0x04, 0x72, 0x65, 0x61, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, + 0x04, 0x72, 0x65, 0x61, 0x64, 0x12, 0x3c, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x12, 0x33, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x52, 0x08, + 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x4e, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x64, 0x64, + 0x69, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x64, 0x64, 0x69, + 0x6e, 0x67, 0x12, 0x63, 0x0a, 0x14, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x50, 0x61, 0x63, + 0x6b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x69, + 0x63, 0x6b, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x14, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4b, 0x0a, 0x0c, 0x76, 0x69, 0x65, 0x77, 0x4f, + 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x6e, + 0x63, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x52, 0x0c, 0x76, 0x69, 0x65, 0x77, 0x4f, 0x6e, 0x63, 0x65, + 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x48, 0x0a, 0x0b, 0x66, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x74, 0x65, 0x73, + 0x74, 0x52, 0x0b, 0x66, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x33, + 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4b, 0x65, 0x79, 0x73, 0x52, 0x04, 0x6b, + 0x65, 0x79, 0x73, 0x12, 0x69, 0x0a, 0x16, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x0e, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x16, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, + 0x0a, 0x0f, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x06, 0x76, 0x69, 0x65, 0x77, 0x65, 0x64, 0x18, 0x10, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x56, 0x69, 0x65, 0x77, 0x65, 0x64, 0x52, 0x06, 0x76, 0x69, 0x65, 0x77, 0x65, 0x64, 0x12, + 0x54, 0x0a, 0x0f, 0x70, 0x6e, 0x69, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x50, 0x6e, 0x69, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x52, 0x0f, 0x70, 0x6e, 0x69, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x42, 0x0a, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x09, + 0x63, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0e, 0x63, 0x61, 0x6c, + 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, + 0x6c, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x0e, 0x63, 0x61, + 0x6c, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x4b, 0x0a, 0x0c, + 0x63, 0x61, 0x6c, 0x6c, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x15, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, + 0x61, 0x6c, 0x6c, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0c, 0x63, 0x61, 0x6c, + 0x6c, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0xab, 0x07, 0x0a, 0x04, 0x53, 0x65, + 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x31, 0x36, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x31, 0x36, 0x34, 0x12, 0x32, 0x0a, 0x14, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x64, 0x65, 0x73, 0x74, + 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x34, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x3a, 0x0a, 0x18, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x18, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x6a, 0x0a, 0x12, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x2e, 0x55, 0x6e, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, + 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x12, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x33, 0x0a, 0x11, + 0x69, 0x73, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x11, + 0x69, 0x73, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x6d, 0x0a, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, + 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x3c, 0x0a, 0x0b, 0x65, 0x64, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x0b, 0x65, 0x64, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x7a, 0x0a, 0x1a, 0x55, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, + 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x32, 0x0a, + 0x14, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, + 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x1a, 0xa9, 0x01, 0x0a, 0x15, + 0x53, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x32, 0x0a, 0x14, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x14, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x64, 0x69, 0x73, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x69, + 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x54, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, + 0x54, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x1a, 0x63, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x73, 0x12, 0x34, 0x0a, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x52, 0x04, 0x62, 0x6c, 0x6f, 0x62, 0x12, 0x21, 0x0a, 0x08, 0x63, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x1a, 0x53, 0x0a, 0x07, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x63, 0x69, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x04, 0x61, 0x63, 0x69, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, + 0x73, 0x1a, 0xa5, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x5d, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x43, 0x54, 0x53, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, + 0x4e, 0x46, 0x49, 0x47, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x08, 0x0a, + 0x04, 0x4b, 0x45, 0x59, 0x53, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x4e, 0x49, 0x5f, 0x49, + 0x44, 0x45, 0x4e, 0x54, 0x49, 0x54, 0x59, 0x10, 0x06, 0x1a, 0x48, 0x0a, 0x04, 0x52, 0x65, 0x61, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x63, 0x69, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x63, 0x69, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4a, 0x04, 0x08, + 0x01, 0x10, 0x02, 0x1a, 0x4a, 0x0a, 0x06, 0x56, 0x69, 0x65, 0x77, 0x65, 0x64, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x63, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x63, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x1a, + 0x83, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x52, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x46, 0x0a, 0x1e, 0x75, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1e, 0x75, + 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x65, 0x6c, 0x69, 0x76, + 0x65, 0x72, 0x79, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x2a, 0x0a, + 0x10, 0x74, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x74, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x49, + 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x13, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x69, 0x6e, 0x67, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x0c, 0x6c, + 0x69, 0x6e, 0x6b, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x4a, + 0x04, 0x08, 0x04, 0x10, 0x05, 0x1a, 0xb3, 0x01, 0x0a, 0x14, 0x53, 0x74, 0x69, 0x63, 0x6b, 0x65, + 0x72, 0x50, 0x61, 0x63, 0x6b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, + 0x70, 0x61, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x4b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x4b, 0x65, 0x79, + 0x12, 0x48, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x53, 0x74, 0x69, 0x63, 0x6b, + 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x1f, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4c, 0x4c, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x01, 0x1a, 0x50, 0x0a, 0x0c, 0x56, + 0x69, 0x65, 0x77, 0x4f, 0x6e, 0x63, 0x65, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x63, 0x69, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x63, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x1a, 0xa5, 0x01, + 0x0a, 0x0b, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x55, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x50, 0x52, 0x4f, + 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, + 0x45, 0x5f, 0x4d, 0x41, 0x4e, 0x49, 0x46, 0x45, 0x53, 0x54, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, + 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x10, 0x03, 0x1a, 0x46, 0x0a, 0x04, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x26, 0x0a, + 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x1a, 0xf0, 0x01, + 0x0a, 0x16, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, + 0x61, 0x64, 0x41, 0x63, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x68, 0x72, + 0x65, 0x61, 0x64, 0x41, 0x63, 0x69, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, + 0x12, 0x4a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x4c, 0x0a, 0x04, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x4c, 0x4f, + 0x43, 0x4b, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x5f, 0x41, 0x4e, + 0x44, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, + 0x1a, 0x8e, 0x04, 0x0a, 0x0f, 0x4f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x0a, 0x12, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x12, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x12, 0x57, 0x0a, 0x0a, 0x6d, 0x6f, 0x62, 0x69, + 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, + 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4f, 0x75, 0x74, 0x67, 0x6f, 0x69, 0x6e, + 0x67, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, + 0x6f, 0x69, 0x6e, 0x48, 0x00, 0x52, 0x0a, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, + 0x6e, 0x1a, 0xcc, 0x02, 0x0a, 0x0a, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, + 0x12, 0x2a, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x72, 0x65, 0x63, 0x69, + 0x70, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x24, 0x0a, 0x0d, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x69, 0x63, 0x6f, 0x4d, 0x6f, 0x62, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x69, 0x63, 0x6f, 0x4d, + 0x6f, 0x62, 0x12, 0x1e, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x50, 0x69, 0x63, 0x6f, 0x4d, 0x6f, 0x62, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x66, 0x65, 0x65, 0x50, 0x69, 0x63, 0x6f, 0x4d, + 0x6f, 0x62, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x12, 0x32, 0x0a, 0x14, + 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x2a, 0x0a, 0x10, 0x6c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6c, 0x65, 0x64, 0x67, + 0x65, 0x72, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x26, 0x0a, 0x0e, + 0x73, 0x70, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x18, 0x07, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0e, 0x73, 0x70, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x49, 0x6d, + 0x61, 0x67, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x10, + 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, + 0x42, 0x0f, 0x0a, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x1a, 0xd7, 0x01, 0x0a, 0x0f, 0x50, 0x6e, 0x69, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x69, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x50, 0x61, 0x69, 0x72, 0x12, + 0x22, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x50, 0x72, 0x65, + 0x4b, 0x65, 0x79, 0x12, 0x34, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x72, + 0x74, 0x4b, 0x79, 0x62, 0x65, 0x72, 0x50, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x72, 0x74, 0x4b, 0x79, + 0x62, 0x65, 0x72, 0x50, 0x72, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x26, 0x0a, 0x0e, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x77, 0x45, 0x31, 0x36, 0x34, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x45, 0x31, 0x36, 0x34, 0x1a, 0x94, 0x04, 0x0a, 0x09, + 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, + 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x3d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4c, + 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2e, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, + 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x05, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x22, 0x59, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x55, 0x44, 0x49, + 0x4f, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x56, 0x49, 0x44, 0x45, + 0x4f, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x47, 0x52, 0x4f, 0x55, + 0x50, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x41, 0x44, 0x5f, 0x48, + 0x4f, 0x43, 0x5f, 0x43, 0x41, 0x4c, 0x4c, 0x10, 0x04, 0x22, 0x3e, 0x0a, 0x09, 0x44, 0x69, 0x72, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x5f, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, + 0x08, 0x49, 0x4e, 0x43, 0x4f, 0x4d, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x4f, + 0x55, 0x54, 0x47, 0x4f, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x22, 0x47, 0x0a, 0x05, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x41, 0x43, + 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x4f, 0x54, 0x5f, 0x41, 0x43, 0x43, 0x45, + 0x50, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, + 0x10, 0x03, 0x1a, 0x4e, 0x0a, 0x0e, 0x43, 0x61, 0x6c, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6f, 0x74, 0x4b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x6f, 0x6f, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x22, + 0x0a, 0x0c, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x4b, + 0x65, 0x79, 0x1a, 0x81, 0x01, 0x0a, 0x0c, 0x43, 0x61, 0x6c, 0x6c, 0x4c, 0x6f, 0x67, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x12, 0x40, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x61, + 0x6c, 0x6c, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x22, 0x11, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x43, + 0x4c, 0x45, 0x41, 0x52, 0x10, 0x00, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x11, + 0x10, 0x12, 0x22, 0xdd, 0x04, 0x0a, 0x11, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x05, 0x63, 0x64, 0x6e, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, 0x48, 0x00, 0x52, 0x05, 0x63, 0x64, 0x6e, 0x49, 0x64, + 0x12, 0x18, 0x0a, 0x06, 0x63, 0x64, 0x6e, 0x4b, 0x65, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x06, 0x63, 0x64, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x74, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, + 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x6e, 0x63, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x63, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x4d, 0x61, 0x63, + 0x12, 0x38, 0x0a, 0x17, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x4d, + 0x61, 0x63, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x17, 0x69, 0x6e, 0x63, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x4d, 0x61, + 0x63, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69, 0x64, + 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x61, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6c, 0x75, 0x72, 0x48, 0x61, 0x73, 0x68, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x6c, 0x75, 0x72, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x28, 0x0a, 0x0f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x75, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x64, + 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, + 0x64, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x39, 0x0a, 0x05, 0x46, 0x6c, 0x61, 0x67, + 0x73, 0x12, 0x11, 0x0a, 0x0d, 0x56, 0x4f, 0x49, 0x43, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, + 0x47, 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x4c, 0x45, + 0x53, 0x53, 0x10, 0x02, 0x12, 0x07, 0x0a, 0x03, 0x47, 0x49, 0x46, 0x10, 0x04, 0x22, 0x04, 0x08, + 0x03, 0x10, 0x03, 0x42, 0x17, 0x0a, 0x15, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x4a, 0x04, 0x08, 0x10, + 0x10, 0x11, 0x22, 0xf0, 0x02, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x45, 0x31, 0x36, 0x34, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x45, 0x31, 0x36, 0x34, 0x12, + 0x3c, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x38, 0x0a, + 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x74, + 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x52, + 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x1a, 0x22, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x31, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x65, 0x31, 0x36, 0x34, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0x48, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x45, 0x4c, 0x49, 0x56, 0x45, 0x52, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x51, 0x55, 0x49, + 0x54, 0x10, 0x03, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x49, + 0x4e, 0x46, 0x4f, 0x10, 0x04, 0x22, 0x6c, 0x0a, 0x0e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x56, 0x32, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x73, 0x74, 0x65, + 0x72, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x22, 0xb9, 0x03, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, + 0x0a, 0x03, 0x61, 0x63, 0x69, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x61, 0x63, 0x69, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x2e, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x33, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x52, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x1e, 0x0a, + 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, + 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x62, + 0x6f, 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x0d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x1a, 0x42, 0x0a, 0x06, 0x41, + 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, + 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, + 0xe8, 0x03, 0x0a, 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x45, + 0x31, 0x36, 0x34, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x45, 0x31, 0x36, 0x34, 0x12, 0x3c, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x12, 0x3a, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x2e, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x12, 0x1c, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x72, + 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x12, 0x24, 0x0a, 0x0d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x50, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x64, 0x1a, 0x42, 0x0a, 0x06, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x20, 0x0a, 0x0b, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x1a, 0x22, 0x0a, 0x06, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x65, 0x31, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x65, 0x31, 0x36, 0x34, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xc9, 0x01, 0x0a, 0x0e, 0x50, + 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x5f, 0x0a, + 0x11, 0x6d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, + 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x48, 0x00, 0x52, 0x11, 0x6d, 0x6f, 0x62, + 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x1a, 0x4b, + 0x0a, 0x11, 0x4d, 0x6f, 0x62, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1c, 0x0a, + 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x72, 0x0a, 0x16, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x61, 0x74, 0x63, 0x68, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x61, 0x74, 0x63, 0x68, 0x65, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1a, + 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x08, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x13, 0x50, 0x6e, + 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6e, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, + 0x70, 0x6e, 0x69, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x22, 0x7d, 0x0a, 0x0b, 0x45, 0x64, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x30, 0x0a, 0x13, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x74, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x12, 0x3c, 0x0a, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x0b, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x42, 0x45, 0x0a, 0x2e, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x68, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x75, + 0x73, 0x68, 0x42, 0x13, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, +} + +var ( + file_SignalService_proto_rawDescOnce sync.Once + file_SignalService_proto_rawDescData = file_SignalService_proto_rawDesc +) + +func file_SignalService_proto_rawDescGZIP() []byte { + file_SignalService_proto_rawDescOnce.Do(func() { + file_SignalService_proto_rawDescData = protoimpl.X.CompressGZIP(file_SignalService_proto_rawDescData) + }) + return file_SignalService_proto_rawDescData +} + +var file_SignalService_proto_enumTypes = make([]protoimpl.EnumInfo, 26) +var file_SignalService_proto_msgTypes = make([]protoimpl.MessageInfo, 74) +var file_SignalService_proto_goTypes = []interface{}{ + (Envelope_Type)(0), // 0: signalservice.Envelope.Type + (CallMessage_Offer_Type)(0), // 1: signalservice.CallMessage.Offer.Type + (CallMessage_Hangup_Type)(0), // 2: signalservice.CallMessage.Hangup.Type + (CallMessage_Opaque_Urgency)(0), // 3: signalservice.CallMessage.Opaque.Urgency + (BodyRange_Style)(0), // 4: signalservice.BodyRange.Style + (DataMessage_Flags)(0), // 5: signalservice.DataMessage.Flags + (DataMessage_ProtocolVersion)(0), // 6: signalservice.DataMessage.ProtocolVersion + (DataMessage_Quote_Type)(0), // 7: signalservice.DataMessage.Quote.Type + (DataMessage_Contact_Phone_Type)(0), // 8: signalservice.DataMessage.Contact.Phone.Type + (DataMessage_Contact_Email_Type)(0), // 9: signalservice.DataMessage.Contact.Email.Type + (DataMessage_Contact_PostalAddress_Type)(0), // 10: signalservice.DataMessage.Contact.PostalAddress.Type + (DataMessage_Payment_Activation_Type)(0), // 11: signalservice.DataMessage.Payment.Activation.Type + (ReceiptMessage_Type)(0), // 12: signalservice.ReceiptMessage.Type + (TypingMessage_Action)(0), // 13: signalservice.TypingMessage.Action + (TextAttachment_Style)(0), // 14: signalservice.TextAttachment.Style + (Verified_State)(0), // 15: signalservice.Verified.State + (SyncMessage_Request_Type)(0), // 16: signalservice.SyncMessage.Request.Type + (SyncMessage_StickerPackOperation_Type)(0), // 17: signalservice.SyncMessage.StickerPackOperation.Type + (SyncMessage_FetchLatest_Type)(0), // 18: signalservice.SyncMessage.FetchLatest.Type + (SyncMessage_MessageRequestResponse_Type)(0), // 19: signalservice.SyncMessage.MessageRequestResponse.Type + (SyncMessage_CallEvent_Type)(0), // 20: signalservice.SyncMessage.CallEvent.Type + (SyncMessage_CallEvent_Direction)(0), // 21: signalservice.SyncMessage.CallEvent.Direction + (SyncMessage_CallEvent_Event)(0), // 22: signalservice.SyncMessage.CallEvent.Event + (SyncMessage_CallLogEvent_Type)(0), // 23: signalservice.SyncMessage.CallLogEvent.Type + (AttachmentPointer_Flags)(0), // 24: signalservice.AttachmentPointer.Flags + (GroupContext_Type)(0), // 25: signalservice.GroupContext.Type + (*Envelope)(nil), // 26: signalservice.Envelope + (*Content)(nil), // 27: signalservice.Content + (*CallMessage)(nil), // 28: signalservice.CallMessage + (*BodyRange)(nil), // 29: signalservice.BodyRange + (*DataMessage)(nil), // 30: signalservice.DataMessage + (*NullMessage)(nil), // 31: signalservice.NullMessage + (*ReceiptMessage)(nil), // 32: signalservice.ReceiptMessage + (*TypingMessage)(nil), // 33: signalservice.TypingMessage + (*StoryMessage)(nil), // 34: signalservice.StoryMessage + (*Preview)(nil), // 35: signalservice.Preview + (*TextAttachment)(nil), // 36: signalservice.TextAttachment + (*Verified)(nil), // 37: signalservice.Verified + (*SyncMessage)(nil), // 38: signalservice.SyncMessage + (*AttachmentPointer)(nil), // 39: signalservice.AttachmentPointer + (*GroupContext)(nil), // 40: signalservice.GroupContext + (*GroupContextV2)(nil), // 41: signalservice.GroupContextV2 + (*ContactDetails)(nil), // 42: signalservice.ContactDetails + (*GroupDetails)(nil), // 43: signalservice.GroupDetails + (*PaymentAddress)(nil), // 44: signalservice.PaymentAddress + (*DecryptionErrorMessage)(nil), // 45: signalservice.DecryptionErrorMessage + (*PniSignatureMessage)(nil), // 46: signalservice.PniSignatureMessage + (*EditMessage)(nil), // 47: signalservice.EditMessage + (*CallMessage_Offer)(nil), // 48: signalservice.CallMessage.Offer + (*CallMessage_Answer)(nil), // 49: signalservice.CallMessage.Answer + (*CallMessage_IceUpdate)(nil), // 50: signalservice.CallMessage.IceUpdate + (*CallMessage_Busy)(nil), // 51: signalservice.CallMessage.Busy + (*CallMessage_Hangup)(nil), // 52: signalservice.CallMessage.Hangup + (*CallMessage_Opaque)(nil), // 53: signalservice.CallMessage.Opaque + (*DataMessage_Quote)(nil), // 54: signalservice.DataMessage.Quote + (*DataMessage_Contact)(nil), // 55: signalservice.DataMessage.Contact + (*DataMessage_Sticker)(nil), // 56: signalservice.DataMessage.Sticker + (*DataMessage_Reaction)(nil), // 57: signalservice.DataMessage.Reaction + (*DataMessage_Delete)(nil), // 58: signalservice.DataMessage.Delete + (*DataMessage_GroupCallUpdate)(nil), // 59: signalservice.DataMessage.GroupCallUpdate + (*DataMessage_StoryContext)(nil), // 60: signalservice.DataMessage.StoryContext + (*DataMessage_Payment)(nil), // 61: signalservice.DataMessage.Payment + (*DataMessage_GiftBadge)(nil), // 62: signalservice.DataMessage.GiftBadge + (*DataMessage_Quote_QuotedAttachment)(nil), // 63: signalservice.DataMessage.Quote.QuotedAttachment + (*DataMessage_Contact_Name)(nil), // 64: signalservice.DataMessage.Contact.Name + (*DataMessage_Contact_Phone)(nil), // 65: signalservice.DataMessage.Contact.Phone + (*DataMessage_Contact_Email)(nil), // 66: signalservice.DataMessage.Contact.Email + (*DataMessage_Contact_PostalAddress)(nil), // 67: signalservice.DataMessage.Contact.PostalAddress + (*DataMessage_Contact_Avatar)(nil), // 68: signalservice.DataMessage.Contact.Avatar + (*DataMessage_Payment_Amount)(nil), // 69: signalservice.DataMessage.Payment.Amount + (*DataMessage_Payment_Notification)(nil), // 70: signalservice.DataMessage.Payment.Notification + (*DataMessage_Payment_Activation)(nil), // 71: signalservice.DataMessage.Payment.Activation + (*DataMessage_Payment_Amount_MobileCoin)(nil), // 72: signalservice.DataMessage.Payment.Amount.MobileCoin + (*DataMessage_Payment_Notification_MobileCoin)(nil), // 73: signalservice.DataMessage.Payment.Notification.MobileCoin + (*TextAttachment_Gradient)(nil), // 74: signalservice.TextAttachment.Gradient + (*SyncMessage_Sent)(nil), // 75: signalservice.SyncMessage.Sent + (*SyncMessage_Contacts)(nil), // 76: signalservice.SyncMessage.Contacts + (*SyncMessage_Blocked)(nil), // 77: signalservice.SyncMessage.Blocked + (*SyncMessage_Request)(nil), // 78: signalservice.SyncMessage.Request + (*SyncMessage_Read)(nil), // 79: signalservice.SyncMessage.Read + (*SyncMessage_Viewed)(nil), // 80: signalservice.SyncMessage.Viewed + (*SyncMessage_Configuration)(nil), // 81: signalservice.SyncMessage.Configuration + (*SyncMessage_StickerPackOperation)(nil), // 82: signalservice.SyncMessage.StickerPackOperation + (*SyncMessage_ViewOnceOpen)(nil), // 83: signalservice.SyncMessage.ViewOnceOpen + (*SyncMessage_FetchLatest)(nil), // 84: signalservice.SyncMessage.FetchLatest + (*SyncMessage_Keys)(nil), // 85: signalservice.SyncMessage.Keys + (*SyncMessage_MessageRequestResponse)(nil), // 86: signalservice.SyncMessage.MessageRequestResponse + (*SyncMessage_OutgoingPayment)(nil), // 87: signalservice.SyncMessage.OutgoingPayment + (*SyncMessage_PniChangeNumber)(nil), // 88: signalservice.SyncMessage.PniChangeNumber + (*SyncMessage_CallEvent)(nil), // 89: signalservice.SyncMessage.CallEvent + (*SyncMessage_CallLinkUpdate)(nil), // 90: signalservice.SyncMessage.CallLinkUpdate + (*SyncMessage_CallLogEvent)(nil), // 91: signalservice.SyncMessage.CallLogEvent + (*SyncMessage_Sent_UnidentifiedDeliveryStatus)(nil), // 92: signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus + (*SyncMessage_Sent_StoryMessageRecipient)(nil), // 93: signalservice.SyncMessage.Sent.StoryMessageRecipient + (*SyncMessage_OutgoingPayment_MobileCoin)(nil), // 94: signalservice.SyncMessage.OutgoingPayment.MobileCoin + (*GroupContext_Member)(nil), // 95: signalservice.GroupContext.Member + (*ContactDetails_Avatar)(nil), // 96: signalservice.ContactDetails.Avatar + (*GroupDetails_Avatar)(nil), // 97: signalservice.GroupDetails.Avatar + (*GroupDetails_Member)(nil), // 98: signalservice.GroupDetails.Member + (*PaymentAddress_MobileCoinAddress)(nil), // 99: signalservice.PaymentAddress.MobileCoinAddress +} +var file_SignalService_proto_depIdxs = []int32{ + 0, // 0: signalservice.Envelope.type:type_name -> signalservice.Envelope.Type + 30, // 1: signalservice.Content.dataMessage:type_name -> signalservice.DataMessage + 38, // 2: signalservice.Content.syncMessage:type_name -> signalservice.SyncMessage + 28, // 3: signalservice.Content.callMessage:type_name -> signalservice.CallMessage + 31, // 4: signalservice.Content.nullMessage:type_name -> signalservice.NullMessage + 32, // 5: signalservice.Content.receiptMessage:type_name -> signalservice.ReceiptMessage + 33, // 6: signalservice.Content.typingMessage:type_name -> signalservice.TypingMessage + 34, // 7: signalservice.Content.storyMessage:type_name -> signalservice.StoryMessage + 46, // 8: signalservice.Content.pniSignatureMessage:type_name -> signalservice.PniSignatureMessage + 47, // 9: signalservice.Content.editMessage:type_name -> signalservice.EditMessage + 48, // 10: signalservice.CallMessage.offer:type_name -> signalservice.CallMessage.Offer + 49, // 11: signalservice.CallMessage.answer:type_name -> signalservice.CallMessage.Answer + 50, // 12: signalservice.CallMessage.iceUpdate:type_name -> signalservice.CallMessage.IceUpdate + 51, // 13: signalservice.CallMessage.busy:type_name -> signalservice.CallMessage.Busy + 52, // 14: signalservice.CallMessage.hangup:type_name -> signalservice.CallMessage.Hangup + 53, // 15: signalservice.CallMessage.opaque:type_name -> signalservice.CallMessage.Opaque + 4, // 16: signalservice.BodyRange.style:type_name -> signalservice.BodyRange.Style + 39, // 17: signalservice.DataMessage.attachments:type_name -> signalservice.AttachmentPointer + 41, // 18: signalservice.DataMessage.groupV2:type_name -> signalservice.GroupContextV2 + 54, // 19: signalservice.DataMessage.quote:type_name -> signalservice.DataMessage.Quote + 55, // 20: signalservice.DataMessage.contact:type_name -> signalservice.DataMessage.Contact + 35, // 21: signalservice.DataMessage.preview:type_name -> signalservice.Preview + 56, // 22: signalservice.DataMessage.sticker:type_name -> signalservice.DataMessage.Sticker + 57, // 23: signalservice.DataMessage.reaction:type_name -> signalservice.DataMessage.Reaction + 58, // 24: signalservice.DataMessage.delete:type_name -> signalservice.DataMessage.Delete + 29, // 25: signalservice.DataMessage.bodyRanges:type_name -> signalservice.BodyRange + 59, // 26: signalservice.DataMessage.groupCallUpdate:type_name -> signalservice.DataMessage.GroupCallUpdate + 61, // 27: signalservice.DataMessage.payment:type_name -> signalservice.DataMessage.Payment + 60, // 28: signalservice.DataMessage.storyContext:type_name -> signalservice.DataMessage.StoryContext + 62, // 29: signalservice.DataMessage.giftBadge:type_name -> signalservice.DataMessage.GiftBadge + 12, // 30: signalservice.ReceiptMessage.type:type_name -> signalservice.ReceiptMessage.Type + 13, // 31: signalservice.TypingMessage.action:type_name -> signalservice.TypingMessage.Action + 41, // 32: signalservice.StoryMessage.group:type_name -> signalservice.GroupContextV2 + 39, // 33: signalservice.StoryMessage.fileAttachment:type_name -> signalservice.AttachmentPointer + 36, // 34: signalservice.StoryMessage.textAttachment:type_name -> signalservice.TextAttachment + 29, // 35: signalservice.StoryMessage.bodyRanges:type_name -> signalservice.BodyRange + 39, // 36: signalservice.Preview.image:type_name -> signalservice.AttachmentPointer + 14, // 37: signalservice.TextAttachment.textStyle:type_name -> signalservice.TextAttachment.Style + 35, // 38: signalservice.TextAttachment.preview:type_name -> signalservice.Preview + 74, // 39: signalservice.TextAttachment.gradient:type_name -> signalservice.TextAttachment.Gradient + 15, // 40: signalservice.Verified.state:type_name -> signalservice.Verified.State + 75, // 41: signalservice.SyncMessage.sent:type_name -> signalservice.SyncMessage.Sent + 76, // 42: signalservice.SyncMessage.contacts:type_name -> signalservice.SyncMessage.Contacts + 78, // 43: signalservice.SyncMessage.request:type_name -> signalservice.SyncMessage.Request + 79, // 44: signalservice.SyncMessage.read:type_name -> signalservice.SyncMessage.Read + 77, // 45: signalservice.SyncMessage.blocked:type_name -> signalservice.SyncMessage.Blocked + 37, // 46: signalservice.SyncMessage.verified:type_name -> signalservice.Verified + 81, // 47: signalservice.SyncMessage.configuration:type_name -> signalservice.SyncMessage.Configuration + 82, // 48: signalservice.SyncMessage.stickerPackOperation:type_name -> signalservice.SyncMessage.StickerPackOperation + 83, // 49: signalservice.SyncMessage.viewOnceOpen:type_name -> signalservice.SyncMessage.ViewOnceOpen + 84, // 50: signalservice.SyncMessage.fetchLatest:type_name -> signalservice.SyncMessage.FetchLatest + 85, // 51: signalservice.SyncMessage.keys:type_name -> signalservice.SyncMessage.Keys + 86, // 52: signalservice.SyncMessage.messageRequestResponse:type_name -> signalservice.SyncMessage.MessageRequestResponse + 87, // 53: signalservice.SyncMessage.outgoingPayment:type_name -> signalservice.SyncMessage.OutgoingPayment + 80, // 54: signalservice.SyncMessage.viewed:type_name -> signalservice.SyncMessage.Viewed + 88, // 55: signalservice.SyncMessage.pniChangeNumber:type_name -> signalservice.SyncMessage.PniChangeNumber + 89, // 56: signalservice.SyncMessage.callEvent:type_name -> signalservice.SyncMessage.CallEvent + 90, // 57: signalservice.SyncMessage.callLinkUpdate:type_name -> signalservice.SyncMessage.CallLinkUpdate + 91, // 58: signalservice.SyncMessage.callLogEvent:type_name -> signalservice.SyncMessage.CallLogEvent + 25, // 59: signalservice.GroupContext.type:type_name -> signalservice.GroupContext.Type + 95, // 60: signalservice.GroupContext.members:type_name -> signalservice.GroupContext.Member + 39, // 61: signalservice.GroupContext.avatar:type_name -> signalservice.AttachmentPointer + 96, // 62: signalservice.ContactDetails.avatar:type_name -> signalservice.ContactDetails.Avatar + 37, // 63: signalservice.ContactDetails.verified:type_name -> signalservice.Verified + 98, // 64: signalservice.GroupDetails.members:type_name -> signalservice.GroupDetails.Member + 97, // 65: signalservice.GroupDetails.avatar:type_name -> signalservice.GroupDetails.Avatar + 99, // 66: signalservice.PaymentAddress.mobileCoinAddress:type_name -> signalservice.PaymentAddress.MobileCoinAddress + 30, // 67: signalservice.EditMessage.dataMessage:type_name -> signalservice.DataMessage + 1, // 68: signalservice.CallMessage.Offer.type:type_name -> signalservice.CallMessage.Offer.Type + 2, // 69: signalservice.CallMessage.Hangup.type:type_name -> signalservice.CallMessage.Hangup.Type + 3, // 70: signalservice.CallMessage.Opaque.urgency:type_name -> signalservice.CallMessage.Opaque.Urgency + 63, // 71: signalservice.DataMessage.Quote.attachments:type_name -> signalservice.DataMessage.Quote.QuotedAttachment + 29, // 72: signalservice.DataMessage.Quote.bodyRanges:type_name -> signalservice.BodyRange + 7, // 73: signalservice.DataMessage.Quote.type:type_name -> signalservice.DataMessage.Quote.Type + 64, // 74: signalservice.DataMessage.Contact.name:type_name -> signalservice.DataMessage.Contact.Name + 65, // 75: signalservice.DataMessage.Contact.number:type_name -> signalservice.DataMessage.Contact.Phone + 66, // 76: signalservice.DataMessage.Contact.email:type_name -> signalservice.DataMessage.Contact.Email + 67, // 77: signalservice.DataMessage.Contact.address:type_name -> signalservice.DataMessage.Contact.PostalAddress + 68, // 78: signalservice.DataMessage.Contact.avatar:type_name -> signalservice.DataMessage.Contact.Avatar + 39, // 79: signalservice.DataMessage.Sticker.data:type_name -> signalservice.AttachmentPointer + 70, // 80: signalservice.DataMessage.Payment.notification:type_name -> signalservice.DataMessage.Payment.Notification + 71, // 81: signalservice.DataMessage.Payment.activation:type_name -> signalservice.DataMessage.Payment.Activation + 39, // 82: signalservice.DataMessage.Quote.QuotedAttachment.thumbnail:type_name -> signalservice.AttachmentPointer + 8, // 83: signalservice.DataMessage.Contact.Phone.type:type_name -> signalservice.DataMessage.Contact.Phone.Type + 9, // 84: signalservice.DataMessage.Contact.Email.type:type_name -> signalservice.DataMessage.Contact.Email.Type + 10, // 85: signalservice.DataMessage.Contact.PostalAddress.type:type_name -> signalservice.DataMessage.Contact.PostalAddress.Type + 39, // 86: signalservice.DataMessage.Contact.Avatar.avatar:type_name -> signalservice.AttachmentPointer + 72, // 87: signalservice.DataMessage.Payment.Amount.mobileCoin:type_name -> signalservice.DataMessage.Payment.Amount.MobileCoin + 73, // 88: signalservice.DataMessage.Payment.Notification.mobileCoin:type_name -> signalservice.DataMessage.Payment.Notification.MobileCoin + 11, // 89: signalservice.DataMessage.Payment.Activation.type:type_name -> signalservice.DataMessage.Payment.Activation.Type + 30, // 90: signalservice.SyncMessage.Sent.message:type_name -> signalservice.DataMessage + 92, // 91: signalservice.SyncMessage.Sent.unidentifiedStatus:type_name -> signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus + 34, // 92: signalservice.SyncMessage.Sent.storyMessage:type_name -> signalservice.StoryMessage + 93, // 93: signalservice.SyncMessage.Sent.storyMessageRecipients:type_name -> signalservice.SyncMessage.Sent.StoryMessageRecipient + 47, // 94: signalservice.SyncMessage.Sent.editMessage:type_name -> signalservice.EditMessage + 39, // 95: signalservice.SyncMessage.Contacts.blob:type_name -> signalservice.AttachmentPointer + 16, // 96: signalservice.SyncMessage.Request.type:type_name -> signalservice.SyncMessage.Request.Type + 17, // 97: signalservice.SyncMessage.StickerPackOperation.type:type_name -> signalservice.SyncMessage.StickerPackOperation.Type + 18, // 98: signalservice.SyncMessage.FetchLatest.type:type_name -> signalservice.SyncMessage.FetchLatest.Type + 19, // 99: signalservice.SyncMessage.MessageRequestResponse.type:type_name -> signalservice.SyncMessage.MessageRequestResponse.Type + 94, // 100: signalservice.SyncMessage.OutgoingPayment.mobileCoin:type_name -> signalservice.SyncMessage.OutgoingPayment.MobileCoin + 20, // 101: signalservice.SyncMessage.CallEvent.type:type_name -> signalservice.SyncMessage.CallEvent.Type + 21, // 102: signalservice.SyncMessage.CallEvent.direction:type_name -> signalservice.SyncMessage.CallEvent.Direction + 22, // 103: signalservice.SyncMessage.CallEvent.event:type_name -> signalservice.SyncMessage.CallEvent.Event + 23, // 104: signalservice.SyncMessage.CallLogEvent.type:type_name -> signalservice.SyncMessage.CallLogEvent.Type + 105, // [105:105] is the sub-list for method output_type + 105, // [105:105] is the sub-list for method input_type + 105, // [105:105] is the sub-list for extension type_name + 105, // [105:105] is the sub-list for extension extendee + 0, // [0:105] is the sub-list for field type_name +} + +func init() { file_SignalService_proto_init() } +func file_SignalService_proto_init() { + if File_SignalService_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_SignalService_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Envelope); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Content); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BodyRange); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NullMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReceiptMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TypingMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoryMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Preview); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TextAttachment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Verified); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AttachmentPointer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupContext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupContextV2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContactDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PaymentAddress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DecryptionErrorMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PniSignatureMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EditMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallMessage_Offer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallMessage_Answer); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallMessage_IceUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallMessage_Busy); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallMessage_Hangup); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CallMessage_Opaque); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Quote); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Contact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Sticker); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Reaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Delete); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_GroupCallUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_StoryContext); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Payment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_GiftBadge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Quote_QuotedAttachment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Contact_Name); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Contact_Phone); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Contact_Email); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Contact_PostalAddress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Contact_Avatar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Payment_Amount); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Payment_Notification); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Payment_Activation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Payment_Amount_MobileCoin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DataMessage_Payment_Notification_MobileCoin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TextAttachment_Gradient); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Sent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Contacts); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Blocked); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Read); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Viewed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Configuration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_StickerPackOperation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_ViewOnceOpen); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_FetchLatest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Keys); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_MessageRequestResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_OutgoingPayment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_PniChangeNumber); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_CallEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_CallLinkUpdate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_CallLogEvent); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Sent_UnidentifiedDeliveryStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_Sent_StoryMessageRecipient); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncMessage_OutgoingPayment_MobileCoin); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupContext_Member); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContactDetails_Avatar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupDetails_Avatar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupDetails_Member); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_SignalService_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PaymentAddress_MobileCoinAddress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_SignalService_proto_msgTypes[3].OneofWrappers = []interface{}{ + (*BodyRange_MentionAci)(nil), + (*BodyRange_Style_)(nil), + } + file_SignalService_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*StoryMessage_FileAttachment)(nil), + (*StoryMessage_TextAttachment)(nil), + } + file_SignalService_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*TextAttachment_Gradient_)(nil), + (*TextAttachment_Color)(nil), + } + file_SignalService_proto_msgTypes[13].OneofWrappers = []interface{}{ + (*AttachmentPointer_CdnId)(nil), + (*AttachmentPointer_CdnKey)(nil), + } + file_SignalService_proto_msgTypes[18].OneofWrappers = []interface{}{ + (*PaymentAddress_MobileCoinAddress_)(nil), + } + file_SignalService_proto_msgTypes[35].OneofWrappers = []interface{}{ + (*DataMessage_Payment_Notification_)(nil), + (*DataMessage_Payment_Activation_)(nil), + } + file_SignalService_proto_msgTypes[43].OneofWrappers = []interface{}{ + (*DataMessage_Payment_Amount_MobileCoin_)(nil), + } + file_SignalService_proto_msgTypes[44].OneofWrappers = []interface{}{ + (*DataMessage_Payment_Notification_MobileCoin_)(nil), + } + file_SignalService_proto_msgTypes[61].OneofWrappers = []interface{}{ + (*SyncMessage_OutgoingPayment_MobileCoin_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_SignalService_proto_rawDesc, + NumEnums: 26, + NumMessages: 74, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_SignalService_proto_goTypes, + DependencyIndexes: file_SignalService_proto_depIdxs, + EnumInfos: file_SignalService_proto_enumTypes, + MessageInfos: file_SignalService_proto_msgTypes, + }.Build() + File_SignalService_proto = out.File + file_SignalService_proto_rawDesc = nil + file_SignalService_proto_goTypes = nil + file_SignalService_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/SignalService.proto b/pkg/signalmeow/protobuf/SignalService.proto new file mode 100644 index 0000000..866343f --- /dev/null +++ b/pkg/signalmeow/protobuf/SignalService.proto @@ -0,0 +1,785 @@ +/** + * Copyright (C) 2014-2016 Open Whisper Systems + * + * Licensed according to the LICENSE file in this repository. + */ +syntax = "proto2"; + +package signalservice; + +option java_package = "org.whispersystems.signalservice.internal.push"; +option java_outer_classname = "SignalServiceProtos"; + +message Envelope { + enum Type { + UNKNOWN = 0; + CIPHERTEXT = 1; + KEY_EXCHANGE = 2; + PREKEY_BUNDLE = 3; + RECEIPT = 5; + UNIDENTIFIED_SENDER = 6; + reserved 7; // SENDERKEY_MESSAGE + PLAINTEXT_CONTENT = 8; + } + + optional Type type = 1; + reserved /*sourceE164*/ 2; + optional string sourceServiceId = 11; + optional uint32 sourceDevice = 7; + optional string destinationServiceId = 13; + reserved /*relay*/ 3; + optional uint64 timestamp = 5; + reserved /*legacyMessage*/ 6; + optional bytes content = 8; // Contains an encrypted Content + optional string serverGuid = 9; + optional uint64 serverTimestamp = 10; + optional bool urgent = 14 [default = true]; + reserved /*updatedPni*/ 15; // Not used presently, may be used in the future + optional bool story = 16; + optional bytes reportingToken = 17; + // NEXT ID: 18 +} + +message Content { + 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 = 7; + optional bytes decryptionErrorMessage = 8; + optional StoryMessage storyMessage = 9; + optional PniSignatureMessage pniSignatureMessage = 10; + optional EditMessage editMessage = 11; +} + +message CallMessage { + message Offer { + enum Type { + OFFER_AUDIO_CALL = 0; + OFFER_VIDEO_CALL = 1; + reserved /* OFFER_NEED_PERMISSION */ 2; // removed + } + + optional uint64 id = 1; + reserved /* sdp */ 2; + optional Type type = 3; + optional bytes opaque = 4; + } + + message Answer { + optional uint64 id = 1; + reserved /* sdp */ 2; + optional bytes opaque = 3; + } + + message IceUpdate { + optional uint64 id = 1; + reserved /* mid */ 2; + reserved /* line */ 3; + reserved /* sdp */ 4; + optional bytes opaque = 5; + } + + message Busy { + optional uint64 id = 1; + } + + message Hangup { + enum Type { + HANGUP_NORMAL = 0; + HANGUP_ACCEPTED = 1; + HANGUP_DECLINED = 2; + HANGUP_BUSY = 3; + HANGUP_NEED_PERMISSION = 4; + } + + optional uint64 id = 1; + optional Type type = 2; + optional uint32 deviceId = 3; + } + + message Opaque { + enum Urgency { + DROPPABLE = 0; + HANDLE_IMMEDIATELY = 1; + } + + optional bytes data = 1; + optional Urgency urgency = 2; + } + + optional Offer offer = 1; + optional Answer answer = 2; + repeated IceUpdate iceUpdate = 3; + reserved /* legacyHangup */ 4; + optional Busy busy = 5; + reserved /* profileKey */ 6; + optional Hangup hangup = 7; + reserved /* multiRing */ 8; + optional uint32 destinationDeviceId = 9; + optional Opaque opaque = 10; +} + +message BodyRange { + enum Style { + NONE = 0; + BOLD = 1; + ITALIC = 2; + SPOILER = 3; + STRIKETHROUGH = 4; + MONOSPACE = 5; + } + + optional uint32 start = 1; + optional uint32 length = 2; + + oneof associatedValue { + string mentionAci = 3; + Style style = 4; + } +} + +message DataMessage { + enum Flags { + END_SESSION = 1; + EXPIRATION_TIMER_UPDATE = 2; + PROFILE_KEY_UPDATE = 4; + } + + message Quote { + enum Type { + NORMAL = 0; + GIFT_BADGE = 1; + } + + message QuotedAttachment { + optional string contentType = 1; + optional string fileName = 2; + optional AttachmentPointer thumbnail = 3; + } + + optional uint64 id = 1; + reserved /*authorE164*/ 2; + optional string authorAci = 5; + optional string text = 3; + repeated QuotedAttachment attachments = 4; + repeated BodyRange bodyRanges = 6; + optional Type type = 7; + } + + message Contact { + message Name { + optional string givenName = 1; + optional string familyName = 2; + optional string prefix = 3; + optional string suffix = 4; + optional string middleName = 5; + optional string displayName = 6; + } + + message Phone { + enum Type { + HOME = 1; + MOBILE = 2; + WORK = 3; + CUSTOM = 4; + } + + optional string value = 1; + optional Type type = 2; + optional string label = 3; + } + + message Email { + enum Type { + HOME = 1; + MOBILE = 2; + WORK = 3; + CUSTOM = 4; + } + + optional string value = 1; + optional Type type = 2; + optional string label = 3; + } + + message PostalAddress { + enum Type { + HOME = 1; + WORK = 2; + CUSTOM = 3; + } + + optional Type type = 1; + optional string label = 2; + optional string street = 3; + optional string pobox = 4; + optional string neighborhood = 5; + optional string city = 6; + optional string region = 7; + optional string postcode = 8; + optional string country = 9; + } + + message Avatar { + optional AttachmentPointer avatar = 1; + optional bool isProfile = 2; + } + + optional Name name = 1; + repeated Phone number = 3; + repeated Email email = 4; + repeated PostalAddress address = 5; + optional Avatar avatar = 6; + optional string organization = 7; + } + + message Sticker { + optional bytes packId = 1; + optional bytes packKey = 2; + optional uint32 stickerId = 3; + optional AttachmentPointer data = 4; + optional string emoji = 5; + } + + message Reaction { + optional string emoji = 1; + optional bool remove = 2; + reserved /*targetAuthorE164*/ 3; + optional string targetAuthorAci = 4; + optional uint64 targetSentTimestamp = 5; + } + + message Delete { + optional uint64 targetSentTimestamp = 1; + } + + message GroupCallUpdate { + optional string eraId = 1; + } + + message StoryContext { + optional string authorAci = 1; + optional uint64 sentTimestamp = 2; + } + + message Payment { + message Amount { + message MobileCoin { + optional uint64 picoMob = 1; + } + + oneof Amount { + MobileCoin mobileCoin = 1; + } + } + + message Notification { + message MobileCoin { + optional bytes receipt = 1; + } + + oneof Transaction { + MobileCoin mobileCoin = 1; + } + + optional string note = 2; + reserved /*requestId*/ 1003; + } + + message Activation { + enum Type { + REQUEST = 0; + ACTIVATED = 1; + } + + optional Type type = 1; + } + + oneof Item { + Notification notification = 1; + Activation activation = 2; + } + + reserved /*request*/ 1002; + reserved /*cancellation*/ 1003; + } + + message GiftBadge { + optional bytes receiptCredentialPresentation = 1; + } + + enum ProtocolVersion { + option allow_alias = true; + + INITIAL = 0; + MESSAGE_TIMERS = 1; + VIEW_ONCE = 2; + VIEW_ONCE_VIDEO = 3; + REACTIONS = 4; + CDN_SELECTOR_ATTACHMENTS = 5; + MENTIONS = 6; + PAYMENTS = 7; + CURRENT = 7; + } + + optional string body = 1; + repeated AttachmentPointer attachments = 2; + reserved /*groupV1*/ 3; + optional GroupContextV2 groupV2 = 15; + optional uint32 flags = 4; + optional uint32 expireTimer = 5; + optional bytes profileKey = 6; + optional uint64 timestamp = 7; + optional Quote quote = 8; + repeated Contact contact = 9; + repeated Preview preview = 10; + optional Sticker sticker = 11; + optional uint32 requiredProtocolVersion = 12; + optional bool isViewOnce = 14; + optional Reaction reaction = 16; + optional Delete delete = 17; + repeated BodyRange bodyRanges = 18; + optional GroupCallUpdate groupCallUpdate = 19; + optional Payment payment = 20; + optional StoryContext storyContext = 21; + optional GiftBadge giftBadge = 22; +} + +message NullMessage { + optional bytes padding = 1; +} + +message ReceiptMessage { + enum Type { + DELIVERY = 0; + READ = 1; + VIEWED = 2; + } + + optional Type type = 1; + repeated uint64 timestamp = 2; +} + +message TypingMessage { + enum Action { + STARTED = 0; + STOPPED = 1; + } + + optional uint64 timestamp = 1; + optional Action action = 2; + optional bytes groupId = 3; +} + +message StoryMessage { + optional bytes profileKey = 1; + optional GroupContextV2 group = 2; + oneof attachment { + AttachmentPointer fileAttachment = 3; + TextAttachment textAttachment = 4; + } + optional bool allowsReplies = 5; + repeated BodyRange bodyRanges = 6; +} + +message Preview { + optional string url = 1; + optional string title = 2; + optional AttachmentPointer image = 3; + optional string description = 4; + optional uint64 date = 5; +} + +message TextAttachment { + enum Style { + DEFAULT = 0; + REGULAR = 1; + BOLD = 2; + SERIF = 3; + SCRIPT = 4; + CONDENSED = 5; + } + + message Gradient { + 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 + repeated uint32 colors = 4; + repeated float positions = 5; // percent from 0 to 1 + } + + optional string text = 1; + optional Style textStyle = 2; + optional uint32 textForegroundColor = 3; // integer representation of hex color + optional uint32 textBackgroundColor = 4; + optional Preview preview = 5; + oneof background { + Gradient gradient = 6; + uint32 color = 7; + } +} + +message Verified { + enum State { + DEFAULT = 0; + VERIFIED = 1; + UNVERIFIED = 2; + } + + reserved /*destinationE164*/ 1; + optional string destinationAci = 5; + optional bytes identityKey = 2; + optional State state = 3; + optional bytes nullMessage = 4; +} + +message SyncMessage { + message Sent { + message UnidentifiedDeliveryStatus { + reserved /*destinationE164*/ 1; + optional string destinationServiceId = 3; + optional bool unidentified = 2; + } + + message StoryMessageRecipient { + optional string destinationServiceId = 1; + repeated string distributionListIds = 2; + optional bool isAllowedToReply = 3; + } + + optional string destinationE164 = 1; + optional string destinationServiceId = 7; + optional uint64 timestamp = 2; + optional DataMessage message = 3; + optional uint64 expirationStartTimestamp = 4; + repeated UnidentifiedDeliveryStatus unidentifiedStatus = 5; + optional bool isRecipientUpdate = 6 [default = false]; + optional StoryMessage storyMessage = 8; + repeated StoryMessageRecipient storyMessageRecipients = 9; + optional EditMessage editMessage = 10; + } + + message Contacts { + optional AttachmentPointer blob = 1; + optional bool complete = 2 [default = false]; + } + + message Blocked { + repeated string numbers = 1; + repeated string acis = 3; + repeated bytes groupIds = 2; + } + + message Request { + enum Type { + UNKNOWN = 0; + CONTACTS = 1; +// GROUPS = 2; + BLOCKED = 3; + CONFIGURATION = 4; + KEYS = 5; + PNI_IDENTITY = 6; + } + + optional Type type = 1; + } + + message Read { + reserved /*senderE164*/ 1; + optional string senderAci = 3; + optional uint64 timestamp = 2; + } + + message Viewed { + reserved /*senderE164*/ 1; + optional string senderAci = 3; + optional uint64 timestamp = 2; + } + + message Configuration { + optional bool readReceipts = 1; + optional bool unidentifiedDeliveryIndicators = 2; + optional bool typingIndicators = 3; + reserved /* linkPreviews */ 4; + optional uint32 provisioningVersion = 5; + optional bool linkPreviews = 6; + } + + message StickerPackOperation { + enum Type { + INSTALL = 0; + REMOVE = 1; + } + + optional bytes packId = 1; + optional bytes packKey = 2; + optional Type type = 3; + } + + message ViewOnceOpen { + reserved /*senderE164*/ 1; + optional string senderAci = 3; + optional uint64 timestamp = 2; + } + + message FetchLatest { + enum Type { + UNKNOWN = 0; + LOCAL_PROFILE = 1; + STORAGE_MANIFEST = 2; + SUBSCRIPTION_STATUS = 3; + } + + optional Type type = 1; + } + + message Keys { + // @deprecated + optional bytes storageService = 1; + optional bytes master = 2; + } + + message MessageRequestResponse { + enum Type { + UNKNOWN = 0; + ACCEPT = 1; + DELETE = 2; + BLOCK = 3; + BLOCK_AND_DELETE = 4; + } + + reserved /*threadE164*/ 1; + optional string threadAci = 2; + optional bytes groupId = 3; + optional Type type = 4; + } + + message OutgoingPayment { + message MobileCoin { + optional bytes recipientAddress = 1; + // @required + optional uint64 amountPicoMob = 2; + // @required + optional uint64 feePicoMob = 3; + optional bytes receipt = 4; + optional uint64 ledgerBlockTimestamp = 5; + // @required + optional uint64 ledgerBlockIndex = 6; + repeated bytes spentKeyImages = 7; + repeated bytes outputPublicKeys = 8; + } + optional string recipientServiceId = 1; + optional string note = 2; + + oneof paymentDetail { + MobileCoin mobileCoin = 3; + } + } + + message PniChangeNumber { + optional bytes identityKeyPair = 1; // Serialized libsignal-client IdentityKeyPair + optional bytes signedPreKey = 2; // Serialized libsignal-client SignedPreKeyRecord + optional bytes lastResortKyberPreKey = 5; // Serialized libsignal-client KyberPreKeyRecord + optional uint32 registrationId = 3; + optional string newE164 = 4; // The e164 we have changed our number to + // Next ID: 6 + } + + message CallEvent { + enum Type { + UNKNOWN_TYPE = 0; + AUDIO_CALL = 1; + VIDEO_CALL = 2; + GROUP_CALL = 3; + AD_HOC_CALL = 4; + } + + enum Direction { + UNKNOWN_DIRECTION = 0; + INCOMING = 1; + OUTGOING = 2; + } + + enum Event { + UNKNOWN_ACTION = 0; + ACCEPTED = 1; + NOT_ACCEPTED = 2; + DELETE = 3; + } + + optional bytes conversationId = 1; + optional uint64 id = 2; + optional uint64 timestamp = 3; + optional Type type = 4; + optional Direction direction = 5; + optional Event event = 6; + } + + message CallLinkUpdate { + optional bytes rootKey = 1; + optional bytes adminPassKey = 2; + } + + message CallLogEvent { + enum Type { + CLEAR = 0; + } + + optional Type type = 1; + optional uint64 timestamp = 2; + } + + optional Sent sent = 1; + optional Contacts contacts = 2; + reserved /*groups*/ 3; + optional Request request = 4; + repeated Read read = 5; + 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; +} + +message AttachmentPointer { + enum Flags { + VOICE_MESSAGE = 1; + BORDERLESS = 2; + reserved 3; + GIF = 4; + } + + oneof attachment_identifier { + fixed64 cdnId = 1; + string cdnKey = 15; + } + optional string contentType = 2; + optional bytes key = 3; + optional uint32 size = 4; + optional bytes thumbnail = 5; + optional bytes digest = 6; + reserved 16; + optional bytes incrementalMac = 18; + optional uint32 incrementalMacChunkSize = 17; + optional string fileName = 7; + optional uint32 flags = 8; + optional uint32 width = 9; + optional uint32 height = 10; + optional string caption = 11; + optional string blurHash = 12; + optional uint64 uploadTimestamp = 13; + optional uint32 cdnNumber = 14; + // Next ID: 19 +} + +message GroupContext { + enum Type { + UNKNOWN = 0; + UPDATE = 1; + DELIVER = 2; + QUIT = 3; + REQUEST_INFO = 4; + } + + message Member { + reserved /* uuid */ 1; // removed + optional string e164 = 2; + } + + optional bytes id = 1; + optional Type type = 2; + optional string name = 3; + repeated string membersE164 = 4; + repeated Member members = 6; + optional AttachmentPointer avatar = 5; +} + +message GroupContextV2 { + optional bytes masterKey = 1; + optional uint32 revision = 2; + optional bytes groupChange = 3; +} + +message ContactDetails { + message Avatar { + optional string contentType = 1; + optional uint32 length = 2; + } + + optional string number = 1; + optional string aci = 9; + optional string name = 2; + optional Avatar avatar = 3; + optional string color = 4; + optional Verified verified = 5; + optional bytes profileKey = 6; + optional bool blocked = 7; + optional uint32 expireTimer = 8; + optional uint32 inboxPosition = 10; + optional bool archived = 11; +} + +message GroupDetails { + message Avatar { + optional string contentType = 1; + optional uint32 length = 2; + } + + message Member { + reserved /* uuid */ 1; // removed + optional string e164 = 2; + } + + optional bytes id = 1; + optional string name = 2; + repeated string membersE164 = 3; + repeated Member members = 9; + optional Avatar avatar = 4; + optional bool active = 5 [default = true]; + optional uint32 expireTimer = 6; + optional string color = 7; + optional bool blocked = 8; + optional uint32 inboxPosition = 10; + optional bool archived = 11; +} + +message PaymentAddress { + oneof Address { + MobileCoinAddress mobileCoinAddress = 1; + } + + message MobileCoinAddress { + optional bytes address = 1; + optional bytes signature = 2; + } +} + +message DecryptionErrorMessage { + optional bytes ratchetKey = 1; + optional uint64 timestamp = 2; + optional uint32 deviceId = 3; +} + +message PniSignatureMessage { + optional bytes pni = 1; + optional bytes signature = 2; +} + +message EditMessage { + optional uint64 targetSentTimestamp = 1; + optional DataMessage dataMessage = 2; +} diff --git a/pkg/signalmeow/protobuf/StickerResources.pb.go b/pkg/signalmeow/protobuf/StickerResources.pb.go new file mode 100644 index 0000000..34f48be --- /dev/null +++ b/pkg/signalmeow/protobuf/StickerResources.pb.go @@ -0,0 +1,266 @@ +//* +// Copyright (C) 2019 Open Whisper Systems +// +// Licensed according to the LICENSE file in this repository. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: StickerResources.proto + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Pack struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Title *string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` + Author *string `protobuf:"bytes,2,opt,name=author" json:"author,omitempty"` + Cover *Pack_Sticker `protobuf:"bytes,3,opt,name=cover" json:"cover,omitempty"` + Stickers []*Pack_Sticker `protobuf:"bytes,4,rep,name=stickers" json:"stickers,omitempty"` +} + +func (x *Pack) Reset() { + *x = Pack{} + if protoimpl.UnsafeEnabled { + mi := &file_StickerResources_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pack) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pack) ProtoMessage() {} + +func (x *Pack) ProtoReflect() protoreflect.Message { + mi := &file_StickerResources_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pack.ProtoReflect.Descriptor instead. +func (*Pack) Descriptor() ([]byte, []int) { + return file_StickerResources_proto_rawDescGZIP(), []int{0} +} + +func (x *Pack) GetTitle() string { + if x != nil && x.Title != nil { + return *x.Title + } + return "" +} + +func (x *Pack) GetAuthor() string { + if x != nil && x.Author != nil { + return *x.Author + } + return "" +} + +func (x *Pack) GetCover() *Pack_Sticker { + if x != nil { + return x.Cover + } + return nil +} + +func (x *Pack) GetStickers() []*Pack_Sticker { + if x != nil { + return x.Stickers + } + return nil +} + +type Pack_Sticker struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Emoji *string `protobuf:"bytes,2,opt,name=emoji" json:"emoji,omitempty"` + ContentType *string `protobuf:"bytes,3,opt,name=contentType" json:"contentType,omitempty"` +} + +func (x *Pack_Sticker) Reset() { + *x = Pack_Sticker{} + if protoimpl.UnsafeEnabled { + mi := &file_StickerResources_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Pack_Sticker) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Pack_Sticker) ProtoMessage() {} + +func (x *Pack_Sticker) ProtoReflect() protoreflect.Message { + mi := &file_StickerResources_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Pack_Sticker.ProtoReflect.Descriptor instead. +func (*Pack_Sticker) Descriptor() ([]byte, []int) { + return file_StickerResources_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Pack_Sticker) GetId() uint32 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *Pack_Sticker) GetEmoji() string { + if x != nil && x.Emoji != nil { + return *x.Emoji + } + return "" +} + +func (x *Pack_Sticker) GetContentType() string { + if x != nil && x.ContentType != nil { + return *x.ContentType + } + return "" +} + +var File_StickerResources_proto protoreflect.FileDescriptor + +var file_StickerResources_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x53, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xf3, 0x01, 0x0a, 0x04, 0x50, 0x61, 0x63, 0x6b, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x31, + 0x0a, 0x05, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x61, + 0x63, 0x6b, 0x2e, 0x53, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x52, 0x05, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x12, 0x37, 0x0a, 0x08, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x2e, 0x53, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, + 0x52, 0x08, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x73, 0x1a, 0x51, 0x0a, 0x07, 0x53, 0x74, + 0x69, 0x63, 0x6b, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x6f, 0x6a, 0x69, 0x12, 0x20, 0x0a, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x42, 0x0a, + 0x31, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x68, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x73, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x73, 0x74, 0x69, 0x63, 0x6b, + 0x65, 0x72, 0x42, 0x0d, 0x53, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x73, +} + +var ( + file_StickerResources_proto_rawDescOnce sync.Once + file_StickerResources_proto_rawDescData = file_StickerResources_proto_rawDesc +) + +func file_StickerResources_proto_rawDescGZIP() []byte { + file_StickerResources_proto_rawDescOnce.Do(func() { + file_StickerResources_proto_rawDescData = protoimpl.X.CompressGZIP(file_StickerResources_proto_rawDescData) + }) + return file_StickerResources_proto_rawDescData +} + +var file_StickerResources_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_StickerResources_proto_goTypes = []interface{}{ + (*Pack)(nil), // 0: signalservice.Pack + (*Pack_Sticker)(nil), // 1: signalservice.Pack.Sticker +} +var file_StickerResources_proto_depIdxs = []int32{ + 1, // 0: signalservice.Pack.cover:type_name -> signalservice.Pack.Sticker + 1, // 1: signalservice.Pack.stickers:type_name -> signalservice.Pack.Sticker + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_StickerResources_proto_init() } +func file_StickerResources_proto_init() { + if File_StickerResources_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_StickerResources_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pack); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StickerResources_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Pack_Sticker); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_StickerResources_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_StickerResources_proto_goTypes, + DependencyIndexes: file_StickerResources_proto_depIdxs, + MessageInfos: file_StickerResources_proto_msgTypes, + }.Build() + File_StickerResources_proto = out.File + file_StickerResources_proto_rawDesc = nil + file_StickerResources_proto_goTypes = nil + file_StickerResources_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/signalpb/StickerResources.proto b/pkg/signalmeow/protobuf/StickerResources.proto similarity index 100% rename from pkg/signalmeow/protobuf/signalpb/StickerResources.proto rename to pkg/signalmeow/protobuf/StickerResources.proto diff --git a/pkg/signalmeow/protobuf/StorageService.pb.go b/pkg/signalmeow/protobuf/StorageService.pb.go new file mode 100644 index 0000000..1476794 --- /dev/null +++ b/pkg/signalmeow/protobuf/StorageService.pb.go @@ -0,0 +1,2566 @@ +//* +// Copyright (C) 2019 Open Whisper Systems +// +// Licensed according to the LICENSE file in this repository. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: StorageService.proto + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type OptionalBool int32 + +const ( + OptionalBool_UNSET OptionalBool = 0 + OptionalBool_ENABLED OptionalBool = 1 + OptionalBool_DISABLED OptionalBool = 2 +) + +// Enum value maps for OptionalBool. +var ( + OptionalBool_name = map[int32]string{ + 0: "UNSET", + 1: "ENABLED", + 2: "DISABLED", + } + OptionalBool_value = map[string]int32{ + "UNSET": 0, + "ENABLED": 1, + "DISABLED": 2, + } +) + +func (x OptionalBool) Enum() *OptionalBool { + p := new(OptionalBool) + *p = x + return p +} + +func (x OptionalBool) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OptionalBool) Descriptor() protoreflect.EnumDescriptor { + return file_StorageService_proto_enumTypes[0].Descriptor() +} + +func (OptionalBool) Type() protoreflect.EnumType { + return &file_StorageService_proto_enumTypes[0] +} + +func (x OptionalBool) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OptionalBool.Descriptor instead. +func (OptionalBool) EnumDescriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{0} +} + +type ManifestRecord_Identifier_Type int32 + +const ( + ManifestRecord_Identifier_UNKNOWN ManifestRecord_Identifier_Type = 0 + ManifestRecord_Identifier_CONTACT ManifestRecord_Identifier_Type = 1 + ManifestRecord_Identifier_GROUPV1 ManifestRecord_Identifier_Type = 2 + ManifestRecord_Identifier_GROUPV2 ManifestRecord_Identifier_Type = 3 + ManifestRecord_Identifier_ACCOUNT ManifestRecord_Identifier_Type = 4 + ManifestRecord_Identifier_STORY_DISTRIBUTION_LIST ManifestRecord_Identifier_Type = 5 +) + +// Enum value maps for ManifestRecord_Identifier_Type. +var ( + ManifestRecord_Identifier_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CONTACT", + 2: "GROUPV1", + 3: "GROUPV2", + 4: "ACCOUNT", + 5: "STORY_DISTRIBUTION_LIST", + } + ManifestRecord_Identifier_Type_value = map[string]int32{ + "UNKNOWN": 0, + "CONTACT": 1, + "GROUPV1": 2, + "GROUPV2": 3, + "ACCOUNT": 4, + "STORY_DISTRIBUTION_LIST": 5, + } +) + +func (x ManifestRecord_Identifier_Type) Enum() *ManifestRecord_Identifier_Type { + p := new(ManifestRecord_Identifier_Type) + *p = x + return p +} + +func (x ManifestRecord_Identifier_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ManifestRecord_Identifier_Type) Descriptor() protoreflect.EnumDescriptor { + return file_StorageService_proto_enumTypes[1].Descriptor() +} + +func (ManifestRecord_Identifier_Type) Type() protoreflect.EnumType { + return &file_StorageService_proto_enumTypes[1] +} + +func (x ManifestRecord_Identifier_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ManifestRecord_Identifier_Type.Descriptor instead. +func (ManifestRecord_Identifier_Type) EnumDescriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{5, 0, 0} +} + +type ContactRecord_IdentityState int32 + +const ( + ContactRecord_DEFAULT ContactRecord_IdentityState = 0 + ContactRecord_VERIFIED ContactRecord_IdentityState = 1 + ContactRecord_UNVERIFIED ContactRecord_IdentityState = 2 +) + +// Enum value maps for ContactRecord_IdentityState. +var ( + ContactRecord_IdentityState_name = map[int32]string{ + 0: "DEFAULT", + 1: "VERIFIED", + 2: "UNVERIFIED", + } + ContactRecord_IdentityState_value = map[string]int32{ + "DEFAULT": 0, + "VERIFIED": 1, + "UNVERIFIED": 2, + } +) + +func (x ContactRecord_IdentityState) Enum() *ContactRecord_IdentityState { + p := new(ContactRecord_IdentityState) + *p = x + return p +} + +func (x ContactRecord_IdentityState) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ContactRecord_IdentityState) Descriptor() protoreflect.EnumDescriptor { + return file_StorageService_proto_enumTypes[2].Descriptor() +} + +func (ContactRecord_IdentityState) Type() protoreflect.EnumType { + return &file_StorageService_proto_enumTypes[2] +} + +func (x ContactRecord_IdentityState) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ContactRecord_IdentityState.Descriptor instead. +func (ContactRecord_IdentityState) EnumDescriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{7, 0} +} + +type GroupV2Record_StorySendMode int32 + +const ( + GroupV2Record_DEFAULT GroupV2Record_StorySendMode = 0 + GroupV2Record_DISABLED GroupV2Record_StorySendMode = 1 + GroupV2Record_ENABLED GroupV2Record_StorySendMode = 2 +) + +// Enum value maps for GroupV2Record_StorySendMode. +var ( + GroupV2Record_StorySendMode_name = map[int32]string{ + 0: "DEFAULT", + 1: "DISABLED", + 2: "ENABLED", + } + GroupV2Record_StorySendMode_value = map[string]int32{ + "DEFAULT": 0, + "DISABLED": 1, + "ENABLED": 2, + } +) + +func (x GroupV2Record_StorySendMode) Enum() *GroupV2Record_StorySendMode { + p := new(GroupV2Record_StorySendMode) + *p = x + return p +} + +func (x GroupV2Record_StorySendMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GroupV2Record_StorySendMode) Descriptor() protoreflect.EnumDescriptor { + return file_StorageService_proto_enumTypes[3].Descriptor() +} + +func (GroupV2Record_StorySendMode) Type() protoreflect.EnumType { + return &file_StorageService_proto_enumTypes[3] +} + +func (x GroupV2Record_StorySendMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GroupV2Record_StorySendMode.Descriptor instead. +func (GroupV2Record_StorySendMode) EnumDescriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{9, 0} +} + +type AccountRecord_PhoneNumberSharingMode int32 + +const ( + AccountRecord_UNKNOWN AccountRecord_PhoneNumberSharingMode = 0 + AccountRecord_EVERYBODY AccountRecord_PhoneNumberSharingMode = 1 + AccountRecord_NOBODY AccountRecord_PhoneNumberSharingMode = 2 +) + +// Enum value maps for AccountRecord_PhoneNumberSharingMode. +var ( + AccountRecord_PhoneNumberSharingMode_name = map[int32]string{ + 0: "UNKNOWN", + 1: "EVERYBODY", + 2: "NOBODY", + } + AccountRecord_PhoneNumberSharingMode_value = map[string]int32{ + "UNKNOWN": 0, + "EVERYBODY": 1, + "NOBODY": 2, + } +) + +func (x AccountRecord_PhoneNumberSharingMode) Enum() *AccountRecord_PhoneNumberSharingMode { + p := new(AccountRecord_PhoneNumberSharingMode) + *p = x + return p +} + +func (x AccountRecord_PhoneNumberSharingMode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AccountRecord_PhoneNumberSharingMode) Descriptor() protoreflect.EnumDescriptor { + return file_StorageService_proto_enumTypes[4].Descriptor() +} + +func (AccountRecord_PhoneNumberSharingMode) Type() protoreflect.EnumType { + return &file_StorageService_proto_enumTypes[4] +} + +func (x AccountRecord_PhoneNumberSharingMode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AccountRecord_PhoneNumberSharingMode.Descriptor instead. +func (AccountRecord_PhoneNumberSharingMode) EnumDescriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{11, 0} +} + +type AccountRecord_UsernameLink_Color int32 + +const ( + AccountRecord_UsernameLink_UNKNOWN AccountRecord_UsernameLink_Color = 0 + AccountRecord_UsernameLink_BLUE AccountRecord_UsernameLink_Color = 1 + AccountRecord_UsernameLink_WHITE AccountRecord_UsernameLink_Color = 2 + AccountRecord_UsernameLink_GREY AccountRecord_UsernameLink_Color = 3 + AccountRecord_UsernameLink_OLIVE AccountRecord_UsernameLink_Color = 4 + AccountRecord_UsernameLink_GREEN AccountRecord_UsernameLink_Color = 5 + AccountRecord_UsernameLink_ORANGE AccountRecord_UsernameLink_Color = 6 + AccountRecord_UsernameLink_PINK AccountRecord_UsernameLink_Color = 7 + AccountRecord_UsernameLink_PURPLE AccountRecord_UsernameLink_Color = 8 +) + +// Enum value maps for AccountRecord_UsernameLink_Color. +var ( + AccountRecord_UsernameLink_Color_name = map[int32]string{ + 0: "UNKNOWN", + 1: "BLUE", + 2: "WHITE", + 3: "GREY", + 4: "OLIVE", + 5: "GREEN", + 6: "ORANGE", + 7: "PINK", + 8: "PURPLE", + } + AccountRecord_UsernameLink_Color_value = map[string]int32{ + "UNKNOWN": 0, + "BLUE": 1, + "WHITE": 2, + "GREY": 3, + "OLIVE": 4, + "GREEN": 5, + "ORANGE": 6, + "PINK": 7, + "PURPLE": 8, + } +) + +func (x AccountRecord_UsernameLink_Color) Enum() *AccountRecord_UsernameLink_Color { + p := new(AccountRecord_UsernameLink_Color) + *p = x + return p +} + +func (x AccountRecord_UsernameLink_Color) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (AccountRecord_UsernameLink_Color) Descriptor() protoreflect.EnumDescriptor { + return file_StorageService_proto_enumTypes[5].Descriptor() +} + +func (AccountRecord_UsernameLink_Color) Type() protoreflect.EnumType { + return &file_StorageService_proto_enumTypes[5] +} + +func (x AccountRecord_UsernameLink_Color) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use AccountRecord_UsernameLink_Color.Descriptor instead. +func (AccountRecord_UsernameLink_Color) EnumDescriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{11, 1, 0} +} + +type StorageManifest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *StorageManifest) Reset() { + *x = StorageManifest{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageManifest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageManifest) ProtoMessage() {} + +func (x *StorageManifest) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StorageManifest.ProtoReflect.Descriptor instead. +func (*StorageManifest) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{0} +} + +func (x *StorageManifest) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *StorageManifest) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type StorageItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *StorageItem) Reset() { + *x = StorageItem{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageItem) ProtoMessage() {} + +func (x *StorageItem) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StorageItem.ProtoReflect.Descriptor instead. +func (*StorageItem) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{1} +} + +func (x *StorageItem) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +func (x *StorageItem) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type StorageItems struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Items []*StorageItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` +} + +func (x *StorageItems) Reset() { + *x = StorageItems{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageItems) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageItems) ProtoMessage() {} + +func (x *StorageItems) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StorageItems.ProtoReflect.Descriptor instead. +func (*StorageItems) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{2} +} + +func (x *StorageItems) GetItems() []*StorageItem { + if x != nil { + return x.Items + } + return nil +} + +type ReadOperation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReadKey [][]byte `protobuf:"bytes,1,rep,name=readKey,proto3" json:"readKey,omitempty"` +} + +func (x *ReadOperation) Reset() { + *x = ReadOperation{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReadOperation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReadOperation) ProtoMessage() {} + +func (x *ReadOperation) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReadOperation.ProtoReflect.Descriptor instead. +func (*ReadOperation) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{3} +} + +func (x *ReadOperation) GetReadKey() [][]byte { + if x != nil { + return x.ReadKey + } + return nil +} + +type WriteOperation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Manifest *StorageManifest `protobuf:"bytes,1,opt,name=manifest,proto3" json:"manifest,omitempty"` + InsertItem []*StorageItem `protobuf:"bytes,2,rep,name=insertItem,proto3" json:"insertItem,omitempty"` + DeleteKey [][]byte `protobuf:"bytes,3,rep,name=deleteKey,proto3" json:"deleteKey,omitempty"` + ClearAll bool `protobuf:"varint,4,opt,name=clearAll,proto3" json:"clearAll,omitempty"` +} + +func (x *WriteOperation) Reset() { + *x = WriteOperation{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteOperation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteOperation) ProtoMessage() {} + +func (x *WriteOperation) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WriteOperation.ProtoReflect.Descriptor instead. +func (*WriteOperation) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{4} +} + +func (x *WriteOperation) GetManifest() *StorageManifest { + if x != nil { + return x.Manifest + } + return nil +} + +func (x *WriteOperation) GetInsertItem() []*StorageItem { + if x != nil { + return x.InsertItem + } + return nil +} + +func (x *WriteOperation) GetDeleteKey() [][]byte { + if x != nil { + return x.DeleteKey + } + return nil +} + +func (x *WriteOperation) GetClearAll() bool { + if x != nil { + return x.ClearAll + } + return false +} + +type ManifestRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + SourceDevice uint32 `protobuf:"varint,3,opt,name=sourceDevice,proto3" json:"sourceDevice,omitempty"` + Identifiers []*ManifestRecord_Identifier `protobuf:"bytes,2,rep,name=identifiers,proto3" json:"identifiers,omitempty"` // Next ID: 4 +} + +func (x *ManifestRecord) Reset() { + *x = ManifestRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ManifestRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManifestRecord) ProtoMessage() {} + +func (x *ManifestRecord) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManifestRecord.ProtoReflect.Descriptor instead. +func (*ManifestRecord) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{5} +} + +func (x *ManifestRecord) GetVersion() uint64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *ManifestRecord) GetSourceDevice() uint32 { + if x != nil { + return x.SourceDevice + } + return 0 +} + +func (x *ManifestRecord) GetIdentifiers() []*ManifestRecord_Identifier { + if x != nil { + return x.Identifiers + } + return nil +} + +type StorageRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Record: + // + // *StorageRecord_Contact + // *StorageRecord_GroupV1 + // *StorageRecord_GroupV2 + // *StorageRecord_Account + // *StorageRecord_StoryDistributionList + Record isStorageRecord_Record `protobuf_oneof:"record"` +} + +func (x *StorageRecord) Reset() { + *x = StorageRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageRecord) ProtoMessage() {} + +func (x *StorageRecord) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StorageRecord.ProtoReflect.Descriptor instead. +func (*StorageRecord) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{6} +} + +func (m *StorageRecord) GetRecord() isStorageRecord_Record { + if m != nil { + return m.Record + } + return nil +} + +func (x *StorageRecord) GetContact() *ContactRecord { + if x, ok := x.GetRecord().(*StorageRecord_Contact); ok { + return x.Contact + } + return nil +} + +func (x *StorageRecord) GetGroupV1() *GroupV1Record { + if x, ok := x.GetRecord().(*StorageRecord_GroupV1); ok { + return x.GroupV1 + } + return nil +} + +func (x *StorageRecord) GetGroupV2() *GroupV2Record { + if x, ok := x.GetRecord().(*StorageRecord_GroupV2); ok { + return x.GroupV2 + } + return nil +} + +func (x *StorageRecord) GetAccount() *AccountRecord { + if x, ok := x.GetRecord().(*StorageRecord_Account); ok { + return x.Account + } + return nil +} + +func (x *StorageRecord) GetStoryDistributionList() *StoryDistributionListRecord { + if x, ok := x.GetRecord().(*StorageRecord_StoryDistributionList); ok { + return x.StoryDistributionList + } + return nil +} + +type isStorageRecord_Record interface { + isStorageRecord_Record() +} + +type StorageRecord_Contact struct { + Contact *ContactRecord `protobuf:"bytes,1,opt,name=contact,proto3,oneof"` +} + +type StorageRecord_GroupV1 struct { + GroupV1 *GroupV1Record `protobuf:"bytes,2,opt,name=groupV1,proto3,oneof"` +} + +type StorageRecord_GroupV2 struct { + GroupV2 *GroupV2Record `protobuf:"bytes,3,opt,name=groupV2,proto3,oneof"` +} + +type StorageRecord_Account struct { + Account *AccountRecord `protobuf:"bytes,4,opt,name=account,proto3,oneof"` +} + +type StorageRecord_StoryDistributionList struct { + StoryDistributionList *StoryDistributionListRecord `protobuf:"bytes,5,opt,name=storyDistributionList,proto3,oneof"` +} + +func (*StorageRecord_Contact) isStorageRecord_Record() {} + +func (*StorageRecord_GroupV1) isStorageRecord_Record() {} + +func (*StorageRecord_GroupV2) isStorageRecord_Record() {} + +func (*StorageRecord_Account) isStorageRecord_Record() {} + +func (*StorageRecord_StoryDistributionList) isStorageRecord_Record() {} + +type ContactRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Aci string `protobuf:"bytes,1,opt,name=aci,proto3" json:"aci,omitempty"` + E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` + Pni string `protobuf:"bytes,15,opt,name=pni,proto3" json:"pni,omitempty"` + ProfileKey []byte `protobuf:"bytes,3,opt,name=profileKey,proto3" json:"profileKey,omitempty"` + IdentityKey []byte `protobuf:"bytes,4,opt,name=identityKey,proto3" json:"identityKey,omitempty"` + IdentityState ContactRecord_IdentityState `protobuf:"varint,5,opt,name=identityState,proto3,enum=signalservice.ContactRecord_IdentityState" json:"identityState,omitempty"` + GivenName string `protobuf:"bytes,6,opt,name=givenName,proto3" json:"givenName,omitempty"` + FamilyName string `protobuf:"bytes,7,opt,name=familyName,proto3" json:"familyName,omitempty"` + Username string `protobuf:"bytes,8,opt,name=username,proto3" json:"username,omitempty"` + Blocked bool `protobuf:"varint,9,opt,name=blocked,proto3" json:"blocked,omitempty"` + Whitelisted bool `protobuf:"varint,10,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"` + Archived bool `protobuf:"varint,11,opt,name=archived,proto3" json:"archived,omitempty"` + MarkedUnread bool `protobuf:"varint,12,opt,name=markedUnread,proto3" json:"markedUnread,omitempty"` + MutedUntilTimestamp uint64 `protobuf:"varint,13,opt,name=mutedUntilTimestamp,proto3" json:"mutedUntilTimestamp,omitempty"` + HideStory bool `protobuf:"varint,14,opt,name=hideStory,proto3" json:"hideStory,omitempty"` + UnregisteredAtTimestamp uint64 `protobuf:"varint,16,opt,name=unregisteredAtTimestamp,proto3" json:"unregisteredAtTimestamp,omitempty"` + SystemGivenName string `protobuf:"bytes,17,opt,name=systemGivenName,proto3" json:"systemGivenName,omitempty"` + SystemFamilyName string `protobuf:"bytes,18,opt,name=systemFamilyName,proto3" json:"systemFamilyName,omitempty"` + SystemNickname string `protobuf:"bytes,19,opt,name=systemNickname,proto3" json:"systemNickname,omitempty"` + Hidden bool `protobuf:"varint,20,opt,name=hidden,proto3" json:"hidden,omitempty"` // NEXT ID: 21 +} + +func (x *ContactRecord) Reset() { + *x = ContactRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ContactRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContactRecord) ProtoMessage() {} + +func (x *ContactRecord) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ContactRecord.ProtoReflect.Descriptor instead. +func (*ContactRecord) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{7} +} + +func (x *ContactRecord) GetAci() string { + if x != nil { + return x.Aci + } + return "" +} + +func (x *ContactRecord) GetE164() string { + if x != nil { + return x.E164 + } + return "" +} + +func (x *ContactRecord) GetPni() string { + if x != nil { + return x.Pni + } + return "" +} + +func (x *ContactRecord) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *ContactRecord) GetIdentityKey() []byte { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *ContactRecord) GetIdentityState() ContactRecord_IdentityState { + if x != nil { + return x.IdentityState + } + return ContactRecord_DEFAULT +} + +func (x *ContactRecord) GetGivenName() string { + if x != nil { + return x.GivenName + } + return "" +} + +func (x *ContactRecord) GetFamilyName() string { + if x != nil { + return x.FamilyName + } + return "" +} + +func (x *ContactRecord) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *ContactRecord) GetBlocked() bool { + if x != nil { + return x.Blocked + } + return false +} + +func (x *ContactRecord) GetWhitelisted() bool { + if x != nil { + return x.Whitelisted + } + return false +} + +func (x *ContactRecord) GetArchived() bool { + if x != nil { + return x.Archived + } + return false +} + +func (x *ContactRecord) GetMarkedUnread() bool { + if x != nil { + return x.MarkedUnread + } + return false +} + +func (x *ContactRecord) GetMutedUntilTimestamp() uint64 { + if x != nil { + return x.MutedUntilTimestamp + } + return 0 +} + +func (x *ContactRecord) GetHideStory() bool { + if x != nil { + return x.HideStory + } + return false +} + +func (x *ContactRecord) GetUnregisteredAtTimestamp() uint64 { + if x != nil { + return x.UnregisteredAtTimestamp + } + return 0 +} + +func (x *ContactRecord) GetSystemGivenName() string { + if x != nil { + return x.SystemGivenName + } + return "" +} + +func (x *ContactRecord) GetSystemFamilyName() string { + if x != nil { + return x.SystemFamilyName + } + return "" +} + +func (x *ContactRecord) GetSystemNickname() string { + if x != nil { + return x.SystemNickname + } + return "" +} + +func (x *ContactRecord) GetHidden() bool { + if x != nil { + return x.Hidden + } + return false +} + +type GroupV1Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Blocked bool `protobuf:"varint,2,opt,name=blocked,proto3" json:"blocked,omitempty"` + Whitelisted bool `protobuf:"varint,3,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"` + Archived bool `protobuf:"varint,4,opt,name=archived,proto3" json:"archived,omitempty"` + MarkedUnread bool `protobuf:"varint,5,opt,name=markedUnread,proto3" json:"markedUnread,omitempty"` + MutedUntilTimestamp uint64 `protobuf:"varint,6,opt,name=mutedUntilTimestamp,proto3" json:"mutedUntilTimestamp,omitempty"` +} + +func (x *GroupV1Record) Reset() { + *x = GroupV1Record{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupV1Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupV1Record) ProtoMessage() {} + +func (x *GroupV1Record) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupV1Record.ProtoReflect.Descriptor instead. +func (*GroupV1Record) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{8} +} + +func (x *GroupV1Record) GetId() []byte { + if x != nil { + return x.Id + } + return nil +} + +func (x *GroupV1Record) GetBlocked() bool { + if x != nil { + return x.Blocked + } + return false +} + +func (x *GroupV1Record) GetWhitelisted() bool { + if x != nil { + return x.Whitelisted + } + return false +} + +func (x *GroupV1Record) GetArchived() bool { + if x != nil { + return x.Archived + } + return false +} + +func (x *GroupV1Record) GetMarkedUnread() bool { + if x != nil { + return x.MarkedUnread + } + return false +} + +func (x *GroupV1Record) GetMutedUntilTimestamp() uint64 { + if x != nil { + return x.MutedUntilTimestamp + } + return 0 +} + +type GroupV2Record struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MasterKey []byte `protobuf:"bytes,1,opt,name=masterKey,proto3" json:"masterKey,omitempty"` + Blocked bool `protobuf:"varint,2,opt,name=blocked,proto3" json:"blocked,omitempty"` + Whitelisted bool `protobuf:"varint,3,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"` + Archived bool `protobuf:"varint,4,opt,name=archived,proto3" json:"archived,omitempty"` + MarkedUnread bool `protobuf:"varint,5,opt,name=markedUnread,proto3" json:"markedUnread,omitempty"` + MutedUntilTimestamp uint64 `protobuf:"varint,6,opt,name=mutedUntilTimestamp,proto3" json:"mutedUntilTimestamp,omitempty"` + DontNotifyForMentionsIfMuted bool `protobuf:"varint,7,opt,name=dontNotifyForMentionsIfMuted,proto3" json:"dontNotifyForMentionsIfMuted,omitempty"` + 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"` +} + +func (x *GroupV2Record) Reset() { + *x = GroupV2Record{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GroupV2Record) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GroupV2Record) ProtoMessage() {} + +func (x *GroupV2Record) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GroupV2Record.ProtoReflect.Descriptor instead. +func (*GroupV2Record) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{9} +} + +func (x *GroupV2Record) GetMasterKey() []byte { + if x != nil { + return x.MasterKey + } + return nil +} + +func (x *GroupV2Record) GetBlocked() bool { + if x != nil { + return x.Blocked + } + return false +} + +func (x *GroupV2Record) GetWhitelisted() bool { + if x != nil { + return x.Whitelisted + } + return false +} + +func (x *GroupV2Record) GetArchived() bool { + if x != nil { + return x.Archived + } + return false +} + +func (x *GroupV2Record) GetMarkedUnread() bool { + if x != nil { + return x.MarkedUnread + } + return false +} + +func (x *GroupV2Record) GetMutedUntilTimestamp() uint64 { + if x != nil { + return x.MutedUntilTimestamp + } + return 0 +} + +func (x *GroupV2Record) GetDontNotifyForMentionsIfMuted() bool { + if x != nil { + return x.DontNotifyForMentionsIfMuted + } + return false +} + +func (x *GroupV2Record) GetHideStory() bool { + if x != nil { + return x.HideStory + } + return false +} + +func (x *GroupV2Record) GetStorySendMode() GroupV2Record_StorySendMode { + if x != nil { + return x.StorySendMode + } + return GroupV2Record_DEFAULT +} + +type Payments struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + Entropy []byte `protobuf:"bytes,2,opt,name=entropy,proto3" json:"entropy,omitempty"` +} + +func (x *Payments) Reset() { + *x = Payments{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payments) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payments) ProtoMessage() {} + +func (x *Payments) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payments.ProtoReflect.Descriptor instead. +func (*Payments) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{10} +} + +func (x *Payments) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *Payments) GetEntropy() []byte { + if x != nil { + return x.Entropy + } + return nil +} + +type AccountRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProfileKey []byte `protobuf:"bytes,1,opt,name=profileKey,proto3" json:"profileKey,omitempty"` + GivenName string `protobuf:"bytes,2,opt,name=givenName,proto3" json:"givenName,omitempty"` + FamilyName string `protobuf:"bytes,3,opt,name=familyName,proto3" json:"familyName,omitempty"` + AvatarUrlPath string `protobuf:"bytes,4,opt,name=avatarUrlPath,proto3" json:"avatarUrlPath,omitempty"` + NoteToSelfArchived bool `protobuf:"varint,5,opt,name=noteToSelfArchived,proto3" json:"noteToSelfArchived,omitempty"` + ReadReceipts bool `protobuf:"varint,6,opt,name=readReceipts,proto3" json:"readReceipts,omitempty"` + SealedSenderIndicators bool `protobuf:"varint,7,opt,name=sealedSenderIndicators,proto3" json:"sealedSenderIndicators,omitempty"` + TypingIndicators bool `protobuf:"varint,8,opt,name=typingIndicators,proto3" json:"typingIndicators,omitempty"` + NoteToSelfMarkedUnread bool `protobuf:"varint,10,opt,name=noteToSelfMarkedUnread,proto3" json:"noteToSelfMarkedUnread,omitempty"` + LinkPreviews bool `protobuf:"varint,11,opt,name=linkPreviews,proto3" json:"linkPreviews,omitempty"` + PhoneNumberSharingMode AccountRecord_PhoneNumberSharingMode `protobuf:"varint,12,opt,name=phoneNumberSharingMode,proto3,enum=signalservice.AccountRecord_PhoneNumberSharingMode" json:"phoneNumberSharingMode,omitempty"` + UnlistedPhoneNumber bool `protobuf:"varint,13,opt,name=unlistedPhoneNumber,proto3" json:"unlistedPhoneNumber,omitempty"` + PinnedConversations []*AccountRecord_PinnedConversation `protobuf:"bytes,14,rep,name=pinnedConversations,proto3" json:"pinnedConversations,omitempty"` + PreferContactAvatars bool `protobuf:"varint,15,opt,name=preferContactAvatars,proto3" json:"preferContactAvatars,omitempty"` + Payments *Payments `protobuf:"bytes,16,opt,name=payments,proto3" json:"payments,omitempty"` + UniversalExpireTimer uint32 `protobuf:"varint,17,opt,name=universalExpireTimer,proto3" json:"universalExpireTimer,omitempty"` + PrimarySendsSms bool `protobuf:"varint,18,opt,name=primarySendsSms,proto3" json:"primarySendsSms,omitempty"` + E164 string `protobuf:"bytes,19,opt,name=e164,proto3" json:"e164,omitempty"` + PreferredReactionEmoji []string `protobuf:"bytes,20,rep,name=preferredReactionEmoji,proto3" json:"preferredReactionEmoji,omitempty"` + SubscriberId []byte `protobuf:"bytes,21,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` + SubscriberCurrencyCode string `protobuf:"bytes,22,opt,name=subscriberCurrencyCode,proto3" json:"subscriberCurrencyCode,omitempty"` + DisplayBadgesOnProfile bool `protobuf:"varint,23,opt,name=displayBadgesOnProfile,proto3" json:"displayBadgesOnProfile,omitempty"` + SubscriptionManuallyCancelled bool `protobuf:"varint,24,opt,name=subscriptionManuallyCancelled,proto3" json:"subscriptionManuallyCancelled,omitempty"` + KeepMutedChatsArchived bool `protobuf:"varint,25,opt,name=keepMutedChatsArchived,proto3" json:"keepMutedChatsArchived,omitempty"` + HasSetMyStoriesPrivacy bool `protobuf:"varint,26,opt,name=hasSetMyStoriesPrivacy,proto3" json:"hasSetMyStoriesPrivacy,omitempty"` + HasViewedOnboardingStory bool `protobuf:"varint,27,opt,name=hasViewedOnboardingStory,proto3" json:"hasViewedOnboardingStory,omitempty"` + StoriesDisabled bool `protobuf:"varint,29,opt,name=storiesDisabled,proto3" json:"storiesDisabled,omitempty"` + StoryViewReceiptsEnabled OptionalBool `protobuf:"varint,30,opt,name=storyViewReceiptsEnabled,proto3,enum=signalservice.OptionalBool" json:"storyViewReceiptsEnabled,omitempty"` + HasSeenGroupStoryEducationSheet bool `protobuf:"varint,32,opt,name=hasSeenGroupStoryEducationSheet,proto3" json:"hasSeenGroupStoryEducationSheet,omitempty"` + Username string `protobuf:"bytes,33,opt,name=username,proto3" json:"username,omitempty"` + HasCompletedUsernameOnboarding bool `protobuf:"varint,34,opt,name=hasCompletedUsernameOnboarding,proto3" json:"hasCompletedUsernameOnboarding,omitempty"` + UsernameLink *AccountRecord_UsernameLink `protobuf:"bytes,35,opt,name=usernameLink,proto3" json:"usernameLink,omitempty"` +} + +func (x *AccountRecord) Reset() { + *x = AccountRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRecord) ProtoMessage() {} + +func (x *AccountRecord) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountRecord.ProtoReflect.Descriptor instead. +func (*AccountRecord) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{11} +} + +func (x *AccountRecord) GetProfileKey() []byte { + if x != nil { + return x.ProfileKey + } + return nil +} + +func (x *AccountRecord) GetGivenName() string { + if x != nil { + return x.GivenName + } + return "" +} + +func (x *AccountRecord) GetFamilyName() string { + if x != nil { + return x.FamilyName + } + return "" +} + +func (x *AccountRecord) GetAvatarUrlPath() string { + if x != nil { + return x.AvatarUrlPath + } + return "" +} + +func (x *AccountRecord) GetNoteToSelfArchived() bool { + if x != nil { + return x.NoteToSelfArchived + } + return false +} + +func (x *AccountRecord) GetReadReceipts() bool { + if x != nil { + return x.ReadReceipts + } + return false +} + +func (x *AccountRecord) GetSealedSenderIndicators() bool { + if x != nil { + return x.SealedSenderIndicators + } + return false +} + +func (x *AccountRecord) GetTypingIndicators() bool { + if x != nil { + return x.TypingIndicators + } + return false +} + +func (x *AccountRecord) GetNoteToSelfMarkedUnread() bool { + if x != nil { + return x.NoteToSelfMarkedUnread + } + return false +} + +func (x *AccountRecord) GetLinkPreviews() bool { + if x != nil { + return x.LinkPreviews + } + return false +} + +func (x *AccountRecord) GetPhoneNumberSharingMode() AccountRecord_PhoneNumberSharingMode { + if x != nil { + return x.PhoneNumberSharingMode + } + return AccountRecord_UNKNOWN +} + +func (x *AccountRecord) GetUnlistedPhoneNumber() bool { + if x != nil { + return x.UnlistedPhoneNumber + } + return false +} + +func (x *AccountRecord) GetPinnedConversations() []*AccountRecord_PinnedConversation { + if x != nil { + return x.PinnedConversations + } + return nil +} + +func (x *AccountRecord) GetPreferContactAvatars() bool { + if x != nil { + return x.PreferContactAvatars + } + return false +} + +func (x *AccountRecord) GetPayments() *Payments { + if x != nil { + return x.Payments + } + return nil +} + +func (x *AccountRecord) GetUniversalExpireTimer() uint32 { + if x != nil { + return x.UniversalExpireTimer + } + return 0 +} + +func (x *AccountRecord) GetPrimarySendsSms() bool { + if x != nil { + return x.PrimarySendsSms + } + return false +} + +func (x *AccountRecord) GetE164() string { + if x != nil { + return x.E164 + } + return "" +} + +func (x *AccountRecord) GetPreferredReactionEmoji() []string { + if x != nil { + return x.PreferredReactionEmoji + } + return nil +} + +func (x *AccountRecord) GetSubscriberId() []byte { + if x != nil { + return x.SubscriberId + } + return nil +} + +func (x *AccountRecord) GetSubscriberCurrencyCode() string { + if x != nil { + return x.SubscriberCurrencyCode + } + return "" +} + +func (x *AccountRecord) GetDisplayBadgesOnProfile() bool { + if x != nil { + return x.DisplayBadgesOnProfile + } + return false +} + +func (x *AccountRecord) GetSubscriptionManuallyCancelled() bool { + if x != nil { + return x.SubscriptionManuallyCancelled + } + return false +} + +func (x *AccountRecord) GetKeepMutedChatsArchived() bool { + if x != nil { + return x.KeepMutedChatsArchived + } + return false +} + +func (x *AccountRecord) GetHasSetMyStoriesPrivacy() bool { + if x != nil { + return x.HasSetMyStoriesPrivacy + } + return false +} + +func (x *AccountRecord) GetHasViewedOnboardingStory() bool { + if x != nil { + return x.HasViewedOnboardingStory + } + return false +} + +func (x *AccountRecord) GetStoriesDisabled() bool { + if x != nil { + return x.StoriesDisabled + } + return false +} + +func (x *AccountRecord) GetStoryViewReceiptsEnabled() OptionalBool { + if x != nil { + return x.StoryViewReceiptsEnabled + } + return OptionalBool_UNSET +} + +func (x *AccountRecord) GetHasSeenGroupStoryEducationSheet() bool { + if x != nil { + return x.HasSeenGroupStoryEducationSheet + } + return false +} + +func (x *AccountRecord) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *AccountRecord) GetHasCompletedUsernameOnboarding() bool { + if x != nil { + return x.HasCompletedUsernameOnboarding + } + return false +} + +func (x *AccountRecord) GetUsernameLink() *AccountRecord_UsernameLink { + if x != nil { + return x.UsernameLink + } + return nil +} + +type StoryDistributionListRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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"` +} + +func (x *StoryDistributionListRecord) Reset() { + *x = StoryDistributionListRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StoryDistributionListRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StoryDistributionListRecord) ProtoMessage() {} + +func (x *StoryDistributionListRecord) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StoryDistributionListRecord.ProtoReflect.Descriptor instead. +func (*StoryDistributionListRecord) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{12} +} + +func (x *StoryDistributionListRecord) GetIdentifier() []byte { + if x != nil { + return x.Identifier + } + return nil +} + +func (x *StoryDistributionListRecord) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StoryDistributionListRecord) GetRecipientServiceIds() []string { + if x != nil { + return x.RecipientServiceIds + } + return nil +} + +func (x *StoryDistributionListRecord) GetDeletedAtTimestamp() uint64 { + if x != nil { + return x.DeletedAtTimestamp + } + return 0 +} + +func (x *StoryDistributionListRecord) GetAllowsReplies() bool { + if x != nil { + return x.AllowsReplies + } + return false +} + +func (x *StoryDistributionListRecord) GetIsBlockList() bool { + if x != nil { + return x.IsBlockList + } + return false +} + +type ManifestRecord_Identifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3" json:"raw,omitempty"` + Type ManifestRecord_Identifier_Type `protobuf:"varint,2,opt,name=type,proto3,enum=signalservice.ManifestRecord_Identifier_Type" json:"type,omitempty"` +} + +func (x *ManifestRecord_Identifier) Reset() { + *x = ManifestRecord_Identifier{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ManifestRecord_Identifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ManifestRecord_Identifier) ProtoMessage() {} + +func (x *ManifestRecord_Identifier) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ManifestRecord_Identifier.ProtoReflect.Descriptor instead. +func (*ManifestRecord_Identifier) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *ManifestRecord_Identifier) GetRaw() []byte { + if x != nil { + return x.Raw + } + return nil +} + +func (x *ManifestRecord_Identifier) GetType() ManifestRecord_Identifier_Type { + if x != nil { + return x.Type + } + return ManifestRecord_Identifier_UNKNOWN +} + +type AccountRecord_PinnedConversation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Identifier: + // + // *AccountRecord_PinnedConversation_Contact_ + // *AccountRecord_PinnedConversation_LegacyGroupId + // *AccountRecord_PinnedConversation_GroupMasterKey + Identifier isAccountRecord_PinnedConversation_Identifier `protobuf_oneof:"identifier"` +} + +func (x *AccountRecord_PinnedConversation) Reset() { + *x = AccountRecord_PinnedConversation{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRecord_PinnedConversation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRecord_PinnedConversation) ProtoMessage() {} + +func (x *AccountRecord_PinnedConversation) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountRecord_PinnedConversation.ProtoReflect.Descriptor instead. +func (*AccountRecord_PinnedConversation) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{11, 0} +} + +func (m *AccountRecord_PinnedConversation) GetIdentifier() isAccountRecord_PinnedConversation_Identifier { + if m != nil { + return m.Identifier + } + return nil +} + +func (x *AccountRecord_PinnedConversation) GetContact() *AccountRecord_PinnedConversation_Contact { + if x, ok := x.GetIdentifier().(*AccountRecord_PinnedConversation_Contact_); ok { + return x.Contact + } + return nil +} + +func (x *AccountRecord_PinnedConversation) GetLegacyGroupId() []byte { + if x, ok := x.GetIdentifier().(*AccountRecord_PinnedConversation_LegacyGroupId); ok { + return x.LegacyGroupId + } + return nil +} + +func (x *AccountRecord_PinnedConversation) GetGroupMasterKey() []byte { + if x, ok := x.GetIdentifier().(*AccountRecord_PinnedConversation_GroupMasterKey); ok { + return x.GroupMasterKey + } + return nil +} + +type isAccountRecord_PinnedConversation_Identifier interface { + isAccountRecord_PinnedConversation_Identifier() +} + +type AccountRecord_PinnedConversation_Contact_ struct { + Contact *AccountRecord_PinnedConversation_Contact `protobuf:"bytes,1,opt,name=contact,proto3,oneof"` +} + +type AccountRecord_PinnedConversation_LegacyGroupId struct { + LegacyGroupId []byte `protobuf:"bytes,3,opt,name=legacyGroupId,proto3,oneof"` +} + +type AccountRecord_PinnedConversation_GroupMasterKey struct { + GroupMasterKey []byte `protobuf:"bytes,4,opt,name=groupMasterKey,proto3,oneof"` +} + +func (*AccountRecord_PinnedConversation_Contact_) isAccountRecord_PinnedConversation_Identifier() {} + +func (*AccountRecord_PinnedConversation_LegacyGroupId) isAccountRecord_PinnedConversation_Identifier() { +} + +func (*AccountRecord_PinnedConversation_GroupMasterKey) isAccountRecord_PinnedConversation_Identifier() { +} + +type AccountRecord_UsernameLink struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Entropy []byte `protobuf:"bytes,1,opt,name=entropy,proto3" json:"entropy,omitempty"` // 32 bytes of entropy used for encryption + ServerId []byte `protobuf:"bytes,2,opt,name=serverId,proto3" json:"serverId,omitempty"` // 16 bytes of encoded UUID provided by the server + Color AccountRecord_UsernameLink_Color `protobuf:"varint,3,opt,name=color,proto3,enum=signalservice.AccountRecord_UsernameLink_Color" json:"color,omitempty"` +} + +func (x *AccountRecord_UsernameLink) Reset() { + *x = AccountRecord_UsernameLink{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRecord_UsernameLink) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRecord_UsernameLink) ProtoMessage() {} + +func (x *AccountRecord_UsernameLink) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountRecord_UsernameLink.ProtoReflect.Descriptor instead. +func (*AccountRecord_UsernameLink) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{11, 1} +} + +func (x *AccountRecord_UsernameLink) GetEntropy() []byte { + if x != nil { + return x.Entropy + } + return nil +} + +func (x *AccountRecord_UsernameLink) GetServerId() []byte { + if x != nil { + return x.ServerId + } + return nil +} + +func (x *AccountRecord_UsernameLink) GetColor() AccountRecord_UsernameLink_Color { + if x != nil { + return x.Color + } + return AccountRecord_UsernameLink_UNKNOWN +} + +type AccountRecord_PinnedConversation_Contact struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ServiceId string `protobuf:"bytes,1,opt,name=serviceId,proto3" json:"serviceId,omitempty"` + E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` +} + +func (x *AccountRecord_PinnedConversation_Contact) Reset() { + *x = AccountRecord_PinnedConversation_Contact{} + if protoimpl.UnsafeEnabled { + mi := &file_StorageService_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountRecord_PinnedConversation_Contact) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountRecord_PinnedConversation_Contact) ProtoMessage() {} + +func (x *AccountRecord_PinnedConversation_Contact) ProtoReflect() protoreflect.Message { + mi := &file_StorageService_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AccountRecord_PinnedConversation_Contact.ProtoReflect.Descriptor instead. +func (*AccountRecord_PinnedConversation_Contact) Descriptor() ([]byte, []int) { + return file_StorageService_proto_rawDescGZIP(), []int{11, 0, 0} +} + +func (x *AccountRecord_PinnedConversation_Contact) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *AccountRecord_PinnedConversation_Contact) GetE164() string { + if x != nil { + return x.E164 + } + return "" +} + +var File_StorageService_proto protoreflect.FileDescriptor + +var file_StorageService_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x41, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x35, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, + 0x40, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, + 0x30, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x22, 0x29, 0x0a, 0x0d, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x61, 0x64, 0x4b, 0x65, 0x79, 0x22, 0xc2, 0x01, 0x0a, + 0x0e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x3a, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, + 0x74, 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0a, 0x69, + 0x6e, 0x73, 0x65, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x69, 0x6e, 0x73, + 0x65, 0x72, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x41, 0x6c, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x41, 0x6c, + 0x6c, 0x22, 0xe4, 0x02, 0x0a, 0x0e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, + 0x0a, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x65, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, + 0x72, 0x52, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x1a, 0xc7, + 0x01, 0x0a, 0x0a, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x10, 0x0a, + 0x03, 0x72, 0x61, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, + 0x41, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4d, 0x61, + 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x22, 0x64, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4e, 0x54, 0x41, + 0x43, 0x54, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x56, 0x31, 0x10, + 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x56, 0x32, 0x10, 0x03, 0x12, 0x0b, + 0x0a, 0x07, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x53, + 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x44, 0x49, 0x53, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x05, 0x22, 0xe5, 0x02, 0x0a, 0x0d, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x38, 0x0a, 0x07, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x63, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x31, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x31, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x31, 0x12, 0x38, + 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x32, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, + 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x32, 0x12, 0x38, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x62, 0x0a, 0x15, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, + 0x15, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x22, 0x8d, 0x06, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x63, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x61, 0x63, 0x69, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x31, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x65, 0x31, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x6e, 0x69, 0x18, + 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x6e, 0x69, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x50, 0x0a, 0x0d, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, + 0x0d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, + 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, + 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, + 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, + 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x55, 0x6e, + 0x72, 0x65, 0x61, 0x64, 0x12, 0x30, 0x0a, 0x13, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x55, 0x6e, 0x74, + 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x13, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x69, 0x64, 0x65, 0x53, 0x74, + 0x6f, 0x72, 0x79, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x68, 0x69, 0x64, 0x65, 0x53, + 0x74, 0x6f, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x17, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x65, 0x64, 0x41, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x04, 0x52, 0x17, 0x75, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x65, 0x64, 0x41, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x28, + 0x0a, 0x0f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x47, 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x47, + 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x46, 0x61, 0x6d, 0x69, 0x6c, 0x79, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x69, + 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x68, 0x69, + 0x64, 0x64, 0x65, 0x6e, 0x22, 0x3a, 0x0a, 0x0d, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, + 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x02, + 0x22, 0xcd, 0x01, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x31, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, + 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0b, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x08, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, + 0x72, 0x6b, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0c, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12, 0x30, + 0x0a, 0x13, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6d, 0x75, 0x74, + 0x65, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x22, 0xce, 0x03, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x32, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x65, 0x79, + 0x12, 0x18, 0x0a, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x77, 0x68, + 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x61, 0x72, 0x6b, + 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, + 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12, 0x30, 0x0a, 0x13, + 0x6d, 0x75, 0x74, 0x65, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6d, 0x75, 0x74, 0x65, 0x64, + 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x42, + 0x0a, 0x1c, 0x64, 0x6f, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x46, 0x6f, 0x72, 0x4d, + 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x66, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x1c, 0x64, 0x6f, 0x6e, 0x74, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, + 0x46, 0x6f, 0x72, 0x4d, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x66, 0x4d, 0x75, 0x74, + 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x69, 0x64, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x68, 0x69, 0x64, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x79, + 0x12, 0x50, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x6f, 0x64, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x32, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x4d, + 0x6f, 0x64, 0x65, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x6f, + 0x64, 0x65, 0x22, 0x37, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x4d, + 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, + 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, + 0x0a, 0x07, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x09, 0x10, + 0x0a, 0x22, 0x3e, 0x0a, 0x08, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x0a, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x6f, + 0x70, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, + 0x79, 0x22, 0x9a, 0x12, 0x0a, 0x0d, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x50, 0x61, + 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x55, 0x72, 0x6c, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x12, 0x6e, 0x6f, 0x74, 0x65, 0x54, + 0x6f, 0x53, 0x65, 0x6c, 0x66, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x12, 0x6e, 0x6f, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x65, 0x6c, 0x66, 0x41, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x52, + 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x72, + 0x65, 0x61, 0x64, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x12, 0x36, 0x0a, 0x16, 0x73, + 0x65, 0x61, 0x6c, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, + 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x73, 0x65, 0x61, + 0x6c, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, + 0x6f, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x79, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, + 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x74, + 0x79, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, + 0x36, 0x0a, 0x16, 0x6e, 0x6f, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x65, 0x6c, 0x66, 0x4d, 0x61, 0x72, + 0x6b, 0x65, 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x16, 0x6e, 0x6f, 0x74, 0x65, 0x54, 0x6f, 0x53, 0x65, 0x6c, 0x66, 0x4d, 0x61, 0x72, 0x6b, 0x65, + 0x64, 0x55, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x50, + 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, + 0x69, 0x6e, 0x6b, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x12, 0x6b, 0x0a, 0x16, 0x70, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, + 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, + 0x52, 0x16, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x68, 0x61, + 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x75, 0x6e, 0x6c, 0x69, + 0x73, 0x74, 0x65, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x75, 0x6e, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x50, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x61, 0x0a, 0x13, 0x70, 0x69, + 0x6e, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x76, + 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, + 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x32, 0x0a, + 0x14, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x41, 0x76, + 0x61, 0x74, 0x61, 0x72, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x70, 0x72, 0x65, + 0x66, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, + 0x73, 0x12, 0x33, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x10, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x08, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x76, 0x65, 0x72, + 0x73, 0x61, 0x6c, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x75, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x45, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x0f, 0x70, 0x72, + 0x69, 0x6d, 0x61, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, 0x73, 0x53, 0x6d, 0x73, 0x18, 0x12, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x53, 0x65, 0x6e, 0x64, + 0x73, 0x53, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x31, 0x36, 0x34, 0x18, 0x13, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x65, 0x31, 0x36, 0x34, 0x12, 0x36, 0x0a, 0x16, 0x70, 0x72, 0x65, 0x66, + 0x65, 0x72, 0x72, 0x65, 0x64, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x6f, + 0x6a, 0x69, 0x18, 0x14, 0x20, 0x03, 0x28, 0x09, 0x52, 0x16, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, + 0x72, 0x65, 0x64, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6d, 0x6f, 0x6a, 0x69, + 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x49, 0x64, + 0x18, 0x15, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x36, 0x0a, 0x16, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, + 0x65, 0x72, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x16, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, + 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x36, 0x0a, 0x16, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x42, 0x61, 0x64, 0x67, 0x65, 0x73, 0x4f, 0x6e, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x64, 0x69, + 0x73, 0x70, 0x6c, 0x61, 0x79, 0x42, 0x61, 0x64, 0x67, 0x65, 0x73, 0x4f, 0x6e, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x1d, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x18, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x73, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, + 0x79, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x16, 0x6b, 0x65, + 0x65, 0x70, 0x4d, 0x75, 0x74, 0x65, 0x64, 0x43, 0x68, 0x61, 0x74, 0x73, 0x41, 0x72, 0x63, 0x68, + 0x69, 0x76, 0x65, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x6b, 0x65, 0x65, 0x70, + 0x4d, 0x75, 0x74, 0x65, 0x64, 0x43, 0x68, 0x61, 0x74, 0x73, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, + 0x65, 0x64, 0x12, 0x36, 0x0a, 0x16, 0x68, 0x61, 0x73, 0x53, 0x65, 0x74, 0x4d, 0x79, 0x53, 0x74, + 0x6f, 0x72, 0x69, 0x65, 0x73, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x18, 0x1a, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x16, 0x68, 0x61, 0x73, 0x53, 0x65, 0x74, 0x4d, 0x79, 0x53, 0x74, 0x6f, 0x72, + 0x69, 0x65, 0x73, 0x50, 0x72, 0x69, 0x76, 0x61, 0x63, 0x79, 0x12, 0x3a, 0x0a, 0x18, 0x68, 0x61, + 0x73, 0x56, 0x69, 0x65, 0x77, 0x65, 0x64, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x68, 0x61, + 0x73, 0x56, 0x69, 0x65, 0x77, 0x65, 0x64, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x65, + 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x12, 0x57, 0x0a, 0x18, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x63, + 0x65, 0x69, 0x70, 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x1e, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x52, + 0x18, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x63, 0x65, 0x69, 0x70, + 0x74, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x48, 0x0a, 0x1f, 0x68, 0x61, 0x73, + 0x53, 0x65, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x64, + 0x75, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x18, 0x20, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x1f, 0x68, 0x61, 0x73, 0x53, 0x65, 0x65, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x53, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x64, 0x75, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x68, + 0x65, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x21, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x46, 0x0a, 0x1e, 0x68, 0x61, 0x73, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4f, 0x6e, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, + 0x67, 0x18, 0x22, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1e, 0x68, 0x61, 0x73, 0x43, 0x6f, 0x6d, 0x70, + 0x6c, 0x65, 0x74, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4f, 0x6e, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x4d, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, + 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x55, 0x73, 0x65, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, 0x1a, 0x86, 0x02, 0x0a, 0x12, 0x50, 0x69, 0x6e, 0x6e, 0x65, + 0x64, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x53, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, + 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x50, 0x69, 0x6e, + 0x6e, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x63, 0x74, 0x12, 0x26, 0x0a, 0x0d, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0d, 0x6c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0e, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x0e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x61, 0x73, 0x74, 0x65, + 0x72, 0x4b, 0x65, 0x79, 0x1a, 0x3b, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x65, 0x31, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x31, 0x36, + 0x34, 0x42, 0x0c, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x1a, + 0xf8, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, + 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x70, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4c, 0x69, 0x6e, 0x6b, + 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x6b, 0x0a, + 0x05, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x4c, 0x55, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, + 0x05, 0x57, 0x48, 0x49, 0x54, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x47, 0x52, 0x45, 0x59, + 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x4c, 0x49, 0x56, 0x45, 0x10, 0x04, 0x12, 0x09, 0x0a, + 0x05, 0x47, 0x52, 0x45, 0x45, 0x4e, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x52, 0x41, 0x4e, + 0x47, 0x45, 0x10, 0x06, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x49, 0x4e, 0x4b, 0x10, 0x07, 0x12, 0x0a, + 0x0a, 0x06, 0x50, 0x55, 0x52, 0x50, 0x4c, 0x45, 0x10, 0x08, 0x22, 0x40, 0x0a, 0x16, 0x50, 0x68, + 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x53, 0x68, 0x61, 0x72, 0x69, 0x6e, 0x67, + 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, + 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x56, 0x45, 0x52, 0x59, 0x42, 0x4f, 0x44, 0x59, 0x10, 0x01, + 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x42, 0x4f, 0x44, 0x59, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x09, + 0x10, 0x0a, 0x4a, 0x04, 0x08, 0x1c, 0x10, 0x1d, 0x4a, 0x04, 0x08, 0x1f, 0x10, 0x20, 0x22, 0xfb, + 0x01, 0x0a, 0x1b, 0x53, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x13, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x49, 0x64, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x12, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x52, 0x65, + 0x70, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x73, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x69, 0x73, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x2a, 0x34, 0x0a, 0x0c, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x09, 0x0a, 0x05, + 0x55, 0x4e, 0x53, 0x45, 0x54, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x4e, 0x41, 0x42, 0x4c, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, + 0x10, 0x02, 0x42, 0x3c, 0x0a, 0x38, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x68, 0x69, 0x73, 0x70, 0x65, + 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x50, 0x01, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_StorageService_proto_rawDescOnce sync.Once + file_StorageService_proto_rawDescData = file_StorageService_proto_rawDesc +) + +func file_StorageService_proto_rawDescGZIP() []byte { + file_StorageService_proto_rawDescOnce.Do(func() { + file_StorageService_proto_rawDescData = protoimpl.X.CompressGZIP(file_StorageService_proto_rawDescData) + }) + return file_StorageService_proto_rawDescData +} + +var file_StorageService_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_StorageService_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_StorageService_proto_goTypes = []interface{}{ + (OptionalBool)(0), // 0: signalservice.OptionalBool + (ManifestRecord_Identifier_Type)(0), // 1: signalservice.ManifestRecord.Identifier.Type + (ContactRecord_IdentityState)(0), // 2: signalservice.ContactRecord.IdentityState + (GroupV2Record_StorySendMode)(0), // 3: signalservice.GroupV2Record.StorySendMode + (AccountRecord_PhoneNumberSharingMode)(0), // 4: signalservice.AccountRecord.PhoneNumberSharingMode + (AccountRecord_UsernameLink_Color)(0), // 5: signalservice.AccountRecord.UsernameLink.Color + (*StorageManifest)(nil), // 6: signalservice.StorageManifest + (*StorageItem)(nil), // 7: signalservice.StorageItem + (*StorageItems)(nil), // 8: signalservice.StorageItems + (*ReadOperation)(nil), // 9: signalservice.ReadOperation + (*WriteOperation)(nil), // 10: signalservice.WriteOperation + (*ManifestRecord)(nil), // 11: signalservice.ManifestRecord + (*StorageRecord)(nil), // 12: signalservice.StorageRecord + (*ContactRecord)(nil), // 13: signalservice.ContactRecord + (*GroupV1Record)(nil), // 14: signalservice.GroupV1Record + (*GroupV2Record)(nil), // 15: signalservice.GroupV2Record + (*Payments)(nil), // 16: signalservice.Payments + (*AccountRecord)(nil), // 17: signalservice.AccountRecord + (*StoryDistributionListRecord)(nil), // 18: signalservice.StoryDistributionListRecord + (*ManifestRecord_Identifier)(nil), // 19: signalservice.ManifestRecord.Identifier + (*AccountRecord_PinnedConversation)(nil), // 20: signalservice.AccountRecord.PinnedConversation + (*AccountRecord_UsernameLink)(nil), // 21: signalservice.AccountRecord.UsernameLink + (*AccountRecord_PinnedConversation_Contact)(nil), // 22: signalservice.AccountRecord.PinnedConversation.Contact +} +var file_StorageService_proto_depIdxs = []int32{ + 7, // 0: signalservice.StorageItems.items:type_name -> signalservice.StorageItem + 6, // 1: signalservice.WriteOperation.manifest:type_name -> signalservice.StorageManifest + 7, // 2: signalservice.WriteOperation.insertItem:type_name -> signalservice.StorageItem + 19, // 3: signalservice.ManifestRecord.identifiers:type_name -> signalservice.ManifestRecord.Identifier + 13, // 4: signalservice.StorageRecord.contact:type_name -> signalservice.ContactRecord + 14, // 5: signalservice.StorageRecord.groupV1:type_name -> signalservice.GroupV1Record + 15, // 6: signalservice.StorageRecord.groupV2:type_name -> signalservice.GroupV2Record + 17, // 7: signalservice.StorageRecord.account:type_name -> signalservice.AccountRecord + 18, // 8: signalservice.StorageRecord.storyDistributionList:type_name -> signalservice.StoryDistributionListRecord + 2, // 9: signalservice.ContactRecord.identityState:type_name -> signalservice.ContactRecord.IdentityState + 3, // 10: signalservice.GroupV2Record.storySendMode:type_name -> signalservice.GroupV2Record.StorySendMode + 4, // 11: signalservice.AccountRecord.phoneNumberSharingMode:type_name -> signalservice.AccountRecord.PhoneNumberSharingMode + 20, // 12: signalservice.AccountRecord.pinnedConversations:type_name -> signalservice.AccountRecord.PinnedConversation + 16, // 13: signalservice.AccountRecord.payments:type_name -> signalservice.Payments + 0, // 14: signalservice.AccountRecord.storyViewReceiptsEnabled:type_name -> signalservice.OptionalBool + 21, // 15: signalservice.AccountRecord.usernameLink:type_name -> signalservice.AccountRecord.UsernameLink + 1, // 16: signalservice.ManifestRecord.Identifier.type:type_name -> signalservice.ManifestRecord.Identifier.Type + 22, // 17: signalservice.AccountRecord.PinnedConversation.contact:type_name -> signalservice.AccountRecord.PinnedConversation.Contact + 5, // 18: signalservice.AccountRecord.UsernameLink.color:type_name -> signalservice.AccountRecord.UsernameLink.Color + 19, // [19:19] is the sub-list for method output_type + 19, // [19:19] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name +} + +func init() { file_StorageService_proto_init() } +func file_StorageService_proto_init() { + if File_StorageService_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_StorageService_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageManifest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageItem); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageItems); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ReadOperation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteOperation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManifestRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ContactRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupV1Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupV2Record); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payments); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StoryDistributionListRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ManifestRecord_Identifier); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRecord_PinnedConversation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRecord_UsernameLink); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_StorageService_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountRecord_PinnedConversation_Contact); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_StorageService_proto_msgTypes[6].OneofWrappers = []interface{}{ + (*StorageRecord_Contact)(nil), + (*StorageRecord_GroupV1)(nil), + (*StorageRecord_GroupV2)(nil), + (*StorageRecord_Account)(nil), + (*StorageRecord_StoryDistributionList)(nil), + } + file_StorageService_proto_msgTypes[14].OneofWrappers = []interface{}{ + (*AccountRecord_PinnedConversation_Contact_)(nil), + (*AccountRecord_PinnedConversation_LegacyGroupId)(nil), + (*AccountRecord_PinnedConversation_GroupMasterKey)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_StorageService_proto_rawDesc, + NumEnums: 6, + NumMessages: 17, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_StorageService_proto_goTypes, + DependencyIndexes: file_StorageService_proto_depIdxs, + EnumInfos: file_StorageService_proto_enumTypes, + MessageInfos: file_StorageService_proto_msgTypes, + }.Build() + File_StorageService_proto = out.File + file_StorageService_proto_rawDesc = nil + file_StorageService_proto_goTypes = nil + file_StorageService_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/StorageService.proto b/pkg/signalmeow/protobuf/StorageService.proto new file mode 100644 index 0000000..c8873ff --- /dev/null +++ b/pkg/signalmeow/protobuf/StorageService.proto @@ -0,0 +1,221 @@ +/** + * Copyright (C) 2019 Open Whisper Systems + * + * Licensed according to the LICENSE file in this repository. + */ +syntax = "proto3"; + +package signalservice; + +option java_package = "org.whispersystems.signalservice.internal.storage.protos"; +option java_multiple_files = true; + +enum OptionalBool { + UNSET = 0; + ENABLED = 1; + DISABLED = 2; +} + +message StorageManifest { + uint64 version = 1; + bytes value = 2; +} + +message StorageItem { + bytes key = 1; + bytes value = 2; +} + +message StorageItems { + repeated StorageItem items = 1; +} + +message ReadOperation { + repeated bytes readKey = 1; +} + +message WriteOperation { + StorageManifest manifest = 1; + repeated StorageItem insertItem = 2; + repeated bytes deleteKey = 3; + bool clearAll = 4; +} + +message ManifestRecord { + message Identifier { + enum Type { + UNKNOWN = 0; + CONTACT = 1; + GROUPV1 = 2; + GROUPV2 = 3; + ACCOUNT = 4; + STORY_DISTRIBUTION_LIST = 5; + } + + bytes raw = 1; + Type type = 2; + } + + uint64 version = 1; + uint32 sourceDevice = 3; + repeated Identifier identifiers = 2; + // Next ID: 4 +} + +message StorageRecord { + oneof record { + ContactRecord contact = 1; + GroupV1Record groupV1 = 2; + GroupV2Record groupV2 = 3; + AccountRecord account = 4; + StoryDistributionListRecord storyDistributionList = 5; + } +} + +message ContactRecord { + enum IdentityState { + DEFAULT = 0; + VERIFIED = 1; + UNVERIFIED = 2; + } + + string aci = 1; + string e164 = 2; + string pni = 15; + bytes profileKey = 3; + bytes identityKey = 4; + IdentityState identityState = 5; + string givenName = 6; + string familyName = 7; + string username = 8; + bool blocked = 9; + bool whitelisted = 10; + bool archived = 11; + bool markedUnread = 12; + uint64 mutedUntilTimestamp = 13; + bool hideStory = 14; + uint64 unregisteredAtTimestamp = 16; + string systemGivenName = 17; + string systemFamilyName = 18; + string systemNickname = 19; + bool hidden = 20; + // NEXT ID: 21 +} + +message GroupV1Record { + bytes id = 1; + bool blocked = 2; + bool whitelisted = 3; + bool archived = 4; + bool markedUnread = 5; + uint64 mutedUntilTimestamp = 6; +} + +message GroupV2Record { + enum StorySendMode { + DEFAULT = 0; + DISABLED = 1; + ENABLED = 2; + } + + bytes masterKey = 1; + bool blocked = 2; + bool whitelisted = 3; + bool archived = 4; + bool markedUnread = 5; + uint64 mutedUntilTimestamp = 6; + bool dontNotifyForMentionsIfMuted = 7; + bool hideStory = 8; + reserved /* storySendEnabled */ 9; + StorySendMode storySendMode = 10; +} + +message Payments { + bool enabled = 1; + bytes entropy = 2; +} + +message AccountRecord { + + enum PhoneNumberSharingMode { + UNKNOWN = 0; + EVERYBODY = 1; + NOBODY = 2; + } + + message PinnedConversation { + message Contact { + string serviceId = 1; + string e164 = 2; + } + + oneof identifier { + Contact contact = 1; + bytes legacyGroupId = 3; + bytes groupMasterKey = 4; + } + } + + message UsernameLink { + enum Color { + UNKNOWN = 0; + BLUE = 1; + WHITE = 2; + GREY = 3; + OLIVE = 4; + GREEN = 5; + ORANGE = 6; + PINK = 7; + PURPLE = 8; + } + + bytes entropy = 1; // 32 bytes of entropy used for encryption + bytes serverId = 2; // 16 bytes of encoded UUID provided by the server + Color color = 3; + } + + bytes profileKey = 1; + string givenName = 2; + string familyName = 3; + string avatarUrlPath = 4; + bool noteToSelfArchived = 5; + bool readReceipts = 6; + bool sealedSenderIndicators = 7; + bool typingIndicators = 8; + reserved /* proxiedLinkPreviews */ 9; + bool noteToSelfMarkedUnread = 10; + bool linkPreviews = 11; + PhoneNumberSharingMode phoneNumberSharingMode = 12; + bool unlistedPhoneNumber = 13; + repeated PinnedConversation pinnedConversations = 14; + bool preferContactAvatars = 15; + Payments payments = 16; + uint32 universalExpireTimer = 17; + bool primarySendsSms = 18; + string e164 = 19; + repeated string preferredReactionEmoji = 20; + bytes subscriberId = 21; + string subscriberCurrencyCode = 22; + bool displayBadgesOnProfile = 23; + bool subscriptionManuallyCancelled = 24; + bool keepMutedChatsArchived = 25; + bool hasSetMyStoriesPrivacy = 26; + bool hasViewedOnboardingStory = 27; + reserved /* storiesDisabled */ 28; + bool storiesDisabled = 29; + OptionalBool storyViewReceiptsEnabled = 30; + reserved /* hasReadOnboardingStory */ 31; + bool hasSeenGroupStoryEducationSheet = 32; + string username = 33; + bool hasCompletedUsernameOnboarding = 34; + UsernameLink usernameLink = 35; +} + +message StoryDistributionListRecord { + bytes identifier = 1; + string name = 2; + repeated string recipientServiceIds = 3; + uint64 deletedAtTimestamp = 4; + bool allowsReplies = 5; + bool isBlockList = 6; +} diff --git a/pkg/signalmeow/protobuf/UnidentifiedDelivery.pb.go b/pkg/signalmeow/protobuf/UnidentifiedDelivery.pb.go new file mode 100644 index 0000000..9f95088 --- /dev/null +++ b/pkg/signalmeow/protobuf/UnidentifiedDelivery.pb.go @@ -0,0 +1,757 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: UnidentifiedDelivery.proto + +// Copyright 2018 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UnidentifiedSenderMessage_Message_Type int32 + +const ( + UnidentifiedSenderMessage_Message_PREKEY_MESSAGE UnidentifiedSenderMessage_Message_Type = 1 + UnidentifiedSenderMessage_Message_MESSAGE UnidentifiedSenderMessage_Message_Type = 2 // Further cases should line up with Envelope.Type, even though old cases don't. + UnidentifiedSenderMessage_Message_SENDERKEY_MESSAGE UnidentifiedSenderMessage_Message_Type = 7 + UnidentifiedSenderMessage_Message_PLAINTEXT_CONTENT UnidentifiedSenderMessage_Message_Type = 8 +) + +// Enum value maps for UnidentifiedSenderMessage_Message_Type. +var ( + UnidentifiedSenderMessage_Message_Type_name = map[int32]string{ + 1: "PREKEY_MESSAGE", + 2: "MESSAGE", + 7: "SENDERKEY_MESSAGE", + 8: "PLAINTEXT_CONTENT", + } + UnidentifiedSenderMessage_Message_Type_value = map[string]int32{ + "PREKEY_MESSAGE": 1, + "MESSAGE": 2, + "SENDERKEY_MESSAGE": 7, + "PLAINTEXT_CONTENT": 8, + } +) + +func (x UnidentifiedSenderMessage_Message_Type) Enum() *UnidentifiedSenderMessage_Message_Type { + p := new(UnidentifiedSenderMessage_Message_Type) + *p = x + return p +} + +func (x UnidentifiedSenderMessage_Message_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UnidentifiedSenderMessage_Message_Type) Descriptor() protoreflect.EnumDescriptor { + return file_UnidentifiedDelivery_proto_enumTypes[0].Descriptor() +} + +func (UnidentifiedSenderMessage_Message_Type) Type() protoreflect.EnumType { + return &file_UnidentifiedDelivery_proto_enumTypes[0] +} + +func (x UnidentifiedSenderMessage_Message_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *UnidentifiedSenderMessage_Message_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = UnidentifiedSenderMessage_Message_Type(num) + return nil +} + +// Deprecated: Use UnidentifiedSenderMessage_Message_Type.Descriptor instead. +func (UnidentifiedSenderMessage_Message_Type) EnumDescriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{2, 0, 0} +} + +type UnidentifiedSenderMessage_Message_ContentHint int32 + +const ( + // Show an error immediately; it was important but we can't retry. + UnidentifiedSenderMessage_Message_DEFAULT UnidentifiedSenderMessage_Message_ContentHint = 0 + // Sender will try to resend; delay any error UI if possible + UnidentifiedSenderMessage_Message_RESENDABLE UnidentifiedSenderMessage_Message_ContentHint = 1 + // Don't show any error UI at all; this is something sent implicitly like a typing message or a receipt + UnidentifiedSenderMessage_Message_IMPLICIT UnidentifiedSenderMessage_Message_ContentHint = 2 +) + +// Enum value maps for UnidentifiedSenderMessage_Message_ContentHint. +var ( + UnidentifiedSenderMessage_Message_ContentHint_name = map[int32]string{ + 0: "DEFAULT", + 1: "RESENDABLE", + 2: "IMPLICIT", + } + UnidentifiedSenderMessage_Message_ContentHint_value = map[string]int32{ + "DEFAULT": 0, + "RESENDABLE": 1, + "IMPLICIT": 2, + } +) + +func (x UnidentifiedSenderMessage_Message_ContentHint) Enum() *UnidentifiedSenderMessage_Message_ContentHint { + p := new(UnidentifiedSenderMessage_Message_ContentHint) + *p = x + return p +} + +func (x UnidentifiedSenderMessage_Message_ContentHint) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UnidentifiedSenderMessage_Message_ContentHint) Descriptor() protoreflect.EnumDescriptor { + return file_UnidentifiedDelivery_proto_enumTypes[1].Descriptor() +} + +func (UnidentifiedSenderMessage_Message_ContentHint) Type() protoreflect.EnumType { + return &file_UnidentifiedDelivery_proto_enumTypes[1] +} + +func (x UnidentifiedSenderMessage_Message_ContentHint) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *UnidentifiedSenderMessage_Message_ContentHint) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = UnidentifiedSenderMessage_Message_ContentHint(num) + return nil +} + +// Deprecated: Use UnidentifiedSenderMessage_Message_ContentHint.Descriptor instead. +func (UnidentifiedSenderMessage_Message_ContentHint) EnumDescriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{2, 0, 1} +} + +type ServerCertificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Certificate []byte `protobuf:"bytes,1,opt,name=certificate" json:"certificate,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` +} + +func (x *ServerCertificate) Reset() { + *x = ServerCertificate{} + if protoimpl.UnsafeEnabled { + mi := &file_UnidentifiedDelivery_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerCertificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerCertificate) ProtoMessage() {} + +func (x *ServerCertificate) ProtoReflect() protoreflect.Message { + mi := &file_UnidentifiedDelivery_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerCertificate.ProtoReflect.Descriptor instead. +func (*ServerCertificate) Descriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{0} +} + +func (x *ServerCertificate) GetCertificate() []byte { + if x != nil { + return x.Certificate + } + return nil +} + +func (x *ServerCertificate) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type SenderCertificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Certificate []byte `protobuf:"bytes,1,opt,name=certificate" json:"certificate,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` +} + +func (x *SenderCertificate) Reset() { + *x = SenderCertificate{} + if protoimpl.UnsafeEnabled { + mi := &file_UnidentifiedDelivery_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SenderCertificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SenderCertificate) ProtoMessage() {} + +func (x *SenderCertificate) ProtoReflect() protoreflect.Message { + mi := &file_UnidentifiedDelivery_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SenderCertificate.ProtoReflect.Descriptor instead. +func (*SenderCertificate) Descriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{1} +} + +func (x *SenderCertificate) GetCertificate() []byte { + if x != nil { + return x.Certificate + } + return nil +} + +func (x *SenderCertificate) GetSignature() []byte { + if x != nil { + return x.Signature + } + return nil +} + +type UnidentifiedSenderMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EphemeralPublic []byte `protobuf:"bytes,1,opt,name=ephemeralPublic" json:"ephemeralPublic,omitempty"` + EncryptedStatic []byte `protobuf:"bytes,2,opt,name=encryptedStatic" json:"encryptedStatic,omitempty"` + EncryptedMessage []byte `protobuf:"bytes,3,opt,name=encryptedMessage" json:"encryptedMessage,omitempty"` +} + +func (x *UnidentifiedSenderMessage) Reset() { + *x = UnidentifiedSenderMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_UnidentifiedDelivery_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnidentifiedSenderMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnidentifiedSenderMessage) ProtoMessage() {} + +func (x *UnidentifiedSenderMessage) ProtoReflect() protoreflect.Message { + mi := &file_UnidentifiedDelivery_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnidentifiedSenderMessage.ProtoReflect.Descriptor instead. +func (*UnidentifiedSenderMessage) Descriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{2} +} + +func (x *UnidentifiedSenderMessage) GetEphemeralPublic() []byte { + if x != nil { + return x.EphemeralPublic + } + return nil +} + +func (x *UnidentifiedSenderMessage) GetEncryptedStatic() []byte { + if x != nil { + return x.EncryptedStatic + } + return nil +} + +func (x *UnidentifiedSenderMessage) GetEncryptedMessage() []byte { + if x != nil { + return x.EncryptedMessage + } + return nil +} + +type ServerCertificate_Certificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Key []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` +} + +func (x *ServerCertificate_Certificate) Reset() { + *x = ServerCertificate_Certificate{} + if protoimpl.UnsafeEnabled { + mi := &file_UnidentifiedDelivery_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ServerCertificate_Certificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ServerCertificate_Certificate) ProtoMessage() {} + +func (x *ServerCertificate_Certificate) ProtoReflect() protoreflect.Message { + mi := &file_UnidentifiedDelivery_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ServerCertificate_Certificate.ProtoReflect.Descriptor instead. +func (*ServerCertificate_Certificate) Descriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *ServerCertificate_Certificate) GetId() uint32 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *ServerCertificate_Certificate) GetKey() []byte { + if x != nil { + return x.Key + } + return nil +} + +type SenderCertificate_Certificate struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderE164 *string `protobuf:"bytes,1,opt,name=senderE164" json:"senderE164,omitempty"` + SenderUuid *string `protobuf:"bytes,6,opt,name=senderUuid" json:"senderUuid,omitempty"` + SenderDevice *uint32 `protobuf:"varint,2,opt,name=senderDevice" json:"senderDevice,omitempty"` + Expires *uint64 `protobuf:"fixed64,3,opt,name=expires" json:"expires,omitempty"` + IdentityKey []byte `protobuf:"bytes,4,opt,name=identityKey" json:"identityKey,omitempty"` + Signer *ServerCertificate `protobuf:"bytes,5,opt,name=signer" json:"signer,omitempty"` +} + +func (x *SenderCertificate_Certificate) Reset() { + *x = SenderCertificate_Certificate{} + if protoimpl.UnsafeEnabled { + mi := &file_UnidentifiedDelivery_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SenderCertificate_Certificate) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SenderCertificate_Certificate) ProtoMessage() {} + +func (x *SenderCertificate_Certificate) ProtoReflect() protoreflect.Message { + mi := &file_UnidentifiedDelivery_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SenderCertificate_Certificate.ProtoReflect.Descriptor instead. +func (*SenderCertificate_Certificate) Descriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *SenderCertificate_Certificate) GetSenderE164() string { + if x != nil && x.SenderE164 != nil { + return *x.SenderE164 + } + return "" +} + +func (x *SenderCertificate_Certificate) GetSenderUuid() string { + if x != nil && x.SenderUuid != nil { + return *x.SenderUuid + } + return "" +} + +func (x *SenderCertificate_Certificate) GetSenderDevice() uint32 { + if x != nil && x.SenderDevice != nil { + return *x.SenderDevice + } + return 0 +} + +func (x *SenderCertificate_Certificate) GetExpires() uint64 { + if x != nil && x.Expires != nil { + return *x.Expires + } + return 0 +} + +func (x *SenderCertificate_Certificate) GetIdentityKey() []byte { + if x != nil { + return x.IdentityKey + } + return nil +} + +func (x *SenderCertificate_Certificate) GetSigner() *ServerCertificate { + if x != nil { + return x.Signer + } + return nil +} + +type UnidentifiedSenderMessage_Message struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *UnidentifiedSenderMessage_Message_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.UnidentifiedSenderMessage_Message_Type" json:"type,omitempty"` + SenderCertificate *SenderCertificate `protobuf:"bytes,2,opt,name=senderCertificate" json:"senderCertificate,omitempty"` + Content []byte `protobuf:"bytes,3,opt,name=content" json:"content,omitempty"` + ContentHint *UnidentifiedSenderMessage_Message_ContentHint `protobuf:"varint,4,opt,name=contentHint,enum=signalservice.UnidentifiedSenderMessage_Message_ContentHint" json:"contentHint,omitempty"` + GroupId []byte `protobuf:"bytes,5,opt,name=groupId" json:"groupId,omitempty"` +} + +func (x *UnidentifiedSenderMessage_Message) Reset() { + *x = UnidentifiedSenderMessage_Message{} + if protoimpl.UnsafeEnabled { + mi := &file_UnidentifiedDelivery_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnidentifiedSenderMessage_Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnidentifiedSenderMessage_Message) ProtoMessage() {} + +func (x *UnidentifiedSenderMessage_Message) ProtoReflect() protoreflect.Message { + mi := &file_UnidentifiedDelivery_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UnidentifiedSenderMessage_Message.ProtoReflect.Descriptor instead. +func (*UnidentifiedSenderMessage_Message) Descriptor() ([]byte, []int) { + return file_UnidentifiedDelivery_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *UnidentifiedSenderMessage_Message) GetType() UnidentifiedSenderMessage_Message_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return UnidentifiedSenderMessage_Message_PREKEY_MESSAGE +} + +func (x *UnidentifiedSenderMessage_Message) GetSenderCertificate() *SenderCertificate { + if x != nil { + return x.SenderCertificate + } + return nil +} + +func (x *UnidentifiedSenderMessage_Message) GetContent() []byte { + if x != nil { + return x.Content + } + return nil +} + +func (x *UnidentifiedSenderMessage_Message) GetContentHint() UnidentifiedSenderMessage_Message_ContentHint { + if x != nil && x.ContentHint != nil { + return *x.ContentHint + } + return UnidentifiedSenderMessage_Message_DEFAULT +} + +func (x *UnidentifiedSenderMessage_Message) GetGroupId() []byte { + if x != nil { + return x.GroupId + } + return nil +} + +var File_UnidentifiedDelivery_proto protoreflect.FileDescriptor + +var file_UnidentifiedDelivery_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x55, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x44, 0x65, + 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x11, + 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x1a, 0x2f, 0x0a, 0x0b, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x22, 0xbd, 0x02, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x1a, 0xe7, 0x01, 0x0a, 0x0b, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x45, 0x31, 0x36, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x45, 0x31, 0x36, 0x34, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x55, 0x75, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, + 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x06, 0x52, 0x07, 0x65, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x4b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, + 0x65, 0x72, 0x22, 0xe7, 0x04, 0x0a, 0x19, 0x55, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x70, 0x68, 0x65, 0x6d, 0x65, 0x72, 0x61, 0x6c, 0x50, 0x75, 0x62, + 0x6c, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x70, 0x68, 0x65, 0x6d, + 0x65, 0x72, 0x61, 0x6c, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x28, 0x0a, 0x0f, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x53, 0x74, + 0x61, 0x74, 0x69, 0x63, 0x12, 0x2a, 0x0a, 0x10, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, + 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x1a, 0xc9, 0x03, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x49, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x35, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x79, 0x70, + 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4e, 0x0a, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, + 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x12, 0x5e, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3c, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x48, 0x69, 0x6e, 0x74, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x52, 0x45, 0x4b, 0x45, 0x59, 0x5f, 0x4d, 0x45, + 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x45, 0x53, 0x53, 0x41, + 0x47, 0x45, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x4b, 0x45, + 0x59, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x50, + 0x4c, 0x41, 0x49, 0x4e, 0x54, 0x45, 0x58, 0x54, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x54, + 0x10, 0x08, 0x22, 0x38, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x48, 0x69, 0x6e, + 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, + 0x0a, 0x0a, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x44, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0c, + 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, 0x02, 0x42, 0x36, 0x0a, 0x25, + 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x68, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x73, 0x2e, 0x6c, 0x69, 0x62, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x42, 0x0d, 0x57, 0x68, 0x69, 0x73, 0x70, 0x65, 0x72, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x73, +} + +var ( + file_UnidentifiedDelivery_proto_rawDescOnce sync.Once + file_UnidentifiedDelivery_proto_rawDescData = file_UnidentifiedDelivery_proto_rawDesc +) + +func file_UnidentifiedDelivery_proto_rawDescGZIP() []byte { + file_UnidentifiedDelivery_proto_rawDescOnce.Do(func() { + file_UnidentifiedDelivery_proto_rawDescData = protoimpl.X.CompressGZIP(file_UnidentifiedDelivery_proto_rawDescData) + }) + return file_UnidentifiedDelivery_proto_rawDescData +} + +var file_UnidentifiedDelivery_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_UnidentifiedDelivery_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_UnidentifiedDelivery_proto_goTypes = []interface{}{ + (UnidentifiedSenderMessage_Message_Type)(0), // 0: signalservice.UnidentifiedSenderMessage.Message.Type + (UnidentifiedSenderMessage_Message_ContentHint)(0), // 1: signalservice.UnidentifiedSenderMessage.Message.ContentHint + (*ServerCertificate)(nil), // 2: signalservice.ServerCertificate + (*SenderCertificate)(nil), // 3: signalservice.SenderCertificate + (*UnidentifiedSenderMessage)(nil), // 4: signalservice.UnidentifiedSenderMessage + (*ServerCertificate_Certificate)(nil), // 5: signalservice.ServerCertificate.Certificate + (*SenderCertificate_Certificate)(nil), // 6: signalservice.SenderCertificate.Certificate + (*UnidentifiedSenderMessage_Message)(nil), // 7: signalservice.UnidentifiedSenderMessage.Message +} +var file_UnidentifiedDelivery_proto_depIdxs = []int32{ + 2, // 0: signalservice.SenderCertificate.Certificate.signer:type_name -> signalservice.ServerCertificate + 0, // 1: signalservice.UnidentifiedSenderMessage.Message.type:type_name -> signalservice.UnidentifiedSenderMessage.Message.Type + 3, // 2: signalservice.UnidentifiedSenderMessage.Message.senderCertificate:type_name -> signalservice.SenderCertificate + 1, // 3: signalservice.UnidentifiedSenderMessage.Message.contentHint:type_name -> signalservice.UnidentifiedSenderMessage.Message.ContentHint + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_UnidentifiedDelivery_proto_init() } +func file_UnidentifiedDelivery_proto_init() { + if File_UnidentifiedDelivery_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_UnidentifiedDelivery_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_UnidentifiedDelivery_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SenderCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_UnidentifiedDelivery_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnidentifiedSenderMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_UnidentifiedDelivery_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ServerCertificate_Certificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_UnidentifiedDelivery_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SenderCertificate_Certificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_UnidentifiedDelivery_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UnidentifiedSenderMessage_Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_UnidentifiedDelivery_proto_rawDesc, + NumEnums: 2, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_UnidentifiedDelivery_proto_goTypes, + DependencyIndexes: file_UnidentifiedDelivery_proto_depIdxs, + EnumInfos: file_UnidentifiedDelivery_proto_enumTypes, + MessageInfos: file_UnidentifiedDelivery_proto_msgTypes, + }.Build() + File_UnidentifiedDelivery_proto = out.File + file_UnidentifiedDelivery_proto_rawDesc = nil + file_UnidentifiedDelivery_proto_goTypes = nil + file_UnidentifiedDelivery_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/UnidentifiedDelivery.proto b/pkg/signalmeow/protobuf/UnidentifiedDelivery.proto new file mode 100644 index 0000000..fb86b60 --- /dev/null +++ b/pkg/signalmeow/protobuf/UnidentifiedDelivery.proto @@ -0,0 +1,69 @@ +// Copyright 2018 Signal Messenger, LLC +// SPDX-License-Identifier: AGPL-3.0-only + +package signalservice; + +option java_package = "org.whispersystems.libsignal.protocol"; +option java_outer_classname = "WhisperProtos"; + +message ServerCertificate { + message Certificate { + optional uint32 id = 1; + optional bytes key = 2; + } + + optional bytes certificate = 1; + optional bytes signature = 2; +} + +message SenderCertificate { + message Certificate { + optional string senderE164 = 1; + optional string senderUuid = 6; + optional uint32 senderDevice = 2; + optional fixed64 expires = 3; + optional bytes identityKey = 4; + optional ServerCertificate signer = 5; + } + + optional bytes certificate = 1; + optional bytes signature = 2; +} + +message UnidentifiedSenderMessage { + + message Message { + enum Type { + PREKEY_MESSAGE = 1; + MESSAGE = 2; + // Further cases should line up with Envelope.Type, even though old cases don't. + + // Our parser does not handle reserved in enums: DESKTOP-1569 + // reserved 3 to 6; + + SENDERKEY_MESSAGE = 7; + PLAINTEXT_CONTENT = 8; + } + + enum ContentHint { + // Show an error immediately; it was important but we can't retry. + DEFAULT = 0; + + // Sender will try to resend; delay any error UI if possible + RESENDABLE = 1; + + // Don't show any error UI at all; this is something sent implicitly like a typing message or a receipt + IMPLICIT = 2; + } + + optional Type type = 1; + optional SenderCertificate senderCertificate = 2; + optional bytes content = 3; + optional ContentHint contentHint = 4; + optional bytes groupId = 5; + } + + optional bytes ephemeralPublic = 1; + optional bytes encryptedStatic = 2; + optional bytes encryptedMessage = 3; +} diff --git a/pkg/signalmeow/protobuf/WebSocketResources.pb.go b/pkg/signalmeow/protobuf/WebSocketResources.pb.go new file mode 100644 index 0000000..c3aed6d --- /dev/null +++ b/pkg/signalmeow/protobuf/WebSocketResources.pb.go @@ -0,0 +1,447 @@ +//* +// Copyright (C) 2014-2016 Open Whisper Systems +// +// Licensed according to the LICENSE file in this repository. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: WebSocketResources.proto + +package signalpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type WebSocketMessage_Type int32 + +const ( + WebSocketMessage_UNKNOWN WebSocketMessage_Type = 0 + WebSocketMessage_REQUEST WebSocketMessage_Type = 1 + WebSocketMessage_RESPONSE WebSocketMessage_Type = 2 +) + +// Enum value maps for WebSocketMessage_Type. +var ( + WebSocketMessage_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "REQUEST", + 2: "RESPONSE", + } + WebSocketMessage_Type_value = map[string]int32{ + "UNKNOWN": 0, + "REQUEST": 1, + "RESPONSE": 2, + } +) + +func (x WebSocketMessage_Type) Enum() *WebSocketMessage_Type { + p := new(WebSocketMessage_Type) + *p = x + return p +} + +func (x WebSocketMessage_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WebSocketMessage_Type) Descriptor() protoreflect.EnumDescriptor { + return file_WebSocketResources_proto_enumTypes[0].Descriptor() +} + +func (WebSocketMessage_Type) Type() protoreflect.EnumType { + return &file_WebSocketResources_proto_enumTypes[0] +} + +func (x WebSocketMessage_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *WebSocketMessage_Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = WebSocketMessage_Type(num) + return nil +} + +// Deprecated: Use WebSocketMessage_Type.Descriptor instead. +func (WebSocketMessage_Type) EnumDescriptor() ([]byte, []int) { + return file_WebSocketResources_proto_rawDescGZIP(), []int{2, 0} +} + +type WebSocketRequestMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Verb *string `protobuf:"bytes,1,opt,name=verb" json:"verb,omitempty"` + Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` + Body []byte `protobuf:"bytes,3,opt,name=body" json:"body,omitempty"` + Headers []string `protobuf:"bytes,5,rep,name=headers" json:"headers,omitempty"` + Id *uint64 `protobuf:"varint,4,opt,name=id" json:"id,omitempty"` +} + +func (x *WebSocketRequestMessage) Reset() { + *x = WebSocketRequestMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_WebSocketResources_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebSocketRequestMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebSocketRequestMessage) ProtoMessage() {} + +func (x *WebSocketRequestMessage) ProtoReflect() protoreflect.Message { + mi := &file_WebSocketResources_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebSocketRequestMessage.ProtoReflect.Descriptor instead. +func (*WebSocketRequestMessage) Descriptor() ([]byte, []int) { + return file_WebSocketResources_proto_rawDescGZIP(), []int{0} +} + +func (x *WebSocketRequestMessage) GetVerb() string { + if x != nil && x.Verb != nil { + return *x.Verb + } + return "" +} + +func (x *WebSocketRequestMessage) GetPath() string { + if x != nil && x.Path != nil { + return *x.Path + } + return "" +} + +func (x *WebSocketRequestMessage) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +func (x *WebSocketRequestMessage) GetHeaders() []string { + if x != nil { + return x.Headers + } + return nil +} + +func (x *WebSocketRequestMessage) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +type WebSocketResponseMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Status *uint32 `protobuf:"varint,2,opt,name=status" json:"status,omitempty"` + Message *string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` + Headers []string `protobuf:"bytes,5,rep,name=headers" json:"headers,omitempty"` + Body []byte `protobuf:"bytes,4,opt,name=body" json:"body,omitempty"` +} + +func (x *WebSocketResponseMessage) Reset() { + *x = WebSocketResponseMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_WebSocketResources_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebSocketResponseMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebSocketResponseMessage) ProtoMessage() {} + +func (x *WebSocketResponseMessage) ProtoReflect() protoreflect.Message { + mi := &file_WebSocketResources_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebSocketResponseMessage.ProtoReflect.Descriptor instead. +func (*WebSocketResponseMessage) Descriptor() ([]byte, []int) { + return file_WebSocketResources_proto_rawDescGZIP(), []int{1} +} + +func (x *WebSocketResponseMessage) GetId() uint64 { + if x != nil && x.Id != nil { + return *x.Id + } + return 0 +} + +func (x *WebSocketResponseMessage) GetStatus() uint32 { + if x != nil && x.Status != nil { + return *x.Status + } + return 0 +} + +func (x *WebSocketResponseMessage) GetMessage() string { + if x != nil && x.Message != nil { + return *x.Message + } + return "" +} + +func (x *WebSocketResponseMessage) GetHeaders() []string { + if x != nil { + return x.Headers + } + return nil +} + +func (x *WebSocketResponseMessage) GetBody() []byte { + if x != nil { + return x.Body + } + return nil +} + +type WebSocketMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type *WebSocketMessage_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.WebSocketMessage_Type" json:"type,omitempty"` + Request *WebSocketRequestMessage `protobuf:"bytes,2,opt,name=request" json:"request,omitempty"` + Response *WebSocketResponseMessage `protobuf:"bytes,3,opt,name=response" json:"response,omitempty"` +} + +func (x *WebSocketMessage) Reset() { + *x = WebSocketMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_WebSocketResources_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebSocketMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebSocketMessage) ProtoMessage() {} + +func (x *WebSocketMessage) ProtoReflect() protoreflect.Message { + mi := &file_WebSocketResources_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WebSocketMessage.ProtoReflect.Descriptor instead. +func (*WebSocketMessage) Descriptor() ([]byte, []int) { + return file_WebSocketResources_proto_rawDescGZIP(), []int{2} +} + +func (x *WebSocketMessage) GetType() WebSocketMessage_Type { + if x != nil && x.Type != nil { + return *x.Type + } + return WebSocketMessage_UNKNOWN +} + +func (x *WebSocketMessage) GetRequest() *WebSocketRequestMessage { + if x != nil { + return x.Request + } + return nil +} + +func (x *WebSocketMessage) GetResponse() *WebSocketResponseMessage { + if x != nil { + return x.Response + } + return nil +} + +var File_WebSocketResources_proto protoreflect.FileDescriptor + +var file_WebSocketResources_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x7f, 0x0a, 0x17, 0x57, 0x65, 0x62, + 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x65, 0x72, 0x62, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x76, 0x65, 0x72, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x8a, 0x01, 0x0a, 0x18, 0x57, + 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x83, 0x02, 0x0a, 0x10, 0x57, 0x65, 0x62, 0x53, + 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x38, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, + 0x63, 0x6b, 0x65, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, + 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, + 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, + 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x53, 0x50, 0x4f, 0x4e, 0x53, 0x45, 0x10, 0x02, 0x42, 0x46, 0x0a, + 0x33, 0x6f, 0x72, 0x67, 0x2e, 0x77, 0x68, 0x69, 0x73, 0x70, 0x65, 0x72, 0x73, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x73, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x77, 0x65, 0x62, 0x73, 0x6f, + 0x63, 0x6b, 0x65, 0x74, 0x42, 0x0f, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x73, +} + +var ( + file_WebSocketResources_proto_rawDescOnce sync.Once + file_WebSocketResources_proto_rawDescData = file_WebSocketResources_proto_rawDesc +) + +func file_WebSocketResources_proto_rawDescGZIP() []byte { + file_WebSocketResources_proto_rawDescOnce.Do(func() { + file_WebSocketResources_proto_rawDescData = protoimpl.X.CompressGZIP(file_WebSocketResources_proto_rawDescData) + }) + return file_WebSocketResources_proto_rawDescData +} + +var file_WebSocketResources_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_WebSocketResources_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_WebSocketResources_proto_goTypes = []interface{}{ + (WebSocketMessage_Type)(0), // 0: signalservice.WebSocketMessage.Type + (*WebSocketRequestMessage)(nil), // 1: signalservice.WebSocketRequestMessage + (*WebSocketResponseMessage)(nil), // 2: signalservice.WebSocketResponseMessage + (*WebSocketMessage)(nil), // 3: signalservice.WebSocketMessage +} +var file_WebSocketResources_proto_depIdxs = []int32{ + 0, // 0: signalservice.WebSocketMessage.type:type_name -> signalservice.WebSocketMessage.Type + 1, // 1: signalservice.WebSocketMessage.request:type_name -> signalservice.WebSocketRequestMessage + 2, // 2: signalservice.WebSocketMessage.response:type_name -> signalservice.WebSocketResponseMessage + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_WebSocketResources_proto_init() } +func file_WebSocketResources_proto_init() { + if File_WebSocketResources_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_WebSocketResources_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebSocketRequestMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_WebSocketResources_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebSocketResponseMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_WebSocketResources_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebSocketMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_WebSocketResources_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_WebSocketResources_proto_goTypes, + DependencyIndexes: file_WebSocketResources_proto_depIdxs, + EnumInfos: file_WebSocketResources_proto_enumTypes, + MessageInfos: file_WebSocketResources_proto_msgTypes, + }.Build() + File_WebSocketResources_proto = out.File + file_WebSocketResources_proto_rawDesc = nil + file_WebSocketResources_proto_goTypes = nil + file_WebSocketResources_proto_depIdxs = nil +} diff --git a/pkg/signalmeow/protobuf/signalpb/WebSocketResources.proto b/pkg/signalmeow/protobuf/WebSocketResources.proto similarity index 91% rename from pkg/signalmeow/protobuf/signalpb/WebSocketResources.proto rename to pkg/signalmeow/protobuf/WebSocketResources.proto index e230ad7..376f8b2 100644 --- a/pkg/signalmeow/protobuf/signalpb/WebSocketResources.proto +++ b/pkg/signalmeow/protobuf/WebSocketResources.proto @@ -7,7 +7,7 @@ syntax = "proto2"; package signalservice; -option java_package = "org.signal.network.websocket"; +option java_package = "org.whispersystems.signalservice.internal.websocket"; option java_outer_classname = "WebSocketProtos"; message WebSocketRequestMessage { diff --git a/pkg/signalmeow/protobuf/backuppb/Backup.pb.go b/pkg/signalmeow/protobuf/backuppb/Backup.pb.go deleted file mode 100644 index bcff3bd..0000000 --- a/pkg/signalmeow/protobuf/backuppb/Backup.pb.go +++ /dev/null @@ -1,14212 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: backuppb/Backup.proto - -package backuppb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// If unset - computed as the value of the first byte of SHA-256(msg=CONTACT_ID) -// modulo the count of colors. Once set the avatar color for a recipient is -// never recomputed or changed. -// -// `CONTACT_ID` is the first available identifier from the list: -// - ServiceIdToBinary(ACI) -// - E164 -// - ServiceIdToBinary(PNI) -// - Group Id -type AvatarColor int32 - -const ( - AvatarColor_A100 AvatarColor = 0 - AvatarColor_A110 AvatarColor = 1 - AvatarColor_A120 AvatarColor = 2 - AvatarColor_A130 AvatarColor = 3 - AvatarColor_A140 AvatarColor = 4 - AvatarColor_A150 AvatarColor = 5 - AvatarColor_A160 AvatarColor = 6 - AvatarColor_A170 AvatarColor = 7 - AvatarColor_A180 AvatarColor = 8 - AvatarColor_A190 AvatarColor = 9 - AvatarColor_A200 AvatarColor = 10 - AvatarColor_A210 AvatarColor = 11 -) - -// Enum value maps for AvatarColor. -var ( - AvatarColor_name = map[int32]string{ - 0: "A100", - 1: "A110", - 2: "A120", - 3: "A130", - 4: "A140", - 5: "A150", - 6: "A160", - 7: "A170", - 8: "A180", - 9: "A190", - 10: "A200", - 11: "A210", - } - AvatarColor_value = map[string]int32{ - "A100": 0, - "A110": 1, - "A120": 2, - "A130": 3, - "A140": 4, - "A150": 5, - "A160": 6, - "A170": 7, - "A180": 8, - "A190": 9, - "A200": 10, - "A210": 11, - } -) - -func (x AvatarColor) Enum() *AvatarColor { - p := new(AvatarColor) - *p = x - return p -} - -func (x AvatarColor) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AvatarColor) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[0].Descriptor() -} - -func (AvatarColor) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[0] -} - -func (x AvatarColor) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AvatarColor.Descriptor instead. -func (AvatarColor) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{0} -} - -type GroupV2AccessLevel int32 - -const ( - GroupV2AccessLevel_UNKNOWN GroupV2AccessLevel = 0 // Interpret as "Unsatisfiable" - GroupV2AccessLevel_ANY GroupV2AccessLevel = 1 - GroupV2AccessLevel_MEMBER GroupV2AccessLevel = 2 - GroupV2AccessLevel_ADMINISTRATOR GroupV2AccessLevel = 3 - GroupV2AccessLevel_UNSATISFIABLE GroupV2AccessLevel = 4 -) - -// Enum value maps for GroupV2AccessLevel. -var ( - GroupV2AccessLevel_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ANY", - 2: "MEMBER", - 3: "ADMINISTRATOR", - 4: "UNSATISFIABLE", - } - GroupV2AccessLevel_value = map[string]int32{ - "UNKNOWN": 0, - "ANY": 1, - "MEMBER": 2, - "ADMINISTRATOR": 3, - "UNSATISFIABLE": 4, - } -) - -func (x GroupV2AccessLevel) Enum() *GroupV2AccessLevel { - p := new(GroupV2AccessLevel) - *p = x - return p -} - -func (x GroupV2AccessLevel) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GroupV2AccessLevel) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[1].Descriptor() -} - -func (GroupV2AccessLevel) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[1] -} - -func (x GroupV2AccessLevel) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GroupV2AccessLevel.Descriptor instead. -func (GroupV2AccessLevel) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{1} -} - -type AccountData_PhoneNumberSharingMode int32 - -const ( - AccountData_UNKNOWN AccountData_PhoneNumberSharingMode = 0 // Interpret as "Nobody" - AccountData_EVERYBODY AccountData_PhoneNumberSharingMode = 1 - AccountData_NOBODY AccountData_PhoneNumberSharingMode = 2 -) - -// Enum value maps for AccountData_PhoneNumberSharingMode. -var ( - AccountData_PhoneNumberSharingMode_name = map[int32]string{ - 0: "UNKNOWN", - 1: "EVERYBODY", - 2: "NOBODY", - } - AccountData_PhoneNumberSharingMode_value = map[string]int32{ - "UNKNOWN": 0, - "EVERYBODY": 1, - "NOBODY": 2, - } -) - -func (x AccountData_PhoneNumberSharingMode) Enum() *AccountData_PhoneNumberSharingMode { - p := new(AccountData_PhoneNumberSharingMode) - *p = x - return p -} - -func (x AccountData_PhoneNumberSharingMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_PhoneNumberSharingMode) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[2].Descriptor() -} - -func (AccountData_PhoneNumberSharingMode) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[2] -} - -func (x AccountData_PhoneNumberSharingMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_PhoneNumberSharingMode.Descriptor instead. -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 ( - AccountData_UsernameLink_UNKNOWN AccountData_UsernameLink_Color = 0 // Interpret as "Blue" - AccountData_UsernameLink_BLUE AccountData_UsernameLink_Color = 1 - AccountData_UsernameLink_WHITE AccountData_UsernameLink_Color = 2 - AccountData_UsernameLink_GREY AccountData_UsernameLink_Color = 3 - AccountData_UsernameLink_OLIVE AccountData_UsernameLink_Color = 4 - AccountData_UsernameLink_GREEN AccountData_UsernameLink_Color = 5 - AccountData_UsernameLink_ORANGE AccountData_UsernameLink_Color = 6 - AccountData_UsernameLink_PINK AccountData_UsernameLink_Color = 7 - AccountData_UsernameLink_PURPLE AccountData_UsernameLink_Color = 8 -) - -// Enum value maps for AccountData_UsernameLink_Color. -var ( - AccountData_UsernameLink_Color_name = map[int32]string{ - 0: "UNKNOWN", - 1: "BLUE", - 2: "WHITE", - 3: "GREY", - 4: "OLIVE", - 5: "GREEN", - 6: "ORANGE", - 7: "PINK", - 8: "PURPLE", - } - AccountData_UsernameLink_Color_value = map[string]int32{ - "UNKNOWN": 0, - "BLUE": 1, - "WHITE": 2, - "GREY": 3, - "OLIVE": 4, - "GREEN": 5, - "ORANGE": 6, - "PINK": 7, - "PURPLE": 8, - } -) - -func (x AccountData_UsernameLink_Color) Enum() *AccountData_UsernameLink_Color { - p := new(AccountData_UsernameLink_Color) - *p = x - return p -} - -func (x AccountData_UsernameLink_Color) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_UsernameLink_Color) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[6].Descriptor() -} - -func (AccountData_UsernameLink_Color) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[6] -} - -func (x AccountData_UsernameLink_Color) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_UsernameLink_Color.Descriptor instead. -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_AccountSettings_UnreadBadgeType int32 - -const ( - AccountData_AccountSettings_UNKNOWN_BADGE_TYPE AccountData_AccountSettings_UnreadBadgeType = 0 // Interpret as "Unread messages" - AccountData_AccountSettings_UNREAD_MESSAGES AccountData_AccountSettings_UnreadBadgeType = 1 - AccountData_AccountSettings_UNREAD_CHATS AccountData_AccountSettings_UnreadBadgeType = 2 -) - -// Enum value maps for AccountData_AccountSettings_UnreadBadgeType. -var ( - AccountData_AccountSettings_UnreadBadgeType_name = map[int32]string{ - 0: "UNKNOWN_BADGE_TYPE", - 1: "UNREAD_MESSAGES", - 2: "UNREAD_CHATS", - } - AccountData_AccountSettings_UnreadBadgeType_value = map[string]int32{ - "UNKNOWN_BADGE_TYPE": 0, - "UNREAD_MESSAGES": 1, - "UNREAD_CHATS": 2, - } -) - -func (x AccountData_AccountSettings_UnreadBadgeType) Enum() *AccountData_AccountSettings_UnreadBadgeType { - p := new(AccountData_AccountSettings_UnreadBadgeType) - *p = x - return p -} - -func (x AccountData_AccountSettings_UnreadBadgeType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountData_AccountSettings_UnreadBadgeType) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[8].Descriptor() -} - -func (AccountData_AccountSettings_UnreadBadgeType) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[8] -} - -func (x AccountData_AccountSettings_UnreadBadgeType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountData_AccountSettings_UnreadBadgeType.Descriptor instead. -func (AccountData_AccountSettings_UnreadBadgeType) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 2, 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[9].Descriptor() -} - -func (AccountData_AndroidSpecificSettings_NavigationBarSize) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[9] -} - -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 ( - Contact_DEFAULT Contact_IdentityState = 0 // A valid value -- indicates unset by the user - Contact_VERIFIED Contact_IdentityState = 1 - Contact_UNVERIFIED Contact_IdentityState = 2 // Was once verified and is now unverified -) - -// Enum value maps for Contact_IdentityState. -var ( - Contact_IdentityState_name = map[int32]string{ - 0: "DEFAULT", - 1: "VERIFIED", - 2: "UNVERIFIED", - } - Contact_IdentityState_value = map[string]int32{ - "DEFAULT": 0, - "VERIFIED": 1, - "UNVERIFIED": 2, - } -) - -func (x Contact_IdentityState) Enum() *Contact_IdentityState { - p := new(Contact_IdentityState) - *p = x - return p -} - -func (x Contact_IdentityState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Contact_IdentityState) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[10].Descriptor() -} - -func (Contact_IdentityState) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[10] -} - -func (x Contact_IdentityState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Contact_IdentityState.Descriptor instead. -func (Contact_IdentityState) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{4, 0} -} - -type Contact_Visibility int32 - -const ( - Contact_VISIBLE Contact_Visibility = 0 // A valid value -- the contact is not hidden - Contact_HIDDEN Contact_Visibility = 1 - Contact_HIDDEN_MESSAGE_REQUEST Contact_Visibility = 2 -) - -// Enum value maps for Contact_Visibility. -var ( - Contact_Visibility_name = map[int32]string{ - 0: "VISIBLE", - 1: "HIDDEN", - 2: "HIDDEN_MESSAGE_REQUEST", - } - Contact_Visibility_value = map[string]int32{ - "VISIBLE": 0, - "HIDDEN": 1, - "HIDDEN_MESSAGE_REQUEST": 2, - } -) - -func (x Contact_Visibility) Enum() *Contact_Visibility { - p := new(Contact_Visibility) - *p = x - return p -} - -func (x Contact_Visibility) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Contact_Visibility) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[11].Descriptor() -} - -func (Contact_Visibility) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[11] -} - -func (x Contact_Visibility) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Contact_Visibility.Descriptor instead. -func (Contact_Visibility) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{4, 1} -} - -type Group_StorySendMode int32 - -const ( - Group_DEFAULT Group_StorySendMode = 0 // A valid value -- indicates unset by the user - Group_DISABLED Group_StorySendMode = 1 - Group_ENABLED Group_StorySendMode = 2 -) - -// Enum value maps for Group_StorySendMode. -var ( - Group_StorySendMode_name = map[int32]string{ - 0: "DEFAULT", - 1: "DISABLED", - 2: "ENABLED", - } - Group_StorySendMode_value = map[string]int32{ - "DEFAULT": 0, - "DISABLED": 1, - "ENABLED": 2, - } -) - -func (x Group_StorySendMode) Enum() *Group_StorySendMode { - p := new(Group_StorySendMode) - *p = x - return p -} - -func (x Group_StorySendMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Group_StorySendMode) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[12].Descriptor() -} - -func (Group_StorySendMode) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[12] -} - -func (x Group_StorySendMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Group_StorySendMode.Descriptor instead. -func (Group_StorySendMode) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 0} -} - -type Group_Member_Role int32 - -const ( - Group_Member_UNKNOWN Group_Member_Role = 0 // Intepret as "Default" - Group_Member_DEFAULT Group_Member_Role = 1 - Group_Member_ADMINISTRATOR Group_Member_Role = 2 -) - -// Enum value maps for Group_Member_Role. -var ( - Group_Member_Role_name = map[int32]string{ - 0: "UNKNOWN", - 1: "DEFAULT", - 2: "ADMINISTRATOR", - } - Group_Member_Role_value = map[string]int32{ - "UNKNOWN": 0, - "DEFAULT": 1, - "ADMINISTRATOR": 2, - } -) - -func (x Group_Member_Role) Enum() *Group_Member_Role { - p := new(Group_Member_Role) - *p = x - return p -} - -func (x Group_Member_Role) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Group_Member_Role) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[13].Descriptor() -} - -func (Group_Member_Role) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[13] -} - -func (x Group_Member_Role) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Group_Member_Role.Descriptor instead. -func (Group_Member_Role) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 2, 0} -} - -type Group_AccessControl_AccessRequired int32 - -const ( - Group_AccessControl_UNKNOWN Group_AccessControl_AccessRequired = 0 // Intepret as "Unsatisfiable" - Group_AccessControl_ANY Group_AccessControl_AccessRequired = 1 - Group_AccessControl_MEMBER Group_AccessControl_AccessRequired = 2 - Group_AccessControl_ADMINISTRATOR Group_AccessControl_AccessRequired = 3 - Group_AccessControl_UNSATISFIABLE Group_AccessControl_AccessRequired = 4 -) - -// Enum value maps for Group_AccessControl_AccessRequired. -var ( - Group_AccessControl_AccessRequired_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ANY", - 2: "MEMBER", - 3: "ADMINISTRATOR", - 4: "UNSATISFIABLE", - } - Group_AccessControl_AccessRequired_value = map[string]int32{ - "UNKNOWN": 0, - "ANY": 1, - "MEMBER": 2, - "ADMINISTRATOR": 3, - "UNSATISFIABLE": 4, - } -) - -func (x Group_AccessControl_AccessRequired) Enum() *Group_AccessControl_AccessRequired { - p := new(Group_AccessControl_AccessRequired) - *p = x - return p -} - -func (x Group_AccessControl_AccessRequired) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Group_AccessControl_AccessRequired) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[14].Descriptor() -} - -func (Group_AccessControl_AccessRequired) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[14] -} - -func (x Group_AccessControl_AccessRequired) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Group_AccessControl_AccessRequired.Descriptor instead. -func (Group_AccessControl_AccessRequired) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 6, 0} -} - -type CallLink_Restrictions int32 - -const ( - CallLink_UNKNOWN CallLink_Restrictions = 0 // Interpret as "Admin Approval" - CallLink_NONE CallLink_Restrictions = 1 - CallLink_ADMIN_APPROVAL CallLink_Restrictions = 2 -) - -// Enum value maps for CallLink_Restrictions. -var ( - CallLink_Restrictions_name = map[int32]string{ - 0: "UNKNOWN", - 1: "NONE", - 2: "ADMIN_APPROVAL", - } - CallLink_Restrictions_value = map[string]int32{ - "UNKNOWN": 0, - "NONE": 1, - "ADMIN_APPROVAL": 2, - } -) - -func (x CallLink_Restrictions) Enum() *CallLink_Restrictions { - p := new(CallLink_Restrictions) - *p = x - return p -} - -func (x CallLink_Restrictions) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CallLink_Restrictions) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[15].Descriptor() -} - -func (CallLink_Restrictions) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[15] -} - -func (x CallLink_Restrictions) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CallLink_Restrictions.Descriptor instead. -func (CallLink_Restrictions) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{9, 0} -} - -type AdHocCall_State int32 - -const ( - AdHocCall_UNKNOWN_STATE AdHocCall_State = 0 // Interpret as "Generic" - AdHocCall_GENERIC AdHocCall_State = 1 -) - -// Enum value maps for AdHocCall_State. -var ( - AdHocCall_State_name = map[int32]string{ - 0: "UNKNOWN_STATE", - 1: "GENERIC", - } - AdHocCall_State_value = map[string]int32{ - "UNKNOWN_STATE": 0, - "GENERIC": 1, - } -) - -func (x AdHocCall_State) Enum() *AdHocCall_State { - p := new(AdHocCall_State) - *p = x - return p -} - -func (x AdHocCall_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AdHocCall_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[16].Descriptor() -} - -func (AdHocCall_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[16] -} - -func (x AdHocCall_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AdHocCall_State.Descriptor instead. -func (AdHocCall_State) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{10, 0} -} - -type DistributionList_PrivacyMode int32 - -const ( - DistributionList_UNKNOWN DistributionList_PrivacyMode = 0 // Interpret as "Only with" - DistributionList_ONLY_WITH DistributionList_PrivacyMode = 1 - DistributionList_ALL_EXCEPT DistributionList_PrivacyMode = 2 - DistributionList_ALL DistributionList_PrivacyMode = 3 -) - -// Enum value maps for DistributionList_PrivacyMode. -var ( - DistributionList_PrivacyMode_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ONLY_WITH", - 2: "ALL_EXCEPT", - 3: "ALL", - } - DistributionList_PrivacyMode_value = map[string]int32{ - "UNKNOWN": 0, - "ONLY_WITH": 1, - "ALL_EXCEPT": 2, - "ALL": 3, - } -) - -func (x DistributionList_PrivacyMode) Enum() *DistributionList_PrivacyMode { - p := new(DistributionList_PrivacyMode) - *p = x - return p -} - -func (x DistributionList_PrivacyMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DistributionList_PrivacyMode) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[17].Descriptor() -} - -func (DistributionList_PrivacyMode) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[17] -} - -func (x DistributionList_PrivacyMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DistributionList_PrivacyMode.Descriptor instead. -func (DistributionList_PrivacyMode) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{12, 0} -} - -type SendStatus_Failed_FailureReason int32 - -const ( - SendStatus_Failed_UNKNOWN SendStatus_Failed_FailureReason = 0 // A valid value -- could indicate a crash or lack of information - SendStatus_Failed_NETWORK SendStatus_Failed_FailureReason = 1 - SendStatus_Failed_IDENTITY_KEY_MISMATCH SendStatus_Failed_FailureReason = 2 -) - -// Enum value maps for SendStatus_Failed_FailureReason. -var ( - SendStatus_Failed_FailureReason_name = map[int32]string{ - 0: "UNKNOWN", - 1: "NETWORK", - 2: "IDENTITY_KEY_MISMATCH", - } - SendStatus_Failed_FailureReason_value = map[string]int32{ - "UNKNOWN": 0, - "NETWORK": 1, - "IDENTITY_KEY_MISMATCH": 2, - } -) - -func (x SendStatus_Failed_FailureReason) Enum() *SendStatus_Failed_FailureReason { - p := new(SendStatus_Failed_FailureReason) - *p = x - return p -} - -func (x SendStatus_Failed_FailureReason) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SendStatus_Failed_FailureReason) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[18].Descriptor() -} - -func (SendStatus_Failed_FailureReason) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[18] -} - -func (x SendStatus_Failed_FailureReason) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SendStatus_Failed_FailureReason.Descriptor instead. -func (SendStatus_Failed_FailureReason) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 6, 0} -} - -type PaymentNotification_TransactionDetails_FailedTransaction_FailureReason int32 - -const ( - PaymentNotification_TransactionDetails_FailedTransaction_GENERIC PaymentNotification_TransactionDetails_FailedTransaction_FailureReason = 0 // A valid value -- reason unknown - PaymentNotification_TransactionDetails_FailedTransaction_NETWORK PaymentNotification_TransactionDetails_FailedTransaction_FailureReason = 1 - PaymentNotification_TransactionDetails_FailedTransaction_INSUFFICIENT_FUNDS PaymentNotification_TransactionDetails_FailedTransaction_FailureReason = 2 -) - -// Enum value maps for PaymentNotification_TransactionDetails_FailedTransaction_FailureReason. -var ( - PaymentNotification_TransactionDetails_FailedTransaction_FailureReason_name = map[int32]string{ - 0: "GENERIC", - 1: "NETWORK", - 2: "INSUFFICIENT_FUNDS", - } - PaymentNotification_TransactionDetails_FailedTransaction_FailureReason_value = map[string]int32{ - "GENERIC": 0, - "NETWORK": 1, - "INSUFFICIENT_FUNDS": 2, - } -) - -func (x PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) Enum() *PaymentNotification_TransactionDetails_FailedTransaction_FailureReason { - p := new(PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) - *p = x - return p -} - -func (x PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[19].Descriptor() -} - -func (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[19] -} - -func (x PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PaymentNotification_TransactionDetails_FailedTransaction_FailureReason.Descriptor instead. -func (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{19, 0, 1, 0} -} - -type PaymentNotification_TransactionDetails_Transaction_Status int32 - -const ( - PaymentNotification_TransactionDetails_Transaction_INITIAL PaymentNotification_TransactionDetails_Transaction_Status = 0 // A valid value -- state unconfirmed - PaymentNotification_TransactionDetails_Transaction_SUBMITTED PaymentNotification_TransactionDetails_Transaction_Status = 1 - PaymentNotification_TransactionDetails_Transaction_SUCCESSFUL PaymentNotification_TransactionDetails_Transaction_Status = 2 -) - -// Enum value maps for PaymentNotification_TransactionDetails_Transaction_Status. -var ( - PaymentNotification_TransactionDetails_Transaction_Status_name = map[int32]string{ - 0: "INITIAL", - 1: "SUBMITTED", - 2: "SUCCESSFUL", - } - PaymentNotification_TransactionDetails_Transaction_Status_value = map[string]int32{ - "INITIAL": 0, - "SUBMITTED": 1, - "SUCCESSFUL": 2, - } -) - -func (x PaymentNotification_TransactionDetails_Transaction_Status) Enum() *PaymentNotification_TransactionDetails_Transaction_Status { - p := new(PaymentNotification_TransactionDetails_Transaction_Status) - *p = x - return p -} - -func (x PaymentNotification_TransactionDetails_Transaction_Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PaymentNotification_TransactionDetails_Transaction_Status) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[20].Descriptor() -} - -func (PaymentNotification_TransactionDetails_Transaction_Status) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[20] -} - -func (x PaymentNotification_TransactionDetails_Transaction_Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PaymentNotification_TransactionDetails_Transaction_Status.Descriptor instead. -func (PaymentNotification_TransactionDetails_Transaction_Status) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{19, 0, 2, 0} -} - -type GiftBadge_State int32 - -const ( - GiftBadge_UNOPENED GiftBadge_State = 0 // A valid state - GiftBadge_OPENED GiftBadge_State = 1 - GiftBadge_REDEEMED GiftBadge_State = 2 - GiftBadge_FAILED GiftBadge_State = 3 -) - -// Enum value maps for GiftBadge_State. -var ( - GiftBadge_State_name = map[int32]string{ - 0: "UNOPENED", - 1: "OPENED", - 2: "REDEEMED", - 3: "FAILED", - } - GiftBadge_State_value = map[string]int32{ - "UNOPENED": 0, - "OPENED": 1, - "REDEEMED": 2, - "FAILED": 3, - } -) - -func (x GiftBadge_State) Enum() *GiftBadge_State { - p := new(GiftBadge_State) - *p = x - return p -} - -func (x GiftBadge_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GiftBadge_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[21].Descriptor() -} - -func (GiftBadge_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[21] -} - -func (x GiftBadge_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GiftBadge_State.Descriptor instead. -func (GiftBadge_State) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{20, 0} -} - -type ContactAttachment_Phone_Type int32 - -const ( - ContactAttachment_Phone_UNKNOWN ContactAttachment_Phone_Type = 0 // Interpret as "Home" - ContactAttachment_Phone_HOME ContactAttachment_Phone_Type = 1 - ContactAttachment_Phone_MOBILE ContactAttachment_Phone_Type = 2 - ContactAttachment_Phone_WORK ContactAttachment_Phone_Type = 3 - ContactAttachment_Phone_CUSTOM ContactAttachment_Phone_Type = 4 -) - -// Enum value maps for ContactAttachment_Phone_Type. -var ( - ContactAttachment_Phone_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "HOME", - 2: "MOBILE", - 3: "WORK", - 4: "CUSTOM", - } - ContactAttachment_Phone_Type_value = map[string]int32{ - "UNKNOWN": 0, - "HOME": 1, - "MOBILE": 2, - "WORK": 3, - "CUSTOM": 4, - } -) - -func (x ContactAttachment_Phone_Type) Enum() *ContactAttachment_Phone_Type { - p := new(ContactAttachment_Phone_Type) - *p = x - return p -} - -func (x ContactAttachment_Phone_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ContactAttachment_Phone_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[22].Descriptor() -} - -func (ContactAttachment_Phone_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[22] -} - -func (x ContactAttachment_Phone_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ContactAttachment_Phone_Type.Descriptor instead. -func (ContactAttachment_Phone_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22, 1, 0} -} - -type ContactAttachment_Email_Type int32 - -const ( - ContactAttachment_Email_UNKNOWN ContactAttachment_Email_Type = 0 // Intepret as "Home" - ContactAttachment_Email_HOME ContactAttachment_Email_Type = 1 - ContactAttachment_Email_MOBILE ContactAttachment_Email_Type = 2 - ContactAttachment_Email_WORK ContactAttachment_Email_Type = 3 - ContactAttachment_Email_CUSTOM ContactAttachment_Email_Type = 4 -) - -// Enum value maps for ContactAttachment_Email_Type. -var ( - ContactAttachment_Email_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "HOME", - 2: "MOBILE", - 3: "WORK", - 4: "CUSTOM", - } - ContactAttachment_Email_Type_value = map[string]int32{ - "UNKNOWN": 0, - "HOME": 1, - "MOBILE": 2, - "WORK": 3, - "CUSTOM": 4, - } -) - -func (x ContactAttachment_Email_Type) Enum() *ContactAttachment_Email_Type { - p := new(ContactAttachment_Email_Type) - *p = x - return p -} - -func (x ContactAttachment_Email_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ContactAttachment_Email_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[23].Descriptor() -} - -func (ContactAttachment_Email_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[23] -} - -func (x ContactAttachment_Email_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ContactAttachment_Email_Type.Descriptor instead. -func (ContactAttachment_Email_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22, 2, 0} -} - -type ContactAttachment_PostalAddress_Type int32 - -const ( - ContactAttachment_PostalAddress_UNKNOWN ContactAttachment_PostalAddress_Type = 0 // Interpret as "Home" - ContactAttachment_PostalAddress_HOME ContactAttachment_PostalAddress_Type = 1 - ContactAttachment_PostalAddress_WORK ContactAttachment_PostalAddress_Type = 2 - ContactAttachment_PostalAddress_CUSTOM ContactAttachment_PostalAddress_Type = 3 -) - -// Enum value maps for ContactAttachment_PostalAddress_Type. -var ( - ContactAttachment_PostalAddress_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "HOME", - 2: "WORK", - 3: "CUSTOM", - } - ContactAttachment_PostalAddress_Type_value = map[string]int32{ - "UNKNOWN": 0, - "HOME": 1, - "WORK": 2, - "CUSTOM": 3, - } -) - -func (x ContactAttachment_PostalAddress_Type) Enum() *ContactAttachment_PostalAddress_Type { - p := new(ContactAttachment_PostalAddress_Type) - *p = x - return p -} - -func (x ContactAttachment_PostalAddress_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ContactAttachment_PostalAddress_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[24].Descriptor() -} - -func (ContactAttachment_PostalAddress_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[24] -} - -func (x ContactAttachment_PostalAddress_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ContactAttachment_PostalAddress_Type.Descriptor instead. -func (ContactAttachment_PostalAddress_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22, 3, 0} -} - -// Similar to SignalService.AttachmentPointer.Flags, -// but explicitly mutually exclusive. Note the different raw values -// (non-zero starting values are not supported in proto3.) -type MessageAttachment_Flag int32 - -const ( - MessageAttachment_NONE MessageAttachment_Flag = 0 // A valid value -- no flag applied - MessageAttachment_VOICE_MESSAGE MessageAttachment_Flag = 1 - MessageAttachment_BORDERLESS MessageAttachment_Flag = 2 - MessageAttachment_GIF MessageAttachment_Flag = 3 -) - -// Enum value maps for MessageAttachment_Flag. -var ( - MessageAttachment_Flag_name = map[int32]string{ - 0: "NONE", - 1: "VOICE_MESSAGE", - 2: "BORDERLESS", - 3: "GIF", - } - MessageAttachment_Flag_value = map[string]int32{ - "NONE": 0, - "VOICE_MESSAGE": 1, - "BORDERLESS": 2, - "GIF": 3, - } -) - -func (x MessageAttachment_Flag) Enum() *MessageAttachment_Flag { - p := new(MessageAttachment_Flag) - *p = x - return p -} - -func (x MessageAttachment_Flag) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MessageAttachment_Flag) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[25].Descriptor() -} - -func (MessageAttachment_Flag) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[25] -} - -func (x MessageAttachment_Flag) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MessageAttachment_Flag.Descriptor instead. -func (MessageAttachment_Flag) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{27, 0} -} - -type Quote_Type int32 - -const ( - Quote_UNKNOWN Quote_Type = 0 // Interpret as "Normal" - 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. -var ( - Quote_Type_name = map[int32]string{ - 0: "UNKNOWN", - 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, - } -) - -func (x Quote_Type) Enum() *Quote_Type { - p := new(Quote_Type) - *p = x - return p -} - -func (x Quote_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Quote_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[26].Descriptor() -} - -func (Quote_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[26] -} - -func (x Quote_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Quote_Type.Descriptor instead. -func (Quote_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{29, 0} -} - -type BodyRange_Style int32 - -const ( - BodyRange_NONE BodyRange_Style = 0 // Importers should ignore the body range without throwing an error. - BodyRange_BOLD BodyRange_Style = 1 - BodyRange_ITALIC BodyRange_Style = 2 - BodyRange_SPOILER BodyRange_Style = 3 - BodyRange_STRIKETHROUGH BodyRange_Style = 4 - BodyRange_MONOSPACE BodyRange_Style = 5 -) - -// Enum value maps for BodyRange_Style. -var ( - BodyRange_Style_name = map[int32]string{ - 0: "NONE", - 1: "BOLD", - 2: "ITALIC", - 3: "SPOILER", - 4: "STRIKETHROUGH", - 5: "MONOSPACE", - } - BodyRange_Style_value = map[string]int32{ - "NONE": 0, - "BOLD": 1, - "ITALIC": 2, - "SPOILER": 3, - "STRIKETHROUGH": 4, - "MONOSPACE": 5, - } -) - -func (x BodyRange_Style) Enum() *BodyRange_Style { - p := new(BodyRange_Style) - *p = x - return p -} - -func (x BodyRange_Style) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BodyRange_Style) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[27].Descriptor() -} - -func (BodyRange_Style) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[27] -} - -func (x BodyRange_Style) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BodyRange_Style.Descriptor instead. -func (BodyRange_Style) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{30, 0} -} - -type IndividualCall_Type int32 - -const ( - IndividualCall_UNKNOWN_TYPE IndividualCall_Type = 0 // Interpret as "Audio call" - IndividualCall_AUDIO_CALL IndividualCall_Type = 1 - IndividualCall_VIDEO_CALL IndividualCall_Type = 2 -) - -// Enum value maps for IndividualCall_Type. -var ( - IndividualCall_Type_name = map[int32]string{ - 0: "UNKNOWN_TYPE", - 1: "AUDIO_CALL", - 2: "VIDEO_CALL", - } - IndividualCall_Type_value = map[string]int32{ - "UNKNOWN_TYPE": 0, - "AUDIO_CALL": 1, - "VIDEO_CALL": 2, - } -) - -func (x IndividualCall_Type) Enum() *IndividualCall_Type { - p := new(IndividualCall_Type) - *p = x - return p -} - -func (x IndividualCall_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IndividualCall_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[28].Descriptor() -} - -func (IndividualCall_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[28] -} - -func (x IndividualCall_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IndividualCall_Type.Descriptor instead. -func (IndividualCall_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35, 0} -} - -type IndividualCall_Direction int32 - -const ( - IndividualCall_UNKNOWN_DIRECTION IndividualCall_Direction = 0 // Interpret as "Incoming" - IndividualCall_INCOMING IndividualCall_Direction = 1 - IndividualCall_OUTGOING IndividualCall_Direction = 2 -) - -// Enum value maps for IndividualCall_Direction. -var ( - IndividualCall_Direction_name = map[int32]string{ - 0: "UNKNOWN_DIRECTION", - 1: "INCOMING", - 2: "OUTGOING", - } - IndividualCall_Direction_value = map[string]int32{ - "UNKNOWN_DIRECTION": 0, - "INCOMING": 1, - "OUTGOING": 2, - } -) - -func (x IndividualCall_Direction) Enum() *IndividualCall_Direction { - p := new(IndividualCall_Direction) - *p = x - return p -} - -func (x IndividualCall_Direction) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IndividualCall_Direction) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[29].Descriptor() -} - -func (IndividualCall_Direction) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[29] -} - -func (x IndividualCall_Direction) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IndividualCall_Direction.Descriptor instead. -func (IndividualCall_Direction) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35, 1} -} - -type IndividualCall_State int32 - -const ( - IndividualCall_UNKNOWN_STATE IndividualCall_State = 0 // Interpret as "Accepted" - IndividualCall_ACCEPTED IndividualCall_State = 1 - IndividualCall_NOT_ACCEPTED IndividualCall_State = 2 - // An incoming call that is no longer ongoing, which we neither accepted - // not actively declined. For example, it expired, was canceled by the - // sender, or was rejected due to being in another call. - IndividualCall_MISSED IndividualCall_State = 3 - // We auto-declined an incoming call due to a notification profile. - IndividualCall_MISSED_NOTIFICATION_PROFILE IndividualCall_State = 4 -) - -// Enum value maps for IndividualCall_State. -var ( - IndividualCall_State_name = map[int32]string{ - 0: "UNKNOWN_STATE", - 1: "ACCEPTED", - 2: "NOT_ACCEPTED", - 3: "MISSED", - 4: "MISSED_NOTIFICATION_PROFILE", - } - IndividualCall_State_value = map[string]int32{ - "UNKNOWN_STATE": 0, - "ACCEPTED": 1, - "NOT_ACCEPTED": 2, - "MISSED": 3, - "MISSED_NOTIFICATION_PROFILE": 4, - } -) - -func (x IndividualCall_State) Enum() *IndividualCall_State { - p := new(IndividualCall_State) - *p = x - return p -} - -func (x IndividualCall_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IndividualCall_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[30].Descriptor() -} - -func (IndividualCall_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[30] -} - -func (x IndividualCall_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IndividualCall_State.Descriptor instead. -func (IndividualCall_State) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35, 2} -} - -type GroupCall_State int32 - -const ( - GroupCall_UNKNOWN_STATE GroupCall_State = 0 // Interpret as "Generic" - // A group call was started without ringing. - GroupCall_GENERIC GroupCall_State = 1 - // We joined a group call that was started without ringing. - GroupCall_JOINED GroupCall_State = 2 - // An incoming group call is actively ringing. - GroupCall_RINGING GroupCall_State = 3 - // We accepted an incoming group ring. - GroupCall_ACCEPTED GroupCall_State = 4 - // We declined an incoming group ring. - GroupCall_DECLINED GroupCall_State = 5 - // We missed an incoming group ring, for example because it expired. - GroupCall_MISSED GroupCall_State = 6 - // We auto-declined an incoming group ring due to a notification profile. - GroupCall_MISSED_NOTIFICATION_PROFILE GroupCall_State = 7 - // An outgoing ring was started. We don't track any state for outgoing rings - // beyond that they started. - GroupCall_OUTGOING_RING GroupCall_State = 8 -) - -// Enum value maps for GroupCall_State. -var ( - GroupCall_State_name = map[int32]string{ - 0: "UNKNOWN_STATE", - 1: "GENERIC", - 2: "JOINED", - 3: "RINGING", - 4: "ACCEPTED", - 5: "DECLINED", - 6: "MISSED", - 7: "MISSED_NOTIFICATION_PROFILE", - 8: "OUTGOING_RING", - } - GroupCall_State_value = map[string]int32{ - "UNKNOWN_STATE": 0, - "GENERIC": 1, - "JOINED": 2, - "RINGING": 3, - "ACCEPTED": 4, - "DECLINED": 5, - "MISSED": 6, - "MISSED_NOTIFICATION_PROFILE": 7, - "OUTGOING_RING": 8, - } -) - -func (x GroupCall_State) Enum() *GroupCall_State { - p := new(GroupCall_State) - *p = x - return p -} - -func (x GroupCall_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GroupCall_State) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[31].Descriptor() -} - -func (GroupCall_State) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[31] -} - -func (x GroupCall_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GroupCall_State.Descriptor instead. -func (GroupCall_State) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{36, 0} -} - -type SimpleChatUpdate_Type int32 - -const ( - SimpleChatUpdate_UNKNOWN SimpleChatUpdate_Type = 0 // Importers should skip the update without throwing an error. - SimpleChatUpdate_JOINED_SIGNAL SimpleChatUpdate_Type = 1 - SimpleChatUpdate_IDENTITY_UPDATE SimpleChatUpdate_Type = 2 - SimpleChatUpdate_IDENTITY_VERIFIED SimpleChatUpdate_Type = 3 - SimpleChatUpdate_IDENTITY_DEFAULT SimpleChatUpdate_Type = 4 // marking as unverified - SimpleChatUpdate_CHANGE_NUMBER SimpleChatUpdate_Type = 5 - SimpleChatUpdate_RELEASE_CHANNEL_DONATION_REQUEST SimpleChatUpdate_Type = 6 - SimpleChatUpdate_END_SESSION SimpleChatUpdate_Type = 7 - SimpleChatUpdate_CHAT_SESSION_REFRESH SimpleChatUpdate_Type = 8 - SimpleChatUpdate_BAD_DECRYPT SimpleChatUpdate_Type = 9 - SimpleChatUpdate_PAYMENTS_ACTIVATED SimpleChatUpdate_Type = 10 - SimpleChatUpdate_PAYMENT_ACTIVATION_REQUEST SimpleChatUpdate_Type = 11 - SimpleChatUpdate_UNSUPPORTED_PROTOCOL_MESSAGE SimpleChatUpdate_Type = 12 - SimpleChatUpdate_REPORTED_SPAM SimpleChatUpdate_Type = 13 - SimpleChatUpdate_BLOCKED SimpleChatUpdate_Type = 14 - SimpleChatUpdate_UNBLOCKED SimpleChatUpdate_Type = 15 - SimpleChatUpdate_MESSAGE_REQUEST_ACCEPTED SimpleChatUpdate_Type = 16 -) - -// Enum value maps for SimpleChatUpdate_Type. -var ( - SimpleChatUpdate_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "JOINED_SIGNAL", - 2: "IDENTITY_UPDATE", - 3: "IDENTITY_VERIFIED", - 4: "IDENTITY_DEFAULT", - 5: "CHANGE_NUMBER", - 6: "RELEASE_CHANNEL_DONATION_REQUEST", - 7: "END_SESSION", - 8: "CHAT_SESSION_REFRESH", - 9: "BAD_DECRYPT", - 10: "PAYMENTS_ACTIVATED", - 11: "PAYMENT_ACTIVATION_REQUEST", - 12: "UNSUPPORTED_PROTOCOL_MESSAGE", - 13: "REPORTED_SPAM", - 14: "BLOCKED", - 15: "UNBLOCKED", - 16: "MESSAGE_REQUEST_ACCEPTED", - } - SimpleChatUpdate_Type_value = map[string]int32{ - "UNKNOWN": 0, - "JOINED_SIGNAL": 1, - "IDENTITY_UPDATE": 2, - "IDENTITY_VERIFIED": 3, - "IDENTITY_DEFAULT": 4, - "CHANGE_NUMBER": 5, - "RELEASE_CHANNEL_DONATION_REQUEST": 6, - "END_SESSION": 7, - "CHAT_SESSION_REFRESH": 8, - "BAD_DECRYPT": 9, - "PAYMENTS_ACTIVATED": 10, - "PAYMENT_ACTIVATION_REQUEST": 11, - "UNSUPPORTED_PROTOCOL_MESSAGE": 12, - "REPORTED_SPAM": 13, - "BLOCKED": 14, - "UNBLOCKED": 15, - "MESSAGE_REQUEST_ACCEPTED": 16, - } -) - -func (x SimpleChatUpdate_Type) Enum() *SimpleChatUpdate_Type { - p := new(SimpleChatUpdate_Type) - *p = x - return p -} - -func (x SimpleChatUpdate_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SimpleChatUpdate_Type) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[32].Descriptor() -} - -func (SimpleChatUpdate_Type) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[32] -} - -func (x SimpleChatUpdate_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SimpleChatUpdate_Type.Descriptor instead. -func (SimpleChatUpdate_Type) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{37, 0} -} - -type ChatStyle_WallpaperPreset int32 - -const ( - ChatStyle_UNKNOWN_WALLPAPER_PRESET ChatStyle_WallpaperPreset = 0 // Interpret as the wallpaper being unset - ChatStyle_SOLID_BLUSH ChatStyle_WallpaperPreset = 1 - ChatStyle_SOLID_COPPER ChatStyle_WallpaperPreset = 2 - ChatStyle_SOLID_DUST ChatStyle_WallpaperPreset = 3 - ChatStyle_SOLID_CELADON ChatStyle_WallpaperPreset = 4 - ChatStyle_SOLID_RAINFOREST ChatStyle_WallpaperPreset = 5 - ChatStyle_SOLID_PACIFIC ChatStyle_WallpaperPreset = 6 - ChatStyle_SOLID_FROST ChatStyle_WallpaperPreset = 7 - ChatStyle_SOLID_NAVY ChatStyle_WallpaperPreset = 8 - ChatStyle_SOLID_LILAC ChatStyle_WallpaperPreset = 9 - ChatStyle_SOLID_PINK ChatStyle_WallpaperPreset = 10 - ChatStyle_SOLID_EGGPLANT ChatStyle_WallpaperPreset = 11 - ChatStyle_SOLID_SILVER ChatStyle_WallpaperPreset = 12 - ChatStyle_GRADIENT_SUNSET ChatStyle_WallpaperPreset = 13 - ChatStyle_GRADIENT_NOIR ChatStyle_WallpaperPreset = 14 - ChatStyle_GRADIENT_HEATMAP ChatStyle_WallpaperPreset = 15 - ChatStyle_GRADIENT_AQUA ChatStyle_WallpaperPreset = 16 - ChatStyle_GRADIENT_IRIDESCENT ChatStyle_WallpaperPreset = 17 - ChatStyle_GRADIENT_MONSTERA ChatStyle_WallpaperPreset = 18 - ChatStyle_GRADIENT_BLISS ChatStyle_WallpaperPreset = 19 - ChatStyle_GRADIENT_SKY ChatStyle_WallpaperPreset = 20 - ChatStyle_GRADIENT_PEACH ChatStyle_WallpaperPreset = 21 -) - -// Enum value maps for ChatStyle_WallpaperPreset. -var ( - ChatStyle_WallpaperPreset_name = map[int32]string{ - 0: "UNKNOWN_WALLPAPER_PRESET", - 1: "SOLID_BLUSH", - 2: "SOLID_COPPER", - 3: "SOLID_DUST", - 4: "SOLID_CELADON", - 5: "SOLID_RAINFOREST", - 6: "SOLID_PACIFIC", - 7: "SOLID_FROST", - 8: "SOLID_NAVY", - 9: "SOLID_LILAC", - 10: "SOLID_PINK", - 11: "SOLID_EGGPLANT", - 12: "SOLID_SILVER", - 13: "GRADIENT_SUNSET", - 14: "GRADIENT_NOIR", - 15: "GRADIENT_HEATMAP", - 16: "GRADIENT_AQUA", - 17: "GRADIENT_IRIDESCENT", - 18: "GRADIENT_MONSTERA", - 19: "GRADIENT_BLISS", - 20: "GRADIENT_SKY", - 21: "GRADIENT_PEACH", - } - ChatStyle_WallpaperPreset_value = map[string]int32{ - "UNKNOWN_WALLPAPER_PRESET": 0, - "SOLID_BLUSH": 1, - "SOLID_COPPER": 2, - "SOLID_DUST": 3, - "SOLID_CELADON": 4, - "SOLID_RAINFOREST": 5, - "SOLID_PACIFIC": 6, - "SOLID_FROST": 7, - "SOLID_NAVY": 8, - "SOLID_LILAC": 9, - "SOLID_PINK": 10, - "SOLID_EGGPLANT": 11, - "SOLID_SILVER": 12, - "GRADIENT_SUNSET": 13, - "GRADIENT_NOIR": 14, - "GRADIENT_HEATMAP": 15, - "GRADIENT_AQUA": 16, - "GRADIENT_IRIDESCENT": 17, - "GRADIENT_MONSTERA": 18, - "GRADIENT_BLISS": 19, - "GRADIENT_SKY": 20, - "GRADIENT_PEACH": 21, - } -) - -func (x ChatStyle_WallpaperPreset) Enum() *ChatStyle_WallpaperPreset { - p := new(ChatStyle_WallpaperPreset) - *p = x - return p -} - -func (x ChatStyle_WallpaperPreset) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ChatStyle_WallpaperPreset) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[33].Descriptor() -} - -func (ChatStyle_WallpaperPreset) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[33] -} - -func (x ChatStyle_WallpaperPreset) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ChatStyle_WallpaperPreset.Descriptor instead. -func (ChatStyle_WallpaperPreset) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 0} -} - -type ChatStyle_BubbleColorPreset int32 - -const ( - ChatStyle_UNKNOWN_BUBBLE_COLOR_PRESET ChatStyle_BubbleColorPreset = 0 // Interpret as the user's default chat bubble color - ChatStyle_SOLID_ULTRAMARINE ChatStyle_BubbleColorPreset = 1 - ChatStyle_SOLID_CRIMSON ChatStyle_BubbleColorPreset = 2 - ChatStyle_SOLID_VERMILION ChatStyle_BubbleColorPreset = 3 - ChatStyle_SOLID_BURLAP ChatStyle_BubbleColorPreset = 4 - ChatStyle_SOLID_FOREST ChatStyle_BubbleColorPreset = 5 - ChatStyle_SOLID_WINTERGREEN ChatStyle_BubbleColorPreset = 6 - ChatStyle_SOLID_TEAL ChatStyle_BubbleColorPreset = 7 - ChatStyle_SOLID_BLUE ChatStyle_BubbleColorPreset = 8 - ChatStyle_SOLID_INDIGO ChatStyle_BubbleColorPreset = 9 - ChatStyle_SOLID_VIOLET ChatStyle_BubbleColorPreset = 10 - ChatStyle_SOLID_PLUM ChatStyle_BubbleColorPreset = 11 - ChatStyle_SOLID_TAUPE ChatStyle_BubbleColorPreset = 12 - ChatStyle_SOLID_STEEL ChatStyle_BubbleColorPreset = 13 - ChatStyle_GRADIENT_EMBER ChatStyle_BubbleColorPreset = 14 - ChatStyle_GRADIENT_MIDNIGHT ChatStyle_BubbleColorPreset = 15 - ChatStyle_GRADIENT_INFRARED ChatStyle_BubbleColorPreset = 16 - ChatStyle_GRADIENT_LAGOON ChatStyle_BubbleColorPreset = 17 - ChatStyle_GRADIENT_FLUORESCENT ChatStyle_BubbleColorPreset = 18 - ChatStyle_GRADIENT_BASIL ChatStyle_BubbleColorPreset = 19 - ChatStyle_GRADIENT_SUBLIME ChatStyle_BubbleColorPreset = 20 - ChatStyle_GRADIENT_SEA ChatStyle_BubbleColorPreset = 21 - ChatStyle_GRADIENT_TANGERINE ChatStyle_BubbleColorPreset = 22 -) - -// Enum value maps for ChatStyle_BubbleColorPreset. -var ( - ChatStyle_BubbleColorPreset_name = map[int32]string{ - 0: "UNKNOWN_BUBBLE_COLOR_PRESET", - 1: "SOLID_ULTRAMARINE", - 2: "SOLID_CRIMSON", - 3: "SOLID_VERMILION", - 4: "SOLID_BURLAP", - 5: "SOLID_FOREST", - 6: "SOLID_WINTERGREEN", - 7: "SOLID_TEAL", - 8: "SOLID_BLUE", - 9: "SOLID_INDIGO", - 10: "SOLID_VIOLET", - 11: "SOLID_PLUM", - 12: "SOLID_TAUPE", - 13: "SOLID_STEEL", - 14: "GRADIENT_EMBER", - 15: "GRADIENT_MIDNIGHT", - 16: "GRADIENT_INFRARED", - 17: "GRADIENT_LAGOON", - 18: "GRADIENT_FLUORESCENT", - 19: "GRADIENT_BASIL", - 20: "GRADIENT_SUBLIME", - 21: "GRADIENT_SEA", - 22: "GRADIENT_TANGERINE", - } - ChatStyle_BubbleColorPreset_value = map[string]int32{ - "UNKNOWN_BUBBLE_COLOR_PRESET": 0, - "SOLID_ULTRAMARINE": 1, - "SOLID_CRIMSON": 2, - "SOLID_VERMILION": 3, - "SOLID_BURLAP": 4, - "SOLID_FOREST": 5, - "SOLID_WINTERGREEN": 6, - "SOLID_TEAL": 7, - "SOLID_BLUE": 8, - "SOLID_INDIGO": 9, - "SOLID_VIOLET": 10, - "SOLID_PLUM": 11, - "SOLID_TAUPE": 12, - "SOLID_STEEL": 13, - "GRADIENT_EMBER": 14, - "GRADIENT_MIDNIGHT": 15, - "GRADIENT_INFRARED": 16, - "GRADIENT_LAGOON": 17, - "GRADIENT_FLUORESCENT": 18, - "GRADIENT_BASIL": 19, - "GRADIENT_SUBLIME": 20, - "GRADIENT_SEA": 21, - "GRADIENT_TANGERINE": 22, - } -) - -func (x ChatStyle_BubbleColorPreset) Enum() *ChatStyle_BubbleColorPreset { - p := new(ChatStyle_BubbleColorPreset) - *p = x - return p -} - -func (x ChatStyle_BubbleColorPreset) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ChatStyle_BubbleColorPreset) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[34].Descriptor() -} - -func (ChatStyle_BubbleColorPreset) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[34] -} - -func (x ChatStyle_BubbleColorPreset) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ChatStyle_BubbleColorPreset.Descriptor instead. -func (ChatStyle_BubbleColorPreset) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 1} -} - -type NotificationProfile_DayOfWeek int32 - -const ( - NotificationProfile_UNKNOWN NotificationProfile_DayOfWeek = 0 // Interpret as "Monday" - NotificationProfile_MONDAY NotificationProfile_DayOfWeek = 1 - NotificationProfile_TUESDAY NotificationProfile_DayOfWeek = 2 - NotificationProfile_WEDNESDAY NotificationProfile_DayOfWeek = 3 - NotificationProfile_THURSDAY NotificationProfile_DayOfWeek = 4 - NotificationProfile_FRIDAY NotificationProfile_DayOfWeek = 5 - NotificationProfile_SATURDAY NotificationProfile_DayOfWeek = 6 - NotificationProfile_SUNDAY NotificationProfile_DayOfWeek = 7 -) - -// Enum value maps for NotificationProfile_DayOfWeek. -var ( - NotificationProfile_DayOfWeek_name = map[int32]string{ - 0: "UNKNOWN", - 1: "MONDAY", - 2: "TUESDAY", - 3: "WEDNESDAY", - 4: "THURSDAY", - 5: "FRIDAY", - 6: "SATURDAY", - 7: "SUNDAY", - } - NotificationProfile_DayOfWeek_value = map[string]int32{ - "UNKNOWN": 0, - "MONDAY": 1, - "TUESDAY": 2, - "WEDNESDAY": 3, - "THURSDAY": 4, - "FRIDAY": 5, - "SATURDAY": 6, - "SUNDAY": 7, - } -) - -func (x NotificationProfile_DayOfWeek) Enum() *NotificationProfile_DayOfWeek { - p := new(NotificationProfile_DayOfWeek) - *p = x - return p -} - -func (x NotificationProfile_DayOfWeek) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NotificationProfile_DayOfWeek) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[35].Descriptor() -} - -func (NotificationProfile_DayOfWeek) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[35] -} - -func (x NotificationProfile_DayOfWeek) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NotificationProfile_DayOfWeek.Descriptor instead. -func (NotificationProfile_DayOfWeek) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{84, 0} -} - -// Represents the default "All chats" folder record vs all other custom folders -type ChatFolder_FolderType int32 - -const ( - ChatFolder_UNKNOWN ChatFolder_FolderType = 0 // Interpret as "Custom" - ChatFolder_ALL ChatFolder_FolderType = 1 - ChatFolder_CUSTOM ChatFolder_FolderType = 2 -) - -// Enum value maps for ChatFolder_FolderType. -var ( - ChatFolder_FolderType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ALL", - 2: "CUSTOM", - } - ChatFolder_FolderType_value = map[string]int32{ - "UNKNOWN": 0, - "ALL": 1, - "CUSTOM": 2, - } -) - -func (x ChatFolder_FolderType) Enum() *ChatFolder_FolderType { - p := new(ChatFolder_FolderType) - *p = x - return p -} - -func (x ChatFolder_FolderType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ChatFolder_FolderType) Descriptor() protoreflect.EnumDescriptor { - return file_backuppb_Backup_proto_enumTypes[36].Descriptor() -} - -func (ChatFolder_FolderType) Type() protoreflect.EnumType { - return &file_backuppb_Backup_proto_enumTypes[36] -} - -func (x ChatFolder_FolderType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ChatFolder_FolderType.Descriptor instead. -func (ChatFolder_FolderType) EnumDescriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{85, 0} -} - -type BackupInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - BackupTimeMs uint64 `protobuf:"varint,2,opt,name=backupTimeMs,proto3" json:"backupTimeMs,omitempty"` - MediaRootBackupKey []byte `protobuf:"bytes,3,opt,name=mediaRootBackupKey,proto3" json:"mediaRootBackupKey,omitempty"` // 32-byte random value generated when the backup is uploaded for the first time. - CurrentAppVersion string `protobuf:"bytes,4,opt,name=currentAppVersion,proto3" json:"currentAppVersion,omitempty"` - FirstAppVersion string `protobuf:"bytes,5,opt,name=firstAppVersion,proto3" json:"firstAppVersion,omitempty"` - DebugInfo []byte `protobuf:"bytes,6,opt,name=debugInfo,proto3" json:"debugInfo,omitempty"` // Client-specific data field for debug info during testing - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupInfo) Reset() { - *x = BackupInfo{} - mi := &file_backuppb_Backup_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupInfo) ProtoMessage() {} - -func (x *BackupInfo) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[0] - 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 BackupInfo.ProtoReflect.Descriptor instead. -func (*BackupInfo) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{0} -} - -func (x *BackupInfo) GetVersion() uint64 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *BackupInfo) GetBackupTimeMs() uint64 { - if x != nil { - return x.BackupTimeMs - } - return 0 -} - -func (x *BackupInfo) GetMediaRootBackupKey() []byte { - if x != nil { - return x.MediaRootBackupKey - } - return nil -} - -func (x *BackupInfo) GetCurrentAppVersion() string { - if x != nil { - return x.CurrentAppVersion - } - return "" -} - -func (x *BackupInfo) GetFirstAppVersion() string { - if x != nil { - return x.FirstAppVersion - } - return "" -} - -func (x *BackupInfo) GetDebugInfo() []byte { - if x != nil { - return x.DebugInfo - } - return nil -} - -// Frames must follow in the following ordering rules: -// -// 1. There is exactly one AccountData and it is the first frame. -// 2. A frame referenced by ID must come before the referencing frame. -// e.g. a Recipient must come before any Chat referencing it. -// 3. All ChatItems must appear in global Chat rendering order. -// (The order in which they were received by the client.) -// 4. ChatFolders must appear in render order (e.g., left to right for -// LTR locales), but can appear anywhere relative to other frames respecting -// rule 2 (after Recipients and Chats). -// -// Recipients, Chats, StickerPacks, AdHocCalls, and NotificationProfiles -// can be in any order. (But must respect rule 2.) -// -// For example, Chats may all be together at the beginning, -// or may each immediately precede its first ChatItem. -type Frame struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If unset, importers should skip this frame without throwing an error. - // - // Types that are valid to be assigned to Item: - // - // *Frame_Account - // *Frame_Recipient - // *Frame_Chat - // *Frame_ChatItem - // *Frame_StickerPack - // *Frame_AdHocCall - // *Frame_NotificationProfile - // *Frame_ChatFolder - Item isFrame_Item `protobuf_oneof:"item"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Frame) Reset() { - *x = Frame{} - mi := &file_backuppb_Backup_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Frame) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Frame) ProtoMessage() {} - -func (x *Frame) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[1] - 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 Frame.ProtoReflect.Descriptor instead. -func (*Frame) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{1} -} - -func (x *Frame) GetItem() isFrame_Item { - if x != nil { - return x.Item - } - return nil -} - -func (x *Frame) GetAccount() *AccountData { - if x != nil { - if x, ok := x.Item.(*Frame_Account); ok { - return x.Account - } - } - return nil -} - -func (x *Frame) GetRecipient() *Recipient { - if x != nil { - if x, ok := x.Item.(*Frame_Recipient); ok { - return x.Recipient - } - } - return nil -} - -func (x *Frame) GetChat() *Chat { - if x != nil { - if x, ok := x.Item.(*Frame_Chat); ok { - return x.Chat - } - } - return nil -} - -func (x *Frame) GetChatItem() *ChatItem { - if x != nil { - if x, ok := x.Item.(*Frame_ChatItem); ok { - return x.ChatItem - } - } - return nil -} - -func (x *Frame) GetStickerPack() *StickerPack { - if x != nil { - if x, ok := x.Item.(*Frame_StickerPack); ok { - return x.StickerPack - } - } - return nil -} - -func (x *Frame) GetAdHocCall() *AdHocCall { - if x != nil { - if x, ok := x.Item.(*Frame_AdHocCall); ok { - return x.AdHocCall - } - } - return nil -} - -func (x *Frame) GetNotificationProfile() *NotificationProfile { - if x != nil { - if x, ok := x.Item.(*Frame_NotificationProfile); ok { - return x.NotificationProfile - } - } - return nil -} - -func (x *Frame) GetChatFolder() *ChatFolder { - if x != nil { - if x, ok := x.Item.(*Frame_ChatFolder); ok { - return x.ChatFolder - } - } - return nil -} - -type isFrame_Item interface { - isFrame_Item() -} - -type Frame_Account struct { - Account *AccountData `protobuf:"bytes,1,opt,name=account,proto3,oneof"` -} - -type Frame_Recipient struct { - Recipient *Recipient `protobuf:"bytes,2,opt,name=recipient,proto3,oneof"` -} - -type Frame_Chat struct { - Chat *Chat `protobuf:"bytes,3,opt,name=chat,proto3,oneof"` -} - -type Frame_ChatItem struct { - ChatItem *ChatItem `protobuf:"bytes,4,opt,name=chatItem,proto3,oneof"` -} - -type Frame_StickerPack struct { - StickerPack *StickerPack `protobuf:"bytes,5,opt,name=stickerPack,proto3,oneof"` -} - -type Frame_AdHocCall struct { - AdHocCall *AdHocCall `protobuf:"bytes,6,opt,name=adHocCall,proto3,oneof"` -} - -type Frame_NotificationProfile struct { - NotificationProfile *NotificationProfile `protobuf:"bytes,7,opt,name=notificationProfile,proto3,oneof"` -} - -type Frame_ChatFolder struct { - ChatFolder *ChatFolder `protobuf:"bytes,8,opt,name=chatFolder,proto3,oneof"` -} - -func (*Frame_Account) isFrame_Item() {} - -func (*Frame_Recipient) isFrame_Item() {} - -func (*Frame_Chat) isFrame_Item() {} - -func (*Frame_ChatItem) isFrame_Item() {} - -func (*Frame_StickerPack) isFrame_Item() {} - -func (*Frame_AdHocCall) isFrame_Item() {} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountData) Reset() { - *x = AccountData{} - mi := &file_backuppb_Backup_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountData) ProtoMessage() {} - -func (x *AccountData) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[2] - 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.ProtoReflect.Descriptor instead. -func (*AccountData) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2} -} - -func (x *AccountData) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *AccountData) GetUsername() string { - if x != nil && x.Username != nil { - return *x.Username - } - return "" -} - -func (x *AccountData) GetUsernameLink() *AccountData_UsernameLink { - if x != nil { - return x.UsernameLink - } - return nil -} - -func (x *AccountData) GetGivenName() string { - if x != nil { - return x.GivenName - } - return "" -} - -func (x *AccountData) GetFamilyName() string { - if x != nil { - return x.FamilyName - } - return "" -} - -func (x *AccountData) GetAvatarUrlPath() string { - if x != nil { - return x.AvatarUrlPath - } - return "" -} - -func (x *AccountData) GetDonationSubscriberData() *AccountData_SubscriberData { - if x != nil { - return x.DonationSubscriberData - } - return nil -} - -func (x *AccountData) GetAccountSettings() *AccountData_AccountSettings { - if x != nil { - return x.AccountSettings - } - return nil -} - -func (x *AccountData) GetBackupsSubscriberData() *AccountData_IAPSubscriberData { - if x != nil { - return x.BackupsSubscriberData - } - return nil -} - -func (x *AccountData) GetSvrPin() string { - if x != nil { - return x.SvrPin - } - 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 "" -} - -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 - // If unset, importers should skip this frame without throwing an error. - // - // Types that are valid to be assigned to Destination: - // - // *Recipient_Contact - // *Recipient_Group - // *Recipient_DistributionList - // *Recipient_Self - // *Recipient_ReleaseNotes - // *Recipient_CallLink - Destination isRecipient_Destination `protobuf_oneof:"destination"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Recipient) Reset() { - *x = Recipient{} - mi := &file_backuppb_Backup_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Recipient) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Recipient) ProtoMessage() {} - -func (x *Recipient) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[3] - 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 Recipient.ProtoReflect.Descriptor instead. -func (*Recipient) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{3} -} - -func (x *Recipient) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Recipient) GetDestination() isRecipient_Destination { - if x != nil { - return x.Destination - } - return nil -} - -func (x *Recipient) GetContact() *Contact { - if x != nil { - if x, ok := x.Destination.(*Recipient_Contact); ok { - return x.Contact - } - } - return nil -} - -func (x *Recipient) GetGroup() *Group { - if x != nil { - if x, ok := x.Destination.(*Recipient_Group); ok { - return x.Group - } - } - return nil -} - -func (x *Recipient) GetDistributionList() *DistributionListItem { - if x != nil { - if x, ok := x.Destination.(*Recipient_DistributionList); ok { - return x.DistributionList - } - } - return nil -} - -func (x *Recipient) GetSelf() *Self { - if x != nil { - if x, ok := x.Destination.(*Recipient_Self); ok { - return x.Self - } - } - return nil -} - -func (x *Recipient) GetReleaseNotes() *ReleaseNotes { - if x != nil { - if x, ok := x.Destination.(*Recipient_ReleaseNotes); ok { - return x.ReleaseNotes - } - } - return nil -} - -func (x *Recipient) GetCallLink() *CallLink { - if x != nil { - if x, ok := x.Destination.(*Recipient_CallLink); ok { - return x.CallLink - } - } - return nil -} - -type isRecipient_Destination interface { - isRecipient_Destination() -} - -type Recipient_Contact struct { - Contact *Contact `protobuf:"bytes,2,opt,name=contact,proto3,oneof"` -} - -type Recipient_Group struct { - Group *Group `protobuf:"bytes,3,opt,name=group,proto3,oneof"` -} - -type Recipient_DistributionList struct { - DistributionList *DistributionListItem `protobuf:"bytes,4,opt,name=distributionList,proto3,oneof"` -} - -type Recipient_Self struct { - Self *Self `protobuf:"bytes,5,opt,name=self,proto3,oneof"` -} - -type Recipient_ReleaseNotes struct { - ReleaseNotes *ReleaseNotes `protobuf:"bytes,6,opt,name=releaseNotes,proto3,oneof"` -} - -type Recipient_CallLink struct { - CallLink *CallLink `protobuf:"bytes,7,opt,name=callLink,proto3,oneof"` -} - -func (*Recipient_Contact) isRecipient_Destination() {} - -func (*Recipient_Group) isRecipient_Destination() {} - -func (*Recipient_DistributionList) isRecipient_Destination() {} - -func (*Recipient_Self) isRecipient_Destination() {} - -func (*Recipient_ReleaseNotes) isRecipient_Destination() {} - -func (*Recipient_CallLink) isRecipient_Destination() {} - -type Contact struct { - state protoimpl.MessageState `protogen:"open.v1"` - Aci []byte `protobuf:"bytes,1,opt,name=aci,proto3,oneof" json:"aci,omitempty"` // should be 16 bytes - Pni []byte `protobuf:"bytes,2,opt,name=pni,proto3,oneof" json:"pni,omitempty"` // should be 16 bytes - Username *string `protobuf:"bytes,3,opt,name=username,proto3,oneof" json:"username,omitempty"` - E164 *uint64 `protobuf:"varint,4,opt,name=e164,proto3,oneof" json:"e164,omitempty"` - Blocked bool `protobuf:"varint,5,opt,name=blocked,proto3" json:"blocked,omitempty"` - Visibility Contact_Visibility `protobuf:"varint,6,opt,name=visibility,proto3,enum=signal.backup.Contact_Visibility" json:"visibility,omitempty"` - // If unset, consider the user to be registered - // - // Types that are valid to be assigned to Registration: - // - // *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"` - BlockedAtTimestamp uint64 `protobuf:"varint,23,opt,name=blockedAtTimestamp,proto3" json:"blockedAtTimestamp,omitempty"` // if `blocked` is true, 0 means unknown block time - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Contact) Reset() { - *x = Contact{} - mi := &file_backuppb_Backup_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Contact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Contact) ProtoMessage() {} - -func (x *Contact) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[4] - 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 Contact.ProtoReflect.Descriptor instead. -func (*Contact) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{4} -} - -func (x *Contact) GetAci() []byte { - if x != nil { - return x.Aci - } - return nil -} - -func (x *Contact) GetPni() []byte { - if x != nil { - return x.Pni - } - return nil -} - -func (x *Contact) GetUsername() string { - if x != nil && x.Username != nil { - return *x.Username - } - return "" -} - -func (x *Contact) GetE164() uint64 { - if x != nil && x.E164 != nil { - return *x.E164 - } - return 0 -} - -func (x *Contact) GetBlocked() bool { - if x != nil { - return x.Blocked - } - return false -} - -func (x *Contact) GetVisibility() Contact_Visibility { - if x != nil { - return x.Visibility - } - return Contact_VISIBLE -} - -func (x *Contact) GetRegistration() isContact_Registration { - if x != nil { - return x.Registration - } - return nil -} - -func (x *Contact) GetRegistered() *Contact_Registered { - if x != nil { - if x, ok := x.Registration.(*Contact_Registered_); ok { - return x.Registered - } - } - return nil -} - -func (x *Contact) GetNotRegistered() *Contact_NotRegistered { - if x != nil { - if x, ok := x.Registration.(*Contact_NotRegistered_); ok { - return x.NotRegistered - } - } - return nil -} - -func (x *Contact) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *Contact) GetProfileSharing() bool { - if x != nil { - return x.ProfileSharing - } - return false -} - -func (x *Contact) GetProfileGivenName() string { - if x != nil && x.ProfileGivenName != nil { - return *x.ProfileGivenName - } - return "" -} - -func (x *Contact) GetProfileFamilyName() string { - if x != nil && x.ProfileFamilyName != nil { - return *x.ProfileFamilyName - } - return "" -} - -func (x *Contact) GetHideStory() bool { - if x != nil { - return x.HideStory - } - return false -} - -func (x *Contact) GetIdentityKey() []byte { - if x != nil { - return x.IdentityKey - } - return nil -} - -func (x *Contact) GetIdentityState() Contact_IdentityState { - if x != nil { - return x.IdentityState - } - return Contact_DEFAULT -} - -func (x *Contact) GetNickname() *Contact_Name { - if x != nil { - return x.Nickname - } - return nil -} - -func (x *Contact) GetNote() string { - if x != nil { - return x.Note - } - return "" -} - -func (x *Contact) GetSystemGivenName() string { - if x != nil { - return x.SystemGivenName - } - return "" -} - -func (x *Contact) GetSystemFamilyName() string { - if x != nil { - return x.SystemFamilyName - } - return "" -} - -func (x *Contact) GetSystemNickname() string { - if x != nil { - return x.SystemNickname - } - return "" -} - -func (x *Contact) GetAvatarColor() AvatarColor { - if x != nil && x.AvatarColor != nil { - return *x.AvatarColor - } - return AvatarColor_A100 -} - -func (x *Contact) GetKeyTransparencyData() []byte { - if x != nil { - return x.KeyTransparencyData - } - return nil -} - -func (x *Contact) GetBlockedAtTimestamp() uint64 { - if x != nil { - return x.BlockedAtTimestamp - } - return 0 -} - -type isContact_Registration interface { - isContact_Registration() -} - -type Contact_Registered_ struct { - Registered *Contact_Registered `protobuf:"bytes,7,opt,name=registered,proto3,oneof"` -} - -type Contact_NotRegistered_ struct { - NotRegistered *Contact_NotRegistered `protobuf:"bytes,8,opt,name=notRegistered,proto3,oneof"` -} - -func (*Contact_Registered_) isContact_Registration() {} - -func (*Contact_NotRegistered_) isContact_Registration() {} - -type Group struct { - state protoimpl.MessageState `protogen:"open.v1"` - MasterKey []byte `protobuf:"bytes,1,opt,name=masterKey,proto3" json:"masterKey,omitempty"` - Whitelisted bool `protobuf:"varint,2,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"` - HideStory bool `protobuf:"varint,3,opt,name=hideStory,proto3" json:"hideStory,omitempty"` - StorySendMode Group_StorySendMode `protobuf:"varint,4,opt,name=storySendMode,proto3,enum=signal.backup.Group_StorySendMode" json:"storySendMode,omitempty"` - Snapshot *Group_GroupSnapshot `protobuf:"bytes,5,opt,name=snapshot,proto3" json:"snapshot,omitempty"` - Blocked bool `protobuf:"varint,6,opt,name=blocked,proto3" json:"blocked,omitempty"` - AvatarColor *AvatarColor `protobuf:"varint,7,opt,name=avatarColor,proto3,enum=signal.backup.AvatarColor,oneof" json:"avatarColor,omitempty"` - BlockedAtTimestamp uint64 `protobuf:"varint,8,opt,name=blockedAtTimestamp,proto3" json:"blockedAtTimestamp,omitempty"` // if `blocked` is true, 0 means unknown block time - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Group) Reset() { - *x = Group{} - mi := &file_backuppb_Backup_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group) ProtoMessage() {} - -func (x *Group) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[5] - 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 Group.ProtoReflect.Descriptor instead. -func (*Group) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5} -} - -func (x *Group) GetMasterKey() []byte { - if x != nil { - return x.MasterKey - } - return nil -} - -func (x *Group) GetWhitelisted() bool { - if x != nil { - return x.Whitelisted - } - return false -} - -func (x *Group) GetHideStory() bool { - if x != nil { - return x.HideStory - } - return false -} - -func (x *Group) GetStorySendMode() Group_StorySendMode { - if x != nil { - return x.StorySendMode - } - return Group_DEFAULT -} - -func (x *Group) GetSnapshot() *Group_GroupSnapshot { - if x != nil { - return x.Snapshot - } - return nil -} - -func (x *Group) GetBlocked() bool { - if x != nil { - return x.Blocked - } - return false -} - -func (x *Group) GetAvatarColor() AvatarColor { - if x != nil && x.AvatarColor != nil { - return *x.AvatarColor - } - return AvatarColor_A100 -} - -func (x *Group) GetBlockedAtTimestamp() uint64 { - if x != nil { - return x.BlockedAtTimestamp - } - return 0 -} - -type Self struct { - state protoimpl.MessageState `protogen:"open.v1"` - AvatarColor *AvatarColor `protobuf:"varint,1,opt,name=avatarColor,proto3,enum=signal.backup.AvatarColor,oneof" json:"avatarColor,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Self) Reset() { - *x = Self{} - mi := &file_backuppb_Backup_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Self) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Self) ProtoMessage() {} - -func (x *Self) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[6] - 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 Self.ProtoReflect.Descriptor instead. -func (*Self) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{6} -} - -func (x *Self) GetAvatarColor() AvatarColor { - if x != nil && x.AvatarColor != nil { - return *x.AvatarColor - } - return AvatarColor_A100 -} - -type ReleaseNotes struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReleaseNotes) Reset() { - *x = ReleaseNotes{} - mi := &file_backuppb_Backup_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReleaseNotes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReleaseNotes) ProtoMessage() {} - -func (x *ReleaseNotes) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[7] - 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 ReleaseNotes.ProtoReflect.Descriptor instead. -func (*ReleaseNotes) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{7} -} - -type Chat 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 - RecipientId uint64 `protobuf:"varint,2,opt,name=recipientId,proto3" json:"recipientId,omitempty"` - Archived bool `protobuf:"varint,3,opt,name=archived,proto3" json:"archived,omitempty"` - PinnedOrder *uint32 `protobuf:"varint,4,opt,name=pinnedOrder,proto3,oneof" json:"pinnedOrder,omitempty"` // will be displayed in ascending order - ExpirationTimerMs *uint64 `protobuf:"varint,5,opt,name=expirationTimerMs,proto3,oneof" json:"expirationTimerMs,omitempty"` - MuteUntilMs *uint64 `protobuf:"varint,6,opt,name=muteUntilMs,proto3,oneof" json:"muteUntilMs,omitempty"` // INT64_MAX (2^63 - 1) = "always muted". - MarkedUnread bool `protobuf:"varint,7,opt,name=markedUnread,proto3" json:"markedUnread,omitempty"` - DontNotifyForMentionsIfMuted bool `protobuf:"varint,8,opt,name=dontNotifyForMentionsIfMuted,proto3" json:"dontNotifyForMentionsIfMuted,omitempty"` // will be deprecated in favor of [notifyForMentionsIfMuted] - Style *ChatStyle `protobuf:"bytes,9,opt,name=style,proto3" json:"style,omitempty"` - ExpireTimerVersion uint32 `protobuf:"varint,10,opt,name=expireTimerVersion,proto3" json:"expireTimerVersion,omitempty"` - NotifyForCallsIfMuted *bool `protobuf:"varint,11,opt,name=notifyForCallsIfMuted,proto3,oneof" json:"notifyForCallsIfMuted,omitempty"` // If unset, use default global settings - NotifyForMentionsIfMuted *bool `protobuf:"varint,12,opt,name=notifyForMentionsIfMuted,proto3,oneof" json:"notifyForMentionsIfMuted,omitempty"` // If unset, use default global settings. Only for groups. If [dontNotifyForMentionsIfMuted] is true, this should be initialized to false. - NotifyForRepliesIfMuted *bool `protobuf:"varint,13,opt,name=notifyForRepliesIfMuted,proto3,oneof" json:"notifyForRepliesIfMuted,omitempty"` // If unset, use default global settings. Only for groups. - ShowUnreadReminders *bool `protobuf:"varint,14,opt,name=showUnreadReminders,proto3,oneof" json:"showUnreadReminders,omitempty"` // If unset, use default global settings - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Chat) Reset() { - *x = Chat{} - mi := &file_backuppb_Backup_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Chat) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Chat) ProtoMessage() {} - -func (x *Chat) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 Chat.ProtoReflect.Descriptor instead. -func (*Chat) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{8} -} - -func (x *Chat) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Chat) GetRecipientId() uint64 { - if x != nil { - return x.RecipientId - } - return 0 -} - -func (x *Chat) GetArchived() bool { - if x != nil { - return x.Archived - } - return false -} - -func (x *Chat) GetPinnedOrder() uint32 { - if x != nil && x.PinnedOrder != nil { - return *x.PinnedOrder - } - return 0 -} - -func (x *Chat) GetExpirationTimerMs() uint64 { - if x != nil && x.ExpirationTimerMs != nil { - return *x.ExpirationTimerMs - } - return 0 -} - -func (x *Chat) GetMuteUntilMs() uint64 { - if x != nil && x.MuteUntilMs != nil { - return *x.MuteUntilMs - } - return 0 -} - -func (x *Chat) GetMarkedUnread() bool { - if x != nil { - return x.MarkedUnread - } - return false -} - -func (x *Chat) GetDontNotifyForMentionsIfMuted() bool { - if x != nil { - return x.DontNotifyForMentionsIfMuted - } - return false -} - -func (x *Chat) GetStyle() *ChatStyle { - if x != nil { - return x.Style - } - return nil -} - -func (x *Chat) GetExpireTimerVersion() uint32 { - if x != nil { - return x.ExpireTimerVersion - } - return 0 -} - -func (x *Chat) GetNotifyForCallsIfMuted() bool { - if x != nil && x.NotifyForCallsIfMuted != nil { - return *x.NotifyForCallsIfMuted - } - return false -} - -func (x *Chat) GetNotifyForMentionsIfMuted() bool { - if x != nil && x.NotifyForMentionsIfMuted != nil { - return *x.NotifyForMentionsIfMuted - } - return false -} - -func (x *Chat) GetNotifyForRepliesIfMuted() bool { - if x != nil && x.NotifyForRepliesIfMuted != nil { - return *x.NotifyForRepliesIfMuted - } - return false -} - -func (x *Chat) GetShowUnreadReminders() bool { - if x != nil && x.ShowUnreadReminders != nil { - return *x.ShowUnreadReminders - } - return false -} - -// * -// Call Links have some associated data including a call, but unlike other recipients -// are not tied to threads because they do not have messages associated with them. -// -// note: -// - room id can be derived from the root key -// - the presence of an admin key means this user is a call admin -type CallLink struct { - state protoimpl.MessageState `protogen:"open.v1"` - RootKey []byte `protobuf:"bytes,1,opt,name=rootKey,proto3" json:"rootKey,omitempty"` - AdminKey []byte `protobuf:"bytes,2,opt,name=adminKey,proto3,oneof" json:"adminKey,omitempty"` // Only present if the user is an admin - 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallLink) Reset() { - *x = CallLink{} - mi := &file_backuppb_Backup_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallLink) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallLink) ProtoMessage() {} - -func (x *CallLink) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 CallLink.ProtoReflect.Descriptor instead. -func (*CallLink) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{9} -} - -func (x *CallLink) GetRootKey() []byte { - if x != nil { - return x.RootKey - } - return nil -} - -func (x *CallLink) GetAdminKey() []byte { - if x != nil { - return x.AdminKey - } - return nil -} - -func (x *CallLink) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CallLink) GetRestrictions() CallLink_Restrictions { - if x != nil { - return x.Restrictions - } - return CallLink_UNKNOWN -} - -func (x *CallLink) GetExpirationMs() uint64 { - if x != nil { - return x.ExpirationMs - } - return 0 -} - -type AdHocCall struct { - state protoimpl.MessageState `protogen:"open.v1"` - CallId uint64 `protobuf:"varint,1,opt,name=callId,proto3" json:"callId,omitempty"` - // Refers to a `CallLink` recipient. - RecipientId uint64 `protobuf:"varint,2,opt,name=recipientId,proto3" json:"recipientId,omitempty"` - State AdHocCall_State `protobuf:"varint,3,opt,name=state,proto3,enum=signal.backup.AdHocCall_State" json:"state,omitempty"` - CallTimestamp uint64 `protobuf:"varint,4,opt,name=callTimestamp,proto3" json:"callTimestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AdHocCall) Reset() { - *x = AdHocCall{} - mi := &file_backuppb_Backup_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AdHocCall) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AdHocCall) ProtoMessage() {} - -func (x *AdHocCall) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 AdHocCall.ProtoReflect.Descriptor instead. -func (*AdHocCall) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{10} -} - -func (x *AdHocCall) GetCallId() uint64 { - if x != nil { - return x.CallId - } - return 0 -} - -func (x *AdHocCall) GetRecipientId() uint64 { - if x != nil { - return x.RecipientId - } - return 0 -} - -func (x *AdHocCall) GetState() AdHocCall_State { - if x != nil { - return x.State - } - return AdHocCall_UNKNOWN_STATE -} - -func (x *AdHocCall) GetCallTimestamp() uint64 { - if x != nil { - return x.CallTimestamp - } - return 0 -} - -type DistributionListItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - // distribution ids are UUIDv4s. "My Story" is represented - // by an all-0 UUID (00000000-0000-0000-0000-000000000000). - DistributionId []byte `protobuf:"bytes,1,opt,name=distributionId,proto3" json:"distributionId,omitempty"` // distribution list ids are uuids - // If unset, importers should skip the item entirely without showing an error. - // - // Types that are valid to be assigned to Item: - // - // *DistributionListItem_DeletionTimestamp - // *DistributionListItem_DistributionList - Item isDistributionListItem_Item `protobuf_oneof:"item"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DistributionListItem) Reset() { - *x = DistributionListItem{} - mi := &file_backuppb_Backup_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DistributionListItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DistributionListItem) ProtoMessage() {} - -func (x *DistributionListItem) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[11] - 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 DistributionListItem.ProtoReflect.Descriptor instead. -func (*DistributionListItem) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{11} -} - -func (x *DistributionListItem) GetDistributionId() []byte { - if x != nil { - return x.DistributionId - } - return nil -} - -func (x *DistributionListItem) GetItem() isDistributionListItem_Item { - if x != nil { - return x.Item - } - return nil -} - -func (x *DistributionListItem) GetDeletionTimestamp() uint64 { - if x != nil { - if x, ok := x.Item.(*DistributionListItem_DeletionTimestamp); ok { - return x.DeletionTimestamp - } - } - return 0 -} - -func (x *DistributionListItem) GetDistributionList() *DistributionList { - if x != nil { - if x, ok := x.Item.(*DistributionListItem_DistributionList); ok { - return x.DistributionList - } - } - return nil -} - -type isDistributionListItem_Item interface { - isDistributionListItem_Item() -} - -type DistributionListItem_DeletionTimestamp struct { - DeletionTimestamp uint64 `protobuf:"varint,2,opt,name=deletionTimestamp,proto3,oneof"` -} - -type DistributionListItem_DistributionList struct { - DistributionList *DistributionList `protobuf:"bytes,3,opt,name=distributionList,proto3,oneof"` -} - -func (*DistributionListItem_DeletionTimestamp) isDistributionListItem_Item() {} - -func (*DistributionListItem_DistributionList) isDistributionListItem_Item() {} - -type DistributionList struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - AllowReplies bool `protobuf:"varint,2,opt,name=allowReplies,proto3" json:"allowReplies,omitempty"` - PrivacyMode DistributionList_PrivacyMode `protobuf:"varint,3,opt,name=privacyMode,proto3,enum=signal.backup.DistributionList_PrivacyMode" json:"privacyMode,omitempty"` - MemberRecipientIds []uint64 `protobuf:"varint,4,rep,packed,name=memberRecipientIds,proto3" json:"memberRecipientIds,omitempty"` // generated recipient id - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DistributionList) Reset() { - *x = DistributionList{} - mi := &file_backuppb_Backup_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DistributionList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DistributionList) ProtoMessage() {} - -func (x *DistributionList) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 DistributionList.ProtoReflect.Descriptor instead. -func (*DistributionList) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{12} -} - -func (x *DistributionList) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *DistributionList) GetAllowReplies() bool { - if x != nil { - return x.AllowReplies - } - return false -} - -func (x *DistributionList) GetPrivacyMode() DistributionList_PrivacyMode { - if x != nil { - return x.PrivacyMode - } - return DistributionList_UNKNOWN -} - -func (x *DistributionList) GetMemberRecipientIds() []uint64 { - if x != nil { - return x.MemberRecipientIds - } - return nil -} - -type ChatItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChatId uint64 `protobuf:"varint,1,opt,name=chatId,proto3" json:"chatId,omitempty"` // conversation id - AuthorId uint64 `protobuf:"varint,2,opt,name=authorId,proto3" json:"authorId,omitempty"` // recipient id - DateSent uint64 `protobuf:"varint,3,opt,name=dateSent,proto3" json:"dateSent,omitempty"` - ExpireStartDate *uint64 `protobuf:"varint,4,opt,name=expireStartDate,proto3,oneof" json:"expireStartDate,omitempty"` // timestamp of when expiration timer started ticking down - ExpiresInMs *uint64 `protobuf:"varint,5,opt,name=expiresInMs,proto3,oneof" json:"expiresInMs,omitempty"` // how long timer of message is (ms) - Revisions []*ChatItem `protobuf:"bytes,6,rep,name=revisions,proto3" json:"revisions,omitempty"` // ordered from oldest to newest - Sms bool `protobuf:"varint,7,opt,name=sms,proto3" json:"sms,omitempty"` - // If unset, importers should skip this item without throwing an error. - // - // Types that are valid to be assigned to DirectionalDetails: - // - // *ChatItem_Incoming - // *ChatItem_Outgoing - // *ChatItem_Directionless - DirectionalDetails isChatItem_DirectionalDetails `protobuf_oneof:"directionalDetails"` - // If unset, importers should skip this item without throwing an error. - // - // Types that are valid to be assigned to Item: - // - // *ChatItem_StandardMessage - // *ChatItem_ContactMessage - // *ChatItem_StickerMessage - // *ChatItem_RemoteDeletedMessage - // *ChatItem_UpdateMessage - // *ChatItem_PaymentNotification - // *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 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatItem) Reset() { - *x = ChatItem{} - mi := &file_backuppb_Backup_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatItem) ProtoMessage() {} - -func (x *ChatItem) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 ChatItem.ProtoReflect.Descriptor instead. -func (*ChatItem) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{13} -} - -func (x *ChatItem) GetChatId() uint64 { - if x != nil { - return x.ChatId - } - return 0 -} - -func (x *ChatItem) GetAuthorId() uint64 { - if x != nil { - return x.AuthorId - } - return 0 -} - -func (x *ChatItem) GetDateSent() uint64 { - if x != nil { - return x.DateSent - } - return 0 -} - -func (x *ChatItem) GetExpireStartDate() uint64 { - if x != nil && x.ExpireStartDate != nil { - return *x.ExpireStartDate - } - return 0 -} - -func (x *ChatItem) GetExpiresInMs() uint64 { - if x != nil && x.ExpiresInMs != nil { - return *x.ExpiresInMs - } - return 0 -} - -func (x *ChatItem) GetRevisions() []*ChatItem { - if x != nil { - return x.Revisions - } - return nil -} - -func (x *ChatItem) GetSms() bool { - if x != nil { - return x.Sms - } - return false -} - -func (x *ChatItem) GetDirectionalDetails() isChatItem_DirectionalDetails { - if x != nil { - return x.DirectionalDetails - } - return nil -} - -func (x *ChatItem) GetIncoming() *ChatItem_IncomingMessageDetails { - if x != nil { - if x, ok := x.DirectionalDetails.(*ChatItem_Incoming); ok { - return x.Incoming - } - } - return nil -} - -func (x *ChatItem) GetOutgoing() *ChatItem_OutgoingMessageDetails { - if x != nil { - if x, ok := x.DirectionalDetails.(*ChatItem_Outgoing); ok { - return x.Outgoing - } - } - return nil -} - -func (x *ChatItem) GetDirectionless() *ChatItem_DirectionlessMessageDetails { - if x != nil { - if x, ok := x.DirectionalDetails.(*ChatItem_Directionless); ok { - return x.Directionless - } - } - return nil -} - -func (x *ChatItem) GetItem() isChatItem_Item { - if x != nil { - return x.Item - } - return nil -} - -func (x *ChatItem) GetStandardMessage() *StandardMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_StandardMessage); ok { - return x.StandardMessage - } - } - return nil -} - -func (x *ChatItem) GetContactMessage() *ContactMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_ContactMessage); ok { - return x.ContactMessage - } - } - return nil -} - -func (x *ChatItem) GetStickerMessage() *StickerMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_StickerMessage); ok { - return x.StickerMessage - } - } - return nil -} - -func (x *ChatItem) GetRemoteDeletedMessage() *RemoteDeletedMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_RemoteDeletedMessage); ok { - return x.RemoteDeletedMessage - } - } - return nil -} - -func (x *ChatItem) GetUpdateMessage() *ChatUpdateMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_UpdateMessage); ok { - return x.UpdateMessage - } - } - return nil -} - -func (x *ChatItem) GetPaymentNotification() *PaymentNotification { - if x != nil { - if x, ok := x.Item.(*ChatItem_PaymentNotification); ok { - return x.PaymentNotification - } - } - return nil -} - -func (x *ChatItem) GetGiftBadge() *GiftBadge { - if x != nil { - if x, ok := x.Item.(*ChatItem_GiftBadge); ok { - return x.GiftBadge - } - } - return nil -} - -func (x *ChatItem) GetViewOnceMessage() *ViewOnceMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_ViewOnceMessage); ok { - return x.ViewOnceMessage - } - } - return nil -} - -func (x *ChatItem) GetDirectStoryReplyMessage() *DirectStoryReplyMessage { - if x != nil { - if x, ok := x.Item.(*ChatItem_DirectStoryReplyMessage); ok { - return x.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() -} - -type ChatItem_Incoming struct { - Incoming *ChatItem_IncomingMessageDetails `protobuf:"bytes,8,opt,name=incoming,proto3,oneof"` -} - -type ChatItem_Outgoing struct { - Outgoing *ChatItem_OutgoingMessageDetails `protobuf:"bytes,9,opt,name=outgoing,proto3,oneof"` -} - -type ChatItem_Directionless struct { - Directionless *ChatItem_DirectionlessMessageDetails `protobuf:"bytes,10,opt,name=directionless,proto3,oneof"` -} - -func (*ChatItem_Incoming) isChatItem_DirectionalDetails() {} - -func (*ChatItem_Outgoing) isChatItem_DirectionalDetails() {} - -func (*ChatItem_Directionless) isChatItem_DirectionalDetails() {} - -type isChatItem_Item interface { - isChatItem_Item() -} - -type ChatItem_StandardMessage struct { - StandardMessage *StandardMessage `protobuf:"bytes,11,opt,name=standardMessage,proto3,oneof"` -} - -type ChatItem_ContactMessage struct { - ContactMessage *ContactMessage `protobuf:"bytes,12,opt,name=contactMessage,proto3,oneof"` -} - -type ChatItem_StickerMessage struct { - StickerMessage *StickerMessage `protobuf:"bytes,13,opt,name=stickerMessage,proto3,oneof"` -} - -type ChatItem_RemoteDeletedMessage struct { - RemoteDeletedMessage *RemoteDeletedMessage `protobuf:"bytes,14,opt,name=remoteDeletedMessage,proto3,oneof"` -} - -type ChatItem_UpdateMessage struct { - UpdateMessage *ChatUpdateMessage `protobuf:"bytes,15,opt,name=updateMessage,proto3,oneof"` -} - -type ChatItem_PaymentNotification struct { - PaymentNotification *PaymentNotification `protobuf:"bytes,16,opt,name=paymentNotification,proto3,oneof"` -} - -type ChatItem_GiftBadge struct { - GiftBadge *GiftBadge `protobuf:"bytes,17,opt,name=giftBadge,proto3,oneof"` -} - -type ChatItem_ViewOnceMessage struct { - ViewOnceMessage *ViewOnceMessage `protobuf:"bytes,18,opt,name=viewOnceMessage,proto3,oneof"` -} - -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() {} - -func (*ChatItem_StickerMessage) isChatItem_Item() {} - -func (*ChatItem_RemoteDeletedMessage) isChatItem_Item() {} - -func (*ChatItem_UpdateMessage) isChatItem_Item() {} - -func (*ChatItem_PaymentNotification) isChatItem_Item() {} - -func (*ChatItem_GiftBadge) isChatItem_Item() {} - -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"` - Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // the time the status was last updated -- if from a receipt, it should be the sentTime of the receipt - // If unset, importers should consider the status to be "pending" - // - // Types that are valid to be assigned to DeliveryStatus: - // - // *SendStatus_Pending_ - // *SendStatus_Sent_ - // *SendStatus_Delivered_ - // *SendStatus_Read_ - // *SendStatus_Viewed_ - // *SendStatus_Skipped_ - // *SendStatus_Failed_ - DeliveryStatus isSendStatus_DeliveryStatus `protobuf_oneof:"deliveryStatus"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus) Reset() { - *x = SendStatus{} - mi := &file_backuppb_Backup_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus) ProtoMessage() {} - -func (x *SendStatus) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 SendStatus.ProtoReflect.Descriptor instead. -func (*SendStatus) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14} -} - -func (x *SendStatus) GetRecipientId() uint64 { - if x != nil { - return x.RecipientId - } - return 0 -} - -func (x *SendStatus) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *SendStatus) GetDeliveryStatus() isSendStatus_DeliveryStatus { - if x != nil { - return x.DeliveryStatus - } - return nil -} - -func (x *SendStatus) GetPending() *SendStatus_Pending { - if x != nil { - if x, ok := x.DeliveryStatus.(*SendStatus_Pending_); ok { - return x.Pending - } - } - return nil -} - -func (x *SendStatus) GetSent() *SendStatus_Sent { - if x != nil { - if x, ok := x.DeliveryStatus.(*SendStatus_Sent_); ok { - return x.Sent - } - } - return nil -} - -func (x *SendStatus) GetDelivered() *SendStatus_Delivered { - if x != nil { - if x, ok := x.DeliveryStatus.(*SendStatus_Delivered_); ok { - return x.Delivered - } - } - return nil -} - -func (x *SendStatus) GetRead() *SendStatus_Read { - if x != nil { - if x, ok := x.DeliveryStatus.(*SendStatus_Read_); ok { - return x.Read - } - } - return nil -} - -func (x *SendStatus) GetViewed() *SendStatus_Viewed { - if x != nil { - if x, ok := x.DeliveryStatus.(*SendStatus_Viewed_); ok { - return x.Viewed - } - } - return nil -} - -func (x *SendStatus) GetSkipped() *SendStatus_Skipped { - if x != nil { - if x, ok := x.DeliveryStatus.(*SendStatus_Skipped_); ok { - return x.Skipped - } - } - return nil -} - -func (x *SendStatus) GetFailed() *SendStatus_Failed { - if x != nil { - if x, ok := x.DeliveryStatus.(*SendStatus_Failed_); ok { - return x.Failed - } - } - return nil -} - -type isSendStatus_DeliveryStatus interface { - isSendStatus_DeliveryStatus() -} - -type SendStatus_Pending_ struct { - Pending *SendStatus_Pending `protobuf:"bytes,3,opt,name=pending,proto3,oneof"` -} - -type SendStatus_Sent_ struct { - Sent *SendStatus_Sent `protobuf:"bytes,4,opt,name=sent,proto3,oneof"` -} - -type SendStatus_Delivered_ struct { - Delivered *SendStatus_Delivered `protobuf:"bytes,5,opt,name=delivered,proto3,oneof"` -} - -type SendStatus_Read_ struct { - Read *SendStatus_Read `protobuf:"bytes,6,opt,name=read,proto3,oneof"` -} - -type SendStatus_Viewed_ struct { - Viewed *SendStatus_Viewed `protobuf:"bytes,7,opt,name=viewed,proto3,oneof"` -} - -type SendStatus_Skipped_ struct { - Skipped *SendStatus_Skipped `protobuf:"bytes,8,opt,name=skipped,proto3,oneof"` -} - -type SendStatus_Failed_ struct { - Failed *SendStatus_Failed `protobuf:"bytes,9,opt,name=failed,proto3,oneof"` -} - -func (*SendStatus_Pending_) isSendStatus_DeliveryStatus() {} - -func (*SendStatus_Sent_) isSendStatus_DeliveryStatus() {} - -func (*SendStatus_Delivered_) isSendStatus_DeliveryStatus() {} - -func (*SendStatus_Read_) isSendStatus_DeliveryStatus() {} - -func (*SendStatus_Viewed_) isSendStatus_DeliveryStatus() {} - -func (*SendStatus_Skipped_) isSendStatus_DeliveryStatus() {} - -func (*SendStatus_Failed_) isSendStatus_DeliveryStatus() {} - -type Text struct { - state protoimpl.MessageState `protogen:"open.v1"` - Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - BodyRanges []*BodyRange `protobuf:"bytes,2,rep,name=bodyRanges,proto3" json:"bodyRanges,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Text) Reset() { - *x = Text{} - mi := &file_backuppb_Backup_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Text) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Text) ProtoMessage() {} - -func (x *Text) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 Text.ProtoReflect.Descriptor instead. -func (*Text) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{15} -} - -func (x *Text) GetBody() string { - if x != nil { - return x.Body - } - return "" -} - -func (x *Text) GetBodyRanges() []*BodyRange { - if x != nil { - return x.BodyRanges - } - return nil -} - -type StandardMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Quote *Quote `protobuf:"bytes,1,opt,name=quote,proto3,oneof" json:"quote,omitempty"` - Text *Text `protobuf:"bytes,2,opt,name=text,proto3,oneof" json:"text,omitempty"` - Attachments []*MessageAttachment `protobuf:"bytes,3,rep,name=attachments,proto3" json:"attachments,omitempty"` - LinkPreview []*LinkPreview `protobuf:"bytes,4,rep,name=linkPreview,proto3" json:"linkPreview,omitempty"` - LongText *FilePointer `protobuf:"bytes,5,opt,name=longText,proto3,oneof" json:"longText,omitempty"` - Reactions []*Reaction `protobuf:"bytes,6,rep,name=reactions,proto3" json:"reactions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StandardMessage) Reset() { - *x = StandardMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StandardMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StandardMessage) ProtoMessage() {} - -func (x *StandardMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[16] - 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 StandardMessage.ProtoReflect.Descriptor instead. -func (*StandardMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{16} -} - -func (x *StandardMessage) GetQuote() *Quote { - if x != nil { - return x.Quote - } - return nil -} - -func (x *StandardMessage) GetText() *Text { - if x != nil { - return x.Text - } - return nil -} - -func (x *StandardMessage) GetAttachments() []*MessageAttachment { - if x != nil { - return x.Attachments - } - return nil -} - -func (x *StandardMessage) GetLinkPreview() []*LinkPreview { - if x != nil { - return x.LinkPreview - } - return nil -} - -func (x *StandardMessage) GetLongText() *FilePointer { - if x != nil { - return x.LongText - } - return nil -} - -func (x *StandardMessage) GetReactions() []*Reaction { - if x != nil { - return x.Reactions - } - return nil -} - -type ContactMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Contact *ContactAttachment `protobuf:"bytes,1,opt,name=contact,proto3" json:"contact,omitempty"` - Reactions []*Reaction `protobuf:"bytes,2,rep,name=reactions,proto3" json:"reactions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactMessage) Reset() { - *x = ContactMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactMessage) ProtoMessage() {} - -func (x *ContactMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[17] - 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 ContactMessage.ProtoReflect.Descriptor instead. -func (*ContactMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{17} -} - -func (x *ContactMessage) GetContact() *ContactAttachment { - if x != nil { - return x.Contact - } - return nil -} - -func (x *ContactMessage) GetReactions() []*Reaction { - if x != nil { - return x.Reactions - } - return nil -} - -type DirectStoryReplyMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If unset, importers should ignore the message without throwing an error. - // - // Types that are valid to be assigned to Reply: - // - // *DirectStoryReplyMessage_TextReply_ - // *DirectStoryReplyMessage_Emoji - Reply isDirectStoryReplyMessage_Reply `protobuf_oneof:"reply"` - Reactions []*Reaction `protobuf:"bytes,3,rep,name=reactions,proto3" json:"reactions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DirectStoryReplyMessage) Reset() { - *x = DirectStoryReplyMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DirectStoryReplyMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DirectStoryReplyMessage) ProtoMessage() {} - -func (x *DirectStoryReplyMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[18] - 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 DirectStoryReplyMessage.ProtoReflect.Descriptor instead. -func (*DirectStoryReplyMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{18} -} - -func (x *DirectStoryReplyMessage) GetReply() isDirectStoryReplyMessage_Reply { - if x != nil { - return x.Reply - } - return nil -} - -func (x *DirectStoryReplyMessage) GetTextReply() *DirectStoryReplyMessage_TextReply { - if x != nil { - if x, ok := x.Reply.(*DirectStoryReplyMessage_TextReply_); ok { - return x.TextReply - } - } - return nil -} - -func (x *DirectStoryReplyMessage) GetEmoji() string { - if x != nil { - if x, ok := x.Reply.(*DirectStoryReplyMessage_Emoji); ok { - return x.Emoji - } - } - return "" -} - -func (x *DirectStoryReplyMessage) GetReactions() []*Reaction { - if x != nil { - return x.Reactions - } - return nil -} - -type isDirectStoryReplyMessage_Reply interface { - isDirectStoryReplyMessage_Reply() -} - -type DirectStoryReplyMessage_TextReply_ struct { - TextReply *DirectStoryReplyMessage_TextReply `protobuf:"bytes,1,opt,name=textReply,proto3,oneof"` -} - -type DirectStoryReplyMessage_Emoji struct { - Emoji string `protobuf:"bytes,2,opt,name=emoji,proto3,oneof"` -} - -func (*DirectStoryReplyMessage_TextReply_) isDirectStoryReplyMessage_Reply() {} - -func (*DirectStoryReplyMessage_Emoji) isDirectStoryReplyMessage_Reply() {} - -type PaymentNotification struct { - state protoimpl.MessageState `protogen:"open.v1"` - AmountMob *string `protobuf:"bytes,1,opt,name=amountMob,proto3,oneof" json:"amountMob,omitempty"` // stored as a decimal string, e.g. 1.00001 - FeeMob *string `protobuf:"bytes,2,opt,name=feeMob,proto3,oneof" json:"feeMob,omitempty"` // stored as a decimal string, e.g. 1.00001 - Note *string `protobuf:"bytes,3,opt,name=note,proto3,oneof" json:"note,omitempty"` - TransactionDetails *PaymentNotification_TransactionDetails `protobuf:"bytes,4,opt,name=transactionDetails,proto3" json:"transactionDetails,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentNotification) Reset() { - *x = PaymentNotification{} - mi := &file_backuppb_Backup_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentNotification) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentNotification) ProtoMessage() {} - -func (x *PaymentNotification) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[19] - 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 PaymentNotification.ProtoReflect.Descriptor instead. -func (*PaymentNotification) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{19} -} - -func (x *PaymentNotification) GetAmountMob() string { - if x != nil && x.AmountMob != nil { - return *x.AmountMob - } - return "" -} - -func (x *PaymentNotification) GetFeeMob() string { - if x != nil && x.FeeMob != nil { - return *x.FeeMob - } - return "" -} - -func (x *PaymentNotification) GetNote() string { - if x != nil && x.Note != nil { - return *x.Note - } - return "" -} - -func (x *PaymentNotification) GetTransactionDetails() *PaymentNotification_TransactionDetails { - if x != nil { - return x.TransactionDetails - } - return nil -} - -type GiftBadge struct { - state protoimpl.MessageState `protogen:"open.v1"` - ReceiptCredentialPresentation []byte `protobuf:"bytes,1,opt,name=receiptCredentialPresentation,proto3" json:"receiptCredentialPresentation,omitempty"` - State GiftBadge_State `protobuf:"varint,2,opt,name=state,proto3,enum=signal.backup.GiftBadge_State" json:"state,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GiftBadge) Reset() { - *x = GiftBadge{} - mi := &file_backuppb_Backup_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GiftBadge) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GiftBadge) ProtoMessage() {} - -func (x *GiftBadge) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 GiftBadge.ProtoReflect.Descriptor instead. -func (*GiftBadge) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{20} -} - -func (x *GiftBadge) GetReceiptCredentialPresentation() []byte { - if x != nil { - return x.ReceiptCredentialPresentation - } - return nil -} - -func (x *GiftBadge) GetState() GiftBadge_State { - if x != nil { - return x.State - } - return GiftBadge_UNOPENED -} - -type ViewOnceMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Will be null for viewed messages - Attachment *MessageAttachment `protobuf:"bytes,1,opt,name=attachment,proto3" json:"attachment,omitempty"` - Reactions []*Reaction `protobuf:"bytes,2,rep,name=reactions,proto3" json:"reactions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ViewOnceMessage) Reset() { - *x = ViewOnceMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ViewOnceMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ViewOnceMessage) ProtoMessage() {} - -func (x *ViewOnceMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[21] - 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 ViewOnceMessage.ProtoReflect.Descriptor instead. -func (*ViewOnceMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{21} -} - -func (x *ViewOnceMessage) GetAttachment() *MessageAttachment { - if x != nil { - return x.Attachment - } - return nil -} - -func (x *ViewOnceMessage) GetReactions() []*Reaction { - if x != nil { - return x.Reactions - } - return nil -} - -type ContactAttachment struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name *ContactAttachment_Name `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` - Number []*ContactAttachment_Phone `protobuf:"bytes,3,rep,name=number,proto3" json:"number,omitempty"` - Email []*ContactAttachment_Email `protobuf:"bytes,4,rep,name=email,proto3" json:"email,omitempty"` - Address []*ContactAttachment_PostalAddress `protobuf:"bytes,5,rep,name=address,proto3" json:"address,omitempty"` - Avatar *FilePointer `protobuf:"bytes,6,opt,name=avatar,proto3,oneof" json:"avatar,omitempty"` - Organization string `protobuf:"bytes,7,opt,name=organization,proto3" json:"organization,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactAttachment) Reset() { - *x = ContactAttachment{} - mi := &file_backuppb_Backup_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactAttachment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactAttachment) ProtoMessage() {} - -func (x *ContactAttachment) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[22] - 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 ContactAttachment.ProtoReflect.Descriptor instead. -func (*ContactAttachment) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22} -} - -func (x *ContactAttachment) GetName() *ContactAttachment_Name { - if x != nil { - return x.Name - } - return nil -} - -func (x *ContactAttachment) GetNumber() []*ContactAttachment_Phone { - if x != nil { - return x.Number - } - return nil -} - -func (x *ContactAttachment) GetEmail() []*ContactAttachment_Email { - if x != nil { - return x.Email - } - return nil -} - -func (x *ContactAttachment) GetAddress() []*ContactAttachment_PostalAddress { - if x != nil { - return x.Address - } - return nil -} - -func (x *ContactAttachment) GetAvatar() *FilePointer { - if x != nil { - return x.Avatar - } - return nil -} - -func (x *ContactAttachment) GetOrganization() string { - if x != nil { - return x.Organization - } - return "" -} - -type StickerMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Sticker *Sticker `protobuf:"bytes,1,opt,name=sticker,proto3" json:"sticker,omitempty"` - Reactions []*Reaction `protobuf:"bytes,2,rep,name=reactions,proto3" json:"reactions,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StickerMessage) Reset() { - *x = StickerMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StickerMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StickerMessage) ProtoMessage() {} - -func (x *StickerMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[23] - 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 StickerMessage.ProtoReflect.Descriptor instead. -func (*StickerMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{23} -} - -func (x *StickerMessage) GetSticker() *Sticker { - if x != nil { - return x.Sticker - } - return nil -} - -func (x *StickerMessage) GetReactions() []*Reaction { - if x != nil { - return x.Reactions - } - return nil -} - -// Tombstone for remote delete -type RemoteDeletedMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoteDeletedMessage) Reset() { - *x = RemoteDeletedMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoteDeletedMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoteDeletedMessage) ProtoMessage() {} - -func (x *RemoteDeletedMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[24] - 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 RemoteDeletedMessage.ProtoReflect.Descriptor instead. -func (*RemoteDeletedMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{24} -} - -type Sticker struct { - state protoimpl.MessageState `protogen:"open.v1"` - PackId []byte `protobuf:"bytes,1,opt,name=packId,proto3" json:"packId,omitempty"` - PackKey []byte `protobuf:"bytes,2,opt,name=packKey,proto3" json:"packKey,omitempty"` - StickerId uint32 `protobuf:"varint,3,opt,name=stickerId,proto3" json:"stickerId,omitempty"` - Emoji *string `protobuf:"bytes,4,opt,name=emoji,proto3,oneof" json:"emoji,omitempty"` - // Stickers are uploaded to be sent as attachments; we also - // back them up as normal attachments when they are in messages. - // DO NOT treat this as the definitive source of a sticker in - // an installed StickerPack that shares the same packId. - Data *FilePointer `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Sticker) Reset() { - *x = Sticker{} - mi := &file_backuppb_Backup_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Sticker) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Sticker) ProtoMessage() {} - -func (x *Sticker) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[25] - 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 Sticker.ProtoReflect.Descriptor instead. -func (*Sticker) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{25} -} - -func (x *Sticker) GetPackId() []byte { - if x != nil { - return x.PackId - } - return nil -} - -func (x *Sticker) GetPackKey() []byte { - if x != nil { - return x.PackKey - } - return nil -} - -func (x *Sticker) GetStickerId() uint32 { - if x != nil { - return x.StickerId - } - return 0 -} - -func (x *Sticker) GetEmoji() string { - if x != nil && x.Emoji != nil { - return *x.Emoji - } - return "" -} - -func (x *Sticker) GetData() *FilePointer { - if x != nil { - return x.Data - } - return nil -} - -type LinkPreview struct { - state protoimpl.MessageState `protogen:"open.v1"` - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - Title *string `protobuf:"bytes,2,opt,name=title,proto3,oneof" json:"title,omitempty"` - Image *FilePointer `protobuf:"bytes,3,opt,name=image,proto3,oneof" json:"image,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description,proto3,oneof" json:"description,omitempty"` - Date *uint64 `protobuf:"varint,5,opt,name=date,proto3,oneof" json:"date,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LinkPreview) Reset() { - *x = LinkPreview{} - mi := &file_backuppb_Backup_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LinkPreview) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LinkPreview) ProtoMessage() {} - -func (x *LinkPreview) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[26] - 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 LinkPreview.ProtoReflect.Descriptor instead. -func (*LinkPreview) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{26} -} - -func (x *LinkPreview) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *LinkPreview) GetTitle() string { - if x != nil && x.Title != nil { - return *x.Title - } - return "" -} - -func (x *LinkPreview) GetImage() *FilePointer { - if x != nil { - return x.Image - } - return nil -} - -func (x *LinkPreview) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *LinkPreview) GetDate() uint64 { - if x != nil && x.Date != nil { - return *x.Date - } - return 0 -} - -// A FilePointer on a message that has additional -// metadata that applies only to message attachments. -type MessageAttachment struct { - state protoimpl.MessageState `protogen:"open.v1"` - Pointer *FilePointer `protobuf:"bytes,1,opt,name=pointer,proto3" json:"pointer,omitempty"` - Flag MessageAttachment_Flag `protobuf:"varint,2,opt,name=flag,proto3,enum=signal.backup.MessageAttachment_Flag" json:"flag,omitempty"` - WasDownloaded bool `protobuf:"varint,3,opt,name=wasDownloaded,proto3" json:"wasDownloaded,omitempty"` - // Cross-client identifier for this attachment among all attachments on the - // owning message. See: SignalService.AttachmentPointer.clientUuid. - ClientUuid []byte `protobuf:"bytes,4,opt,name=clientUuid,proto3,oneof" json:"clientUuid,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MessageAttachment) Reset() { - *x = MessageAttachment{} - mi := &file_backuppb_Backup_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MessageAttachment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageAttachment) ProtoMessage() {} - -func (x *MessageAttachment) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[27] - 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 MessageAttachment.ProtoReflect.Descriptor instead. -func (*MessageAttachment) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{27} -} - -func (x *MessageAttachment) GetPointer() *FilePointer { - if x != nil { - return x.Pointer - } - return nil -} - -func (x *MessageAttachment) GetFlag() MessageAttachment_Flag { - if x != nil { - return x.Flag - } - return MessageAttachment_NONE -} - -func (x *MessageAttachment) GetWasDownloaded() bool { - if x != nil { - return x.WasDownloaded - } - return false -} - -func (x *MessageAttachment) GetClientUuid() []byte { - if x != nil { - return x.ClientUuid - } - return nil -} - -type FilePointer struct { - state protoimpl.MessageState `protogen:"open.v1"` - ContentType *string `protobuf:"bytes,4,opt,name=contentType,proto3,oneof" json:"contentType,omitempty"` - IncrementalMac []byte `protobuf:"bytes,5,opt,name=incrementalMac,proto3,oneof" json:"incrementalMac,omitempty"` - IncrementalMacChunkSize *uint32 `protobuf:"varint,6,opt,name=incrementalMacChunkSize,proto3,oneof" json:"incrementalMacChunkSize,omitempty"` - FileName *string `protobuf:"bytes,7,opt,name=fileName,proto3,oneof" json:"fileName,omitempty"` - Width *uint32 `protobuf:"varint,8,opt,name=width,proto3,oneof" json:"width,omitempty"` - Height *uint32 `protobuf:"varint,9,opt,name=height,proto3,oneof" json:"height,omitempty"` - Caption *string `protobuf:"bytes,10,opt,name=caption,proto3,oneof" json:"caption,omitempty"` - BlurHash *string `protobuf:"bytes,11,opt,name=blurHash,proto3,oneof" json:"blurHash,omitempty"` - LocatorInfo *FilePointer_LocatorInfo `protobuf:"bytes,13,opt,name=locatorInfo,proto3" json:"locatorInfo,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FilePointer) Reset() { - *x = FilePointer{} - mi := &file_backuppb_Backup_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FilePointer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilePointer) ProtoMessage() {} - -func (x *FilePointer) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[28] - 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 FilePointer.ProtoReflect.Descriptor instead. -func (*FilePointer) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{28} -} - -func (x *FilePointer) GetContentType() string { - if x != nil && x.ContentType != nil { - return *x.ContentType - } - return "" -} - -func (x *FilePointer) GetIncrementalMac() []byte { - if x != nil { - return x.IncrementalMac - } - return nil -} - -func (x *FilePointer) GetIncrementalMacChunkSize() uint32 { - if x != nil && x.IncrementalMacChunkSize != nil { - return *x.IncrementalMacChunkSize - } - return 0 -} - -func (x *FilePointer) GetFileName() string { - if x != nil && x.FileName != nil { - return *x.FileName - } - return "" -} - -func (x *FilePointer) GetWidth() uint32 { - if x != nil && x.Width != nil { - return *x.Width - } - return 0 -} - -func (x *FilePointer) GetHeight() uint32 { - if x != nil && x.Height != nil { - return *x.Height - } - return 0 -} - -func (x *FilePointer) GetCaption() string { - if x != nil && x.Caption != nil { - return *x.Caption - } - return "" -} - -func (x *FilePointer) GetBlurHash() string { - if x != nil && x.BlurHash != nil { - return *x.BlurHash - } - return "" -} - -func (x *FilePointer) GetLocatorInfo() *FilePointer_LocatorInfo { - if x != nil { - return x.LocatorInfo - } - return nil -} - -type Quote struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetSentTimestamp *uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp,proto3,oneof" json:"targetSentTimestamp,omitempty"` // null if the target message could not be found at time of quote insert - AuthorId uint64 `protobuf:"varint,2,opt,name=authorId,proto3" json:"authorId,omitempty"` - Text *Text `protobuf:"bytes,3,opt,name=text,proto3,oneof" json:"text,omitempty"` - Attachments []*Quote_QuotedAttachment `protobuf:"bytes,4,rep,name=attachments,proto3" json:"attachments,omitempty"` - Type Quote_Type `protobuf:"varint,5,opt,name=type,proto3,enum=signal.backup.Quote_Type" json:"type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Quote) Reset() { - *x = Quote{} - mi := &file_backuppb_Backup_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Quote) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Quote) ProtoMessage() {} - -func (x *Quote) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[29] - 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 Quote.ProtoReflect.Descriptor instead. -func (*Quote) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{29} -} - -func (x *Quote) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - -func (x *Quote) GetAuthorId() uint64 { - if x != nil { - return x.AuthorId - } - return 0 -} - -func (x *Quote) GetText() *Text { - if x != nil { - return x.Text - } - return nil -} - -func (x *Quote) GetAttachments() []*Quote_QuotedAttachment { - if x != nil { - return x.Attachments - } - return nil -} - -func (x *Quote) GetType() Quote_Type { - if x != nil { - return x.Type - } - return Quote_UNKNOWN -} - -type BodyRange struct { - state protoimpl.MessageState `protogen:"open.v1"` - // 'start' and 'length' are measured in UTF-16 code units. - // They may refer to offsets in a longText attachment. - Start uint32 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty"` - Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"` - // If unset, importers should ignore the body range without throwing an error. - // - // Types that are valid to be assigned to AssociatedValue: - // - // *BodyRange_MentionAci - // *BodyRange_Style_ - AssociatedValue isBodyRange_AssociatedValue `protobuf_oneof:"associatedValue"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BodyRange) Reset() { - *x = BodyRange{} - mi := &file_backuppb_Backup_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BodyRange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BodyRange) ProtoMessage() {} - -func (x *BodyRange) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[30] - 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 BodyRange.ProtoReflect.Descriptor instead. -func (*BodyRange) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{30} -} - -func (x *BodyRange) GetStart() uint32 { - if x != nil { - return x.Start - } - return 0 -} - -func (x *BodyRange) GetLength() uint32 { - if x != nil { - return x.Length - } - return 0 -} - -func (x *BodyRange) GetAssociatedValue() isBodyRange_AssociatedValue { - if x != nil { - return x.AssociatedValue - } - return nil -} - -func (x *BodyRange) GetMentionAci() []byte { - if x != nil { - if x, ok := x.AssociatedValue.(*BodyRange_MentionAci); ok { - return x.MentionAci - } - } - return nil -} - -func (x *BodyRange) GetStyle() BodyRange_Style { - if x != nil { - if x, ok := x.AssociatedValue.(*BodyRange_Style_); ok { - return x.Style - } - } - return BodyRange_NONE -} - -type isBodyRange_AssociatedValue interface { - isBodyRange_AssociatedValue() -} - -type BodyRange_MentionAci struct { - MentionAci []byte `protobuf:"bytes,3,opt,name=mentionAci,proto3,oneof"` -} - -type BodyRange_Style_ struct { - Style BodyRange_Style `protobuf:"varint,4,opt,name=style,proto3,enum=signal.backup.BodyRange_Style,oneof"` -} - -func (*BodyRange_MentionAci) isBodyRange_AssociatedValue() {} - -func (*BodyRange_Style_) isBodyRange_AssociatedValue() {} - -type Reaction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Emoji string `protobuf:"bytes,1,opt,name=emoji,proto3" json:"emoji,omitempty"` - AuthorId uint64 `protobuf:"varint,2,opt,name=authorId,proto3" json:"authorId,omitempty"` - SentTimestamp uint64 `protobuf:"varint,3,opt,name=sentTimestamp,proto3" json:"sentTimestamp,omitempty"` - // A higher sort order means that a reaction is more recent. Some clients may export this as - // incrementing numbers (e.g. 1, 2, 3), others as timestamps. - SortOrder uint64 `protobuf:"varint,4,opt,name=sortOrder,proto3" json:"sortOrder,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Reaction) Reset() { - *x = Reaction{} - mi := &file_backuppb_Backup_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Reaction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Reaction) ProtoMessage() {} - -func (x *Reaction) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[31] - 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 Reaction.ProtoReflect.Descriptor instead. -func (*Reaction) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{31} -} - -func (x *Reaction) GetEmoji() string { - if x != nil { - return x.Emoji - } - return "" -} - -func (x *Reaction) GetAuthorId() uint64 { - if x != nil { - return x.AuthorId - } - return 0 -} - -func (x *Reaction) GetSentTimestamp() uint64 { - if x != nil { - return x.SentTimestamp - } - return 0 -} - -func (x *Reaction) GetSortOrder() uint64 { - if x != nil { - return x.SortOrder - } - 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. - // - // Types that are valid to be assigned to Update: - // - // *ChatUpdateMessage_SimpleUpdate - // *ChatUpdateMessage_GroupChange - // *ChatUpdateMessage_ExpirationTimerChange - // *ChatUpdateMessage_ProfileChange - // *ChatUpdateMessage_ThreadMerge - // *ChatUpdateMessage_SessionSwitchover - // *ChatUpdateMessage_IndividualCall - // *ChatUpdateMessage_GroupCall - // *ChatUpdateMessage_LearnedProfileChange - // *ChatUpdateMessage_PollTerminate - // *ChatUpdateMessage_PinMessage - Update isChatUpdateMessage_Update `protobuf_oneof:"update"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatUpdateMessage) Reset() { - *x = ChatUpdateMessage{} - mi := &file_backuppb_Backup_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatUpdateMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatUpdateMessage) ProtoMessage() {} - -func (x *ChatUpdateMessage) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[34] - 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 ChatUpdateMessage.ProtoReflect.Descriptor instead. -func (*ChatUpdateMessage) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{34} -} - -func (x *ChatUpdateMessage) GetUpdate() isChatUpdateMessage_Update { - if x != nil { - return x.Update - } - return nil -} - -func (x *ChatUpdateMessage) GetSimpleUpdate() *SimpleChatUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_SimpleUpdate); ok { - return x.SimpleUpdate - } - } - return nil -} - -func (x *ChatUpdateMessage) GetGroupChange() *GroupChangeChatUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_GroupChange); ok { - return x.GroupChange - } - } - return nil -} - -func (x *ChatUpdateMessage) GetExpirationTimerChange() *ExpirationTimerChatUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_ExpirationTimerChange); ok { - return x.ExpirationTimerChange - } - } - return nil -} - -func (x *ChatUpdateMessage) GetProfileChange() *ProfileChangeChatUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_ProfileChange); ok { - return x.ProfileChange - } - } - return nil -} - -func (x *ChatUpdateMessage) GetThreadMerge() *ThreadMergeChatUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_ThreadMerge); ok { - return x.ThreadMerge - } - } - return nil -} - -func (x *ChatUpdateMessage) GetSessionSwitchover() *SessionSwitchoverChatUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_SessionSwitchover); ok { - return x.SessionSwitchover - } - } - return nil -} - -func (x *ChatUpdateMessage) GetIndividualCall() *IndividualCall { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_IndividualCall); ok { - return x.IndividualCall - } - } - return nil -} - -func (x *ChatUpdateMessage) GetGroupCall() *GroupCall { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_GroupCall); ok { - return x.GroupCall - } - } - return nil -} - -func (x *ChatUpdateMessage) GetLearnedProfileChange() *LearnedProfileChatUpdate { - if x != nil { - if x, ok := x.Update.(*ChatUpdateMessage_LearnedProfileChange); ok { - return x.LearnedProfileChange - } - } - 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() -} - -type ChatUpdateMessage_SimpleUpdate struct { - SimpleUpdate *SimpleChatUpdate `protobuf:"bytes,1,opt,name=simpleUpdate,proto3,oneof"` -} - -type ChatUpdateMessage_GroupChange struct { - GroupChange *GroupChangeChatUpdate `protobuf:"bytes,2,opt,name=groupChange,proto3,oneof"` -} - -type ChatUpdateMessage_ExpirationTimerChange struct { - ExpirationTimerChange *ExpirationTimerChatUpdate `protobuf:"bytes,3,opt,name=expirationTimerChange,proto3,oneof"` -} - -type ChatUpdateMessage_ProfileChange struct { - ProfileChange *ProfileChangeChatUpdate `protobuf:"bytes,4,opt,name=profileChange,proto3,oneof"` -} - -type ChatUpdateMessage_ThreadMerge struct { - ThreadMerge *ThreadMergeChatUpdate `protobuf:"bytes,5,opt,name=threadMerge,proto3,oneof"` -} - -type ChatUpdateMessage_SessionSwitchover struct { - SessionSwitchover *SessionSwitchoverChatUpdate `protobuf:"bytes,6,opt,name=sessionSwitchover,proto3,oneof"` -} - -type ChatUpdateMessage_IndividualCall struct { - IndividualCall *IndividualCall `protobuf:"bytes,7,opt,name=individualCall,proto3,oneof"` -} - -type ChatUpdateMessage_GroupCall struct { - GroupCall *GroupCall `protobuf:"bytes,8,opt,name=groupCall,proto3,oneof"` -} - -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() {} - -func (*ChatUpdateMessage_ExpirationTimerChange) isChatUpdateMessage_Update() {} - -func (*ChatUpdateMessage_ProfileChange) isChatUpdateMessage_Update() {} - -func (*ChatUpdateMessage_ThreadMerge) isChatUpdateMessage_Update() {} - -func (*ChatUpdateMessage_SessionSwitchover) isChatUpdateMessage_Update() {} - -func (*ChatUpdateMessage_IndividualCall) isChatUpdateMessage_Update() {} - -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"` - Type IndividualCall_Type `protobuf:"varint,2,opt,name=type,proto3,enum=signal.backup.IndividualCall_Type" json:"type,omitempty"` - Direction IndividualCall_Direction `protobuf:"varint,3,opt,name=direction,proto3,enum=signal.backup.IndividualCall_Direction" json:"direction,omitempty"` - State IndividualCall_State `protobuf:"varint,4,opt,name=state,proto3,enum=signal.backup.IndividualCall_State" json:"state,omitempty"` - StartedCallTimestamp uint64 `protobuf:"varint,5,opt,name=startedCallTimestamp,proto3" json:"startedCallTimestamp,omitempty"` - Read bool `protobuf:"varint,6,opt,name=read,proto3" json:"read,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IndividualCall) Reset() { - *x = IndividualCall{} - mi := &file_backuppb_Backup_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IndividualCall) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IndividualCall) ProtoMessage() {} - -func (x *IndividualCall) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[35] - 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 IndividualCall.ProtoReflect.Descriptor instead. -func (*IndividualCall) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{35} -} - -func (x *IndividualCall) GetCallId() uint64 { - if x != nil && x.CallId != nil { - return *x.CallId - } - return 0 -} - -func (x *IndividualCall) GetType() IndividualCall_Type { - if x != nil { - return x.Type - } - return IndividualCall_UNKNOWN_TYPE -} - -func (x *IndividualCall) GetDirection() IndividualCall_Direction { - if x != nil { - return x.Direction - } - return IndividualCall_UNKNOWN_DIRECTION -} - -func (x *IndividualCall) GetState() IndividualCall_State { - if x != nil { - return x.State - } - return IndividualCall_UNKNOWN_STATE -} - -func (x *IndividualCall) GetStartedCallTimestamp() uint64 { - if x != nil { - return x.StartedCallTimestamp - } - return 0 -} - -func (x *IndividualCall) GetRead() bool { - if x != nil { - return x.Read - } - return false -} - -type GroupCall struct { - state protoimpl.MessageState `protogen:"open.v1"` - CallId *uint64 `protobuf:"varint,1,opt,name=callId,proto3,oneof" json:"callId,omitempty"` - State GroupCall_State `protobuf:"varint,2,opt,name=state,proto3,enum=signal.backup.GroupCall_State" json:"state,omitempty"` - RingerRecipientId *uint64 `protobuf:"varint,3,opt,name=ringerRecipientId,proto3,oneof" json:"ringerRecipientId,omitempty"` - StartedCallRecipientId *uint64 `protobuf:"varint,4,opt,name=startedCallRecipientId,proto3,oneof" json:"startedCallRecipientId,omitempty"` - StartedCallTimestamp uint64 `protobuf:"varint,5,opt,name=startedCallTimestamp,proto3" json:"startedCallTimestamp,omitempty"` - EndedCallTimestamp *uint64 `protobuf:"varint,6,opt,name=endedCallTimestamp,proto3,oneof" json:"endedCallTimestamp,omitempty"` // The time the call ended. - Read bool `protobuf:"varint,7,opt,name=read,proto3" json:"read,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupCall) Reset() { - *x = GroupCall{} - mi := &file_backuppb_Backup_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupCall) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupCall) ProtoMessage() {} - -func (x *GroupCall) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[36] - 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 GroupCall.ProtoReflect.Descriptor instead. -func (*GroupCall) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{36} -} - -func (x *GroupCall) GetCallId() uint64 { - if x != nil && x.CallId != nil { - return *x.CallId - } - return 0 -} - -func (x *GroupCall) GetState() GroupCall_State { - if x != nil { - return x.State - } - return GroupCall_UNKNOWN_STATE -} - -func (x *GroupCall) GetRingerRecipientId() uint64 { - if x != nil && x.RingerRecipientId != nil { - return *x.RingerRecipientId - } - return 0 -} - -func (x *GroupCall) GetStartedCallRecipientId() uint64 { - if x != nil && x.StartedCallRecipientId != nil { - return *x.StartedCallRecipientId - } - return 0 -} - -func (x *GroupCall) GetStartedCallTimestamp() uint64 { - if x != nil { - return x.StartedCallTimestamp - } - return 0 -} - -func (x *GroupCall) GetEndedCallTimestamp() uint64 { - if x != nil && x.EndedCallTimestamp != nil { - return *x.EndedCallTimestamp - } - return 0 -} - -func (x *GroupCall) GetRead() bool { - if x != nil { - return x.Read - } - return false -} - -type SimpleChatUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type SimpleChatUpdate_Type `protobuf:"varint,1,opt,name=type,proto3,enum=signal.backup.SimpleChatUpdate_Type" json:"type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SimpleChatUpdate) Reset() { - *x = SimpleChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SimpleChatUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleChatUpdate) ProtoMessage() {} - -func (x *SimpleChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 SimpleChatUpdate.ProtoReflect.Descriptor instead. -func (*SimpleChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{37} -} - -func (x *SimpleChatUpdate) GetType() SimpleChatUpdate_Type { - if x != nil { - return x.Type - } - return SimpleChatUpdate_UNKNOWN -} - -// For 1:1 chat updates only. -// For group thread updates use GroupExpirationTimerUpdate. -type ExpirationTimerChatUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - ExpiresInMs uint64 `protobuf:"varint,1,opt,name=expiresInMs,proto3" json:"expiresInMs,omitempty"` // 0 means the expiration timer was disabled - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExpirationTimerChatUpdate) Reset() { - *x = ExpirationTimerChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExpirationTimerChatUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExpirationTimerChatUpdate) ProtoMessage() {} - -func (x *ExpirationTimerChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 ExpirationTimerChatUpdate.ProtoReflect.Descriptor instead. -func (*ExpirationTimerChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{38} -} - -func (x *ExpirationTimerChatUpdate) GetExpiresInMs() uint64 { - if x != nil { - return x.ExpiresInMs - } - return 0 -} - -type ProfileChangeChatUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - PreviousName string `protobuf:"bytes,1,opt,name=previousName,proto3" json:"previousName,omitempty"` - NewName string `protobuf:"bytes,2,opt,name=newName,proto3" json:"newName,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProfileChangeChatUpdate) Reset() { - *x = ProfileChangeChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProfileChangeChatUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProfileChangeChatUpdate) ProtoMessage() {} - -func (x *ProfileChangeChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 ProfileChangeChatUpdate.ProtoReflect.Descriptor instead. -func (*ProfileChangeChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{39} -} - -func (x *ProfileChangeChatUpdate) GetPreviousName() string { - if x != nil { - return x.PreviousName - } - return "" -} - -func (x *ProfileChangeChatUpdate) GetNewName() string { - if x != nil { - return x.NewName - } - return "" -} - -type LearnedProfileChatUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If unset, importers should consider the previous name to be an empty string. - // - // Types that are valid to be assigned to PreviousName: - // - // *LearnedProfileChatUpdate_E164 - // *LearnedProfileChatUpdate_Username - PreviousName isLearnedProfileChatUpdate_PreviousName `protobuf_oneof:"previousName"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LearnedProfileChatUpdate) Reset() { - *x = LearnedProfileChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LearnedProfileChatUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LearnedProfileChatUpdate) ProtoMessage() {} - -func (x *LearnedProfileChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 LearnedProfileChatUpdate.ProtoReflect.Descriptor instead. -func (*LearnedProfileChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{40} -} - -func (x *LearnedProfileChatUpdate) GetPreviousName() isLearnedProfileChatUpdate_PreviousName { - if x != nil { - return x.PreviousName - } - return nil -} - -func (x *LearnedProfileChatUpdate) GetE164() uint64 { - if x != nil { - if x, ok := x.PreviousName.(*LearnedProfileChatUpdate_E164); ok { - return x.E164 - } - } - return 0 -} - -func (x *LearnedProfileChatUpdate) GetUsername() string { - if x != nil { - if x, ok := x.PreviousName.(*LearnedProfileChatUpdate_Username); ok { - return x.Username - } - } - return "" -} - -type isLearnedProfileChatUpdate_PreviousName interface { - isLearnedProfileChatUpdate_PreviousName() -} - -type LearnedProfileChatUpdate_E164 struct { - E164 uint64 `protobuf:"varint,1,opt,name=e164,proto3,oneof"` -} - -type LearnedProfileChatUpdate_Username struct { - Username string `protobuf:"bytes,2,opt,name=username,proto3,oneof"` -} - -func (*LearnedProfileChatUpdate_E164) isLearnedProfileChatUpdate_PreviousName() {} - -func (*LearnedProfileChatUpdate_Username) isLearnedProfileChatUpdate_PreviousName() {} - -type ThreadMergeChatUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - PreviousE164 uint64 `protobuf:"varint,1,opt,name=previousE164,proto3" json:"previousE164,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ThreadMergeChatUpdate) Reset() { - *x = ThreadMergeChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ThreadMergeChatUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ThreadMergeChatUpdate) ProtoMessage() {} - -func (x *ThreadMergeChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 ThreadMergeChatUpdate.ProtoReflect.Descriptor instead. -func (*ThreadMergeChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{41} -} - -func (x *ThreadMergeChatUpdate) GetPreviousE164() uint64 { - if x != nil { - return x.PreviousE164 - } - return 0 -} - -type SessionSwitchoverChatUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - E164 uint64 `protobuf:"varint,1,opt,name=e164,proto3" json:"e164,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SessionSwitchoverChatUpdate) Reset() { - *x = SessionSwitchoverChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SessionSwitchoverChatUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SessionSwitchoverChatUpdate) ProtoMessage() {} - -func (x *SessionSwitchoverChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_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 SessionSwitchoverChatUpdate.ProtoReflect.Descriptor instead. -func (*SessionSwitchoverChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{42} -} - -func (x *SessionSwitchoverChatUpdate) GetE164() uint64 { - if x != nil { - return x.E164 - } - return 0 -} - -type GroupChangeChatUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Must be one or more; all updates batched together came from - // a single batched group state update. - Updates []*GroupChangeChatUpdate_Update `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChangeChatUpdate) Reset() { - *x = GroupChangeChatUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChangeChatUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChangeChatUpdate) ProtoMessage() {} - -func (x *GroupChangeChatUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[43] - 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 GroupChangeChatUpdate.ProtoReflect.Descriptor instead. -func (*GroupChangeChatUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{43} -} - -func (x *GroupChangeChatUpdate) GetUpdates() []*GroupChangeChatUpdate_Update { - if x != nil { - return x.Updates - } - return nil -} - -type GenericGroupUpdate 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 *GenericGroupUpdate) Reset() { - *x = GenericGroupUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenericGroupUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenericGroupUpdate) ProtoMessage() {} - -func (x *GenericGroupUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[44] - 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 GenericGroupUpdate.ProtoReflect.Descriptor instead. -func (*GenericGroupUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{44} -} - -func (x *GenericGroupUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -type GroupCreationUpdate 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 *GroupCreationUpdate) Reset() { - *x = GroupCreationUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupCreationUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupCreationUpdate) ProtoMessage() {} - -func (x *GroupCreationUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[45] - 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 GroupCreationUpdate.ProtoReflect.Descriptor instead. -func (*GroupCreationUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{45} -} - -func (x *GroupCreationUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -type GroupNameUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - // Null value means the group name was removed. - NewGroupName *string `protobuf:"bytes,2,opt,name=newGroupName,proto3,oneof" json:"newGroupName,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupNameUpdate) Reset() { - *x = GroupNameUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupNameUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupNameUpdate) ProtoMessage() {} - -func (x *GroupNameUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[46] - 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 GroupNameUpdate.ProtoReflect.Descriptor instead. -func (*GroupNameUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{46} -} - -func (x *GroupNameUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupNameUpdate) GetNewGroupName() string { - if x != nil && x.NewGroupName != nil { - return *x.NewGroupName - } - return "" -} - -type GroupAvatarUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - WasRemoved bool `protobuf:"varint,2,opt,name=wasRemoved,proto3" json:"wasRemoved,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupAvatarUpdate) Reset() { - *x = GroupAvatarUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupAvatarUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupAvatarUpdate) ProtoMessage() {} - -func (x *GroupAvatarUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[47] - 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 GroupAvatarUpdate.ProtoReflect.Descriptor instead. -func (*GroupAvatarUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{47} -} - -func (x *GroupAvatarUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupAvatarUpdate) GetWasRemoved() bool { - if x != nil { - return x.WasRemoved - } - return false -} - -type GroupDescriptionUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - // Null value means the group description was removed. - NewDescription *string `protobuf:"bytes,2,opt,name=newDescription,proto3,oneof" json:"newDescription,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupDescriptionUpdate) Reset() { - *x = GroupDescriptionUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupDescriptionUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupDescriptionUpdate) ProtoMessage() {} - -func (x *GroupDescriptionUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[48] - 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 GroupDescriptionUpdate.ProtoReflect.Descriptor instead. -func (*GroupDescriptionUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{48} -} - -func (x *GroupDescriptionUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupDescriptionUpdate) GetNewDescription() string { - if x != nil && x.NewDescription != nil { - return *x.NewDescription - } - return "" -} - -type GroupMembershipAccessLevelChangeUpdate 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 *GroupMembershipAccessLevelChangeUpdate) Reset() { - *x = GroupMembershipAccessLevelChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMembershipAccessLevelChangeUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMembershipAccessLevelChangeUpdate) ProtoMessage() {} - -func (x *GroupMembershipAccessLevelChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[49] - 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 GroupMembershipAccessLevelChangeUpdate.ProtoReflect.Descriptor instead. -func (*GroupMembershipAccessLevelChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{49} -} - -func (x *GroupMembershipAccessLevelChangeUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupMembershipAccessLevelChangeUpdate) GetAccessLevel() GroupV2AccessLevel { - if x != nil { - return x.AccessLevel - } - return GroupV2AccessLevel_UNKNOWN -} - -type GroupAttributesAccessLevelChangeUpdate 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 *GroupAttributesAccessLevelChangeUpdate) Reset() { - *x = GroupAttributesAccessLevelChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupAttributesAccessLevelChangeUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupAttributesAccessLevelChangeUpdate) ProtoMessage() {} - -func (x *GroupAttributesAccessLevelChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[50] - 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 GroupAttributesAccessLevelChangeUpdate.ProtoReflect.Descriptor instead. -func (*GroupAttributesAccessLevelChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{50} -} - -func (x *GroupAttributesAccessLevelChangeUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupAttributesAccessLevelChangeUpdate) GetAccessLevel() GroupV2AccessLevel { - if x != nil { - return x.AccessLevel - } - 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"` - IsAnnouncementOnly bool `protobuf:"varint,2,opt,name=isAnnouncementOnly,proto3" json:"isAnnouncementOnly,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupAnnouncementOnlyChangeUpdate) Reset() { - *x = GroupAnnouncementOnlyChangeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupAnnouncementOnlyChangeUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupAnnouncementOnlyChangeUpdate) ProtoMessage() {} - -func (x *GroupAnnouncementOnlyChangeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[53] - 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 GroupAnnouncementOnlyChangeUpdate.ProtoReflect.Descriptor instead. -func (*GroupAnnouncementOnlyChangeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{53} -} - -func (x *GroupAnnouncementOnlyChangeUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupAnnouncementOnlyChangeUpdate) GetIsAnnouncementOnly() bool { - if x != nil { - return x.IsAnnouncementOnly - } - return false -} - -type GroupAdminStatusUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - // The aci who had admin status granted or revoked. - MemberAci []byte `protobuf:"bytes,2,opt,name=memberAci,proto3" json:"memberAci,omitempty"` - WasAdminStatusGranted bool `protobuf:"varint,3,opt,name=wasAdminStatusGranted,proto3" json:"wasAdminStatusGranted,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupAdminStatusUpdate) Reset() { - *x = GroupAdminStatusUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupAdminStatusUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupAdminStatusUpdate) ProtoMessage() {} - -func (x *GroupAdminStatusUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[54] - 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 GroupAdminStatusUpdate.ProtoReflect.Descriptor instead. -func (*GroupAdminStatusUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{54} -} - -func (x *GroupAdminStatusUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupAdminStatusUpdate) GetMemberAci() []byte { - if x != nil { - return x.MemberAci - } - return nil -} - -func (x *GroupAdminStatusUpdate) GetWasAdminStatusGranted() bool { - if x != nil { - return x.WasAdminStatusGranted - } - return false -} - -type GroupMemberLeftUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - Aci []byte `protobuf:"bytes,1,opt,name=aci,proto3" json:"aci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupMemberLeftUpdate) Reset() { - *x = GroupMemberLeftUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMemberLeftUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberLeftUpdate) ProtoMessage() {} - -func (x *GroupMemberLeftUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[55] - 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 GroupMemberLeftUpdate.ProtoReflect.Descriptor instead. -func (*GroupMemberLeftUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{55} -} - -func (x *GroupMemberLeftUpdate) GetAci() []byte { - if x != nil { - return x.Aci - } - return nil -} - -type GroupMemberRemovedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - RemoverAci []byte `protobuf:"bytes,1,opt,name=removerAci,proto3,oneof" json:"removerAci,omitempty"` - RemovedAci []byte `protobuf:"bytes,2,opt,name=removedAci,proto3" json:"removedAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupMemberRemovedUpdate) Reset() { - *x = GroupMemberRemovedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMemberRemovedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberRemovedUpdate) ProtoMessage() {} - -func (x *GroupMemberRemovedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[56] - 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 GroupMemberRemovedUpdate.ProtoReflect.Descriptor instead. -func (*GroupMemberRemovedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{56} -} - -func (x *GroupMemberRemovedUpdate) GetRemoverAci() []byte { - if x != nil { - return x.RemoverAci - } - return nil -} - -func (x *GroupMemberRemovedUpdate) GetRemovedAci() []byte { - if x != nil { - return x.RemovedAci - } - return nil -} - -type SelfInvitedToGroupUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - InviterAci []byte `protobuf:"bytes,1,opt,name=inviterAci,proto3,oneof" json:"inviterAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SelfInvitedToGroupUpdate) Reset() { - *x = SelfInvitedToGroupUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[57] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SelfInvitedToGroupUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SelfInvitedToGroupUpdate) ProtoMessage() {} - -func (x *SelfInvitedToGroupUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[57] - 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 SelfInvitedToGroupUpdate.ProtoReflect.Descriptor instead. -func (*SelfInvitedToGroupUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{57} -} - -func (x *SelfInvitedToGroupUpdate) GetInviterAci() []byte { - if x != nil { - return x.InviterAci - } - return nil -} - -type SelfInvitedOtherUserToGroupUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If no invitee id available, use GroupUnknownInviteeUpdate - InviteeServiceId []byte `protobuf:"bytes,1,opt,name=inviteeServiceId,proto3" json:"inviteeServiceId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SelfInvitedOtherUserToGroupUpdate) Reset() { - *x = SelfInvitedOtherUserToGroupUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[58] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SelfInvitedOtherUserToGroupUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SelfInvitedOtherUserToGroupUpdate) ProtoMessage() {} - -func (x *SelfInvitedOtherUserToGroupUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[58] - 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 SelfInvitedOtherUserToGroupUpdate.ProtoReflect.Descriptor instead. -func (*SelfInvitedOtherUserToGroupUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{58} -} - -func (x *SelfInvitedOtherUserToGroupUpdate) GetInviteeServiceId() []byte { - if x != nil { - return x.InviteeServiceId - } - return nil -} - -type GroupUnknownInviteeUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Can be the self user. - InviterAci []byte `protobuf:"bytes,1,opt,name=inviterAci,proto3,oneof" json:"inviterAci,omitempty"` - InviteeCount uint32 `protobuf:"varint,2,opt,name=inviteeCount,proto3" json:"inviteeCount,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupUnknownInviteeUpdate) Reset() { - *x = GroupUnknownInviteeUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[59] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupUnknownInviteeUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupUnknownInviteeUpdate) ProtoMessage() {} - -func (x *GroupUnknownInviteeUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[59] - 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 GroupUnknownInviteeUpdate.ProtoReflect.Descriptor instead. -func (*GroupUnknownInviteeUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{59} -} - -func (x *GroupUnknownInviteeUpdate) GetInviterAci() []byte { - if x != nil { - return x.InviterAci - } - return nil -} - -func (x *GroupUnknownInviteeUpdate) GetInviteeCount() uint32 { - if x != nil { - return x.InviteeCount - } - return 0 -} - -type GroupInvitationAcceptedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - InviterAci []byte `protobuf:"bytes,1,opt,name=inviterAci,proto3,oneof" json:"inviterAci,omitempty"` - NewMemberAci []byte `protobuf:"bytes,2,opt,name=newMemberAci,proto3" json:"newMemberAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInvitationAcceptedUpdate) Reset() { - *x = GroupInvitationAcceptedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[60] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInvitationAcceptedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInvitationAcceptedUpdate) ProtoMessage() {} - -func (x *GroupInvitationAcceptedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[60] - 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 GroupInvitationAcceptedUpdate.ProtoReflect.Descriptor instead. -func (*GroupInvitationAcceptedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{60} -} - -func (x *GroupInvitationAcceptedUpdate) GetInviterAci() []byte { - if x != nil { - return x.InviterAci - } - return nil -} - -func (x *GroupInvitationAcceptedUpdate) GetNewMemberAci() []byte { - if x != nil { - return x.NewMemberAci - } - return nil -} - -type GroupInvitationDeclinedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - InviterAci []byte `protobuf:"bytes,1,opt,name=inviterAci,proto3,oneof" json:"inviterAci,omitempty"` - // Note: if invited by pni, just set inviteeAci to nil. - InviteeAci []byte `protobuf:"bytes,2,opt,name=inviteeAci,proto3,oneof" json:"inviteeAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInvitationDeclinedUpdate) Reset() { - *x = GroupInvitationDeclinedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[61] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInvitationDeclinedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInvitationDeclinedUpdate) ProtoMessage() {} - -func (x *GroupInvitationDeclinedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[61] - 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 GroupInvitationDeclinedUpdate.ProtoReflect.Descriptor instead. -func (*GroupInvitationDeclinedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{61} -} - -func (x *GroupInvitationDeclinedUpdate) GetInviterAci() []byte { - if x != nil { - return x.InviterAci - } - return nil -} - -func (x *GroupInvitationDeclinedUpdate) GetInviteeAci() []byte { - if x != nil { - return x.InviteeAci - } - return nil -} - -type GroupMemberJoinedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - NewMemberAci []byte `protobuf:"bytes,1,opt,name=newMemberAci,proto3" json:"newMemberAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupMemberJoinedUpdate) Reset() { - *x = GroupMemberJoinedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[62] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMemberJoinedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberJoinedUpdate) ProtoMessage() {} - -func (x *GroupMemberJoinedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[62] - 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 GroupMemberJoinedUpdate.ProtoReflect.Descriptor instead. -func (*GroupMemberJoinedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{62} -} - -func (x *GroupMemberJoinedUpdate) GetNewMemberAci() []byte { - if x != nil { - return x.NewMemberAci - } - return nil -} - -type GroupMemberAddedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - NewMemberAci []byte `protobuf:"bytes,2,opt,name=newMemberAci,proto3" json:"newMemberAci,omitempty"` - HadOpenInvitation bool `protobuf:"varint,3,opt,name=hadOpenInvitation,proto3" json:"hadOpenInvitation,omitempty"` - // If hadOpenInvitation is true, optionally include aci of the inviter. - InviterAci []byte `protobuf:"bytes,4,opt,name=inviterAci,proto3,oneof" json:"inviterAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupMemberAddedUpdate) Reset() { - *x = GroupMemberAddedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[63] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMemberAddedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberAddedUpdate) ProtoMessage() {} - -func (x *GroupMemberAddedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[63] - 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 GroupMemberAddedUpdate.ProtoReflect.Descriptor instead. -func (*GroupMemberAddedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{63} -} - -func (x *GroupMemberAddedUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupMemberAddedUpdate) GetNewMemberAci() []byte { - if x != nil { - return x.NewMemberAci - } - return nil -} - -func (x *GroupMemberAddedUpdate) GetHadOpenInvitation() bool { - if x != nil { - return x.HadOpenInvitation - } - return false -} - -func (x *GroupMemberAddedUpdate) GetInviterAci() []byte { - if x != nil { - return x.InviterAci - } - return nil -} - -// An invitation to self was revoked. -type GroupSelfInvitationRevokedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - RevokerAci []byte `protobuf:"bytes,1,opt,name=revokerAci,proto3,oneof" json:"revokerAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupSelfInvitationRevokedUpdate) Reset() { - *x = GroupSelfInvitationRevokedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[64] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupSelfInvitationRevokedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupSelfInvitationRevokedUpdate) ProtoMessage() {} - -func (x *GroupSelfInvitationRevokedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[64] - 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 GroupSelfInvitationRevokedUpdate.ProtoReflect.Descriptor instead. -func (*GroupSelfInvitationRevokedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{64} -} - -func (x *GroupSelfInvitationRevokedUpdate) GetRevokerAci() []byte { - if x != nil { - return x.RevokerAci - } - return nil -} - -// These invitees should never be the local user. -// Use GroupSelfInvitationRevokedUpdate in those cases. -// The inviter or updater can be the local user. -type GroupInvitationRevokedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The member that revoked the invite(s), not the inviter! - // Assumed to be an admin (at the time, may no longer be an - // admin or even a member). - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - Invitees []*GroupInvitationRevokedUpdate_Invitee `protobuf:"bytes,2,rep,name=invitees,proto3" json:"invitees,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInvitationRevokedUpdate) Reset() { - *x = GroupInvitationRevokedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[65] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInvitationRevokedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInvitationRevokedUpdate) ProtoMessage() {} - -func (x *GroupInvitationRevokedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[65] - 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 GroupInvitationRevokedUpdate.ProtoReflect.Descriptor instead. -func (*GroupInvitationRevokedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{65} -} - -func (x *GroupInvitationRevokedUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupInvitationRevokedUpdate) GetInvitees() []*GroupInvitationRevokedUpdate_Invitee { - if x != nil { - return x.Invitees - } - return nil -} - -type GroupJoinRequestUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestorAci []byte `protobuf:"bytes,1,opt,name=requestorAci,proto3" json:"requestorAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupJoinRequestUpdate) Reset() { - *x = GroupJoinRequestUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[66] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupJoinRequestUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupJoinRequestUpdate) ProtoMessage() {} - -func (x *GroupJoinRequestUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[66] - 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 GroupJoinRequestUpdate.ProtoReflect.Descriptor instead. -func (*GroupJoinRequestUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{66} -} - -func (x *GroupJoinRequestUpdate) GetRequestorAci() []byte { - if x != nil { - return x.RequestorAci - } - return nil -} - -type GroupJoinRequestApprovalUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestorAci []byte `protobuf:"bytes,1,opt,name=requestorAci,proto3" json:"requestorAci,omitempty"` - // The aci that approved or rejected the request. - UpdaterAci []byte `protobuf:"bytes,2,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - WasApproved bool `protobuf:"varint,3,opt,name=wasApproved,proto3" json:"wasApproved,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupJoinRequestApprovalUpdate) Reset() { - *x = GroupJoinRequestApprovalUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[67] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupJoinRequestApprovalUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupJoinRequestApprovalUpdate) ProtoMessage() {} - -func (x *GroupJoinRequestApprovalUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[67] - 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 GroupJoinRequestApprovalUpdate.ProtoReflect.Descriptor instead. -func (*GroupJoinRequestApprovalUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{67} -} - -func (x *GroupJoinRequestApprovalUpdate) GetRequestorAci() []byte { - if x != nil { - return x.RequestorAci - } - return nil -} - -func (x *GroupJoinRequestApprovalUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupJoinRequestApprovalUpdate) GetWasApproved() bool { - if x != nil { - return x.WasApproved - } - return false -} - -type GroupJoinRequestCanceledUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestorAci []byte `protobuf:"bytes,1,opt,name=requestorAci,proto3" json:"requestorAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupJoinRequestCanceledUpdate) Reset() { - *x = GroupJoinRequestCanceledUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[68] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupJoinRequestCanceledUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupJoinRequestCanceledUpdate) ProtoMessage() {} - -func (x *GroupJoinRequestCanceledUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[68] - 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 GroupJoinRequestCanceledUpdate.ProtoReflect.Descriptor instead. -func (*GroupJoinRequestCanceledUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{68} -} - -func (x *GroupJoinRequestCanceledUpdate) GetRequestorAci() []byte { - if x != nil { - return x.RequestorAci - } - return nil -} - -// A single requestor has requested to join and cancelled -// their request repeatedly with no other updates in between. -// The last action encompassed by this update is always a -// cancellation; if there was another open request immediately -// after, it will be a separate GroupJoinRequestUpdate, either -// in the same frame or in a subsequent frame. -type GroupSequenceOfRequestsAndCancelsUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestorAci []byte `protobuf:"bytes,1,opt,name=requestorAci,proto3" json:"requestorAci,omitempty"` - Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupSequenceOfRequestsAndCancelsUpdate) Reset() { - *x = GroupSequenceOfRequestsAndCancelsUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[69] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupSequenceOfRequestsAndCancelsUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupSequenceOfRequestsAndCancelsUpdate) ProtoMessage() {} - -func (x *GroupSequenceOfRequestsAndCancelsUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[69] - 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 GroupSequenceOfRequestsAndCancelsUpdate.ProtoReflect.Descriptor instead. -func (*GroupSequenceOfRequestsAndCancelsUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{69} -} - -func (x *GroupSequenceOfRequestsAndCancelsUpdate) GetRequestorAci() []byte { - if x != nil { - return x.RequestorAci - } - return nil -} - -func (x *GroupSequenceOfRequestsAndCancelsUpdate) GetCount() uint32 { - if x != nil { - return x.Count - } - return 0 -} - -type GroupInviteLinkResetUpdate 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 *GroupInviteLinkResetUpdate) Reset() { - *x = GroupInviteLinkResetUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[70] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInviteLinkResetUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInviteLinkResetUpdate) ProtoMessage() {} - -func (x *GroupInviteLinkResetUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[70] - 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 GroupInviteLinkResetUpdate.ProtoReflect.Descriptor instead. -func (*GroupInviteLinkResetUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{70} -} - -func (x *GroupInviteLinkResetUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -type GroupInviteLinkEnabledUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - LinkRequiresAdminApproval bool `protobuf:"varint,2,opt,name=linkRequiresAdminApproval,proto3" json:"linkRequiresAdminApproval,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInviteLinkEnabledUpdate) Reset() { - *x = GroupInviteLinkEnabledUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[71] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInviteLinkEnabledUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInviteLinkEnabledUpdate) ProtoMessage() {} - -func (x *GroupInviteLinkEnabledUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[71] - 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 GroupInviteLinkEnabledUpdate.ProtoReflect.Descriptor instead. -func (*GroupInviteLinkEnabledUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{71} -} - -func (x *GroupInviteLinkEnabledUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupInviteLinkEnabledUpdate) GetLinkRequiresAdminApproval() bool { - if x != nil { - return x.LinkRequiresAdminApproval - } - return false -} - -type GroupInviteLinkAdminApprovalUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - UpdaterAci []byte `protobuf:"bytes,1,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - LinkRequiresAdminApproval bool `protobuf:"varint,2,opt,name=linkRequiresAdminApproval,proto3" json:"linkRequiresAdminApproval,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInviteLinkAdminApprovalUpdate) Reset() { - *x = GroupInviteLinkAdminApprovalUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[72] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInviteLinkAdminApprovalUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInviteLinkAdminApprovalUpdate) ProtoMessage() {} - -func (x *GroupInviteLinkAdminApprovalUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[72] - 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 GroupInviteLinkAdminApprovalUpdate.ProtoReflect.Descriptor instead. -func (*GroupInviteLinkAdminApprovalUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{72} -} - -func (x *GroupInviteLinkAdminApprovalUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -func (x *GroupInviteLinkAdminApprovalUpdate) GetLinkRequiresAdminApproval() bool { - if x != nil { - return x.LinkRequiresAdminApproval - } - return false -} - -type GroupInviteLinkDisabledUpdate 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 *GroupInviteLinkDisabledUpdate) Reset() { - *x = GroupInviteLinkDisabledUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[73] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInviteLinkDisabledUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInviteLinkDisabledUpdate) ProtoMessage() {} - -func (x *GroupInviteLinkDisabledUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[73] - 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 GroupInviteLinkDisabledUpdate.ProtoReflect.Descriptor instead. -func (*GroupInviteLinkDisabledUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{73} -} - -func (x *GroupInviteLinkDisabledUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - return nil -} - -type GroupMemberJoinedByLinkUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - NewMemberAci []byte `protobuf:"bytes,1,opt,name=newMemberAci,proto3" json:"newMemberAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupMemberJoinedByLinkUpdate) Reset() { - *x = GroupMemberJoinedByLinkUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[74] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupMemberJoinedByLinkUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupMemberJoinedByLinkUpdate) ProtoMessage() {} - -func (x *GroupMemberJoinedByLinkUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[74] - 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 GroupMemberJoinedByLinkUpdate.ProtoReflect.Descriptor instead. -func (*GroupMemberJoinedByLinkUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{74} -} - -func (x *GroupMemberJoinedByLinkUpdate) GetNewMemberAci() []byte { - if x != nil { - return x.NewMemberAci - } - return nil -} - -// A gv1->gv2 migration occurred. -type GroupV2MigrationUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupV2MigrationUpdate) Reset() { - *x = GroupV2MigrationUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[75] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupV2MigrationUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupV2MigrationUpdate) ProtoMessage() {} - -func (x *GroupV2MigrationUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[75] - 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 GroupV2MigrationUpdate.ProtoReflect.Descriptor instead. -func (*GroupV2MigrationUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{75} -} - -// Another user migrated gv1->gv2 but was unable to add -// the local user and invited them instead. -type GroupV2MigrationSelfInvitedUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupV2MigrationSelfInvitedUpdate) Reset() { - *x = GroupV2MigrationSelfInvitedUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[76] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupV2MigrationSelfInvitedUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupV2MigrationSelfInvitedUpdate) ProtoMessage() {} - -func (x *GroupV2MigrationSelfInvitedUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[76] - 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 GroupV2MigrationSelfInvitedUpdate.ProtoReflect.Descriptor instead. -func (*GroupV2MigrationSelfInvitedUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{76} -} - -// The local user migrated gv1->gv2 but was unable to -// add some members and invited them instead. -// (Happens if we don't have the invitee's profile key) -type GroupV2MigrationInvitedMembersUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - InvitedMembersCount uint32 `protobuf:"varint,1,opt,name=invitedMembersCount,proto3" json:"invitedMembersCount,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupV2MigrationInvitedMembersUpdate) Reset() { - *x = GroupV2MigrationInvitedMembersUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[77] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupV2MigrationInvitedMembersUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupV2MigrationInvitedMembersUpdate) ProtoMessage() {} - -func (x *GroupV2MigrationInvitedMembersUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[77] - 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 GroupV2MigrationInvitedMembersUpdate.ProtoReflect.Descriptor instead. -func (*GroupV2MigrationInvitedMembersUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{77} -} - -func (x *GroupV2MigrationInvitedMembersUpdate) GetInvitedMembersCount() uint32 { - if x != nil { - return x.InvitedMembersCount - } - return 0 -} - -// The local user migrated gv1->gv2 but was unable to -// add or invite some members and dropped them instead. -// (Happens for e164 members where we don't have an aci). -type GroupV2MigrationDroppedMembersUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - DroppedMembersCount uint32 `protobuf:"varint,1,opt,name=droppedMembersCount,proto3" json:"droppedMembersCount,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupV2MigrationDroppedMembersUpdate) Reset() { - *x = GroupV2MigrationDroppedMembersUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[78] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupV2MigrationDroppedMembersUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupV2MigrationDroppedMembersUpdate) ProtoMessage() {} - -func (x *GroupV2MigrationDroppedMembersUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[78] - 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 GroupV2MigrationDroppedMembersUpdate.ProtoReflect.Descriptor instead. -func (*GroupV2MigrationDroppedMembersUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{78} -} - -func (x *GroupV2MigrationDroppedMembersUpdate) GetDroppedMembersCount() uint32 { - if x != nil { - return x.DroppedMembersCount - } - return 0 -} - -// For 1:1 timer updates, use ExpirationTimerChatUpdate. -type GroupExpirationTimerUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - ExpiresInMs uint64 `protobuf:"varint,1,opt,name=expiresInMs,proto3" json:"expiresInMs,omitempty"` // 0 means the expiration timer was disabled - UpdaterAci []byte `protobuf:"bytes,2,opt,name=updaterAci,proto3,oneof" json:"updaterAci,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupExpirationTimerUpdate) Reset() { - *x = GroupExpirationTimerUpdate{} - mi := &file_backuppb_Backup_proto_msgTypes[79] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupExpirationTimerUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupExpirationTimerUpdate) ProtoMessage() {} - -func (x *GroupExpirationTimerUpdate) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[79] - 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 GroupExpirationTimerUpdate.ProtoReflect.Descriptor instead. -func (*GroupExpirationTimerUpdate) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{79} -} - -func (x *GroupExpirationTimerUpdate) GetExpiresInMs() uint64 { - if x != nil { - return x.ExpiresInMs - } - return 0 -} - -func (x *GroupExpirationTimerUpdate) GetUpdaterAci() []byte { - if x != nil { - return x.UpdaterAci - } - 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"` - PackKey []byte `protobuf:"bytes,2,opt,name=packKey,proto3" json:"packKey,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StickerPack) Reset() { - *x = StickerPack{} - mi := &file_backuppb_Backup_proto_msgTypes[82] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StickerPack) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StickerPack) ProtoMessage() {} - -func (x *StickerPack) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[82] - 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 StickerPack.ProtoReflect.Descriptor instead. -func (*StickerPack) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{82} -} - -func (x *StickerPack) GetPackId() []byte { - if x != nil { - return x.PackId - } - return nil -} - -func (x *StickerPack) GetPackKey() []byte { - if x != nil { - return x.PackKey - } - return nil -} - -type ChatStyle struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If unset, importers should consider there to be no wallpaper. - // - // Types that are valid to be assigned to Wallpaper: - // - // *ChatStyle_WallpaperPreset_ - // *ChatStyle_WallpaperPhoto - Wallpaper isChatStyle_Wallpaper `protobuf_oneof:"wallpaper"` - // If unset, importers should consider it to be AutomaticBubbleColor - // - // Types that are valid to be assigned to BubbleColor: - // - // *ChatStyle_AutoBubbleColor - // *ChatStyle_BubbleColorPreset_ - // *ChatStyle_CustomColorId - BubbleColor isChatStyle_BubbleColor `protobuf_oneof:"bubbleColor"` - DimWallpaperInDarkMode bool `protobuf:"varint,7,opt,name=dimWallpaperInDarkMode,proto3" json:"dimWallpaperInDarkMode,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatStyle) Reset() { - *x = ChatStyle{} - mi := &file_backuppb_Backup_proto_msgTypes[83] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatStyle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatStyle) ProtoMessage() {} - -func (x *ChatStyle) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[83] - 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 ChatStyle.ProtoReflect.Descriptor instead. -func (*ChatStyle) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83} -} - -func (x *ChatStyle) GetWallpaper() isChatStyle_Wallpaper { - if x != nil { - return x.Wallpaper - } - return nil -} - -func (x *ChatStyle) GetWallpaperPreset() ChatStyle_WallpaperPreset { - if x != nil { - if x, ok := x.Wallpaper.(*ChatStyle_WallpaperPreset_); ok { - return x.WallpaperPreset - } - } - return ChatStyle_UNKNOWN_WALLPAPER_PRESET -} - -func (x *ChatStyle) GetWallpaperPhoto() *FilePointer { - if x != nil { - if x, ok := x.Wallpaper.(*ChatStyle_WallpaperPhoto); ok { - return x.WallpaperPhoto - } - } - return nil -} - -func (x *ChatStyle) GetBubbleColor() isChatStyle_BubbleColor { - if x != nil { - return x.BubbleColor - } - return nil -} - -func (x *ChatStyle) GetAutoBubbleColor() *ChatStyle_AutomaticBubbleColor { - if x != nil { - if x, ok := x.BubbleColor.(*ChatStyle_AutoBubbleColor); ok { - return x.AutoBubbleColor - } - } - return nil -} - -func (x *ChatStyle) GetBubbleColorPreset() ChatStyle_BubbleColorPreset { - if x != nil { - if x, ok := x.BubbleColor.(*ChatStyle_BubbleColorPreset_); ok { - return x.BubbleColorPreset - } - } - return ChatStyle_UNKNOWN_BUBBLE_COLOR_PRESET -} - -func (x *ChatStyle) GetCustomColorId() uint64 { - if x != nil { - if x, ok := x.BubbleColor.(*ChatStyle_CustomColorId); ok { - return x.CustomColorId - } - } - return 0 -} - -func (x *ChatStyle) GetDimWallpaperInDarkMode() bool { - if x != nil { - return x.DimWallpaperInDarkMode - } - return false -} - -type isChatStyle_Wallpaper interface { - isChatStyle_Wallpaper() -} - -type ChatStyle_WallpaperPreset_ struct { - WallpaperPreset ChatStyle_WallpaperPreset `protobuf:"varint,1,opt,name=wallpaperPreset,proto3,enum=signal.backup.ChatStyle_WallpaperPreset,oneof"` -} - -type ChatStyle_WallpaperPhoto struct { - // This `FilePointer` is expected not to contain a `fileName`, `width`, - // `height`, or `caption`. - WallpaperPhoto *FilePointer `protobuf:"bytes,2,opt,name=wallpaperPhoto,proto3,oneof"` -} - -func (*ChatStyle_WallpaperPreset_) isChatStyle_Wallpaper() {} - -func (*ChatStyle_WallpaperPhoto) isChatStyle_Wallpaper() {} - -type isChatStyle_BubbleColor interface { - isChatStyle_BubbleColor() -} - -type ChatStyle_AutoBubbleColor struct { - // Bubble setting is automatically determined based on the wallpaper setting, - // or `SOLID_ULTRAMARINE` for `noWallpaper` - AutoBubbleColor *ChatStyle_AutomaticBubbleColor `protobuf:"bytes,3,opt,name=autoBubbleColor,proto3,oneof"` -} - -type ChatStyle_BubbleColorPreset_ struct { - BubbleColorPreset ChatStyle_BubbleColorPreset `protobuf:"varint,4,opt,name=bubbleColorPreset,proto3,enum=signal.backup.ChatStyle_BubbleColorPreset,oneof"` -} - -type ChatStyle_CustomColorId struct { - // See AccountSettings.customChatColors - CustomColorId uint64 `protobuf:"varint,5,opt,name=customColorId,proto3,oneof"` -} - -func (*ChatStyle_AutoBubbleColor) isChatStyle_BubbleColor() {} - -func (*ChatStyle_BubbleColorPreset_) isChatStyle_BubbleColor() {} - -func (*ChatStyle_CustomColorId) isChatStyle_BubbleColor() {} - -type NotificationProfile struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Emoji *string `protobuf:"bytes,2,opt,name=emoji,proto3,oneof" json:"emoji,omitempty"` - Color uint32 `protobuf:"fixed32,3,opt,name=color,proto3" json:"color,omitempty"` // 0xAARRGGBB - CreatedAtMs uint64 `protobuf:"varint,4,opt,name=createdAtMs,proto3" json:"createdAtMs,omitempty"` - AllowAllCalls bool `protobuf:"varint,5,opt,name=allowAllCalls,proto3" json:"allowAllCalls,omitempty"` - AllowAllMentions bool `protobuf:"varint,6,opt,name=allowAllMentions,proto3" json:"allowAllMentions,omitempty"` - AllowedMembers []uint64 `protobuf:"varint,7,rep,packed,name=allowedMembers,proto3" json:"allowedMembers,omitempty"` // generated recipient id for allowed groups and contacts - ScheduleEnabled bool `protobuf:"varint,8,opt,name=scheduleEnabled,proto3" json:"scheduleEnabled,omitempty"` - ScheduleStartTime uint32 `protobuf:"varint,9,opt,name=scheduleStartTime,proto3" json:"scheduleStartTime,omitempty"` // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - ScheduleEndTime uint32 `protobuf:"varint,10,opt,name=scheduleEndTime,proto3" json:"scheduleEndTime,omitempty"` // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - ScheduleDaysEnabled []NotificationProfile_DayOfWeek `protobuf:"varint,11,rep,packed,name=scheduleDaysEnabled,proto3,enum=signal.backup.NotificationProfile_DayOfWeek" json:"scheduleDaysEnabled,omitempty"` - Id []byte `protobuf:"bytes,12,opt,name=id,proto3" json:"id,omitempty"` // should be 16 bytes - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NotificationProfile) Reset() { - *x = NotificationProfile{} - mi := &file_backuppb_Backup_proto_msgTypes[84] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NotificationProfile) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotificationProfile) ProtoMessage() {} - -func (x *NotificationProfile) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[84] - 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 NotificationProfile.ProtoReflect.Descriptor instead. -func (*NotificationProfile) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{84} -} - -func (x *NotificationProfile) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NotificationProfile) GetEmoji() string { - if x != nil && x.Emoji != nil { - return *x.Emoji - } - return "" -} - -func (x *NotificationProfile) GetColor() uint32 { - if x != nil { - return x.Color - } - return 0 -} - -func (x *NotificationProfile) GetCreatedAtMs() uint64 { - if x != nil { - return x.CreatedAtMs - } - return 0 -} - -func (x *NotificationProfile) GetAllowAllCalls() bool { - if x != nil { - return x.AllowAllCalls - } - return false -} - -func (x *NotificationProfile) GetAllowAllMentions() bool { - if x != nil { - return x.AllowAllMentions - } - return false -} - -func (x *NotificationProfile) GetAllowedMembers() []uint64 { - if x != nil { - return x.AllowedMembers - } - return nil -} - -func (x *NotificationProfile) GetScheduleEnabled() bool { - if x != nil { - return x.ScheduleEnabled - } - return false -} - -func (x *NotificationProfile) GetScheduleStartTime() uint32 { - if x != nil { - return x.ScheduleStartTime - } - return 0 -} - -func (x *NotificationProfile) GetScheduleEndTime() uint32 { - if x != nil { - return x.ScheduleEndTime - } - return 0 -} - -func (x *NotificationProfile) GetScheduleDaysEnabled() []NotificationProfile_DayOfWeek { - if x != nil { - return x.ScheduleDaysEnabled - } - return nil -} - -func (x *NotificationProfile) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} - -type ChatFolder struct { - state protoimpl.MessageState `protogen:"open.v1"` - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ShowOnlyUnread bool `protobuf:"varint,2,opt,name=showOnlyUnread,proto3" json:"showOnlyUnread,omitempty"` - ShowMutedChats bool `protobuf:"varint,3,opt,name=showMutedChats,proto3" json:"showMutedChats,omitempty"` - // Folder includes all 1:1 chats, unless excluded - IncludeAllIndividualChats bool `protobuf:"varint,4,opt,name=includeAllIndividualChats,proto3" json:"includeAllIndividualChats,omitempty"` - // Folder includes all group chats, unless excluded - IncludeAllGroupChats bool `protobuf:"varint,5,opt,name=includeAllGroupChats,proto3" json:"includeAllGroupChats,omitempty"` - FolderType ChatFolder_FolderType `protobuf:"varint,6,opt,name=folderType,proto3,enum=signal.backup.ChatFolder_FolderType" json:"folderType,omitempty"` - IncludedRecipientIds []uint64 `protobuf:"varint,7,rep,packed,name=includedRecipientIds,proto3" json:"includedRecipientIds,omitempty"` // generated recipient id of groups, contacts, and/or note to self - ExcludedRecipientIds []uint64 `protobuf:"varint,8,rep,packed,name=excludedRecipientIds,proto3" json:"excludedRecipientIds,omitempty"` // generated recipient id of groups, contacts, and/or note to self - Id []byte `protobuf:"bytes,9,opt,name=id,proto3" json:"id,omitempty"` // should be 16 bytes - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatFolder) Reset() { - *x = ChatFolder{} - mi := &file_backuppb_Backup_proto_msgTypes[85] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatFolder) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatFolder) ProtoMessage() {} - -func (x *ChatFolder) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[85] - 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 ChatFolder.ProtoReflect.Descriptor instead. -func (*ChatFolder) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{85} -} - -func (x *ChatFolder) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ChatFolder) GetShowOnlyUnread() bool { - if x != nil { - return x.ShowOnlyUnread - } - return false -} - -func (x *ChatFolder) GetShowMutedChats() bool { - if x != nil { - return x.ShowMutedChats - } - return false -} - -func (x *ChatFolder) GetIncludeAllIndividualChats() bool { - if x != nil { - return x.IncludeAllIndividualChats - } - return false -} - -func (x *ChatFolder) GetIncludeAllGroupChats() bool { - if x != nil { - return x.IncludeAllGroupChats - } - return false -} - -func (x *ChatFolder) GetFolderType() ChatFolder_FolderType { - if x != nil { - return x.FolderType - } - return ChatFolder_UNKNOWN -} - -func (x *ChatFolder) GetIncludedRecipientIds() []uint64 { - if x != nil { - return x.IncludedRecipientIds - } - return nil -} - -func (x *ChatFolder) GetExcludedRecipientIds() []uint64 { - if x != nil { - return x.ExcludedRecipientIds - } - return nil -} - -func (x *ChatFolder) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} - -type AccountData_UsernameLink struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entropy []byte `protobuf:"bytes,1,opt,name=entropy,proto3" json:"entropy,omitempty"` // 32 bytes of entropy used for encryption - ServerId []byte `protobuf:"bytes,2,opt,name=serverId,proto3" json:"serverId,omitempty"` // 16 bytes of encoded UUID provided by the server - Color AccountData_UsernameLink_Color `protobuf:"varint,3,opt,name=color,proto3,enum=signal.backup.AccountData_UsernameLink_Color" json:"color,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountData_UsernameLink) Reset() { - *x = AccountData_UsernameLink{} - mi := &file_backuppb_Backup_proto_msgTypes[86] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountData_UsernameLink) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountData_UsernameLink) ProtoMessage() {} - -func (x *AccountData_UsernameLink) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[86] - 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_UsernameLink.ProtoReflect.Descriptor instead. -func (*AccountData_UsernameLink) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *AccountData_UsernameLink) GetEntropy() []byte { - if x != nil { - return x.Entropy - } - return nil -} - -func (x *AccountData_UsernameLink) GetServerId() []byte { - if x != nil { - return x.ServerId - } - return nil -} - -func (x *AccountData_UsernameLink) GetColor() AccountData_UsernameLink_Color { - if x != nil { - return x.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"` - SealedSenderIndicators bool `protobuf:"varint,2,opt,name=sealedSenderIndicators,proto3" json:"sealedSenderIndicators,omitempty"` - TypingIndicators bool `protobuf:"varint,3,opt,name=typingIndicators,proto3" json:"typingIndicators,omitempty"` - LinkPreviews bool `protobuf:"varint,4,opt,name=linkPreviews,proto3" json:"linkPreviews,omitempty"` - NotDiscoverableByPhoneNumber bool `protobuf:"varint,5,opt,name=notDiscoverableByPhoneNumber,proto3" json:"notDiscoverableByPhoneNumber,omitempty"` - PreferContactAvatars bool `protobuf:"varint,6,opt,name=preferContactAvatars,proto3" json:"preferContactAvatars,omitempty"` - UniversalExpireTimerSeconds uint32 `protobuf:"varint,7,opt,name=universalExpireTimerSeconds,proto3" json:"universalExpireTimerSeconds,omitempty"` // 0 means no universal expire timer. - PreferredReactionEmoji []string `protobuf:"bytes,8,rep,name=preferredReactionEmoji,proto3" json:"preferredReactionEmoji,omitempty"` - DisplayBadgesOnProfile bool `protobuf:"varint,9,opt,name=displayBadgesOnProfile,proto3" json:"displayBadgesOnProfile,omitempty"` - KeepMutedChatsArchived bool `protobuf:"varint,10,opt,name=keepMutedChatsArchived,proto3" json:"keepMutedChatsArchived,omitempty"` - HasSetMyStoriesPrivacy bool `protobuf:"varint,11,opt,name=hasSetMyStoriesPrivacy,proto3" json:"hasSetMyStoriesPrivacy,omitempty"` - HasViewedOnboardingStory bool `protobuf:"varint,12,opt,name=hasViewedOnboardingStory,proto3" json:"hasViewedOnboardingStory,omitempty"` - StoriesDisabled bool `protobuf:"varint,13,opt,name=storiesDisabled,proto3" json:"storiesDisabled,omitempty"` - StoryViewReceiptsEnabled *bool `protobuf:"varint,14,opt,name=storyViewReceiptsEnabled,proto3,oneof" json:"storyViewReceiptsEnabled,omitempty"` - HasSeenGroupStoryEducationSheet bool `protobuf:"varint,15,opt,name=hasSeenGroupStoryEducationSheet,proto3" json:"hasSeenGroupStoryEducationSheet,omitempty"` - HasCompletedUsernameOnboarding bool `protobuf:"varint,16,opt,name=hasCompletedUsernameOnboarding,proto3" json:"hasCompletedUsernameOnboarding,omitempty"` - PhoneNumberSharingMode AccountData_PhoneNumberSharingMode `protobuf:"varint,17,opt,name=phoneNumberSharingMode,proto3,enum=signal.backup.AccountData_PhoneNumberSharingMode" json:"phoneNumberSharingMode,omitempty"` - DefaultChatStyle *ChatStyle `protobuf:"bytes,18,opt,name=defaultChatStyle,proto3" json:"defaultChatStyle,omitempty"` - 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"` - UnreadBadgeType AccountData_AccountSettings_UnreadBadgeType `protobuf:"varint,33,opt,name=unreadBadgeType,proto3,enum=signal.backup.AccountData_AccountSettings_UnreadBadgeType" json:"unreadBadgeType,omitempty"` // Only used in ios/desktop - IncludeMutedChatsInBadge *bool `protobuf:"varint,34,opt,name=includeMutedChatsInBadge,proto3,oneof" json:"includeMutedChatsInBadge,omitempty"` // Only used in ios/desktop. If unset, consider this disabled - ReactionNotifications *bool `protobuf:"varint,35,opt,name=reactionNotifications,proto3,oneof" json:"reactionNotifications,omitempty"` // If unset, consider this enabled - NotifyForCallsIfMuted *bool `protobuf:"varint,36,opt,name=notifyForCallsIfMuted,proto3,oneof" json:"notifyForCallsIfMuted,omitempty"` // If unset, consider this disabled - NotifyForMentionsIfMuted *bool `protobuf:"varint,37,opt,name=notifyForMentionsIfMuted,proto3,oneof" json:"notifyForMentionsIfMuted,omitempty"` // If unset, consider this enabled - NotifyForRepliesIfMuted *bool `protobuf:"varint,38,opt,name=notifyForRepliesIfMuted,proto3,oneof" json:"notifyForRepliesIfMuted,omitempty"` // If unset, consider this enabled - ShowUnreadReminders *bool `protobuf:"varint,39,opt,name=showUnreadReminders,proto3,oneof" json:"showUnreadReminders,omitempty"` // If unset, consider this enabled - NotifyWhenContactJoins *bool `protobuf:"varint,40,opt,name=notifyWhenContactJoins,proto3,oneof" json:"notifyWhenContactJoins,omitempty"` // If unset, consider this disabled - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountData_AccountSettings) Reset() { - *x = AccountData_AccountSettings{} - mi := &file_backuppb_Backup_proto_msgTypes[88] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountData_AccountSettings) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountData_AccountSettings) ProtoMessage() {} - -func (x *AccountData_AccountSettings) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[88] - 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_AccountSettings.ProtoReflect.Descriptor instead. -func (*AccountData_AccountSettings) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 2} -} - -func (x *AccountData_AccountSettings) GetReadReceipts() bool { - if x != nil { - return x.ReadReceipts - } - return false -} - -func (x *AccountData_AccountSettings) GetSealedSenderIndicators() bool { - if x != nil { - return x.SealedSenderIndicators - } - return false -} - -func (x *AccountData_AccountSettings) GetTypingIndicators() bool { - if x != nil { - return x.TypingIndicators - } - return false -} - -func (x *AccountData_AccountSettings) GetLinkPreviews() bool { - if x != nil { - return x.LinkPreviews - } - return false -} - -func (x *AccountData_AccountSettings) GetNotDiscoverableByPhoneNumber() bool { - if x != nil { - return x.NotDiscoverableByPhoneNumber - } - return false -} - -func (x *AccountData_AccountSettings) GetPreferContactAvatars() bool { - if x != nil { - return x.PreferContactAvatars - } - return false -} - -func (x *AccountData_AccountSettings) GetUniversalExpireTimerSeconds() uint32 { - if x != nil { - return x.UniversalExpireTimerSeconds - } - return 0 -} - -func (x *AccountData_AccountSettings) GetPreferredReactionEmoji() []string { - if x != nil { - return x.PreferredReactionEmoji - } - return nil -} - -func (x *AccountData_AccountSettings) GetDisplayBadgesOnProfile() bool { - if x != nil { - return x.DisplayBadgesOnProfile - } - return false -} - -func (x *AccountData_AccountSettings) GetKeepMutedChatsArchived() bool { - if x != nil { - return x.KeepMutedChatsArchived - } - return false -} - -func (x *AccountData_AccountSettings) GetHasSetMyStoriesPrivacy() bool { - if x != nil { - return x.HasSetMyStoriesPrivacy - } - return false -} - -func (x *AccountData_AccountSettings) GetHasViewedOnboardingStory() bool { - if x != nil { - return x.HasViewedOnboardingStory - } - return false -} - -func (x *AccountData_AccountSettings) GetStoriesDisabled() bool { - if x != nil { - return x.StoriesDisabled - } - return false -} - -func (x *AccountData_AccountSettings) GetStoryViewReceiptsEnabled() bool { - if x != nil && x.StoryViewReceiptsEnabled != nil { - return *x.StoryViewReceiptsEnabled - } - return false -} - -func (x *AccountData_AccountSettings) GetHasSeenGroupStoryEducationSheet() bool { - if x != nil { - return x.HasSeenGroupStoryEducationSheet - } - return false -} - -func (x *AccountData_AccountSettings) GetHasCompletedUsernameOnboarding() bool { - if x != nil { - return x.HasCompletedUsernameOnboarding - } - return false -} - -func (x *AccountData_AccountSettings) GetPhoneNumberSharingMode() AccountData_PhoneNumberSharingMode { - if x != nil { - return x.PhoneNumberSharingMode - } - return AccountData_UNKNOWN -} - -func (x *AccountData_AccountSettings) GetDefaultChatStyle() *ChatStyle { - if x != nil { - return x.DefaultChatStyle - } - return nil -} - -func (x *AccountData_AccountSettings) GetCustomChatColors() []*ChatStyle_CustomChatColor { - if x != nil { - return x.CustomChatColors - } - return nil -} - -func (x *AccountData_AccountSettings) GetOptimizeOnDeviceStorage() bool { - if x != nil { - return x.OptimizeOnDeviceStorage - } - return false -} - -func (x *AccountData_AccountSettings) GetBackupTier() uint64 { - if x != nil && x.BackupTier != nil { - return *x.BackupTier - } - 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 -} - -func (x *AccountData_AccountSettings) GetUnreadBadgeType() AccountData_AccountSettings_UnreadBadgeType { - if x != nil { - return x.UnreadBadgeType - } - return AccountData_AccountSettings_UNKNOWN_BADGE_TYPE -} - -func (x *AccountData_AccountSettings) GetIncludeMutedChatsInBadge() bool { - if x != nil && x.IncludeMutedChatsInBadge != nil { - return *x.IncludeMutedChatsInBadge - } - return false -} - -func (x *AccountData_AccountSettings) GetReactionNotifications() bool { - if x != nil && x.ReactionNotifications != nil { - return *x.ReactionNotifications - } - return false -} - -func (x *AccountData_AccountSettings) GetNotifyForCallsIfMuted() bool { - if x != nil && x.NotifyForCallsIfMuted != nil { - return *x.NotifyForCallsIfMuted - } - return false -} - -func (x *AccountData_AccountSettings) GetNotifyForMentionsIfMuted() bool { - if x != nil && x.NotifyForMentionsIfMuted != nil { - return *x.NotifyForMentionsIfMuted - } - return false -} - -func (x *AccountData_AccountSettings) GetNotifyForRepliesIfMuted() bool { - if x != nil && x.NotifyForRepliesIfMuted != nil { - return *x.NotifyForRepliesIfMuted - } - return false -} - -func (x *AccountData_AccountSettings) GetShowUnreadReminders() bool { - if x != nil && x.ShowUnreadReminders != nil { - return *x.ShowUnreadReminders - } - return false -} - -func (x *AccountData_AccountSettings) GetNotifyWhenContactJoins() bool { - if x != nil && x.NotifyWhenContactJoins != nil { - return *x.NotifyWhenContactJoins - } - return false -} - -type AccountData_SubscriberData struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - CurrencyCode string `protobuf:"bytes,2,opt,name=currencyCode,proto3" json:"currencyCode,omitempty"` - ManuallyCancelled bool `protobuf:"varint,3,opt,name=manuallyCancelled,proto3" json:"manuallyCancelled,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountData_SubscriberData) Reset() { - *x = AccountData_SubscriberData{} - mi := &file_backuppb_Backup_proto_msgTypes[89] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountData_SubscriberData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountData_SubscriberData) ProtoMessage() {} - -func (x *AccountData_SubscriberData) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[89] - 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_SubscriberData.ProtoReflect.Descriptor instead. -func (*AccountData_SubscriberData) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 3} -} - -func (x *AccountData_SubscriberData) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *AccountData_SubscriberData) GetCurrencyCode() string { - if x != nil { - return x.CurrencyCode - } - return "" -} - -func (x *AccountData_SubscriberData) GetManuallyCancelled() bool { - if x != nil { - return x.ManuallyCancelled - } - return false -} - -type AccountData_IAPSubscriberData struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - // If unset, importers should ignore the subscriber data without throwing an error. - // - // Types that are valid to be assigned to IapSubscriptionId: - // - // *AccountData_IAPSubscriberData_PurchaseToken - // *AccountData_IAPSubscriberData_OriginalTransactionId - IapSubscriptionId isAccountData_IAPSubscriberData_IapSubscriptionId `protobuf_oneof:"iapSubscriptionId"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountData_IAPSubscriberData) Reset() { - *x = AccountData_IAPSubscriberData{} - mi := &file_backuppb_Backup_proto_msgTypes[90] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountData_IAPSubscriberData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountData_IAPSubscriberData) ProtoMessage() {} - -func (x *AccountData_IAPSubscriberData) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[90] - 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_IAPSubscriberData.ProtoReflect.Descriptor instead. -func (*AccountData_IAPSubscriberData) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{2, 4} -} - -func (x *AccountData_IAPSubscriberData) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *AccountData_IAPSubscriberData) GetIapSubscriptionId() isAccountData_IAPSubscriberData_IapSubscriptionId { - if x != nil { - return x.IapSubscriptionId - } - return nil -} - -func (x *AccountData_IAPSubscriberData) GetPurchaseToken() string { - if x != nil { - if x, ok := x.IapSubscriptionId.(*AccountData_IAPSubscriberData_PurchaseToken); ok { - return x.PurchaseToken - } - } - return "" -} - -func (x *AccountData_IAPSubscriberData) GetOriginalTransactionId() uint64 { - if x != nil { - if x, ok := x.IapSubscriptionId.(*AccountData_IAPSubscriberData_OriginalTransactionId); ok { - return x.OriginalTransactionId - } - } - return 0 -} - -type isAccountData_IAPSubscriberData_IapSubscriptionId interface { - isAccountData_IAPSubscriberData_IapSubscriptionId() -} - -type AccountData_IAPSubscriberData_PurchaseToken struct { - // Identifies an Android Play Store IAP subscription. - PurchaseToken string `protobuf:"bytes,2,opt,name=purchaseToken,proto3,oneof"` -} - -type AccountData_IAPSubscriberData_OriginalTransactionId struct { - // Identifies an iOS App Store IAP subscription. - OriginalTransactionId uint64 `protobuf:"varint,3,opt,name=originalTransactionId,proto3,oneof"` -} - -func (*AccountData_IAPSubscriberData_PurchaseToken) isAccountData_IAPSubscriberData_IapSubscriptionId() { -} - -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 - sizeCache protoimpl.SizeCache -} - -func (x *Contact_Registered) Reset() { - *x = Contact_Registered{} - mi := &file_backuppb_Backup_proto_msgTypes[92] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Contact_Registered) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Contact_Registered) ProtoMessage() {} - -func (x *Contact_Registered) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[92] - 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 Contact_Registered.ProtoReflect.Descriptor instead. -func (*Contact_Registered) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{4, 0} -} - -type Contact_NotRegistered struct { - state protoimpl.MessageState `protogen:"open.v1"` - UnregisteredTimestamp uint64 `protobuf:"varint,1,opt,name=unregisteredTimestamp,proto3" json:"unregisteredTimestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Contact_NotRegistered) Reset() { - *x = Contact_NotRegistered{} - mi := &file_backuppb_Backup_proto_msgTypes[93] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Contact_NotRegistered) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Contact_NotRegistered) ProtoMessage() {} - -func (x *Contact_NotRegistered) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[93] - 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 Contact_NotRegistered.ProtoReflect.Descriptor instead. -func (*Contact_NotRegistered) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{4, 1} -} - -func (x *Contact_NotRegistered) GetUnregisteredTimestamp() uint64 { - if x != nil { - return x.UnregisteredTimestamp - } - return 0 -} - -type Contact_Name struct { - state protoimpl.MessageState `protogen:"open.v1"` - Given string `protobuf:"bytes,1,opt,name=given,proto3" json:"given,omitempty"` - Family string `protobuf:"bytes,2,opt,name=family,proto3" json:"family,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Contact_Name) Reset() { - *x = Contact_Name{} - mi := &file_backuppb_Backup_proto_msgTypes[94] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Contact_Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Contact_Name) ProtoMessage() {} - -func (x *Contact_Name) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[94] - 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 Contact_Name.ProtoReflect.Descriptor instead. -func (*Contact_Name) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{4, 2} -} - -func (x *Contact_Name) GetGiven() string { - if x != nil { - return x.Given - } - return "" -} - -func (x *Contact_Name) GetFamily() string { - if x != nil { - return x.Family - } - return "" -} - -// These are simply plaintext copies of the groups proto from Groups.proto. -// They should be kept completely in-sync with Groups.proto. -// These exist to allow us to have the latest snapshot of a group during restoration without having to hit the network. -// We would use Groups.proto if we could, but we want a plaintext version to improve export readability. -// For documentation, defer to Groups.proto. The only name change is Group -> GroupSnapshot to avoid the naming conflict. -type Group_GroupSnapshot struct { - state protoimpl.MessageState `protogen:"open.v1"` - Title *Group_GroupAttributeBlob `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Description *Group_GroupAttributeBlob `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` - AvatarUrl string `protobuf:"bytes,3,opt,name=avatarUrl,proto3" json:"avatarUrl,omitempty"` - DisappearingMessagesTimer *Group_GroupAttributeBlob `protobuf:"bytes,4,opt,name=disappearingMessagesTimer,proto3" json:"disappearingMessagesTimer,omitempty"` - AccessControl *Group_AccessControl `protobuf:"bytes,5,opt,name=accessControl,proto3" json:"accessControl,omitempty"` - Version uint32 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"` - Members []*Group_Member `protobuf:"bytes,7,rep,name=members,proto3" json:"members,omitempty"` - MembersPendingProfileKey []*Group_MemberPendingProfileKey `protobuf:"bytes,8,rep,name=membersPendingProfileKey,proto3" json:"membersPendingProfileKey,omitempty"` - MembersPendingAdminApproval []*Group_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 []*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] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group_GroupSnapshot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group_GroupSnapshot) ProtoMessage() {} - -func (x *Group_GroupSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[95] - 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 Group_GroupSnapshot.ProtoReflect.Descriptor instead. -func (*Group_GroupSnapshot) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *Group_GroupSnapshot) GetTitle() *Group_GroupAttributeBlob { - if x != nil { - return x.Title - } - return nil -} - -func (x *Group_GroupSnapshot) GetDescription() *Group_GroupAttributeBlob { - if x != nil { - return x.Description - } - return nil -} - -func (x *Group_GroupSnapshot) GetAvatarUrl() string { - if x != nil { - return x.AvatarUrl - } - return "" -} - -func (x *Group_GroupSnapshot) GetDisappearingMessagesTimer() *Group_GroupAttributeBlob { - if x != nil { - return x.DisappearingMessagesTimer - } - return nil -} - -func (x *Group_GroupSnapshot) GetAccessControl() *Group_AccessControl { - if x != nil { - return x.AccessControl - } - return nil -} - -func (x *Group_GroupSnapshot) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *Group_GroupSnapshot) GetMembers() []*Group_Member { - if x != nil { - return x.Members - } - return nil -} - -func (x *Group_GroupSnapshot) GetMembersPendingProfileKey() []*Group_MemberPendingProfileKey { - if x != nil { - return x.MembersPendingProfileKey - } - return nil -} - -func (x *Group_GroupSnapshot) GetMembersPendingAdminApproval() []*Group_MemberPendingAdminApproval { - if x != nil { - return x.MembersPendingAdminApproval - } - return nil -} - -func (x *Group_GroupSnapshot) GetInviteLinkPassword() []byte { - if x != nil { - return x.InviteLinkPassword - } - return nil -} - -func (x *Group_GroupSnapshot) GetAnnouncementsOnly() bool { - if x != nil { - return x.AnnouncementsOnly - } - return false -} - -func (x *Group_GroupSnapshot) GetMembersBanned() []*Group_MemberBanned { - if x != nil { - return x.MembersBanned - } - 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 - // - // Types that are valid to be assigned to Content: - // - // *Group_GroupAttributeBlob_Title - // *Group_GroupAttributeBlob_Avatar - // *Group_GroupAttributeBlob_DisappearingMessagesDuration - // *Group_GroupAttributeBlob_DescriptionText - Content isGroup_GroupAttributeBlob_Content `protobuf_oneof:"content"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Group_GroupAttributeBlob) Reset() { - *x = Group_GroupAttributeBlob{} - mi := &file_backuppb_Backup_proto_msgTypes[96] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group_GroupAttributeBlob) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group_GroupAttributeBlob) ProtoMessage() {} - -func (x *Group_GroupAttributeBlob) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[96] - 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 Group_GroupAttributeBlob.ProtoReflect.Descriptor instead. -func (*Group_GroupAttributeBlob) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 1} -} - -func (x *Group_GroupAttributeBlob) GetContent() isGroup_GroupAttributeBlob_Content { - if x != nil { - return x.Content - } - return nil -} - -func (x *Group_GroupAttributeBlob) GetTitle() string { - if x != nil { - if x, ok := x.Content.(*Group_GroupAttributeBlob_Title); ok { - return x.Title - } - } - return "" -} - -func (x *Group_GroupAttributeBlob) GetAvatar() []byte { - if x != nil { - if x, ok := x.Content.(*Group_GroupAttributeBlob_Avatar); ok { - return x.Avatar - } - } - return nil -} - -func (x *Group_GroupAttributeBlob) GetDisappearingMessagesDuration() uint32 { - if x != nil { - if x, ok := x.Content.(*Group_GroupAttributeBlob_DisappearingMessagesDuration); ok { - return x.DisappearingMessagesDuration - } - } - return 0 -} - -func (x *Group_GroupAttributeBlob) GetDescriptionText() string { - if x != nil { - if x, ok := x.Content.(*Group_GroupAttributeBlob_DescriptionText); ok { - return x.DescriptionText - } - } - return "" -} - -type isGroup_GroupAttributeBlob_Content interface { - isGroup_GroupAttributeBlob_Content() -} - -type Group_GroupAttributeBlob_Title struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3,oneof"` -} - -type Group_GroupAttributeBlob_Avatar struct { - Avatar []byte `protobuf:"bytes,2,opt,name=avatar,proto3,oneof"` -} - -type Group_GroupAttributeBlob_DisappearingMessagesDuration struct { - DisappearingMessagesDuration uint32 `protobuf:"varint,3,opt,name=disappearingMessagesDuration,proto3,oneof"` -} - -type Group_GroupAttributeBlob_DescriptionText struct { - DescriptionText string `protobuf:"bytes,4,opt,name=descriptionText,proto3,oneof"` -} - -func (*Group_GroupAttributeBlob_Title) isGroup_GroupAttributeBlob_Content() {} - -func (*Group_GroupAttributeBlob_Avatar) isGroup_GroupAttributeBlob_Content() {} - -func (*Group_GroupAttributeBlob_DisappearingMessagesDuration) isGroup_GroupAttributeBlob_Content() {} - -func (*Group_GroupAttributeBlob_DescriptionText) isGroup_GroupAttributeBlob_Content() {} - -type Group_Member struct { - state protoimpl.MessageState `protogen:"open.v1"` - 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] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group_Member) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group_Member) ProtoMessage() {} - -func (x *Group_Member) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[97] - 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 Group_Member.ProtoReflect.Descriptor instead. -func (*Group_Member) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 2} -} - -func (x *Group_Member) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *Group_Member) GetRole() Group_Member_Role { - if x != nil { - return x.Role - } - return Group_Member_UNKNOWN -} - -func (x *Group_Member) GetJoinedAtVersion() uint32 { - if x != nil { - return x.JoinedAtVersion - } - 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"` - AddedByUserId []byte `protobuf:"bytes,2,opt,name=addedByUserId,proto3" json:"addedByUserId,omitempty"` - Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Group_MemberPendingProfileKey) Reset() { - *x = Group_MemberPendingProfileKey{} - mi := &file_backuppb_Backup_proto_msgTypes[98] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group_MemberPendingProfileKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group_MemberPendingProfileKey) ProtoMessage() {} - -func (x *Group_MemberPendingProfileKey) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[98] - 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 Group_MemberPendingProfileKey.ProtoReflect.Descriptor instead. -func (*Group_MemberPendingProfileKey) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 3} -} - -func (x *Group_MemberPendingProfileKey) GetMember() *Group_Member { - if x != nil { - return x.Member - } - return nil -} - -func (x *Group_MemberPendingProfileKey) GetAddedByUserId() []byte { - if x != nil { - return x.AddedByUserId - } - return nil -} - -func (x *Group_MemberPendingProfileKey) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type Group_MemberPendingAdminApproval struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId []byte `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - Timestamp uint64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Group_MemberPendingAdminApproval) Reset() { - *x = Group_MemberPendingAdminApproval{} - mi := &file_backuppb_Backup_proto_msgTypes[99] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group_MemberPendingAdminApproval) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group_MemberPendingAdminApproval) ProtoMessage() {} - -func (x *Group_MemberPendingAdminApproval) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[99] - 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 Group_MemberPendingAdminApproval.ProtoReflect.Descriptor instead. -func (*Group_MemberPendingAdminApproval) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 4} -} - -func (x *Group_MemberPendingAdminApproval) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *Group_MemberPendingAdminApproval) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type Group_MemberBanned 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Group_MemberBanned) Reset() { - *x = Group_MemberBanned{} - mi := &file_backuppb_Backup_proto_msgTypes[100] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group_MemberBanned) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group_MemberBanned) ProtoMessage() {} - -func (x *Group_MemberBanned) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[100] - 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 Group_MemberBanned.ProtoReflect.Descriptor instead. -func (*Group_MemberBanned) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 5} -} - -func (x *Group_MemberBanned) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *Group_MemberBanned) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type Group_AccessControl struct { - state protoimpl.MessageState `protogen:"open.v1"` - 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] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group_AccessControl) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group_AccessControl) ProtoMessage() {} - -func (x *Group_AccessControl) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[101] - 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 Group_AccessControl.ProtoReflect.Descriptor instead. -func (*Group_AccessControl) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{5, 6} -} - -func (x *Group_AccessControl) GetAttributes() Group_AccessControl_AccessRequired { - if x != nil { - return x.Attributes - } - return Group_AccessControl_UNKNOWN -} - -func (x *Group_AccessControl) GetMembers() Group_AccessControl_AccessRequired { - if x != nil { - return x.Members - } - return Group_AccessControl_UNKNOWN -} - -func (x *Group_AccessControl) GetAddFromInviteLink() Group_AccessControl_AccessRequired { - if x != nil { - return x.AddFromInviteLink - } - 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"` - DateServerSent *uint64 `protobuf:"varint,2,opt,name=dateServerSent,proto3,oneof" json:"dateServerSent,omitempty"` - Read bool `protobuf:"varint,3,opt,name=read,proto3" json:"read,omitempty"` - SealedSender bool `protobuf:"varint,4,opt,name=sealedSender,proto3" json:"sealedSender,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatItem_IncomingMessageDetails) Reset() { - *x = ChatItem_IncomingMessageDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[102] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatItem_IncomingMessageDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatItem_IncomingMessageDetails) ProtoMessage() {} - -func (x *ChatItem_IncomingMessageDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[102] - 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_IncomingMessageDetails.ProtoReflect.Descriptor instead. -func (*ChatItem_IncomingMessageDetails) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{13, 0} -} - -func (x *ChatItem_IncomingMessageDetails) GetDateReceived() uint64 { - if x != nil { - return x.DateReceived - } - return 0 -} - -func (x *ChatItem_IncomingMessageDetails) GetDateServerSent() uint64 { - if x != nil && x.DateServerSent != nil { - return *x.DateServerSent - } - return 0 -} - -func (x *ChatItem_IncomingMessageDetails) GetRead() bool { - if x != nil { - return x.Read - } - return false -} - -func (x *ChatItem_IncomingMessageDetails) GetSealedSender() bool { - if x != nil { - return x.SealedSender - } - return false -} - -type ChatItem_OutgoingMessageDetails struct { - state protoimpl.MessageState `protogen:"open.v1"` - SendStatus []*SendStatus `protobuf:"bytes,1,rep,name=sendStatus,proto3" json:"sendStatus,omitempty"` - DateReceived uint64 `protobuf:"varint,2,opt,name=dateReceived,proto3" json:"dateReceived,omitempty"` // may be different from dateSent for sync messages - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatItem_OutgoingMessageDetails) Reset() { - *x = ChatItem_OutgoingMessageDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[103] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatItem_OutgoingMessageDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatItem_OutgoingMessageDetails) ProtoMessage() {} - -func (x *ChatItem_OutgoingMessageDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[103] - 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_OutgoingMessageDetails.ProtoReflect.Descriptor instead. -func (*ChatItem_OutgoingMessageDetails) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{13, 1} -} - -func (x *ChatItem_OutgoingMessageDetails) GetSendStatus() []*SendStatus { - if x != nil { - return x.SendStatus - } - return nil -} - -func (x *ChatItem_OutgoingMessageDetails) GetDateReceived() uint64 { - if x != nil { - return x.DateReceived - } - return 0 -} - -type ChatItem_DirectionlessMessageDetails struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatItem_DirectionlessMessageDetails) Reset() { - *x = ChatItem_DirectionlessMessageDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[104] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatItem_DirectionlessMessageDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatItem_DirectionlessMessageDetails) ProtoMessage() {} - -func (x *ChatItem_DirectionlessMessageDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[104] - 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_DirectionlessMessageDetails.ProtoReflect.Descriptor instead. -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 - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus_Pending) Reset() { - *x = SendStatus_Pending{} - mi := &file_backuppb_Backup_proto_msgTypes[106] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus_Pending) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus_Pending) ProtoMessage() {} - -func (x *SendStatus_Pending) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[106] - 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 SendStatus_Pending.ProtoReflect.Descriptor instead. -func (*SendStatus_Pending) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 0} -} - -type SendStatus_Sent struct { - state protoimpl.MessageState `protogen:"open.v1"` - SealedSender bool `protobuf:"varint,1,opt,name=sealedSender,proto3" json:"sealedSender,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus_Sent) Reset() { - *x = SendStatus_Sent{} - mi := &file_backuppb_Backup_proto_msgTypes[107] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus_Sent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus_Sent) ProtoMessage() {} - -func (x *SendStatus_Sent) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[107] - 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 SendStatus_Sent.ProtoReflect.Descriptor instead. -func (*SendStatus_Sent) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 1} -} - -func (x *SendStatus_Sent) GetSealedSender() bool { - if x != nil { - return x.SealedSender - } - return false -} - -type SendStatus_Delivered struct { - state protoimpl.MessageState `protogen:"open.v1"` - SealedSender bool `protobuf:"varint,1,opt,name=sealedSender,proto3" json:"sealedSender,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus_Delivered) Reset() { - *x = SendStatus_Delivered{} - mi := &file_backuppb_Backup_proto_msgTypes[108] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus_Delivered) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus_Delivered) ProtoMessage() {} - -func (x *SendStatus_Delivered) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[108] - 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 SendStatus_Delivered.ProtoReflect.Descriptor instead. -func (*SendStatus_Delivered) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 2} -} - -func (x *SendStatus_Delivered) GetSealedSender() bool { - if x != nil { - return x.SealedSender - } - return false -} - -type SendStatus_Read struct { - state protoimpl.MessageState `protogen:"open.v1"` - SealedSender bool `protobuf:"varint,1,opt,name=sealedSender,proto3" json:"sealedSender,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus_Read) Reset() { - *x = SendStatus_Read{} - mi := &file_backuppb_Backup_proto_msgTypes[109] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus_Read) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus_Read) ProtoMessage() {} - -func (x *SendStatus_Read) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[109] - 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 SendStatus_Read.ProtoReflect.Descriptor instead. -func (*SendStatus_Read) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 3} -} - -func (x *SendStatus_Read) GetSealedSender() bool { - if x != nil { - return x.SealedSender - } - return false -} - -type SendStatus_Viewed struct { - state protoimpl.MessageState `protogen:"open.v1"` - SealedSender bool `protobuf:"varint,1,opt,name=sealedSender,proto3" json:"sealedSender,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus_Viewed) Reset() { - *x = SendStatus_Viewed{} - mi := &file_backuppb_Backup_proto_msgTypes[110] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus_Viewed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus_Viewed) ProtoMessage() {} - -func (x *SendStatus_Viewed) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[110] - 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 SendStatus_Viewed.ProtoReflect.Descriptor instead. -func (*SendStatus_Viewed) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 4} -} - -func (x *SendStatus_Viewed) GetSealedSender() bool { - if x != nil { - return x.SealedSender - } - return false -} - -// e.g. user in group was blocked, so we skipped sending to them -type SendStatus_Skipped struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus_Skipped) Reset() { - *x = SendStatus_Skipped{} - mi := &file_backuppb_Backup_proto_msgTypes[111] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus_Skipped) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus_Skipped) ProtoMessage() {} - -func (x *SendStatus_Skipped) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[111] - 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 SendStatus_Skipped.ProtoReflect.Descriptor instead. -func (*SendStatus_Skipped) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 5} -} - -type SendStatus_Failed struct { - state protoimpl.MessageState `protogen:"open.v1"` - Reason SendStatus_Failed_FailureReason `protobuf:"varint,1,opt,name=reason,proto3,enum=signal.backup.SendStatus_Failed_FailureReason" json:"reason,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStatus_Failed) Reset() { - *x = SendStatus_Failed{} - mi := &file_backuppb_Backup_proto_msgTypes[112] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStatus_Failed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStatus_Failed) ProtoMessage() {} - -func (x *SendStatus_Failed) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[112] - 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 SendStatus_Failed.ProtoReflect.Descriptor instead. -func (*SendStatus_Failed) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{14, 6} -} - -func (x *SendStatus_Failed) GetReason() SendStatus_Failed_FailureReason { - if x != nil { - return x.Reason - } - return SendStatus_Failed_UNKNOWN -} - -type DirectStoryReplyMessage_TextReply struct { - state protoimpl.MessageState `protogen:"open.v1"` - Text *Text `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` - LongText *FilePointer `protobuf:"bytes,2,opt,name=longText,proto3" json:"longText,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DirectStoryReplyMessage_TextReply) Reset() { - *x = DirectStoryReplyMessage_TextReply{} - mi := &file_backuppb_Backup_proto_msgTypes[113] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DirectStoryReplyMessage_TextReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DirectStoryReplyMessage_TextReply) ProtoMessage() {} - -func (x *DirectStoryReplyMessage_TextReply) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[113] - 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 DirectStoryReplyMessage_TextReply.ProtoReflect.Descriptor instead. -func (*DirectStoryReplyMessage_TextReply) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{18, 0} -} - -func (x *DirectStoryReplyMessage_TextReply) GetText() *Text { - if x != nil { - return x.Text - } - return nil -} - -func (x *DirectStoryReplyMessage_TextReply) GetLongText() *FilePointer { - if x != nil { - return x.LongText - } - return nil -} - -type PaymentNotification_TransactionDetails struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If unset, importers should treat the transaction as successful with no metadata. - // - // Types that are valid to be assigned to Payment: - // - // *PaymentNotification_TransactionDetails_Transaction_ - // *PaymentNotification_TransactionDetails_FailedTransaction_ - Payment isPaymentNotification_TransactionDetails_Payment `protobuf_oneof:"payment"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentNotification_TransactionDetails) Reset() { - *x = PaymentNotification_TransactionDetails{} - mi := &file_backuppb_Backup_proto_msgTypes[114] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentNotification_TransactionDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentNotification_TransactionDetails) ProtoMessage() {} - -func (x *PaymentNotification_TransactionDetails) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[114] - 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 PaymentNotification_TransactionDetails.ProtoReflect.Descriptor instead. -func (*PaymentNotification_TransactionDetails) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{19, 0} -} - -func (x *PaymentNotification_TransactionDetails) GetPayment() isPaymentNotification_TransactionDetails_Payment { - if x != nil { - return x.Payment - } - return nil -} - -func (x *PaymentNotification_TransactionDetails) GetTransaction() *PaymentNotification_TransactionDetails_Transaction { - if x != nil { - if x, ok := x.Payment.(*PaymentNotification_TransactionDetails_Transaction_); ok { - return x.Transaction - } - } - return nil -} - -func (x *PaymentNotification_TransactionDetails) GetFailedTransaction() *PaymentNotification_TransactionDetails_FailedTransaction { - if x != nil { - if x, ok := x.Payment.(*PaymentNotification_TransactionDetails_FailedTransaction_); ok { - return x.FailedTransaction - } - } - return nil -} - -type isPaymentNotification_TransactionDetails_Payment interface { - isPaymentNotification_TransactionDetails_Payment() -} - -type PaymentNotification_TransactionDetails_Transaction_ struct { - Transaction *PaymentNotification_TransactionDetails_Transaction `protobuf:"bytes,1,opt,name=transaction,proto3,oneof"` -} - -type PaymentNotification_TransactionDetails_FailedTransaction_ struct { - FailedTransaction *PaymentNotification_TransactionDetails_FailedTransaction `protobuf:"bytes,2,opt,name=failedTransaction,proto3,oneof"` -} - -func (*PaymentNotification_TransactionDetails_Transaction_) isPaymentNotification_TransactionDetails_Payment() { -} - -func (*PaymentNotification_TransactionDetails_FailedTransaction_) isPaymentNotification_TransactionDetails_Payment() { -} - -type PaymentNotification_TransactionDetails_MobileCoinTxoIdentification struct { - state protoimpl.MessageState `protogen:"open.v1"` - PublicKey [][]byte `protobuf:"bytes,1,rep,name=publicKey,proto3" json:"publicKey,omitempty"` // for received transactions - KeyImages [][]byte `protobuf:"bytes,2,rep,name=keyImages,proto3" json:"keyImages,omitempty"` // for sent transactions - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) Reset() { - *x = PaymentNotification_TransactionDetails_MobileCoinTxoIdentification{} - mi := &file_backuppb_Backup_proto_msgTypes[115] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) ProtoMessage() {} - -func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[115] - 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 PaymentNotification_TransactionDetails_MobileCoinTxoIdentification.ProtoReflect.Descriptor instead. -func (*PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{19, 0, 0} -} - -func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) GetPublicKey() [][]byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification) GetKeyImages() [][]byte { - if x != nil { - return x.KeyImages - } - return nil -} - -type PaymentNotification_TransactionDetails_FailedTransaction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Reason PaymentNotification_TransactionDetails_FailedTransaction_FailureReason `protobuf:"varint,1,opt,name=reason,proto3,enum=signal.backup.PaymentNotification_TransactionDetails_FailedTransaction_FailureReason" json:"reason,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentNotification_TransactionDetails_FailedTransaction) Reset() { - *x = PaymentNotification_TransactionDetails_FailedTransaction{} - mi := &file_backuppb_Backup_proto_msgTypes[116] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentNotification_TransactionDetails_FailedTransaction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentNotification_TransactionDetails_FailedTransaction) ProtoMessage() {} - -func (x *PaymentNotification_TransactionDetails_FailedTransaction) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[116] - 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 PaymentNotification_TransactionDetails_FailedTransaction.ProtoReflect.Descriptor instead. -func (*PaymentNotification_TransactionDetails_FailedTransaction) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{19, 0, 1} -} - -func (x *PaymentNotification_TransactionDetails_FailedTransaction) GetReason() PaymentNotification_TransactionDetails_FailedTransaction_FailureReason { - if x != nil { - return x.Reason - } - return PaymentNotification_TransactionDetails_FailedTransaction_GENERIC -} - -type PaymentNotification_TransactionDetails_Transaction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Status PaymentNotification_TransactionDetails_Transaction_Status `protobuf:"varint,1,opt,name=status,proto3,enum=signal.backup.PaymentNotification_TransactionDetails_Transaction_Status" json:"status,omitempty"` - // This identification is used to map the payment table to the ledger - // and is likely required otherwise we may have issues reconciling with - // the ledger - MobileCoinIdentification *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification `protobuf:"bytes,2,opt,name=mobileCoinIdentification,proto3" json:"mobileCoinIdentification,omitempty"` - Timestamp *uint64 `protobuf:"varint,3,opt,name=timestamp,proto3,oneof" json:"timestamp,omitempty"` - BlockIndex *uint64 `protobuf:"varint,4,opt,name=blockIndex,proto3,oneof" json:"blockIndex,omitempty"` - BlockTimestamp *uint64 `protobuf:"varint,5,opt,name=blockTimestamp,proto3,oneof" json:"blockTimestamp,omitempty"` - Transaction []byte `protobuf:"bytes,6,opt,name=transaction,proto3,oneof" json:"transaction,omitempty"` // mobile coin blobs - Receipt []byte `protobuf:"bytes,7,opt,name=receipt,proto3,oneof" json:"receipt,omitempty"` // mobile coin blobs - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentNotification_TransactionDetails_Transaction) Reset() { - *x = PaymentNotification_TransactionDetails_Transaction{} - mi := &file_backuppb_Backup_proto_msgTypes[117] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentNotification_TransactionDetails_Transaction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentNotification_TransactionDetails_Transaction) ProtoMessage() {} - -func (x *PaymentNotification_TransactionDetails_Transaction) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[117] - 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 PaymentNotification_TransactionDetails_Transaction.ProtoReflect.Descriptor instead. -func (*PaymentNotification_TransactionDetails_Transaction) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{19, 0, 2} -} - -func (x *PaymentNotification_TransactionDetails_Transaction) GetStatus() PaymentNotification_TransactionDetails_Transaction_Status { - if x != nil { - return x.Status - } - return PaymentNotification_TransactionDetails_Transaction_INITIAL -} - -func (x *PaymentNotification_TransactionDetails_Transaction) GetMobileCoinIdentification() *PaymentNotification_TransactionDetails_MobileCoinTxoIdentification { - if x != nil { - return x.MobileCoinIdentification - } - return nil -} - -func (x *PaymentNotification_TransactionDetails_Transaction) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -func (x *PaymentNotification_TransactionDetails_Transaction) GetBlockIndex() uint64 { - if x != nil && x.BlockIndex != nil { - return *x.BlockIndex - } - return 0 -} - -func (x *PaymentNotification_TransactionDetails_Transaction) GetBlockTimestamp() uint64 { - if x != nil && x.BlockTimestamp != nil { - return *x.BlockTimestamp - } - return 0 -} - -func (x *PaymentNotification_TransactionDetails_Transaction) GetTransaction() []byte { - if x != nil { - return x.Transaction - } - return nil -} - -func (x *PaymentNotification_TransactionDetails_Transaction) GetReceipt() []byte { - if x != nil { - return x.Receipt - } - return nil -} - -type ContactAttachment_Name struct { - state protoimpl.MessageState `protogen:"open.v1"` - GivenName string `protobuf:"bytes,1,opt,name=givenName,proto3" json:"givenName,omitempty"` - FamilyName string `protobuf:"bytes,2,opt,name=familyName,proto3" json:"familyName,omitempty"` - Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` - Suffix string `protobuf:"bytes,4,opt,name=suffix,proto3" json:"suffix,omitempty"` - MiddleName string `protobuf:"bytes,5,opt,name=middleName,proto3" json:"middleName,omitempty"` - Nickname string `protobuf:"bytes,6,opt,name=nickname,proto3" json:"nickname,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactAttachment_Name) Reset() { - *x = ContactAttachment_Name{} - mi := &file_backuppb_Backup_proto_msgTypes[118] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactAttachment_Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactAttachment_Name) ProtoMessage() {} - -func (x *ContactAttachment_Name) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[118] - 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 ContactAttachment_Name.ProtoReflect.Descriptor instead. -func (*ContactAttachment_Name) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22, 0} -} - -func (x *ContactAttachment_Name) GetGivenName() string { - if x != nil { - return x.GivenName - } - return "" -} - -func (x *ContactAttachment_Name) GetFamilyName() string { - if x != nil { - return x.FamilyName - } - return "" -} - -func (x *ContactAttachment_Name) GetPrefix() string { - if x != nil { - return x.Prefix - } - return "" -} - -func (x *ContactAttachment_Name) GetSuffix() string { - if x != nil { - return x.Suffix - } - return "" -} - -func (x *ContactAttachment_Name) GetMiddleName() string { - if x != nil { - return x.MiddleName - } - return "" -} - -func (x *ContactAttachment_Name) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -type ContactAttachment_Phone struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Type ContactAttachment_Phone_Type `protobuf:"varint,2,opt,name=type,proto3,enum=signal.backup.ContactAttachment_Phone_Type" json:"type,omitempty"` - Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactAttachment_Phone) Reset() { - *x = ContactAttachment_Phone{} - mi := &file_backuppb_Backup_proto_msgTypes[119] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactAttachment_Phone) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactAttachment_Phone) ProtoMessage() {} - -func (x *ContactAttachment_Phone) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[119] - 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 ContactAttachment_Phone.ProtoReflect.Descriptor instead. -func (*ContactAttachment_Phone) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22, 1} -} - -func (x *ContactAttachment_Phone) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *ContactAttachment_Phone) GetType() ContactAttachment_Phone_Type { - if x != nil { - return x.Type - } - return ContactAttachment_Phone_UNKNOWN -} - -func (x *ContactAttachment_Phone) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -type ContactAttachment_Email struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Type ContactAttachment_Email_Type `protobuf:"varint,2,opt,name=type,proto3,enum=signal.backup.ContactAttachment_Email_Type" json:"type,omitempty"` - Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactAttachment_Email) Reset() { - *x = ContactAttachment_Email{} - mi := &file_backuppb_Backup_proto_msgTypes[120] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactAttachment_Email) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactAttachment_Email) ProtoMessage() {} - -func (x *ContactAttachment_Email) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[120] - 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 ContactAttachment_Email.ProtoReflect.Descriptor instead. -func (*ContactAttachment_Email) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22, 2} -} - -func (x *ContactAttachment_Email) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *ContactAttachment_Email) GetType() ContactAttachment_Email_Type { - if x != nil { - return x.Type - } - return ContactAttachment_Email_UNKNOWN -} - -func (x *ContactAttachment_Email) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -type ContactAttachment_PostalAddress struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type ContactAttachment_PostalAddress_Type `protobuf:"varint,1,opt,name=type,proto3,enum=signal.backup.ContactAttachment_PostalAddress_Type" json:"type,omitempty"` - Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` - Street string `protobuf:"bytes,3,opt,name=street,proto3" json:"street,omitempty"` - Pobox string `protobuf:"bytes,4,opt,name=pobox,proto3" json:"pobox,omitempty"` - Neighborhood string `protobuf:"bytes,5,opt,name=neighborhood,proto3" json:"neighborhood,omitempty"` - City string `protobuf:"bytes,6,opt,name=city,proto3" json:"city,omitempty"` - Region string `protobuf:"bytes,7,opt,name=region,proto3" json:"region,omitempty"` - Postcode string `protobuf:"bytes,8,opt,name=postcode,proto3" json:"postcode,omitempty"` - Country string `protobuf:"bytes,9,opt,name=country,proto3" json:"country,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactAttachment_PostalAddress) Reset() { - *x = ContactAttachment_PostalAddress{} - mi := &file_backuppb_Backup_proto_msgTypes[121] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactAttachment_PostalAddress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactAttachment_PostalAddress) ProtoMessage() {} - -func (x *ContactAttachment_PostalAddress) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[121] - 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 ContactAttachment_PostalAddress.ProtoReflect.Descriptor instead. -func (*ContactAttachment_PostalAddress) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{22, 3} -} - -func (x *ContactAttachment_PostalAddress) GetType() ContactAttachment_PostalAddress_Type { - if x != nil { - return x.Type - } - return ContactAttachment_PostalAddress_UNKNOWN -} - -func (x *ContactAttachment_PostalAddress) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -func (x *ContactAttachment_PostalAddress) GetStreet() string { - if x != nil { - return x.Street - } - return "" -} - -func (x *ContactAttachment_PostalAddress) GetPobox() string { - if x != nil { - return x.Pobox - } - return "" -} - -func (x *ContactAttachment_PostalAddress) GetNeighborhood() string { - if x != nil { - return x.Neighborhood - } - return "" -} - -func (x *ContactAttachment_PostalAddress) GetCity() string { - if x != nil { - return x.City - } - return "" -} - -func (x *ContactAttachment_PostalAddress) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *ContactAttachment_PostalAddress) GetPostcode() string { - if x != nil { - return x.Postcode - } - return "" -} - -func (x *ContactAttachment_PostalAddress) GetCountry() string { - if x != nil { - return x.Country - } - return "" -} - -type FilePointer_LocatorInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Must be non-empty if transitCdnKey or plaintextHash are set/nonempty. - // Otherwise must be empty. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Types that are valid to be assigned to IntegrityCheck: - // - // *FilePointer_LocatorInfo_PlaintextHash - // *FilePointer_LocatorInfo_EncryptedDigest - IntegrityCheck isFilePointer_LocatorInfo_IntegrityCheck `protobuf_oneof:"integrityCheck"` - // NB: This is the plaintext size, and empty content attachments are legal, so this - // may be zero even if transitCdnKey or mediaName are set/nonempty. - Size uint32 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` - // Either both transit cdn key and number are set or neither should be set. - // Upload timestamp is optional but should only be set if key/number are set. - TransitCdnKey *string `protobuf:"bytes,4,opt,name=transitCdnKey,proto3,oneof" json:"transitCdnKey,omitempty"` - TransitCdnNumber *uint32 `protobuf:"varint,5,opt,name=transitCdnNumber,proto3,oneof" json:"transitCdnNumber,omitempty"` - TransitTierUploadTimestamp *uint64 `protobuf:"varint,6,opt,name=transitTierUploadTimestamp,proto3,oneof" json:"transitTierUploadTimestamp,omitempty"` - // If present, the cdn number of the succesful upload to media tier. - // If unset, may still have been uploaded, and clients - // can discover the cdn number via the list endpoint. - // Exporting clients should set this as long as their subscription - // has not rotated since last upload; even if currently free tier. - MediaTierCdnNumber *uint32 `protobuf:"varint,7,opt,name=mediaTierCdnNumber,proto3,oneof" json:"mediaTierCdnNumber,omitempty"` - // Separate key used to encrypt this file for the local backup. - // Generally required for local backups. - // Missing field indicates attachment was not available locally - // when the backup was generated, but remote backup or transit - // info was available. - LocalKey []byte `protobuf:"bytes,9,opt,name=localKey,proto3,oneof" json:"localKey,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FilePointer_LocatorInfo) Reset() { - *x = FilePointer_LocatorInfo{} - mi := &file_backuppb_Backup_proto_msgTypes[122] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FilePointer_LocatorInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FilePointer_LocatorInfo) ProtoMessage() {} - -func (x *FilePointer_LocatorInfo) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[122] - 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 FilePointer_LocatorInfo.ProtoReflect.Descriptor instead. -func (*FilePointer_LocatorInfo) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{28, 0} -} - -func (x *FilePointer_LocatorInfo) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *FilePointer_LocatorInfo) GetIntegrityCheck() isFilePointer_LocatorInfo_IntegrityCheck { - if x != nil { - return x.IntegrityCheck - } - return nil -} - -func (x *FilePointer_LocatorInfo) GetPlaintextHash() []byte { - if x != nil { - if x, ok := x.IntegrityCheck.(*FilePointer_LocatorInfo_PlaintextHash); ok { - return x.PlaintextHash - } - } - return nil -} - -func (x *FilePointer_LocatorInfo) GetEncryptedDigest() []byte { - if x != nil { - if x, ok := x.IntegrityCheck.(*FilePointer_LocatorInfo_EncryptedDigest); ok { - return x.EncryptedDigest - } - } - return nil -} - -func (x *FilePointer_LocatorInfo) GetSize() uint32 { - if x != nil { - return x.Size - } - return 0 -} - -func (x *FilePointer_LocatorInfo) GetTransitCdnKey() string { - if x != nil && x.TransitCdnKey != nil { - return *x.TransitCdnKey - } - return "" -} - -func (x *FilePointer_LocatorInfo) GetTransitCdnNumber() uint32 { - if x != nil && x.TransitCdnNumber != nil { - return *x.TransitCdnNumber - } - return 0 -} - -func (x *FilePointer_LocatorInfo) GetTransitTierUploadTimestamp() uint64 { - if x != nil && x.TransitTierUploadTimestamp != nil { - return *x.TransitTierUploadTimestamp - } - return 0 -} - -func (x *FilePointer_LocatorInfo) GetMediaTierCdnNumber() uint32 { - if x != nil && x.MediaTierCdnNumber != nil { - return *x.MediaTierCdnNumber - } - return 0 -} - -func (x *FilePointer_LocatorInfo) GetLocalKey() []byte { - if x != nil { - return x.LocalKey - } - return nil -} - -type isFilePointer_LocatorInfo_IntegrityCheck interface { - isFilePointer_LocatorInfo_IntegrityCheck() -} - -type FilePointer_LocatorInfo_PlaintextHash struct { - // Set if file was at one point downloaded and its plaintextHash was calculated - PlaintextHash []byte `protobuf:"bytes,10,opt,name=plaintextHash,proto3,oneof"` -} - -type FilePointer_LocatorInfo_EncryptedDigest struct { - // Set if file has not been downloaded so its integrity has not been verified - // From the sender of the attachment - EncryptedDigest []byte `protobuf:"bytes,11,opt,name=encryptedDigest,proto3,oneof"` -} - -func (*FilePointer_LocatorInfo_PlaintextHash) isFilePointer_LocatorInfo_IntegrityCheck() {} - -func (*FilePointer_LocatorInfo_EncryptedDigest) isFilePointer_LocatorInfo_IntegrityCheck() {} - -type Quote_QuotedAttachment struct { - state protoimpl.MessageState `protogen:"open.v1"` - ContentType *string `protobuf:"bytes,1,opt,name=contentType,proto3,oneof" json:"contentType,omitempty"` - FileName *string `protobuf:"bytes,2,opt,name=fileName,proto3,oneof" json:"fileName,omitempty"` - Thumbnail *MessageAttachment `protobuf:"bytes,3,opt,name=thumbnail,proto3,oneof" json:"thumbnail,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Quote_QuotedAttachment) Reset() { - *x = Quote_QuotedAttachment{} - mi := &file_backuppb_Backup_proto_msgTypes[123] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Quote_QuotedAttachment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Quote_QuotedAttachment) ProtoMessage() {} - -func (x *Quote_QuotedAttachment) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[123] - 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 Quote_QuotedAttachment.ProtoReflect.Descriptor instead. -func (*Quote_QuotedAttachment) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{29, 0} -} - -func (x *Quote_QuotedAttachment) GetContentType() string { - if x != nil && x.ContentType != nil { - return *x.ContentType - } - return "" -} - -func (x *Quote_QuotedAttachment) GetFileName() string { - if x != nil && x.FileName != nil { - return *x.FileName - } - return "" -} - -func (x *Quote_QuotedAttachment) GetThumbnail() *MessageAttachment { - if x != nil { - return x.Thumbnail - } - 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 - // - // Types that are valid to be assigned to Update: - // - // *GroupChangeChatUpdate_Update_GenericGroupUpdate - // *GroupChangeChatUpdate_Update_GroupCreationUpdate - // *GroupChangeChatUpdate_Update_GroupNameUpdate - // *GroupChangeChatUpdate_Update_GroupAvatarUpdate - // *GroupChangeChatUpdate_Update_GroupDescriptionUpdate - // *GroupChangeChatUpdate_Update_GroupMembershipAccessLevelChangeUpdate - // *GroupChangeChatUpdate_Update_GroupAttributesAccessLevelChangeUpdate - // *GroupChangeChatUpdate_Update_GroupAnnouncementOnlyChangeUpdate - // *GroupChangeChatUpdate_Update_GroupAdminStatusUpdate - // *GroupChangeChatUpdate_Update_GroupMemberLeftUpdate - // *GroupChangeChatUpdate_Update_GroupMemberRemovedUpdate - // *GroupChangeChatUpdate_Update_SelfInvitedToGroupUpdate - // *GroupChangeChatUpdate_Update_SelfInvitedOtherUserToGroupUpdate - // *GroupChangeChatUpdate_Update_GroupUnknownInviteeUpdate - // *GroupChangeChatUpdate_Update_GroupInvitationAcceptedUpdate - // *GroupChangeChatUpdate_Update_GroupInvitationDeclinedUpdate - // *GroupChangeChatUpdate_Update_GroupMemberJoinedUpdate - // *GroupChangeChatUpdate_Update_GroupMemberAddedUpdate - // *GroupChangeChatUpdate_Update_GroupSelfInvitationRevokedUpdate - // *GroupChangeChatUpdate_Update_GroupInvitationRevokedUpdate - // *GroupChangeChatUpdate_Update_GroupJoinRequestUpdate - // *GroupChangeChatUpdate_Update_GroupJoinRequestApprovalUpdate - // *GroupChangeChatUpdate_Update_GroupJoinRequestCanceledUpdate - // *GroupChangeChatUpdate_Update_GroupInviteLinkResetUpdate - // *GroupChangeChatUpdate_Update_GroupInviteLinkEnabledUpdate - // *GroupChangeChatUpdate_Update_GroupInviteLinkAdminApprovalUpdate - // *GroupChangeChatUpdate_Update_GroupInviteLinkDisabledUpdate - // *GroupChangeChatUpdate_Update_GroupMemberJoinedByLinkUpdate - // *GroupChangeChatUpdate_Update_GroupV2MigrationUpdate - // *GroupChangeChatUpdate_Update_GroupV2MigrationSelfInvitedUpdate - // *GroupChangeChatUpdate_Update_GroupV2MigrationInvitedMembersUpdate - // *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 -} - -func (x *GroupChangeChatUpdate_Update) Reset() { - *x = GroupChangeChatUpdate_Update{} - mi := &file_backuppb_Backup_proto_msgTypes[126] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChangeChatUpdate_Update) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChangeChatUpdate_Update) ProtoMessage() {} - -func (x *GroupChangeChatUpdate_Update) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[126] - 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 GroupChangeChatUpdate_Update.ProtoReflect.Descriptor instead. -func (*GroupChangeChatUpdate_Update) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{43, 0} -} - -func (x *GroupChangeChatUpdate_Update) GetUpdate() isGroupChangeChatUpdate_Update_Update { - if x != nil { - return x.Update - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGenericGroupUpdate() *GenericGroupUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GenericGroupUpdate); ok { - return x.GenericGroupUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupCreationUpdate() *GroupCreationUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupCreationUpdate); ok { - return x.GroupCreationUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupNameUpdate() *GroupNameUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupNameUpdate); ok { - return x.GroupNameUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupAvatarUpdate() *GroupAvatarUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupAvatarUpdate); ok { - return x.GroupAvatarUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupDescriptionUpdate() *GroupDescriptionUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupDescriptionUpdate); ok { - return x.GroupDescriptionUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupMembershipAccessLevelChangeUpdate() *GroupMembershipAccessLevelChangeUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupMembershipAccessLevelChangeUpdate); ok { - return x.GroupMembershipAccessLevelChangeUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupAttributesAccessLevelChangeUpdate() *GroupAttributesAccessLevelChangeUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupAttributesAccessLevelChangeUpdate); ok { - return x.GroupAttributesAccessLevelChangeUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupAnnouncementOnlyChangeUpdate() *GroupAnnouncementOnlyChangeUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupAnnouncementOnlyChangeUpdate); ok { - return x.GroupAnnouncementOnlyChangeUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupAdminStatusUpdate() *GroupAdminStatusUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupAdminStatusUpdate); ok { - return x.GroupAdminStatusUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupMemberLeftUpdate() *GroupMemberLeftUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupMemberLeftUpdate); ok { - return x.GroupMemberLeftUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupMemberRemovedUpdate() *GroupMemberRemovedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupMemberRemovedUpdate); ok { - return x.GroupMemberRemovedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetSelfInvitedToGroupUpdate() *SelfInvitedToGroupUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_SelfInvitedToGroupUpdate); ok { - return x.SelfInvitedToGroupUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetSelfInvitedOtherUserToGroupUpdate() *SelfInvitedOtherUserToGroupUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_SelfInvitedOtherUserToGroupUpdate); ok { - return x.SelfInvitedOtherUserToGroupUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupUnknownInviteeUpdate() *GroupUnknownInviteeUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupUnknownInviteeUpdate); ok { - return x.GroupUnknownInviteeUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupInvitationAcceptedUpdate() *GroupInvitationAcceptedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupInvitationAcceptedUpdate); ok { - return x.GroupInvitationAcceptedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupInvitationDeclinedUpdate() *GroupInvitationDeclinedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupInvitationDeclinedUpdate); ok { - return x.GroupInvitationDeclinedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupMemberJoinedUpdate() *GroupMemberJoinedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupMemberJoinedUpdate); ok { - return x.GroupMemberJoinedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupMemberAddedUpdate() *GroupMemberAddedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupMemberAddedUpdate); ok { - return x.GroupMemberAddedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupSelfInvitationRevokedUpdate() *GroupSelfInvitationRevokedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupSelfInvitationRevokedUpdate); ok { - return x.GroupSelfInvitationRevokedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupInvitationRevokedUpdate() *GroupInvitationRevokedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupInvitationRevokedUpdate); ok { - return x.GroupInvitationRevokedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupJoinRequestUpdate() *GroupJoinRequestUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupJoinRequestUpdate); ok { - return x.GroupJoinRequestUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupJoinRequestApprovalUpdate() *GroupJoinRequestApprovalUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupJoinRequestApprovalUpdate); ok { - return x.GroupJoinRequestApprovalUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupJoinRequestCanceledUpdate() *GroupJoinRequestCanceledUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupJoinRequestCanceledUpdate); ok { - return x.GroupJoinRequestCanceledUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupInviteLinkResetUpdate() *GroupInviteLinkResetUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupInviteLinkResetUpdate); ok { - return x.GroupInviteLinkResetUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupInviteLinkEnabledUpdate() *GroupInviteLinkEnabledUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupInviteLinkEnabledUpdate); ok { - return x.GroupInviteLinkEnabledUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupInviteLinkAdminApprovalUpdate() *GroupInviteLinkAdminApprovalUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupInviteLinkAdminApprovalUpdate); ok { - return x.GroupInviteLinkAdminApprovalUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupInviteLinkDisabledUpdate() *GroupInviteLinkDisabledUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupInviteLinkDisabledUpdate); ok { - return x.GroupInviteLinkDisabledUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupMemberJoinedByLinkUpdate() *GroupMemberJoinedByLinkUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupMemberJoinedByLinkUpdate); ok { - return x.GroupMemberJoinedByLinkUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupV2MigrationUpdate() *GroupV2MigrationUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupV2MigrationUpdate); ok { - return x.GroupV2MigrationUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupV2MigrationSelfInvitedUpdate() *GroupV2MigrationSelfInvitedUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupV2MigrationSelfInvitedUpdate); ok { - return x.GroupV2MigrationSelfInvitedUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupV2MigrationInvitedMembersUpdate() *GroupV2MigrationInvitedMembersUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupV2MigrationInvitedMembersUpdate); ok { - return x.GroupV2MigrationInvitedMembersUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupV2MigrationDroppedMembersUpdate() *GroupV2MigrationDroppedMembersUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupV2MigrationDroppedMembersUpdate); ok { - return x.GroupV2MigrationDroppedMembersUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupSequenceOfRequestsAndCancelsUpdate() *GroupSequenceOfRequestsAndCancelsUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupSequenceOfRequestsAndCancelsUpdate); ok { - return x.GroupSequenceOfRequestsAndCancelsUpdate - } - } - return nil -} - -func (x *GroupChangeChatUpdate_Update) GetGroupExpirationTimerUpdate() *GroupExpirationTimerUpdate { - if x != nil { - if x, ok := x.Update.(*GroupChangeChatUpdate_Update_GroupExpirationTimerUpdate); ok { - return x.GroupExpirationTimerUpdate - } - } - 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() -} - -type GroupChangeChatUpdate_Update_GenericGroupUpdate struct { - GenericGroupUpdate *GenericGroupUpdate `protobuf:"bytes,1,opt,name=genericGroupUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupCreationUpdate struct { - GroupCreationUpdate *GroupCreationUpdate `protobuf:"bytes,2,opt,name=groupCreationUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupNameUpdate struct { - GroupNameUpdate *GroupNameUpdate `protobuf:"bytes,3,opt,name=groupNameUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupAvatarUpdate struct { - GroupAvatarUpdate *GroupAvatarUpdate `protobuf:"bytes,4,opt,name=groupAvatarUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupDescriptionUpdate struct { - GroupDescriptionUpdate *GroupDescriptionUpdate `protobuf:"bytes,5,opt,name=groupDescriptionUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupMembershipAccessLevelChangeUpdate struct { - GroupMembershipAccessLevelChangeUpdate *GroupMembershipAccessLevelChangeUpdate `protobuf:"bytes,6,opt,name=groupMembershipAccessLevelChangeUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupAttributesAccessLevelChangeUpdate struct { - GroupAttributesAccessLevelChangeUpdate *GroupAttributesAccessLevelChangeUpdate `protobuf:"bytes,7,opt,name=groupAttributesAccessLevelChangeUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupAnnouncementOnlyChangeUpdate struct { - GroupAnnouncementOnlyChangeUpdate *GroupAnnouncementOnlyChangeUpdate `protobuf:"bytes,8,opt,name=groupAnnouncementOnlyChangeUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupAdminStatusUpdate struct { - GroupAdminStatusUpdate *GroupAdminStatusUpdate `protobuf:"bytes,9,opt,name=groupAdminStatusUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupMemberLeftUpdate struct { - GroupMemberLeftUpdate *GroupMemberLeftUpdate `protobuf:"bytes,10,opt,name=groupMemberLeftUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupMemberRemovedUpdate struct { - GroupMemberRemovedUpdate *GroupMemberRemovedUpdate `protobuf:"bytes,11,opt,name=groupMemberRemovedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_SelfInvitedToGroupUpdate struct { - SelfInvitedToGroupUpdate *SelfInvitedToGroupUpdate `protobuf:"bytes,12,opt,name=selfInvitedToGroupUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_SelfInvitedOtherUserToGroupUpdate struct { - SelfInvitedOtherUserToGroupUpdate *SelfInvitedOtherUserToGroupUpdate `protobuf:"bytes,13,opt,name=selfInvitedOtherUserToGroupUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupUnknownInviteeUpdate struct { - GroupUnknownInviteeUpdate *GroupUnknownInviteeUpdate `protobuf:"bytes,14,opt,name=groupUnknownInviteeUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupInvitationAcceptedUpdate struct { - GroupInvitationAcceptedUpdate *GroupInvitationAcceptedUpdate `protobuf:"bytes,15,opt,name=groupInvitationAcceptedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupInvitationDeclinedUpdate struct { - GroupInvitationDeclinedUpdate *GroupInvitationDeclinedUpdate `protobuf:"bytes,16,opt,name=groupInvitationDeclinedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupMemberJoinedUpdate struct { - GroupMemberJoinedUpdate *GroupMemberJoinedUpdate `protobuf:"bytes,17,opt,name=groupMemberJoinedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupMemberAddedUpdate struct { - GroupMemberAddedUpdate *GroupMemberAddedUpdate `protobuf:"bytes,18,opt,name=groupMemberAddedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupSelfInvitationRevokedUpdate struct { - GroupSelfInvitationRevokedUpdate *GroupSelfInvitationRevokedUpdate `protobuf:"bytes,19,opt,name=groupSelfInvitationRevokedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupInvitationRevokedUpdate struct { - GroupInvitationRevokedUpdate *GroupInvitationRevokedUpdate `protobuf:"bytes,20,opt,name=groupInvitationRevokedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupJoinRequestUpdate struct { - GroupJoinRequestUpdate *GroupJoinRequestUpdate `protobuf:"bytes,21,opt,name=groupJoinRequestUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupJoinRequestApprovalUpdate struct { - GroupJoinRequestApprovalUpdate *GroupJoinRequestApprovalUpdate `protobuf:"bytes,22,opt,name=groupJoinRequestApprovalUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupJoinRequestCanceledUpdate struct { - GroupJoinRequestCanceledUpdate *GroupJoinRequestCanceledUpdate `protobuf:"bytes,23,opt,name=groupJoinRequestCanceledUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupInviteLinkResetUpdate struct { - GroupInviteLinkResetUpdate *GroupInviteLinkResetUpdate `protobuf:"bytes,24,opt,name=groupInviteLinkResetUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupInviteLinkEnabledUpdate struct { - GroupInviteLinkEnabledUpdate *GroupInviteLinkEnabledUpdate `protobuf:"bytes,25,opt,name=groupInviteLinkEnabledUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupInviteLinkAdminApprovalUpdate struct { - GroupInviteLinkAdminApprovalUpdate *GroupInviteLinkAdminApprovalUpdate `protobuf:"bytes,26,opt,name=groupInviteLinkAdminApprovalUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupInviteLinkDisabledUpdate struct { - GroupInviteLinkDisabledUpdate *GroupInviteLinkDisabledUpdate `protobuf:"bytes,27,opt,name=groupInviteLinkDisabledUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupMemberJoinedByLinkUpdate struct { - GroupMemberJoinedByLinkUpdate *GroupMemberJoinedByLinkUpdate `protobuf:"bytes,28,opt,name=groupMemberJoinedByLinkUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupV2MigrationUpdate struct { - GroupV2MigrationUpdate *GroupV2MigrationUpdate `protobuf:"bytes,29,opt,name=groupV2MigrationUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupV2MigrationSelfInvitedUpdate struct { - GroupV2MigrationSelfInvitedUpdate *GroupV2MigrationSelfInvitedUpdate `protobuf:"bytes,30,opt,name=groupV2MigrationSelfInvitedUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupV2MigrationInvitedMembersUpdate struct { - GroupV2MigrationInvitedMembersUpdate *GroupV2MigrationInvitedMembersUpdate `protobuf:"bytes,31,opt,name=groupV2MigrationInvitedMembersUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupV2MigrationDroppedMembersUpdate struct { - GroupV2MigrationDroppedMembersUpdate *GroupV2MigrationDroppedMembersUpdate `protobuf:"bytes,32,opt,name=groupV2MigrationDroppedMembersUpdate,proto3,oneof"` -} - -type GroupChangeChatUpdate_Update_GroupSequenceOfRequestsAndCancelsUpdate struct { - GroupSequenceOfRequestsAndCancelsUpdate *GroupSequenceOfRequestsAndCancelsUpdate `protobuf:"bytes,33,opt,name=groupSequenceOfRequestsAndCancelsUpdate,proto3,oneof"` -} - -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() {} - -func (*GroupChangeChatUpdate_Update_GroupNameUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupAvatarUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupDescriptionUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupMembershipAccessLevelChangeUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupAttributesAccessLevelChangeUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupAnnouncementOnlyChangeUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupAdminStatusUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupMemberLeftUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupMemberRemovedUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_SelfInvitedToGroupUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_SelfInvitedOtherUserToGroupUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupUnknownInviteeUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupInvitationAcceptedUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupInvitationDeclinedUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupMemberJoinedUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupMemberAddedUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupSelfInvitationRevokedUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupInvitationRevokedUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupJoinRequestUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupJoinRequestApprovalUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupJoinRequestCanceledUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupInviteLinkResetUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupInviteLinkEnabledUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupInviteLinkAdminApprovalUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupInviteLinkDisabledUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupMemberJoinedByLinkUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupV2MigrationUpdate) isGroupChangeChatUpdate_Update_Update() {} - -func (*GroupChangeChatUpdate_Update_GroupV2MigrationSelfInvitedUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupV2MigrationInvitedMembersUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupV2MigrationDroppedMembersUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -func (*GroupChangeChatUpdate_Update_GroupSequenceOfRequestsAndCancelsUpdate) isGroupChangeChatUpdate_Update_Update() { -} - -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"` - // Prefer to use aci over pni. No need to set - // pni if aci is set. Both can be missing. - InviteeAci []byte `protobuf:"bytes,2,opt,name=inviteeAci,proto3,oneof" json:"inviteeAci,omitempty"` - InviteePni []byte `protobuf:"bytes,3,opt,name=inviteePni,proto3,oneof" json:"inviteePni,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInvitationRevokedUpdate_Invitee) Reset() { - *x = GroupInvitationRevokedUpdate_Invitee{} - mi := &file_backuppb_Backup_proto_msgTypes[127] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInvitationRevokedUpdate_Invitee) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInvitationRevokedUpdate_Invitee) ProtoMessage() {} - -func (x *GroupInvitationRevokedUpdate_Invitee) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[127] - 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 GroupInvitationRevokedUpdate_Invitee.ProtoReflect.Descriptor instead. -func (*GroupInvitationRevokedUpdate_Invitee) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{65, 0} -} - -func (x *GroupInvitationRevokedUpdate_Invitee) GetInviterAci() []byte { - if x != nil { - return x.InviterAci - } - return nil -} - -func (x *GroupInvitationRevokedUpdate_Invitee) GetInviteeAci() []byte { - if x != nil { - return x.InviteeAci - } - return nil -} - -func (x *GroupInvitationRevokedUpdate_Invitee) GetInviteePni() []byte { - if x != nil { - return x.InviteePni - } - return nil -} - -type ChatStyle_Gradient struct { - state protoimpl.MessageState `protogen:"open.v1"` - Angle uint32 `protobuf:"varint,1,opt,name=angle,proto3" json:"angle,omitempty"` // degrees - Colors []uint32 `protobuf:"fixed32,2,rep,packed,name=colors,proto3" json:"colors,omitempty"` // 0xAARRGGBB - Positions []float32 `protobuf:"fixed32,3,rep,packed,name=positions,proto3" json:"positions,omitempty"` // percent from 0 to 1 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatStyle_Gradient) Reset() { - *x = ChatStyle_Gradient{} - mi := &file_backuppb_Backup_proto_msgTypes[128] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatStyle_Gradient) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatStyle_Gradient) ProtoMessage() {} - -func (x *ChatStyle_Gradient) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[128] - 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 ChatStyle_Gradient.ProtoReflect.Descriptor instead. -func (*ChatStyle_Gradient) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 0} -} - -func (x *ChatStyle_Gradient) GetAngle() uint32 { - if x != nil { - return x.Angle - } - return 0 -} - -func (x *ChatStyle_Gradient) GetColors() []uint32 { - if x != nil { - return x.Colors - } - return nil -} - -func (x *ChatStyle_Gradient) GetPositions() []float32 { - if x != nil { - return x.Positions - } - return nil -} - -type ChatStyle_CustomChatColor struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // If unset, use the default chat color - // - // Types that are valid to be assigned to Color: - // - // *ChatStyle_CustomChatColor_Solid - // *ChatStyle_CustomChatColor_Gradient - Color isChatStyle_CustomChatColor_Color `protobuf_oneof:"color"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatStyle_CustomChatColor) Reset() { - *x = ChatStyle_CustomChatColor{} - mi := &file_backuppb_Backup_proto_msgTypes[129] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatStyle_CustomChatColor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatStyle_CustomChatColor) ProtoMessage() {} - -func (x *ChatStyle_CustomChatColor) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[129] - 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 ChatStyle_CustomChatColor.ProtoReflect.Descriptor instead. -func (*ChatStyle_CustomChatColor) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 1} -} - -func (x *ChatStyle_CustomChatColor) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ChatStyle_CustomChatColor) GetColor() isChatStyle_CustomChatColor_Color { - if x != nil { - return x.Color - } - return nil -} - -func (x *ChatStyle_CustomChatColor) GetSolid() uint32 { - if x != nil { - if x, ok := x.Color.(*ChatStyle_CustomChatColor_Solid); ok { - return x.Solid - } - } - return 0 -} - -func (x *ChatStyle_CustomChatColor) GetGradient() *ChatStyle_Gradient { - if x != nil { - if x, ok := x.Color.(*ChatStyle_CustomChatColor_Gradient); ok { - return x.Gradient - } - } - return nil -} - -type isChatStyle_CustomChatColor_Color interface { - isChatStyle_CustomChatColor_Color() -} - -type ChatStyle_CustomChatColor_Solid struct { - Solid uint32 `protobuf:"fixed32,2,opt,name=solid,proto3,oneof"` // 0xAARRGGBB -} - -type ChatStyle_CustomChatColor_Gradient struct { - Gradient *ChatStyle_Gradient `protobuf:"bytes,3,opt,name=gradient,proto3,oneof"` -} - -func (*ChatStyle_CustomChatColor_Solid) isChatStyle_CustomChatColor_Color() {} - -func (*ChatStyle_CustomChatColor_Gradient) isChatStyle_CustomChatColor_Color() {} - -type ChatStyle_AutomaticBubbleColor struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatStyle_AutomaticBubbleColor) Reset() { - *x = ChatStyle_AutomaticBubbleColor{} - mi := &file_backuppb_Backup_proto_msgTypes[130] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatStyle_AutomaticBubbleColor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatStyle_AutomaticBubbleColor) ProtoMessage() {} - -func (x *ChatStyle_AutomaticBubbleColor) ProtoReflect() protoreflect.Message { - mi := &file_backuppb_Backup_proto_msgTypes[130] - 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 ChatStyle_AutomaticBubbleColor.ProtoReflect.Descriptor instead. -func (*ChatStyle_AutomaticBubbleColor) Descriptor() ([]byte, []int) { - return file_backuppb_Backup_proto_rawDescGZIP(), []int{83, 2} -} - -var File_backuppb_Backup_proto protoreflect.FileDescriptor - -const file_backuppb_Backup_proto_rawDesc = "" + - "\n" + - "\x15backuppb/Backup.proto\x12\rsignal.backup\"\xf0\x01\n" + - "\n" + - "BackupInfo\x12\x18\n" + - "\aversion\x18\x01 \x01(\x04R\aversion\x12\"\n" + - "\fbackupTimeMs\x18\x02 \x01(\x04R\fbackupTimeMs\x12.\n" + - "\x12mediaRootBackupKey\x18\x03 \x01(\fR\x12mediaRootBackupKey\x12,\n" + - "\x11currentAppVersion\x18\x04 \x01(\tR\x11currentAppVersion\x12(\n" + - "\x0ffirstAppVersion\x18\x05 \x01(\tR\x0ffirstAppVersion\x12\x1c\n" + - "\tdebugInfo\x18\x06 \x01(\fR\tdebugInfo\"\xf2\x03\n" + - "\x05Frame\x126\n" + - "\aaccount\x18\x01 \x01(\v2\x1a.signal.backup.AccountDataH\x00R\aaccount\x128\n" + - "\trecipient\x18\x02 \x01(\v2\x18.signal.backup.RecipientH\x00R\trecipient\x12)\n" + - "\x04chat\x18\x03 \x01(\v2\x13.signal.backup.ChatH\x00R\x04chat\x125\n" + - "\bchatItem\x18\x04 \x01(\v2\x17.signal.backup.ChatItemH\x00R\bchatItem\x12>\n" + - "\vstickerPack\x18\x05 \x01(\v2\x1a.signal.backup.StickerPackH\x00R\vstickerPack\x128\n" + - "\tadHocCall\x18\x06 \x01(\v2\x18.signal.backup.AdHocCallH\x00R\tadHocCall\x12V\n" + - "\x13notificationProfile\x18\a \x01(\v2\".signal.backup.NotificationProfileH\x00R\x13notificationProfile\x12;\n" + - "\n" + - "chatFolder\x18\b \x01(\v2\x19.signal.backup.ChatFolderH\x00R\n" + - "chatFolderB\x06\n" + - "\x04item\"\x9e)\n" + - "\vAccountData\x12\x1e\n" + - "\n" + - "profileKey\x18\x01 \x01(\fR\n" + - "profileKey\x12\x1f\n" + - "\busername\x18\x02 \x01(\tH\x00R\busername\x88\x01\x01\x12K\n" + - "\fusernameLink\x18\x03 \x01(\v2'.signal.backup.AccountData.UsernameLinkR\fusernameLink\x12\x1c\n" + - "\tgivenName\x18\x04 \x01(\tR\tgivenName\x12\x1e\n" + - "\n" + - "familyName\x18\x05 \x01(\tR\n" + - "familyName\x12$\n" + - "\ravatarUrlPath\x18\x06 \x01(\tR\ravatarUrlPath\x12a\n" + - "\x16donationSubscriberData\x18\a \x01(\v2).signal.backup.AccountData.SubscriberDataR\x16donationSubscriberData\x12T\n" + - "\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\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" + - "\x05color\x18\x03 \x01(\x0e2-.signal.backup.AccountData.UsernameLink.ColorR\x05color\"k\n" + - "\x05Color\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\b\n" + - "\x04BLUE\x10\x01\x12\t\n" + - "\x05WHITE\x10\x02\x12\b\n" + - "\x04GREY\x10\x03\x12\t\n" + - "\x05OLIVE\x10\x04\x12\t\n" + - "\x05GREEN\x10\x05\x12\n" + - "\n" + - "\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\xb7\x16\n" + - "\x0fAccountSettings\x12\"\n" + - "\freadReceipts\x18\x01 \x01(\bR\freadReceipts\x126\n" + - "\x16sealedSenderIndicators\x18\x02 \x01(\bR\x16sealedSenderIndicators\x12*\n" + - "\x10typingIndicators\x18\x03 \x01(\bR\x10typingIndicators\x12\"\n" + - "\flinkPreviews\x18\x04 \x01(\bR\flinkPreviews\x12B\n" + - "\x1cnotDiscoverableByPhoneNumber\x18\x05 \x01(\bR\x1cnotDiscoverableByPhoneNumber\x122\n" + - "\x14preferContactAvatars\x18\x06 \x01(\bR\x14preferContactAvatars\x12@\n" + - "\x1buniversalExpireTimerSeconds\x18\a \x01(\rR\x1buniversalExpireTimerSeconds\x126\n" + - "\x16preferredReactionEmoji\x18\b \x03(\tR\x16preferredReactionEmoji\x126\n" + - "\x16displayBadgesOnProfile\x18\t \x01(\bR\x16displayBadgesOnProfile\x126\n" + - "\x16keepMutedChatsArchived\x18\n" + - " \x01(\bR\x16keepMutedChatsArchived\x126\n" + - "\x16hasSetMyStoriesPrivacy\x18\v \x01(\bR\x16hasSetMyStoriesPrivacy\x12:\n" + - "\x18hasViewedOnboardingStory\x18\f \x01(\bR\x18hasViewedOnboardingStory\x12(\n" + - "\x0fstoriesDisabled\x18\r \x01(\bR\x0fstoriesDisabled\x12?\n" + - "\x18storyViewReceiptsEnabled\x18\x0e \x01(\bH\x00R\x18storyViewReceiptsEnabled\x88\x01\x01\x12H\n" + - "\x1fhasSeenGroupStoryEducationSheet\x18\x0f \x01(\bR\x1fhasSeenGroupStoryEducationSheet\x12F\n" + - "\x1ehasCompletedUsernameOnboarding\x18\x10 \x01(\bR\x1ehasCompletedUsernameOnboarding\x12i\n" + - "\x16phoneNumberSharingMode\x18\x11 \x01(\x0e21.signal.backup.AccountData.PhoneNumberSharingModeR\x16phoneNumberSharingMode\x12D\n" + - "\x10defaultChatStyle\x18\x12 \x01(\v2\x18.signal.backup.ChatStyleR\x10defaultChatStyle\x12T\n" + - "\x10customChatColors\x18\x13 \x03(\v2(.signal.backup.ChatStyle.CustomChatColorR\x10customChatColors\x128\n" + - "\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!hasSeenAdminDeleteEducationDialog\x12d\n" + - "\x0funreadBadgeType\x18! \x01(\x0e2:.signal.backup.AccountData.AccountSettings.UnreadBadgeTypeR\x0funreadBadgeType\x12?\n" + - "\x18includeMutedChatsInBadge\x18\" \x01(\bH\x04R\x18includeMutedChatsInBadge\x88\x01\x01\x129\n" + - "\x15reactionNotifications\x18# \x01(\bH\x05R\x15reactionNotifications\x88\x01\x01\x129\n" + - "\x15notifyForCallsIfMuted\x18$ \x01(\bH\x06R\x15notifyForCallsIfMuted\x88\x01\x01\x12?\n" + - "\x18notifyForMentionsIfMuted\x18% \x01(\bH\aR\x18notifyForMentionsIfMuted\x88\x01\x01\x12=\n" + - "\x17notifyForRepliesIfMuted\x18& \x01(\bH\bR\x17notifyForRepliesIfMuted\x88\x01\x01\x125\n" + - "\x13showUnreadReminders\x18' \x01(\bH\tR\x13showUnreadReminders\x88\x01\x01\x12;\n" + - "\x16notifyWhenContactJoins\x18( \x01(\bH\n" + - "R\x16notifyWhenContactJoins\x88\x01\x01\"P\n" + - "\x0fUnreadBadgeType\x12\x16\n" + - "\x12UNKNOWN_BADGE_TYPE\x10\x00\x12\x13\n" + - "\x0fUNREAD_MESSAGES\x10\x01\x12\x10\n" + - "\fUNREAD_CHATS\x10\x02B\x1b\n" + - "\x19_storyViewReceiptsEnabledB\r\n" + - "\v_backupTierB\x1b\n" + - "\x19_screenLockTimeoutMinutesB\x0f\n" + - "\r_pinRemindersB\x1b\n" + - "\x19_includeMutedChatsInBadgeB\x18\n" + - "\x16_reactionNotificationsB\x18\n" + - "\x16_notifyForCallsIfMutedB\x1b\n" + - "\x19_notifyForMentionsIfMutedB\x1a\n" + - "\x18_notifyForRepliesIfMutedB\x16\n" + - "\x14_showUnreadRemindersB\x19\n" + - "\x17_notifyWhenContactJoinsJ\x04\b\x16\x10\x17J\x04\b\x19\x10\x1a\x1a\x86\x01\n" + - "\x0eSubscriberData\x12\"\n" + - "\fsubscriberId\x18\x01 \x01(\fR\fsubscriberId\x12\"\n" + - "\fcurrencyCode\x18\x02 \x01(\tR\fcurrencyCode\x12,\n" + - "\x11manuallyCancelled\x18\x03 \x01(\bR\x11manuallyCancelled\x1a\xac\x01\n" + - "\x11IAPSubscriberData\x12\"\n" + - "\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" + - "\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_usernameJ\x04\b\b\x10\tJ\x04\b\x0f\x10\x10\"\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" + - "\x05group\x18\x03 \x01(\v2\x14.signal.backup.GroupH\x00R\x05group\x12Q\n" + - "\x10distributionList\x18\x04 \x01(\v2#.signal.backup.DistributionListItemH\x00R\x10distributionList\x12)\n" + - "\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\"\xca\v\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" + - "\busername\x18\x03 \x01(\tH\x03R\busername\x88\x01\x01\x12\x17\n" + - "\x04e164\x18\x04 \x01(\x04H\x04R\x04e164\x88\x01\x01\x12\x18\n" + - "\ablocked\x18\x05 \x01(\bR\ablocked\x12A\n" + - "\n" + - "visibility\x18\x06 \x01(\x0e2!.signal.backup.Contact.VisibilityR\n" + - "visibility\x12C\n" + - "\n" + - "registered\x18\a \x01(\v2!.signal.backup.Contact.RegisteredH\x00R\n" + - "registered\x12L\n" + - "\rnotRegistered\x18\b \x01(\v2$.signal.backup.Contact.NotRegisteredH\x00R\rnotRegistered\x12#\n" + - "\n" + - "profileKey\x18\t \x01(\fH\x05R\n" + - "profileKey\x88\x01\x01\x12&\n" + - "\x0eprofileSharing\x18\n" + - " \x01(\bR\x0eprofileSharing\x12/\n" + - "\x10profileGivenName\x18\v \x01(\tH\x06R\x10profileGivenName\x88\x01\x01\x121\n" + - "\x11profileFamilyName\x18\f \x01(\tH\aR\x11profileFamilyName\x88\x01\x01\x12\x1c\n" + - "\thideStory\x18\r \x01(\bR\thideStory\x12%\n" + - "\videntityKey\x18\x0e \x01(\fH\bR\videntityKey\x88\x01\x01\x12J\n" + - "\ridentityState\x18\x0f \x01(\x0e2$.signal.backup.Contact.IdentityStateR\ridentityState\x127\n" + - "\bnickname\x18\x10 \x01(\v2\x1b.signal.backup.Contact.NameR\bnickname\x12\x12\n" + - "\x04note\x18\x11 \x01(\tR\x04note\x12(\n" + - "\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\x12.\n" + - "\x12blockedAtTimestamp\x18\x17 \x01(\x04R\x12blockedAtTimestamp\x1a\f\n" + - "\n" + - "Registered\x1aE\n" + - "\rNotRegistered\x124\n" + - "\x15unregisteredTimestamp\x18\x01 \x01(\x04R\x15unregisteredTimestamp\x1a4\n" + - "\x04Name\x12\x14\n" + - "\x05given\x18\x01 \x01(\tR\x05given\x12\x16\n" + - "\x06family\x18\x02 \x01(\tR\x06family\":\n" + - "\rIdentityState\x12\v\n" + - "\aDEFAULT\x10\x00\x12\f\n" + - "\bVERIFIED\x10\x01\x12\x0e\n" + - "\n" + - "UNVERIFIED\x10\x02\"A\n" + - "\n" + - "Visibility\x12\v\n" + - "\aVISIBLE\x10\x00\x12\n" + - "\n" + - "\x06HIDDEN\x10\x01\x12\x1a\n" + - "\x16HIDDEN_MESSAGE_REQUEST\x10\x02B\x0e\n" + - "\fregistrationB\x06\n" + - "\x04_aciB\x06\n" + - "\x04_pniB\v\n" + - "\t_usernameB\a\n" + - "\x05_e164B\r\n" + - "\v_profileKeyB\x13\n" + - "\x11_profileGivenNameB\x14\n" + - "\x12_profileFamilyNameB\x0e\n" + - "\f_identityKeyB\x0e\n" + - "\f_avatarColorB\x16\n" + - "\x14_keyTransparencyData\"\xf6\x13\n" + - "\x05Group\x12\x1c\n" + - "\tmasterKey\x18\x01 \x01(\fR\tmasterKey\x12 \n" + - "\vwhitelisted\x18\x02 \x01(\bR\vwhitelisted\x12\x1c\n" + - "\thideStory\x18\x03 \x01(\bR\thideStory\x12H\n" + - "\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\x12.\n" + - "\x12blockedAtTimestamp\x18\b \x01(\x04R\x12blockedAtTimestamp\x1a\xe5\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" + - "\tavatarUrl\x18\x03 \x01(\tR\tavatarUrl\x12e\n" + - "\x19disappearingMessagesTimer\x18\x04 \x01(\v2'.signal.backup.Group.GroupAttributeBlobR\x19disappearingMessagesTimer\x12H\n" + - "\raccessControl\x18\x05 \x01(\v2\".signal.backup.Group.AccessControlR\raccessControl\x12\x18\n" + - "\aversion\x18\x06 \x01(\rR\aversion\x125\n" + - "\amembers\x18\a \x03(\v2\x1b.signal.backup.Group.MemberR\amembers\x12h\n" + - "\x18membersPendingProfileKey\x18\b \x03(\v2,.signal.backup.Group.MemberPendingProfileKeyR\x18membersPendingProfileKey\x12q\n" + - "\x1bmembersPendingAdminApproval\x18\t \x03(\v2/.signal.backup.Group.MemberPendingAdminApprovalR\x1bmembersPendingAdminApproval\x12.\n" + - "\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" + - "\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" + - "\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" + - "\x04Role\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\v\n" + - "\aDEFAULT\x10\x01\x12\x11\n" + - "\rADMINISTRATOR\x10\x02J\x04\b\x03\x10\x04J\x04\b\x04\x10\x05\x1a\x92\x01\n" + - "\x17MemberPendingProfileKey\x123\n" + - "\x06member\x18\x01 \x01(\v2\x1b.signal.backup.Group.MemberR\x06member\x12$\n" + - "\raddedByUserId\x18\x02 \x01(\fR\raddedByUserId\x12\x1c\n" + - "\ttimestamp\x18\x03 \x01(\x04R\ttimestamp\x1a^\n" + - "\x1aMemberPendingAdminApproval\x12\x16\n" + - "\x06userId\x18\x01 \x01(\fR\x06userId\x12\x1c\n" + - "\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" + - "\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" + - "\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\"7\n" + - "\rStorySendMode\x12\v\n" + - "\aDEFAULT\x10\x00\x12\f\n" + - "\bDISABLED\x10\x01\x12\v\n" + - "\aENABLED\x10\x02B\x0e\n" + - "\f_avatarColor\"Y\n" + - "\x04Self\x12A\n" + - "\vavatarColor\x18\x01 \x01(\x0e2\x1a.signal.backup.AvatarColorH\x00R\vavatarColor\x88\x01\x01B\x0e\n" + - "\f_avatarColor\"\x0e\n" + - "\fReleaseNotes\"\xb0\x06\n" + - "\x04Chat\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x12 \n" + - "\vrecipientId\x18\x02 \x01(\x04R\vrecipientId\x12\x1a\n" + - "\barchived\x18\x03 \x01(\bR\barchived\x12%\n" + - "\vpinnedOrder\x18\x04 \x01(\rH\x00R\vpinnedOrder\x88\x01\x01\x121\n" + - "\x11expirationTimerMs\x18\x05 \x01(\x04H\x01R\x11expirationTimerMs\x88\x01\x01\x12%\n" + - "\vmuteUntilMs\x18\x06 \x01(\x04H\x02R\vmuteUntilMs\x88\x01\x01\x12\"\n" + - "\fmarkedUnread\x18\a \x01(\bR\fmarkedUnread\x12B\n" + - "\x1cdontNotifyForMentionsIfMuted\x18\b \x01(\bR\x1cdontNotifyForMentionsIfMuted\x12.\n" + - "\x05style\x18\t \x01(\v2\x18.signal.backup.ChatStyleR\x05style\x12.\n" + - "\x12expireTimerVersion\x18\n" + - " \x01(\rR\x12expireTimerVersion\x129\n" + - "\x15notifyForCallsIfMuted\x18\v \x01(\bH\x03R\x15notifyForCallsIfMuted\x88\x01\x01\x12?\n" + - "\x18notifyForMentionsIfMuted\x18\f \x01(\bH\x04R\x18notifyForMentionsIfMuted\x88\x01\x01\x12=\n" + - "\x17notifyForRepliesIfMuted\x18\r \x01(\bH\x05R\x17notifyForRepliesIfMuted\x88\x01\x01\x125\n" + - "\x13showUnreadReminders\x18\x0e \x01(\bH\x06R\x13showUnreadReminders\x88\x01\x01B\x0e\n" + - "\f_pinnedOrderB\x14\n" + - "\x12_expirationTimerMsB\x0e\n" + - "\f_muteUntilMsB\x18\n" + - "\x16_notifyForCallsIfMutedB\x1b\n" + - "\x19_notifyForMentionsIfMutedB\x1a\n" + - "\x18_notifyForRepliesIfMutedB\x16\n" + - "\x14_showUnreadReminders\"\x95\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" + - "\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" + - "\tAdHocCall\x12\x16\n" + - "\x06callId\x18\x01 \x01(\x04R\x06callId\x12 \n" + - "\vrecipientId\x18\x02 \x01(\x04R\vrecipientId\x124\n" + - "\x05state\x18\x03 \x01(\x0e2\x1e.signal.backup.AdHocCall.StateR\x05state\x12$\n" + - "\rcallTimestamp\x18\x04 \x01(\x04R\rcallTimestamp\"'\n" + - "\x05State\x12\x11\n" + - "\rUNKNOWN_STATE\x10\x00\x12\v\n" + - "\aGENERIC\x10\x01\"\xc5\x01\n" + - "\x14DistributionListItem\x12&\n" + - "\x0edistributionId\x18\x01 \x01(\fR\x0edistributionId\x12.\n" + - "\x11deletionTimestamp\x18\x02 \x01(\x04H\x00R\x11deletionTimestamp\x12M\n" + - "\x10distributionList\x18\x03 \x01(\v2\x1f.signal.backup.DistributionListH\x00R\x10distributionListB\x06\n" + - "\x04item\"\x8d\x02\n" + - "\x10DistributionList\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\"\n" + - "\fallowReplies\x18\x02 \x01(\bR\fallowReplies\x12M\n" + - "\vprivacyMode\x18\x03 \x01(\x0e2+.signal.backup.DistributionList.PrivacyModeR\vprivacyMode\x12.\n" + - "\x12memberRecipientIds\x18\x04 \x03(\x04R\x12memberRecipientIds\"B\n" + - "\vPrivacyMode\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\r\n" + - "\tONLY_WITH\x10\x01\x12\x0e\n" + - "\n" + - "ALL_EXCEPT\x10\x02\x12\a\n" + - "\x03ALL\x10\x03\"\xbd\x0f\n" + - "\bChatItem\x12\x16\n" + - "\x06chatId\x18\x01 \x01(\x04R\x06chatId\x12\x1a\n" + - "\bauthorId\x18\x02 \x01(\x04R\bauthorId\x12\x1a\n" + - "\bdateSent\x18\x03 \x01(\x04R\bdateSent\x12-\n" + - "\x0fexpireStartDate\x18\x04 \x01(\x04H\x02R\x0fexpireStartDate\x88\x01\x01\x12%\n" + - "\vexpiresInMs\x18\x05 \x01(\x04H\x03R\vexpiresInMs\x88\x01\x01\x125\n" + - "\trevisions\x18\x06 \x03(\v2\x17.signal.backup.ChatItemR\trevisions\x12\x10\n" + - "\x03sms\x18\a \x01(\bR\x03sms\x12L\n" + - "\bincoming\x18\b \x01(\v2..signal.backup.ChatItem.IncomingMessageDetailsH\x00R\bincoming\x12L\n" + - "\boutgoing\x18\t \x01(\v2..signal.backup.ChatItem.OutgoingMessageDetailsH\x00R\boutgoing\x12[\n" + - "\rdirectionless\x18\n" + - " \x01(\v23.signal.backup.ChatItem.DirectionlessMessageDetailsH\x00R\rdirectionless\x12J\n" + - "\x0fstandardMessage\x18\v \x01(\v2\x1e.signal.backup.StandardMessageH\x01R\x0fstandardMessage\x12G\n" + - "\x0econtactMessage\x18\f \x01(\v2\x1d.signal.backup.ContactMessageH\x01R\x0econtactMessage\x12G\n" + - "\x0estickerMessage\x18\r \x01(\v2\x1d.signal.backup.StickerMessageH\x01R\x0estickerMessage\x12Y\n" + - "\x14remoteDeletedMessage\x18\x0e \x01(\v2#.signal.backup.RemoteDeletedMessageH\x01R\x14remoteDeletedMessage\x12H\n" + - "\rupdateMessage\x18\x0f \x01(\v2 .signal.backup.ChatUpdateMessageH\x01R\rupdateMessage\x12V\n" + - "\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" + - "\x16IncomingMessageDetails\x12\"\n" + - "\fdateReceived\x18\x01 \x01(\x04R\fdateReceived\x12+\n" + - "\x0edateServerSent\x18\x02 \x01(\x04H\x00R\x0edateServerSent\x88\x01\x01\x12\x12\n" + - "\x04read\x18\x03 \x01(\bR\x04read\x12\"\n" + - "\fsealedSender\x18\x04 \x01(\bR\fsealedSenderB\x11\n" + - "\x0f_dateServerSent\x1aw\n" + - "\x16OutgoingMessageDetails\x129\n" + - "\n" + - "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" + - "\x12directionalDetailsB\x06\n" + - "\x04itemB\x12\n" + - "\x10_expireStartDateB\x0e\n" + - "\f_expiresInMs\"\xeb\x06\n" + - "\n" + - "SendStatus\x12 \n" + - "\vrecipientId\x18\x01 \x01(\x04R\vrecipientId\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x12=\n" + - "\apending\x18\x03 \x01(\v2!.signal.backup.SendStatus.PendingH\x00R\apending\x124\n" + - "\x04sent\x18\x04 \x01(\v2\x1e.signal.backup.SendStatus.SentH\x00R\x04sent\x12C\n" + - "\tdelivered\x18\x05 \x01(\v2#.signal.backup.SendStatus.DeliveredH\x00R\tdelivered\x124\n" + - "\x04read\x18\x06 \x01(\v2\x1e.signal.backup.SendStatus.ReadH\x00R\x04read\x12:\n" + - "\x06viewed\x18\a \x01(\v2 .signal.backup.SendStatus.ViewedH\x00R\x06viewed\x12=\n" + - "\askipped\x18\b \x01(\v2!.signal.backup.SendStatus.SkippedH\x00R\askipped\x12:\n" + - "\x06failed\x18\t \x01(\v2 .signal.backup.SendStatus.FailedH\x00R\x06failed\x1a\t\n" + - "\aPending\x1a*\n" + - "\x04Sent\x12\"\n" + - "\fsealedSender\x18\x01 \x01(\bR\fsealedSender\x1a/\n" + - "\tDelivered\x12\"\n" + - "\fsealedSender\x18\x01 \x01(\bR\fsealedSender\x1a*\n" + - "\x04Read\x12\"\n" + - "\fsealedSender\x18\x01 \x01(\bR\fsealedSender\x1a,\n" + - "\x06Viewed\x12\"\n" + - "\fsealedSender\x18\x01 \x01(\bR\fsealedSender\x1a\t\n" + - "\aSkipped\x1a\x96\x01\n" + - "\x06Failed\x12F\n" + - "\x06reason\x18\x01 \x01(\x0e2..signal.backup.SendStatus.Failed.FailureReasonR\x06reason\"D\n" + - "\rFailureReason\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\v\n" + - "\aNETWORK\x10\x01\x12\x19\n" + - "\x15IDENTITY_KEY_MISMATCH\x10\x02B\x10\n" + - "\x0edeliveryStatus\"T\n" + - "\x04Text\x12\x12\n" + - "\x04body\x18\x01 \x01(\tR\x04body\x128\n" + - "\n" + - "bodyRanges\x18\x02 \x03(\v2\x18.signal.backup.BodyRangeR\n" + - "bodyRanges\"\x86\x03\n" + - "\x0fStandardMessage\x12/\n" + - "\x05quote\x18\x01 \x01(\v2\x14.signal.backup.QuoteH\x00R\x05quote\x88\x01\x01\x12,\n" + - "\x04text\x18\x02 \x01(\v2\x13.signal.backup.TextH\x01R\x04text\x88\x01\x01\x12B\n" + - "\vattachments\x18\x03 \x03(\v2 .signal.backup.MessageAttachmentR\vattachments\x12<\n" + - "\vlinkPreview\x18\x04 \x03(\v2\x1a.signal.backup.LinkPreviewR\vlinkPreview\x12;\n" + - "\blongText\x18\x05 \x01(\v2\x1a.signal.backup.FilePointerH\x02R\blongText\x88\x01\x01\x125\n" + - "\treactions\x18\x06 \x03(\v2\x17.signal.backup.ReactionR\treactionsB\b\n" + - "\x06_quoteB\a\n" + - "\x05_textB\v\n" + - "\t_longText\"\x83\x01\n" + - "\x0eContactMessage\x12:\n" + - "\acontact\x18\x01 \x01(\v2 .signal.backup.ContactAttachmentR\acontact\x125\n" + - "\treactions\x18\x02 \x03(\v2\x17.signal.backup.ReactionR\treactions\"\xb7\x02\n" + - "\x17DirectStoryReplyMessage\x12P\n" + - "\ttextReply\x18\x01 \x01(\v20.signal.backup.DirectStoryReplyMessage.TextReplyH\x00R\ttextReply\x12\x16\n" + - "\x05emoji\x18\x02 \x01(\tH\x00R\x05emoji\x125\n" + - "\treactions\x18\x03 \x03(\v2\x17.signal.backup.ReactionR\treactions\x1al\n" + - "\tTextReply\x12'\n" + - "\x04text\x18\x01 \x01(\v2\x13.signal.backup.TextR\x04text\x126\n" + - "\blongText\x18\x02 \x01(\v2\x1a.signal.backup.FilePointerR\blongTextB\a\n" + - "\x05replyJ\x04\b\x04\x10\x05\"\xdb\n" + - "\n" + - "\x13PaymentNotification\x12!\n" + - "\tamountMob\x18\x01 \x01(\tH\x00R\tamountMob\x88\x01\x01\x12\x1b\n" + - "\x06feeMob\x18\x02 \x01(\tH\x01R\x06feeMob\x88\x01\x01\x12\x17\n" + - "\x04note\x18\x03 \x01(\tH\x02R\x04note\x88\x01\x01\x12e\n" + - "\x12transactionDetails\x18\x04 \x01(\v25.signal.backup.PaymentNotification.TransactionDetailsR\x12transactionDetails\x1a\xe1\b\n" + - "\x12TransactionDetails\x12e\n" + - "\vtransaction\x18\x01 \x01(\v2A.signal.backup.PaymentNotification.TransactionDetails.TransactionH\x00R\vtransaction\x12w\n" + - "\x11failedTransaction\x18\x02 \x01(\v2G.signal.backup.PaymentNotification.TransactionDetails.FailedTransactionH\x00R\x11failedTransaction\x1aY\n" + - "\x1bMobileCoinTxoIdentification\x12\x1c\n" + - "\tpublicKey\x18\x01 \x03(\fR\tpublicKey\x12\x1c\n" + - "\tkeyImages\x18\x02 \x03(\fR\tkeyImages\x1a\xc5\x01\n" + - "\x11FailedTransaction\x12m\n" + - "\x06reason\x18\x01 \x01(\x0e2U.signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.FailureReasonR\x06reason\"A\n" + - "\rFailureReason\x12\v\n" + - "\aGENERIC\x10\x00\x12\v\n" + - "\aNETWORK\x10\x01\x12\x16\n" + - "\x12INSUFFICIENT_FUNDS\x10\x02\x1a\xbc\x04\n" + - "\vTransaction\x12`\n" + - "\x06status\x18\x01 \x01(\x0e2H.signal.backup.PaymentNotification.TransactionDetails.Transaction.StatusR\x06status\x12\x8d\x01\n" + - "\x18mobileCoinIdentification\x18\x02 \x01(\v2Q.signal.backup.PaymentNotification.TransactionDetails.MobileCoinTxoIdentificationR\x18mobileCoinIdentification\x12!\n" + - "\ttimestamp\x18\x03 \x01(\x04H\x00R\ttimestamp\x88\x01\x01\x12#\n" + - "\n" + - "blockIndex\x18\x04 \x01(\x04H\x01R\n" + - "blockIndex\x88\x01\x01\x12+\n" + - "\x0eblockTimestamp\x18\x05 \x01(\x04H\x02R\x0eblockTimestamp\x88\x01\x01\x12%\n" + - "\vtransaction\x18\x06 \x01(\fH\x03R\vtransaction\x88\x01\x01\x12\x1d\n" + - "\areceipt\x18\a \x01(\fH\x04R\areceipt\x88\x01\x01\"4\n" + - "\x06Status\x12\v\n" + - "\aINITIAL\x10\x00\x12\r\n" + - "\tSUBMITTED\x10\x01\x12\x0e\n" + - "\n" + - "SUCCESSFUL\x10\x02B\f\n" + - "\n" + - "_timestampB\r\n" + - "\v_blockIndexB\x11\n" + - "\x0f_blockTimestampB\x0e\n" + - "\f_transactionB\n" + - "\n" + - "\b_receiptB\t\n" + - "\apaymentB\f\n" + - "\n" + - "_amountMobB\t\n" + - "\a_feeMobB\a\n" + - "\x05_note\"\xc4\x01\n" + - "\tGiftBadge\x12D\n" + - "\x1dreceiptCredentialPresentation\x18\x01 \x01(\fR\x1dreceiptCredentialPresentation\x124\n" + - "\x05state\x18\x02 \x01(\x0e2\x1e.signal.backup.GiftBadge.StateR\x05state\";\n" + - "\x05State\x12\f\n" + - "\bUNOPENED\x10\x00\x12\n" + - "\n" + - "\x06OPENED\x10\x01\x12\f\n" + - "\bREDEEMED\x10\x02\x12\n" + - "\n" + - "\x06FAILED\x10\x03\"\x8a\x01\n" + - "\x0fViewOnceMessage\x12@\n" + - "\n" + - "attachment\x18\x01 \x01(\v2 .signal.backup.MessageAttachmentR\n" + - "attachment\x125\n" + - "\treactions\x18\x02 \x03(\v2\x17.signal.backup.ReactionR\treactions\"\x89\n" + - "\n" + - "\x11ContactAttachment\x12>\n" + - "\x04name\x18\x01 \x01(\v2%.signal.backup.ContactAttachment.NameH\x00R\x04name\x88\x01\x01\x12>\n" + - "\x06number\x18\x03 \x03(\v2&.signal.backup.ContactAttachment.PhoneR\x06number\x12<\n" + - "\x05email\x18\x04 \x03(\v2&.signal.backup.ContactAttachment.EmailR\x05email\x12H\n" + - "\aaddress\x18\x05 \x03(\v2..signal.backup.ContactAttachment.PostalAddressR\aaddress\x127\n" + - "\x06avatar\x18\x06 \x01(\v2\x1a.signal.backup.FilePointerH\x01R\x06avatar\x88\x01\x01\x12\"\n" + - "\forganization\x18\a \x01(\tR\forganization\x1a\xb0\x01\n" + - "\x04Name\x12\x1c\n" + - "\tgivenName\x18\x01 \x01(\tR\tgivenName\x12\x1e\n" + - "\n" + - "familyName\x18\x02 \x01(\tR\n" + - "familyName\x12\x16\n" + - "\x06prefix\x18\x03 \x01(\tR\x06prefix\x12\x16\n" + - "\x06suffix\x18\x04 \x01(\tR\x06suffix\x12\x1e\n" + - "\n" + - "middleName\x18\x05 \x01(\tR\n" + - "middleName\x12\x1a\n" + - "\bnickname\x18\x06 \x01(\tR\bnickname\x1a\xb5\x01\n" + - "\x05Phone\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12?\n" + - "\x04type\x18\x02 \x01(\x0e2+.signal.backup.ContactAttachment.Phone.TypeR\x04type\x12\x14\n" + - "\x05label\x18\x03 \x01(\tR\x05label\"?\n" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\b\n" + - "\x04HOME\x10\x01\x12\n" + - "\n" + - "\x06MOBILE\x10\x02\x12\b\n" + - "\x04WORK\x10\x03\x12\n" + - "\n" + - "\x06CUSTOM\x10\x04\x1a\xb5\x01\n" + - "\x05Email\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12?\n" + - "\x04type\x18\x02 \x01(\x0e2+.signal.backup.ContactAttachment.Email.TypeR\x04type\x12\x14\n" + - "\x05label\x18\x03 \x01(\tR\x05label\"?\n" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\b\n" + - "\x04HOME\x10\x01\x12\n" + - "\n" + - "\x06MOBILE\x10\x02\x12\b\n" + - "\x04WORK\x10\x03\x12\n" + - "\n" + - "\x06CUSTOM\x10\x04\x1a\xd7\x02\n" + - "\rPostalAddress\x12G\n" + - "\x04type\x18\x01 \x01(\x0e23.signal.backup.ContactAttachment.PostalAddress.TypeR\x04type\x12\x14\n" + - "\x05label\x18\x02 \x01(\tR\x05label\x12\x16\n" + - "\x06street\x18\x03 \x01(\tR\x06street\x12\x14\n" + - "\x05pobox\x18\x04 \x01(\tR\x05pobox\x12\"\n" + - "\fneighborhood\x18\x05 \x01(\tR\fneighborhood\x12\x12\n" + - "\x04city\x18\x06 \x01(\tR\x04city\x12\x16\n" + - "\x06region\x18\a \x01(\tR\x06region\x12\x1a\n" + - "\bpostcode\x18\b \x01(\tR\bpostcode\x12\x18\n" + - "\acountry\x18\t \x01(\tR\acountry\"3\n" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\b\n" + - "\x04HOME\x10\x01\x12\b\n" + - "\x04WORK\x10\x02\x12\n" + - "\n" + - "\x06CUSTOM\x10\x03B\a\n" + - "\x05_nameB\t\n" + - "\a_avatar\"y\n" + - "\x0eStickerMessage\x120\n" + - "\asticker\x18\x01 \x01(\v2\x16.signal.backup.StickerR\asticker\x125\n" + - "\treactions\x18\x02 \x03(\v2\x17.signal.backup.ReactionR\treactions\"\x16\n" + - "\x14RemoteDeletedMessage\"\xae\x01\n" + - "\aSticker\x12\x16\n" + - "\x06packId\x18\x01 \x01(\fR\x06packId\x12\x18\n" + - "\apackKey\x18\x02 \x01(\fR\apackKey\x12\x1c\n" + - "\tstickerId\x18\x03 \x01(\rR\tstickerId\x12\x19\n" + - "\x05emoji\x18\x04 \x01(\tH\x00R\x05emoji\x88\x01\x01\x12.\n" + - "\x04data\x18\x05 \x01(\v2\x1a.signal.backup.FilePointerR\x04dataB\b\n" + - "\x06_emoji\"\xde\x01\n" + - "\vLinkPreview\x12\x10\n" + - "\x03url\x18\x01 \x01(\tR\x03url\x12\x19\n" + - "\x05title\x18\x02 \x01(\tH\x00R\x05title\x88\x01\x01\x125\n" + - "\x05image\x18\x03 \x01(\v2\x1a.signal.backup.FilePointerH\x01R\x05image\x88\x01\x01\x12%\n" + - "\vdescription\x18\x04 \x01(\tH\x02R\vdescription\x88\x01\x01\x12\x17\n" + - "\x04date\x18\x05 \x01(\x04H\x03R\x04date\x88\x01\x01B\b\n" + - "\x06_titleB\b\n" + - "\x06_imageB\x0e\n" + - "\f_descriptionB\a\n" + - "\x05_date\"\x9c\x02\n" + - "\x11MessageAttachment\x124\n" + - "\apointer\x18\x01 \x01(\v2\x1a.signal.backup.FilePointerR\apointer\x129\n" + - "\x04flag\x18\x02 \x01(\x0e2%.signal.backup.MessageAttachment.FlagR\x04flag\x12$\n" + - "\rwasDownloaded\x18\x03 \x01(\bR\rwasDownloaded\x12#\n" + - "\n" + - "clientUuid\x18\x04 \x01(\fH\x00R\n" + - "clientUuid\x88\x01\x01\"<\n" + - "\x04Flag\x12\b\n" + - "\x04NONE\x10\x00\x12\x11\n" + - "\rVOICE_MESSAGE\x10\x01\x12\x0e\n" + - "\n" + - "BORDERLESS\x10\x02\x12\a\n" + - "\x03GIF\x10\x03B\r\n" + - "\v_clientUuid\"\x9e\b\n" + - "\vFilePointer\x12%\n" + - "\vcontentType\x18\x04 \x01(\tH\x00R\vcontentType\x88\x01\x01\x12+\n" + - "\x0eincrementalMac\x18\x05 \x01(\fH\x01R\x0eincrementalMac\x88\x01\x01\x12=\n" + - "\x17incrementalMacChunkSize\x18\x06 \x01(\rH\x02R\x17incrementalMacChunkSize\x88\x01\x01\x12\x1f\n" + - "\bfileName\x18\a \x01(\tH\x03R\bfileName\x88\x01\x01\x12\x19\n" + - "\x05width\x18\b \x01(\rH\x04R\x05width\x88\x01\x01\x12\x1b\n" + - "\x06height\x18\t \x01(\rH\x05R\x06height\x88\x01\x01\x12\x1d\n" + - "\acaption\x18\n" + - " \x01(\tH\x06R\acaption\x88\x01\x01\x12\x1f\n" + - "\bblurHash\x18\v \x01(\tH\aR\bblurHash\x88\x01\x01\x12H\n" + - "\vlocatorInfo\x18\r \x01(\v2&.signal.backup.FilePointer.LocatorInfoR\vlocatorInfo\x1a\x86\x04\n" + - "\vLocatorInfo\x12\x10\n" + - "\x03key\x18\x01 \x01(\fR\x03key\x12&\n" + - "\rplaintextHash\x18\n" + - " \x01(\fH\x00R\rplaintextHash\x12*\n" + - "\x0fencryptedDigest\x18\v \x01(\fH\x00R\x0fencryptedDigest\x12\x12\n" + - "\x04size\x18\x03 \x01(\rR\x04size\x12)\n" + - "\rtransitCdnKey\x18\x04 \x01(\tH\x01R\rtransitCdnKey\x88\x01\x01\x12/\n" + - "\x10transitCdnNumber\x18\x05 \x01(\rH\x02R\x10transitCdnNumber\x88\x01\x01\x12C\n" + - "\x1atransitTierUploadTimestamp\x18\x06 \x01(\x04H\x03R\x1atransitTierUploadTimestamp\x88\x01\x01\x123\n" + - "\x12mediaTierCdnNumber\x18\a \x01(\rH\x04R\x12mediaTierCdnNumber\x88\x01\x01\x12\x1f\n" + - "\blocalKey\x18\t \x01(\fH\x05R\blocalKey\x88\x01\x01B\x10\n" + - "\x0eintegrityCheckB\x10\n" + - "\x0e_transitCdnKeyB\x13\n" + - "\x11_transitCdnNumberB\x1d\n" + - "\x1b_transitTierUploadTimestampB\x15\n" + - "\x13_mediaTierCdnNumberB\v\n" + - "\t_localKeyJ\x04\b\x02\x10\x03J\x04\b\b\x10\tB\x0e\n" + - "\f_contentTypeB\x11\n" + - "\x0f_incrementalMacB\x1a\n" + - "\x18_incrementalMacChunkSizeB\v\n" + - "\t_fileNameB\b\n" + - "\x06_widthB\t\n" + - "\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" + - "\x05Quote\x125\n" + - "\x13targetSentTimestamp\x18\x01 \x01(\x04H\x00R\x13targetSentTimestamp\x88\x01\x01\x12\x1a\n" + - "\bauthorId\x18\x02 \x01(\x04R\bauthorId\x12,\n" + - "\x04text\x18\x03 \x01(\v2\x13.signal.backup.TextH\x01R\x04text\x88\x01\x01\x12G\n" + - "\vattachments\x18\x04 \x03(\v2%.signal.backup.Quote.QuotedAttachmentR\vattachments\x12-\n" + - "\x04type\x18\x05 \x01(\x0e2\x19.signal.backup.Quote.TypeR\x04type\x1a\xca\x01\n" + - "\x10QuotedAttachment\x12%\n" + - "\vcontentType\x18\x01 \x01(\tH\x00R\vcontentType\x88\x01\x01\x12\x1f\n" + - "\bfileName\x18\x02 \x01(\tH\x01R\bfileName\x88\x01\x01\x12C\n" + - "\tthumbnail\x18\x03 \x01(\v2 .signal.backup.MessageAttachmentH\x02R\tthumbnail\x88\x01\x01B\x0e\n" + - "\f_contentTypeB\v\n" + - "\t_fileNameB\f\n" + - "\n" + - "_thumbnail\"H\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" + - "\x14_targetSentTimestampB\a\n" + - "\x05_text\"\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(\fH\x00R\n" + - "mentionAci\x126\n" + - "\x05style\x18\x04 \x01(\x0e2\x1e.signal.backup.BodyRange.StyleH\x00R\x05style\"V\n" + - "\x05Style\x12\b\n" + - "\x04NONE\x10\x00\x12\b\n" + - "\x04BOLD\x10\x01\x12\n" + - "\n" + - "\x06ITALIC\x10\x02\x12\v\n" + - "\aSPOILER\x10\x03\x12\x11\n" + - "\rSTRIKETHROUGH\x10\x04\x12\r\n" + - "\tMONOSPACE\x10\x05B\x11\n" + - "\x0fassociatedValue\"\x80\x01\n" + - "\bReaction\x12\x14\n" + - "\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" + - "\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" + - "\x15expirationTimerChange\x18\x03 \x01(\v2(.signal.backup.ExpirationTimerChatUpdateH\x00R\x15expirationTimerChange\x12N\n" + - "\rprofileChange\x18\x04 \x01(\v2&.signal.backup.ProfileChangeChatUpdateH\x00R\rprofileChange\x12H\n" + - "\vthreadMerge\x18\x05 \x01(\v2$.signal.backup.ThreadMergeChatUpdateH\x00R\vthreadMerge\x12Z\n" + - "\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" + - "\x06update\"\x9d\x04\n" + - "\x0eIndividualCall\x12\x1b\n" + - "\x06callId\x18\x01 \x01(\x04H\x00R\x06callId\x88\x01\x01\x126\n" + - "\x04type\x18\x02 \x01(\x0e2\".signal.backup.IndividualCall.TypeR\x04type\x12E\n" + - "\tdirection\x18\x03 \x01(\x0e2'.signal.backup.IndividualCall.DirectionR\tdirection\x129\n" + - "\x05state\x18\x04 \x01(\x0e2#.signal.backup.IndividualCall.StateR\x05state\x122\n" + - "\x14startedCallTimestamp\x18\x05 \x01(\x04R\x14startedCallTimestamp\x12\x12\n" + - "\x04read\x18\x06 \x01(\bR\x04read\"8\n" + - "\x04Type\x12\x10\n" + - "\fUNKNOWN_TYPE\x10\x00\x12\x0e\n" + - "\n" + - "AUDIO_CALL\x10\x01\x12\x0e\n" + - "\n" + - "VIDEO_CALL\x10\x02\">\n" + - "\tDirection\x12\x15\n" + - "\x11UNKNOWN_DIRECTION\x10\x00\x12\f\n" + - "\bINCOMING\x10\x01\x12\f\n" + - "\bOUTGOING\x10\x02\"g\n" + - "\x05State\x12\x11\n" + - "\rUNKNOWN_STATE\x10\x00\x12\f\n" + - "\bACCEPTED\x10\x01\x12\x10\n" + - "\fNOT_ACCEPTED\x10\x02\x12\n" + - "\n" + - "\x06MISSED\x10\x03\x12\x1f\n" + - "\x1bMISSED_NOTIFICATION_PROFILE\x10\x04B\t\n" + - "\a_callId\"\xbd\x04\n" + - "\tGroupCall\x12\x1b\n" + - "\x06callId\x18\x01 \x01(\x04H\x00R\x06callId\x88\x01\x01\x124\n" + - "\x05state\x18\x02 \x01(\x0e2\x1e.signal.backup.GroupCall.StateR\x05state\x121\n" + - "\x11ringerRecipientId\x18\x03 \x01(\x04H\x01R\x11ringerRecipientId\x88\x01\x01\x12;\n" + - "\x16startedCallRecipientId\x18\x04 \x01(\x04H\x02R\x16startedCallRecipientId\x88\x01\x01\x122\n" + - "\x14startedCallTimestamp\x18\x05 \x01(\x04R\x14startedCallTimestamp\x123\n" + - "\x12endedCallTimestamp\x18\x06 \x01(\x04H\x03R\x12endedCallTimestamp\x88\x01\x01\x12\x12\n" + - "\x04read\x18\a \x01(\bR\x04read\"\x9c\x01\n" + - "\x05State\x12\x11\n" + - "\rUNKNOWN_STATE\x10\x00\x12\v\n" + - "\aGENERIC\x10\x01\x12\n" + - "\n" + - "\x06JOINED\x10\x02\x12\v\n" + - "\aRINGING\x10\x03\x12\f\n" + - "\bACCEPTED\x10\x04\x12\f\n" + - "\bDECLINED\x10\x05\x12\n" + - "\n" + - "\x06MISSED\x10\x06\x12\x1f\n" + - "\x1bMISSED_NOTIFICATION_PROFILE\x10\a\x12\x11\n" + - "\rOUTGOING_RING\x10\bB\t\n" + - "\a_callIdB\x14\n" + - "\x12_ringerRecipientIdB\x19\n" + - "\x17_startedCallRecipientIdB\x15\n" + - "\x13_endedCallTimestamp\"\xd3\x03\n" + - "\x10SimpleChatUpdate\x128\n" + - "\x04type\x18\x01 \x01(\x0e2$.signal.backup.SimpleChatUpdate.TypeR\x04type\"\x84\x03\n" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\x11\n" + - "\rJOINED_SIGNAL\x10\x01\x12\x13\n" + - "\x0fIDENTITY_UPDATE\x10\x02\x12\x15\n" + - "\x11IDENTITY_VERIFIED\x10\x03\x12\x14\n" + - "\x10IDENTITY_DEFAULT\x10\x04\x12\x11\n" + - "\rCHANGE_NUMBER\x10\x05\x12$\n" + - " RELEASE_CHANNEL_DONATION_REQUEST\x10\x06\x12\x0f\n" + - "\vEND_SESSION\x10\a\x12\x18\n" + - "\x14CHAT_SESSION_REFRESH\x10\b\x12\x0f\n" + - "\vBAD_DECRYPT\x10\t\x12\x16\n" + - "\x12PAYMENTS_ACTIVATED\x10\n" + - "\x12\x1e\n" + - "\x1aPAYMENT_ACTIVATION_REQUEST\x10\v\x12 \n" + - "\x1cUNSUPPORTED_PROTOCOL_MESSAGE\x10\f\x12\x11\n" + - "\rREPORTED_SPAM\x10\r\x12\v\n" + - "\aBLOCKED\x10\x0e\x12\r\n" + - "\tUNBLOCKED\x10\x0f\x12\x1c\n" + - "\x18MESSAGE_REQUEST_ACCEPTED\x10\x10\"=\n" + - "\x19ExpirationTimerChatUpdate\x12 \n" + - "\vexpiresInMs\x18\x01 \x01(\x04R\vexpiresInMs\"W\n" + - "\x17ProfileChangeChatUpdate\x12\"\n" + - "\fpreviousName\x18\x01 \x01(\tR\fpreviousName\x12\x18\n" + - "\anewName\x18\x02 \x01(\tR\anewName\"^\n" + - "\x18LearnedProfileChatUpdate\x12\x14\n" + - "\x04e164\x18\x01 \x01(\x04H\x00R\x04e164\x12\x1c\n" + - "\busername\x18\x02 \x01(\tH\x00R\busernameB\x0e\n" + - "\fpreviousName\";\n" + - "\x15ThreadMergeChatUpdate\x12\"\n" + - "\fpreviousE164\x18\x01 \x01(\x04R\fpreviousE164\"1\n" + - "\x1bSessionSwitchoverChatUpdate\x12\x12\n" + - "\x04e164\x18\x01 \x01(\x04R\x04e164\"\x88!\n" + - "\x15GroupChangeChatUpdate\x12E\n" + - "\aupdates\x18\x01 \x03(\v2+.signal.backup.GroupChangeChatUpdate.UpdateR\aupdates\x1a\xa7 \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" + - "\x0fgroupNameUpdate\x18\x03 \x01(\v2\x1e.signal.backup.GroupNameUpdateH\x00R\x0fgroupNameUpdate\x12P\n" + - "\x11groupAvatarUpdate\x18\x04 \x01(\v2 .signal.backup.GroupAvatarUpdateH\x00R\x11groupAvatarUpdate\x12_\n" + - "\x16groupDescriptionUpdate\x18\x05 \x01(\v2%.signal.backup.GroupDescriptionUpdateH\x00R\x16groupDescriptionUpdate\x12\x8f\x01\n" + - "&groupMembershipAccessLevelChangeUpdate\x18\x06 \x01(\v25.signal.backup.GroupMembershipAccessLevelChangeUpdateH\x00R&groupMembershipAccessLevelChangeUpdate\x12\x8f\x01\n" + - "&groupAttributesAccessLevelChangeUpdate\x18\a \x01(\v25.signal.backup.GroupAttributesAccessLevelChangeUpdateH\x00R&groupAttributesAccessLevelChangeUpdate\x12\x80\x01\n" + - "!groupAnnouncementOnlyChangeUpdate\x18\b \x01(\v20.signal.backup.GroupAnnouncementOnlyChangeUpdateH\x00R!groupAnnouncementOnlyChangeUpdate\x12_\n" + - "\x16groupAdminStatusUpdate\x18\t \x01(\v2%.signal.backup.GroupAdminStatusUpdateH\x00R\x16groupAdminStatusUpdate\x12\\\n" + - "\x15groupMemberLeftUpdate\x18\n" + - " \x01(\v2$.signal.backup.GroupMemberLeftUpdateH\x00R\x15groupMemberLeftUpdate\x12e\n" + - "\x18groupMemberRemovedUpdate\x18\v \x01(\v2'.signal.backup.GroupMemberRemovedUpdateH\x00R\x18groupMemberRemovedUpdate\x12e\n" + - "\x18selfInvitedToGroupUpdate\x18\f \x01(\v2'.signal.backup.SelfInvitedToGroupUpdateH\x00R\x18selfInvitedToGroupUpdate\x12\x80\x01\n" + - "!selfInvitedOtherUserToGroupUpdate\x18\r \x01(\v20.signal.backup.SelfInvitedOtherUserToGroupUpdateH\x00R!selfInvitedOtherUserToGroupUpdate\x12h\n" + - "\x19groupUnknownInviteeUpdate\x18\x0e \x01(\v2(.signal.backup.GroupUnknownInviteeUpdateH\x00R\x19groupUnknownInviteeUpdate\x12t\n" + - "\x1dgroupInvitationAcceptedUpdate\x18\x0f \x01(\v2,.signal.backup.GroupInvitationAcceptedUpdateH\x00R\x1dgroupInvitationAcceptedUpdate\x12t\n" + - "\x1dgroupInvitationDeclinedUpdate\x18\x10 \x01(\v2,.signal.backup.GroupInvitationDeclinedUpdateH\x00R\x1dgroupInvitationDeclinedUpdate\x12b\n" + - "\x17groupMemberJoinedUpdate\x18\x11 \x01(\v2&.signal.backup.GroupMemberJoinedUpdateH\x00R\x17groupMemberJoinedUpdate\x12_\n" + - "\x16groupMemberAddedUpdate\x18\x12 \x01(\v2%.signal.backup.GroupMemberAddedUpdateH\x00R\x16groupMemberAddedUpdate\x12}\n" + - " groupSelfInvitationRevokedUpdate\x18\x13 \x01(\v2/.signal.backup.GroupSelfInvitationRevokedUpdateH\x00R groupSelfInvitationRevokedUpdate\x12q\n" + - "\x1cgroupInvitationRevokedUpdate\x18\x14 \x01(\v2+.signal.backup.GroupInvitationRevokedUpdateH\x00R\x1cgroupInvitationRevokedUpdate\x12_\n" + - "\x16groupJoinRequestUpdate\x18\x15 \x01(\v2%.signal.backup.GroupJoinRequestUpdateH\x00R\x16groupJoinRequestUpdate\x12w\n" + - "\x1egroupJoinRequestApprovalUpdate\x18\x16 \x01(\v2-.signal.backup.GroupJoinRequestApprovalUpdateH\x00R\x1egroupJoinRequestApprovalUpdate\x12w\n" + - "\x1egroupJoinRequestCanceledUpdate\x18\x17 \x01(\v2-.signal.backup.GroupJoinRequestCanceledUpdateH\x00R\x1egroupJoinRequestCanceledUpdate\x12k\n" + - "\x1agroupInviteLinkResetUpdate\x18\x18 \x01(\v2).signal.backup.GroupInviteLinkResetUpdateH\x00R\x1agroupInviteLinkResetUpdate\x12q\n" + - "\x1cgroupInviteLinkEnabledUpdate\x18\x19 \x01(\v2+.signal.backup.GroupInviteLinkEnabledUpdateH\x00R\x1cgroupInviteLinkEnabledUpdate\x12\x83\x01\n" + - "\"groupInviteLinkAdminApprovalUpdate\x18\x1a \x01(\v21.signal.backup.GroupInviteLinkAdminApprovalUpdateH\x00R\"groupInviteLinkAdminApprovalUpdate\x12t\n" + - "\x1dgroupInviteLinkDisabledUpdate\x18\x1b \x01(\v2,.signal.backup.GroupInviteLinkDisabledUpdateH\x00R\x1dgroupInviteLinkDisabledUpdate\x12t\n" + - "\x1dgroupMemberJoinedByLinkUpdate\x18\x1c \x01(\v2,.signal.backup.GroupMemberJoinedByLinkUpdateH\x00R\x1dgroupMemberJoinedByLinkUpdate\x12_\n" + - "\x16groupV2MigrationUpdate\x18\x1d \x01(\v2%.signal.backup.GroupV2MigrationUpdateH\x00R\x16groupV2MigrationUpdate\x12\x80\x01\n" + - "!groupV2MigrationSelfInvitedUpdate\x18\x1e \x01(\v20.signal.backup.GroupV2MigrationSelfInvitedUpdateH\x00R!groupV2MigrationSelfInvitedUpdate\x12\x89\x01\n" + - "$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" + - "\x06update\"H\n" + - "\x12GenericGroupUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01B\r\n" + - "\v_updaterAci\"I\n" + - "\x13GroupCreationUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01B\r\n" + - "\v_updaterAci\"\x7f\n" + - "\x0fGroupNameUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12'\n" + - "\fnewGroupName\x18\x02 \x01(\tH\x01R\fnewGroupName\x88\x01\x01B\r\n" + - "\v_updaterAciB\x0f\n" + - "\r_newGroupName\"g\n" + - "\x11GroupAvatarUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12\x1e\n" + - "\n" + - "wasRemoved\x18\x02 \x01(\bR\n" + - "wasRemovedB\r\n" + - "\v_updaterAci\"\x8c\x01\n" + - "\x16GroupDescriptionUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12+\n" + - "\x0enewDescription\x18\x02 \x01(\tH\x01R\x0enewDescription\x88\x01\x01B\r\n" + - "\v_updaterAciB\x11\n" + - "\x0f_newDescription\"\xa1\x01\n" + - "&GroupMembershipAccessLevelChangeUpdate\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\"\xa1\x01\n" + - "&GroupAttributesAccessLevelChangeUpdate\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\"\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" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12.\n" + - "\x12isAnnouncementOnly\x18\x02 \x01(\bR\x12isAnnouncementOnlyB\r\n" + - "\v_updaterAci\"\xa0\x01\n" + - "\x16GroupAdminStatusUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12\x1c\n" + - "\tmemberAci\x18\x02 \x01(\fR\tmemberAci\x124\n" + - "\x15wasAdminStatusGranted\x18\x03 \x01(\bR\x15wasAdminStatusGrantedB\r\n" + - "\v_updaterAci\")\n" + - "\x15GroupMemberLeftUpdate\x12\x10\n" + - "\x03aci\x18\x01 \x01(\fR\x03aci\"n\n" + - "\x18GroupMemberRemovedUpdate\x12#\n" + - "\n" + - "removerAci\x18\x01 \x01(\fH\x00R\n" + - "removerAci\x88\x01\x01\x12\x1e\n" + - "\n" + - "removedAci\x18\x02 \x01(\fR\n" + - "removedAciB\r\n" + - "\v_removerAci\"N\n" + - "\x18SelfInvitedToGroupUpdate\x12#\n" + - "\n" + - "inviterAci\x18\x01 \x01(\fH\x00R\n" + - "inviterAci\x88\x01\x01B\r\n" + - "\v_inviterAci\"O\n" + - "!SelfInvitedOtherUserToGroupUpdate\x12*\n" + - "\x10inviteeServiceId\x18\x01 \x01(\fR\x10inviteeServiceId\"s\n" + - "\x19GroupUnknownInviteeUpdate\x12#\n" + - "\n" + - "inviterAci\x18\x01 \x01(\fH\x00R\n" + - "inviterAci\x88\x01\x01\x12\"\n" + - "\finviteeCount\x18\x02 \x01(\rR\finviteeCountB\r\n" + - "\v_inviterAci\"w\n" + - "\x1dGroupInvitationAcceptedUpdate\x12#\n" + - "\n" + - "inviterAci\x18\x01 \x01(\fH\x00R\n" + - "inviterAci\x88\x01\x01\x12\"\n" + - "\fnewMemberAci\x18\x02 \x01(\fR\fnewMemberAciB\r\n" + - "\v_inviterAci\"\x87\x01\n" + - "\x1dGroupInvitationDeclinedUpdate\x12#\n" + - "\n" + - "inviterAci\x18\x01 \x01(\fH\x00R\n" + - "inviterAci\x88\x01\x01\x12#\n" + - "\n" + - "inviteeAci\x18\x02 \x01(\fH\x01R\n" + - "inviteeAci\x88\x01\x01B\r\n" + - "\v_inviterAciB\r\n" + - "\v_inviteeAci\"=\n" + - "\x17GroupMemberJoinedUpdate\x12\"\n" + - "\fnewMemberAci\x18\x01 \x01(\fR\fnewMemberAci\"\xd2\x01\n" + - "\x16GroupMemberAddedUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12\"\n" + - "\fnewMemberAci\x18\x02 \x01(\fR\fnewMemberAci\x12,\n" + - "\x11hadOpenInvitation\x18\x03 \x01(\bR\x11hadOpenInvitation\x12#\n" + - "\n" + - "inviterAci\x18\x04 \x01(\fH\x01R\n" + - "inviterAci\x88\x01\x01B\r\n" + - "\v_updaterAciB\r\n" + - "\v_inviterAci\"V\n" + - " GroupSelfInvitationRevokedUpdate\x12#\n" + - "\n" + - "revokerAci\x18\x01 \x01(\fH\x00R\n" + - "revokerAci\x88\x01\x01B\r\n" + - "\v_revokerAci\"\xcb\x02\n" + - "\x1cGroupInvitationRevokedUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12O\n" + - "\binvitees\x18\x02 \x03(\v23.signal.backup.GroupInvitationRevokedUpdate.InviteeR\binvitees\x1a\xa5\x01\n" + - "\aInvitee\x12#\n" + - "\n" + - "inviterAci\x18\x01 \x01(\fH\x00R\n" + - "inviterAci\x88\x01\x01\x12#\n" + - "\n" + - "inviteeAci\x18\x02 \x01(\fH\x01R\n" + - "inviteeAci\x88\x01\x01\x12#\n" + - "\n" + - "inviteePni\x18\x03 \x01(\fH\x02R\n" + - "inviteePni\x88\x01\x01B\r\n" + - "\v_inviterAciB\r\n" + - "\v_inviteeAciB\r\n" + - "\v_inviteePniB\r\n" + - "\v_updaterAci\"<\n" + - "\x16GroupJoinRequestUpdate\x12\"\n" + - "\frequestorAci\x18\x01 \x01(\fR\frequestorAci\"\x9a\x01\n" + - "\x1eGroupJoinRequestApprovalUpdate\x12\"\n" + - "\frequestorAci\x18\x01 \x01(\fR\frequestorAci\x12#\n" + - "\n" + - "updaterAci\x18\x02 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12 \n" + - "\vwasApproved\x18\x03 \x01(\bR\vwasApprovedB\r\n" + - "\v_updaterAci\"D\n" + - "\x1eGroupJoinRequestCanceledUpdate\x12\"\n" + - "\frequestorAci\x18\x01 \x01(\fR\frequestorAci\"c\n" + - "'GroupSequenceOfRequestsAndCancelsUpdate\x12\"\n" + - "\frequestorAci\x18\x01 \x01(\fR\frequestorAci\x12\x14\n" + - "\x05count\x18\x02 \x01(\rR\x05count\"P\n" + - "\x1aGroupInviteLinkResetUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01B\r\n" + - "\v_updaterAci\"\x90\x01\n" + - "\x1cGroupInviteLinkEnabledUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12<\n" + - "\x19linkRequiresAdminApproval\x18\x02 \x01(\bR\x19linkRequiresAdminApprovalB\r\n" + - "\v_updaterAci\"\x96\x01\n" + - "\"GroupInviteLinkAdminApprovalUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01\x12<\n" + - "\x19linkRequiresAdminApproval\x18\x02 \x01(\bR\x19linkRequiresAdminApprovalB\r\n" + - "\v_updaterAci\"S\n" + - "\x1dGroupInviteLinkDisabledUpdate\x12#\n" + - "\n" + - "updaterAci\x18\x01 \x01(\fH\x00R\n" + - "updaterAci\x88\x01\x01B\r\n" + - "\v_updaterAci\"C\n" + - "\x1dGroupMemberJoinedByLinkUpdate\x12\"\n" + - "\fnewMemberAci\x18\x01 \x01(\fR\fnewMemberAci\"\x18\n" + - "\x16GroupV2MigrationUpdate\"#\n" + - "!GroupV2MigrationSelfInvitedUpdate\"X\n" + - "$GroupV2MigrationInvitedMembersUpdate\x120\n" + - "\x13invitedMembersCount\x18\x01 \x01(\rR\x13invitedMembersCount\"X\n" + - "$GroupV2MigrationDroppedMembersUpdate\x120\n" + - "\x13droppedMembersCount\x18\x01 \x01(\rR\x13droppedMembersCount\"r\n" + - "\x1aGroupExpirationTimerUpdate\x12 \n" + - "\vexpiresInMs\x18\x01 \x01(\x04R\vexpiresInMs\x12#\n" + - "\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" + - "\vStickerPack\x12\x16\n" + - "\x06packId\x18\x01 \x01(\fR\x06packId\x12\x18\n" + - "\apackKey\x18\x02 \x01(\fR\apackKey\"\x80\r\n" + - "\tChatStyle\x12T\n" + - "\x0fwallpaperPreset\x18\x01 \x01(\x0e2(.signal.backup.ChatStyle.WallpaperPresetH\x00R\x0fwallpaperPreset\x12D\n" + - "\x0ewallpaperPhoto\x18\x02 \x01(\v2\x1a.signal.backup.FilePointerH\x00R\x0ewallpaperPhoto\x12Y\n" + - "\x0fautoBubbleColor\x18\x03 \x01(\v2-.signal.backup.ChatStyle.AutomaticBubbleColorH\x01R\x0fautoBubbleColor\x12Z\n" + - "\x11bubbleColorPreset\x18\x04 \x01(\x0e2*.signal.backup.ChatStyle.BubbleColorPresetH\x01R\x11bubbleColorPreset\x12&\n" + - "\rcustomColorId\x18\x05 \x01(\x04H\x01R\rcustomColorId\x126\n" + - "\x16dimWallpaperInDarkMode\x18\a \x01(\bR\x16dimWallpaperInDarkMode\x1aV\n" + - "\bGradient\x12\x14\n" + - "\x05angle\x18\x01 \x01(\rR\x05angle\x12\x16\n" + - "\x06colors\x18\x02 \x03(\aR\x06colors\x12\x1c\n" + - "\tpositions\x18\x03 \x03(\x02R\tpositions\x1a\x83\x01\n" + - "\x0fCustomChatColor\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x12\x16\n" + - "\x05solid\x18\x02 \x01(\aH\x00R\x05solid\x12?\n" + - "\bgradient\x18\x03 \x01(\v2!.signal.backup.ChatStyle.GradientH\x00R\bgradientB\a\n" + - "\x05color\x1a\x16\n" + - "\x14AutomaticBubbleColor\"\xc1\x03\n" + - "\x0fWallpaperPreset\x12\x1c\n" + - "\x18UNKNOWN_WALLPAPER_PRESET\x10\x00\x12\x0f\n" + - "\vSOLID_BLUSH\x10\x01\x12\x10\n" + - "\fSOLID_COPPER\x10\x02\x12\x0e\n" + - "\n" + - "SOLID_DUST\x10\x03\x12\x11\n" + - "\rSOLID_CELADON\x10\x04\x12\x14\n" + - "\x10SOLID_RAINFOREST\x10\x05\x12\x11\n" + - "\rSOLID_PACIFIC\x10\x06\x12\x0f\n" + - "\vSOLID_FROST\x10\a\x12\x0e\n" + - "\n" + - "SOLID_NAVY\x10\b\x12\x0f\n" + - "\vSOLID_LILAC\x10\t\x12\x0e\n" + - "\n" + - "SOLID_PINK\x10\n" + - "\x12\x12\n" + - "\x0eSOLID_EGGPLANT\x10\v\x12\x10\n" + - "\fSOLID_SILVER\x10\f\x12\x13\n" + - "\x0fGRADIENT_SUNSET\x10\r\x12\x11\n" + - "\rGRADIENT_NOIR\x10\x0e\x12\x14\n" + - "\x10GRADIENT_HEATMAP\x10\x0f\x12\x11\n" + - "\rGRADIENT_AQUA\x10\x10\x12\x17\n" + - "\x13GRADIENT_IRIDESCENT\x10\x11\x12\x15\n" + - "\x11GRADIENT_MONSTERA\x10\x12\x12\x12\n" + - "\x0eGRADIENT_BLISS\x10\x13\x12\x10\n" + - "\fGRADIENT_SKY\x10\x14\x12\x12\n" + - "\x0eGRADIENT_PEACH\x10\x15\"\xe9\x03\n" + - "\x11BubbleColorPreset\x12\x1f\n" + - "\x1bUNKNOWN_BUBBLE_COLOR_PRESET\x10\x00\x12\x15\n" + - "\x11SOLID_ULTRAMARINE\x10\x01\x12\x11\n" + - "\rSOLID_CRIMSON\x10\x02\x12\x13\n" + - "\x0fSOLID_VERMILION\x10\x03\x12\x10\n" + - "\fSOLID_BURLAP\x10\x04\x12\x10\n" + - "\fSOLID_FOREST\x10\x05\x12\x15\n" + - "\x11SOLID_WINTERGREEN\x10\x06\x12\x0e\n" + - "\n" + - "SOLID_TEAL\x10\a\x12\x0e\n" + - "\n" + - "SOLID_BLUE\x10\b\x12\x10\n" + - "\fSOLID_INDIGO\x10\t\x12\x10\n" + - "\fSOLID_VIOLET\x10\n" + - "\x12\x0e\n" + - "\n" + - "SOLID_PLUM\x10\v\x12\x0f\n" + - "\vSOLID_TAUPE\x10\f\x12\x0f\n" + - "\vSOLID_STEEL\x10\r\x12\x12\n" + - "\x0eGRADIENT_EMBER\x10\x0e\x12\x15\n" + - "\x11GRADIENT_MIDNIGHT\x10\x0f\x12\x15\n" + - "\x11GRADIENT_INFRARED\x10\x10\x12\x13\n" + - "\x0fGRADIENT_LAGOON\x10\x11\x12\x18\n" + - "\x14GRADIENT_FLUORESCENT\x10\x12\x12\x12\n" + - "\x0eGRADIENT_BASIL\x10\x13\x12\x14\n" + - "\x10GRADIENT_SUBLIME\x10\x14\x12\x10\n" + - "\fGRADIENT_SEA\x10\x15\x12\x16\n" + - "\x12GRADIENT_TANGERINE\x10\x16B\v\n" + - "\twallpaperB\r\n" + - "\vbubbleColor\"\xe8\x04\n" + - "\x13NotificationProfile\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x19\n" + - "\x05emoji\x18\x02 \x01(\tH\x00R\x05emoji\x88\x01\x01\x12\x14\n" + - "\x05color\x18\x03 \x01(\aR\x05color\x12 \n" + - "\vcreatedAtMs\x18\x04 \x01(\x04R\vcreatedAtMs\x12$\n" + - "\rallowAllCalls\x18\x05 \x01(\bR\rallowAllCalls\x12*\n" + - "\x10allowAllMentions\x18\x06 \x01(\bR\x10allowAllMentions\x12&\n" + - "\x0eallowedMembers\x18\a \x03(\x04R\x0eallowedMembers\x12(\n" + - "\x0fscheduleEnabled\x18\b \x01(\bR\x0fscheduleEnabled\x12,\n" + - "\x11scheduleStartTime\x18\t \x01(\rR\x11scheduleStartTime\x12(\n" + - "\x0fscheduleEndTime\x18\n" + - " \x01(\rR\x0fscheduleEndTime\x12^\n" + - "\x13scheduleDaysEnabled\x18\v \x03(\x0e2,.signal.backup.NotificationProfile.DayOfWeekR\x13scheduleDaysEnabled\x12\x0e\n" + - "\x02id\x18\f \x01(\fR\x02id\"t\n" + - "\tDayOfWeek\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\n" + - "\n" + - "\x06MONDAY\x10\x01\x12\v\n" + - "\aTUESDAY\x10\x02\x12\r\n" + - "\tWEDNESDAY\x10\x03\x12\f\n" + - "\bTHURSDAY\x10\x04\x12\n" + - "\n" + - "\x06FRIDAY\x10\x05\x12\f\n" + - "\bSATURDAY\x10\x06\x12\n" + - "\n" + - "\x06SUNDAY\x10\aB\b\n" + - "\x06_emoji\"\xd0\x03\n" + - "\n" + - "ChatFolder\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12&\n" + - "\x0eshowOnlyUnread\x18\x02 \x01(\bR\x0eshowOnlyUnread\x12&\n" + - "\x0eshowMutedChats\x18\x03 \x01(\bR\x0eshowMutedChats\x12<\n" + - "\x19includeAllIndividualChats\x18\x04 \x01(\bR\x19includeAllIndividualChats\x122\n" + - "\x14includeAllGroupChats\x18\x05 \x01(\bR\x14includeAllGroupChats\x12D\n" + - "\n" + - "folderType\x18\x06 \x01(\x0e2$.signal.backup.ChatFolder.FolderTypeR\n" + - "folderType\x122\n" + - "\x14includedRecipientIds\x18\a \x03(\x04R\x14includedRecipientIds\x122\n" + - "\x14excludedRecipientIds\x18\b \x03(\x04R\x14excludedRecipientIds\x12\x0e\n" + - "\x02id\x18\t \x01(\fR\x02id\".\n" + - "\n" + - "FolderType\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\a\n" + - "\x03ALL\x10\x01\x12\n" + - "\n" + - "\x06CUSTOM\x10\x02*\x85\x01\n" + - "\vAvatarColor\x12\b\n" + - "\x04A100\x10\x00\x12\b\n" + - "\x04A110\x10\x01\x12\b\n" + - "\x04A120\x10\x02\x12\b\n" + - "\x04A130\x10\x03\x12\b\n" + - "\x04A140\x10\x04\x12\b\n" + - "\x04A150\x10\x05\x12\b\n" + - "\x04A160\x10\x06\x12\b\n" + - "\x04A170\x10\a\x12\b\n" + - "\x04A180\x10\b\x12\b\n" + - "\x04A190\x10\t\x12\b\n" + - "\x04A200\x10\n" + - "\x12\b\n" + - "\x04A210\x10\v*\\\n" + - "\x12GroupV2AccessLevel\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\x04B)\n" + - "\x18org.signal.archive.proto\xba\x02\fBackupProto_b\x06proto3" - -var ( - file_backuppb_Backup_proto_rawDescOnce sync.Once - file_backuppb_Backup_proto_rawDescData []byte -) - -func file_backuppb_Backup_proto_rawDescGZIP() []byte { - file_backuppb_Backup_proto_rawDescOnce.Do(func() { - file_backuppb_Backup_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_backuppb_Backup_proto_rawDesc), len(file_backuppb_Backup_proto_rawDesc))) - }) - return file_backuppb_Backup_proto_rawDescData -} - -var file_backuppb_Backup_proto_enumTypes = make([]protoimpl.EnumInfo, 37) -var file_backuppb_Backup_proto_msgTypes = make([]protoimpl.MessageInfo, 131) -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_AccountSettings_UnreadBadgeType)(0), // 8: signal.backup.AccountData.AccountSettings.UnreadBadgeType - (AccountData_AndroidSpecificSettings_NavigationBarSize)(0), // 9: signal.backup.AccountData.AndroidSpecificSettings.NavigationBarSize - (Contact_IdentityState)(0), // 10: signal.backup.Contact.IdentityState - (Contact_Visibility)(0), // 11: signal.backup.Contact.Visibility - (Group_StorySendMode)(0), // 12: signal.backup.Group.StorySendMode - (Group_Member_Role)(0), // 13: signal.backup.Group.Member.Role - (Group_AccessControl_AccessRequired)(0), // 14: signal.backup.Group.AccessControl.AccessRequired - (CallLink_Restrictions)(0), // 15: signal.backup.CallLink.Restrictions - (AdHocCall_State)(0), // 16: signal.backup.AdHocCall.State - (DistributionList_PrivacyMode)(0), // 17: signal.backup.DistributionList.PrivacyMode - (SendStatus_Failed_FailureReason)(0), // 18: signal.backup.SendStatus.Failed.FailureReason - (PaymentNotification_TransactionDetails_FailedTransaction_FailureReason)(0), // 19: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.FailureReason - (PaymentNotification_TransactionDetails_Transaction_Status)(0), // 20: signal.backup.PaymentNotification.TransactionDetails.Transaction.Status - (GiftBadge_State)(0), // 21: signal.backup.GiftBadge.State - (ContactAttachment_Phone_Type)(0), // 22: signal.backup.ContactAttachment.Phone.Type - (ContactAttachment_Email_Type)(0), // 23: signal.backup.ContactAttachment.Email.Type - (ContactAttachment_PostalAddress_Type)(0), // 24: signal.backup.ContactAttachment.PostalAddress.Type - (MessageAttachment_Flag)(0), // 25: signal.backup.MessageAttachment.Flag - (Quote_Type)(0), // 26: signal.backup.Quote.Type - (BodyRange_Style)(0), // 27: signal.backup.BodyRange.Style - (IndividualCall_Type)(0), // 28: signal.backup.IndividualCall.Type - (IndividualCall_Direction)(0), // 29: signal.backup.IndividualCall.Direction - (IndividualCall_State)(0), // 30: signal.backup.IndividualCall.State - (GroupCall_State)(0), // 31: signal.backup.GroupCall.State - (SimpleChatUpdate_Type)(0), // 32: signal.backup.SimpleChatUpdate.Type - (ChatStyle_WallpaperPreset)(0), // 33: signal.backup.ChatStyle.WallpaperPreset - (ChatStyle_BubbleColorPreset)(0), // 34: signal.backup.ChatStyle.BubbleColorPreset - (NotificationProfile_DayOfWeek)(0), // 35: signal.backup.NotificationProfile.DayOfWeek - (ChatFolder_FolderType)(0), // 36: signal.backup.ChatFolder.FolderType - (*BackupInfo)(nil), // 37: signal.backup.BackupInfo - (*Frame)(nil), // 38: signal.backup.Frame - (*AccountData)(nil), // 39: signal.backup.AccountData - (*Recipient)(nil), // 40: signal.backup.Recipient - (*Contact)(nil), // 41: signal.backup.Contact - (*Group)(nil), // 42: signal.backup.Group - (*Self)(nil), // 43: signal.backup.Self - (*ReleaseNotes)(nil), // 44: signal.backup.ReleaseNotes - (*Chat)(nil), // 45: signal.backup.Chat - (*CallLink)(nil), // 46: signal.backup.CallLink - (*AdHocCall)(nil), // 47: signal.backup.AdHocCall - (*DistributionListItem)(nil), // 48: signal.backup.DistributionListItem - (*DistributionList)(nil), // 49: signal.backup.DistributionList - (*ChatItem)(nil), // 50: signal.backup.ChatItem - (*SendStatus)(nil), // 51: signal.backup.SendStatus - (*Text)(nil), // 52: signal.backup.Text - (*StandardMessage)(nil), // 53: signal.backup.StandardMessage - (*ContactMessage)(nil), // 54: signal.backup.ContactMessage - (*DirectStoryReplyMessage)(nil), // 55: signal.backup.DirectStoryReplyMessage - (*PaymentNotification)(nil), // 56: signal.backup.PaymentNotification - (*GiftBadge)(nil), // 57: signal.backup.GiftBadge - (*ViewOnceMessage)(nil), // 58: signal.backup.ViewOnceMessage - (*ContactAttachment)(nil), // 59: signal.backup.ContactAttachment - (*StickerMessage)(nil), // 60: signal.backup.StickerMessage - (*RemoteDeletedMessage)(nil), // 61: signal.backup.RemoteDeletedMessage - (*Sticker)(nil), // 62: signal.backup.Sticker - (*LinkPreview)(nil), // 63: signal.backup.LinkPreview - (*MessageAttachment)(nil), // 64: signal.backup.MessageAttachment - (*FilePointer)(nil), // 65: signal.backup.FilePointer - (*Quote)(nil), // 66: signal.backup.Quote - (*BodyRange)(nil), // 67: signal.backup.BodyRange - (*Reaction)(nil), // 68: signal.backup.Reaction - (*Poll)(nil), // 69: signal.backup.Poll - (*AdminDeletedMessage)(nil), // 70: signal.backup.AdminDeletedMessage - (*ChatUpdateMessage)(nil), // 71: signal.backup.ChatUpdateMessage - (*IndividualCall)(nil), // 72: signal.backup.IndividualCall - (*GroupCall)(nil), // 73: signal.backup.GroupCall - (*SimpleChatUpdate)(nil), // 74: signal.backup.SimpleChatUpdate - (*ExpirationTimerChatUpdate)(nil), // 75: signal.backup.ExpirationTimerChatUpdate - (*ProfileChangeChatUpdate)(nil), // 76: signal.backup.ProfileChangeChatUpdate - (*LearnedProfileChatUpdate)(nil), // 77: signal.backup.LearnedProfileChatUpdate - (*ThreadMergeChatUpdate)(nil), // 78: signal.backup.ThreadMergeChatUpdate - (*SessionSwitchoverChatUpdate)(nil), // 79: signal.backup.SessionSwitchoverChatUpdate - (*GroupChangeChatUpdate)(nil), // 80: signal.backup.GroupChangeChatUpdate - (*GenericGroupUpdate)(nil), // 81: signal.backup.GenericGroupUpdate - (*GroupCreationUpdate)(nil), // 82: signal.backup.GroupCreationUpdate - (*GroupNameUpdate)(nil), // 83: signal.backup.GroupNameUpdate - (*GroupAvatarUpdate)(nil), // 84: signal.backup.GroupAvatarUpdate - (*GroupDescriptionUpdate)(nil), // 85: signal.backup.GroupDescriptionUpdate - (*GroupMembershipAccessLevelChangeUpdate)(nil), // 86: signal.backup.GroupMembershipAccessLevelChangeUpdate - (*GroupAttributesAccessLevelChangeUpdate)(nil), // 87: signal.backup.GroupAttributesAccessLevelChangeUpdate - (*GroupMemberLabelAccessLevelChangeUpdate)(nil), // 88: signal.backup.GroupMemberLabelAccessLevelChangeUpdate - (*GroupTerminateChangeUpdate)(nil), // 89: signal.backup.GroupTerminateChangeUpdate - (*GroupAnnouncementOnlyChangeUpdate)(nil), // 90: signal.backup.GroupAnnouncementOnlyChangeUpdate - (*GroupAdminStatusUpdate)(nil), // 91: signal.backup.GroupAdminStatusUpdate - (*GroupMemberLeftUpdate)(nil), // 92: signal.backup.GroupMemberLeftUpdate - (*GroupMemberRemovedUpdate)(nil), // 93: signal.backup.GroupMemberRemovedUpdate - (*SelfInvitedToGroupUpdate)(nil), // 94: signal.backup.SelfInvitedToGroupUpdate - (*SelfInvitedOtherUserToGroupUpdate)(nil), // 95: signal.backup.SelfInvitedOtherUserToGroupUpdate - (*GroupUnknownInviteeUpdate)(nil), // 96: signal.backup.GroupUnknownInviteeUpdate - (*GroupInvitationAcceptedUpdate)(nil), // 97: signal.backup.GroupInvitationAcceptedUpdate - (*GroupInvitationDeclinedUpdate)(nil), // 98: signal.backup.GroupInvitationDeclinedUpdate - (*GroupMemberJoinedUpdate)(nil), // 99: signal.backup.GroupMemberJoinedUpdate - (*GroupMemberAddedUpdate)(nil), // 100: signal.backup.GroupMemberAddedUpdate - (*GroupSelfInvitationRevokedUpdate)(nil), // 101: signal.backup.GroupSelfInvitationRevokedUpdate - (*GroupInvitationRevokedUpdate)(nil), // 102: signal.backup.GroupInvitationRevokedUpdate - (*GroupJoinRequestUpdate)(nil), // 103: signal.backup.GroupJoinRequestUpdate - (*GroupJoinRequestApprovalUpdate)(nil), // 104: signal.backup.GroupJoinRequestApprovalUpdate - (*GroupJoinRequestCanceledUpdate)(nil), // 105: signal.backup.GroupJoinRequestCanceledUpdate - (*GroupSequenceOfRequestsAndCancelsUpdate)(nil), // 106: signal.backup.GroupSequenceOfRequestsAndCancelsUpdate - (*GroupInviteLinkResetUpdate)(nil), // 107: signal.backup.GroupInviteLinkResetUpdate - (*GroupInviteLinkEnabledUpdate)(nil), // 108: signal.backup.GroupInviteLinkEnabledUpdate - (*GroupInviteLinkAdminApprovalUpdate)(nil), // 109: signal.backup.GroupInviteLinkAdminApprovalUpdate - (*GroupInviteLinkDisabledUpdate)(nil), // 110: signal.backup.GroupInviteLinkDisabledUpdate - (*GroupMemberJoinedByLinkUpdate)(nil), // 111: signal.backup.GroupMemberJoinedByLinkUpdate - (*GroupV2MigrationUpdate)(nil), // 112: signal.backup.GroupV2MigrationUpdate - (*GroupV2MigrationSelfInvitedUpdate)(nil), // 113: signal.backup.GroupV2MigrationSelfInvitedUpdate - (*GroupV2MigrationInvitedMembersUpdate)(nil), // 114: signal.backup.GroupV2MigrationInvitedMembersUpdate - (*GroupV2MigrationDroppedMembersUpdate)(nil), // 115: signal.backup.GroupV2MigrationDroppedMembersUpdate - (*GroupExpirationTimerUpdate)(nil), // 116: signal.backup.GroupExpirationTimerUpdate - (*PollTerminateUpdate)(nil), // 117: signal.backup.PollTerminateUpdate - (*PinMessageUpdate)(nil), // 118: signal.backup.PinMessageUpdate - (*StickerPack)(nil), // 119: signal.backup.StickerPack - (*ChatStyle)(nil), // 120: signal.backup.ChatStyle - (*NotificationProfile)(nil), // 121: signal.backup.NotificationProfile - (*ChatFolder)(nil), // 122: signal.backup.ChatFolder - (*AccountData_UsernameLink)(nil), // 123: signal.backup.AccountData.UsernameLink - (*AccountData_AutoDownloadSettings)(nil), // 124: signal.backup.AccountData.AutoDownloadSettings - (*AccountData_AccountSettings)(nil), // 125: signal.backup.AccountData.AccountSettings - (*AccountData_SubscriberData)(nil), // 126: signal.backup.AccountData.SubscriberData - (*AccountData_IAPSubscriberData)(nil), // 127: signal.backup.AccountData.IAPSubscriberData - (*AccountData_AndroidSpecificSettings)(nil), // 128: signal.backup.AccountData.AndroidSpecificSettings - (*Contact_Registered)(nil), // 129: signal.backup.Contact.Registered - (*Contact_NotRegistered)(nil), // 130: signal.backup.Contact.NotRegistered - (*Contact_Name)(nil), // 131: signal.backup.Contact.Name - (*Group_GroupSnapshot)(nil), // 132: signal.backup.Group.GroupSnapshot - (*Group_GroupAttributeBlob)(nil), // 133: signal.backup.Group.GroupAttributeBlob - (*Group_Member)(nil), // 134: signal.backup.Group.Member - (*Group_MemberPendingProfileKey)(nil), // 135: signal.backup.Group.MemberPendingProfileKey - (*Group_MemberPendingAdminApproval)(nil), // 136: signal.backup.Group.MemberPendingAdminApproval - (*Group_MemberBanned)(nil), // 137: signal.backup.Group.MemberBanned - (*Group_AccessControl)(nil), // 138: signal.backup.Group.AccessControl - (*ChatItem_IncomingMessageDetails)(nil), // 139: signal.backup.ChatItem.IncomingMessageDetails - (*ChatItem_OutgoingMessageDetails)(nil), // 140: signal.backup.ChatItem.OutgoingMessageDetails - (*ChatItem_DirectionlessMessageDetails)(nil), // 141: signal.backup.ChatItem.DirectionlessMessageDetails - (*ChatItem_PinDetails)(nil), // 142: signal.backup.ChatItem.PinDetails - (*SendStatus_Pending)(nil), // 143: signal.backup.SendStatus.Pending - (*SendStatus_Sent)(nil), // 144: signal.backup.SendStatus.Sent - (*SendStatus_Delivered)(nil), // 145: signal.backup.SendStatus.Delivered - (*SendStatus_Read)(nil), // 146: signal.backup.SendStatus.Read - (*SendStatus_Viewed)(nil), // 147: signal.backup.SendStatus.Viewed - (*SendStatus_Skipped)(nil), // 148: signal.backup.SendStatus.Skipped - (*SendStatus_Failed)(nil), // 149: signal.backup.SendStatus.Failed - (*DirectStoryReplyMessage_TextReply)(nil), // 150: signal.backup.DirectStoryReplyMessage.TextReply - (*PaymentNotification_TransactionDetails)(nil), // 151: signal.backup.PaymentNotification.TransactionDetails - (*PaymentNotification_TransactionDetails_MobileCoinTxoIdentification)(nil), // 152: signal.backup.PaymentNotification.TransactionDetails.MobileCoinTxoIdentification - (*PaymentNotification_TransactionDetails_FailedTransaction)(nil), // 153: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction - (*PaymentNotification_TransactionDetails_Transaction)(nil), // 154: signal.backup.PaymentNotification.TransactionDetails.Transaction - (*ContactAttachment_Name)(nil), // 155: signal.backup.ContactAttachment.Name - (*ContactAttachment_Phone)(nil), // 156: signal.backup.ContactAttachment.Phone - (*ContactAttachment_Email)(nil), // 157: signal.backup.ContactAttachment.Email - (*ContactAttachment_PostalAddress)(nil), // 158: signal.backup.ContactAttachment.PostalAddress - (*FilePointer_LocatorInfo)(nil), // 159: signal.backup.FilePointer.LocatorInfo - (*Quote_QuotedAttachment)(nil), // 160: signal.backup.Quote.QuotedAttachment - (*Poll_PollOption)(nil), // 161: signal.backup.Poll.PollOption - (*Poll_PollOption_PollVote)(nil), // 162: signal.backup.Poll.PollOption.PollVote - (*GroupChangeChatUpdate_Update)(nil), // 163: signal.backup.GroupChangeChatUpdate.Update - (*GroupInvitationRevokedUpdate_Invitee)(nil), // 164: signal.backup.GroupInvitationRevokedUpdate.Invitee - (*ChatStyle_Gradient)(nil), // 165: signal.backup.ChatStyle.Gradient - (*ChatStyle_CustomChatColor)(nil), // 166: signal.backup.ChatStyle.CustomChatColor - (*ChatStyle_AutomaticBubbleColor)(nil), // 167: signal.backup.ChatStyle.AutomaticBubbleColor -} -var file_backuppb_Backup_proto_depIdxs = []int32{ - 39, // 0: signal.backup.Frame.account:type_name -> signal.backup.AccountData - 40, // 1: signal.backup.Frame.recipient:type_name -> signal.backup.Recipient - 45, // 2: signal.backup.Frame.chat:type_name -> signal.backup.Chat - 50, // 3: signal.backup.Frame.chatItem:type_name -> signal.backup.ChatItem - 119, // 4: signal.backup.Frame.stickerPack:type_name -> signal.backup.StickerPack - 47, // 5: signal.backup.Frame.adHocCall:type_name -> signal.backup.AdHocCall - 121, // 6: signal.backup.Frame.notificationProfile:type_name -> signal.backup.NotificationProfile - 122, // 7: signal.backup.Frame.chatFolder:type_name -> signal.backup.ChatFolder - 123, // 8: signal.backup.AccountData.usernameLink:type_name -> signal.backup.AccountData.UsernameLink - 126, // 9: signal.backup.AccountData.donationSubscriberData:type_name -> signal.backup.AccountData.SubscriberData - 125, // 10: signal.backup.AccountData.accountSettings:type_name -> signal.backup.AccountData.AccountSettings - 127, // 11: signal.backup.AccountData.backupsSubscriberData:type_name -> signal.backup.AccountData.IAPSubscriberData - 128, // 12: signal.backup.AccountData.androidSpecificSettings:type_name -> signal.backup.AccountData.AndroidSpecificSettings - 41, // 13: signal.backup.Recipient.contact:type_name -> signal.backup.Contact - 42, // 14: signal.backup.Recipient.group:type_name -> signal.backup.Group - 48, // 15: signal.backup.Recipient.distributionList:type_name -> signal.backup.DistributionListItem - 43, // 16: signal.backup.Recipient.self:type_name -> signal.backup.Self - 44, // 17: signal.backup.Recipient.releaseNotes:type_name -> signal.backup.ReleaseNotes - 46, // 18: signal.backup.Recipient.callLink:type_name -> signal.backup.CallLink - 11, // 19: signal.backup.Contact.visibility:type_name -> signal.backup.Contact.Visibility - 129, // 20: signal.backup.Contact.registered:type_name -> signal.backup.Contact.Registered - 130, // 21: signal.backup.Contact.notRegistered:type_name -> signal.backup.Contact.NotRegistered - 10, // 22: signal.backup.Contact.identityState:type_name -> signal.backup.Contact.IdentityState - 131, // 23: signal.backup.Contact.nickname:type_name -> signal.backup.Contact.Name - 0, // 24: signal.backup.Contact.avatarColor:type_name -> signal.backup.AvatarColor - 12, // 25: signal.backup.Group.storySendMode:type_name -> signal.backup.Group.StorySendMode - 132, // 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 - 120, // 29: signal.backup.Chat.style:type_name -> signal.backup.ChatStyle - 15, // 30: signal.backup.CallLink.restrictions:type_name -> signal.backup.CallLink.Restrictions - 16, // 31: signal.backup.AdHocCall.state:type_name -> signal.backup.AdHocCall.State - 49, // 32: signal.backup.DistributionListItem.distributionList:type_name -> signal.backup.DistributionList - 17, // 33: signal.backup.DistributionList.privacyMode:type_name -> signal.backup.DistributionList.PrivacyMode - 50, // 34: signal.backup.ChatItem.revisions:type_name -> signal.backup.ChatItem - 139, // 35: signal.backup.ChatItem.incoming:type_name -> signal.backup.ChatItem.IncomingMessageDetails - 140, // 36: signal.backup.ChatItem.outgoing:type_name -> signal.backup.ChatItem.OutgoingMessageDetails - 141, // 37: signal.backup.ChatItem.directionless:type_name -> signal.backup.ChatItem.DirectionlessMessageDetails - 53, // 38: signal.backup.ChatItem.standardMessage:type_name -> signal.backup.StandardMessage - 54, // 39: signal.backup.ChatItem.contactMessage:type_name -> signal.backup.ContactMessage - 60, // 40: signal.backup.ChatItem.stickerMessage:type_name -> signal.backup.StickerMessage - 61, // 41: signal.backup.ChatItem.remoteDeletedMessage:type_name -> signal.backup.RemoteDeletedMessage - 71, // 42: signal.backup.ChatItem.updateMessage:type_name -> signal.backup.ChatUpdateMessage - 56, // 43: signal.backup.ChatItem.paymentNotification:type_name -> signal.backup.PaymentNotification - 57, // 44: signal.backup.ChatItem.giftBadge:type_name -> signal.backup.GiftBadge - 58, // 45: signal.backup.ChatItem.viewOnceMessage:type_name -> signal.backup.ViewOnceMessage - 55, // 46: signal.backup.ChatItem.directStoryReplyMessage:type_name -> signal.backup.DirectStoryReplyMessage - 69, // 47: signal.backup.ChatItem.poll:type_name -> signal.backup.Poll - 70, // 48: signal.backup.ChatItem.adminDeletedMessage:type_name -> signal.backup.AdminDeletedMessage - 142, // 49: signal.backup.ChatItem.pinDetails:type_name -> signal.backup.ChatItem.PinDetails - 143, // 50: signal.backup.SendStatus.pending:type_name -> signal.backup.SendStatus.Pending - 144, // 51: signal.backup.SendStatus.sent:type_name -> signal.backup.SendStatus.Sent - 145, // 52: signal.backup.SendStatus.delivered:type_name -> signal.backup.SendStatus.Delivered - 146, // 53: signal.backup.SendStatus.read:type_name -> signal.backup.SendStatus.Read - 147, // 54: signal.backup.SendStatus.viewed:type_name -> signal.backup.SendStatus.Viewed - 148, // 55: signal.backup.SendStatus.skipped:type_name -> signal.backup.SendStatus.Skipped - 149, // 56: signal.backup.SendStatus.failed:type_name -> signal.backup.SendStatus.Failed - 67, // 57: signal.backup.Text.bodyRanges:type_name -> signal.backup.BodyRange - 66, // 58: signal.backup.StandardMessage.quote:type_name -> signal.backup.Quote - 52, // 59: signal.backup.StandardMessage.text:type_name -> signal.backup.Text - 64, // 60: signal.backup.StandardMessage.attachments:type_name -> signal.backup.MessageAttachment - 63, // 61: signal.backup.StandardMessage.linkPreview:type_name -> signal.backup.LinkPreview - 65, // 62: signal.backup.StandardMessage.longText:type_name -> signal.backup.FilePointer - 68, // 63: signal.backup.StandardMessage.reactions:type_name -> signal.backup.Reaction - 59, // 64: signal.backup.ContactMessage.contact:type_name -> signal.backup.ContactAttachment - 68, // 65: signal.backup.ContactMessage.reactions:type_name -> signal.backup.Reaction - 150, // 66: signal.backup.DirectStoryReplyMessage.textReply:type_name -> signal.backup.DirectStoryReplyMessage.TextReply - 68, // 67: signal.backup.DirectStoryReplyMessage.reactions:type_name -> signal.backup.Reaction - 151, // 68: signal.backup.PaymentNotification.transactionDetails:type_name -> signal.backup.PaymentNotification.TransactionDetails - 21, // 69: signal.backup.GiftBadge.state:type_name -> signal.backup.GiftBadge.State - 64, // 70: signal.backup.ViewOnceMessage.attachment:type_name -> signal.backup.MessageAttachment - 68, // 71: signal.backup.ViewOnceMessage.reactions:type_name -> signal.backup.Reaction - 155, // 72: signal.backup.ContactAttachment.name:type_name -> signal.backup.ContactAttachment.Name - 156, // 73: signal.backup.ContactAttachment.number:type_name -> signal.backup.ContactAttachment.Phone - 157, // 74: signal.backup.ContactAttachment.email:type_name -> signal.backup.ContactAttachment.Email - 158, // 75: signal.backup.ContactAttachment.address:type_name -> signal.backup.ContactAttachment.PostalAddress - 65, // 76: signal.backup.ContactAttachment.avatar:type_name -> signal.backup.FilePointer - 62, // 77: signal.backup.StickerMessage.sticker:type_name -> signal.backup.Sticker - 68, // 78: signal.backup.StickerMessage.reactions:type_name -> signal.backup.Reaction - 65, // 79: signal.backup.Sticker.data:type_name -> signal.backup.FilePointer - 65, // 80: signal.backup.LinkPreview.image:type_name -> signal.backup.FilePointer - 65, // 81: signal.backup.MessageAttachment.pointer:type_name -> signal.backup.FilePointer - 25, // 82: signal.backup.MessageAttachment.flag:type_name -> signal.backup.MessageAttachment.Flag - 159, // 83: signal.backup.FilePointer.locatorInfo:type_name -> signal.backup.FilePointer.LocatorInfo - 52, // 84: signal.backup.Quote.text:type_name -> signal.backup.Text - 160, // 85: signal.backup.Quote.attachments:type_name -> signal.backup.Quote.QuotedAttachment - 26, // 86: signal.backup.Quote.type:type_name -> signal.backup.Quote.Type - 27, // 87: signal.backup.BodyRange.style:type_name -> signal.backup.BodyRange.Style - 161, // 88: signal.backup.Poll.options:type_name -> signal.backup.Poll.PollOption - 68, // 89: signal.backup.Poll.reactions:type_name -> signal.backup.Reaction - 74, // 90: signal.backup.ChatUpdateMessage.simpleUpdate:type_name -> signal.backup.SimpleChatUpdate - 80, // 91: signal.backup.ChatUpdateMessage.groupChange:type_name -> signal.backup.GroupChangeChatUpdate - 75, // 92: signal.backup.ChatUpdateMessage.expirationTimerChange:type_name -> signal.backup.ExpirationTimerChatUpdate - 76, // 93: signal.backup.ChatUpdateMessage.profileChange:type_name -> signal.backup.ProfileChangeChatUpdate - 78, // 94: signal.backup.ChatUpdateMessage.threadMerge:type_name -> signal.backup.ThreadMergeChatUpdate - 79, // 95: signal.backup.ChatUpdateMessage.sessionSwitchover:type_name -> signal.backup.SessionSwitchoverChatUpdate - 72, // 96: signal.backup.ChatUpdateMessage.individualCall:type_name -> signal.backup.IndividualCall - 73, // 97: signal.backup.ChatUpdateMessage.groupCall:type_name -> signal.backup.GroupCall - 77, // 98: signal.backup.ChatUpdateMessage.learnedProfileChange:type_name -> signal.backup.LearnedProfileChatUpdate - 117, // 99: signal.backup.ChatUpdateMessage.pollTerminate:type_name -> signal.backup.PollTerminateUpdate - 118, // 100: signal.backup.ChatUpdateMessage.pinMessage:type_name -> signal.backup.PinMessageUpdate - 28, // 101: signal.backup.IndividualCall.type:type_name -> signal.backup.IndividualCall.Type - 29, // 102: signal.backup.IndividualCall.direction:type_name -> signal.backup.IndividualCall.Direction - 30, // 103: signal.backup.IndividualCall.state:type_name -> signal.backup.IndividualCall.State - 31, // 104: signal.backup.GroupCall.state:type_name -> signal.backup.GroupCall.State - 32, // 105: signal.backup.SimpleChatUpdate.type:type_name -> signal.backup.SimpleChatUpdate.Type - 163, // 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 - 164, // 110: signal.backup.GroupInvitationRevokedUpdate.invitees:type_name -> signal.backup.GroupInvitationRevokedUpdate.Invitee - 33, // 111: signal.backup.ChatStyle.wallpaperPreset:type_name -> signal.backup.ChatStyle.WallpaperPreset - 65, // 112: signal.backup.ChatStyle.wallpaperPhoto:type_name -> signal.backup.FilePointer - 167, // 113: signal.backup.ChatStyle.autoBubbleColor:type_name -> signal.backup.ChatStyle.AutomaticBubbleColor - 34, // 114: signal.backup.ChatStyle.bubbleColorPreset:type_name -> signal.backup.ChatStyle.BubbleColorPreset - 35, // 115: signal.backup.NotificationProfile.scheduleDaysEnabled:type_name -> signal.backup.NotificationProfile.DayOfWeek - 36, // 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 - 120, // 123: signal.backup.AccountData.AccountSettings.defaultChatStyle:type_name -> signal.backup.ChatStyle - 166, // 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 - 124, // 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.AccountSettings.unreadBadgeType:type_name -> signal.backup.AccountData.AccountSettings.UnreadBadgeType - 9, // 130: signal.backup.AccountData.AndroidSpecificSettings.navigationBarSize:type_name -> signal.backup.AccountData.AndroidSpecificSettings.NavigationBarSize - 133, // 131: signal.backup.Group.GroupSnapshot.title:type_name -> signal.backup.Group.GroupAttributeBlob - 133, // 132: signal.backup.Group.GroupSnapshot.description:type_name -> signal.backup.Group.GroupAttributeBlob - 133, // 133: signal.backup.Group.GroupSnapshot.disappearingMessagesTimer:type_name -> signal.backup.Group.GroupAttributeBlob - 138, // 134: signal.backup.Group.GroupSnapshot.accessControl:type_name -> signal.backup.Group.AccessControl - 134, // 135: signal.backup.Group.GroupSnapshot.members:type_name -> signal.backup.Group.Member - 135, // 136: signal.backup.Group.GroupSnapshot.membersPendingProfileKey:type_name -> signal.backup.Group.MemberPendingProfileKey - 136, // 137: signal.backup.Group.GroupSnapshot.membersPendingAdminApproval:type_name -> signal.backup.Group.MemberPendingAdminApproval - 137, // 138: signal.backup.Group.GroupSnapshot.members_banned:type_name -> signal.backup.Group.MemberBanned - 13, // 139: signal.backup.Group.Member.role:type_name -> signal.backup.Group.Member.Role - 134, // 140: signal.backup.Group.MemberPendingProfileKey.member:type_name -> signal.backup.Group.Member - 14, // 141: signal.backup.Group.AccessControl.attributes:type_name -> signal.backup.Group.AccessControl.AccessRequired - 14, // 142: signal.backup.Group.AccessControl.members:type_name -> signal.backup.Group.AccessControl.AccessRequired - 14, // 143: signal.backup.Group.AccessControl.addFromInviteLink:type_name -> signal.backup.Group.AccessControl.AccessRequired - 14, // 144: signal.backup.Group.AccessControl.memberLabel:type_name -> signal.backup.Group.AccessControl.AccessRequired - 51, // 145: signal.backup.ChatItem.OutgoingMessageDetails.sendStatus:type_name -> signal.backup.SendStatus - 18, // 146: signal.backup.SendStatus.Failed.reason:type_name -> signal.backup.SendStatus.Failed.FailureReason - 52, // 147: signal.backup.DirectStoryReplyMessage.TextReply.text:type_name -> signal.backup.Text - 65, // 148: signal.backup.DirectStoryReplyMessage.TextReply.longText:type_name -> signal.backup.FilePointer - 154, // 149: signal.backup.PaymentNotification.TransactionDetails.transaction:type_name -> signal.backup.PaymentNotification.TransactionDetails.Transaction - 153, // 150: signal.backup.PaymentNotification.TransactionDetails.failedTransaction:type_name -> signal.backup.PaymentNotification.TransactionDetails.FailedTransaction - 19, // 151: signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.reason:type_name -> signal.backup.PaymentNotification.TransactionDetails.FailedTransaction.FailureReason - 20, // 152: signal.backup.PaymentNotification.TransactionDetails.Transaction.status:type_name -> signal.backup.PaymentNotification.TransactionDetails.Transaction.Status - 152, // 153: signal.backup.PaymentNotification.TransactionDetails.Transaction.mobileCoinIdentification:type_name -> signal.backup.PaymentNotification.TransactionDetails.MobileCoinTxoIdentification - 22, // 154: signal.backup.ContactAttachment.Phone.type:type_name -> signal.backup.ContactAttachment.Phone.Type - 23, // 155: signal.backup.ContactAttachment.Email.type:type_name -> signal.backup.ContactAttachment.Email.Type - 24, // 156: signal.backup.ContactAttachment.PostalAddress.type:type_name -> signal.backup.ContactAttachment.PostalAddress.Type - 64, // 157: signal.backup.Quote.QuotedAttachment.thumbnail:type_name -> signal.backup.MessageAttachment - 162, // 158: signal.backup.Poll.PollOption.votes:type_name -> signal.backup.Poll.PollOption.PollVote - 81, // 159: signal.backup.GroupChangeChatUpdate.Update.genericGroupUpdate:type_name -> signal.backup.GenericGroupUpdate - 82, // 160: signal.backup.GroupChangeChatUpdate.Update.groupCreationUpdate:type_name -> signal.backup.GroupCreationUpdate - 83, // 161: signal.backup.GroupChangeChatUpdate.Update.groupNameUpdate:type_name -> signal.backup.GroupNameUpdate - 84, // 162: signal.backup.GroupChangeChatUpdate.Update.groupAvatarUpdate:type_name -> signal.backup.GroupAvatarUpdate - 85, // 163: signal.backup.GroupChangeChatUpdate.Update.groupDescriptionUpdate:type_name -> signal.backup.GroupDescriptionUpdate - 86, // 164: signal.backup.GroupChangeChatUpdate.Update.groupMembershipAccessLevelChangeUpdate:type_name -> signal.backup.GroupMembershipAccessLevelChangeUpdate - 87, // 165: signal.backup.GroupChangeChatUpdate.Update.groupAttributesAccessLevelChangeUpdate:type_name -> signal.backup.GroupAttributesAccessLevelChangeUpdate - 90, // 166: signal.backup.GroupChangeChatUpdate.Update.groupAnnouncementOnlyChangeUpdate:type_name -> signal.backup.GroupAnnouncementOnlyChangeUpdate - 91, // 167: signal.backup.GroupChangeChatUpdate.Update.groupAdminStatusUpdate:type_name -> signal.backup.GroupAdminStatusUpdate - 92, // 168: signal.backup.GroupChangeChatUpdate.Update.groupMemberLeftUpdate:type_name -> signal.backup.GroupMemberLeftUpdate - 93, // 169: signal.backup.GroupChangeChatUpdate.Update.groupMemberRemovedUpdate:type_name -> signal.backup.GroupMemberRemovedUpdate - 94, // 170: signal.backup.GroupChangeChatUpdate.Update.selfInvitedToGroupUpdate:type_name -> signal.backup.SelfInvitedToGroupUpdate - 95, // 171: signal.backup.GroupChangeChatUpdate.Update.selfInvitedOtherUserToGroupUpdate:type_name -> signal.backup.SelfInvitedOtherUserToGroupUpdate - 96, // 172: signal.backup.GroupChangeChatUpdate.Update.groupUnknownInviteeUpdate:type_name -> signal.backup.GroupUnknownInviteeUpdate - 97, // 173: signal.backup.GroupChangeChatUpdate.Update.groupInvitationAcceptedUpdate:type_name -> signal.backup.GroupInvitationAcceptedUpdate - 98, // 174: signal.backup.GroupChangeChatUpdate.Update.groupInvitationDeclinedUpdate:type_name -> signal.backup.GroupInvitationDeclinedUpdate - 99, // 175: signal.backup.GroupChangeChatUpdate.Update.groupMemberJoinedUpdate:type_name -> signal.backup.GroupMemberJoinedUpdate - 100, // 176: signal.backup.GroupChangeChatUpdate.Update.groupMemberAddedUpdate:type_name -> signal.backup.GroupMemberAddedUpdate - 101, // 177: signal.backup.GroupChangeChatUpdate.Update.groupSelfInvitationRevokedUpdate:type_name -> signal.backup.GroupSelfInvitationRevokedUpdate - 102, // 178: signal.backup.GroupChangeChatUpdate.Update.groupInvitationRevokedUpdate:type_name -> signal.backup.GroupInvitationRevokedUpdate - 103, // 179: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestUpdate:type_name -> signal.backup.GroupJoinRequestUpdate - 104, // 180: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestApprovalUpdate:type_name -> signal.backup.GroupJoinRequestApprovalUpdate - 105, // 181: signal.backup.GroupChangeChatUpdate.Update.groupJoinRequestCanceledUpdate:type_name -> signal.backup.GroupJoinRequestCanceledUpdate - 107, // 182: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkResetUpdate:type_name -> signal.backup.GroupInviteLinkResetUpdate - 108, // 183: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkEnabledUpdate:type_name -> signal.backup.GroupInviteLinkEnabledUpdate - 109, // 184: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkAdminApprovalUpdate:type_name -> signal.backup.GroupInviteLinkAdminApprovalUpdate - 110, // 185: signal.backup.GroupChangeChatUpdate.Update.groupInviteLinkDisabledUpdate:type_name -> signal.backup.GroupInviteLinkDisabledUpdate - 111, // 186: signal.backup.GroupChangeChatUpdate.Update.groupMemberJoinedByLinkUpdate:type_name -> signal.backup.GroupMemberJoinedByLinkUpdate - 112, // 187: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationUpdate:type_name -> signal.backup.GroupV2MigrationUpdate - 113, // 188: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationSelfInvitedUpdate:type_name -> signal.backup.GroupV2MigrationSelfInvitedUpdate - 114, // 189: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationInvitedMembersUpdate:type_name -> signal.backup.GroupV2MigrationInvitedMembersUpdate - 115, // 190: signal.backup.GroupChangeChatUpdate.Update.groupV2MigrationDroppedMembersUpdate:type_name -> signal.backup.GroupV2MigrationDroppedMembersUpdate - 106, // 191: signal.backup.GroupChangeChatUpdate.Update.groupSequenceOfRequestsAndCancelsUpdate:type_name -> signal.backup.GroupSequenceOfRequestsAndCancelsUpdate - 116, // 192: signal.backup.GroupChangeChatUpdate.Update.groupExpirationTimerUpdate:type_name -> signal.backup.GroupExpirationTimerUpdate - 88, // 193: signal.backup.GroupChangeChatUpdate.Update.groupMemberLabelAccessLevelChangeUpdate:type_name -> signal.backup.GroupMemberLabelAccessLevelChangeUpdate - 89, // 194: signal.backup.GroupChangeChatUpdate.Update.groupTerminateChangeUpdate:type_name -> signal.backup.GroupTerminateChangeUpdate - 165, // 195: signal.backup.ChatStyle.CustomChatColor.gradient:type_name -> signal.backup.ChatStyle.Gradient - 196, // [196:196] is the sub-list for method output_type - 196, // [196:196] is the sub-list for method input_type - 196, // [196:196] is the sub-list for extension type_name - 196, // [196:196] is the sub-list for extension extendee - 0, // [0:196] is the sub-list for field type_name -} - -func init() { file_backuppb_Backup_proto_init() } -func file_backuppb_Backup_proto_init() { - if File_backuppb_Backup_proto != nil { - return - } - file_backuppb_Backup_proto_msgTypes[1].OneofWrappers = []any{ - (*Frame_Account)(nil), - (*Frame_Recipient)(nil), - (*Frame_Chat)(nil), - (*Frame_ChatItem)(nil), - (*Frame_StickerPack)(nil), - (*Frame_AdHocCall)(nil), - (*Frame_NotificationProfile)(nil), - (*Frame_ChatFolder)(nil), - } - file_backuppb_Backup_proto_msgTypes[2].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[3].OneofWrappers = []any{ - (*Recipient_Contact)(nil), - (*Recipient_Group)(nil), - (*Recipient_DistributionList)(nil), - (*Recipient_Self)(nil), - (*Recipient_ReleaseNotes)(nil), - (*Recipient_CallLink)(nil), - } - file_backuppb_Backup_proto_msgTypes[4].OneofWrappers = []any{ - (*Contact_Registered_)(nil), - (*Contact_NotRegistered_)(nil), - } - file_backuppb_Backup_proto_msgTypes[5].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[6].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[8].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[9].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[11].OneofWrappers = []any{ - (*DistributionListItem_DeletionTimestamp)(nil), - (*DistributionListItem_DistributionList)(nil), - } - file_backuppb_Backup_proto_msgTypes[13].OneofWrappers = []any{ - (*ChatItem_Incoming)(nil), - (*ChatItem_Outgoing)(nil), - (*ChatItem_Directionless)(nil), - (*ChatItem_StandardMessage)(nil), - (*ChatItem_ContactMessage)(nil), - (*ChatItem_StickerMessage)(nil), - (*ChatItem_RemoteDeletedMessage)(nil), - (*ChatItem_UpdateMessage)(nil), - (*ChatItem_PaymentNotification)(nil), - (*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), - (*SendStatus_Sent_)(nil), - (*SendStatus_Delivered_)(nil), - (*SendStatus_Read_)(nil), - (*SendStatus_Viewed_)(nil), - (*SendStatus_Skipped_)(nil), - (*SendStatus_Failed_)(nil), - } - file_backuppb_Backup_proto_msgTypes[16].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[18].OneofWrappers = []any{ - (*DirectStoryReplyMessage_TextReply_)(nil), - (*DirectStoryReplyMessage_Emoji)(nil), - } - file_backuppb_Backup_proto_msgTypes[19].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[22].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[25].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[26].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[27].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[28].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[29].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[30].OneofWrappers = []any{ - (*BodyRange_MentionAci)(nil), - (*BodyRange_Style_)(nil), - } - file_backuppb_Backup_proto_msgTypes[34].OneofWrappers = []any{ - (*ChatUpdateMessage_SimpleUpdate)(nil), - (*ChatUpdateMessage_GroupChange)(nil), - (*ChatUpdateMessage_ExpirationTimerChange)(nil), - (*ChatUpdateMessage_ProfileChange)(nil), - (*ChatUpdateMessage_ThreadMerge)(nil), - (*ChatUpdateMessage_SessionSwitchover)(nil), - (*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{ - (*LearnedProfileChatUpdate_E164)(nil), - (*LearnedProfileChatUpdate_Username)(nil), - } - file_backuppb_Backup_proto_msgTypes[44].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[45].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[46].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[47].OneofWrappers = []any{} - 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[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[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{ - (*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{ - (*AccountData_IAPSubscriberData_PurchaseToken)(nil), - (*AccountData_IAPSubscriberData_OriginalTransactionId)(nil), - } - file_backuppb_Backup_proto_msgTypes[96].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[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{ - (*FilePointer_LocatorInfo_PlaintextHash)(nil), - (*FilePointer_LocatorInfo_EncryptedDigest)(nil), - } - file_backuppb_Backup_proto_msgTypes[123].OneofWrappers = []any{} - file_backuppb_Backup_proto_msgTypes[126].OneofWrappers = []any{ - (*GroupChangeChatUpdate_Update_GenericGroupUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupCreationUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupNameUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupAvatarUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupDescriptionUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupMembershipAccessLevelChangeUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupAttributesAccessLevelChangeUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupAnnouncementOnlyChangeUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupAdminStatusUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupMemberLeftUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupMemberRemovedUpdate)(nil), - (*GroupChangeChatUpdate_Update_SelfInvitedToGroupUpdate)(nil), - (*GroupChangeChatUpdate_Update_SelfInvitedOtherUserToGroupUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupUnknownInviteeUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupInvitationAcceptedUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupInvitationDeclinedUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupMemberJoinedUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupMemberAddedUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupSelfInvitationRevokedUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupInvitationRevokedUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupJoinRequestUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupJoinRequestApprovalUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupJoinRequestCanceledUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupInviteLinkResetUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupInviteLinkEnabledUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupInviteLinkAdminApprovalUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupInviteLinkDisabledUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupMemberJoinedByLinkUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupV2MigrationUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupV2MigrationSelfInvitedUpdate)(nil), - (*GroupChangeChatUpdate_Update_GroupV2MigrationInvitedMembersUpdate)(nil), - (*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{ - (*ChatStyle_CustomChatColor_Solid)(nil), - (*ChatStyle_CustomChatColor_Gradient)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - 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: 37, - NumMessages: 131, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_backuppb_Backup_proto_goTypes, - DependencyIndexes: file_backuppb_Backup_proto_depIdxs, - EnumInfos: file_backuppb_Backup_proto_enumTypes, - MessageInfos: file_backuppb_Backup_proto_msgTypes, - }.Build() - File_backuppb_Backup_proto = out.File - file_backuppb_Backup_proto_goTypes = nil - file_backuppb_Backup_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/backuppb/Backup.proto b/pkg/signalmeow/protobuf/backuppb/Backup.proto deleted file mode 100644 index 32b3ac3..0000000 --- a/pkg/signalmeow/protobuf/backuppb/Backup.proto +++ /dev/null @@ -1,1474 +0,0 @@ -syntax = "proto3"; - -package signal.backup; - -option java_package = "org.signal.archive.proto"; -option swift_prefix = "BackupProto_"; - -message BackupInfo { - uint64 version = 1; - uint64 backupTimeMs = 2; - bytes mediaRootBackupKey = 3; // 32-byte random value generated when the backup is uploaded for the first time. - string currentAppVersion = 4; - string firstAppVersion = 5; - bytes debugInfo = 6; // Client-specific data field for debug info during testing -} - -// Frames must follow in the following ordering rules: -// -// 1. There is exactly one AccountData and it is the first frame. -// 2. A frame referenced by ID must come before the referencing frame. -// e.g. a Recipient must come before any Chat referencing it. -// 3. All ChatItems must appear in global Chat rendering order. -// (The order in which they were received by the client.) -// 4. ChatFolders must appear in render order (e.g., left to right for -// LTR locales), but can appear anywhere relative to other frames respecting -// rule 2 (after Recipients and Chats). -// -// Recipients, Chats, StickerPacks, AdHocCalls, and NotificationProfiles -// can be in any order. (But must respect rule 2.) -// -// For example, Chats may all be together at the beginning, -// or may each immediately precede its first ChatItem. -message Frame { - // If unset, importers should skip this frame without throwing an error. - oneof item { - AccountData account = 1; - Recipient recipient = 2; - Chat chat = 3; - ChatItem chatItem = 4; - StickerPack stickerPack = 5; - AdHocCall adHocCall = 6; - NotificationProfile notificationProfile = 7; - ChatFolder chatFolder = 8; - } -} - -message AccountData { - enum PhoneNumberSharingMode { - UNKNOWN = 0; // Interpret as "Nobody" - EVERYBODY = 1; - NOBODY = 2; - } - message UsernameLink { - enum Color { - UNKNOWN = 0; // Interpret as "Blue" - BLUE = 1; - WHITE = 2; - GREY = 3; - OLIVE = 4; - GREEN = 5; - ORANGE = 6; - PINK = 7; - PURPLE = 8; - } - - bytes entropy = 1; // 32 bytes of entropy used for encryption - bytes serverId = 2; // 16 bytes of encoded UUID provided by the server - 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 { - enum UnreadBadgeType { - UNKNOWN_BADGE_TYPE = 0; // Interpret as "Unread messages" - UNREAD_MESSAGES = 1; - UNREAD_CHATS = 2; - } - - bool readReceipts = 1; - bool sealedSenderIndicators = 2; - bool typingIndicators = 3; - bool linkPreviews = 4; - bool notDiscoverableByPhoneNumber = 5; - bool preferContactAvatars = 6; - uint32 universalExpireTimerSeconds = 7; // 0 means no universal expire timer. - repeated string preferredReactionEmoji = 8; - bool displayBadgesOnProfile = 9; - bool keepMutedChatsArchived = 10; - bool hasSetMyStoriesPrivacy = 11; - bool hasViewedOnboardingStory = 12; - bool storiesDisabled = 13; - optional bool storyViewReceiptsEnabled = 14; - bool hasSeenGroupStoryEducationSheet = 15; - bool hasCompletedUsernameOnboarding = 16; - PhoneNumberSharingMode phoneNumberSharingMode = 17; - ChatStyle defaultChatStyle = 18; - repeated ChatStyle.CustomChatColor customChatColors = 19; - 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; - UnreadBadgeType unreadBadgeType = 33; // Only used in ios/desktop - optional bool includeMutedChatsInBadge = 34; // Only used in ios/desktop. If unset, consider this disabled - optional bool reactionNotifications = 35; // If unset, consider this enabled - optional bool notifyForCallsIfMuted = 36; // If unset, consider this disabled - optional bool notifyForMentionsIfMuted = 37; // If unset, consider this enabled - optional bool notifyForRepliesIfMuted = 38; // If unset, consider this enabled - optional bool showUnreadReminders = 39; // If unset, consider this enabled - optional bool notifyWhenContactJoins = 40; // If unset, consider this disabled - } - - message SubscriberData { - bytes subscriberId = 1; - string currencyCode = 2; - bool manuallyCancelled = 3; - } - - message IAPSubscriberData { - bytes subscriberId = 1; - - // If unset, importers should ignore the subscriber data without throwing an error. - oneof iapSubscriptionId { - // Identifies an Android Play Store IAP subscription. - string purchaseToken = 2; - // Identifies an iOS App Store IAP subscription. - uint64 originalTransactionId = 3; - } - } - - 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; - string givenName = 4; - string familyName = 5; - string avatarUrlPath = 6; - SubscriberData donationSubscriberData = 7; - reserved /*backupsSubscriberData*/ 8; // A deprecated format - AccountSettings accountSettings = 9; - IAPSubscriberData backupsSubscriberData = 10; - string svrPin = 11; - AndroidSpecificSettings androidSpecificSettings = 12; - string bioText = 13; - string bioEmoji = 14; - reserved /*keyTransparencyData*/ 15; // No longer want to persist self-KT data -} - -message Recipient { - uint64 id = 1; // generated id for reference only within this file - // If unset, importers should skip this frame without throwing an error. - oneof destination { - Contact contact = 2; - Group group = 3; - DistributionListItem distributionList = 4; - Self self = 5; - ReleaseNotes releaseNotes = 6; - CallLink callLink = 7; - } -} - -// If unset - computed as the value of the first byte of SHA-256(msg=CONTACT_ID) -// modulo the count of colors. Once set the avatar color for a recipient is -// never recomputed or changed. -// -// `CONTACT_ID` is the first available identifier from the list: -// - ServiceIdToBinary(ACI) -// - E164 -// - ServiceIdToBinary(PNI) -// - Group Id -enum AvatarColor { - A100 = 0; - A110 = 1; - A120 = 2; - A130 = 3; - A140 = 4; - A150 = 5; - A160 = 6; - A170 = 7; - A180 = 8; - A190 = 9; - A200 = 10; - A210 = 11; -} - -message Contact { - enum IdentityState { - DEFAULT = 0; // A valid value -- indicates unset by the user - VERIFIED = 1; - UNVERIFIED = 2; // Was once verified and is now unverified - } - - message Registered {} - message NotRegistered { - uint64 unregisteredTimestamp = 1; - } - - enum Visibility { - VISIBLE = 0; // A valid value -- the contact is not hidden - HIDDEN = 1; - HIDDEN_MESSAGE_REQUEST = 2; - } - - message Name { - string given = 1; - string family = 2; - } - - optional bytes aci = 1; // should be 16 bytes - optional bytes pni = 2; // should be 16 bytes - optional string username = 3; - optional uint64 e164 = 4; - bool blocked = 5; - Visibility visibility = 6; - - // If unset, consider the user to be registered - oneof registration { - Registered registered = 7; - NotRegistered notRegistered = 8; - } - - optional bytes profileKey = 9; - bool profileSharing = 10; - optional string profileGivenName = 11; - optional string profileFamilyName = 12; - bool hideStory = 13; - optional bytes identityKey = 14; - IdentityState identityState = 15; - Name nickname = 16; // absent iff both `given` and `family` are empty - string note = 17; - string systemGivenName = 18; - string systemFamilyName = 19; - string systemNickname = 20; - optional AvatarColor avatarColor = 21; - optional bytes keyTransparencyData = 22; - uint64 blockedAtTimestamp = 23; // if `blocked` is true, 0 means unknown block time -} - -message Group { - enum StorySendMode { - DEFAULT = 0; // A valid value -- indicates unset by the user - DISABLED = 1; - ENABLED = 2; - } - - bytes masterKey = 1; - bool whitelisted = 2; - bool hideStory = 3; - StorySendMode storySendMode = 4; - GroupSnapshot snapshot = 5; - bool blocked = 6; - optional AvatarColor avatarColor = 7; - uint64 blockedAtTimestamp = 8; // if `blocked` is true, 0 means unknown block time - - // These are simply plaintext copies of the groups proto from Groups.proto. - // They should be kept completely in-sync with Groups.proto. - // These exist to allow us to have the latest snapshot of a group during restoration without having to hit the network. - // We would use Groups.proto if we could, but we want a plaintext version to improve export readability. - // For documentation, defer to Groups.proto. The only name change is Group -> GroupSnapshot to avoid the naming conflict. - message GroupSnapshot { - reserved /*publicKey*/ 1; // The field is deprecated in the context of static group state - GroupAttributeBlob title = 2; - GroupAttributeBlob description = 11; - string avatarUrl = 3; - GroupAttributeBlob 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; - } - - message GroupAttributeBlob { - // If unset, consider the field it represents to not be present - oneof content { - string title = 1; - bytes avatar = 2; - uint32 disappearingMessagesDuration = 3; - string descriptionText = 4; - } - } - - message Member { - enum Role { - UNKNOWN = 0; // Intepret as "Default" - DEFAULT = 1; - ADMINISTRATOR = 2; - } - - bytes userId = 1; - Role role = 2; - 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 { - Member member = 1; - bytes addedByUserId = 2; - uint64 timestamp = 3; - } - - message MemberPendingAdminApproval { - bytes userId = 1; - reserved /*profileKey*/ 2; // This field is ignored in Backups, in favor of Contact frames for members - reserved /*presentation*/ 3; // This field is deprecated in the context of static group state - uint64 timestamp = 4; - } - - message MemberBanned { - bytes userId = 1; - uint64 timestamp = 2; - } - - message AccessControl { - enum AccessRequired { - UNKNOWN = 0; // Intepret as "Unsatisfiable" - ANY = 1; - MEMBER = 2; - ADMINISTRATOR = 3; - UNSATISFIABLE = 4; - } - - AccessRequired attributes = 1; - AccessRequired members = 2; - AccessRequired addFromInviteLink = 3; - AccessRequired memberLabel = 4; - } -} - -message Self { - optional AvatarColor avatarColor = 1; -} - -message ReleaseNotes {} - -message Chat { - uint64 id = 1; // generated id for reference only within this file - uint64 recipientId = 2; - bool archived = 3; - optional uint32 pinnedOrder = 4; // will be displayed in ascending order - optional uint64 expirationTimerMs = 5; - optional uint64 muteUntilMs = 6; // INT64_MAX (2^63 - 1) = "always muted". - bool markedUnread = 7; - bool dontNotifyForMentionsIfMuted = 8; // will be deprecated in favor of [notifyForMentionsIfMuted] - ChatStyle style = 9; - uint32 expireTimerVersion = 10; - optional bool notifyForCallsIfMuted = 11; // If unset, use default global settings - optional bool notifyForMentionsIfMuted = 12; // If unset, use default global settings. Only for groups. If [dontNotifyForMentionsIfMuted] is true, this should be initialized to false. - optional bool notifyForRepliesIfMuted = 13; // If unset, use default global settings. Only for groups. - optional bool showUnreadReminders = 14; // If unset, use default global settings -} - -/** - * Call Links have some associated data including a call, but unlike other recipients - * are not tied to threads because they do not have messages associated with them. - * - * note: - * - room id can be derived from the root key - * - the presence of an admin key means this user is a call admin - */ -message CallLink { - enum Restrictions { - UNKNOWN = 0; // Interpret as "Admin Approval" - NONE = 1; - ADMIN_APPROVAL = 2; - } - - bytes rootKey = 1; - optional bytes adminKey = 2; // Only present if the user is an admin - string name = 3; - Restrictions restrictions = 4; - uint64 expirationMs = 5; - reserved /*epoch*/ 6; -} - -message AdHocCall { - enum State { - UNKNOWN_STATE = 0; // Interpret as "Generic" - GENERIC = 1; - } - - uint64 callId = 1; - // Refers to a `CallLink` recipient. - uint64 recipientId = 2; - State state = 3; - uint64 callTimestamp = 4; -} - -message DistributionListItem { - // distribution ids are UUIDv4s. "My Story" is represented - // by an all-0 UUID (00000000-0000-0000-0000-000000000000). - bytes distributionId = 1; // distribution list ids are uuids - - // If unset, importers should skip the item entirely without showing an error. - oneof item { - uint64 deletionTimestamp = 2; - DistributionList distributionList = 3; - } -} - -message DistributionList { - enum PrivacyMode { - UNKNOWN = 0; // Interpret as "Only with" - ONLY_WITH = 1; - ALL_EXCEPT = 2; - ALL = 3; - } - - string name = 1; - bool allowReplies = 2; - PrivacyMode privacyMode = 3; - repeated uint64 memberRecipientIds = 4; // generated recipient id -} - -message ChatItem { - message IncomingMessageDetails { - uint64 dateReceived = 1; - optional uint64 dateServerSent = 2; - bool read = 3; - bool sealedSender = 4; - } - - message OutgoingMessageDetails { - repeated SendStatus sendStatus = 1; - uint64 dateReceived = 2; // may be different from dateSent for sync messages - } - - 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; - optional uint64 expireStartDate = 4; // timestamp of when expiration timer started ticking down - optional uint64 expiresInMs = 5; // how long timer of message is (ms) - repeated ChatItem revisions = 6; // ordered from oldest to newest - bool sms = 7; - - // If unset, importers should skip this item without throwing an error. - oneof directionalDetails { - IncomingMessageDetails incoming = 8; - OutgoingMessageDetails outgoing = 9; - DirectionlessMessageDetails directionless = 10; - } - - // If unset, importers should skip this item without throwing an error. - oneof item { - StandardMessage standardMessage = 11; - ContactMessage contactMessage = 12; - StickerMessage stickerMessage = 13; - RemoteDeletedMessage remoteDeletedMessage = 14; - ChatUpdateMessage updateMessage = 15; - PaymentNotification paymentNotification = 16; - 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 { - message Pending {} - - message Sent { - bool sealedSender = 1; - } - - message Delivered { - bool sealedSender = 1; - } - - message Read { - bool sealedSender = 1; - } - - message Viewed { - bool sealedSender = 1; - } - - // e.g. user in group was blocked, so we skipped sending to them - message Skipped {} - - message Failed { - enum FailureReason { - UNKNOWN = 0; // A valid value -- could indicate a crash or lack of information - NETWORK = 1; - IDENTITY_KEY_MISMATCH = 2; - } - - FailureReason reason = 1; - } - - uint64 recipientId = 1; - uint64 timestamp = 2; // the time the status was last updated -- if from a receipt, it should be the sentTime of the receipt - - // If unset, importers should consider the status to be "pending" - oneof deliveryStatus { - Pending pending = 3; - Sent sent = 4; - Delivered delivered = 5; - Read read = 6; - Viewed viewed = 7; - Skipped skipped = 8; - Failed failed = 9; - } -} - -message Text { - string body = 1; - repeated BodyRange bodyRanges = 2; -} - -message StandardMessage { - optional Quote quote = 1; - optional Text text = 2; - repeated MessageAttachment attachments = 3; - repeated LinkPreview linkPreview = 4; - optional FilePointer longText = 5; - repeated Reaction reactions = 6; -} - -message ContactMessage { - ContactAttachment contact = 1; - repeated Reaction reactions = 2; -} - -message DirectStoryReplyMessage { - message TextReply { - Text text = 1; - FilePointer longText = 2; - } - - // If unset, importers should ignore the message without throwing an error. - oneof reply { - TextReply textReply = 1; - string emoji = 2; - } - - repeated Reaction reactions = 3; - reserved /*storySentTimestamp*/ 4; -} - -message PaymentNotification { - message TransactionDetails { - message MobileCoinTxoIdentification { // Used to map to payments on the ledger - repeated bytes publicKey = 1; // for received transactions - repeated bytes keyImages = 2; // for sent transactions - } - - message FailedTransaction { // Failed payments can't be synced from the ledger - enum FailureReason { - GENERIC = 0; // A valid value -- reason unknown - NETWORK = 1; - INSUFFICIENT_FUNDS = 2; - } - FailureReason reason = 1; - } - - message Transaction { - enum Status { - INITIAL = 0; // A valid value -- state unconfirmed - SUBMITTED = 1; - SUCCESSFUL = 2; - } - Status status = 1; - - // This identification is used to map the payment table to the ledger - // and is likely required otherwise we may have issues reconciling with - // the ledger - MobileCoinTxoIdentification mobileCoinIdentification = 2; - optional uint64 timestamp = 3; - optional uint64 blockIndex = 4; - optional uint64 blockTimestamp = 5; - optional bytes transaction = 6; // mobile coin blobs - optional bytes receipt = 7; // mobile coin blobs - } - - // If unset, importers should treat the transaction as successful with no metadata. - oneof payment { - Transaction transaction = 1; - FailedTransaction failedTransaction = 2; - } - } - - optional string amountMob = 1; // stored as a decimal string, e.g. 1.00001 - optional string feeMob = 2; // stored as a decimal string, e.g. 1.00001 - optional string note = 3; - TransactionDetails transactionDetails = 4; -} - -message GiftBadge { - enum State { - UNOPENED = 0; // A valid state - OPENED = 1; - REDEEMED = 2; - FAILED = 3; - } - - bytes receiptCredentialPresentation = 1; - State state = 2; -} - -message ViewOnceMessage { - // Will be null for viewed messages - MessageAttachment attachment = 1; - repeated Reaction reactions = 2; -} - -message ContactAttachment { - message Name { - string givenName = 1; - string familyName = 2; - string prefix = 3; - string suffix = 4; - string middleName = 5; - string nickname = 6; - } - - message Phone { - enum Type { - UNKNOWN = 0; // Interpret as "Home" - HOME = 1; - MOBILE = 2; - WORK = 3; - CUSTOM = 4; - } - - string value = 1; - Type type = 2; - string label = 3; - } - - message Email { - enum Type { - UNKNOWN = 0; // Intepret as "Home" - HOME = 1; - MOBILE = 2; - WORK = 3; - CUSTOM = 4; - } - - string value = 1; - Type type = 2; - string label = 3; - } - - message PostalAddress { - enum Type { - UNKNOWN = 0; // Interpret as "Home" - HOME = 1; - WORK = 2; - CUSTOM = 3; - } - - Type type = 1; - string label = 2; - string street = 3; - string pobox = 4; - string neighborhood = 5; - string city = 6; - string region = 7; - string postcode = 8; - string country = 9; - } - - optional Name name = 1; - repeated Phone number = 3; - repeated Email email = 4; - repeated PostalAddress address = 5; - optional FilePointer avatar = 6; - string organization = 7; -} - -message StickerMessage { - Sticker sticker = 1; - repeated Reaction reactions = 2; -} - -// Tombstone for remote delete -message RemoteDeletedMessage {} - -message Sticker { - bytes packId = 1; - bytes packKey = 2; - uint32 stickerId = 3; - optional string emoji = 4; - // Stickers are uploaded to be sent as attachments; we also - // back them up as normal attachments when they are in messages. - // DO NOT treat this as the definitive source of a sticker in - // an installed StickerPack that shares the same packId. - FilePointer data = 5; -} - -message LinkPreview { - string url = 1; - optional string title = 2; - optional FilePointer image = 3; - optional string description = 4; - optional uint64 date = 5; -} - -// A FilePointer on a message that has additional -// metadata that applies only to message attachments. -message MessageAttachment { - // Similar to SignalService.AttachmentPointer.Flags, - // but explicitly mutually exclusive. Note the different raw values - // (non-zero starting values are not supported in proto3.) - enum Flag { - NONE = 0; // A valid value -- no flag applied - VOICE_MESSAGE = 1; - BORDERLESS = 2; - GIF = 3; - } - - FilePointer pointer = 1; - Flag flag = 2; - bool wasDownloaded = 3; - // Cross-client identifier for this attachment among all attachments on the - // owning message. See: SignalService.AttachmentPointer.clientUuid. - optional bytes clientUuid = 4; -} - -message FilePointer { - message LocatorInfo { - // Must be non-empty if transitCdnKey or plaintextHash are set/nonempty. - // Otherwise must be empty. - bytes key = 1; - - reserved /*legacyDigest*/ 2; - - oneof integrityCheck { - // Set if file was at one point downloaded and its plaintextHash was calculated - bytes plaintextHash = 10; - - // Set if file has not been downloaded so its integrity has not been verified - // From the sender of the attachment - bytes encryptedDigest = 11; - } - - // NB: This is the plaintext size, and empty content attachments are legal, so this - // may be zero even if transitCdnKey or mediaName are set/nonempty. - uint32 size = 3; - - // Either both transit cdn key and number are set or neither should be set. - // Upload timestamp is optional but should only be set if key/number are set. - optional string transitCdnKey = 4; - optional uint32 transitCdnNumber = 5; - optional uint64 transitTierUploadTimestamp = 6; - - // If present, the cdn number of the succesful upload to media tier. - // If unset, may still have been uploaded, and clients - // can discover the cdn number via the list endpoint. - // Exporting clients should set this as long as their subscription - // has not rotated since last upload; even if currently free tier. - optional uint32 mediaTierCdnNumber = 7; - - reserved /*legacyMediaName*/ 8; - - // Separate key used to encrypt this file for the local backup. - // Generally required for local backups. - // Missing field indicates attachment was not available locally - // when the backup was generated, but remote backup or transit - // info was available. - optional bytes localKey = 9; - } - - reserved /*backupLocator*/ 1; - reserved /*attachmentLocator*/ 2; - reserved /*invalidAttachmentLocator*/ 3; - reserved /*localLocator*/ 12; - - optional string contentType = 4; - optional bytes incrementalMac = 5; - optional uint32 incrementalMacChunkSize = 6; - optional string fileName = 7; - optional uint32 width = 8; - optional uint32 height = 9; - optional string caption = 10; - optional string blurHash = 11; - LocatorInfo locatorInfo = 13; -} - -message Quote { - enum Type { - UNKNOWN = 0; // Interpret as "Normal" - NORMAL = 1; - GIFT_BADGE = 2; - VIEW_ONCE = 3; - POLL = 4; - } - - message QuotedAttachment { - optional string contentType = 1; - optional string fileName = 2; - optional MessageAttachment thumbnail = 3; - } - - optional uint64 targetSentTimestamp = 1; // null if the target message could not be found at time of quote insert - uint64 authorId = 2; - optional Text text = 3; - repeated QuotedAttachment attachments = 4; - Type type = 5; -} - -message BodyRange { - enum Style { - NONE = 0; // Importers should ignore the body range without throwing an error. - BOLD = 1; - ITALIC = 2; - SPOILER = 3; - STRIKETHROUGH = 4; - MONOSPACE = 5; - } - - // 'start' and 'length' are measured in UTF-16 code units. - // They may refer to offsets in a longText attachment. - uint32 start = 1; - uint32 length = 2; - - // If unset, importers should ignore the body range without throwing an error. - oneof associatedValue { - bytes mentionAci = 3; - Style style = 4; - } -} - -message Reaction { - string emoji = 1; - uint64 authorId = 2; - uint64 sentTimestamp = 3; - // A higher sort order means that a reaction is more recent. Some clients may export this as - // incrementing numbers (e.g. 1, 2, 3), others as timestamps. - 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 { - SimpleChatUpdate simpleUpdate = 1; - GroupChangeChatUpdate groupChange = 2; - ExpirationTimerChatUpdate expirationTimerChange = 3; - ProfileChangeChatUpdate profileChange = 4; - ThreadMergeChatUpdate threadMerge = 5; - SessionSwitchoverChatUpdate sessionSwitchover = 6; - IndividualCall individualCall = 7; - GroupCall groupCall = 8; - LearnedProfileChatUpdate learnedProfileChange = 9; - PollTerminateUpdate pollTerminate = 10; - PinMessageUpdate pinMessage = 11; - } -} - -message IndividualCall { - enum Type { - UNKNOWN_TYPE = 0; // Interpret as "Audio call" - AUDIO_CALL = 1; - VIDEO_CALL = 2; - } - - enum Direction { - UNKNOWN_DIRECTION = 0; // Interpret as "Incoming" - INCOMING = 1; - OUTGOING = 2; - } - - enum State { - UNKNOWN_STATE = 0; // Interpret as "Accepted" - ACCEPTED = 1; - NOT_ACCEPTED = 2; - // An incoming call that is no longer ongoing, which we neither accepted - // not actively declined. For example, it expired, was canceled by the - // sender, or was rejected due to being in another call. - MISSED = 3; - // We auto-declined an incoming call due to a notification profile. - MISSED_NOTIFICATION_PROFILE = 4; - } - - optional uint64 callId = 1; - Type type = 2; - Direction direction = 3; - State state = 4; - uint64 startedCallTimestamp = 5; - bool read = 6; -} - -message GroupCall { - enum State { - UNKNOWN_STATE = 0; // Interpret as "Generic" - // A group call was started without ringing. - GENERIC = 1; - // We joined a group call that was started without ringing. - JOINED = 2; - // An incoming group call is actively ringing. - RINGING = 3; - // We accepted an incoming group ring. - ACCEPTED = 4; - // We declined an incoming group ring. - DECLINED = 5; - // We missed an incoming group ring, for example because it expired. - MISSED = 6; - // We auto-declined an incoming group ring due to a notification profile. - MISSED_NOTIFICATION_PROFILE = 7; - // An outgoing ring was started. We don't track any state for outgoing rings - // beyond that they started. - OUTGOING_RING = 8; - } - - optional uint64 callId = 1; - State state = 2; - optional uint64 ringerRecipientId = 3; - optional uint64 startedCallRecipientId = 4; - uint64 startedCallTimestamp = 5; - optional uint64 endedCallTimestamp = 6; // The time the call ended. - bool read = 7; -} - -message SimpleChatUpdate { - enum Type { - UNKNOWN = 0; // Importers should skip the update without throwing an error. - JOINED_SIGNAL = 1; - IDENTITY_UPDATE = 2; - IDENTITY_VERIFIED = 3; - IDENTITY_DEFAULT = 4; // marking as unverified - CHANGE_NUMBER = 5; - RELEASE_CHANNEL_DONATION_REQUEST = 6; - END_SESSION = 7; - CHAT_SESSION_REFRESH = 8; - BAD_DECRYPT = 9; - PAYMENTS_ACTIVATED = 10; - PAYMENT_ACTIVATION_REQUEST = 11; - UNSUPPORTED_PROTOCOL_MESSAGE = 12; - REPORTED_SPAM = 13; - BLOCKED = 14; - UNBLOCKED = 15; - MESSAGE_REQUEST_ACCEPTED = 16; - } - - Type type = 1; -} - -// For 1:1 chat updates only. -// For group thread updates use GroupExpirationTimerUpdate. -message ExpirationTimerChatUpdate { - uint64 expiresInMs = 1; // 0 means the expiration timer was disabled -} - -message ProfileChangeChatUpdate { - string previousName = 1; - string newName = 2; -} - -message LearnedProfileChatUpdate { - // If unset, importers should consider the previous name to be an empty string. - oneof previousName { - uint64 e164 = 1; - string username = 2; - } -} - -message ThreadMergeChatUpdate { - uint64 previousE164 = 1; -} - -message SessionSwitchoverChatUpdate { - uint64 e164 = 1; -} - -message GroupChangeChatUpdate { - message Update { - // If unset, importers should consider it to be a GenericGroupUpdate with unset updaterAci - oneof update { - GenericGroupUpdate genericGroupUpdate = 1; - GroupCreationUpdate groupCreationUpdate = 2; - GroupNameUpdate groupNameUpdate = 3; - GroupAvatarUpdate groupAvatarUpdate = 4; - GroupDescriptionUpdate groupDescriptionUpdate = 5; - GroupMembershipAccessLevelChangeUpdate groupMembershipAccessLevelChangeUpdate = 6; - GroupAttributesAccessLevelChangeUpdate groupAttributesAccessLevelChangeUpdate = 7; - GroupAnnouncementOnlyChangeUpdate groupAnnouncementOnlyChangeUpdate = 8; - GroupAdminStatusUpdate groupAdminStatusUpdate = 9; - GroupMemberLeftUpdate groupMemberLeftUpdate = 10; - GroupMemberRemovedUpdate groupMemberRemovedUpdate = 11; - SelfInvitedToGroupUpdate selfInvitedToGroupUpdate = 12; - SelfInvitedOtherUserToGroupUpdate selfInvitedOtherUserToGroupUpdate = 13; - GroupUnknownInviteeUpdate groupUnknownInviteeUpdate = 14; - GroupInvitationAcceptedUpdate groupInvitationAcceptedUpdate = 15; - GroupInvitationDeclinedUpdate groupInvitationDeclinedUpdate = 16; - GroupMemberJoinedUpdate groupMemberJoinedUpdate = 17; - GroupMemberAddedUpdate groupMemberAddedUpdate = 18; - GroupSelfInvitationRevokedUpdate groupSelfInvitationRevokedUpdate = 19; - GroupInvitationRevokedUpdate groupInvitationRevokedUpdate = 20; - GroupJoinRequestUpdate groupJoinRequestUpdate = 21; - GroupJoinRequestApprovalUpdate groupJoinRequestApprovalUpdate = 22; - GroupJoinRequestCanceledUpdate groupJoinRequestCanceledUpdate = 23; - GroupInviteLinkResetUpdate groupInviteLinkResetUpdate = 24; - GroupInviteLinkEnabledUpdate groupInviteLinkEnabledUpdate = 25; - GroupInviteLinkAdminApprovalUpdate groupInviteLinkAdminApprovalUpdate = 26; - GroupInviteLinkDisabledUpdate groupInviteLinkDisabledUpdate = 27; - GroupMemberJoinedByLinkUpdate groupMemberJoinedByLinkUpdate = 28; - GroupV2MigrationUpdate groupV2MigrationUpdate = 29; - GroupV2MigrationSelfInvitedUpdate groupV2MigrationSelfInvitedUpdate = 30; - GroupV2MigrationInvitedMembersUpdate groupV2MigrationInvitedMembersUpdate = 31; - GroupV2MigrationDroppedMembersUpdate groupV2MigrationDroppedMembersUpdate = 32; - GroupSequenceOfRequestsAndCancelsUpdate groupSequenceOfRequestsAndCancelsUpdate = 33; - GroupExpirationTimerUpdate groupExpirationTimerUpdate = 34; - GroupMemberLabelAccessLevelChangeUpdate groupMemberLabelAccessLevelChangeUpdate = 35; - GroupTerminateChangeUpdate groupTerminateChangeUpdate = 36; - } - } - - // Must be one or more; all updates batched together came from - // a single batched group state update. - repeated Update updates = 1; -} - -message GenericGroupUpdate { - optional bytes updaterAci = 1; -} - -message GroupCreationUpdate { - optional bytes updaterAci = 1; -} - -message GroupNameUpdate { - optional bytes updaterAci = 1; - // Null value means the group name was removed. - optional string newGroupName = 2; -} - -message GroupAvatarUpdate { - optional bytes updaterAci = 1; - bool wasRemoved = 2; -} - -message GroupDescriptionUpdate { - optional bytes updaterAci = 1; - // Null value means the group description was removed. - optional string newDescription = 2; -} - -enum GroupV2AccessLevel { - UNKNOWN = 0; // Interpret as "Unsatisfiable" - ANY = 1; - MEMBER = 2; - ADMINISTRATOR = 3; - UNSATISFIABLE = 4; -} - -message GroupMembershipAccessLevelChangeUpdate { - optional bytes updaterAci = 1; - GroupV2AccessLevel accessLevel = 2; -} - -message GroupAttributesAccessLevelChangeUpdate { - optional bytes updaterAci = 1; - 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; -} - -message GroupAdminStatusUpdate { - optional bytes updaterAci = 1; - // The aci who had admin status granted or revoked. - bytes memberAci = 2; - bool wasAdminStatusGranted = 3; -} - -message GroupMemberLeftUpdate { - bytes aci = 1; -} - -message GroupMemberRemovedUpdate { - optional bytes removerAci = 1; - bytes removedAci = 2; -} - -message SelfInvitedToGroupUpdate { - optional bytes inviterAci = 1; -} - -message SelfInvitedOtherUserToGroupUpdate { - // If no invitee id available, use GroupUnknownInviteeUpdate - bytes inviteeServiceId = 1; -} - -message GroupUnknownInviteeUpdate { - // Can be the self user. - optional bytes inviterAci = 1; - uint32 inviteeCount = 2; -} - -message GroupInvitationAcceptedUpdate { - optional bytes inviterAci = 1; - bytes newMemberAci = 2; -} - -message GroupInvitationDeclinedUpdate { - optional bytes inviterAci = 1; - // Note: if invited by pni, just set inviteeAci to nil. - optional bytes inviteeAci = 2; -} - -message GroupMemberJoinedUpdate { - bytes newMemberAci = 1; -} - -message GroupMemberAddedUpdate { - optional bytes updaterAci = 1; - bytes newMemberAci = 2; - bool hadOpenInvitation = 3; - // If hadOpenInvitation is true, optionally include aci of the inviter. - optional bytes inviterAci = 4; -} - -// An invitation to self was revoked. -message GroupSelfInvitationRevokedUpdate { - optional bytes revokerAci = 1; -} - -// These invitees should never be the local user. -// Use GroupSelfInvitationRevokedUpdate in those cases. -// The inviter or updater can be the local user. -message GroupInvitationRevokedUpdate { - message Invitee { - optional bytes inviterAci = 1; - // Prefer to use aci over pni. No need to set - // pni if aci is set. Both can be missing. - optional bytes inviteeAci = 2; - optional bytes inviteePni = 3; - } - - // The member that revoked the invite(s), not the inviter! - // Assumed to be an admin (at the time, may no longer be an - // admin or even a member). - optional bytes updaterAci = 1; - repeated Invitee invitees = 2; -} - -message GroupJoinRequestUpdate { - bytes requestorAci = 1; -} - -message GroupJoinRequestApprovalUpdate { - bytes requestorAci = 1; - // The aci that approved or rejected the request. - optional bytes updaterAci = 2; - bool wasApproved = 3; -} - -message GroupJoinRequestCanceledUpdate { - bytes requestorAci = 1; -} - -// A single requestor has requested to join and cancelled -// their request repeatedly with no other updates in between. -// The last action encompassed by this update is always a -// cancellation; if there was another open request immediately -// after, it will be a separate GroupJoinRequestUpdate, either -// in the same frame or in a subsequent frame. -message GroupSequenceOfRequestsAndCancelsUpdate { - bytes requestorAci = 1; - uint32 count = 2; -} - -message GroupInviteLinkResetUpdate { - optional bytes updaterAci = 1; -} - -message GroupInviteLinkEnabledUpdate { - optional bytes updaterAci = 1; - bool linkRequiresAdminApproval = 2; -} - -message GroupInviteLinkAdminApprovalUpdate { - optional bytes updaterAci = 1; - bool linkRequiresAdminApproval = 2; -} - -message GroupInviteLinkDisabledUpdate { - optional bytes updaterAci = 1; -} - -message GroupMemberJoinedByLinkUpdate { - bytes newMemberAci = 1; -} - -// A gv1->gv2 migration occurred. -message GroupV2MigrationUpdate {} - -// Another user migrated gv1->gv2 but was unable to add -// the local user and invited them instead. -message GroupV2MigrationSelfInvitedUpdate {} - -// The local user migrated gv1->gv2 but was unable to -// add some members and invited them instead. -// (Happens if we don't have the invitee's profile key) -message GroupV2MigrationInvitedMembersUpdate { - uint32 invitedMembersCount = 1; -} - -// The local user migrated gv1->gv2 but was unable to -// add or invite some members and dropped them instead. -// (Happens for e164 members where we don't have an aci). -message GroupV2MigrationDroppedMembersUpdate { - uint32 droppedMembersCount = 1; -} - -// For 1:1 timer updates, use ExpirationTimerChatUpdate. -message GroupExpirationTimerUpdate { - uint64 expiresInMs = 1; // 0 means the expiration timer was disabled - 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; -} - -message ChatStyle { - message Gradient { - uint32 angle = 1; // degrees - repeated fixed32 colors = 2; // 0xAARRGGBB - repeated float positions = 3; // percent from 0 to 1 - } - - message CustomChatColor { - uint64 id = 1; - - // If unset, use the default chat color - oneof color { - fixed32 solid = 2; // 0xAARRGGBB - Gradient gradient = 3; - } - } - - message AutomaticBubbleColor { - } - - enum WallpaperPreset { - UNKNOWN_WALLPAPER_PRESET = 0; // Interpret as the wallpaper being unset - SOLID_BLUSH = 1; - SOLID_COPPER = 2; - SOLID_DUST = 3; - SOLID_CELADON = 4; - SOLID_RAINFOREST = 5; - SOLID_PACIFIC = 6; - SOLID_FROST = 7; - SOLID_NAVY = 8; - SOLID_LILAC = 9; - SOLID_PINK = 10; - SOLID_EGGPLANT = 11; - SOLID_SILVER = 12; - GRADIENT_SUNSET = 13; - GRADIENT_NOIR = 14; - GRADIENT_HEATMAP = 15; - GRADIENT_AQUA = 16; - GRADIENT_IRIDESCENT = 17; - GRADIENT_MONSTERA = 18; - GRADIENT_BLISS = 19; - GRADIENT_SKY = 20; - GRADIENT_PEACH = 21; - } - - enum BubbleColorPreset { - UNKNOWN_BUBBLE_COLOR_PRESET = 0; // Interpret as the user's default chat bubble color - SOLID_ULTRAMARINE = 1; - SOLID_CRIMSON = 2; - SOLID_VERMILION = 3; - SOLID_BURLAP = 4; - SOLID_FOREST = 5; - SOLID_WINTERGREEN = 6; - SOLID_TEAL = 7; - SOLID_BLUE = 8; - SOLID_INDIGO = 9; - SOLID_VIOLET = 10; - SOLID_PLUM = 11; - SOLID_TAUPE = 12; - SOLID_STEEL = 13; - GRADIENT_EMBER = 14; - GRADIENT_MIDNIGHT = 15; - GRADIENT_INFRARED = 16; - GRADIENT_LAGOON = 17; - GRADIENT_FLUORESCENT = 18; - GRADIENT_BASIL = 19; - GRADIENT_SUBLIME = 20; - GRADIENT_SEA = 21; - GRADIENT_TANGERINE = 22; - } - - // If unset, importers should consider there to be no wallpaper. - oneof wallpaper { - WallpaperPreset wallpaperPreset = 1; - // This `FilePointer` is expected not to contain a `fileName`, `width`, - // `height`, or `caption`. - FilePointer wallpaperPhoto = 2; - } - - // If unset, importers should consider it to be AutomaticBubbleColor - oneof bubbleColor { - // Bubble setting is automatically determined based on the wallpaper setting, - // or `SOLID_ULTRAMARINE` for `noWallpaper` - AutomaticBubbleColor autoBubbleColor = 3; - BubbleColorPreset bubbleColorPreset = 4; - - // See AccountSettings.customChatColors - uint64 customColorId = 5; - } - - bool dimWallpaperInDarkMode = 7; -} - -message NotificationProfile { - enum DayOfWeek { - UNKNOWN = 0; // Interpret as "Monday" - MONDAY = 1; - TUESDAY = 2; - WEDNESDAY = 3; - THURSDAY = 4; - FRIDAY = 5; - SATURDAY = 6; - SUNDAY = 7; - } - - string name = 1; - optional string emoji = 2; - fixed32 color = 3; // 0xAARRGGBB - uint64 createdAtMs = 4; - bool allowAllCalls = 5; - bool allowAllMentions = 6; - repeated uint64 allowedMembers = 7; // generated recipient id for allowed groups and contacts - bool scheduleEnabled = 8; - uint32 scheduleStartTime = 9; // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - uint32 scheduleEndTime = 10; // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - repeated DayOfWeek scheduleDaysEnabled = 11; - bytes id = 12; // should be 16 bytes -} - -message ChatFolder { - // Represents the default "All chats" folder record vs all other custom folders - enum FolderType { - UNKNOWN = 0; // Interpret as "Custom" - ALL = 1; - CUSTOM = 2; - } - - string name = 1; - bool showOnlyUnread = 2; - bool showMutedChats = 3; - // Folder includes all 1:1 chats, unless excluded - bool includeAllIndividualChats = 4; - // Folder includes all group chats, unless excluded - bool includeAllGroupChats = 5; - FolderType folderType = 6; - repeated uint64 includedRecipientIds = 7; // generated recipient id of groups, contacts, and/or note to self - repeated uint64 excludedRecipientIds = 8; // generated recipient id of groups, contacts, and/or note to self - bytes id = 9; // should be 16 bytes -} diff --git a/pkg/signalmeow/protobuf/build-protos.sh b/pkg/signalmeow/protobuf/build-protos.sh index 5a34136..60b622b 100755 --- a/pkg/signalmeow/protobuf/build-protos.sh +++ b/pkg/signalmeow/protobuf/build-protos.sh @@ -1,18 +1,17 @@ -#!/bin/bash -cd $(dirname "$0") -BASE_IMPORT_PATH="go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" -opts=() -for file in */*.proto; do - opts+=("--go_opt=M${file}=${BASE_IMPORT_PATH}/$(dirname "$file")") - opts+=("--go-grpc_opt=M${file}=${BASE_IMPORT_PATH}/$(dirname "$file")") +#!/usr/bin/env bash + +# This script is used to generate the protobuf files for the project. +# It is assumed that the protoc compiler is installed and available on the path. + +# The script will generate the protobuf files for the following languages: +# - Go + +PKG_IMPORT_PATH="go.mau.fi/mautrix-signal/pkg/signalmeow/signalpb" + +for file in *.proto +do + protoc --go_out=. \ + --go_opt=M${file}=$PKG_IMPORT_PATH \ + --go_opt=paths=source_relative \ + $file done -for file in org/signal/chat/*.proto; do - file_without_ext=$(basename "$file" .proto) - opts+=("--go_opt=M${file}=${BASE_IMPORT_PATH}/rpc/${file_without_ext}") - opts+=("--go-grpc_opt=M${file}=${BASE_IMPORT_PATH}/rpc/${file_without_ext}") -done -protoc --go_out=. --go-grpc_out=. \ - --go_opt=module=$BASE_IMPORT_PATH \ - --go-grpc_opt=module=$BASE_IMPORT_PATH "${opts[@]}" \ - */*.proto org/signal/chat/*.proto -pre-commit run -a diff --git a/pkg/signalmeow/protobuf/cds2pb/cds2.pb.go b/pkg/signalmeow/protobuf/cds2pb/cds2.pb.go deleted file mode 100644 index 2c8634a..0000000 --- a/pkg/signalmeow/protobuf/cds2pb/cds2.pb.go +++ /dev/null @@ -1,259 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: cds2pb/cds2.proto - -package cds2pb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ClientRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Each ACI/UAK pair is a 32-byte buffer, containing the 16-byte ACI followed - // by its 16-byte UAK. - AciUakPairs []byte `protobuf:"bytes,1,opt,name=aci_uak_pairs,json=aciUakPairs,proto3" json:"aci_uak_pairs,omitempty"` - // Each E164 is an 8-byte big-endian number, as 8 bytes. - PrevE164S []byte `protobuf:"bytes,2,opt,name=prev_e164s,json=prevE164s,proto3" json:"prev_e164s,omitempty"` - NewE164S []byte `protobuf:"bytes,3,opt,name=new_e164s,json=newE164s,proto3" json:"new_e164s,omitempty"` - DiscardE164S []byte `protobuf:"bytes,4,opt,name=discard_e164s,json=discardE164s,proto3" json:"discard_e164s,omitempty"` - // If set, a token which allows rate limiting to discount the e164s in - // the request's prev_e164s, only counting new_e164s. If not set, then - // rate limiting considers both prev_e164s' and new_e164s' size. - Token []byte `protobuf:"bytes,6,opt,name=token,proto3" json:"token,omitempty"` - // After receiving a new token from the server, send back a message just - // containing a token_ack. - TokenAck bool `protobuf:"varint,7,opt,name=token_ack,json=tokenAck,proto3" json:"token_ack,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClientRequest) Reset() { - *x = ClientRequest{} - mi := &file_cds2pb_cds2_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClientRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientRequest) ProtoMessage() {} - -func (x *ClientRequest) ProtoReflect() protoreflect.Message { - mi := &file_cds2pb_cds2_proto_msgTypes[0] - 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 ClientRequest.ProtoReflect.Descriptor instead. -func (*ClientRequest) Descriptor() ([]byte, []int) { - return file_cds2pb_cds2_proto_rawDescGZIP(), []int{0} -} - -func (x *ClientRequest) GetAciUakPairs() []byte { - if x != nil { - return x.AciUakPairs - } - return nil -} - -func (x *ClientRequest) GetPrevE164S() []byte { - if x != nil { - return x.PrevE164S - } - return nil -} - -func (x *ClientRequest) GetNewE164S() []byte { - if x != nil { - return x.NewE164S - } - return nil -} - -func (x *ClientRequest) GetDiscardE164S() []byte { - if x != nil { - return x.DiscardE164S - } - return nil -} - -func (x *ClientRequest) GetToken() []byte { - if x != nil { - return x.Token - } - return nil -} - -func (x *ClientRequest) GetTokenAck() bool { - if x != nil { - return x.TokenAck - } - return false -} - -type ClientResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Each triple is an 8-byte e164, a 16-byte PNI, and a 16-byte ACI. - // If the e164 was not found, PNI and ACI are all zeros. If the PNI - // was found but the ACI was not, the PNI will be non-zero and the ACI - // will be all zeros. ACI will be returned if one of the returned - // PNIs has an ACI/UAK pair that matches. - // - // Should the request be successful (IE: a successful status returned), - // |e164_pni_aci_triple| will always equal |e164| of the request, - // so the entire marshalled size of the response will be (2+32)*|e164|, - // where the additional 2 bytes are the id/type/length additions of the - // protobuf marshaling added to each byte array. This avoids any data - // leakage based on the size of the encrypted output. - E164PniAciTriples []byte `protobuf:"bytes,1,opt,name=e164_pni_aci_triples,json=e164PniAciTriples,proto3" json:"e164_pni_aci_triples,omitempty"` - // A token which allows subsequent calls' rate limiting to discount the - // e164s sent up in this request, only counting those in the next - // request's new_e164s. - Token []byte `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` - // On a successful response to a token_ack request, the number of permits - // that were deducted from the user's rate-limit in order to process the - // request - DebugPermitsUsed int32 `protobuf:"varint,4,opt,name=debug_permits_used,json=debugPermitsUsed,proto3" json:"debug_permits_used,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClientResponse) Reset() { - *x = ClientResponse{} - mi := &file_cds2pb_cds2_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClientResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClientResponse) ProtoMessage() {} - -func (x *ClientResponse) ProtoReflect() protoreflect.Message { - mi := &file_cds2pb_cds2_proto_msgTypes[1] - 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 ClientResponse.ProtoReflect.Descriptor instead. -func (*ClientResponse) Descriptor() ([]byte, []int) { - return file_cds2pb_cds2_proto_rawDescGZIP(), []int{1} -} - -func (x *ClientResponse) GetE164PniAciTriples() []byte { - if x != nil { - return x.E164PniAciTriples - } - return nil -} - -func (x *ClientResponse) GetToken() []byte { - if x != nil { - return x.Token - } - return nil -} - -func (x *ClientResponse) GetDebugPermitsUsed() int32 { - if x != nil { - return x.DebugPermitsUsed - } - return 0 -} - -var File_cds2pb_cds2_proto protoreflect.FileDescriptor - -const file_cds2pb_cds2_proto_rawDesc = "" + - "\n" + - "\x11cds2pb/cds2.proto\x12\x0forg.signal.cdsi\"\xd3\x01\n" + - "\rClientRequest\x12\"\n" + - "\raci_uak_pairs\x18\x01 \x01(\fR\vaciUakPairs\x12\x1d\n" + - "\n" + - "prev_e164s\x18\x02 \x01(\fR\tprevE164s\x12\x1b\n" + - "\tnew_e164s\x18\x03 \x01(\fR\bnewE164s\x12#\n" + - "\rdiscard_e164s\x18\x04 \x01(\fR\fdiscardE164s\x12\x14\n" + - "\x05token\x18\x06 \x01(\fR\x05token\x12\x1b\n" + - "\ttoken_ack\x18\a \x01(\bR\btokenAckJ\x04\b\x05\x10\x06J\x04\b\b\x10\t\"\x8b\x01\n" + - "\x0eClientResponse\x12/\n" + - "\x14e164_pni_aci_triples\x18\x01 \x01(\fR\x11e164PniAciTriples\x12\x14\n" + - "\x05token\x18\x03 \x01(\fR\x05token\x12,\n" + - "\x12debug_permits_used\x18\x04 \x01(\x05R\x10debugPermitsUsedJ\x04\b\x02\x10\x03b\x06proto3" - -var ( - file_cds2pb_cds2_proto_rawDescOnce sync.Once - file_cds2pb_cds2_proto_rawDescData []byte -) - -func file_cds2pb_cds2_proto_rawDescGZIP() []byte { - file_cds2pb_cds2_proto_rawDescOnce.Do(func() { - file_cds2pb_cds2_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_cds2pb_cds2_proto_rawDesc), len(file_cds2pb_cds2_proto_rawDesc))) - }) - return file_cds2pb_cds2_proto_rawDescData -} - -var file_cds2pb_cds2_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_cds2pb_cds2_proto_goTypes = []any{ - (*ClientRequest)(nil), // 0: org.signal.cdsi.ClientRequest - (*ClientResponse)(nil), // 1: org.signal.cdsi.ClientResponse -} -var file_cds2pb_cds2_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_cds2pb_cds2_proto_init() } -func file_cds2pb_cds2_proto_init() { - if File_cds2pb_cds2_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_cds2pb_cds2_proto_rawDesc), len(file_cds2pb_cds2_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_cds2pb_cds2_proto_goTypes, - DependencyIndexes: file_cds2pb_cds2_proto_depIdxs, - MessageInfos: file_cds2pb_cds2_proto_msgTypes, - }.Build() - File_cds2pb_cds2_proto = out.File - file_cds2pb_cds2_proto_goTypes = nil - file_cds2pb_cds2_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/extra.go b/pkg/signalmeow/protobuf/extra.go similarity index 100% rename from pkg/signalmeow/protobuf/signalpb/extra.go rename to pkg/signalmeow/protobuf/extra.go diff --git a/pkg/signalmeow/protobuf/org/signal/chat/account.proto b/pkg/signalmeow/protobuf/org/signal/chat/account.proto deleted file mode 100644 index c12755b..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/account.proto +++ /dev/null @@ -1,608 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.account; - -import "google/protobuf/empty.proto"; - -import "org/signal/chat/common.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/messages.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/tag.proto"; - -// Provides methods for working with Signal accounts. -service Accounts { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Returns basic identifiers for the authenticated account. - rpc GetAccountIdentity(GetAccountIdentityRequest) returns (GetAccountIdentityResponse) {} - - // Returns entitlements for the authenticated account. - rpc GetEntitlements(GetEntitlementsRequest) returns (GetEntitlementsResponse) {} - - // Deletes the authenticated account, purging all associated data in the - // process. - rpc DeleteAccount(DeleteAccountRequest) returns (DeleteAccountResponse) {} - - // Sets the registration lock secret for the authenticated account. To remove - // a registration lock, please use `ClearRegistrationLock`. - rpc SetRegistrationLock(SetRegistrationLockRequest) returns (SetRegistrationLockResponse) {} - - // Removes any registration lock credentials from the authenticated account. - rpc ClearRegistrationLock(ClearRegistrationLockRequest) returns (ClearRegistrationLockResponse) {} - - // Attempts to reserve one of multiple given username hashes. Reserved - // usernames may be claimed later via `ConfirmUsernameHash`. - rpc ReserveUsernameHash(ReserveUsernameHashRequest) returns (ReserveUsernameHashResponse) {} - - // Sets the username hash/encrypted username to a previously-reserved value - // (see `ReserveUsernameHash`). - rpc ConfirmUsernameHash(ConfirmUsernameHashRequest) returns (ConfirmUsernameHashResponse) {} - - // Clears the current username hash, ciphertext, and link for the - // authenticated user. - rpc DeleteUsernameHash(DeleteUsernameHashRequest) returns (DeleteUsernameHashResponse) {} - - // Associates the given username ciphertext with the account, replacing any - // previously stored ciphertext. A new link handle will optionally be created, - // and the link handle to use will be returned in any event. - rpc SetUsernameLink(SetUsernameLinkRequest) returns (SetUsernameLinkResponse) {} - - // Clears any username link associated with the authenticated account. - rpc DeleteUsernameLink(DeleteUsernameLinkRequest) returns (DeleteUsernameLinkResponse) {} - - // Configures "unidentified access" keys and preferences for the authenticated - // account. Other users permitted to interact with this account anonymously - // may take actions like fetching pre-keys and profiles for this account or - // sending sealed-sender messages without providing identifying credentials. - rpc ConfigureUnidentifiedAccess(ConfigureUnidentifiedAccessRequest) returns (ConfigureUnidentifiedAccessResponse) {} - - // Sets whether the authenticated account may be discovered by phone number - // via the Contact Discovery Service (CDS). - rpc SetDiscoverableByPhoneNumber(SetDiscoverableByPhoneNumberRequest) returns (SetDiscoverableByPhoneNumberResponse) {} - - // Sets the registration recovery password for the authenticated account. - rpc SetRegistrationRecoveryPassword(SetRegistrationRecoveryPasswordRequest) returns (SetRegistrationRecoveryPasswordResponse) {} - - // Store a public key used to issue and verify zero-knowledge (anonymous) credentials for the account. - rpc SetZkCredentialKey(SetZkCredentialKeyRequest) returns (SetZkCredentialKeyResponse) {} - - // Changes the phone number associated with the authenticated account. - rpc ChangeNumber(ChangeNumberRequest) returns (ChangeNumberResponse) {} - - // Produces a report of non-ephemeral account data stored by the service - rpc GetAccountDataReport(GetAccountDataReportRequest) returns (GetAccountDataReportResponse) {} - - // Gets the capabilities for the authenticated account. - rpc GetCapabilities(GetCapabilitiesRequest) returns (GetCapabilitiesResponse) {} - - // Generates and stores a pending TOTP key for the authenticated account. - // To "activate" the key, callers must call the `ConfirmTotpKey` endpoint. - rpc GenerateTotpKey(GenerateTotpKeyRequest) returns (GenerateTotpKeyResponse) {} - - // Confirms that the caller has stored and can derive one-time passwords from - // a pending TOTP key generated via `GenerateTotpKey` and stores/activates the - // key for the caller's account - rpc ConfirmTotpKey(ConfirmTotpKeyRequest) returns (ConfirmTotpKeyResponse) {} - - // Returns a list of confirmed TOTP keys for the authenticated account - rpc ListTotpKeys(ListTotpKeysRequest) returns (ListTotpKeysResponse) {} - - // Updates encrypted, user-supplied metadata (e.g. a human-readable name and - // creation timestamp) for an existing, confirmed TOTP key - rpc SetTotpKeyMetadata(SetTotpKeyMetadataRequest) returns (SetTotpKeyMetadataResponse) {} - - // Removes a TOTP from the authenticated account - rpc RemoveTotpKey(RemoveTotpKeyRequest) returns (RemoveTotpKeyResponse) {} -} - -// Provides methods for looking up Signal accounts. Callers must not provide -// identifying credentials when calling methods in this service. -service AccountsAnonymous { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Checks whether an account with the given service identifier exists. - rpc CheckAccountExistence(CheckAccountExistenceRequest) returns (CheckAccountExistenceResponse) {} - - // Finds the service identifier of the account associated with the given - // username hash. - rpc LookupUsernameHash(LookupUsernameHashRequest) returns (LookupUsernameHashResponse) {} - - // Finds the encrypted username identified by a given username link handle. - rpc LookupUsernameLink(LookupUsernameLinkRequest) returns (LookupUsernameLinkResponse) {} - - // Gets the publicly-visible capabilities enabled on the account identified by - // the provided ACI. - rpc GetCapabilities(GetCapabilitiesAnonymousRequest) returns (GetCapabilitiesAnonymousResponse) {} -} - -message GetAccountIdentityRequest { -} - -message GetAccountIdentityResponse { - // The identifiers for the authenticated account. - common.AccountIdentifiers account_identifiers = 1; -} - -message GetEntitlementsRequest { -} - -message GetEntitlementsResponse { - message BadgeEntitlement { - // The id of the badge the account is entitled. Metadata to display for - // badges may be obtained by cross-referencing badge ids with - // RemoteConfiguration.GetBadges. - string badge_id = 1; - // When the badge expires, in number of seconds since epoch - uint64 expiration_epoch_seconds = 2; - // Whether the badge is currently configured to be visible - bool visible = 3; - } - - message BackupEntitlement { - // The backup level of the account - uint64 level = 1; - // When the backup entitlement expires, in number of seconds since epoch - uint64 expiration_epoch_seconds = 2; - } - - // Active badges added via Donations.redeemReceipt - repeated BadgeEntitlement badges = 1; - - // If present, the backup level set via Backups.redeemReceipt - BackupEntitlement backup = 2; -} - -message DeleteAccountRequest { -} - -message DeleteAccountResponse { -} - -message SetRegistrationLockRequest { - // The new registration lock secret for the authenticated account. - bytes registration_lock = 1 [(require.exactlySize) = 32]; -} - -message SetRegistrationLockResponse { -} - -message ClearRegistrationLockRequest { -} - -message ClearRegistrationLockResponse { -} - -message ReserveUsernameHashRequest { - // A prioritized list of username hashes to attempt to reserve. - repeated bytes username_hashes = 1 [(require.size) = {min: 1, max: 20}, (require.each) = {exactlySize: 32}]; -} - -message UsernameNotAvailable {} - -message ReserveUsernameHashResponse { - oneof response { - // The first username hash that was available (and actually reserved). - bytes username_hash = 1; - - // Indicates that, of all of the candidate hashes provided, none were - // available. Callers may generate a new set of hashes and and retry. - UsernameNotAvailable username_not_available = 2 [(tag.reason) = "username_not_available"]; - } -} - -message ConfirmUsernameHashRequest { - // The username hash to claim for the authenticated account. - bytes username_hash = 1 [(require.exactlySize) = 32]; - - // A zero-knowledge proof that the given username hash was generated by the - // Signal username algorithm. - bytes zk_proof = 2 [(require.nonEmpty) = true]; - - // The ciphertext of the chosen username for use in public-facing contexts - // (e.g. links and QR codes). - bytes username_ciphertext = 3 [(require.size) = {min: 1, max: 128}]; -} - -message ConfirmUsernameHashResponse { - message ConfirmedUsernameHash { - reserved 1; // username_hash - - // The server-generated username link handle for the newly-confirmed username. - bytes username_link_handle = 2; - } - - oneof response { - // The details of the successfully confirmed username. - ConfirmedUsernameHash confirmed_username_hash = 1; - - // The provided hash was not reserved for the account. - errors.FailedPrecondition reservation_not_found = 2 [(tag.reason) = "reservation_not_found"]; - - // The reservation has lapsed and the requested username has been claimed by - // another caller. - UsernameNotAvailable username_not_available = 3 [(tag.reason) = "username_not_available"]; - } -} - -message DeleteUsernameHashRequest { -} - -message DeleteUsernameHashResponse { -} - -message SetUsernameLinkRequest { - // The username ciphertext for which to generate a new link handle. - bytes username_ciphertext = 1 [(require.size) = {min: 1, max: 128}]; - - // If true and the account already had an encrypted username stored, the - // existing link handle will be reused. Otherwise a new link handle will be - // created. - bool keep_link_handle = 2; -} - - -message SetUsernameLinkResponse { - oneof response { - // A new link handle for the given username ciphertext. - bytes username_link_handle = 1; - - // The authenticated account did not have a username set. - errors.FailedPrecondition no_username_set = 2 [(tag.reason) = "no_username_set"]; - - } -} - -message DeleteUsernameLinkRequest { -} - -message DeleteUsernameLinkResponse { -} - -message ConfigureUnidentifiedAccessRequest { - oneof configuration { - // The key that other users must provide to interact with this account - // anonymously (i.e. to retrieve keys or profiles or to send messages) unless - // unrestricted unidentified access is permitted. Must be present if - // unrestricted unidentified access is not allowed. - bytes unidentified_access_key = 1 [(require.exactlySize) = 16]; - - // If set, any user may interact with this account anonymously without - // providing an unidentified access key. Otherwise, users must provide the - // given unidentified access key to interact with this account anonymously. - // Setting unrestricted unidentified access will clear any existing - // unidentified_access_key - google.protobuf.Empty allow_unrestricted_unidentified_access = 2; - } -} - -message ConfigureUnidentifiedAccessResponse { -} - -message SetDiscoverableByPhoneNumberRequest { - // If true, the authenticated account may be discovered by phone number via - // the Contact Discovery Service (CDS). Otherwise, other users must discover - // this account by other means (i.e. by username). - bool discoverable_by_phone_number = 1; -} - -message SetDiscoverableByPhoneNumberResponse { -} - -message SetRegistrationRecoveryPasswordRequest { - // The new registration recovery password for the authenticated account. - bytes registration_recovery_password = 1 [(require.exactlySize) = 32]; -} - -message SetRegistrationRecoveryPasswordResponse { -} - -message CheckAccountExistenceRequest { - // The service identifier of an account that may or may not exist. - common.ServiceIdentifier service_identifier = 1; -} - -message CheckAccountExistenceResponse { - // True if an account exists with the given service identifier or false if no - // account was found. - bool account_exists = 1; -} - -message LookupUsernameHashRequest { - // A 32-byte username hash for which to find an account. - bytes username_hash = 1 [(require.exactlySize) = 32]; -} - -message LookupUsernameHashResponse { - oneof response { - // The service identifier associated with the provided username hash. - common.ServiceIdentifier service_identifier = 1; - - // No account was found for the provided username hash. - errors.NotFound not_found = 2 [(tag.reason) = "not_found"]; - } -} - -message LookupUsernameLinkRequest { - // The link handle for which to find an encrypted username. Link handles are - // 16-byte representations of UUIDs. - bytes username_link_handle = 1 [(require.exactlySize) = 16]; -} - -message LookupUsernameLinkResponse { - oneof response { - // The ciphertext of the username identified by the provided link handle. - bytes username_ciphertext = 1; - - - // No username was found for the provided link handle. - errors.NotFound not_found = 2 [(tag.reason) = "not_found"]; - } -} - -message SetZkCredentialKeyRequest { - // A serialized libsignal ZkCredentialPublicKey - bytes public_key = 1 [(require.exactlySize) = 33]; -} - -message SetZkCredentialKeyResponse { - // A random, non-zero, value that must be included in credential requests using the key. - // - // This value allows the server to ratchet the resulting binding identity, - // as reverting to the previous key will result in a new rotation ID. - uint64 rotation_id = 1; -} - -message ChangeNumberRequest { - // A means of authenticating the change-number request for the new phone - // number. Exactly one must be provided. - oneof verification { - // A verified registration session ID (as returned by the registration - // service) for the new phone number. - bytes session_id = 1 [(require.nonEmpty) = true]; - - // A registration recovery password for the new phone number. - bytes recovery_password = 2 [(require.exactlySize) = 32]; - } - - // The new phone number for the authenticated account. - string number = 3 [(require.e164) = true]; - - // The registration lock secret for the new phone number, if the account - // associated with the new phone number has a registration lock configured. - bytes registration_lock = 4 [(require.exactlySize) = 0, (require.exactlySize) = 32]; - - // The new public identity key to use for the phone-number identity (PNI) - // associated with the new phone number. - bytes pni_identity_key = 5 [(require.nonEmpty) = true]; - - // Synchronization messages to send to companion devices to supply the private - // keys associated with the new identity key and their new pre-keys. Exactly - // one message must be supplied for each device other than the sending - // (primary) device. May be omitted if no companion devices are linked to the - // account. - messages.IndividualRecipientMessageBundle device_messages = 6; - - // A new signed EC pre-key for each device on the account, including the - // sending device, keyed by device ID. Each must be accompanied by a valid - // signature from the identity key in this request. - map device_pni_signed_pre_keys = 7; - - // A new signed post-quantum last-resort pre-key for each device on the - // account, including the sending device, keyed by device ID. Each must be - // accompanied by a valid signature from the identity key in this request. - map device_pni_pq_last_resort_pre_keys = 8; - - // The new phone-number-identity registration ID for each device on the - // account, including the sending device, keyed by device ID. - map pni_registration_ids = 9; -} - -message ChangeNumberResponse { - oneof response { - // The identifiers of the account after the successful - // number change. - common.AccountIdentifiers account_identifiers = 1; - - // Mismatched number of devices or device ids in 'devices to notify' list - messages.MismatchedDevices mismatched_devices = 2 [(tag.reason) = "mismatched_devices"]; - - // The account associated with the new phone number has a registration lock, - // and the provided registration lock secret was missing or incorrect. - RegistrationLockFailure registration_lock_failure = 3 [(tag.reason) = "registration_lock_failure"]; - - // Mismatched registration ids in 'devices to notify' list - StaleDevices stale_devices = 4 [(tag.reason) = "stale_devices"]; - - // One or more device messages was too large - errors.FailedPrecondition message_too_large = 5 [(tag.reason) = "message_too_large"]; - - // The registration session is unverified - errors.FailedPrecondition unverified_registration_session = 6 [(tag.reason) = "unverified_registration_session"]; - - // The number does not match the registration session, or the registration session is invalid - errors.FailedPrecondition invalid_registration_session = 7 [(tag.reason) = "invalid_registration_session"]; - - errors.FailedPrecondition recovery_password_verification_failed = 8 [(tag.reason) = "recovery_password_verification_failed"]; - } -} - -// Information about the current Registration lock and SVR credentials. With a correct PIN, the credentials can -// be used to recover the secret used to derive the registration lock password. -message RegistrationLockFailure { - // Time remaining in milliseconds before the existing registration lock expires - uint64 time_remaining_millis = 1; - - // Credentials that can be used with SVR2 - ExternalServiceCredentials svr2_credentials = 2; -} - -// A username/password pair for authenticating with an external service. -message ExternalServiceCredentials { - // A username that can be presented to authenticate with the external service. - string username = 1; - - // A password that can be presented to authenticate with the external service. - string password = 2; -} - -// A list of devices that are linked to the account but presented a stale -// registration ID (indicating the device has likely been replaced by another -// device). -message StaleDevices { - // The IDs of devices that are no longer active. - repeated uint32 stale_devices = 1 [(require.each) = {range: {max: 0x7f}}]; -} - -message GetAccountDataReportRequest { -} - -message GetAccountDataReportResponse { - // The JSON representation of the data report - string json = 3; - // A plaintext representation of the data report - string text = 4; -} - -message GetCapabilitiesRequest { -} - -message Capabilities { - // A list of capabilities enabled on the account. - repeated common.DeviceCapability capabilities = 1; -} - -message GetCapabilitiesResponse { - // A list of capabilities enabled on the account. - Capabilities capabilities = 1; -} - -message GetCapabilitiesAnonymousRequest { - // The ACI of the account for which to get capabilities. - common.ServiceIdentifier account_identifier = 1 [(require.present) = true, (require.identityType) = IDENTITY_TYPE_ACI]; - - oneof authentication { - // The unidentified access key for the targeted account. - bytes unidentified_access_key = 2 [(require.exactlySize) = 16]; - - // A group send endorsement token for the targeted account. - bytes group_send_token = 3 [(require.nonEmpty) = true]; - } -} - -message GetCapabilitiesAnonymousResponse { - oneof response { - // A list of capabilities enabled on the account. - Capabilities capabilities = 1; - errors.NotFound not_found = 2 [(tag.reason) = "not_found"]; - errors.FailedUnidentifiedAuthorization failed_unidentified_authorization = 3 [(tag.reason) = "failed_unidentified_authorization"]; - } -} - -message TotpParameters { - // The HMAC algorithm (e.g. "HmacSHA256") used by the TOTP generator - string algorithm = 1; - - // The length of one-time passwords (in decimal digits) produced and expected - // by the TOTP generator - uint32 password_length = 2; - - // The time step (in seconds) used by the TOTP generator - uint32 time_step_seconds = 3; -} - -message GenerateTotpKeyRequest { -} - -message GenerateTotpKeyResponse { - message KeyGenerated { - // The raw TOTP key - bytes key = 1; - - // The TOTP parameters associated with the generated key - TotpParameters totp_parameters = 2; - } - - oneof response { - // A new, pending TOTP key has been generated and added to the authenticated - // account - KeyGenerated key_generated = 1; - - // The authenticated account already has too many TOTP keys, and the caller - // must remove one before adding more - errors.FailedPrecondition too_many_totp_keys = 2 [(tag.reason) = "too_many_totp_keys"]; - } -} - -message ConfirmTotpKeyRequest { - // A one-time password derived from the current pending TOTP key - uint32 one_time_password = 1; - - // The ciphertext of user-provided metadata (presumably including a - // human-readable name and creation timestamp) to be attached to the - // newly-confirmed key - bytes metadata_ciphertext = 2 [(require.exactlySize) = 160]; -} - -message ConfirmTotpKeyResponse { - message KeyConfirmed { - // The account-specific identifier for the newly-confirmed TOTP key - uint32 key_id = 1; - } - - oneof response { - // The provided one-time password was accepted and the pending TOTP key was - // stored with the provided name ciphertext - KeyConfirmed key_confirmed = 1; - - // The provided one-time password was not valid for any reason (including - // incorrect passwords, misaligned clocks, or missing account records) - errors.FailedPrecondition one_time_password_not_verified = 2 [(tag.reason) = "one_time_password_not_verified"]; - } -} - -message ListTotpKeysRequest {} - -message ListTotpKeysResponse { - message TotpKeyMetadata { - // The user-provided ciphertext for metadata associated with this TOTP key - bytes metadata_ciphertext = 1; - - // The TOTP parameters associated with this key - TotpParameters totp_parameters = 2; - } - - map keys = 1; -} - -message SetTotpKeyMetadataRequest { - // The account-specific identifier of the TOTP key to modify - uint32 key_id = 1; - - // The ciphertext of the new user-provided metadata to be attached to the - // identified key - bytes metadata_ciphertext = 2 [(require.exactlySize) = 160]; -} - -message SetTotpKeyMetadataResponse { - message MetadataUpdated { - } - - oneof response { - // New metadata was stored for the identified TOTP key - MetadataUpdated metadata_updated = 1; - - // No TOTP was found with the given ID - errors.NotFound key_not_found = 2 [(tag.reason) = "key_not_found"]; - } -} - -message RemoveTotpKeyRequest { - // The account-specific identifier of the TOTP key to remove - uint32 key_id = 1; -} - -message RemoveTotpKeyResponse { -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/attachments.proto b/pkg/signalmeow/protobuf/org/signal/chat/attachments.proto deleted file mode 100644 index b51ed13..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/attachments.proto +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.attachments; - -import "org/signal/chat/common.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/tag.proto"; - -service Attachments { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Retrieve an upload form that can be used to perform a resumable upload - rpc GetUploadForm(GetUploadFormRequest) returns (GetUploadFormResponse) {} - - // Retrieve an upload form that can be used to upload a sticker pack - rpc GetStickerUploadForm(GetStickerUploadFormRequest) returns (GetStickerUploadFormResponse) {} -} - -message GetUploadFormRequest { - // The length of the attachment for the requested upload form. Uploads - // performed with this form will be limited to the provided length. - uint64 uploadLength = 1 [(require.range) = {min: 1}]; -} - -message GetUploadFormResponse { - oneof outcome { - common.UploadForm upload_form = 1; - - // The request size was larger than the maximum supported upload size. The - // maximum upload size is subject to change and is governed by - // `global.attachments.maxBytes` - errors.FailedPrecondition exceeds_max_upload_length = 2 [(tag.reason) = "oversize_upload"]; - } -} - -message GetStickerUploadFormRequest { - // The number of stickers in the sticker pack to upload - uint32 sticker_count = 1 [(require.range) = {min: 1, max: 201}]; -} - -message GetStickerUploadFormResponse { - // A randomly-generated ID for the new sticker pack - string pack_id = 1; - - // An upload form clients must use to upload a manifest for the sticker pack - common.S3UploadForm manifest_upload_form = 2; - - // Upload forms for individual stickers within the sticker pack - repeated common.S3UploadForm sticker_upload_forms = 3; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/backups.proto b/pkg/signalmeow/protobuf/org/signal/chat/backups.proto deleted file mode 100644 index 92b7506..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/backups.proto +++ /dev/null @@ -1,554 +0,0 @@ -/* - * Copyright 2024 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.backup; - -import "google/protobuf/empty.proto"; -import "org/signal/chat/common.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/tag.proto"; - -// Service for backup operations that require account authentication. -// -// Most actual backup operations operate on the backup-id and cannot be linked -// to the caller's account, but setting up anonymous credentials and changing -// backup tier requires account authentication. -service Backups { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Set (blinded) backup-id(s) for the account. - // - // Each account may have a single active backup-id for each credential type - // that can be used to store and retrieve backups. Once the backup-id is set, - // BackupAuthCredentials can be generated using GetBackupAuthCredentials. - // - // The blinded backup-id and the key-pair used to blind it must be derived - // from a recoverable secret. - // - // At least one of the credential types must be set on the request. - // Only the primary device can set a blinded backup-id. - rpc SetBackupId(SetBackupIdRequest) returns (SetBackupIdResponse) {} - - // Redeem a receipt acquired from /v1/subscription/{subscriberId}/receipt_credentials - // to mark the account as eligible for the paid backup tier. - // - // After successful redemption, subsequent requests to - // GetBackupAuthCredentials will return credentials with the level on the - // provided receipt until the expiration time on the receipt. - rpc RedeemReceipt(RedeemReceiptRequest) returns (RedeemReceiptResponse) {} - - // After setting a blinded backup-id with PUT /v1/archives/, this fetches - // credentials that can be used to perform operations against that backup-id. - // Clients may (and should) request up to 7 days of credentials at a time. - // - // The redemption_start and redemption_end seconds must be UTC day aligned, and - // must not span more than 7 days. - // - // Each credential contains a receipt level which indicates the backup level - // the credential is good for. If the account has paid backup access that - // expires at some point in the provided redemption window, credentials with - // redemption times after the expiration may be on a lower backup level. - // - // Clients must validate the receipt level on the credential matches a known - // receipt level before using it. - rpc GetBackupAuthCredentials(GetBackupAuthCredentialsRequest) returns (GetBackupAuthCredentialsResponse) {} -} - -message SetBackupIdRequest { - // A BackupAuthCredentialRequest containing a blinded encrypted backup-id, - // encoded in standard padded base64. This backup-id should be used for - // message backups only, and must have the message backup type set on the - // credential. If absent, the message credential request will not be updated. - bytes messages_backup_auth_credential_request = 1; - - // A BackupAuthCredentialRequest containing a blinded encrypted backup-id, - // encoded in standard padded base64. This backup-id should be used for - // media only, and must have the media type set on the credential. If absent, - // the media credential request will not be updated. - bytes media_backup_auth_credential_request = 2; -} - -message SetBackupIdResponse {} - - -message RedeemReceiptRequest { - // Presentation for a previously acquired receipt, serialized with libsignal - bytes presentation = 1; -} - -message RedeemReceiptResponse { - oneof response { - // The receipt was successfully redeemed - google.protobuf.Empty success = 1; - - // The target account does not have a backup-id commitment - errors.FailedPrecondition account_missing_commitment = 2 [(tag.reason) = "account_missing_commitment"]; - - // The provided receipt presentation was malformed or expired - errors.FailedPrecondition invalid_receipt = 3 [(tag.reason) = "invalid_receipt"]; - } -} - -message GetBackupAuthCredentialsRequest { - // The redemption time for the first credential. This must be a day-aligned - // seconds since epoch in UTC. - int64 redemption_start = 1 [(require.range).min = 1]; - - // The redemption time for the last credential. This must be a day-aligned - // seconds since epoch in UTC. The span between redemptionStart and - // redemptionEnd must not exceed 7 days. - int64 redemption_stop = 2 [(require.range).min = 1]; -} - -message GetBackupAuthCredentialsResponse { - message Credentials { - // The requested message backup ZkCredentials indexed by the start of their - // validity period. The smallest key should be for the requested - // redemption_start, the largest for the requested redemption_end. - map message_credentials = 1; - - // The requested media backup ZkCredentials indexed by the start of their - // validity period. The smallest key should be for the requested - // redemption_start, the largest for the requested redemption_end. - map media_credentials = 2; - } - - // The requested credentials. If absent, there was no existing blinded - // backup id associated with the provided account. - Credentials credentials = 1; -} - -// Service for backup operations with anonymous credentials -// -// This service never requires account authentication. It instead requires a -// backup-id authenticated with an anonymous credential that cannot be linked -// to the account. -// -// To register an anonymous credential: -// -// 1. Set a backup-id on the authenticated channel via Backups::SetBackupId -// 2. Retrieve BackupAuthCredentials via Backups::GetBackupAuthCredentials -// 3. Generate a key pair and set the public key via -// BackupsAnonymous::SetPublicKey -// -// Unless otherwise noted, requests for this service require a -// SignedPresentation, which includes: -// -// - a presentation generated from a BackupAuthCredential issued by -// GetBackupAuthCredentials -// - a signature of that presentation using the private key of a key pair -// previously set with SetPublicKey. -service BackupsAnonymous { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Retrieve credentials used to read objects stored on the backup cdn - rpc GetCdnCredentials(GetCdnCredentialsRequest) returns (GetCdnCredentialsResponse) {} - - // Retrieve credentials used to interact with the SecureValueRecoveryB service - rpc GetSvrBCredentials(GetSvrBCredentialsRequest) returns (GetSvrBCredentialsResponse) {} - - // Retrieve information about the currently stored message backup - rpc GetMessageBackupInfo(GetBackupInfoRequest) returns (GetMessageBackupInfoResponse) {} - - // Retrieve information about the currently stored media backup - rpc GetMediaBackupInfo(GetBackupInfoRequest) returns (GetMediaBackupInfoResponse) {} - - // Permanently set the public key of an ED25519 key-pair for the backup-id. - // All requests (including this one!) must sign their BackupAuthCredential - // presentations with the private key corresponding to the provided public key. - rpc SetPublicKey(SetPublicKeyRequest) returns (SetPublicKeyResponse) {} - - // Refresh the backup, indicating that the backup is still active. Clients - // must periodically upload new backups or perform a refresh. If a backup has - // not been active for 30 days, it may be deleted. - rpc Refresh(RefreshRequest) returns (RefreshResponse) {} - - // Retrieve an upload form that can be used to perform a resumable upload - rpc GetUploadForm(GetUploadFormRequest) returns (GetUploadFormResponse) {} - - // Copy and re-encrypt media from the attachments cdn into the backup cdn. - // The original, already encrypted, attachments will be encrypted with the - // provided key material before being copied. - // - // The copy operation is not atomic and responses will be returned as copy - // operations complete with detailed information about the outcome. If an - // error is encountered, not all requests may be reflected in the responses. - // - // On retries, a particular destination media id must not be reused with a - // different source media id or different encryption parameters. - // - // The response stream may be closed with STREAM_CLOSED error reason. In this - // case, a BackupStreamClosed message will be present in the error details. - rpc CopyMedia(CopyMediaRequest) returns (stream CopyMediaResponse) {} - - // Retrieve a page of media objects stored for this backup-id. A client may - // have previously stored media objects that are no longer referenced in their - // current backup. To reclaim storage space used by these orphaned objects, - // perform a list operation and remove any unreferenced media objects - // via DeleteMedia. - rpc ListMedia(ListMediaRequest) returns (ListMediaResponse) {} - - // Delete media objects stored with this backup-id. Streams the locations of - // media items back when the item has successfully been removed. - // - // The response stream may be closed with STREAM_CLOSED error reason. In this - // case, a BackupStreamClosed message will be present in the error details. - rpc DeleteMedia(DeleteMediaRequest) returns (stream DeleteMediaResponse) {} - - // Delete all backup metadata, objects, and stored public key. To use - // backups again, a public key must be resupplied. - rpc DeleteAll(DeleteAllRequest) returns (DeleteAllResponse) {} -} - -message SignedPresentation { - // Presentation of a BackupAuthCredential previously retrieved from - // GetBackupAuthCredentials on the authenticated channel - bytes presentation = 1 [(require.nonEmpty) = true]; - - // The presentation signed with the private key corresponding to the public - // key set with SetPublicKey - bytes presentation_signature = 2 [(require.nonEmpty) = true]; -} - -message SetPublicKeyRequest { - SignedPresentation signed_presentation = 1; - - // The public key, serialized in libsignal's elliptic-curve public key format. - bytes public_key = 2 [(require.nonEmpty) = true]; -} - -message SetPublicKeyResponse { - oneof response { - // The public key was successfully set - google.protobuf.Empty success = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - // - // This may also be returned if there was an existing public key and the - // provided public key did not match. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} - -message GetCdnCredentialsRequest { - SignedPresentation signed_presentation = 1; - uint32 cdn = 2; -} -message GetCdnCredentialsResponse { - message CdnCredentials { - map headers = 1; - } - oneof response { - // Headers to include with requests to the read from the backup CDN. Includes - // time limited read-only credentials. - CdnCredentials cdn_credentials = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} - -message GetSvrBCredentialsRequest { - SignedPresentation signed_presentation = 1; -} - -message GetSvrBCredentialsResponse { - message SvrBCredentials { - // A username that can be presented to authenticate with SVRB - string username = 1; - - // A password that can be presented to authenticate with SVRB - string password = 2; - } - - oneof response { - SvrBCredentials svrb_credentials = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} - -message GetBackupInfoRequest { - SignedPresentation signed_presentation = 1; -} -message GetMessageBackupInfoResponse { - message MessageBackupInfo { - // The base directory of your backup data on the cdn. Always non-empty, even - // if a backup has not actually been stored to the cdn. If a backup was - // previously uploaded and has not expired, it can be found in the returned - // cdn at /backup_dir/backup_name. - string backup_dir = 1; - - // The CDN type where the message backup is stored. Media may be stored - // elsewhere. - uint32 cdn = 2; - - // The location of the message backup on the cdn. Always non-empty, even - // if a backup has not actually been stored to the cdn. If a backup was - // previously uploaded and has not expired, it can be found in the returned - // cdn at /backup_dir/backup_name. - string backup_name = 3; - } - - oneof response { - MessageBackupInfo backup_info = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} -message GetMediaBackupInfoResponse { - message MediaBackupInfo { - // The base directory of your backup data on the cdn. Always non-empty, even - // if no media has been stored to the cdn or the credential is for a tier - // that does not support media. - string backup_dir = 1; - - // The prefix path component for media objects on a cdn. Stored media for a - // media_id can be found at /backup_dir/media_dir/media_id, where the - // media_id is encoded in unpadded url-safe base64. Always non-empty, even - // if no media has been stored to the cdn or the credential is for a tier - // that does not support media. - string media_dir = 2; - - // The amount of space used to store media - uint64 used_space = 3; - } - - oneof response { - MediaBackupInfo backup_info = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} - -message RefreshRequest { - SignedPresentation signed_presentation = 1; -} -message RefreshResponse { - oneof response { - // The backup was successfully refreshed - google.protobuf.Empty success = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} - -message GetUploadFormRequest { - SignedPresentation signed_presentation = 1; - - message MessagesUploadType {} - message MediaUploadType {} - oneof upload_type { - // Retrieve an upload form that can be used to perform a resumable upload of - // a message backup. The finished upload will be available on the backup cdn. - MessagesUploadType messages = 2; - - // Retrieve an upload form for a temporary location that can be used to - // perform a resumable upload of an attachment. After uploading, the - // attachment can be copied into the backup via CopyMedia. - // - // Behaves identically to the account authenticated version at /attachments. - MediaUploadType media = 3; - } - - // The length of the attachment for the requested upload form. Uploads - // performed with this form will be limited to the provided length. - uint64 uploadLength = 4 [(require.range) = {min: 1}]; -} -message GetUploadFormResponse { - oneof response { - common.UploadForm upload_form = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - - // The request size was larger than the maximum supported upload size. The - // maximum upload size is subject to change and is governed by - // `global.attachments.maxBytes` - errors.FailedPrecondition exceeds_max_upload_length = 3 [(tag.reason) = "oversize_upload"]; - } -} - -message CopyMediaItem { - // The attachment cdn of the object to copy into the backup - uint32 source_attachment_cdn = 1 [(require.range).min = 1, (require.range).max = 3]; - - // The attachment key of the object to copy into the backup - string source_key = 2 [(require.nonEmpty) = true, (require.base64url) = true]; - - // The length of the source attachment before the encryption applied by the - // copy operation - uint64 object_length = 3; - - // media_id to copy on to the backup CDN - bytes media_id = 4 [(require.exactlySize) = 15]; - - // A 32-byte key for the MAC - bytes hmac_key = 5 [(require.exactlySize) = 32]; - - // A 32-byte encryption key for AES - bytes encryption_key = 6 [(require.exactlySize) = 32]; -} - -message CopyMediaRequest { - SignedPresentation signed_presentation = 1; - - // Items to copy - repeated CopyMediaItem items = 2 [(require.size) = {min: 1, max: 1000}]; -} - -message CopyMediaResponse { - message SourceNotFound {} - message WrongSourceLength {} - message OutOfSpace {} - message CopySuccess { - // The backup cdn where this media object is stored - uint32 cdn = 1; - } - - // The 15-byte media_id from the corresponding CopyMediaItem in the request - bytes media_id = 1; - - oneof response { - // The media item was successfully copied into the backup - CopySuccess success = 2; - - // The source object was not found - SourceNotFound source_not_found = 3 [(tag.reason) = "source_not_found"]; - - // The provided object length was incorrect - WrongSourceLength wrong_source_length = 4 [(tag.reason) = "wrong_source_length"]; - - // All media capacity has been consumed. Free some space to continue. - OutOfSpace out_of_space = 5 [(tag.reason) = "out_of_space"]; - } -} - -// The reason why a media stream RPC is being prematurely closed by the server. -message BackupStreamClosed { - oneof reason { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 1 [(tag.reason) = "failed_authentication"]; - } -} - -message ListMediaRequest { - SignedPresentation signed_presentation = 1; - - // A cursor returned by a previous call to ListMedia, absent on the first call - optional string cursor = 2; - - // If provided, the maximum number of entries to return in a page. If absent, - // a server-chosen default is used. - optional uint32 limit = 3 [(require.range) = {min: 1, max: 10000}]; -} - -message ListMediaResponse { - message ListEntry { - // The backup cdn where this media object is stored - uint32 cdn = 1; - // The media_id of the object - bytes media_id = 2; - // The length of the object in bytes - uint64 length = 3; - } - - message ListResult { - - // A page of media objects stored for this backup ID - repeated ListEntry page = 1; - - // The base directory of the backup data on the cdn. The stored media can be - // found at /backup_dir/media_dir/media_id, where the media_id is encoded with - // unpadded url-safe base64. - string backup_dir = 2; - - // The prefix path component for the media objects. The stored media for - // media_id can be found at /backup_dir/media_dir/media_id, where the media_id - // is encoded with unpadded url-safe base64. - string media_dir = 3; - - // If set, the cursor value to pass to the next list request to continue - // listing. If absent, all objects have been listed - optional string cursor = 4; - } - - oneof response { - ListResult list_result = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} - -message DeleteAllRequest { - SignedPresentation signed_presentation = 1; -} -message DeleteAllResponse { - oneof response { - // The backup was successfully scheduled for deletion - google.protobuf.Empty success = 1; - - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - } -} - -message DeleteMediaItem { - // The backup cdn where this media object is stored - uint32 cdn = 1; - - // The media_id of the object to delete - bytes media_id = 2 [(require.exactlySize) = 15]; -} - -message DeleteMediaRequest { - SignedPresentation signed_presentation = 1; - - repeated DeleteMediaItem items = 2 [(require.size) = {min: 1, max: 1000}]; -} - -message DeleteMediaResponse { - DeleteMediaItem deleted_item = 1; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/call_quality.proto b/pkg/signalmeow/protobuf/org/signal/chat/call_quality.proto deleted file mode 100644 index 4438c5f..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/call_quality.proto +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2025 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.calling.quality; - -import "org/signal/chat/require.proto"; - -// Provides methods for submitting call quality surveys -service CallQuality { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Submits a call quality survey response. - rpc SubmitCallQualitySurvey(SubmitCallQualitySurveyRequest) returns (SubmitCallQualitySurveyResponse) {} -} - -message SubmitCallQualitySurveyRequest { - // Indicates whether the caller was generally satisfied with the quality of - // the call - bool user_satisfied = 1; - - // A list of call quality issues selected by the caller - repeated string call_quality_issues = 2; - - // A free-form description of any additional issues as written by the caller - optional string additional_issues_description = 3; - - // A URL for a set of debug logs associated with the call if the caller chose - // to submit debug logs - optional string debug_log_url = 4; - - // The time at which the call started in milliseconds since the epoch - int64 start_timestamp = 5; - - // The time at which the call ended in milliseconds since the epoch - int64 end_timestamp = 6; - - // The type of call; note that direct voice calls can become video calls and - // vice versa, and this field indicates which mode was selected at call - // initiation time. At the time of writing, expected call types are - // "direct_voice", "direct_video", "group", and "call_link". - string call_type = 7; - - // Indicates whether the call completed without error or if it terminated - // abnormally - bool success = 8; - - // A client-defined, but human-readable reason for call termination - string call_end_reason = 9; - - // The median round-trip time, measured in milliseconds, for STUN/ICE packets - // (i.e. connection maintenance and establishment) - optional float connection_rtt_median = 10; - - // The median round-trip time, measured in milliseconds, for RTP/RTCP packets - // for audio streams - optional float audio_rtt_median = 11; - - // The median round-trip time, measured in milliseconds, for RTP/RTCP packets - // for video streams - optional float video_rtt_median = 12; - - // The median jitter for audio streams, measured in milliseconds, for the - // duration of the call as measured by the client submitting the survey - optional float audio_recv_jitter_median = 13; - - // The median jitter for video streams, measured in milliseconds, for the - // duration of the call as measured by the client submitting the survey - optional float video_recv_jitter_median = 14; - - // The median jitter for audio streams, measured in milliseconds, for the - // duration of the call as measured by the remote endpoint in the call (either - // the peer of the client submitting the survey in a direct call or the SFU in - // a group call) - optional float audio_send_jitter_median = 15; - - // The median jitter for video streams, measured in milliseconds, for the - // duration of the call as measured by the remote endpoint in the call (either - // the peer of the client submitting the survey in a direct call or the SFU in - // a group call) - optional float video_send_jitter_median = 16; - - // The fraction of audio packets lost over the duration of the call as - // measured by the client submitting the survey - optional float audio_recv_packet_loss_fraction = 17; - - // The fraction of video packets lost over the duration of the call as - // measured by the client submitting the survey - optional float video_recv_packet_loss_fraction = 18; - - // The fraction of audio packets lost over the duration of the call as - // measured by the remote endpoint in the call (either the peer of the client - // submitting the survey in a direct call or the SFU in a group call) - optional float audio_send_packet_loss_fraction = 19; - - // The fraction of video packets lost over the duration of the call as - // measured by the remote endpoint in the call (either the peer of the client - // submitting the survey in a direct call or the SFU in a group call) - optional float video_send_packet_loss_fraction = 20; - - // Machine-generated telemetry from the call; this is a serialized protobuf - // entity generated (and, critically, explained to the user!) by the calling - // library - optional bytes call_telemetry = 21; - - // A hash of a call ID (shared between clients and never sent to the calling - // server) that can be used to correlate survey responses from multiple - // participants in a call - optional bytes call_id_hash = 22; -} - -message SubmitCallQualitySurveyResponse { -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/calling.proto b/pkg/signalmeow/protobuf/org/signal/chat/calling.proto deleted file mode 100644 index afe6972..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/calling.proto +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.calling; - -import "org/signal/chat/require.proto"; - -// Provides methods for getting credentials and relay options for one-on-one -// calls. -service Calling { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Retrieves TURN credentials and relay options for one-on-one calls. - rpc GetCallingRelays(GetCallingRelaysRequest) returns (GetCallingRelaysResponse) {} -} - -message GetCallingRelaysRequest {} - -message GetCallingRelaysResponse { - message HostnameUrlList { - // A collection of hostname-based TURN, TURNS, or STUN URLs a client can use - // to connect to a relay. - repeated string urls = 1; - } - - message IpUrlList { - // A collection of IP-based TURN, TURNS, or STUN URLs a client can use to - // connect to a relay. - repeated string urls = 1; - - // A hostname clients must use to validate the relay's TLS certificate when - // connecting via an IP-based TURNS URL. May not be specified if `urls` - // contains no TURNS URLs. - optional string hostname = 2; - } - - message Relay { - // A username that can be presented to authenticate with a TURN server. - string username = 1; - - // A password that can be presented to authenticate with a TURN server. - string password = 2; - - // The duration, in seconds, after which the included username and password - // will no longer be valid. - uint64 credential_ttl_seconds = 3; - - // A collection of hostname-based URLs clients may use to connect to this - // relay. - optional HostnameUrlList hostname_urls = 4; - - // A collection of IP-based URLs clients may use to connect to this relay. - optional IpUrlList ip_urls = 5; - } - - // A collection of calling relays a client may use for one-on-one calls. - repeated Relay relays = 1; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/challenge.proto b/pkg/signalmeow/protobuf/org/signal/chat/challenge.proto deleted file mode 100644 index a3eef30..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/challenge.proto +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.challenge; - -import "org/signal/chat/require.proto"; - -service Challenge { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - // Submit proof of a challenge completion - - // Some server endpoints (the "send message" endpoint, for example) may return - // a response indicating the client must complete a challenge before continuing. - // Clients may use this endpoint to provide proof of a completed challenge. - // If successful, the client may then continue their original operation. - rpc HandleChallengeResponse(AnswerChallengeRequest) returns (AnswerChallengeResponse) {} -} - -message AnswerChallengeRequest { - - message AnswerPushChallengeRequest { - // The challenge string provided to the client via a push payload - string challenge = 1 [(require.nonEmpty) = true]; - } - - message AnswerCaptchaChallengeRequest { - // A string representing a solved captcha - // Example: signal-hcaptcha.30b01b46-d8c9-4c30-bbd7-9719acfe0c10.challenge.abcdefg1345 - string captcha = 1 [(require.nonEmpty) = true]; - } - - // The opaque token id from the ChallengeRequired response returned by the - // server endpoint that requested the challenge - string token = 1 [(require.nonEmpty) = true]; - - oneof request { - AnswerPushChallengeRequest push = 2; - AnswerCaptchaChallengeRequest captcha = 3; - } - -} - -message AnswerChallengeResponse { - // Whether the challenge proof was accepted - bool success = 1; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/common.proto b/pkg/signalmeow/protobuf/org/signal/chat/common.proto deleted file mode 100644 index a2cf057..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/common.proto +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.common; - -import "org/signal/chat/require.proto"; - -enum IdentityType { - IDENTITY_TYPE_UNSPECIFIED = 0; - IDENTITY_TYPE_ACI = 1; - IDENTITY_TYPE_PNI = 2; -} - -message ServiceIdentifier { - // The type of identity represented by this service identifier. - IdentityType identity_type = 1 [(require.specified) = true]; - - // The UUID of the identity represented by this service identifier. - bytes uuid = 2 [(require.exactlySize) = 16]; -} - -// All identifiers associated with an account. -message AccountIdentifiers { - // A list of service identifiers for the identified account. Always includes - // exactly one ACI service identifier and at most one PNI service identifier. - repeated ServiceIdentifier service_identifiers = 1; - - // The phone number associated with the identified account. May be empty if - // the given account does not have a phone number. - string e164 = 2 [(org.signal.chat.require.e164) = true]; - - // The username hash (if any) associated with the identified account. May be - // empty if no username is associated with the identified account. - bytes username_hash = 3 [(org.signal.chat.require.exactlySize) = 0, (org.signal.chat.require.exactlySize) = 32]; - - // The username link handle UUID associated with the identified account. - // May be empty if no username is associated with the identified account. - bytes username_link_handle = 4 [(org.signal.chat.require.exactlySize) = 0, (org.signal.chat.require.exactlySize) = 16]; -} - -message EcPreKey { - // A locally-unique identifier for this key, which will be provided by - // peers using this key to encrypt messages so the private key can be looked - // up. - int32 key_id = 1 [(require.range).min = 0]; - - // The public key, serialized in libsignal's elliptic-curve public key format. - bytes public_key = 2 [(require.nonEmpty) = true]; -} - -message EcSignedPreKey { - // A locally-unique identifier for this key, which will be provided by - // peers using this key to encrypt messages so the private key can be looked - // up. - int32 key_id = 1 [(require.range).min = 0]; - - // The public key, serialized in libsignal's elliptic-curve public key format. - bytes public_key = 2 [(require.nonEmpty) = true]; - - // A signature of the public key, verifiable with the identity key for the - // account/identity associated with this pre-key. - bytes signature = 3 [(require.nonEmpty) = true]; -} - -message KemSignedPreKey { - // An locally-unique identifier for this key, which will be provided by peers - // using this key to encrypt messages so the private key can be looked up. - int32 key_id = 1 [(require.range).min = 0]; - - // The public key, serialized in libsignal's Kyber1024 public key format. - bytes public_key = 2 [(require.nonEmpty) = true]; - - // A signature of the public key, verifiable with the identity key for the - // account/identity associated with this pre-key. - bytes signature = 3 [(require.nonEmpty) = true]; -} - -enum DeviceCapability { - DEVICE_CAPABILITY_UNSPECIFIED = 0; - DEVICE_CAPABILITY_STORAGE = 1; - DEVICE_CAPABILITY_TRANSFER = 2; - reserved 3; - reserved 4; - reserved 5; - DEVICE_CAPABILITY_ATTACHMENT_BACKFILL = 6; - DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET = 7; - DEVICE_CAPABILITY_PROFILES_V2 = 8; - DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE = 9; - DEVICE_CAPABILITY_OPTIONAL_PHONE_NUMBER = 10; -} - -message ZkCredential { - /* - * Day on which this credential can be redeemed, in UTC seconds since epoch - */ - int64 redemption_time = 1; - - /* - * The ZK credential, using libsignal's serialization - */ - bytes credential = 2 [(require.nonEmpty) = true]; -} - -// An upload location and credentials which may be used to upload an object -// to an external CDN -message UploadForm { - // Indicates the CDN type. 3 indicates resumable uploads using TUS - uint32 cdn = 1; - - // The location within the specified cdn where the finished upload can be found - string key = 2; - - // A map of headers to include with all upload requests. Potentially contains - // time-limited upload credentials - map headers = 3; - - // The URL to upload to with the appropriate protocol - string signed_upload_location = 4; -} - -// An upload location, credentials, and metadata which may be used to upload an -// object to AWS S3 -message S3UploadForm { - // The S3 key (i.e. path and filename) for the uploaded file. - string key = 1; - - // A scoped credential. Includes the AWS access key, date, region targeted, - // and AWS service. - string credential = 2; - - // The type of access control for the uploaded file. - string acl = 3; - - // The algorithm used to calculate a signature on the S3 policy. - string algorithm = 4; - - // The timestamp (formatted as "yyyyMMdd'T'HHmmssX") at which the S3 policy - // and signature were generated. - string date = 5; - - // The S3 policy (as a base64-encoded JSON string) used to upload the file. - string policy = 6; - - // A digital signature (formatted as a hex string) on the S3 policy. - string signature = 7; -} - -message BadgeSvg { - // File name of the scalable vector graphic for light mode. - string light = 1; - // File name of the scalable vector graphic for dark mode. - string dark = 2; -} - -message Badge { - // An ID that uniquely identifies the badge. - string id = 1; - // The category the badge falls in ("donor" or "other"). - string category = 2; - // The badge name. - string name = 3; - // The badge description. - string description = 4; - // Different size badge SVG files. - repeated string sprites6 = 5; - // File name of the scalable vector graphic representing this badge. - string svg = 6; - // Pairs of light/dark SVG files designed for display at different sizes. - repeated BadgeSvg svgs = 7; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/credentials.proto b/pkg/signalmeow/protobuf/org/signal/chat/credentials.proto deleted file mode 100644 index fa9dce7..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/credentials.proto +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -import "org/signal/chat/require.proto"; - -package org.signal.chat.credentials; - -// Provides methods for obtaining and verifying credentials that allow an -// authenticated user to authenticate in another service or context without -// revealing their identity. -service Credentials { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Generates and returns an external service credentials for the caller. - rpc GetExternalServiceCredentials(GetExternalServiceCredentialsRequest) - returns (GetExternalServiceCredentialsResponse) {} - - // Generates a pair of delivery certificates that the holder can include to - // identify themselves to a message recipient (but not the server) in a - // sealed-sender message. - rpc GetDeliveryCertificate(GetDeliveryCertificateRequest) - returns (GetDeliveryCertificateResponse) {} - - // Generates a set of zero-knowledge credentials for various group-related - // actions. - rpc GetGroupCredentials(GetGroupCredentialsRequest) - returns (GetGroupCredentialsResponse) {} - - // Generates zero-knowledge credentials for creating call links. - rpc GetCreateCallLinkCredentials(GetCreateCallLinkCredentialsRequest) - returns (GetCreateCallLinkCredentialsResponse) {} -} - -// Provides methods for working with previously-generated credentials without -// revealing an association between the credentials and the caller's identity to -// the server. -service CredentialsAnonymous { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Given a list of secure value recovery (SVR) service credentials and a phone - // number, checks and returns which of the provided credentials were generated - // by the user with the given phone number and have not yet expired. - rpc CheckSvrCredentials(CheckSvrCredentialsRequest) - returns (CheckSvrCredentialsResponse) {} -} - -enum ExternalServiceType { - EXTERNAL_SERVICE_TYPE_UNSPECIFIED = 0; - EXTERNAL_SERVICE_TYPE_DIRECTORY = 1; - EXTERNAL_SERVICE_TYPE_PAYMENTS = 2; - EXTERNAL_SERVICE_TYPE_STORAGE = 3; - EXTERNAL_SERVICE_TYPE_SVR = 4; -} - -message GetExternalServiceCredentialsRequest { - // A service to request credentials for. - ExternalServiceType externalService = 1; -} - -message GetExternalServiceCredentialsResponse { - // A username that can be presented to authenticate with the external service. - string username = 1; - - // A password that can be presented to authenticate with the external service. - string password = 2; -} - -enum AuthCheckResult { - AUTH_CHECK_RESULT_UNSPECIFIED = 0; - // The credentials could be used to make a call to SVR service by the user - // associated with the `CheckSvrCredentialsRequest.number` phone number. - AUTH_CHECK_RESULT_MATCH = 1; - // The credentials were generated by a different user. - AUTH_CHECK_RESULT_NO_MATCH = 2; - // This status indicates that the corresponding credentials token should no longer be used. - // This may be because it has expired or invalid, but it can also mean that there is a more - // recent token in the request which should be used instead. - AUTH_CHECK_RESULT_INVALID = 3; -} - -message CheckSvrCredentialsRequest { - // A phone number in the E164 format to check the passwords against. - // Only passwords generated for the user associated with the given number will be marked as `AUTH_CHECK_RESULT_MATCH`. - string number = 1; - - // A list of credentials from previously made calls to `ExternalServiceCredentials.GetExternalServiceCredentials()` - // for `EXTERNAL_SERVICE_TYPE_SVR`. This list may contain credentials generated by different users. Up to 10 credentials - // can be checked. - repeated string passwords = 2 [(require.nonEmpty) = true, (require.size) = {max: 10}]; -} - -// For each of the credentials tokens in the `CheckSvrCredentialsRequest` contains the result of the check. -message CheckSvrCredentialsResponse { - - map matches = 1; -} - -message GetDeliveryCertificateRequest { -} - -// A pair of message delivery certificates. The response unconditionally -// includes certificates with and without the caller's phone number so the -// server never learns anything about the caller's intent to share their phone -// number with their contacts. -message GetDeliveryCertificateResponse { - // A delivery receipt that includes the caller's phone number; may be empty if - // the authenticated account does not have a phone number - bytes certificate_with_e164 = 1; - - // A delivery receipt that does not include the caller's phone number - bytes certificate_without_e164 = 2; -} - -message GetGroupCredentialsRequest { - // The earliest time for which to issue group credentials; must be aligned to - // a UTC day boundary and may be no more than one day in the past at the time - // of the call. - uint64 redemption_start_seconds = 1; - - // The latest time for which to issue group credentials; must be aligned to a - // UTC day boundary and no more than seven days in the future at the time of - // the call. - uint64 redemption_end_seconds = 2; -} - -message GetGroupCredentialsResponse { - // A zero-knowledge credential that may be redeemed at or up to one day after - // the given redemption time - message CredentialAndRedemptionTime { - bytes credential = 1; - uint64 redemption_time_seconds = 2; - } - - // A collection of credentials allowing the holder to anonymously - // authenticate themselves for group-related actions - repeated CredentialAndRedemptionTime group_credentials = 1; - - // A collection of credentials allowing the holder to read, update, and delete - // group call links - repeated CredentialAndRedemptionTime call_link_auth_credentials = 2; - - // The phone number identifier for which the included credentials were - // generated. Empty if the account does not have a phone number. - bytes pni = 3; -} - -message GetCreateCallLinkCredentialsRequest { - // A zero-knowledge credential request - bytes credential_request = 1; -} - -message GetCreateCallLinkCredentialsResponse { - // A zero-knowledge credential that may be redeemed at or up to one day after - // the given redemption time - bytes credential = 1; - - // The earliest time, in seconds since the epoch, at which the associated - // credential may be redeemed - uint64 redemption_time_seconds = 2; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/device.proto b/pkg/signalmeow/protobuf/org/signal/chat/device.proto deleted file mode 100644 index 06ad70d..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/device.proto +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.device; - -import "google/protobuf/empty.proto"; - -import "org/signal/chat/common.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/tag.proto"; - -// Provides methods for working with devices attached to a Signal account. -service Devices { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Returns a list of devices associated with the caller's account. - rpc GetDevices(GetDevicesRequest) returns (GetDevicesResponse) {} - - // Removes a linked device from the caller's account. - // - // Linked devices may only remove themselves. Primary devices may remove - // any device other than themselves. - rpc RemoveDevice(RemoveDeviceRequest) returns (RemoveDeviceResponse) {} - - // Sets the encrypted human-readable name for a specific devices. Primary - // devices may change the name of any device associated with their account, - // but linked devices may only change their own name. The response will - // indicate if the target device was not found. - rpc SetDeviceName(SetDeviceNameRequest) returns (SetDeviceNameResponse) {} - - // Sets the token(s) the server should use to send new message notifications - // to the authenticated device. - rpc SetPushToken(SetPushTokenRequest) returns (SetPushTokenResponse) {} - - // Removes any push tokens associated with the authenticated device. After - // calling this method, the server will assume that the authenticated device - // will periodically poll for new messages. - rpc ClearPushToken(ClearPushTokenRequest) returns (ClearPushTokenResponse) {} - - // Declares that the authenticated device supports certain features. - rpc SetCapabilities(SetCapabilitiesRequest) returns (SetCapabilitiesResponse) {} -} - -message GetDevicesRequest {} - -message GetDevicesResponse { - message LinkedDevice { - // The identifier for the device within an account. - uint32 id = 1; - - // A sequence of bytes that encodes an encrypted human-readable name for - // this device. - bytes name = 2; - - // The approximate time, in milliseconds since the epoch, at which this - // device last connected to the server. - uint64 last_seen = 3; - - // The registration ID of the given device. - uint32 registration_id = 4 [(require.range).max = 0x3fff]; - - // A sequence of bytes that encodes the time, - // in milliseconds since the epoch, at which this device was - // attached to its parent account. - bytes created_at_ciphertext = 5; - } - - // A list of devices linked to the authenticated account. - repeated LinkedDevice devices = 1; -} - -message RemoveDeviceRequest { - // The identifier for the device to remove from the authenticated account. The - // identifier must not be for the primary device. - uint32 id = 1; -} - -message SetDeviceNameRequest { - // A sequence of bytes that encodes an encrypted human-readable name for this - // device. - bytes name = 1 [(require.size) = {min: 1, max: 225}]; - - // The identifier for the device for which to set a name. - uint32 id = 2; -} - -message SetDeviceNameResponse { - oneof response { - // The device name was successfully set - google.protobuf.Empty success = 1; - - // No device with the provided identifier was found on the account - errors.NotFound target_device_not_found = 2 [(tag.reason) = "not_found"]; - } -} - -message RemoveDeviceResponse {} - -message SetPushTokenRequest { - message ApnsTokenRequest { - // A "standard" APNs device token. - string apns_token = 1 [(require.nonEmpty) = true]; - } - - message FcmTokenRequest { - // An FCM push token. - string fcm_token = 1 [(require.nonEmpty) = true]; - } - - oneof token_request { - // If present, specifies the APNs device token(s) the server will use to - // send new message notifications to the authenticated device. - ApnsTokenRequest apns_token_request = 1; - - // If present, specifies the FCM push token the server will use to send new - // message notifications to the authenticated device. - FcmTokenRequest fcm_token_request = 2; - } -} - -message SetPushTokenResponse {} - -message ClearPushTokenRequest {} - -message ClearPushTokenResponse {} - -message SetCapabilitiesRequest { - repeated common.DeviceCapability capabilities = 1; -} - -message SetCapabilitiesResponse {} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/donations.proto b/pkg/signalmeow/protobuf/org/signal/chat/donations.proto deleted file mode 100644 index 0ea3022..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/donations.proto +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.donations; - -import "google/protobuf/empty.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/tag.proto"; - -service Donations { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - // Redeem a receipt acquired from Subscriptions.CreateSubscriptionReceiptCredentials - // to add a badge to the account. After successful redemption, profile - // responses will include the corresponding badge (if configured as visible) - // until the expiration time on the receipt. - rpc RedeemReceipt(RedeemReceiptRequest) returns (RedeemReceiptResponse) {} - - // Generate a set of anonymous, single-use, permits for use with /v1/subscription endpoints. - // - // If rate limited, reduce requested permit count and/or try again after the prescribed delay. - rpc CreateDonationPermit(CreateDonationPermitRequest) returns (CreateDonationPermitResponse) {} -} - -message RedeemReceiptRequest { - // Presentation of the ZK receipt acquired when the subscription was created - bytes receiptCredentialPresentation = 1 [(require.exactlySize) = 329]; - // If true, the corresponding badge should be visible on the profile - bool visible = 2; - // If true, and the new badge is visible, it should be the primary badge on the profile - bool primary = 3; -} - -message RedeemReceiptResponse { - oneof response { - // The receipt was successfully redeemed - google.protobuf.Empty success = 1; - // The provided presentation is invalid - errors.FailedZkAuthentication failed_authentication = 2 [(tag.reason) = "failed_authentication"]; - // The receipt was already redeemed for a different account - errors.FailedPrecondition already_redeemed = 3 [(tag.reason) = "already_redeemed"]; - } -} - -message CreateDonationPermitRequest { - // a serialized libsignal DonationPermitRequest - bytes donation_permit_request = 1 [(require.nonEmpty) = true]; -} - -message CreateDonationPermitResponse { - // a serialized libsignal DonationPermitResponse - bytes donation_permit_response = 1; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/errors.proto b/pkg/signalmeow/protobuf/org/signal/chat/errors.proto deleted file mode 100644 index 356f8aa..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/errors.proto +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2025 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.errors; - -// Response message that indicates a particular resource was not found. -message NotFound {} - -// Response message that indicates that some precondition of the request was not -// met. For example, if there was a request to update foo, but foo had not been -// set, this would be an appropriate error. -message FailedPrecondition { - // An optional description indicating what precondition failed. - string description = 1; -} - -// Response message that authentication via an anonymous credential failed. -message FailedZkAuthentication { - // An optional description with additional information about the failure. - string description = 1; -} - -// Response message that indicates authorization to perform an unidentified -// operation via an endorsement or access key failed -message FailedUnidentifiedAuthorization { - // An optional description with additional information about the failure. - string description = 1; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/keys.proto b/pkg/signalmeow/protobuf/org/signal/chat/keys.proto deleted file mode 100644 index ca79c7c..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/keys.proto +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.keys; - -import "google/protobuf/empty.proto"; - -import "org/signal/chat/common.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/tag.proto"; - -// Provides methods for working with pre-keys. -service Keys { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Retrieves an approximate count of the number of the various kinds of - // pre-keys stored for the authenticated device. - rpc GetPreKeyCount (GetPreKeyCountRequest) returns (GetPreKeyCountResponse) {} - - // Retrieves a set of pre-keys for establishing a session with the targeted - // device or devices. Note that callers with an unidentified access key for - // the targeted account should use the version of this method in - // `KeysAnonymous` instead. - rpc GetPreKeys(GetPreKeysRequest) returns (GetPreKeysResponse) {} - - // Uploads a new set of one-time EC pre-keys for the authenticated device, - // clearing any previously-stored pre-keys. Note that all keys submitted via - // a single call to this method _must_ have the same identity type (i.e. if - // the first key has an ACI identity type, then all other keys in the same - // stream must also have an ACI identity type). The provided list of pre-keys - // must be non-empty. - rpc SetOneTimeEcPreKeys (SetOneTimeEcPreKeysRequest) returns (SetPreKeyResponse) {} - - // Uploads a new set of one-time KEM pre-keys for the authenticated device, - // clearing any previously-stored pre-keys. Note that all keys submitted via - // a single call to this method _must_ have the same identity type (i.e. if - // the first key has an ACI identity type, then all other keys in the same - // stream must also have an ACI identity type). The provided list of pre-keys - // must be non-empty. - rpc SetOneTimeKemSignedPreKeys (SetOneTimeKemSignedPreKeysRequest) returns (SetPreKeyResponse) {} - - // Sets the signed EC pre-key for one identity (i.e. ACI or PNI) associated - // with the authenticated device. - rpc SetEcSignedPreKey (SetEcSignedPreKeyRequest) returns (SetPreKeyResponse) {} - - // Sets the last-resort KEM pre-key for one identity (i.e. ACI or PNI) - // associated with the authenticated device. - rpc SetKemLastResortPreKey (SetKemLastResortPreKeyRequest) returns (SetPreKeyResponse) {} -} - -// Provides methods for working with pre-keys using "unidentified access" -// credentials. -service KeysAnonymous { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Retrieves a set of pre-keys for establishing a session with the targeted - // device or devices. Callers must not submit any self-identifying credentials - // when calling this method and must instead present the targeted account's - // unidentified access key as an anonymous authentication mechanism. Callers - // without an unidentified access key should use the equivalent, authenticated - // method in `Keys` instead. - rpc GetPreKeys(GetPreKeysAnonymousRequest) returns (GetPreKeysAnonymousResponse) {} - - // Checks identity key fingerprints of the target accounts. - // - // Returns a stream of elements, each one representing an account that had a mismatched - // identity key fingerprint with the server and the corresponding identity key stored by the server. - rpc CheckIdentityKeys(stream CheckIdentityKeyRequest) returns (stream CheckIdentityKeyResponse) {} -} - -message GetPreKeyCountRequest { -} - -message GetPreKeyCountResponse { - // The approximate number of one-time EC pre-keys stored for the - // authenticated device and associated with the caller's ACI. - uint32 aci_ec_pre_key_count = 1; - - // The approximate number of one-time Kyber pre-keys stored for the - // authenticated device and associated with the caller's ACI. - uint32 aci_kem_pre_key_count = 2; - - // The approximate number of one-time EC pre-keys stored for the - // authenticated device and associated with the caller's PNI. 0 if - // the account does not possess a phone number. - uint32 pni_ec_pre_key_count = 3; - - // The approximate number of one-time KEM pre-keys stored for the - // authenticated device and associated with the caller's PNI. 0 if - // the account does not possess a phone number. - uint32 pni_kem_pre_key_count = 4; -} - -message GetPreKeysRequest { - // The service identifier of the account for which to retrieve pre-keys. - common.ServiceIdentifier target_identifier = 1; - - // The ID of the device associated with the targeted account for which to - // retrieve pre-keys. If not set, pre-keys are returned for all devices - // associated with the targeted account. - optional uint32 device_id = 2; -} - -message GetPreKeysAnonymousRequest { - // The request to retrieve pre-keys for a specific account/device(s). - GetPreKeysRequest request = 1; - - // A means to authorize the request. - oneof authorization { - // The unidentified access key (UAK) for the targeted account. - bytes unidentified_access_key = 2; - - // A group send endorsement token for the targeted account. - bytes group_send_token = 3; - - // The destination account allows unrestricted unidentified access - google.protobuf.Empty unrestricted_access = 4; - } -} - -message DevicePreKeyBundle { - // The EC signed pre-key associated with the targeted - // account/device/identity. - common.EcSignedPreKey ec_signed_pre_key = 1; - - // A one-time EC pre-key for the targeted account/device/identity. May not - // be set if no one-time EC pre-keys are available. - common.EcPreKey ec_one_time_pre_key = 2; - - // A one-time KEM pre-key (or a last-resort KEM pre-key) for the targeted - // account/device/identity. - common.KemSignedPreKey kem_one_time_pre_key = 3; - - // The registration ID for the targeted account/device/identity. - uint32 registration_id = 4; -} - -message AccountPreKeyBundles { - // The identity key associated with the targeted account/identity. - bytes identity_key = 1; - - // A map of device IDs to pre-key "bundles" for the targeted account. - map device_pre_keys = 2; - - // Whether the account has enabled sealed sender from anyone. Always false - // if the request was for a PNI, which does not allow any unidentified access. - bool unrestricted_unidentified_access = 3; - - // If the target supports unidentified access and has an unidentified access - // key, a fingerprint of the target's UAK. This may be used to detect a change - // in the UAK that the sender has for the target before actually sending a message. Otherwise, empty. - bytes unidentified_access_key_fingerprint = 4; -} - -message GetPreKeysResponse { - oneof response { - // The requested pre-key bundles - AccountPreKeyBundles pre_keys = 1; - - // Either the target account was not found, no active device with the given - // ID (if specified) was found on the target account. - errors.NotFound target_not_found = 2 [(tag.reason) = "not_found"]; - } -} - -message GetPreKeysAnonymousResponse { - oneof response { - // The requested pre-key bundles - AccountPreKeyBundles pre_keys = 1; - - // Either the target account was not found, no active device with the given - // ID (if specified) was found on the target account. - errors.NotFound target_not_found = 2 [(tag.reason) = "not_found"]; - - // The provided unidentified authorization credential was invalid - errors.FailedUnidentifiedAuthorization failed_unidentified_authorization = 3 [(tag.reason) = "failed_unidentified_authorization"]; - } -} - -message SetOneTimeEcPreKeysRequest { - // The identity type (i.e. ACI/PNI) with which the keys in this request are - // associated. - common.IdentityType identity_type = 1; - - // The unsigned EC pre-keys to be stored. - repeated common.EcPreKey pre_keys = 2 [(require.size) = {min: 1, max: 100}]; -} - -message SetOneTimeKemSignedPreKeysRequest { - // The identity type (i.e. ACI/PNI) with which the keys in this request are - // associated. - common.IdentityType identity_type = 1; - - // The KEM pre-keys to be stored. - repeated common.KemSignedPreKey pre_keys = 2 [(require.size) = {min: 1, max: 100}]; -} - -message SetEcSignedPreKeyRequest { - // The identity type (i.e. ACI/PNI) with which this key is associated. - common.IdentityType identity_type = 1; - - // The signed EC pre-key itself. - common.EcSignedPreKey signed_pre_key = 2 [(require.present) = true]; -} - -message SetKemLastResortPreKeyRequest { - // The identity type (i.e. ACI/PNI) with which this key is associated. - common.IdentityType identity_type = 1; - - // The signed KEM pre-key itself. - common.KemSignedPreKey signed_pre_key = 2 [(require.present) = true]; -} - -message SetPreKeyResponse { -} - -message CheckIdentityKeyRequest { - // The service identifier of the account for which we want to check the associated identity key fingerprint. - common.ServiceIdentifier target_identifier = 1; - // The most significant 4 bytes of the SHA-256 hash of the identity key associated with the target account/identity type. - bytes fingerprint = 2 [(require.exactlySize) = 4]; -} - -message CheckIdentityKeyResponse { - // The service identifier of the account for which there is a mismatch between the client and server identity key fingerprints. - common.ServiceIdentifier target_identifier = 1; - // The identity key that is stored by the server for the target account/identity type. - bytes identity_key = 2; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/login_purchase.proto b/pkg/signalmeow/protobuf/org/signal/chat/login_purchase.proto deleted file mode 100644 index 236deb5..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/login_purchase.proto +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.purchase; - -import "org/signal/chat/require.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/tag.proto"; -import "org/signal/chat/subscriptions.proto"; - -// Service for one-time purchases of logins -service LoginPurchase { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Obtain a ZK receipt credential for a completed one-time login payment. - // - // The receipt credential can then be presented at registration - rpc CreateLoginReceiptCredential(CreateLoginReceiptCredentialRequest) returns (CreateLoginReceiptCredentialResponse) {} -} - -message CreateLoginReceiptCredentialRequest { - // The payment processor. Currently, only GOOGLE_PLAY_BILLING and - // APPLE_APP_STORE are supported. - PaymentProvider processor = 1 [(require.specified) = true]; - - // The identifier of a completed purchase for a signal login within the - // payment provider - string purchase_identifier = 2 [(require.nonEmpty) = true]; - - // The receipt credential request. Subsequent retries to create a login - // credential for the same purchase_identifier must use an identical - // receipt_credential_request. - // - // Callers must validate that the generated receipt credential has the - // following properties: - // - // - Level == 300 (The login level) - // - ExpirationTime % 86400 == 0 - // - ExpirationTime == PurchaseTime + (5 * 366 * 86400) +/- (7 * 86400) - bytes receipt_credential_request = 3 [(require.nonEmpty) = true]; -} - -message CreateLoginReceiptCredentialResponse { - message CreateLoginReceiptCredentialResult { - bytes receipt_credential_response = 1; - } - - oneof response { - CreateLoginReceiptCredentialResult result = 1; - // The purchase is still pending with the payment provider. The client may retry later. - errors.FailedPrecondition payment_still_processing = 2 [(tag.reason) = "payment_still_processing"]; - // The purchase did not complete successfully. - PaymentRequired payment_required = 3 [(tag.reason) = "payment_required"]; - // The payment provider has no purchase with the provided purchase_identifier - errors.NotFound payment_not_found = 4 [(tag.reason) = "payment_not_found"]; - // The purchase was already redeemed for a receipt credential, but with a different receipt credential request - errors.FailedPrecondition receipt_already_issued = 5 [(tag.reason) = "receipt_already_issued"]; - } -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/messages.proto b/pkg/signalmeow/protobuf/org/signal/chat/messages.proto deleted file mode 100644 index b6bb6a7..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/messages.proto +++ /dev/null @@ -1,437 +0,0 @@ -/* - * Copyright 2025 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.messages; - -import "google/protobuf/empty.proto"; - -import "org/signal/chat/common.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/tag.proto"; - -import "signalpb/SignalService.proto"; - -// Provides methods for sending "unsealed sender" messages. -service Messages { - - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Sends an "unsealed sender" message to all devices linked to a single - // destination account. - // - // The destination account must not be the same as the authenticated caller. - // Callers should use `SendSyncMessage` to send messages to themselves. - rpc SendMessage(SendAuthenticatedSenderMessageRequest) returns (SendMessageAuthenticatedSenderResponse) {} - - // Sends a "sync" message to all other devices linked to the authenticated - // sender's account. - rpc SendSyncMessage(SendSyncMessageRequest) returns (SendMessageAuthenticatedSenderResponse) {} - - // Retrieve messages for the authenticated device. When the caller receives - // and successfully processes a message returned in a GetMessagesResponse they - // must send a corresponding GetMessagesRequest indicating that the message - // has been processed (an ack). Acks should only be sent for messages - // delivered via the currently open RPC. - // - // Only the first GetMessagesRequest may contain request parameters that - // configure the stream. The first request must not contain an ack. - // - // The server will keep the stream open until the client disconnects. Only - // one GetMessages stream may be open per device. If a second GetMessages - // stream is opened, the server may terminate any of the streams with - // a STREAM_CLOSED error reason. A GetMessagesStreamClosed message will be - // present in the error details. - rpc GetMessages(stream GetMessagesRequest) returns (stream GetMessagesResponse) {} -} - -message GetMessagesRequest { - message GetMessageOptions { - // If present and true, the server will not deliver any messages with the - // story flag set. This flag may only be set on the first GetMessagesRequest - // sent from the client to the server in an RPC stream. - bool drop_stories = 1; - } - oneof request { - // Configuration options for the message stream. Required for the first - // request of the stream, forbidden on subsequent reqeusts. - GetMessageOptions options = 1; - - // The server_guid of an envelope previously returned in a - // GetMessagesResponse that has been successfully processed by the caller. - // Forbidden on the first request of the stream, required on subsequent - // requests. - bytes server_guid_ack = 2; - } -} - -// The reason why a GetMessages RPC is being closed by the server. -message GetMessagesStreamClosed { - oneof reason { - // Another caller has opened a GetMessages stream for the same device. - google.protobuf.Empty conflicting_stream = 1; - } -} - -message GetMessagesResponse { - oneof response { - // A message. On successful receipt of an envelope the caller should ack - // the envelope by sending a GetMessagesRequest with the envelope's server - // guid. Acks should only be sent for envelopes received on the currently - // open RPC. - signalservice.Envelope envelope = 1; - - // An indicator that all outstanding messages for the device have been - // drained and acked by the client. The stream will remain open and continue - // to deliver newly arrived messages. - google.protobuf.Empty queue_empty = 2; - } -} - -// Provides methods for sending "sealed sender" messages. -service MessagesAnonymous { - - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Sends a "sealed sender" message to all devices linked to a single - // destination account. - // - // If this RPC is authorized with an unidentified access key, it will fail - // with an authorization failure if the credential is invalid OR if the - // destination account was not found. If it is authorized using a group send - // token, it will fail with an authorization failure if the credential is - // invalid and with an destination not found error if the account does not - // exist - rpc SendSingleRecipientMessage(SendSealedSenderMessageRequest) returns (SendMessageResponse) {} - - // Sends a "sealed sender" message with a common payload to all devices linked - // to multiple destination accounts. - rpc SendMultiRecipientMessage(SendMultiRecipientMessageRequest) returns (SendMultiRecipientMessageResponse) {} - - // Sends a story message to devices linked to a single destination account. - rpc SendStory(SendStoryMessageRequest) returns (SendMessageResponse) {} - - // Sends a story message with a common payload to devices linked to devices - // linked to multiple destination accounts. - rpc SendMultiRecipientStory(SendMultiRecipientStoryRequest) returns (SendMultiRecipientMessageResponse) {} -} - -message IndividualRecipientMessageBundle { - - // A message for an individual device linked to a destination account. - message Message { - - // The registration ID for the destination device. - uint32 registration_id = 1 [(require.range).max = 0x3fff]; - - // The content of the message to deliver to the destination device. - bytes payload = 2 [(require.size) = {min: 1, max: 262144}]; // 256 KiB - - // The message type of the message. If this message is part of an - // unidentified send, this must be UNIDENTIFIED_SENDER - SendMessageType type = 3; - } - - // The time, in milliseconds since the epoch, at which this message was - // originally sent from the perspective of the sender. Note that the maximum - // allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date - // for additional details and discussion. - uint64 timestamp = 1 [(require.range).min = 1, (require.range).max = 8640000000000000]; - - // A map of device IDs to individual messages. Generally, callers must include - // one message for each device linked to the destination account. In cases of - // "sync messages" where a sender is distributing information to other devices - // linked to the sender's account, senders may omit a message for the sending - // device. - map messages = 2 [(require.nonEmpty) = true]; -} - -enum SendMessageType { - UNSPECIFIED = 0; - - // A double-ratchet message represents a "normal," "unsealed-sender" message - // encrypted using the Double Ratchet within an established Signal session. - DOUBLE_RATCHET = 1; - - // 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. - PREKEY_MESSAGE = 2; - - // 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 = 3; - - // An unidentified sender message is an encrypted message. No other - // information about the type of the encrypted message is known to the server. - // - // Unidenitfied sender messages require an unidentified access token or a - // group send endorsement token to prove the unidentified sender is authorized - // to send messages to the destination. - UNIDENTIFIED_SENDER = 4; -} - -message SendAuthenticatedSenderMessageRequest { - - // The service identifier of the account to which to deliver the message. - common.ServiceIdentifier destination = 1; - - // If true, this message will only be delivered to destination devices that - // have an active message delivery channel with a Signal server. - bool ephemeral = 2; - - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - bool urgent = 3; - - // The messages to send to the destination account. - IndividualRecipientMessageBundle messages = 4; -} - -message SendMessageAuthenticatedSenderResponse { - - // The outcome of the message delivery - oneof response { - - // The message was successfully delivered to all destination devices - google.protobuf.Empty success = 1; - - // A list of discrepancies between the destination devices identified in a - // request to send a message and the devices that are actually linked to an - // account. - MismatchedDevices mismatched_devices = 2 [(tag.reason) = "mismatched_devices"]; - - // A description of a challenge callers must complete before sending - // additional messages. - ChallengeRequired challenge_required = 3 [(tag.reason) = "challenge_required"]; - - // The destination account did not exist - errors.NotFound destination_not_found = 4 [(tag.reason) = "destination_not_found"]; - - } -} - - -message SendSyncMessageRequest { - - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - bool urgent = 1; - - // The messages to send to the destination account. - IndividualRecipientMessageBundle messages = 2; -} - -message SendSealedSenderMessageRequest { - - // The service identifier of the account to which to deliver the message. - common.ServiceIdentifier destination = 1; - - // If true, this message will only be delivered to destination devices that - // have an active message delivery channel with a Signal server. - bool ephemeral = 2; - - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - bool urgent = 3; - - // The messages to send to the destination account. - IndividualRecipientMessageBundle messages = 4; - - // A means to authorize the request. - oneof authorization { - - // The unidentified access key (UAK) for the destination account. - bytes unidentified_access_key = 5 [(require.exactlySize) = 16]; - - // A group send endorsement token for the destination account. - bytes group_send_token = 6; - - // The destination account allows unrestricted unidentified access - google.protobuf.Empty unrestricted_access = 7; - } -} - -message SendStoryMessageRequest { - - // The service identifier of the account to which to deliver the message. - common.ServiceIdentifier destination = 1; - - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - bool urgent = 2; - - // The messages to send to the destination account. - IndividualRecipientMessageBundle messages = 3; -} - -message SendMessageResponse { - - // The outcome of the message delivery - oneof response { - - // The message was successfully delivered to all destination devices - google.protobuf.Empty success = 1; - - // A list of discrepancies between the destination devices identified in a - // request to send a message and the devices that are actually linked to an - // account. - MismatchedDevices mismatched_devices = 2 [(tag.reason) = "mismatched_devices"]; - - // The provided unidentified authorization credential was invalid - errors.FailedUnidentifiedAuthorization failed_unidentified_authorization = 3 [(tag.reason) = "failed_unidentified_authorization"]; - - // The destination account did not exist - errors.NotFound destination_not_found = 4 [(tag.reason) = "destination_not_found"]; - - } -} - -message MultiRecipientMessage { - - // The time, in milliseconds since the epoch, at which this message was - // originally sent from the perspective of the sender. Note that the maximum - // allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date - // for additional details and discussion. - uint64 timestamp = 1 [(require.range).min = 1, (require.range).max = 8640000000000000]; - - // The serialized multi-recipient message payload. - bytes payload = 2 [(require.size).max = 762144]; // 256 KiB payload + (5000 * 100) of overhead -} - -message SendMultiRecipientMessageRequest { - - // If true, this message will only be delivered to destination devices that - // have an active message delivery channel with a Signal server. - bool ephemeral = 1; - - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - bool urgent = 2; - - // The multi-recipient message to send to all destination accounts and - // devices. - MultiRecipientMessage message = 3; - - // A group send endorsement token for the destination account. - bytes group_send_token = 4 [(require.nonEmpty) = true]; -} - -message SendMultiRecipientStoryRequest { - - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - bool urgent = 1; - - // The multi-recipient story message to send to all destination accounts and - // devices. - MultiRecipientMessage message = 2; -} - -message MultiRecipientSuccess { - // A list of destination service identifiers that could not be resolved to - // registered Signal accounts. The message in the original request was sent - // to all service identifiers/devices in the original request except for the - // destination devices associated with the service identifiers in this list. - repeated common.ServiceIdentifier unresolved_recipients = 1; -} - -message SendMultiRecipientMessageResponse { - - // The outcome of the message delivery - oneof response { - // The message was sent to at least some of the destination accounts/devices - // identified in the original request. - MultiRecipientSuccess success = 1; - - // A list of sets of discrepancies between the destination devices - // identified in a request to send a message and the devices that are - // actually linked to a destination account. - MultiRecipientMismatchedDevices mismatched_devices = 2 [(tag.reason) = "mismatched_devices"]; - - // The provided unidentified authorization credential was invalid - errors.FailedUnidentifiedAuthorization failed_unidentified_authorization = 3 [(tag.reason) = "failed_unidentified_authorization"]; - } -} - -message MismatchedDevices { - - // The service identifier to which the devices named in this object are - // linked. - common.ServiceIdentifier service_identifier = 1; - - // A list of device IDs that are linked to the destination account, but were - // not included in the collection of messages bound for the destination - // account. - repeated uint32 missing_devices = 2 [(require.each) = {range: {max: 0x7f}}]; - - // A list of device IDs that were included in the collection of messages bound - // for the destination account, but are not currently linked to the - // destination account. - repeated uint32 extra_devices = 3 [(require.each) = {range: {max: 0x7f}}]; - - // A list of device IDs that present in the collection of messages bound for - // the destination account and are linked to the destination account, but have - // a different registration ID than the registration ID presented by the - // sender (indicating that the destination device has likely been replaced by - // another device). - repeated uint32 stale_devices = 4 [(require.each) = {range: {max: 0x7f}}]; -} - -message MultiRecipientMismatchedDevices { - - // A list of sets of discrepancies between the destination devices identified - // in a request to send a message and the devices that are actually linked to - // a destination account. - repeated MismatchedDevices mismatched_devices = 1; -} - -message ChallengeRequired { - - enum ChallengeType { - UNSPECIFIED = 0; - - // A challenge that callers can fulfill by completing a captcha. - CAPTCHA = 1; - - // A challenge that callers can fulfill by supplying a token delivered via - // push notification. - PUSH_CHALLENGE = 2; - }; - - // An opaque token identifying this challenge request. Clients must generally - // submit this token when submitting a challenge response. - string token = 1; - - // A list of challenge types callers may choose to complete to resolve the - // challenge requirement. May be empty, in which case callers cannot resolve - // the challenge by any means other than waiting. - repeated ChallengeType challenge_options = 2; - - // A duration (in seconds) after which the challenge requirement may be - // resolved by simply waiting. May not be set if the challenge cannot be - // resolved by waiting. - optional uint64 retry_after_seconds = 3; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/one_time_donations.proto b/pkg/signalmeow/protobuf/org/signal/chat/one_time_donations.proto deleted file mode 100644 index 11e53ab..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/one_time_donations.proto +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.purchase; - -import "org/signal/chat/require.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/tag.proto"; -import "org/signal/chat/subscriptions.proto"; - -// Service for making one-time donation payments (boost and gift) -// -// Configuration for one-time donations can be found in ProductConfiguration. -service OneTimeDonations { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Create a Stripe payment intent and return a client secret that can be used to complete the payment. - // Once the payment is complete, the paymentIntentId can be used with CreateBoostReceiptCredentials - rpc CreateBoost(CreateBoostRequest) returns (CreateBoostResponse) {} - - // Create a PayPal one-time payment. - // Once the payment is complete, call ConfirmPayPalBoost with the payment ID and token - rpc CreatePayPalBoost(CreatePayPalBoostRequest) returns (CreatePayPalBoostResponse) {} - - // Confirm a PayPal one-time payment - rpc ConfirmPayPalBoost(ConfirmPayPalBoostRequest) returns (ConfirmPayPalBoostResponse) {} - - // Obtain a ZK receipt credential for a completed one-time donation payment. - // The receipt credential can then be used to redeem the one-time donation entitlement - // via Donations.RedeemReceipt - rpc CreateBoostReceiptCredentials(CreateBoostReceiptCredentialsRequest) returns (CreateBoostReceiptCredentialsResponse) {} -} - -// The amount is below the minimum for the currency. -message AmountBelowMinimumError { - // The minimum amount for the currency - string minimum = 1; -} - -// The SEPA Direct Debit amount exceeds the allowed maximum. -message AmountAboveSepaLimitError { - // The maximum amount for a SEPA transaction - string maximum = 1; -} - -message CreateBoostRequest { - // ISO 4217 currency code, case-insensitive (e.g. "usd", "EUR") - string currency = 1 [(require.exactlySize) = 3]; - // The amount to pay in the [currency's minor unit](https://docs.stripe.com/currencies#minor-units) - uint64 amount = 2 [(require.range).min = 1]; - // The level for the boost payment - uint64 level = 3 [(require.range).min = 1]; - // The payment method - PaymentMethod payment_method = 4 [(require.specified) = true]; - // A donation permit retrieved from Donations.createDonationPermit - bytes donation_permit = 5 [(require.nonEmpty) = true]; -} - -message CreateBoostResponse { - oneof response { - // A client secret that can be used to complete a stripe PaymentIntent - string client_secret = 1; - // The amount is below the minimum for the currency - AmountBelowMinimumError amount_below_minimum = 2 [(tag.reason) = "amount_below_minimum"]; - // The amount exceeds the maximum for SEPA Direct Debit - AmountAboveSepaLimitError amount_above_sepa_limit = 3 [(tag.reason) = "amount_above_sepa_limit"]; - // The requested currency is not supported for the given payment method - errors.FailedPrecondition unsupported_currency = 4 [(tag.reason) = "unsupported_currency"]; - // The requested level is not a valid one-time donation level - errors.FailedPrecondition unsupported_level = 5 [(tag.reason) = "unsupported_level"]; - // Donation permit was invalid or already spent - errors.FailedZkAuthentication permit_rejected = 6 [(tag.reason) = "permit_rejected"]; - // The amount in the specified currency is not supported by the payment provider - errors.FailedPrecondition invalid_amount = 7 [(tag.reason) = "invalid_amount"]; - } -} - -message CreatePayPalBoostRequest { - // ISO 4217 currency code, case-insensitive (e.g. "usd", "EUR") - string currency = 1 [(require.exactlySize) = 3]; - // Amount in the currency's minor unit (e.g. cents for USD), must be >= 1 - uint64 amount = 2 [(require.range).min = 1]; - // Donation level. - uint64 level = 3 [(require.range).min = 1]; - // URL to redirect the user to after PayPal approval - string return_url = 4 [(require.nonEmpty) = true]; - // URL to redirect the user to if they cancel - string cancel_url = 5 [(require.nonEmpty) = true]; -} - -message CreatePayPalBoostResponse { - message CreatePayPalBoostResult { - string approval_url = 1; - string payment_id = 2; - } - oneof response { - CreatePayPalBoostResult result = 1; - // The amount is below the minimum for the currency - AmountBelowMinimumError amount_below_minimum = 2 [(tag.reason) = "amount_below_minimum"]; - // The requested currency is not supported for PayPal - errors.FailedPrecondition unsupported_currency = 3 [(tag.reason) = "unsupported_currency"]; - // The requested level is not a valid one-time donation level - errors.FailedPrecondition unsupported_level = 4 [(tag.reason) = "unsupported_level"]; - } -} - -message ConfirmPayPalBoostRequest { - // ISO 4217 currency code, case-insensitive (e.g. "usd", "EUR") - string currency = 1 [(require.exactlySize) = 3]; - // Amount in the currency's minor unit, must be >= 1 - uint64 amount = 2 [(require.range).min = 1]; - // Donation level. - uint64 level = 3 [(require.range).min = 1]; - // PayPal payer ID from the approval redirect - string payer_id = 4 [(require.nonEmpty) = true]; - // PayPal payment ID (PAYID-…) from CreatePayPalBoost - string payment_id = 5 [(require.nonEmpty) = true]; - // PayPal payment token (EC-…) from the approval redirect - string payment_token = 6 [(require.nonEmpty) = true]; -} - -message ConfirmPayPalBoostResponse { - message ConfirmPayPalBoostResult { - string payment_id = 1; - } - oneof response { - ConfirmPayPalBoostResult result = 1; - // The amount is below the minimum for the currency - AmountBelowMinimumError amount_below_minimum = 2 [(tag.reason) = "amount_below_minimum"]; - // The requested currency is not supported for PayPal - errors.FailedPrecondition unsupported_currency = 3 [(tag.reason) = "unsupported_currency"]; - // The requested level is not a valid one-time donation level - errors.FailedPrecondition unsupported_level = 4 [(tag.reason) = "unsupported_level"]; - // The payment failed; see charge failure details - ChargeFailure charge_failure = 5 [(tag.reason) = "charge_failure"]; - } -} - -message CreateBoostReceiptCredentialsRequest { - // a payment ID from the processor - string payment_intent_id = 1 [(require.nonEmpty) = true]; - // ZK blind-signature receipt credential request bytes - bytes receipt_credential_request = 2 [(require.nonEmpty) = true]; - // The processor that handled the payment - PaymentProvider processor = 3 [(require.specified) = true]; -} - -message CreateBoostReceiptCredentialsResponse { - message CreateBoostReceiptCredentialsResult { - bytes receipt_credential_response = 1; - } - oneof response { - CreateBoostReceiptCredentialsResult result = 1; - // Payment is still processing; client should retry - errors.FailedPrecondition payment_still_processing = 2 [(tag.reason) = "payment_still_processing"]; - // Payment failed - PaymentRequired payment_required = 3 [(tag.reason) = "payment_required"]; - // Payment intent not found - errors.NotFound payment_not_found = 4 [(tag.reason) = "payment_not_found"]; - // A receipt credential was already issued for this payment - errors.FailedPrecondition receipt_already_issued = 5 [(tag.reason) = "receipt_already_issued"]; - } -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/payments.proto b/pkg/signalmeow/protobuf/org/signal/chat/payments.proto deleted file mode 100644 index 79e9455..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/payments.proto +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.payments; - -import "org/signal/chat/require.proto"; - -// Provides methods for working with payments. -service Payments { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - - rpc GetCurrencyConversions(GetCurrencyConversionsRequest) returns (GetCurrencyConversionsResponse) {} -} - -message GetCurrencyConversionsRequest { -} - -message GetCurrencyConversionsResponse { - - message CurrencyConversionEntity { - - string base = 1; - - map conversions = 2; - } - - uint64 timestamp = 1; - - repeated CurrencyConversionEntity currencies = 2; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/product_configuration.proto b/pkg/signalmeow/protobuf/org/signal/chat/product_configuration.proto deleted file mode 100644 index c9e894e..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/product_configuration.proto +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.purchase; - -import "org/signal/chat/require.proto"; -import "org/signal/chat/subscriptions.proto"; - -// Retrieve product metadata for one-time donations, subscriptions, and backups -service ProductConfiguration { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Returns configuration for donation subscriptions, backup subscriptions, and one-time donation ( - // "boost" and "gift") minimum and suggested amounts. Badges are referenced by ID only; resolve those - // IDs to full badge details via RemoteConfiguration.GetBadges. - rpc GetConfiguration(GetConfigurationRequest) returns (GetConfigurationResponse) {} -} - -message GetConfigurationRequest {} - -message GetConfigurationResponse { - // Map of lower-cased ISO 3 currency codes to currency-specific configuration - map currencies = 1; - // Map of numeric donation level IDs to level-specific badge configuration - map badge_levels = 2; - // Configuration for backup subscription options - BackupConfiguration backup = 3; - // Maximum value of a one-time SEPA donation - string sepa_maximum_euros = 4; - // Configuration for one-time Signal Login purchases - LoginConfiguration login = 5; -} - -message AmountList { - // NOTE: this is a string instead of a numeric type because it is intended - // for display purposes only - repeated string amounts = 1; -} - -message CurrencyConfiguration { - // Minimum one-time donation - // NOTE: this is a string instead of a numeric type because it is intended - // for display purposes only - string minimum = 1; - // Map of one-time donation level IDs to suggested amounts - map one_time = 2; - // Map of subscription level IDs to the amount charged - map subscription = 3; - // Map of backup subscription level IDs to the amount charged - map backup_subscription = 4; - repeated PaymentMethod supported_payment_methods = 5; -} - -message LevelConfiguration { - // The ID of the badge awarded at this level. Resolve to full badge details - // via RemoteConfiguration.GetBadges. - string badge_id = 1; - - // The duration for which a badge is valid. Present only for - // one-time (boost, gift) badges - optional uint64 badge_duration_seconds = 2; -} - -// Configuration for a backup level - use to present appropriate client interfaces -message BackupLevelConfiguration { - // The amount of media storage in bytes that a paying subscriber may store - uint64 storage_allowance_bytes = 1; - // The play billing productID associated with this backup level - string play_product_id = 2; - // The duration, in days, for which your backed up media is retained on the server after you stop refreshing with a paid credential - uint64 media_ttl_days = 3; -} - -message BackupConfiguration { - // A map of numeric backup level IDs to level-specific backup configuration - map levels = 1; - // The number of days of media a free tier backup user gets - uint64 free_tier_media_days = 2; -} - -// Configuration for one-time Signal Login purchases -message LoginConfiguration { - // The receipt level associated with a Signal Login purchase - uint64 level = 1; - // The play billing productID associated with a Signal Login purchase - string play_product_id = 2; - // The App Store productID associated with a Signal Login purchase - string app_store_product_id = 3; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/profile.proto b/pkg/signalmeow/protobuf/org/signal/chat/profile.proto deleted file mode 100644 index 78d4370..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/profile.proto +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.profile; - -import "google/protobuf/empty.proto"; - -import "org/signal/chat/common.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/tag.proto"; - -// Provides methods for working with profiles and profile-related data. -service Profile { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Sets profile data and, if needed, returns credentials used by clients to upload a v1 avatar. - rpc SetProfile(SetProfileRequest) returns (SetProfileResponse) {} - - // Retrieves profile data. Callers with an unidentified access key for the account - // should use the version of this method in `ProfileAnonymous` instead. - rpc GetProfile(GetProfileRequest) returns (GetProfileResponse) {} - - // Returns anonymous credentials that may be presented with avatar operations in ProfilesAnonymous - // - // Note: `Accounts.SetZkCredentialKey` is a pre-requisite for this RPC - rpc GetAvatarCredentials(GetAvatarCredentialsRequest) returns (GetAvatarCredentialsResponse) {} -} - -// Provides methods for working with profiles and profile-related data using "unidentified access" -// credentials. Callers must not submit any self-identifying credentials -// when calling methods in this service and must instead present the targeted account's -// unidentified access key as an anonymous authentication mechanism. Callers -// without an unidentified access key should use the equivalent, authenticated -// methods in `Profile` instead. -service ProfileAnonymous { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - - // Retrieves profile data. - rpc GetProfile(GetProfileAnonymousRequest) returns (GetProfileAnonymousResponse) {} - - // Retrieves a profile key credential. - rpc GetExpiringProfileKeyCredential(GetExpiringProfileKeyCredentialAnonymousRequest) returns (GetExpiringProfileKeyCredentialAnonymousResponse) {} - - // Returns credentials to upload a v2 avatar. After uploading the avatar, the client - // must call SetProfile with the new avatar URL in the encrypted `data`. - // - // Because avatars are uploaded anonymously, they have an expiration equal to the - // idle account expiration. Clients must periodically (recommended: every 90 days) - // call ExtendAvatarTTL to extend the TTl. - // - // Note: any existing avatar associated with these credentials will be deleted immediately - rpc GetAvatarUploadForm(GetAvatarUploadFormRequest) returns (GetAvatarUploadFormResponse) {} - - // Extends the TTL of the avatar currently associated with the request’s avatar auth credential - rpc ExtendAvatarTTL(ExtendAvatarTTLRequest) returns (ExtendAvatarTTLResponse) {} - - // Deletes the avatar currently associated with the request’s avatar auth credential. - // - // Clients must also call SetProfile to remove the avatar from the encrypted `data`. - rpc DeleteAvatar(DeleteAvatarRequest) returns (DeleteAvatarResponse) {} -} - -message SetProfileV1Request { - enum AvatarChange { - AVATAR_CHANGE_UNCHANGED = 0; - AVATAR_CHANGE_CLEAR = 1; - AVATAR_CHANGE_UPDATE = 2; - } - - // The ciphertext of a name that users must set on the profile. - bytes name = 1 [(require.exactlySize) = 81, (require.exactlySize) = 285]; - - // An enum to indicate what change, if any, is made to the avatar with this request. - AvatarChange avatar_change = 2; - - // The ciphertext of an emoji that users can set on their profile. - bytes about_emoji = 3 [(require.exactlySize) = 0, (require.exactlySize) = 60]; - - // The ciphertext of a description that users can set on their profile. - bytes about = 4 [(require.exactlySize) = 0, (require.exactlySize) = 156, (require.exactlySize) = 282, (require.exactlySize) = 540]; - - // The ciphertext of the phone-number sharing setting on the profile. 29-byte encrypted boolean. - bytes phone_number_sharing = 6 [(require.exactlySize) = 29]; -} - -message SetProfileRequest { - - // The profile version. Required. - bytes version = 1 [(require.exactlySize) = 32]; - - // The ciphertext of a serialized Profile protobuf. Required. - // 937 max length = 909 plaintext serialization + 28 bytes encryption overhead - bytes data = 2 [(require.nonEmpty) = true, (require.size).max = 937]; - - // The SHA-256 hash of the Profile ciphertext being replaced. - // This is used an optimistic lock against concurrent changes. - // - // Optional, if this is the initial request to create a version. - bytes expected_current_data_hash = 3 [(require.exactlySize) = 0, (require.exactlySize) = 32]; - - // The current profile version being updated. - // This is used as an optimistic lock against concurrent changes. - // - // Optional, if there is no current profile version for the account. - bytes expected_current_version = 4 [(require.exactlySize) = 0, (require.exactlySize) = 32]; - - // The ciphertext of the MobileCoin wallet ID on the profile. - bytes payment_address = 5 [(require.exactlySize) = 0, (require.exactlySize) = 582]; - - // A list of badge IDs associated with the profile. - repeated string badge_ids = 6; - - // The profile key commitment. Used to issue a profile key credential response. - // - // Required during the v1 -> v2 migration period. Afterwards will be optional, if this is an update to an existing version. - bytes commitment = 7 [(require.exactlySize) = 0, (require.exactlySize) = 97]; - - // An embedded v1 request. Required during the v1 -> v2 migration period. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - SetProfileV1Request v1Request = 15 [(require.present) = true]; - - // next: 8 -} - -// Indicates that the account is not permitted to set a payment address, -// due to a disallowed country prefix on the account's phone number. -message PaymentsForbiddenInRegion {} - -// Indicates that the account does not have the Profiles v2 capability, which -// is required to call Profiles.SetProfile -message ProfilesV2CapabilityRequired {} - - -message SetProfileResult { - // If the request included a v1 avatar change, this field contains the policy - // and credential used by clients to upload an avatar to the CDN. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - optional common.S3UploadForm v1_avatar_upload_form = 15; - - // next: 1 -} - -message SetProfileResponse { - oneof response { - SetProfileResult result = 1; - // The current data hash did not match the request's expectation, indicating - // another device on the account may have written an update the caller does not know about. - errors.FailedPrecondition expected_data_write_conflict = 2 [(tag.reason) = "expected_data_write_conflict"]; - // Payments are not permitted in the account's region, based on its phone - // number or the caller's IP address if the account does not have a phone - // number. The request should be retried without `payment_address. - PaymentsForbiddenInRegion payments_forbidden_in_region = 3 [(tag.reason) = "payments_forbidden_in_region"]; - // The current version did not match the request's expectation, indicating - // another device on the account may have created a new version the caller does not know about. - errors.FailedPrecondition expected_version_write_conflict = 4 [(tag.reason) = "expected_version_write_conflict"]; - - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - ProfilesV2CapabilityRequired profiles_v2_capability_required = 15 [(tag.reason) = "profiles_v2_capability_required"]; - - // next: 4 - } -} - -message GetProfileRequest { - // The ACI of the account for which to get profile data. - common.ServiceIdentifier account_identifier = 1 [(require.present) = true, (require.identityType) = IDENTITY_TYPE_ACI]; - // The profile version to retrieve. - bytes version = 2 [(require.exactlySize) = 32]; - - // The `etag` from the previous request for this Profile version. If - // unchanged, the response will omit `profile` and `etag_matched` will be - // `true`. - bytes etag = 3 [(require.exactlySize) = 0, (require.exactlySize) = 10]; -} - -message GetProfileAnonymousRequest { - // Contains the data necessary to request a profile. - GetProfileRequest request = 1 [(require.present) = true]; - oneof authentication { - // The unidentified access key for the targeted account. - bytes unidentified_access_key = 2 [(require.exactlySize) = 16]; - - // A group send endorsement token for the targeted account. - bytes group_send_token = 3 [(require.nonEmpty) = true]; - } -} - -message AccountInfo { - // The account identity key of the targeted account. - bytes identity_key = 1; - - // A checksum of the unidentified access key for the targeted account. - bytes unidentified_access_key_fingerprint = 2; - - // Whether the account has enabled sealed sender from anyone. - bool unrestricted_unidentified_access = 3; - - // A list of the badges ids associated with the account. Metadata to display - // badges may be obtained by cross-referencing badge ids with - // RemoteConfiguration.GetBadges. - repeated string badge_ids = 4; -} - -message ProfileResult { - // The ciphertext of the requested version of the profile - bytes data = 1; - - // The ciphertext of the MobileCoin wallet ID on the profile. - bytes payment_address = 2; - - // Information about the targeted account - AccountInfo account_info = 3; - - // An entity tag for the profile. This may be used in subsequent requests - // for this profile version to optimize bandwidth. - // - // Note that this hash will not match the expected_data_hash used on - // SetProfile for concurrency control. - // - // Clients may validate that the value has been correctly calculated by - // calculating a 10-byte truncated TupleHash256 as follows: - // - // ``` - // TupleHash256(S = "ProfileETag/v1", L = 80 bits, tuple = [ - // data, - // payment_address, - // account_info.identity_key, - // account_info.unidentified_access_key_fingerprint, - // account_info.unrestricted_unidentified_access ? 0x01 : 0x00, - // uint32BE(count(account_info.badge_ids)), - // utf8(id) for each id in sortLexAscendingByUtf8Bytes(account_info.badge_ids), - // ]) - //``` - // - // Absent/empty fields contribute an empty element (not zero bytes omitted): - // a missing payment_address is still a present, zero-length tuple element. - // - // This etag will always exclusively cover the documented fields. If fields - // are added in the future, a new etag field must be introduced. - bytes etag = 4; -} - -message LegacyProfileResult { - - // The ciphertext of the name on the profile. - bytes name = 1; - // The ciphertext of the description on the profile. - bytes about = 2; - // The ciphertext of the emoji on the profile. - bytes about_emoji = 3; - // The cdn0 path of the avatar on the profile. - string avatar = 4; - // The ciphertext of the phone-number sharing setting on the profile. - bytes phone_number_sharing = 5; - // The ciphertext of the MobileCoin wallet ID on the profile. - bytes payment_address = 6; - // Information about the targeted account - AccountInfo account_info = 7; -} - - -message GetProfileResponse { - oneof response { - // The full profile data. The current profile did not match the provided - // etag (or no etag was provided). - ProfileResult profile = 1; - - // The current profile matched the provided etag. If present, this will always be true. - bool etag_matched = 2 [(tag.reason) = "etag_match"]; - - errors.NotFound not_found = 3 [(tag.reason) = "not_found"]; - - // Will be present if there is no v2 Profile data for this version. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - LegacyProfileResult legacy_profile = 15 [(tag.reason) = "legacy_profile"]; - } - // next: 4 -} - -message GetProfileAnonymousResponse { - oneof response { - // The full profile data. The current profile did not match the provided - // etag (or no etag was provided). - ProfileResult profile = 1; - - // The current profile matched the provided etag. If present, this will always be true. - bool etag_matched = 2 [(tag.reason) = "etag_match"]; - - errors.NotFound not_found = 3 [(tag.reason) = "not_found"]; - errors.FailedUnidentifiedAuthorization failed_unidentified_authorization = 4 [(tag.reason) = "failed_unidentified_authorization"]; - - // Will be present if there is no v2 Profile data for this version. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - LegacyProfileResult profile_v1 = 15 [(tag.reason) = "profile_v1"]; - } - // next: 5 -} - -message GetExpiringProfileKeyCredentialRequest { - // The ACI of the account for which to get a profile key credential. - common.ServiceIdentifier account_identifier = 1 [(require.present) = true, (require.identityType) = IDENTITY_TYPE_ACI]; - // A zkgroup request for a profile key credential. - bytes credential_request = 2 [(require.nonEmpty) = true]; - // The type of credential being requested. - CredentialType credential_type = 3 [(require.specified) = true]; - // The profile version for which to generate a profile key credential. - bytes version = 4 [(require.exactlySize) = 32]; -} - -message GetExpiringProfileKeyCredentialAnonymousRequest { - // Contains the data necessary to request an expiring profile key credential. - GetExpiringProfileKeyCredentialRequest request = 1 [(require.present) = true]; - // The unidentified access key for the targeted account. - bytes unidentified_access_key = 2 [(require.exactlySize) = 16]; -} - -message GetExpiringProfileKeyCredentialResult { - // A zkgroup credential used by a client to prove that it has the profile key - // of a targeted account. - bytes profile_key_credential = 1; -} - -message GetExpiringProfileKeyCredentialAnonymousResponse { - oneof response { - GetExpiringProfileKeyCredentialResult result = 1; - errors.NotFound not_found = 2 [(tag.reason) = "not_found"]; - errors.FailedUnidentifiedAuthorization failed_unidentified_authorization = 3 [(tag.reason) = "failed_unidentified_authorization"]; - } -} - -enum CredentialType { - CREDENTIAL_TYPE_UNSPECIFIED = 0; - CREDENTIAL_TYPE_EXPIRING_PROFILE_KEY = 1; -} - -// avatar auth - -message GetAvatarCredentialsRequest { - bytes avatar_credentials_request = 1; -} - -message GetAvatarCredentialsResponse { - oneof response { - bytes avatar_credentials = 1; - - // the client must call Accounts.SetZkCredentialKey to call this method - errors.FailedPrecondition missing_zk_credential_key = 2 [(tag.reason) = "missing_zk_credential_key"]; - } -} - -message GetAvatarUploadFormRequest { - bytes avatar_credentials_presentation = 1; - - // The length of the attachment for the requested upload form. Uploads - // performed with this form will be limited to the provided length. - uint32 upload_length = 2 [(require.range) = {min: 1, max: 10485760 /* 10 MiB */}]; -} - -message GetAvatarUploadFormResponse { - oneof response { - common.S3UploadForm avatar_upload_form = 1; - - errors.FailedZkAuthentication invalid_credentials_presentation = 2 [(tag.reason) = "invalid_credentials_presentation"]; - } -} - -message ExtendAvatarTTLRequest { - bytes avatar_credentials_presentation = 1; -} - -message ExtendAvatarTTLResponse { - oneof response { - // The avatar that was extended. May be used as a check against state de-synchronization. - string path = 1; - errors.FailedZkAuthentication invalid_credentials_presentation = 2 [(tag.reason) = "invalid_credentials_presentation"]; - // the identity does not have an active avatar - errors.NotFound not_found = 3 [(tag.reason) = "no_active_avatar"]; - } -} - -message DeleteAvatarRequest { - bytes avatar_credentials_presentation = 1; -} - -message DeleteAvatarResponse { - oneof response { - google.protobuf.Empty success = 1; - errors.FailedZkAuthentication invalid_credentials_presentation = 2 [(tag.reason) = "invalid_credentials_presentation"]; - } -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/remote_configuration.proto b/pkg/signalmeow/protobuf/org/signal/chat/remote_configuration.proto deleted file mode 100644 index ffbfbcd..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/remote_configuration.proto +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.remoteconfiguration; - -import "org/signal/chat/common.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/tag.proto"; - -// Provides remote configuration applicable to the authenticated user -service RemoteConfiguration { - option (require.auth) = AUTH_ONLY_AUTHENTICATED; - - // Fetches the configuration for the authenticated user. Returned - // values are based on the authenticated account and caller's client platform, - // which is derived from the "User-Agent" header. - rpc GetConfiguration(GetConfigurationRequest) returns (GetConfigurationResponse) {} - - // Returns detailed information for all configured badges, keyed by badge ID. - // - // Badge descriptions may contain localized strings. Callers should set their - // language preferences via an "Accept-Language" header on the request - // https://datatracker.ietf.org/doc/html/rfc3282#section-3 - // - // Callers may cache a badges result for up to 1 day before checking (via - // etag) if there are any new updates. - rpc GetBadges(GetBadgesRequest) returns (GetBadgesResponse) {} -} - -message GetConfigurationRequest { - // If present, the etag from a prior GetConfigurationResponse. If the - // provided etag matches the current configuration etag, the server may elide - // the configuration response. - bytes etag = 1; -} - -message GetConfigurationResponse { - oneof response { - // The full configuration and corresponding etag. - TaggedConfiguration tagged_configuration = 1; - - // The etag in the request matched the current configuration etag. - bool etag_matched = 2 [(tag.reason) = "etag_match"]; - } -} - -message Configuration { - // A map of namespaced configuration keys to their resolved values. All - // configuration values are represented as strings. boolean values are - // represented as the strings "true" or "false". - map configuration = 1; -} - -message TaggedConfiguration { - Configuration configuration = 1; - - // An entity tag for `configuration`. This may be supplied in a - // subsequent request to optimize bandwidth when the configuration has not - // changed. - bytes etag = 2; -} - -message GetBadgesRequest { - // If present, the etag from a prior GetBadgesResponse. If the provided etag - // matches the current badge etag, the server may elide the badge response. - bytes etag = 1; -} - -message GetBadgesResponse { - oneof response { - // The full set of badges and corresponding etag. - TaggedBadges tagged_badges = 1; - - // The etag in the request matched the current badge etag. - bool etag_matched = 2 [(tag.reason) = "etag_match"]; - } -} - -message Badges { - // A map of badge ID to the detailed information for that badge. - map badges = 1; -} - -message TaggedBadges { - Badges badges = 1; - - // An entity tag for `badges`. This may be supplied in a subsequent request - // to optimize bandwidth when the set of badges has not changed. - bytes etag = 2; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/require.proto b/pkg/signalmeow/protobuf/org/signal/chat/require.proto deleted file mode 100644 index 868a3fe..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/require.proto +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2023 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.require; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.FieldOptions { - /* - * Requires a field to have content of non-zero size/length. - * Applies to both `optional` and regular fields, i.e. if the field is not set - * or has a default value, it's considered to be empty. This does not apply - * to fields that are contained in a `oneof`. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * string nonEmptyString = 1 [(require.nonEmpty) = true]; - * bytes nonEmptyBytes = 2 [(require.nonEmpty) = true]; - * optional string nonEmptyStringOptional = 3 [(require.nonEmpty) = true]; - * optional bytes nonEmptyBytesOptional = 4 [(require.nonEmpty) = true]; - * repeated string nonEmptyList = 5 [(require.nonEmpty) = true]; - * } - * ``` - * - * Applicable to fields of type `string`, `byte`, and `repeated` fields. - */ - optional bool nonEmpty = 70001; - - /* - * Requires a enum field to have value with an index greater than zero. - * Applies to both `optional` and regular fields, i.e. if the field is not set or has a default value, - * its index will be <= 0. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * Color color = 1 [(require.specified) = true]; - * } - * - * enum Color { - * COLOR_UNSPECIFIED = 0; - * COLOR_RED = 1; - * COLOR_GREEN = 2; - * COLOR_BLUE = 3; - * } - * ``` - */ - optional bool specified = 70002; - - /* - * Requires a size/length of a field to be within certain boundaries. - * Applies to both `optional` and regular fields, i.e. if the field is not set - * or has a default value, its size considered to be zero. However, if the - * field is contained in a `oneof` and is not set, this annotation does not - * apply. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * - * string name = 1 [(require.size) = {min: 3, max: 8}]; - * - * optional string address = 2 [(require.size) = {min: 3, max: 8}]; - * } - * ``` - * - * Applicable to fields of type `string`, `byte`, and `repeated` fields. - */ - optional SizeConstraint size = 70003; - - /* - * Requires a size/length of a field to be within certain boundaries. - * Applies to both `optional` and regular fields, i.e. if the field is not set - * or has a default value, its size considered to be zero. However, if the - * field is contained in a `oneof` and is not set, this annotation does not - * apply. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * - * string zip = 1 [(require.exactlySize) = 5]; - * - * optional string exactlySizeVariants = 2 [(require.exactlySize) = 2, (require.exactlySize) = 4]; - * } - * ``` - * - * Applicable to fields of type `string`, `byte`, and `repeated` fields. - */ - repeated uint32 exactlySize = 70004; - - /* - * Requires a value of a string field to be a valid E164-normalized phone number. - * If the field is `optional`, this check allows a value to be not set. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * string number = 1 [(require.e164)]; - * } - * ``` - */ - optional bool e164 = 70005; - - /* - * Requires an integer value to be within a certain range. The range boundaries are specified - * with the values of type `int32`, which should be enough for all practical purposes. - * - * If the field is `optional`, this check allows a value to be not set. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * int32 byte = 1 [(require.range) = {min: -128, max: 127}]; - * uint32 unsignedByte = 2 [(require.range).max = 255]; - * } - * ``` - */ - optional ValueRangeConstraint range = 70006; - - /* - * Require a value of a message field to be present. - * - * Applies to both `optional` and regular fields (both of which have explicit - * presence for the message type anyways). This does not apply to fields that - * are contained in a `oneof`. - * - * ``` - * import "org/signal/chat/require.proto"; - * message Data { - * message MyMessage {} - * MyMessage myMessage = 1 [(require.present) = true]; - * } - *```` - */ - optional bool present = 70007; - - /* - * Requires a value of a string field to be a valid base64 URL string. The - * string may be padded or unpadded. If the field is `optional`, this check - * allows a value to be not set. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * string myString = 1 [(require.base64url) = true]; - * } - * ``` - */ - optional bool base64url = 70008; - - /* - * Requires a common.ServiceIdentifier field to have its IdentityType - * be the given type (`aci` or `pni`). - * - * ``` - * import "org/signal/chat/require.proto"; - * import "org/signal/chat/common.proto"; - * - * message Data { - * common.ServiceIdentifier accountIdentifier = 1 [(require.identityType) = IDENTITY_TYPE_ACI]; - * } - * ``` - */ - optional IdentityType identityType = 70009; - - /* - * Applies element-wise constraints to the elements of a `repeated` field. - * Top-level `require.*` annotations on a `repeated` field constrain the - * collection itself (e.g. element count), `each` constrains the - * individual elements. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * message Data { - * // 1-20 username hashes, each exactly 32 bytes - * repeated bytes username_hashes = 1 [ - * (require.size) = {min: 1, max: 20}, - * (require.each) = { exactlySize: 32 } - * ]; - * } - * ``` - * - * Applicable only to `repeated` fields. - */ - optional ElementConstraint each = 70010; - - // next 70011 -} - -message ElementConstraint { - optional bool nonEmpty = 1; - optional SizeConstraint size = 2; - repeated uint32 exactlySize = 3; - optional bool e164 = 4; - optional bool base64url = 5; - optional ValueRangeConstraint range = 6; - optional IdentityType identityType = 7; - optional bool specified = 8; -} - -message SizeConstraint { - optional uint32 min = 1; - optional uint32 max = 2; -} - -message ValueRangeConstraint { - optional int64 min = 1; - optional int64 max = 2; -} - -extend google.protobuf.ServiceOptions { - /* - * Indicates that all methods in a given service require a certain kind of authentication. - * - * ``` - * import "org/signal/chat/require.proto"; - * - * service AuthService { - * option (require.auth) = AUTH_ONLY_AUTHENTICATED; - * - * rpc AuthenticatedMethod (google.protobuf.Empty) returns (google.protobuf.Empty) {} - * } - * ``` - */ - optional Auth auth = 71001; -} - -enum Auth { - AUTH_UNSPECIFIED = 0; - AUTH_ONLY_AUTHENTICATED = 1; - AUTH_ONLY_ANONYMOUS = 2; -} - -// This is duplicated from common.proto because: -// -// 1. importing would be a circular dependency -// 2. the canonical declaration belongs there -enum IdentityType { - IDENTITY_TYPE_UNSPECIFIED = 0; - IDENTITY_TYPE_ACI = 1; - IDENTITY_TYPE_PNI = 2; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/subscriptions.proto b/pkg/signalmeow/protobuf/org/signal/chat/subscriptions.proto deleted file mode 100644 index a820bac..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/subscriptions.proto +++ /dev/null @@ -1,441 +0,0 @@ -/* - * Copyright 2026 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.purchase; - -import "google/protobuf/empty.proto"; -import "org/signal/chat/common.proto"; -import "org/signal/chat/require.proto"; -import "org/signal/chat/errors.proto"; -import "org/signal/chat/tag.proto"; - -// Service for creating donation subscriptions -// -// Configuration for subscription levels can be found in ProductConfiguration. -service Subscriptions { - option (require.auth) = AUTH_ONLY_ANONYMOUS; - // Creates a subscriber record if it does not exist, otherwise refreshes its last access time. - - // Subscribers MUST periodically hit this endpoint to update the access time on the subscription record. Subscribers - // SHOULD attempt to make an update call approximately every 3 days. Not accessing this endpoint for an extended - // period of time will result in the subscription being canceled. - rpc UpdateSubscriber(UpdateSubscriberRequest) returns (UpdateSubscriberResponse) {} - - // Cancels any current subscription at the end of the current subscription period. - // - // Note: Apple IAP subscriptions do not support server-side cancellation, so this method should only be called after - // cancelling a subscription from storekit to keep server data up to date. - rpc DeleteSubscriber(DeleteSubscriberRequest) returns (DeleteSubscriberResponse) {} - - // Returns a client secret that can be used to set up a new payment method with the payment processor. - rpc CreatePaymentMethod(CreatePaymentMethodRequest) returns (CreatePaymentMethodResponse) {} - - // Returns a PayPal billing agreement approval URL and token that can be used to set up PayPal as a payment method. - rpc CreatePayPalPaymentMethod(CreatePayPalPaymentMethodRequest) returns (CreatePayPalPaymentMethodResponse) {} - - // Sets the default payment method for a subscriber. - rpc SetDefaultPaymentMethod(SetDefaultPaymentMethodRequest) returns (SetDefaultPaymentMethodResponse) {} - - // Sets the subscription level and currency for a subscriber. - rpc SetSubscriptionLevel(SetSubscriptionLevelRequest) returns (SetSubscriptionLevelResponse) {} - - // Returns information about the current subscription associated with the provided subscriberId if one exists. - // - // Although it uses [Stripe's values](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses), - // the status field in the response is generic, with [Braintree-specific values](https://developer.paypal.com/braintree/docs/guides/recurring-billing/overview#subscription-statuses) mapped - // to Stripe's. Since we don't support trials or unpaid subscriptions, the associated statuses will never be returned - // by the API. - rpc GetSubscriptionInformation(GetSubscriptionInformationRequest) returns (GetSubscriptionInformationResponse) {} - - // Create a receipt from a valid payment invoice that can be used to obtain an entitlement - // - // This request is repeatable so long as the ReceiptCredentialRequest remains the same. Clients should use the same - // ReceiptCredentialRequest value until they attempt to redeem the resulting ReceiptCredentialPresentation. After - // this point, the ReceiptCredentialRequest MUST NOT be reused or you may not be able to redeem a valid payment - // invoice. Clients SHOULD retry requests at this endpoint with the same ReceiptCredentialRequest value until - // receiving a response. After receiving a response, clients should then compute the ReceiptCredentialPresentation - // and redeem it at the receipt redemption endpoint. Once the first attempt is made there, the same - // ReceiptCredentialRequest MUST NOT be used again to request receipt credentials. - // - // Note that you may in fact redeem TWO or more invoices for the same ReceiptCredentialRequest while retrying this - // operation if a later invoice gets paid while you are retrying. However, the returned receipt is always for the - // latest invoice, so it will have the latest expiration possible and no entitlement time will be lost. The important - // thing is not to reuse ReceiptCredentialRequest after you have started attempting to redeem the associated - // ReceiptCredentialPresentation. Then you may produce a ReceiptCredentialPresentation for a later invoice that - // cannot be redeemed. - // - // Clients MUST validate that the generated receipt credential's level and expiration matches their expectations. - rpc GetReceiptCredentials(GetReceiptCredentialsRequest) returns (GetReceiptCredentialsResponse) {} - - // Set a token that represents an IAP subscription made with App Store/Google Play Billing. - // - // To set up an App Store subscription: - // 1. Create a subscriber with UpdateSubscriber (you must regularly refresh this subscriber) - // 2. [Create a subscription](https://developer.apple.com/documentation/storekit/in-app_purchase/) with the App Store - // directly via StoreKit and obtain a originalTransactionId. - // 3. Call this RPC with the originalTransactionId - // 4. Obtain a receipt via GetReceiptCredentials which can then be used to obtain the - // entitlement - // - // Play Billing: Set a purchaseToken that represents an IAP subscription made with Google Play Billing. - // - // To set up a subscription with Google Play Billing: - // 1. Create a subscriber with UpdateSubscriber (you must regularly refresh this subscriber) - // 2. [Create a subscription](https://developer.android.com/google/play/billing/integrate) with Google Play Billing - // directly and obtain a purchaseToken. Do not [acknowledge](https://developer.android.com/google/play/billing/integrate#subscriptions) - // the purchaseToken. - // 3. Call this RPC with the purchaseToken - // 4. Obtain a receipt via GetReceiptCredentials which can then be used to obtain the - // entitlement - // - // After calling this method, the payment is confirmed. Callers must durably store their subscriberId before calling - // this method to ensure their payment is tracked. - // - // Once a purchaseToken to is posted to a subscriberId, the same subscriberId must not be used with another payment - // method. A different playbilling purchaseToken can be posted to the same subscriberId, in this case the subscription - // associated with the old purchaseToken will be cancelled. - rpc SetIapSubscription(SetIapSubscriptionRequest) returns (SetIapSubscriptionResponse) {} - - // Returns a localized bank mandate for the specified bank transfer type - rpc GetBankMandate(GetBankMandateRequest) returns (GetBankMandateResponse) {} -} - -message UpdateSubscriberRequest { - bytes subscriber_id = 1 [(require.exactlySize) = 32]; - // A libsignal DonationPermit from rpc Donations.CreateDonationPermit. - // Not required if the subscriber already exists. - bytes donation_permit = 2; -} - -message UpdateSubscriberResponse { - oneof response { - google.protobuf.Empty success = 1; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 2 [(tag.reason) = "subscriber_id_mismatch"]; - // The donation permit was expired or already spent - errors.FailedZkAuthentication permit_rejected = 3 [(tag.reason) = "permit_rejected"]; - } -} - -message DeleteSubscriberRequest { - bytes subscriberId = 1 [(require.exactlySize) = 32]; -} - -message DeleteSubscriberResponse { - oneof response { - google.protobuf.Empty success = 1; - errors.NotFound subscriber_not_found = 2 [(tag.reason) = "subscriber_not_found"]; - // The associated subscription is not a type that can be cancelled by the server. Cancel client-side, and then retry. - errors.FailedPrecondition cannot_cancel_subscription = 3 [(tag.reason) = "cannot_cancel_subscription"]; - } -} - -enum PaymentProvider { - PAYMENT_PROVIDER_UNKNOWN = 0; - PAYMENT_PROVIDER_STRIPE = 1; - PAYMENT_PROVIDER_BRAINTREE = 2; - PAYMENT_PROVIDER_GOOGLE_PLAY_BILLING = 3; - PAYMENT_PROVIDER_APPLE_APP_STORE = 4; -} - -enum PaymentMethod { - PAYMENT_METHOD_UNKNOWN = 0; - // A credit card or debit card, including those from Apple Pay and Google Pay - PAYMENT_METHOD_CARD = 1; - // A SEPA debit account - PAYMENT_METHOD_SEPA_DEBIT = 2; - // An iDEAL account - PAYMENT_METHOD_IDEAL = 3; - // A PayPal account - PAYMENT_METHOD_PAYPAL = 4; - PAYMENT_METHOD_GOOGLE_PLAY_BILLING = 5; - PAYMENT_METHOD_APPLE_APP_STORE = 6; -} - -enum SubscriptionStatus { - SUBSCRIPTION_STATUS_UNKNOWN = 0; - // The subscription is in good standing and the most recent payment was successful. - SUBSCRIPTION_STATUS_ACTIVE = 1; - // Payment failed when creating the subscription, or the subscription's start date is in the future. - SUBSCRIPTION_STATUS_INCOMPLETE = 2; - // Payment on the latest renewal failed but there are processor retries left, or payment wasn't attempted. - SUBSCRIPTION_STATUS_PAST_DUE = 3; - // The subscription has been canceled. - SUBSCRIPTION_STATUS_CANCELED = 4; - // The latest renewal hasn't been paid but the subscription remains in place. - SUBSCRIPTION_STATUS_UNPAID = 5; -} - -message CreatePaymentMethodRequest { - // Only PAYMENT_METHOD_CARD, PAYMENT_METHOD_SEPA_DEBIT, and PAYMENT_METHOD_IDEAL are supported; - // other values will result in an INVALID_ARGUMENT error. - bytes subscriber_id = 1 [(require.exactlySize) = 32]; - PaymentMethod payment_method = 2 [(require.specified) = true]; - // a libsignal DonationPermit from rpc Donations.CreateDonationPermit - bytes donation_permit = 3 [(require.nonEmpty) = true]; -} - -message CreatePaymentMethodResponse { - message CreatePaymentMethodResult { - string clientSecret = 1; - PaymentProvider paymentProvider = 2; - } - - oneof response { - CreatePaymentMethodResult result = 1; - errors.NotFound subscriber_not_found = 2 [(tag.reason) = "subscriber_not_found"]; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 3 [(tag.reason) = "subscriber_id_mismatch"]; - // New payment processor does not match existing processor associated with the subscription - errors.FailedPrecondition subscription_processor_conflict = 4 [(tag.reason) = "subscription_processor_conflict"]; - // The donation permit was expired or already spent - errors.FailedZkAuthentication permit_rejected = 5 [(tag.reason) = "permit_rejected"]; - } -} - -message CreatePayPalPaymentMethodRequest { - bytes subscriberId = 1 [(require.exactlySize) = 32]; - // a callback URL (e.g. an in-client URL handler) for when the user approved the payment - string returnUrl = 2; - // a callback URL (e.g. an in-client URL handler) for when the user did not approve the payment - string cancelUrl = 3; -} - -message CreatePayPalPaymentMethodResponse { - message CreatePayPalPaymentMethodResult { - // a URL to open where the user may approve the payment - string approvalUrl = 1; - // an opaque PayPal payment identifier to use with SetDefaultPaymentMethodRequest - string token = 2; - } - - oneof response { - CreatePayPalPaymentMethodResult result = 1; - errors.NotFound subscriber_not_found = 2 [(tag.reason) = "subscriber_not_found"]; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 3 [(tag.reason) = "subscriber_id_mismatch"]; - // New payment processor does not match existing processor associated with the subscription - errors.FailedPrecondition subscription_processor_conflict = 4 [(tag.reason) = "subscription_processor_conflict"]; - } -} - -message SetDefaultPaymentMethodRequest { - message StripePaymentMethod { - string paymentMethodToken = 1 [(require.nonEmpty) = true]; - } - message BraintreePaymentMethod { - string paymentMethodToken = 1 [(require.nonEmpty) = true]; - } - message SepaPaymentMethod { - string setupIntentId = 1 [(require.nonEmpty) = true]; - } - - bytes subscriberId = 1 [(require.exactlySize) = 32]; - oneof request { - StripePaymentMethod stripe = 2; - BraintreePaymentMethod braintree = 3; - SepaPaymentMethod sepa = 4; - } -} - -message SetDefaultPaymentMethodResponse { - oneof response { - google.protobuf.Empty success = 1; - errors.NotFound subscriber_not_found = 2 [(tag.reason) = "subscriber_not_found"]; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 3 [(tag.reason) = "subscriber_id_mismatch"]; - errors.FailedPrecondition payment_method_not_set_up = 4 [(tag.reason) = "payment_method_not_set_up"]; - // Payment processor does not match existing processor associated with the subscription - errors.FailedPrecondition subscription_processor_conflict = 5 [(tag.reason) = "subscription_processor_conflict"]; - } -} - -message SetSubscriptionLevelRequest { - bytes subscriberId = 1 [(require.exactlySize) = 32]; - uint64 level = 2; - string currency = 3; - string idempotencyKey = 4; -} - -// Information about a charge failure. - -// Meaningfully interpreting chargeFailure response fields requires inspecting the processor field first. -// -// For Stripe, code will be one of the [codes defined here](https://stripe.com/docs/api/charges/object#charge_object-failure_code), -// while message [may contain a further textual description](https://stripe.com/docs/api/charges/object#charge_object-failure_message). -// The outcome fields are optional, but present values will directly map to Stripe [response properties](https://stripe.com/docs/api/charges/object#charge_object-outcome-network_status) -// -// For Braintree, the outcome fields will be null. The code and message will contain one of -// - a processor decline code (as a string) in code, and associated text in message, as defined this [table](https://developer.paypal.com/braintree/docs/reference/general/processor-responses/authorization-responses) -// - `gateway` in code, with a [reason](https://developer.paypal.com/braintree/articles/control-panel/transactions/gateway-rejections) in message -// - `code` = "unknown", message = "unknown" -// -// IAP payment processors will never include charge failure information, and detailed order information should be -// retrieved from the payment processor directly -message ChargeFailure { - PaymentProvider processor = 1; - // See [Stripe failure codes](https://stripe.com/docs/api/charges/object#charge_object-failure_code) or - // [Braintree decline codes](https://developer.paypal.com/braintree/docs/reference/general/processor-responses/authorization-responses#decline-codes) - // depending on which processor was used - string code = 2; - // See [Stripe failure codes](https://stripe.com/docs/api/charges/object#charge_object-failure_code) or - // [Braintree decline codes](https://developer.paypal.com/braintree/docs/reference/general/processor-responses/authorization-responses#decline-codes) - // depending on which processor was used - string message = 3; - // See [Outcome Network Status](https://stripe.com/docs/api/charges/object#charge_object-outcome-network_status) - optional string outcome_network_status = 4; - // See [Outcome Reason](https://stripe.com/docs/api/charges/object#charge_object-outcome-reason) - optional string outcome_reason = 5; - // See [Outcome Type](https://stripe.com/docs/api/charges/object#charge_object-outcome-type) - optional string outcome_type = 6; -} - -message PaymentRequired { - optional ChargeFailure charge_failure = 1; -} - -message SetSubscriptionLevelResponse { - message SetSubscriptionLevelResult { - uint64 level = 1; - } - - oneof response { - SetSubscriptionLevelResult success = 1; - errors.NotFound subscriber_not_found = 2 [(tag.reason) = "subscriber_not_found"]; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 3 [(tag.reason) = "subscriber_id_mismatch"]; - // New payment processor does not match existing processor associated with the subscription - errors.FailedPrecondition subscription_processor_conflict = 4 [(tag.reason) = "subscription_processor_conflict"]; - errors.FailedPrecondition payment_method_not_set_up = 5 [(tag.reason) = "payment_method_not_set_up"]; - // The payment processor does not support this operation - errors.FailedPrecondition unsupported_operation = 6 [(tag.reason) = "unsupported_operation"]; - // The requested level was invalid - errors.FailedPrecondition unsupported_level = 7 [(tag.reason) = "unsupported_level"]; - // The requested currency was invalid - errors.FailedPrecondition unsupported_currency = 8 [(tag.reason) = "unsupported_currency"]; - // The card could not be charged - errors.FailedPrecondition payment_requires_action = 9 [(tag.reason) = "payment_requires_action"]; - // Cannot transition from existing level to the requested level - errors.FailedPrecondition invalid_level_transition = 10 [(tag.reason) = "invalid_level_transition"]; - // The idempotency key was invalid or re-used with a modified request - errors.FailedPrecondition invalid_idempotency_key = 11 [(tag.reason) = "invalid_idempotency_key"]; - // The payment failed; see charge failure details - ChargeFailure charge_failure = 12 [(tag.reason) = "charge_failure"]; - } -} - -message SetIapSubscriptionRequest { - message AppStorePurchase { - string original_transaction_id = 1 [(require.nonEmpty) = true]; - } - message PlayBillingPurchase { - string purchase_token = 1 [(require.nonEmpty) = true]; - } - - bytes subscriberId = 1 [(require.exactlySize) = 32]; - oneof request { - AppStorePurchase app_store = 2; - PlayBillingPurchase play_billing = 3; - } -} - -message SetIapSubscriptionResponse { - message SetIapSubscriptionResult { - uint64 level = 1; - } - - oneof response { - SetIapSubscriptionResult success = 1; - errors.NotFound subscriber_not_found = 2 [(tag.reason) = "subscriber_not_found"]; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 3 [(tag.reason) = "subscriber_id_mismatch"]; - // New payment processor does not match existing processor associated with the subscription - errors.FailedPrecondition subscription_processor_conflict = 4 [(tag.reason) = "subscription_processor_conflict"]; - errors.FailedPrecondition payment_required = 5 [(tag.reason) = "payment_required"]; - errors.FailedPrecondition invalid_transaction = 6 [(tag.reason) = "invalid_transaction"]; - } -} - -message GetReceiptCredentialsRequest { - bytes subscriberId = 1 [(require.exactlySize) = 32]; - bytes receiptCredentialRequest = 2 [(require.exactlySize) = 97]; -} - -message GetReceiptCredentialsResponse { - message GetReceiptCredentialsResult { - bytes receiptCredentialResponse = 1; - } - - oneof response { - GetReceiptCredentialsResult success = 1; - errors.NotFound subscriber_not_found = 2 [(tag.reason) = "subscriber_not_found"]; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 3 [(tag.reason) = "subscriber_id_mismatch"]; - // No invoice has been issued for this subscription OR invoice is in 'draft' or 'open' state - errors.FailedPrecondition no_paid_invoice = 4 [(tag.reason) = "no_paid_invoice"]; - // Invoice is in any state other than 'draft', 'open', or 'paid'; Charge failure details may be present - PaymentRequired payment_required = 5 [(tag.reason) = "payment_required"]; - // Latest paid receipt on subscription was already redeemed for a receipt credential but with a different GetReceiptCredentialRequest - errors.FailedPrecondition already_redeemed = 6 [(tag.reason) = "already_redeemed"]; - } -} - -message GetSubscriptionInformationRequest { - bytes subscriberId = 1 [(require.exactlySize) = 32]; -} - -message GetSubscriptionInformationResponse { - message Subscription { - // The subscription level - uint64 level = 1; - // If present, UNIX Epoch Timestamp in seconds, can be used to calculate next billing date. - optional uint64 billing_cycle_anchor = 2; - // UNIX Epoch Timestamp in seconds, when the current subscription period ends - uint64 end_of_current_period = 3; - // Whether there is a currently active subscription - bool active = 4; - // If true, an active subscription will not auto-renew at the end of the current period - bool cancel_at_period_end = 5; - // A three-letter ISO 4217 currency code for currency used in the subscription - string currency = 6; - // The amount paid for the subscription in the currency's smallest unit - uint64 amount = 7; - // The subscription's status, mapped to Stripe's statuses. trialing will never be returned - SubscriptionStatus status = 8; - // The payment provider associated with the subscription - PaymentProvider processor = 9; - // The payment method associated with the subscription - PaymentMethod payment_method = 10; - // Whether the latest charge for the subscription is in a non-terminal state - bool payment_processing = 11; - // if present, contains information that may be interpreted to help the user fix a failure - optional ChargeFailure charge_failure = 12; - } - - oneof response { - Subscription success = 1; - google.protobuf.Empty no_subscription = 2; - errors.NotFound subscriber_not_found = 3 [(tag.reason) = "subscriber_not_found"]; - // subscriberId authentication failure - errors.FailedUnidentifiedAuthorization subscriber_id_mismatch = 4 [(tag.reason) = "subscriber_id_mismatch"]; - } -} - -enum BankTransferType { - BANK_TRANSFER_TYPE_UNKNOWN = 0; - BANK_TRANSFER_TYPE_SEPA_DEBIT = 1; -} - -message GetBankMandateRequest { - BankTransferType bank_transfer_type = 1 [(require.specified) = true]; -} - -message GetBankMandateResponse { - string mandate = 1; -} diff --git a/pkg/signalmeow/protobuf/org/signal/chat/tag.proto b/pkg/signalmeow/protobuf/org/signal/chat/tag.proto deleted file mode 100644 index 507a805..0000000 --- a/pkg/signalmeow/protobuf/org/signal/chat/tag.proto +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2025 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -option java_multiple_files = true; - -package org.signal.chat.tag; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.FieldOptions { - // Indicate that a message which includes this field (directly or indirectly) - // was generated for a particular reason. - // - // ``` - // import "org/signal/chat/tag.proto" - // - // message LookupThingResponse { - // oneof response { - // string thing = 1; - // Error not_found = 2 [(tag.reason) = "not_found"]; - // Error forbidden = 3 [(tag.reason) = "forbidden"]; - // } - // } - // ``` - // - // Metrics middleware may then inspect `LookupThingResponse` and tag responses - // with the provided reason. This is useful when multiple outcomes are - // potentially represented with a status = "OK" RPC response. - // - // Valid messages should only have a single reason set. If a message has - // multiple fields present that have a reason option set, no guarantees are - // made about the reason that is selected. - optional string reason = 71000; -} diff --git a/pkg/signalmeow/protobuf/rpc/account/account.pb.go b/pkg/signalmeow/protobuf/rpc/account/account.pb.go deleted file mode 100644 index 9b9e4ae..0000000 --- a/pkg/signalmeow/protobuf/rpc/account/account.pb.go +++ /dev/null @@ -1,4186 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/account.proto - -package account - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - messages "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/messages" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetAccountIdentityRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAccountIdentityRequest) Reset() { - *x = GetAccountIdentityRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAccountIdentityRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAccountIdentityRequest) ProtoMessage() {} - -func (x *GetAccountIdentityRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[0] - 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 GetAccountIdentityRequest.ProtoReflect.Descriptor instead. -func (*GetAccountIdentityRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{0} -} - -type GetAccountIdentityResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identifiers for the authenticated account. - AccountIdentifiers *common.AccountIdentifiers `protobuf:"bytes,1,opt,name=account_identifiers,json=accountIdentifiers,proto3" json:"account_identifiers,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAccountIdentityResponse) Reset() { - *x = GetAccountIdentityResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAccountIdentityResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAccountIdentityResponse) ProtoMessage() {} - -func (x *GetAccountIdentityResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[1] - 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 GetAccountIdentityResponse.ProtoReflect.Descriptor instead. -func (*GetAccountIdentityResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{1} -} - -func (x *GetAccountIdentityResponse) GetAccountIdentifiers() *common.AccountIdentifiers { - if x != nil { - return x.AccountIdentifiers - } - return nil -} - -type GetEntitlementsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetEntitlementsRequest) Reset() { - *x = GetEntitlementsRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetEntitlementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEntitlementsRequest) ProtoMessage() {} - -func (x *GetEntitlementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[2] - 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 GetEntitlementsRequest.ProtoReflect.Descriptor instead. -func (*GetEntitlementsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{2} -} - -type GetEntitlementsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Active badges added via Donations.redeemReceipt - Badges []*GetEntitlementsResponse_BadgeEntitlement `protobuf:"bytes,1,rep,name=badges,proto3" json:"badges,omitempty"` - // If present, the backup level set via Backups.redeemReceipt - Backup *GetEntitlementsResponse_BackupEntitlement `protobuf:"bytes,2,opt,name=backup,proto3" json:"backup,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetEntitlementsResponse) Reset() { - *x = GetEntitlementsResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetEntitlementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEntitlementsResponse) ProtoMessage() {} - -func (x *GetEntitlementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[3] - 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 GetEntitlementsResponse.ProtoReflect.Descriptor instead. -func (*GetEntitlementsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{3} -} - -func (x *GetEntitlementsResponse) GetBadges() []*GetEntitlementsResponse_BadgeEntitlement { - if x != nil { - return x.Badges - } - return nil -} - -func (x *GetEntitlementsResponse) GetBackup() *GetEntitlementsResponse_BackupEntitlement { - if x != nil { - return x.Backup - } - return nil -} - -type DeleteAccountRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAccountRequest) Reset() { - *x = DeleteAccountRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAccountRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAccountRequest) ProtoMessage() {} - -func (x *DeleteAccountRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[4] - 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 DeleteAccountRequest.ProtoReflect.Descriptor instead. -func (*DeleteAccountRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{4} -} - -type DeleteAccountResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAccountResponse) Reset() { - *x = DeleteAccountResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAccountResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAccountResponse) ProtoMessage() {} - -func (x *DeleteAccountResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[5] - 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 DeleteAccountResponse.ProtoReflect.Descriptor instead. -func (*DeleteAccountResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{5} -} - -type SetRegistrationLockRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The new registration lock secret for the authenticated account. - RegistrationLock []byte `protobuf:"bytes,1,opt,name=registration_lock,json=registrationLock,proto3" json:"registration_lock,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetRegistrationLockRequest) Reset() { - *x = SetRegistrationLockRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetRegistrationLockRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRegistrationLockRequest) ProtoMessage() {} - -func (x *SetRegistrationLockRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[6] - 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 SetRegistrationLockRequest.ProtoReflect.Descriptor instead. -func (*SetRegistrationLockRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{6} -} - -func (x *SetRegistrationLockRequest) GetRegistrationLock() []byte { - if x != nil { - return x.RegistrationLock - } - return nil -} - -type SetRegistrationLockResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetRegistrationLockResponse) Reset() { - *x = SetRegistrationLockResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetRegistrationLockResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRegistrationLockResponse) ProtoMessage() {} - -func (x *SetRegistrationLockResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[7] - 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 SetRegistrationLockResponse.ProtoReflect.Descriptor instead. -func (*SetRegistrationLockResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{7} -} - -type ClearRegistrationLockRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClearRegistrationLockRequest) Reset() { - *x = ClearRegistrationLockRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClearRegistrationLockRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClearRegistrationLockRequest) ProtoMessage() {} - -func (x *ClearRegistrationLockRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ClearRegistrationLockRequest.ProtoReflect.Descriptor instead. -func (*ClearRegistrationLockRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{8} -} - -type ClearRegistrationLockResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClearRegistrationLockResponse) Reset() { - *x = ClearRegistrationLockResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClearRegistrationLockResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClearRegistrationLockResponse) ProtoMessage() {} - -func (x *ClearRegistrationLockResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ClearRegistrationLockResponse.ProtoReflect.Descriptor instead. -func (*ClearRegistrationLockResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{9} -} - -type ReserveUsernameHashRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A prioritized list of username hashes to attempt to reserve. - UsernameHashes [][]byte `protobuf:"bytes,1,rep,name=username_hashes,json=usernameHashes,proto3" json:"username_hashes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReserveUsernameHashRequest) Reset() { - *x = ReserveUsernameHashRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReserveUsernameHashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReserveUsernameHashRequest) ProtoMessage() {} - -func (x *ReserveUsernameHashRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ReserveUsernameHashRequest.ProtoReflect.Descriptor instead. -func (*ReserveUsernameHashRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{10} -} - -func (x *ReserveUsernameHashRequest) GetUsernameHashes() [][]byte { - if x != nil { - return x.UsernameHashes - } - return nil -} - -type UsernameNotAvailable struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UsernameNotAvailable) Reset() { - *x = UsernameNotAvailable{} - mi := &file_org_signal_chat_account_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UsernameNotAvailable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UsernameNotAvailable) ProtoMessage() {} - -func (x *UsernameNotAvailable) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[11] - 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 UsernameNotAvailable.ProtoReflect.Descriptor instead. -func (*UsernameNotAvailable) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{11} -} - -type ReserveUsernameHashResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *ReserveUsernameHashResponse_UsernameHash - // *ReserveUsernameHashResponse_UsernameNotAvailable - Response isReserveUsernameHashResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReserveUsernameHashResponse) Reset() { - *x = ReserveUsernameHashResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReserveUsernameHashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReserveUsernameHashResponse) ProtoMessage() {} - -func (x *ReserveUsernameHashResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ReserveUsernameHashResponse.ProtoReflect.Descriptor instead. -func (*ReserveUsernameHashResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{12} -} - -func (x *ReserveUsernameHashResponse) GetResponse() isReserveUsernameHashResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *ReserveUsernameHashResponse) GetUsernameHash() []byte { - if x != nil { - if x, ok := x.Response.(*ReserveUsernameHashResponse_UsernameHash); ok { - return x.UsernameHash - } - } - return nil -} - -func (x *ReserveUsernameHashResponse) GetUsernameNotAvailable() *UsernameNotAvailable { - if x != nil { - if x, ok := x.Response.(*ReserveUsernameHashResponse_UsernameNotAvailable); ok { - return x.UsernameNotAvailable - } - } - return nil -} - -type isReserveUsernameHashResponse_Response interface { - isReserveUsernameHashResponse_Response() -} - -type ReserveUsernameHashResponse_UsernameHash struct { - // The first username hash that was available (and actually reserved). - UsernameHash []byte `protobuf:"bytes,1,opt,name=username_hash,json=usernameHash,proto3,oneof"` -} - -type ReserveUsernameHashResponse_UsernameNotAvailable struct { - // Indicates that, of all of the candidate hashes provided, none were - // available. Callers may generate a new set of hashes and and retry. - UsernameNotAvailable *UsernameNotAvailable `protobuf:"bytes,2,opt,name=username_not_available,json=usernameNotAvailable,proto3,oneof"` -} - -func (*ReserveUsernameHashResponse_UsernameHash) isReserveUsernameHashResponse_Response() {} - -func (*ReserveUsernameHashResponse_UsernameNotAvailable) isReserveUsernameHashResponse_Response() {} - -type ConfirmUsernameHashRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The username hash to claim for the authenticated account. - UsernameHash []byte `protobuf:"bytes,1,opt,name=username_hash,json=usernameHash,proto3" json:"username_hash,omitempty"` - // A zero-knowledge proof that the given username hash was generated by the - // Signal username algorithm. - ZkProof []byte `protobuf:"bytes,2,opt,name=zk_proof,json=zkProof,proto3" json:"zk_proof,omitempty"` - // The ciphertext of the chosen username for use in public-facing contexts - // (e.g. links and QR codes). - UsernameCiphertext []byte `protobuf:"bytes,3,opt,name=username_ciphertext,json=usernameCiphertext,proto3" json:"username_ciphertext,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmUsernameHashRequest) Reset() { - *x = ConfirmUsernameHashRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmUsernameHashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmUsernameHashRequest) ProtoMessage() {} - -func (x *ConfirmUsernameHashRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ConfirmUsernameHashRequest.ProtoReflect.Descriptor instead. -func (*ConfirmUsernameHashRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{13} -} - -func (x *ConfirmUsernameHashRequest) GetUsernameHash() []byte { - if x != nil { - return x.UsernameHash - } - return nil -} - -func (x *ConfirmUsernameHashRequest) GetZkProof() []byte { - if x != nil { - return x.ZkProof - } - return nil -} - -func (x *ConfirmUsernameHashRequest) GetUsernameCiphertext() []byte { - if x != nil { - return x.UsernameCiphertext - } - return nil -} - -type ConfirmUsernameHashResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *ConfirmUsernameHashResponse_ConfirmedUsernameHash_ - // *ConfirmUsernameHashResponse_ReservationNotFound - // *ConfirmUsernameHashResponse_UsernameNotAvailable - Response isConfirmUsernameHashResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmUsernameHashResponse) Reset() { - *x = ConfirmUsernameHashResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmUsernameHashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmUsernameHashResponse) ProtoMessage() {} - -func (x *ConfirmUsernameHashResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ConfirmUsernameHashResponse.ProtoReflect.Descriptor instead. -func (*ConfirmUsernameHashResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{14} -} - -func (x *ConfirmUsernameHashResponse) GetResponse() isConfirmUsernameHashResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *ConfirmUsernameHashResponse) GetConfirmedUsernameHash() *ConfirmUsernameHashResponse_ConfirmedUsernameHash { - if x != nil { - if x, ok := x.Response.(*ConfirmUsernameHashResponse_ConfirmedUsernameHash_); ok { - return x.ConfirmedUsernameHash - } - } - return nil -} - -func (x *ConfirmUsernameHashResponse) GetReservationNotFound() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ConfirmUsernameHashResponse_ReservationNotFound); ok { - return x.ReservationNotFound - } - } - return nil -} - -func (x *ConfirmUsernameHashResponse) GetUsernameNotAvailable() *UsernameNotAvailable { - if x != nil { - if x, ok := x.Response.(*ConfirmUsernameHashResponse_UsernameNotAvailable); ok { - return x.UsernameNotAvailable - } - } - return nil -} - -type isConfirmUsernameHashResponse_Response interface { - isConfirmUsernameHashResponse_Response() -} - -type ConfirmUsernameHashResponse_ConfirmedUsernameHash_ struct { - // The details of the successfully confirmed username. - ConfirmedUsernameHash *ConfirmUsernameHashResponse_ConfirmedUsernameHash `protobuf:"bytes,1,opt,name=confirmed_username_hash,json=confirmedUsernameHash,proto3,oneof"` -} - -type ConfirmUsernameHashResponse_ReservationNotFound struct { - // The provided hash was not reserved for the account. - ReservationNotFound *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=reservation_not_found,json=reservationNotFound,proto3,oneof"` -} - -type ConfirmUsernameHashResponse_UsernameNotAvailable struct { - // The reservation has lapsed and the requested username has been claimed by - // another caller. - UsernameNotAvailable *UsernameNotAvailable `protobuf:"bytes,3,opt,name=username_not_available,json=usernameNotAvailable,proto3,oneof"` -} - -func (*ConfirmUsernameHashResponse_ConfirmedUsernameHash_) isConfirmUsernameHashResponse_Response() {} - -func (*ConfirmUsernameHashResponse_ReservationNotFound) isConfirmUsernameHashResponse_Response() {} - -func (*ConfirmUsernameHashResponse_UsernameNotAvailable) isConfirmUsernameHashResponse_Response() {} - -type DeleteUsernameHashRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteUsernameHashRequest) Reset() { - *x = DeleteUsernameHashRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteUsernameHashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUsernameHashRequest) ProtoMessage() {} - -func (x *DeleteUsernameHashRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 DeleteUsernameHashRequest.ProtoReflect.Descriptor instead. -func (*DeleteUsernameHashRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{15} -} - -type DeleteUsernameHashResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteUsernameHashResponse) Reset() { - *x = DeleteUsernameHashResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteUsernameHashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUsernameHashResponse) ProtoMessage() {} - -func (x *DeleteUsernameHashResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[16] - 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 DeleteUsernameHashResponse.ProtoReflect.Descriptor instead. -func (*DeleteUsernameHashResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{16} -} - -type SetUsernameLinkRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The username ciphertext for which to generate a new link handle. - UsernameCiphertext []byte `protobuf:"bytes,1,opt,name=username_ciphertext,json=usernameCiphertext,proto3" json:"username_ciphertext,omitempty"` - // If true and the account already had an encrypted username stored, the - // existing link handle will be reused. Otherwise a new link handle will be - // created. - KeepLinkHandle bool `protobuf:"varint,2,opt,name=keep_link_handle,json=keepLinkHandle,proto3" json:"keep_link_handle,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetUsernameLinkRequest) Reset() { - *x = SetUsernameLinkRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetUsernameLinkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetUsernameLinkRequest) ProtoMessage() {} - -func (x *SetUsernameLinkRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[17] - 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 SetUsernameLinkRequest.ProtoReflect.Descriptor instead. -func (*SetUsernameLinkRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{17} -} - -func (x *SetUsernameLinkRequest) GetUsernameCiphertext() []byte { - if x != nil { - return x.UsernameCiphertext - } - return nil -} - -func (x *SetUsernameLinkRequest) GetKeepLinkHandle() bool { - if x != nil { - return x.KeepLinkHandle - } - return false -} - -type SetUsernameLinkResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetUsernameLinkResponse_UsernameLinkHandle - // *SetUsernameLinkResponse_NoUsernameSet - Response isSetUsernameLinkResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetUsernameLinkResponse) Reset() { - *x = SetUsernameLinkResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetUsernameLinkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetUsernameLinkResponse) ProtoMessage() {} - -func (x *SetUsernameLinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[18] - 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 SetUsernameLinkResponse.ProtoReflect.Descriptor instead. -func (*SetUsernameLinkResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{18} -} - -func (x *SetUsernameLinkResponse) GetResponse() isSetUsernameLinkResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetUsernameLinkResponse) GetUsernameLinkHandle() []byte { - if x != nil { - if x, ok := x.Response.(*SetUsernameLinkResponse_UsernameLinkHandle); ok { - return x.UsernameLinkHandle - } - } - return nil -} - -func (x *SetUsernameLinkResponse) GetNoUsernameSet() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetUsernameLinkResponse_NoUsernameSet); ok { - return x.NoUsernameSet - } - } - return nil -} - -type isSetUsernameLinkResponse_Response interface { - isSetUsernameLinkResponse_Response() -} - -type SetUsernameLinkResponse_UsernameLinkHandle struct { - // A new link handle for the given username ciphertext. - UsernameLinkHandle []byte `protobuf:"bytes,1,opt,name=username_link_handle,json=usernameLinkHandle,proto3,oneof"` -} - -type SetUsernameLinkResponse_NoUsernameSet struct { - // The authenticated account did not have a username set. - NoUsernameSet *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=no_username_set,json=noUsernameSet,proto3,oneof"` -} - -func (*SetUsernameLinkResponse_UsernameLinkHandle) isSetUsernameLinkResponse_Response() {} - -func (*SetUsernameLinkResponse_NoUsernameSet) isSetUsernameLinkResponse_Response() {} - -type DeleteUsernameLinkRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteUsernameLinkRequest) Reset() { - *x = DeleteUsernameLinkRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteUsernameLinkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUsernameLinkRequest) ProtoMessage() {} - -func (x *DeleteUsernameLinkRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[19] - 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 DeleteUsernameLinkRequest.ProtoReflect.Descriptor instead. -func (*DeleteUsernameLinkRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{19} -} - -type DeleteUsernameLinkResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteUsernameLinkResponse) Reset() { - *x = DeleteUsernameLinkResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteUsernameLinkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUsernameLinkResponse) ProtoMessage() {} - -func (x *DeleteUsernameLinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 DeleteUsernameLinkResponse.ProtoReflect.Descriptor instead. -func (*DeleteUsernameLinkResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{20} -} - -type ConfigureUnidentifiedAccessRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Configuration: - // - // *ConfigureUnidentifiedAccessRequest_UnidentifiedAccessKey - // *ConfigureUnidentifiedAccessRequest_AllowUnrestrictedUnidentifiedAccess - Configuration isConfigureUnidentifiedAccessRequest_Configuration `protobuf_oneof:"configuration"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfigureUnidentifiedAccessRequest) Reset() { - *x = ConfigureUnidentifiedAccessRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfigureUnidentifiedAccessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfigureUnidentifiedAccessRequest) ProtoMessage() {} - -func (x *ConfigureUnidentifiedAccessRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[21] - 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 ConfigureUnidentifiedAccessRequest.ProtoReflect.Descriptor instead. -func (*ConfigureUnidentifiedAccessRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{21} -} - -func (x *ConfigureUnidentifiedAccessRequest) GetConfiguration() isConfigureUnidentifiedAccessRequest_Configuration { - if x != nil { - return x.Configuration - } - return nil -} - -func (x *ConfigureUnidentifiedAccessRequest) GetUnidentifiedAccessKey() []byte { - if x != nil { - if x, ok := x.Configuration.(*ConfigureUnidentifiedAccessRequest_UnidentifiedAccessKey); ok { - return x.UnidentifiedAccessKey - } - } - return nil -} - -func (x *ConfigureUnidentifiedAccessRequest) GetAllowUnrestrictedUnidentifiedAccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Configuration.(*ConfigureUnidentifiedAccessRequest_AllowUnrestrictedUnidentifiedAccess); ok { - return x.AllowUnrestrictedUnidentifiedAccess - } - } - return nil -} - -type isConfigureUnidentifiedAccessRequest_Configuration interface { - isConfigureUnidentifiedAccessRequest_Configuration() -} - -type ConfigureUnidentifiedAccessRequest_UnidentifiedAccessKey struct { - // The key that other users must provide to interact with this account - // anonymously (i.e. to retrieve keys or profiles or to send messages) unless - // unrestricted unidentified access is permitted. Must be present if - // unrestricted unidentified access is not allowed. - UnidentifiedAccessKey []byte `protobuf:"bytes,1,opt,name=unidentified_access_key,json=unidentifiedAccessKey,proto3,oneof"` -} - -type ConfigureUnidentifiedAccessRequest_AllowUnrestrictedUnidentifiedAccess struct { - // If set, any user may interact with this account anonymously without - // providing an unidentified access key. Otherwise, users must provide the - // given unidentified access key to interact with this account anonymously. - // Setting unrestricted unidentified access will clear any existing - // unidentified_access_key - AllowUnrestrictedUnidentifiedAccess *emptypb.Empty `protobuf:"bytes,2,opt,name=allow_unrestricted_unidentified_access,json=allowUnrestrictedUnidentifiedAccess,proto3,oneof"` -} - -func (*ConfigureUnidentifiedAccessRequest_UnidentifiedAccessKey) isConfigureUnidentifiedAccessRequest_Configuration() { -} - -func (*ConfigureUnidentifiedAccessRequest_AllowUnrestrictedUnidentifiedAccess) isConfigureUnidentifiedAccessRequest_Configuration() { -} - -type ConfigureUnidentifiedAccessResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfigureUnidentifiedAccessResponse) Reset() { - *x = ConfigureUnidentifiedAccessResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfigureUnidentifiedAccessResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfigureUnidentifiedAccessResponse) ProtoMessage() {} - -func (x *ConfigureUnidentifiedAccessResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[22] - 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 ConfigureUnidentifiedAccessResponse.ProtoReflect.Descriptor instead. -func (*ConfigureUnidentifiedAccessResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{22} -} - -type SetDiscoverableByPhoneNumberRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If true, the authenticated account may be discovered by phone number via - // the Contact Discovery Service (CDS). Otherwise, other users must discover - // this account by other means (i.e. by username). - DiscoverableByPhoneNumber bool `protobuf:"varint,1,opt,name=discoverable_by_phone_number,json=discoverableByPhoneNumber,proto3" json:"discoverable_by_phone_number,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDiscoverableByPhoneNumberRequest) Reset() { - *x = SetDiscoverableByPhoneNumberRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDiscoverableByPhoneNumberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDiscoverableByPhoneNumberRequest) ProtoMessage() {} - -func (x *SetDiscoverableByPhoneNumberRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[23] - 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 SetDiscoverableByPhoneNumberRequest.ProtoReflect.Descriptor instead. -func (*SetDiscoverableByPhoneNumberRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{23} -} - -func (x *SetDiscoverableByPhoneNumberRequest) GetDiscoverableByPhoneNumber() bool { - if x != nil { - return x.DiscoverableByPhoneNumber - } - return false -} - -type SetDiscoverableByPhoneNumberResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDiscoverableByPhoneNumberResponse) Reset() { - *x = SetDiscoverableByPhoneNumberResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDiscoverableByPhoneNumberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDiscoverableByPhoneNumberResponse) ProtoMessage() {} - -func (x *SetDiscoverableByPhoneNumberResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[24] - 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 SetDiscoverableByPhoneNumberResponse.ProtoReflect.Descriptor instead. -func (*SetDiscoverableByPhoneNumberResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{24} -} - -type SetRegistrationRecoveryPasswordRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The new registration recovery password for the authenticated account. - RegistrationRecoveryPassword []byte `protobuf:"bytes,1,opt,name=registration_recovery_password,json=registrationRecoveryPassword,proto3" json:"registration_recovery_password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetRegistrationRecoveryPasswordRequest) Reset() { - *x = SetRegistrationRecoveryPasswordRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetRegistrationRecoveryPasswordRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRegistrationRecoveryPasswordRequest) ProtoMessage() {} - -func (x *SetRegistrationRecoveryPasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[25] - 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 SetRegistrationRecoveryPasswordRequest.ProtoReflect.Descriptor instead. -func (*SetRegistrationRecoveryPasswordRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{25} -} - -func (x *SetRegistrationRecoveryPasswordRequest) GetRegistrationRecoveryPassword() []byte { - if x != nil { - return x.RegistrationRecoveryPassword - } - return nil -} - -type SetRegistrationRecoveryPasswordResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetRegistrationRecoveryPasswordResponse) Reset() { - *x = SetRegistrationRecoveryPasswordResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetRegistrationRecoveryPasswordResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRegistrationRecoveryPasswordResponse) ProtoMessage() {} - -func (x *SetRegistrationRecoveryPasswordResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[26] - 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 SetRegistrationRecoveryPasswordResponse.ProtoReflect.Descriptor instead. -func (*SetRegistrationRecoveryPasswordResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{26} -} - -type CheckAccountExistenceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier of an account that may or may not exist. - ServiceIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=service_identifier,json=serviceIdentifier,proto3" json:"service_identifier,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckAccountExistenceRequest) Reset() { - *x = CheckAccountExistenceRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckAccountExistenceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckAccountExistenceRequest) ProtoMessage() {} - -func (x *CheckAccountExistenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[27] - 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 CheckAccountExistenceRequest.ProtoReflect.Descriptor instead. -func (*CheckAccountExistenceRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{27} -} - -func (x *CheckAccountExistenceRequest) GetServiceIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.ServiceIdentifier - } - return nil -} - -type CheckAccountExistenceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // True if an account exists with the given service identifier or false if no - // account was found. - AccountExists bool `protobuf:"varint,1,opt,name=account_exists,json=accountExists,proto3" json:"account_exists,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckAccountExistenceResponse) Reset() { - *x = CheckAccountExistenceResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckAccountExistenceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckAccountExistenceResponse) ProtoMessage() {} - -func (x *CheckAccountExistenceResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[28] - 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 CheckAccountExistenceResponse.ProtoReflect.Descriptor instead. -func (*CheckAccountExistenceResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{28} -} - -func (x *CheckAccountExistenceResponse) GetAccountExists() bool { - if x != nil { - return x.AccountExists - } - return false -} - -type LookupUsernameHashRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A 32-byte username hash for which to find an account. - UsernameHash []byte `protobuf:"bytes,1,opt,name=username_hash,json=usernameHash,proto3" json:"username_hash,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LookupUsernameHashRequest) Reset() { - *x = LookupUsernameHashRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LookupUsernameHashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LookupUsernameHashRequest) ProtoMessage() {} - -func (x *LookupUsernameHashRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[29] - 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 LookupUsernameHashRequest.ProtoReflect.Descriptor instead. -func (*LookupUsernameHashRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{29} -} - -func (x *LookupUsernameHashRequest) GetUsernameHash() []byte { - if x != nil { - return x.UsernameHash - } - return nil -} - -type LookupUsernameHashResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *LookupUsernameHashResponse_ServiceIdentifier - // *LookupUsernameHashResponse_NotFound - Response isLookupUsernameHashResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LookupUsernameHashResponse) Reset() { - *x = LookupUsernameHashResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LookupUsernameHashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LookupUsernameHashResponse) ProtoMessage() {} - -func (x *LookupUsernameHashResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[30] - 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 LookupUsernameHashResponse.ProtoReflect.Descriptor instead. -func (*LookupUsernameHashResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{30} -} - -func (x *LookupUsernameHashResponse) GetResponse() isLookupUsernameHashResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *LookupUsernameHashResponse) GetServiceIdentifier() *common.ServiceIdentifier { - if x != nil { - if x, ok := x.Response.(*LookupUsernameHashResponse_ServiceIdentifier); ok { - return x.ServiceIdentifier - } - } - return nil -} - -func (x *LookupUsernameHashResponse) GetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*LookupUsernameHashResponse_NotFound); ok { - return x.NotFound - } - } - return nil -} - -type isLookupUsernameHashResponse_Response interface { - isLookupUsernameHashResponse_Response() -} - -type LookupUsernameHashResponse_ServiceIdentifier struct { - // The service identifier associated with the provided username hash. - ServiceIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=service_identifier,json=serviceIdentifier,proto3,oneof"` -} - -type LookupUsernameHashResponse_NotFound struct { - // No account was found for the provided username hash. - NotFound *errors.NotFound `protobuf:"bytes,2,opt,name=not_found,json=notFound,proto3,oneof"` -} - -func (*LookupUsernameHashResponse_ServiceIdentifier) isLookupUsernameHashResponse_Response() {} - -func (*LookupUsernameHashResponse_NotFound) isLookupUsernameHashResponse_Response() {} - -type LookupUsernameLinkRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The link handle for which to find an encrypted username. Link handles are - // 16-byte representations of UUIDs. - UsernameLinkHandle []byte `protobuf:"bytes,1,opt,name=username_link_handle,json=usernameLinkHandle,proto3" json:"username_link_handle,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LookupUsernameLinkRequest) Reset() { - *x = LookupUsernameLinkRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LookupUsernameLinkRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LookupUsernameLinkRequest) ProtoMessage() {} - -func (x *LookupUsernameLinkRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[31] - 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 LookupUsernameLinkRequest.ProtoReflect.Descriptor instead. -func (*LookupUsernameLinkRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{31} -} - -func (x *LookupUsernameLinkRequest) GetUsernameLinkHandle() []byte { - if x != nil { - return x.UsernameLinkHandle - } - return nil -} - -type LookupUsernameLinkResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *LookupUsernameLinkResponse_UsernameCiphertext - // *LookupUsernameLinkResponse_NotFound - Response isLookupUsernameLinkResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LookupUsernameLinkResponse) Reset() { - *x = LookupUsernameLinkResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LookupUsernameLinkResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LookupUsernameLinkResponse) ProtoMessage() {} - -func (x *LookupUsernameLinkResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 LookupUsernameLinkResponse.ProtoReflect.Descriptor instead. -func (*LookupUsernameLinkResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{32} -} - -func (x *LookupUsernameLinkResponse) GetResponse() isLookupUsernameLinkResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *LookupUsernameLinkResponse) GetUsernameCiphertext() []byte { - if x != nil { - if x, ok := x.Response.(*LookupUsernameLinkResponse_UsernameCiphertext); ok { - return x.UsernameCiphertext - } - } - return nil -} - -func (x *LookupUsernameLinkResponse) GetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*LookupUsernameLinkResponse_NotFound); ok { - return x.NotFound - } - } - return nil -} - -type isLookupUsernameLinkResponse_Response interface { - isLookupUsernameLinkResponse_Response() -} - -type LookupUsernameLinkResponse_UsernameCiphertext struct { - // The ciphertext of the username identified by the provided link handle. - UsernameCiphertext []byte `protobuf:"bytes,1,opt,name=username_ciphertext,json=usernameCiphertext,proto3,oneof"` -} - -type LookupUsernameLinkResponse_NotFound struct { - // No username was found for the provided link handle. - NotFound *errors.NotFound `protobuf:"bytes,2,opt,name=not_found,json=notFound,proto3,oneof"` -} - -func (*LookupUsernameLinkResponse_UsernameCiphertext) isLookupUsernameLinkResponse_Response() {} - -func (*LookupUsernameLinkResponse_NotFound) isLookupUsernameLinkResponse_Response() {} - -type SetZkCredentialKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A serialized libsignal ZkCredentialPublicKey - PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetZkCredentialKeyRequest) Reset() { - *x = SetZkCredentialKeyRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetZkCredentialKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetZkCredentialKeyRequest) ProtoMessage() {} - -func (x *SetZkCredentialKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 SetZkCredentialKeyRequest.ProtoReflect.Descriptor instead. -func (*SetZkCredentialKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{33} -} - -func (x *SetZkCredentialKeyRequest) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -type SetZkCredentialKeyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A random, non-zero, value that must be included in credential requests using the key. - // - // This value allows the server to ratchet the resulting binding identity, - // as reverting to the previous key will result in a new rotation ID. - RotationId uint64 `protobuf:"varint,1,opt,name=rotation_id,json=rotationId,proto3" json:"rotation_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetZkCredentialKeyResponse) Reset() { - *x = SetZkCredentialKeyResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetZkCredentialKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetZkCredentialKeyResponse) ProtoMessage() {} - -func (x *SetZkCredentialKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[34] - 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 SetZkCredentialKeyResponse.ProtoReflect.Descriptor instead. -func (*SetZkCredentialKeyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{34} -} - -func (x *SetZkCredentialKeyResponse) GetRotationId() uint64 { - if x != nil { - return x.RotationId - } - return 0 -} - -type ChangeNumberRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A means of authenticating the change-number request for the new phone - // number. Exactly one must be provided. - // - // Types that are valid to be assigned to Verification: - // - // *ChangeNumberRequest_SessionId - // *ChangeNumberRequest_RecoveryPassword - Verification isChangeNumberRequest_Verification `protobuf_oneof:"verification"` - // The new phone number for the authenticated account. - Number string `protobuf:"bytes,3,opt,name=number,proto3" json:"number,omitempty"` - // The registration lock secret for the new phone number, if the account - // associated with the new phone number has a registration lock configured. - RegistrationLock []byte `protobuf:"bytes,4,opt,name=registration_lock,json=registrationLock,proto3" json:"registration_lock,omitempty"` - // The new public identity key to use for the phone-number identity (PNI) - // associated with the new phone number. - PniIdentityKey []byte `protobuf:"bytes,5,opt,name=pni_identity_key,json=pniIdentityKey,proto3" json:"pni_identity_key,omitempty"` - // Synchronization messages to send to companion devices to supply the private - // keys associated with the new identity key and their new pre-keys. Exactly - // one message must be supplied for each device other than the sending - // (primary) device. May be omitted if no companion devices are linked to the - // account. - DeviceMessages *messages.IndividualRecipientMessageBundle `protobuf:"bytes,6,opt,name=device_messages,json=deviceMessages,proto3" json:"device_messages,omitempty"` - // A new signed EC pre-key for each device on the account, including the - // sending device, keyed by device ID. Each must be accompanied by a valid - // signature from the identity key in this request. - DevicePniSignedPreKeys map[uint32]*common.EcSignedPreKey `protobuf:"bytes,7,rep,name=device_pni_signed_pre_keys,json=devicePniSignedPreKeys,proto3" json:"device_pni_signed_pre_keys,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // A new signed post-quantum last-resort pre-key for each device on the - // account, including the sending device, keyed by device ID. Each must be - // accompanied by a valid signature from the identity key in this request. - DevicePniPqLastResortPreKeys map[uint32]*common.KemSignedPreKey `protobuf:"bytes,8,rep,name=device_pni_pq_last_resort_pre_keys,json=devicePniPqLastResortPreKeys,proto3" json:"device_pni_pq_last_resort_pre_keys,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // The new phone-number-identity registration ID for each device on the - // account, including the sending device, keyed by device ID. - PniRegistrationIds map[uint32]uint32 `protobuf:"bytes,9,rep,name=pni_registration_ids,json=pniRegistrationIds,proto3" json:"pni_registration_ids,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeNumberRequest) Reset() { - *x = ChangeNumberRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeNumberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeNumberRequest) ProtoMessage() {} - -func (x *ChangeNumberRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[35] - 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 ChangeNumberRequest.ProtoReflect.Descriptor instead. -func (*ChangeNumberRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{35} -} - -func (x *ChangeNumberRequest) GetVerification() isChangeNumberRequest_Verification { - if x != nil { - return x.Verification - } - return nil -} - -func (x *ChangeNumberRequest) GetSessionId() []byte { - if x != nil { - if x, ok := x.Verification.(*ChangeNumberRequest_SessionId); ok { - return x.SessionId - } - } - return nil -} - -func (x *ChangeNumberRequest) GetRecoveryPassword() []byte { - if x != nil { - if x, ok := x.Verification.(*ChangeNumberRequest_RecoveryPassword); ok { - return x.RecoveryPassword - } - } - return nil -} - -func (x *ChangeNumberRequest) GetNumber() string { - if x != nil { - return x.Number - } - return "" -} - -func (x *ChangeNumberRequest) GetRegistrationLock() []byte { - if x != nil { - return x.RegistrationLock - } - return nil -} - -func (x *ChangeNumberRequest) GetPniIdentityKey() []byte { - if x != nil { - return x.PniIdentityKey - } - return nil -} - -func (x *ChangeNumberRequest) GetDeviceMessages() *messages.IndividualRecipientMessageBundle { - if x != nil { - return x.DeviceMessages - } - return nil -} - -func (x *ChangeNumberRequest) GetDevicePniSignedPreKeys() map[uint32]*common.EcSignedPreKey { - if x != nil { - return x.DevicePniSignedPreKeys - } - return nil -} - -func (x *ChangeNumberRequest) GetDevicePniPqLastResortPreKeys() map[uint32]*common.KemSignedPreKey { - if x != nil { - return x.DevicePniPqLastResortPreKeys - } - return nil -} - -func (x *ChangeNumberRequest) GetPniRegistrationIds() map[uint32]uint32 { - if x != nil { - return x.PniRegistrationIds - } - return nil -} - -type isChangeNumberRequest_Verification interface { - isChangeNumberRequest_Verification() -} - -type ChangeNumberRequest_SessionId struct { - // A verified registration session ID (as returned by the registration - // service) for the new phone number. - SessionId []byte `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3,oneof"` -} - -type ChangeNumberRequest_RecoveryPassword struct { - // A registration recovery password for the new phone number. - RecoveryPassword []byte `protobuf:"bytes,2,opt,name=recovery_password,json=recoveryPassword,proto3,oneof"` -} - -func (*ChangeNumberRequest_SessionId) isChangeNumberRequest_Verification() {} - -func (*ChangeNumberRequest_RecoveryPassword) isChangeNumberRequest_Verification() {} - -type ChangeNumberResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *ChangeNumberResponse_AccountIdentifiers - // *ChangeNumberResponse_MismatchedDevices - // *ChangeNumberResponse_RegistrationLockFailure - // *ChangeNumberResponse_StaleDevices - // *ChangeNumberResponse_MessageTooLarge - // *ChangeNumberResponse_UnverifiedRegistrationSession - // *ChangeNumberResponse_InvalidRegistrationSession - // *ChangeNumberResponse_RecoveryPasswordVerificationFailed - Response isChangeNumberResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChangeNumberResponse) Reset() { - *x = ChangeNumberResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChangeNumberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangeNumberResponse) ProtoMessage() {} - -func (x *ChangeNumberResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[36] - 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 ChangeNumberResponse.ProtoReflect.Descriptor instead. -func (*ChangeNumberResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{36} -} - -func (x *ChangeNumberResponse) GetResponse() isChangeNumberResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *ChangeNumberResponse) GetAccountIdentifiers() *common.AccountIdentifiers { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_AccountIdentifiers); ok { - return x.AccountIdentifiers - } - } - return nil -} - -func (x *ChangeNumberResponse) GetMismatchedDevices() *messages.MismatchedDevices { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_MismatchedDevices); ok { - return x.MismatchedDevices - } - } - return nil -} - -func (x *ChangeNumberResponse) GetRegistrationLockFailure() *RegistrationLockFailure { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_RegistrationLockFailure); ok { - return x.RegistrationLockFailure - } - } - return nil -} - -func (x *ChangeNumberResponse) GetStaleDevices() *StaleDevices { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_StaleDevices); ok { - return x.StaleDevices - } - } - return nil -} - -func (x *ChangeNumberResponse) GetMessageTooLarge() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_MessageTooLarge); ok { - return x.MessageTooLarge - } - } - return nil -} - -func (x *ChangeNumberResponse) GetUnverifiedRegistrationSession() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_UnverifiedRegistrationSession); ok { - return x.UnverifiedRegistrationSession - } - } - return nil -} - -func (x *ChangeNumberResponse) GetInvalidRegistrationSession() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_InvalidRegistrationSession); ok { - return x.InvalidRegistrationSession - } - } - return nil -} - -func (x *ChangeNumberResponse) GetRecoveryPasswordVerificationFailed() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ChangeNumberResponse_RecoveryPasswordVerificationFailed); ok { - return x.RecoveryPasswordVerificationFailed - } - } - return nil -} - -type isChangeNumberResponse_Response interface { - isChangeNumberResponse_Response() -} - -type ChangeNumberResponse_AccountIdentifiers struct { - // The identifiers of the account after the successful - // number change. - AccountIdentifiers *common.AccountIdentifiers `protobuf:"bytes,1,opt,name=account_identifiers,json=accountIdentifiers,proto3,oneof"` -} - -type ChangeNumberResponse_MismatchedDevices struct { - // Mismatched number of devices or device ids in 'devices to notify' list - MismatchedDevices *messages.MismatchedDevices `protobuf:"bytes,2,opt,name=mismatched_devices,json=mismatchedDevices,proto3,oneof"` -} - -type ChangeNumberResponse_RegistrationLockFailure struct { - // The account associated with the new phone number has a registration lock, - // and the provided registration lock secret was missing or incorrect. - RegistrationLockFailure *RegistrationLockFailure `protobuf:"bytes,3,opt,name=registration_lock_failure,json=registrationLockFailure,proto3,oneof"` -} - -type ChangeNumberResponse_StaleDevices struct { - // Mismatched registration ids in 'devices to notify' list - StaleDevices *StaleDevices `protobuf:"bytes,4,opt,name=stale_devices,json=staleDevices,proto3,oneof"` -} - -type ChangeNumberResponse_MessageTooLarge struct { - // One or more device messages was too large - MessageTooLarge *errors.FailedPrecondition `protobuf:"bytes,5,opt,name=message_too_large,json=messageTooLarge,proto3,oneof"` -} - -type ChangeNumberResponse_UnverifiedRegistrationSession struct { - // The registration session is unverified - UnverifiedRegistrationSession *errors.FailedPrecondition `protobuf:"bytes,6,opt,name=unverified_registration_session,json=unverifiedRegistrationSession,proto3,oneof"` -} - -type ChangeNumberResponse_InvalidRegistrationSession struct { - // The number does not match the registration session, or the registration session is invalid - InvalidRegistrationSession *errors.FailedPrecondition `protobuf:"bytes,7,opt,name=invalid_registration_session,json=invalidRegistrationSession,proto3,oneof"` -} - -type ChangeNumberResponse_RecoveryPasswordVerificationFailed struct { - RecoveryPasswordVerificationFailed *errors.FailedPrecondition `protobuf:"bytes,8,opt,name=recovery_password_verification_failed,json=recoveryPasswordVerificationFailed,proto3,oneof"` -} - -func (*ChangeNumberResponse_AccountIdentifiers) isChangeNumberResponse_Response() {} - -func (*ChangeNumberResponse_MismatchedDevices) isChangeNumberResponse_Response() {} - -func (*ChangeNumberResponse_RegistrationLockFailure) isChangeNumberResponse_Response() {} - -func (*ChangeNumberResponse_StaleDevices) isChangeNumberResponse_Response() {} - -func (*ChangeNumberResponse_MessageTooLarge) isChangeNumberResponse_Response() {} - -func (*ChangeNumberResponse_UnverifiedRegistrationSession) isChangeNumberResponse_Response() {} - -func (*ChangeNumberResponse_InvalidRegistrationSession) isChangeNumberResponse_Response() {} - -func (*ChangeNumberResponse_RecoveryPasswordVerificationFailed) isChangeNumberResponse_Response() {} - -// Information about the current Registration lock and SVR credentials. With a correct PIN, the credentials can -// be used to recover the secret used to derive the registration lock password. -type RegistrationLockFailure struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Time remaining in milliseconds before the existing registration lock expires - TimeRemainingMillis uint64 `protobuf:"varint,1,opt,name=time_remaining_millis,json=timeRemainingMillis,proto3" json:"time_remaining_millis,omitempty"` - // Credentials that can be used with SVR2 - Svr2Credentials *ExternalServiceCredentials `protobuf:"bytes,2,opt,name=svr2_credentials,json=svr2Credentials,proto3" json:"svr2_credentials,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RegistrationLockFailure) Reset() { - *x = RegistrationLockFailure{} - mi := &file_org_signal_chat_account_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RegistrationLockFailure) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegistrationLockFailure) ProtoMessage() {} - -func (x *RegistrationLockFailure) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 RegistrationLockFailure.ProtoReflect.Descriptor instead. -func (*RegistrationLockFailure) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{37} -} - -func (x *RegistrationLockFailure) GetTimeRemainingMillis() uint64 { - if x != nil { - return x.TimeRemainingMillis - } - return 0 -} - -func (x *RegistrationLockFailure) GetSvr2Credentials() *ExternalServiceCredentials { - if x != nil { - return x.Svr2Credentials - } - return nil -} - -// A username/password pair for authenticating with an external service. -type ExternalServiceCredentials struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A username that can be presented to authenticate with the external service. - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - // A password that can be presented to authenticate with the external service. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExternalServiceCredentials) Reset() { - *x = ExternalServiceCredentials{} - mi := &file_org_signal_chat_account_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExternalServiceCredentials) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExternalServiceCredentials) ProtoMessage() {} - -func (x *ExternalServiceCredentials) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ExternalServiceCredentials.ProtoReflect.Descriptor instead. -func (*ExternalServiceCredentials) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{38} -} - -func (x *ExternalServiceCredentials) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ExternalServiceCredentials) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -// A list of devices that are linked to the account but presented a stale -// registration ID (indicating the device has likely been replaced by another -// device). -type StaleDevices struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The IDs of devices that are no longer active. - StaleDevices []uint32 `protobuf:"varint,1,rep,packed,name=stale_devices,json=staleDevices,proto3" json:"stale_devices,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StaleDevices) Reset() { - *x = StaleDevices{} - mi := &file_org_signal_chat_account_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StaleDevices) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StaleDevices) ProtoMessage() {} - -func (x *StaleDevices) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 StaleDevices.ProtoReflect.Descriptor instead. -func (*StaleDevices) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{39} -} - -func (x *StaleDevices) GetStaleDevices() []uint32 { - if x != nil { - return x.StaleDevices - } - return nil -} - -type GetAccountDataReportRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAccountDataReportRequest) Reset() { - *x = GetAccountDataReportRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAccountDataReportRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAccountDataReportRequest) ProtoMessage() {} - -func (x *GetAccountDataReportRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 GetAccountDataReportRequest.ProtoReflect.Descriptor instead. -func (*GetAccountDataReportRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{40} -} - -type GetAccountDataReportResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The JSON representation of the data report - Json string `protobuf:"bytes,3,opt,name=json,proto3" json:"json,omitempty"` - // A plaintext representation of the data report - Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAccountDataReportResponse) Reset() { - *x = GetAccountDataReportResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAccountDataReportResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAccountDataReportResponse) ProtoMessage() {} - -func (x *GetAccountDataReportResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 GetAccountDataReportResponse.ProtoReflect.Descriptor instead. -func (*GetAccountDataReportResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{41} -} - -func (x *GetAccountDataReportResponse) GetJson() string { - if x != nil { - return x.Json - } - return "" -} - -func (x *GetAccountDataReportResponse) GetText() string { - if x != nil { - return x.Text - } - return "" -} - -type GetCapabilitiesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCapabilitiesRequest) Reset() { - *x = GetCapabilitiesRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCapabilitiesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCapabilitiesRequest) ProtoMessage() {} - -func (x *GetCapabilitiesRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 GetCapabilitiesRequest.ProtoReflect.Descriptor instead. -func (*GetCapabilitiesRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{42} -} - -type Capabilities struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of capabilities enabled on the account. - Capabilities []common.DeviceCapability `protobuf:"varint,1,rep,packed,name=capabilities,proto3,enum=org.signal.chat.common.DeviceCapability" json:"capabilities,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Capabilities) Reset() { - *x = Capabilities{} - mi := &file_org_signal_chat_account_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Capabilities) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Capabilities) ProtoMessage() {} - -func (x *Capabilities) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[43] - 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 Capabilities.ProtoReflect.Descriptor instead. -func (*Capabilities) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{43} -} - -func (x *Capabilities) GetCapabilities() []common.DeviceCapability { - if x != nil { - return x.Capabilities - } - return nil -} - -type GetCapabilitiesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of capabilities enabled on the account. - Capabilities *Capabilities `protobuf:"bytes,1,opt,name=capabilities,proto3" json:"capabilities,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCapabilitiesResponse) Reset() { - *x = GetCapabilitiesResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCapabilitiesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCapabilitiesResponse) ProtoMessage() {} - -func (x *GetCapabilitiesResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[44] - 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 GetCapabilitiesResponse.ProtoReflect.Descriptor instead. -func (*GetCapabilitiesResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{44} -} - -func (x *GetCapabilitiesResponse) GetCapabilities() *Capabilities { - if x != nil { - return x.Capabilities - } - return nil -} - -type GetCapabilitiesAnonymousRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The ACI of the account for which to get capabilities. - AccountIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=account_identifier,json=accountIdentifier,proto3" json:"account_identifier,omitempty"` - // Types that are valid to be assigned to Authentication: - // - // *GetCapabilitiesAnonymousRequest_UnidentifiedAccessKey - // *GetCapabilitiesAnonymousRequest_GroupSendToken - Authentication isGetCapabilitiesAnonymousRequest_Authentication `protobuf_oneof:"authentication"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCapabilitiesAnonymousRequest) Reset() { - *x = GetCapabilitiesAnonymousRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCapabilitiesAnonymousRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCapabilitiesAnonymousRequest) ProtoMessage() {} - -func (x *GetCapabilitiesAnonymousRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[45] - 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 GetCapabilitiesAnonymousRequest.ProtoReflect.Descriptor instead. -func (*GetCapabilitiesAnonymousRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{45} -} - -func (x *GetCapabilitiesAnonymousRequest) GetAccountIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.AccountIdentifier - } - return nil -} - -func (x *GetCapabilitiesAnonymousRequest) GetAuthentication() isGetCapabilitiesAnonymousRequest_Authentication { - if x != nil { - return x.Authentication - } - return nil -} - -func (x *GetCapabilitiesAnonymousRequest) GetUnidentifiedAccessKey() []byte { - if x != nil { - if x, ok := x.Authentication.(*GetCapabilitiesAnonymousRequest_UnidentifiedAccessKey); ok { - return x.UnidentifiedAccessKey - } - } - return nil -} - -func (x *GetCapabilitiesAnonymousRequest) GetGroupSendToken() []byte { - if x != nil { - if x, ok := x.Authentication.(*GetCapabilitiesAnonymousRequest_GroupSendToken); ok { - return x.GroupSendToken - } - } - return nil -} - -type isGetCapabilitiesAnonymousRequest_Authentication interface { - isGetCapabilitiesAnonymousRequest_Authentication() -} - -type GetCapabilitiesAnonymousRequest_UnidentifiedAccessKey struct { - // The unidentified access key for the targeted account. - UnidentifiedAccessKey []byte `protobuf:"bytes,2,opt,name=unidentified_access_key,json=unidentifiedAccessKey,proto3,oneof"` -} - -type GetCapabilitiesAnonymousRequest_GroupSendToken struct { - // A group send endorsement token for the targeted account. - GroupSendToken []byte `protobuf:"bytes,3,opt,name=group_send_token,json=groupSendToken,proto3,oneof"` -} - -func (*GetCapabilitiesAnonymousRequest_UnidentifiedAccessKey) isGetCapabilitiesAnonymousRequest_Authentication() { -} - -func (*GetCapabilitiesAnonymousRequest_GroupSendToken) isGetCapabilitiesAnonymousRequest_Authentication() { -} - -type GetCapabilitiesAnonymousResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetCapabilitiesAnonymousResponse_Capabilities - // *GetCapabilitiesAnonymousResponse_NotFound - // *GetCapabilitiesAnonymousResponse_FailedUnidentifiedAuthorization - Response isGetCapabilitiesAnonymousResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCapabilitiesAnonymousResponse) Reset() { - *x = GetCapabilitiesAnonymousResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCapabilitiesAnonymousResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCapabilitiesAnonymousResponse) ProtoMessage() {} - -func (x *GetCapabilitiesAnonymousResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[46] - 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 GetCapabilitiesAnonymousResponse.ProtoReflect.Descriptor instead. -func (*GetCapabilitiesAnonymousResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{46} -} - -func (x *GetCapabilitiesAnonymousResponse) GetResponse() isGetCapabilitiesAnonymousResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetCapabilitiesAnonymousResponse) GetCapabilities() *Capabilities { - if x != nil { - if x, ok := x.Response.(*GetCapabilitiesAnonymousResponse_Capabilities); ok { - return x.Capabilities - } - } - return nil -} - -func (x *GetCapabilitiesAnonymousResponse) GetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetCapabilitiesAnonymousResponse_NotFound); ok { - return x.NotFound - } - } - return nil -} - -func (x *GetCapabilitiesAnonymousResponse) GetFailedUnidentifiedAuthorization() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*GetCapabilitiesAnonymousResponse_FailedUnidentifiedAuthorization); ok { - return x.FailedUnidentifiedAuthorization - } - } - return nil -} - -type isGetCapabilitiesAnonymousResponse_Response interface { - isGetCapabilitiesAnonymousResponse_Response() -} - -type GetCapabilitiesAnonymousResponse_Capabilities struct { - // A list of capabilities enabled on the account. - Capabilities *Capabilities `protobuf:"bytes,1,opt,name=capabilities,proto3,oneof"` -} - -type GetCapabilitiesAnonymousResponse_NotFound struct { - NotFound *errors.NotFound `protobuf:"bytes,2,opt,name=not_found,json=notFound,proto3,oneof"` -} - -type GetCapabilitiesAnonymousResponse_FailedUnidentifiedAuthorization struct { - FailedUnidentifiedAuthorization *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=failed_unidentified_authorization,json=failedUnidentifiedAuthorization,proto3,oneof"` -} - -func (*GetCapabilitiesAnonymousResponse_Capabilities) isGetCapabilitiesAnonymousResponse_Response() {} - -func (*GetCapabilitiesAnonymousResponse_NotFound) isGetCapabilitiesAnonymousResponse_Response() {} - -func (*GetCapabilitiesAnonymousResponse_FailedUnidentifiedAuthorization) isGetCapabilitiesAnonymousResponse_Response() { -} - -type TotpParameters struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The HMAC algorithm (e.g. "HmacSHA256") used by the TOTP generator - Algorithm string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"` - // The length of one-time passwords (in decimal digits) produced and expected - // by the TOTP generator - PasswordLength uint32 `protobuf:"varint,2,opt,name=password_length,json=passwordLength,proto3" json:"password_length,omitempty"` - // The time step (in seconds) used by the TOTP generator - TimeStepSeconds uint32 `protobuf:"varint,3,opt,name=time_step_seconds,json=timeStepSeconds,proto3" json:"time_step_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TotpParameters) Reset() { - *x = TotpParameters{} - mi := &file_org_signal_chat_account_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TotpParameters) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TotpParameters) ProtoMessage() {} - -func (x *TotpParameters) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[47] - 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 TotpParameters.ProtoReflect.Descriptor instead. -func (*TotpParameters) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{47} -} - -func (x *TotpParameters) GetAlgorithm() string { - if x != nil { - return x.Algorithm - } - return "" -} - -func (x *TotpParameters) GetPasswordLength() uint32 { - if x != nil { - return x.PasswordLength - } - return 0 -} - -func (x *TotpParameters) GetTimeStepSeconds() uint32 { - if x != nil { - return x.TimeStepSeconds - } - return 0 -} - -type GenerateTotpKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenerateTotpKeyRequest) Reset() { - *x = GenerateTotpKeyRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenerateTotpKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateTotpKeyRequest) ProtoMessage() {} - -func (x *GenerateTotpKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[48] - 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 GenerateTotpKeyRequest.ProtoReflect.Descriptor instead. -func (*GenerateTotpKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{48} -} - -type GenerateTotpKeyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GenerateTotpKeyResponse_KeyGenerated_ - // *GenerateTotpKeyResponse_TooManyTotpKeys - Response isGenerateTotpKeyResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenerateTotpKeyResponse) Reset() { - *x = GenerateTotpKeyResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenerateTotpKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateTotpKeyResponse) ProtoMessage() {} - -func (x *GenerateTotpKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[49] - 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 GenerateTotpKeyResponse.ProtoReflect.Descriptor instead. -func (*GenerateTotpKeyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{49} -} - -func (x *GenerateTotpKeyResponse) GetResponse() isGenerateTotpKeyResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GenerateTotpKeyResponse) GetKeyGenerated() *GenerateTotpKeyResponse_KeyGenerated { - if x != nil { - if x, ok := x.Response.(*GenerateTotpKeyResponse_KeyGenerated_); ok { - return x.KeyGenerated - } - } - return nil -} - -func (x *GenerateTotpKeyResponse) GetTooManyTotpKeys() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*GenerateTotpKeyResponse_TooManyTotpKeys); ok { - return x.TooManyTotpKeys - } - } - return nil -} - -type isGenerateTotpKeyResponse_Response interface { - isGenerateTotpKeyResponse_Response() -} - -type GenerateTotpKeyResponse_KeyGenerated_ struct { - // A new, pending TOTP key has been generated and added to the authenticated - // account - KeyGenerated *GenerateTotpKeyResponse_KeyGenerated `protobuf:"bytes,1,opt,name=key_generated,json=keyGenerated,proto3,oneof"` -} - -type GenerateTotpKeyResponse_TooManyTotpKeys struct { - // The authenticated account already has too many TOTP keys, and the caller - // must remove one before adding more - TooManyTotpKeys *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=too_many_totp_keys,json=tooManyTotpKeys,proto3,oneof"` -} - -func (*GenerateTotpKeyResponse_KeyGenerated_) isGenerateTotpKeyResponse_Response() {} - -func (*GenerateTotpKeyResponse_TooManyTotpKeys) isGenerateTotpKeyResponse_Response() {} - -type ConfirmTotpKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A one-time password derived from the current pending TOTP key - OneTimePassword uint32 `protobuf:"varint,1,opt,name=one_time_password,json=oneTimePassword,proto3" json:"one_time_password,omitempty"` - // The ciphertext of user-provided metadata (presumably including a - // human-readable name and creation timestamp) to be attached to the - // newly-confirmed key - MetadataCiphertext []byte `protobuf:"bytes,2,opt,name=metadata_ciphertext,json=metadataCiphertext,proto3" json:"metadata_ciphertext,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmTotpKeyRequest) Reset() { - *x = ConfirmTotpKeyRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmTotpKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmTotpKeyRequest) ProtoMessage() {} - -func (x *ConfirmTotpKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[50] - 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 ConfirmTotpKeyRequest.ProtoReflect.Descriptor instead. -func (*ConfirmTotpKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{50} -} - -func (x *ConfirmTotpKeyRequest) GetOneTimePassword() uint32 { - if x != nil { - return x.OneTimePassword - } - return 0 -} - -func (x *ConfirmTotpKeyRequest) GetMetadataCiphertext() []byte { - if x != nil { - return x.MetadataCiphertext - } - return nil -} - -type ConfirmTotpKeyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *ConfirmTotpKeyResponse_KeyConfirmed_ - // *ConfirmTotpKeyResponse_OneTimePasswordNotVerified - Response isConfirmTotpKeyResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmTotpKeyResponse) Reset() { - *x = ConfirmTotpKeyResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmTotpKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmTotpKeyResponse) ProtoMessage() {} - -func (x *ConfirmTotpKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ConfirmTotpKeyResponse.ProtoReflect.Descriptor instead. -func (*ConfirmTotpKeyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{51} -} - -func (x *ConfirmTotpKeyResponse) GetResponse() isConfirmTotpKeyResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *ConfirmTotpKeyResponse) GetKeyConfirmed() *ConfirmTotpKeyResponse_KeyConfirmed { - if x != nil { - if x, ok := x.Response.(*ConfirmTotpKeyResponse_KeyConfirmed_); ok { - return x.KeyConfirmed - } - } - return nil -} - -func (x *ConfirmTotpKeyResponse) GetOneTimePasswordNotVerified() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ConfirmTotpKeyResponse_OneTimePasswordNotVerified); ok { - return x.OneTimePasswordNotVerified - } - } - return nil -} - -type isConfirmTotpKeyResponse_Response interface { - isConfirmTotpKeyResponse_Response() -} - -type ConfirmTotpKeyResponse_KeyConfirmed_ struct { - // The provided one-time password was accepted and the pending TOTP key was - // stored with the provided name ciphertext - KeyConfirmed *ConfirmTotpKeyResponse_KeyConfirmed `protobuf:"bytes,1,opt,name=key_confirmed,json=keyConfirmed,proto3,oneof"` -} - -type ConfirmTotpKeyResponse_OneTimePasswordNotVerified struct { - // The provided one-time password was not valid for any reason (including - // incorrect passwords, misaligned clocks, or missing account records) - OneTimePasswordNotVerified *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=one_time_password_not_verified,json=oneTimePasswordNotVerified,proto3,oneof"` -} - -func (*ConfirmTotpKeyResponse_KeyConfirmed_) isConfirmTotpKeyResponse_Response() {} - -func (*ConfirmTotpKeyResponse_OneTimePasswordNotVerified) isConfirmTotpKeyResponse_Response() {} - -type ListTotpKeysRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListTotpKeysRequest) Reset() { - *x = ListTotpKeysRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListTotpKeysRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTotpKeysRequest) ProtoMessage() {} - -func (x *ListTotpKeysRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_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 ListTotpKeysRequest.ProtoReflect.Descriptor instead. -func (*ListTotpKeysRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{52} -} - -type ListTotpKeysResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Keys map[int32]*ListTotpKeysResponse_TotpKeyMetadata `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListTotpKeysResponse) Reset() { - *x = ListTotpKeysResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListTotpKeysResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTotpKeysResponse) ProtoMessage() {} - -func (x *ListTotpKeysResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[53] - 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 ListTotpKeysResponse.ProtoReflect.Descriptor instead. -func (*ListTotpKeysResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{53} -} - -func (x *ListTotpKeysResponse) GetKeys() map[int32]*ListTotpKeysResponse_TotpKeyMetadata { - if x != nil { - return x.Keys - } - return nil -} - -type SetTotpKeyMetadataRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The account-specific identifier of the TOTP key to modify - KeyId uint32 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - // The ciphertext of the new user-provided metadata to be attached to the - // identified key - MetadataCiphertext []byte `protobuf:"bytes,2,opt,name=metadata_ciphertext,json=metadataCiphertext,proto3" json:"metadata_ciphertext,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetTotpKeyMetadataRequest) Reset() { - *x = SetTotpKeyMetadataRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetTotpKeyMetadataRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetTotpKeyMetadataRequest) ProtoMessage() {} - -func (x *SetTotpKeyMetadataRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[54] - 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 SetTotpKeyMetadataRequest.ProtoReflect.Descriptor instead. -func (*SetTotpKeyMetadataRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{54} -} - -func (x *SetTotpKeyMetadataRequest) GetKeyId() uint32 { - if x != nil { - return x.KeyId - } - return 0 -} - -func (x *SetTotpKeyMetadataRequest) GetMetadataCiphertext() []byte { - if x != nil { - return x.MetadataCiphertext - } - return nil -} - -type SetTotpKeyMetadataResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetTotpKeyMetadataResponse_MetadataUpdated_ - // *SetTotpKeyMetadataResponse_KeyNotFound - Response isSetTotpKeyMetadataResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetTotpKeyMetadataResponse) Reset() { - *x = SetTotpKeyMetadataResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetTotpKeyMetadataResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetTotpKeyMetadataResponse) ProtoMessage() {} - -func (x *SetTotpKeyMetadataResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[55] - 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 SetTotpKeyMetadataResponse.ProtoReflect.Descriptor instead. -func (*SetTotpKeyMetadataResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{55} -} - -func (x *SetTotpKeyMetadataResponse) GetResponse() isSetTotpKeyMetadataResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetTotpKeyMetadataResponse) GetMetadataUpdated() *SetTotpKeyMetadataResponse_MetadataUpdated { - if x != nil { - if x, ok := x.Response.(*SetTotpKeyMetadataResponse_MetadataUpdated_); ok { - return x.MetadataUpdated - } - } - return nil -} - -func (x *SetTotpKeyMetadataResponse) GetKeyNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*SetTotpKeyMetadataResponse_KeyNotFound); ok { - return x.KeyNotFound - } - } - return nil -} - -type isSetTotpKeyMetadataResponse_Response interface { - isSetTotpKeyMetadataResponse_Response() -} - -type SetTotpKeyMetadataResponse_MetadataUpdated_ struct { - // New metadata was stored for the identified TOTP key - MetadataUpdated *SetTotpKeyMetadataResponse_MetadataUpdated `protobuf:"bytes,1,opt,name=metadata_updated,json=metadataUpdated,proto3,oneof"` -} - -type SetTotpKeyMetadataResponse_KeyNotFound struct { - // No TOTP was found with the given ID - KeyNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=key_not_found,json=keyNotFound,proto3,oneof"` -} - -func (*SetTotpKeyMetadataResponse_MetadataUpdated_) isSetTotpKeyMetadataResponse_Response() {} - -func (*SetTotpKeyMetadataResponse_KeyNotFound) isSetTotpKeyMetadataResponse_Response() {} - -type RemoveTotpKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The account-specific identifier of the TOTP key to remove - KeyId uint32 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveTotpKeyRequest) Reset() { - *x = RemoveTotpKeyRequest{} - mi := &file_org_signal_chat_account_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveTotpKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveTotpKeyRequest) ProtoMessage() {} - -func (x *RemoveTotpKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[56] - 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 RemoveTotpKeyRequest.ProtoReflect.Descriptor instead. -func (*RemoveTotpKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{56} -} - -func (x *RemoveTotpKeyRequest) GetKeyId() uint32 { - if x != nil { - return x.KeyId - } - return 0 -} - -type RemoveTotpKeyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveTotpKeyResponse) Reset() { - *x = RemoveTotpKeyResponse{} - mi := &file_org_signal_chat_account_proto_msgTypes[57] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveTotpKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveTotpKeyResponse) ProtoMessage() {} - -func (x *RemoveTotpKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[57] - 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 RemoveTotpKeyResponse.ProtoReflect.Descriptor instead. -func (*RemoveTotpKeyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{57} -} - -type GetEntitlementsResponse_BadgeEntitlement struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The id of the badge the account is entitled. Metadata to display for - // badges may be obtained by cross-referencing badge ids with - // RemoteConfiguration.GetBadges. - BadgeId string `protobuf:"bytes,1,opt,name=badge_id,json=badgeId,proto3" json:"badge_id,omitempty"` - // When the badge expires, in number of seconds since epoch - ExpirationEpochSeconds uint64 `protobuf:"varint,2,opt,name=expiration_epoch_seconds,json=expirationEpochSeconds,proto3" json:"expiration_epoch_seconds,omitempty"` - // Whether the badge is currently configured to be visible - Visible bool `protobuf:"varint,3,opt,name=visible,proto3" json:"visible,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetEntitlementsResponse_BadgeEntitlement) Reset() { - *x = GetEntitlementsResponse_BadgeEntitlement{} - mi := &file_org_signal_chat_account_proto_msgTypes[58] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetEntitlementsResponse_BadgeEntitlement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEntitlementsResponse_BadgeEntitlement) ProtoMessage() {} - -func (x *GetEntitlementsResponse_BadgeEntitlement) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[58] - 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 GetEntitlementsResponse_BadgeEntitlement.ProtoReflect.Descriptor instead. -func (*GetEntitlementsResponse_BadgeEntitlement) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *GetEntitlementsResponse_BadgeEntitlement) GetBadgeId() string { - if x != nil { - return x.BadgeId - } - return "" -} - -func (x *GetEntitlementsResponse_BadgeEntitlement) GetExpirationEpochSeconds() uint64 { - if x != nil { - return x.ExpirationEpochSeconds - } - return 0 -} - -func (x *GetEntitlementsResponse_BadgeEntitlement) GetVisible() bool { - if x != nil { - return x.Visible - } - return false -} - -type GetEntitlementsResponse_BackupEntitlement struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The backup level of the account - Level uint64 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` - // When the backup entitlement expires, in number of seconds since epoch - ExpirationEpochSeconds uint64 `protobuf:"varint,2,opt,name=expiration_epoch_seconds,json=expirationEpochSeconds,proto3" json:"expiration_epoch_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetEntitlementsResponse_BackupEntitlement) Reset() { - *x = GetEntitlementsResponse_BackupEntitlement{} - mi := &file_org_signal_chat_account_proto_msgTypes[59] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetEntitlementsResponse_BackupEntitlement) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEntitlementsResponse_BackupEntitlement) ProtoMessage() {} - -func (x *GetEntitlementsResponse_BackupEntitlement) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[59] - 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 GetEntitlementsResponse_BackupEntitlement.ProtoReflect.Descriptor instead. -func (*GetEntitlementsResponse_BackupEntitlement) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{3, 1} -} - -func (x *GetEntitlementsResponse_BackupEntitlement) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *GetEntitlementsResponse_BackupEntitlement) GetExpirationEpochSeconds() uint64 { - if x != nil { - return x.ExpirationEpochSeconds - } - return 0 -} - -type ConfirmUsernameHashResponse_ConfirmedUsernameHash struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The server-generated username link handle for the newly-confirmed username. - UsernameLinkHandle []byte `protobuf:"bytes,2,opt,name=username_link_handle,json=usernameLinkHandle,proto3" json:"username_link_handle,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmUsernameHashResponse_ConfirmedUsernameHash) Reset() { - *x = ConfirmUsernameHashResponse_ConfirmedUsernameHash{} - mi := &file_org_signal_chat_account_proto_msgTypes[60] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmUsernameHashResponse_ConfirmedUsernameHash) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmUsernameHashResponse_ConfirmedUsernameHash) ProtoMessage() {} - -func (x *ConfirmUsernameHashResponse_ConfirmedUsernameHash) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[60] - 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 ConfirmUsernameHashResponse_ConfirmedUsernameHash.ProtoReflect.Descriptor instead. -func (*ConfirmUsernameHashResponse_ConfirmedUsernameHash) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{14, 0} -} - -func (x *ConfirmUsernameHashResponse_ConfirmedUsernameHash) GetUsernameLinkHandle() []byte { - if x != nil { - return x.UsernameLinkHandle - } - return nil -} - -type GenerateTotpKeyResponse_KeyGenerated struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The raw TOTP key - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // The TOTP parameters associated with the generated key - TotpParameters *TotpParameters `protobuf:"bytes,2,opt,name=totp_parameters,json=totpParameters,proto3" json:"totp_parameters,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenerateTotpKeyResponse_KeyGenerated) Reset() { - *x = GenerateTotpKeyResponse_KeyGenerated{} - mi := &file_org_signal_chat_account_proto_msgTypes[64] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenerateTotpKeyResponse_KeyGenerated) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateTotpKeyResponse_KeyGenerated) ProtoMessage() {} - -func (x *GenerateTotpKeyResponse_KeyGenerated) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[64] - 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 GenerateTotpKeyResponse_KeyGenerated.ProtoReflect.Descriptor instead. -func (*GenerateTotpKeyResponse_KeyGenerated) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{49, 0} -} - -func (x *GenerateTotpKeyResponse_KeyGenerated) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *GenerateTotpKeyResponse_KeyGenerated) GetTotpParameters() *TotpParameters { - if x != nil { - return x.TotpParameters - } - return nil -} - -type ConfirmTotpKeyResponse_KeyConfirmed struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The account-specific identifier for the newly-confirmed TOTP key - KeyId uint32 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmTotpKeyResponse_KeyConfirmed) Reset() { - *x = ConfirmTotpKeyResponse_KeyConfirmed{} - mi := &file_org_signal_chat_account_proto_msgTypes[65] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmTotpKeyResponse_KeyConfirmed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmTotpKeyResponse_KeyConfirmed) ProtoMessage() {} - -func (x *ConfirmTotpKeyResponse_KeyConfirmed) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[65] - 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 ConfirmTotpKeyResponse_KeyConfirmed.ProtoReflect.Descriptor instead. -func (*ConfirmTotpKeyResponse_KeyConfirmed) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{51, 0} -} - -func (x *ConfirmTotpKeyResponse_KeyConfirmed) GetKeyId() uint32 { - if x != nil { - return x.KeyId - } - return 0 -} - -type ListTotpKeysResponse_TotpKeyMetadata struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The user-provided ciphertext for metadata associated with this TOTP key - MetadataCiphertext []byte `protobuf:"bytes,1,opt,name=metadata_ciphertext,json=metadataCiphertext,proto3" json:"metadata_ciphertext,omitempty"` - // The TOTP parameters associated with this key - TotpParameters *TotpParameters `protobuf:"bytes,2,opt,name=totp_parameters,json=totpParameters,proto3" json:"totp_parameters,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListTotpKeysResponse_TotpKeyMetadata) Reset() { - *x = ListTotpKeysResponse_TotpKeyMetadata{} - mi := &file_org_signal_chat_account_proto_msgTypes[66] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListTotpKeysResponse_TotpKeyMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTotpKeysResponse_TotpKeyMetadata) ProtoMessage() {} - -func (x *ListTotpKeysResponse_TotpKeyMetadata) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[66] - 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 ListTotpKeysResponse_TotpKeyMetadata.ProtoReflect.Descriptor instead. -func (*ListTotpKeysResponse_TotpKeyMetadata) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{53, 0} -} - -func (x *ListTotpKeysResponse_TotpKeyMetadata) GetMetadataCiphertext() []byte { - if x != nil { - return x.MetadataCiphertext - } - return nil -} - -func (x *ListTotpKeysResponse_TotpKeyMetadata) GetTotpParameters() *TotpParameters { - if x != nil { - return x.TotpParameters - } - return nil -} - -type SetTotpKeyMetadataResponse_MetadataUpdated struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetTotpKeyMetadataResponse_MetadataUpdated) Reset() { - *x = SetTotpKeyMetadataResponse_MetadataUpdated{} - mi := &file_org_signal_chat_account_proto_msgTypes[68] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetTotpKeyMetadataResponse_MetadataUpdated) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetTotpKeyMetadataResponse_MetadataUpdated) ProtoMessage() {} - -func (x *SetTotpKeyMetadataResponse_MetadataUpdated) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_account_proto_msgTypes[68] - 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 SetTotpKeyMetadataResponse_MetadataUpdated.ProtoReflect.Descriptor instead. -func (*SetTotpKeyMetadataResponse_MetadataUpdated) Descriptor() ([]byte, []int) { - return file_org_signal_chat_account_proto_rawDescGZIP(), []int{55, 0} -} - -var File_org_signal_chat_account_proto protoreflect.FileDescriptor - -const file_org_signal_chat_account_proto_rawDesc = "" + - "\n" + - "\x1dorg/signal/chat/account.proto\x12\x17org.signal.chat.account\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1corg/signal/chat/common.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x1eorg/signal/chat/messages.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x19org/signal/chat/tag.proto\"\x1b\n" + - "\x19GetAccountIdentityRequest\"y\n" + - "\x1aGetAccountIdentityResponse\x12[\n" + - "\x13account_identifiers\x18\x01 \x01(\v2*.org.signal.chat.common.AccountIdentifiersR\x12accountIdentifiers\"\x18\n" + - "\x16GetEntitlementsRequest\"\xb9\x03\n" + - "\x17GetEntitlementsResponse\x12Y\n" + - "\x06badges\x18\x01 \x03(\v2A.org.signal.chat.account.GetEntitlementsResponse.BadgeEntitlementR\x06badges\x12Z\n" + - "\x06backup\x18\x02 \x01(\v2B.org.signal.chat.account.GetEntitlementsResponse.BackupEntitlementR\x06backup\x1a\x81\x01\n" + - "\x10BadgeEntitlement\x12\x19\n" + - "\bbadge_id\x18\x01 \x01(\tR\abadgeId\x128\n" + - "\x18expiration_epoch_seconds\x18\x02 \x01(\x04R\x16expirationEpochSeconds\x12\x18\n" + - "\avisible\x18\x03 \x01(\bR\avisible\x1ac\n" + - "\x11BackupEntitlement\x12\x14\n" + - "\x05level\x18\x01 \x01(\x04R\x05level\x128\n" + - "\x18expiration_epoch_seconds\x18\x02 \x01(\x04R\x16expirationEpochSeconds\"\x16\n" + - "\x14DeleteAccountRequest\"\x17\n" + - "\x15DeleteAccountResponse\"P\n" + - "\x1aSetRegistrationLockRequest\x122\n" + - "\x11registration_lock\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\x10registrationLock\"\x1d\n" + - "\x1bSetRegistrationLockResponse\"\x1e\n" + - "\x1cClearRegistrationLockRequest\"\x1f\n" + - "\x1dClearRegistrationLockResponse\"V\n" + - "\x1aReserveUsernameHashRequest\x128\n" + - "\x0fusername_hashes\x18\x01 \x03(\fB\x0f\x9a\x97\"\x04\b\x01\x10\x14җ\"\x03\x1a\x01 R\x0eusernameHashes\"\x16\n" + - "\x14UsernameNotAvailable\"\xd4\x01\n" + - "\x1bReserveUsernameHashResponse\x12%\n" + - "\rusername_hash\x18\x01 \x01(\fH\x00R\fusernameHash\x12\x81\x01\n" + - "\x16username_not_available\x18\x02 \x01(\v2-.org.signal.chat.account.UsernameNotAvailableB\x1a\xc2\xd5\"\x16username_not_availableH\x00R\x14usernameNotAvailableB\n" + - "\n" + - "\bresponse\"\xa5\x01\n" + - "\x1aConfirmUsernameHashRequest\x12*\n" + - "\rusername_hash\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fusernameHash\x12\x1f\n" + - "\bzk_proof\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\azkProof\x12:\n" + - "\x13username_ciphertext\x18\x03 \x01(\fB\t\x9a\x97\"\x05\b\x01\x10\x80\x01R\x12usernameCiphertext\"\x82\x04\n" + - "\x1bConfirmUsernameHashResponse\x12\x84\x01\n" + - "\x17confirmed_username_hash\x18\x01 \x01(\v2J.org.signal.chat.account.ConfirmUsernameHashResponse.ConfirmedUsernameHashH\x00R\x15confirmedUsernameHash\x12{\n" + - "\x15reservation_not_found\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x19\xc2\xd5\"\x15reservation_not_foundH\x00R\x13reservationNotFound\x12\x81\x01\n" + - "\x16username_not_available\x18\x03 \x01(\v2-.org.signal.chat.account.UsernameNotAvailableB\x1a\xc2\xd5\"\x16username_not_availableH\x00R\x14usernameNotAvailable\x1aO\n" + - "\x15ConfirmedUsernameHash\x120\n" + - "\x14username_link_handle\x18\x02 \x01(\fR\x12usernameLinkHandleJ\x04\b\x01\x10\x02B\n" + - "\n" + - "\bresponse\"\x1b\n" + - "\x19DeleteUsernameHashRequest\"\x1c\n" + - "\x1aDeleteUsernameHashResponse\"~\n" + - "\x16SetUsernameLinkRequest\x12:\n" + - "\x13username_ciphertext\x18\x01 \x01(\fB\t\x9a\x97\"\x05\b\x01\x10\x80\x01R\x12usernameCiphertext\x12(\n" + - "\x10keep_link_handle\x18\x02 \x01(\bR\x0ekeepLinkHandle\"\xc4\x01\n" + - "\x17SetUsernameLinkResponse\x122\n" + - "\x14username_link_handle\x18\x01 \x01(\fH\x00R\x12usernameLinkHandle\x12i\n" + - "\x0fno_username_set\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x13\xc2\xd5\"\x0fno_username_setH\x00R\rnoUsernameSetB\n" + - "\n" + - "\bresponse\"\x1b\n" + - "\x19DeleteUsernameLinkRequest\"\x1c\n" + - "\x1aDeleteUsernameLinkResponse\"\xe5\x01\n" + - "\"ConfigureUnidentifiedAccessRequest\x12?\n" + - "\x17unidentified_access_key\x18\x01 \x01(\fB\x05\xa2\x97\"\x01\x10H\x00R\x15unidentifiedAccessKey\x12m\n" + - "&allow_unrestricted_unidentified_access\x18\x02 \x01(\v2\x16.google.protobuf.EmptyH\x00R#allowUnrestrictedUnidentifiedAccessB\x0f\n" + - "\rconfiguration\"%\n" + - "#ConfigureUnidentifiedAccessResponse\"f\n" + - "#SetDiscoverableByPhoneNumberRequest\x12?\n" + - "\x1cdiscoverable_by_phone_number\x18\x01 \x01(\bR\x19discoverableByPhoneNumber\"&\n" + - "$SetDiscoverableByPhoneNumberResponse\"u\n" + - "&SetRegistrationRecoveryPasswordRequest\x12K\n" + - "\x1eregistration_recovery_password\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\x1cregistrationRecoveryPassword\")\n" + - "'SetRegistrationRecoveryPasswordResponse\"x\n" + - "\x1cCheckAccountExistenceRequest\x12X\n" + - "\x12service_identifier\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\x11serviceIdentifier\"F\n" + - "\x1dCheckAccountExistenceResponse\x12%\n" + - "\x0eaccount_exists\x18\x01 \x01(\bR\raccountExists\"G\n" + - "\x19LookupUsernameHashRequest\x12*\n" + - "\rusername_hash\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fusernameHash\"\xd4\x01\n" + - "\x1aLookupUsernameHashResponse\x12Z\n" + - "\x12service_identifier\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierH\x00R\x11serviceIdentifier\x12N\n" + - "\tnot_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\r\xc2\xd5\"\tnot_foundH\x00R\bnotFoundB\n" + - "\n" + - "\bresponse\"T\n" + - "\x19LookupUsernameLinkRequest\x127\n" + - "\x14username_link_handle\x18\x01 \x01(\fB\x05\xa2\x97\"\x01\x10R\x12usernameLinkHandle\"\xab\x01\n" + - "\x1aLookupUsernameLinkResponse\x121\n" + - "\x13username_ciphertext\x18\x01 \x01(\fH\x00R\x12usernameCiphertext\x12N\n" + - "\tnot_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\r\xc2\xd5\"\tnot_foundH\x00R\bnotFoundB\n" + - "\n" + - "\bresponse\"A\n" + - "\x19SetZkCredentialKeyRequest\x12$\n" + - "\n" + - "public_key\x18\x01 \x01(\fB\x05\xa2\x97\"\x01!R\tpublicKey\"=\n" + - "\x1aSetZkCredentialKeyResponse\x12\x1f\n" + - "\vrotation_id\x18\x01 \x01(\x04R\n" + - "rotationId\"\xb8\b\n" + - "\x13ChangeNumberRequest\x12%\n" + - "\n" + - "session_id\x18\x01 \x01(\fB\x04\x88\x97\"\x01H\x00R\tsessionId\x124\n" + - "\x11recovery_password\x18\x02 \x01(\fB\x05\xa2\x97\"\x01 H\x00R\x10recoveryPassword\x12\x1c\n" + - "\x06number\x18\x03 \x01(\tB\x04\xa8\x97\"\x01R\x06number\x123\n" + - "\x11registration_lock\x18\x04 \x01(\fB\x06\xa2\x97\"\x02\x00 R\x10registrationLock\x12.\n" + - "\x10pni_identity_key\x18\x05 \x01(\fB\x04\x88\x97\"\x01R\x0epniIdentityKey\x12c\n" + - "\x0fdevice_messages\x18\x06 \x01(\v2:.org.signal.chat.messages.IndividualRecipientMessageBundleR\x0edeviceMessages\x12\x84\x01\n" + - "\x1adevice_pni_signed_pre_keys\x18\a \x03(\v2H.org.signal.chat.account.ChangeNumberRequest.DevicePniSignedPreKeysEntryR\x16devicePniSignedPreKeys\x12\x98\x01\n" + - "\"device_pni_pq_last_resort_pre_keys\x18\b \x03(\v2N.org.signal.chat.account.ChangeNumberRequest.DevicePniPqLastResortPreKeysEntryR\x1cdevicePniPqLastResortPreKeys\x12v\n" + - "\x14pni_registration_ids\x18\t \x03(\v2D.org.signal.chat.account.ChangeNumberRequest.PniRegistrationIdsEntryR\x12pniRegistrationIds\x1aq\n" + - "\x1bDevicePniSignedPreKeysEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\rR\x03key\x12<\n" + - "\x05value\x18\x02 \x01(\v2&.org.signal.chat.common.EcSignedPreKeyR\x05value:\x028\x01\x1ax\n" + - "!DevicePniPqLastResortPreKeysEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\rR\x03key\x12=\n" + - "\x05value\x18\x02 \x01(\v2'.org.signal.chat.common.KemSignedPreKeyR\x05value:\x028\x01\x1aE\n" + - "\x17PniRegistrationIdsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\rR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\rR\x05value:\x028\x01B\x0e\n" + - "\fverification\"\xb5\b\n" + - "\x14ChangeNumberResponse\x12]\n" + - "\x13account_identifiers\x18\x01 \x01(\v2*.org.signal.chat.common.AccountIdentifiersH\x00R\x12accountIdentifiers\x12t\n" + - "\x12mismatched_devices\x18\x02 \x01(\v2+.org.signal.chat.messages.MismatchedDevicesB\x16\xc2\xd5\"\x12mismatched_devicesH\x00R\x11mismatchedDevices\x12\x8d\x01\n" + - "\x19registration_lock_failure\x18\x03 \x01(\v20.org.signal.chat.account.RegistrationLockFailureB\x1d\xc2\xd5\"\x19registration_lock_failureH\x00R\x17registrationLockFailure\x12_\n" + - "\rstale_devices\x18\x04 \x01(\v2%.org.signal.chat.account.StaleDevicesB\x11\xc2\xd5\"\rstale_devicesH\x00R\fstaleDevices\x12o\n" + - "\x11message_too_large\x18\x05 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x15\xc2\xd5\"\x11message_too_largeH\x00R\x0fmessageTooLarge\x12\x99\x01\n" + - "\x1funverified_registration_session\x18\x06 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB#\xc2\xd5\"\x1funverified_registration_sessionH\x00R\x1dunverifiedRegistrationSession\x12\x90\x01\n" + - "\x1cinvalid_registration_session\x18\a \x01(\v2*.org.signal.chat.errors.FailedPreconditionB \xc2\xd5\"\x1cinvalid_registration_sessionH\x00R\x1ainvalidRegistrationSession\x12\xaa\x01\n" + - "%recovery_password_verification_failed\x18\b \x01(\v2*.org.signal.chat.errors.FailedPreconditionB)\xc2\xd5\"%recovery_password_verification_failedH\x00R\"recoveryPasswordVerificationFailedB\n" + - "\n" + - "\bresponse\"\xad\x01\n" + - "\x17RegistrationLockFailure\x122\n" + - "\x15time_remaining_millis\x18\x01 \x01(\x04R\x13timeRemainingMillis\x12^\n" + - "\x10svr2_credentials\x18\x02 \x01(\v23.org.signal.chat.account.ExternalServiceCredentialsR\x0fsvr2Credentials\"T\n" + - "\x1aExternalServiceCredentials\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\"=\n" + - "\fStaleDevices\x12-\n" + - "\rstale_devices\x18\x01 \x03(\rB\bҗ\"\x042\x02\x10\x7fR\fstaleDevices\"\x1d\n" + - "\x1bGetAccountDataReportRequest\"F\n" + - "\x1cGetAccountDataReportResponse\x12\x12\n" + - "\x04json\x18\x03 \x01(\tR\x04json\x12\x12\n" + - "\x04text\x18\x04 \x01(\tR\x04text\"\x18\n" + - "\x16GetCapabilitiesRequest\"\\\n" + - "\fCapabilities\x12L\n" + - "\fcapabilities\x18\x01 \x03(\x0e2(.org.signal.chat.common.DeviceCapabilityR\fcapabilities\"d\n" + - "\x17GetCapabilitiesResponse\x12I\n" + - "\fcapabilities\x18\x01 \x01(\v2%.org.signal.chat.account.CapabilitiesR\fcapabilities\"\x8a\x02\n" + - "\x1fGetCapabilitiesAnonymousRequest\x12b\n" + - "\x12account_identifier\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierB\b\xb8\x97\"\x01ȗ\"\x01R\x11accountIdentifier\x12?\n" + - "\x17unidentified_access_key\x18\x02 \x01(\fB\x05\xa2\x97\"\x01\x10H\x00R\x15unidentifiedAccessKey\x120\n" + - "\x10group_send_token\x18\x03 \x01(\fB\x04\x88\x97\"\x01H\x00R\x0egroupSendTokenB\x10\n" + - "\x0eauthentication\"\xfa\x02\n" + - " GetCapabilitiesAnonymousResponse\x12K\n" + - "\fcapabilities\x18\x01 \x01(\v2%.org.signal.chat.account.CapabilitiesH\x00R\fcapabilities\x12N\n" + - "\tnot_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\r\xc2\xd5\"\tnot_foundH\x00R\bnotFound\x12\xac\x01\n" + - "!failed_unidentified_authorization\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB%\xc2\xd5\"!failed_unidentified_authorizationH\x00R\x1ffailedUnidentifiedAuthorizationB\n" + - "\n" + - "\bresponse\"\x83\x01\n" + - "\x0eTotpParameters\x12\x1c\n" + - "\talgorithm\x18\x01 \x01(\tR\talgorithm\x12'\n" + - "\x0fpassword_length\x18\x02 \x01(\rR\x0epasswordLength\x12*\n" + - "\x11time_step_seconds\x18\x03 \x01(\rR\x0ftimeStepSeconds\"\x18\n" + - "\x16GenerateTotpKeyRequest\"\xf2\x02\n" + - "\x17GenerateTotpKeyResponse\x12d\n" + - "\rkey_generated\x18\x01 \x01(\v2=.org.signal.chat.account.GenerateTotpKeyResponse.KeyGeneratedH\x00R\fkeyGenerated\x12q\n" + - "\x12too_many_totp_keys\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x16\xc2\xd5\"\x12too_many_totp_keysH\x00R\x0ftooManyTotpKeys\x1ar\n" + - "\fKeyGenerated\x12\x10\n" + - "\x03key\x18\x01 \x01(\fR\x03key\x12P\n" + - "\x0ftotp_parameters\x18\x02 \x01(\v2'.org.signal.chat.account.TotpParametersR\x0etotpParametersB\n" + - "\n" + - "\bresponse\"|\n" + - "\x15ConfirmTotpKeyRequest\x12*\n" + - "\x11one_time_password\x18\x01 \x01(\rR\x0foneTimePassword\x127\n" + - "\x13metadata_ciphertext\x18\x02 \x01(\fB\x06\xa2\x97\"\x02\xa0\x01R\x12metadataCiphertext\"\xc7\x02\n" + - "\x16ConfirmTotpKeyResponse\x12c\n" + - "\rkey_confirmed\x18\x01 \x01(\v2<.org.signal.chat.account.ConfirmTotpKeyResponse.KeyConfirmedH\x00R\fkeyConfirmed\x12\x94\x01\n" + - "\x1eone_time_password_not_verified\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\"\xc2\xd5\"\x1eone_time_password_not_verifiedH\x00R\x1aoneTimePasswordNotVerified\x1a%\n" + - "\fKeyConfirmed\x12\x15\n" + - "\x06key_id\x18\x01 \x01(\rR\x05keyIdB\n" + - "\n" + - "\bresponse\"\x15\n" + - "\x13ListTotpKeysRequest\"\xf2\x02\n" + - "\x14ListTotpKeysResponse\x12K\n" + - "\x04keys\x18\x01 \x03(\v27.org.signal.chat.account.ListTotpKeysResponse.KeysEntryR\x04keys\x1a\x94\x01\n" + - "\x0fTotpKeyMetadata\x12/\n" + - "\x13metadata_ciphertext\x18\x01 \x01(\fR\x12metadataCiphertext\x12P\n" + - "\x0ftotp_parameters\x18\x02 \x01(\v2'.org.signal.chat.account.TotpParametersR\x0etotpParameters\x1av\n" + - "\tKeysEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x05R\x03key\x12S\n" + - "\x05value\x18\x02 \x01(\v2=.org.signal.chat.account.ListTotpKeysResponse.TotpKeyMetadataR\x05value:\x028\x01\"k\n" + - "\x19SetTotpKeyMetadataRequest\x12\x15\n" + - "\x06key_id\x18\x01 \x01(\rR\x05keyId\x127\n" + - "\x13metadata_ciphertext\x18\x02 \x01(\fB\x06\xa2\x97\"\x02\xa0\x01R\x12metadataCiphertext\"\x88\x02\n" + - "\x1aSetTotpKeyMetadataResponse\x12p\n" + - "\x10metadata_updated\x18\x01 \x01(\v2C.org.signal.chat.account.SetTotpKeyMetadataResponse.MetadataUpdatedH\x00R\x0fmetadataUpdated\x12Y\n" + - "\rkey_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x11\xc2\xd5\"\rkey_not_foundH\x00R\vkeyNotFound\x1a\x11\n" + - "\x0fMetadataUpdatedB\n" + - "\n" + - "\bresponse\"-\n" + - "\x14RemoveTotpKeyRequest\x12\x15\n" + - "\x06key_id\x18\x01 \x01(\rR\x05keyId\"\x17\n" + - "\x15RemoveTotpKeyResponse2\xb4\x16\n" + - "\bAccounts\x12\x7f\n" + - "\x12GetAccountIdentity\x122.org.signal.chat.account.GetAccountIdentityRequest\x1a3.org.signal.chat.account.GetAccountIdentityResponse\"\x00\x12v\n" + - "\x0fGetEntitlements\x12/.org.signal.chat.account.GetEntitlementsRequest\x1a0.org.signal.chat.account.GetEntitlementsResponse\"\x00\x12p\n" + - "\rDeleteAccount\x12-.org.signal.chat.account.DeleteAccountRequest\x1a..org.signal.chat.account.DeleteAccountResponse\"\x00\x12\x82\x01\n" + - "\x13SetRegistrationLock\x123.org.signal.chat.account.SetRegistrationLockRequest\x1a4.org.signal.chat.account.SetRegistrationLockResponse\"\x00\x12\x88\x01\n" + - "\x15ClearRegistrationLock\x125.org.signal.chat.account.ClearRegistrationLockRequest\x1a6.org.signal.chat.account.ClearRegistrationLockResponse\"\x00\x12\x82\x01\n" + - "\x13ReserveUsernameHash\x123.org.signal.chat.account.ReserveUsernameHashRequest\x1a4.org.signal.chat.account.ReserveUsernameHashResponse\"\x00\x12\x82\x01\n" + - "\x13ConfirmUsernameHash\x123.org.signal.chat.account.ConfirmUsernameHashRequest\x1a4.org.signal.chat.account.ConfirmUsernameHashResponse\"\x00\x12\x7f\n" + - "\x12DeleteUsernameHash\x122.org.signal.chat.account.DeleteUsernameHashRequest\x1a3.org.signal.chat.account.DeleteUsernameHashResponse\"\x00\x12v\n" + - "\x0fSetUsernameLink\x12/.org.signal.chat.account.SetUsernameLinkRequest\x1a0.org.signal.chat.account.SetUsernameLinkResponse\"\x00\x12\x7f\n" + - "\x12DeleteUsernameLink\x122.org.signal.chat.account.DeleteUsernameLinkRequest\x1a3.org.signal.chat.account.DeleteUsernameLinkResponse\"\x00\x12\x9a\x01\n" + - "\x1bConfigureUnidentifiedAccess\x12;.org.signal.chat.account.ConfigureUnidentifiedAccessRequest\x1a<.org.signal.chat.account.ConfigureUnidentifiedAccessResponse\"\x00\x12\x9d\x01\n" + - "\x1cSetDiscoverableByPhoneNumber\x12<.org.signal.chat.account.SetDiscoverableByPhoneNumberRequest\x1a=.org.signal.chat.account.SetDiscoverableByPhoneNumberResponse\"\x00\x12\xa6\x01\n" + - "\x1fSetRegistrationRecoveryPassword\x12?.org.signal.chat.account.SetRegistrationRecoveryPasswordRequest\x1a@.org.signal.chat.account.SetRegistrationRecoveryPasswordResponse\"\x00\x12\x7f\n" + - "\x12SetZkCredentialKey\x122.org.signal.chat.account.SetZkCredentialKeyRequest\x1a3.org.signal.chat.account.SetZkCredentialKeyResponse\"\x00\x12m\n" + - "\fChangeNumber\x12,.org.signal.chat.account.ChangeNumberRequest\x1a-.org.signal.chat.account.ChangeNumberResponse\"\x00\x12\x85\x01\n" + - "\x14GetAccountDataReport\x124.org.signal.chat.account.GetAccountDataReportRequest\x1a5.org.signal.chat.account.GetAccountDataReportResponse\"\x00\x12v\n" + - "\x0fGetCapabilities\x12/.org.signal.chat.account.GetCapabilitiesRequest\x1a0.org.signal.chat.account.GetCapabilitiesResponse\"\x00\x12v\n" + - "\x0fGenerateTotpKey\x12/.org.signal.chat.account.GenerateTotpKeyRequest\x1a0.org.signal.chat.account.GenerateTotpKeyResponse\"\x00\x12s\n" + - "\x0eConfirmTotpKey\x12..org.signal.chat.account.ConfirmTotpKeyRequest\x1a/.org.signal.chat.account.ConfirmTotpKeyResponse\"\x00\x12m\n" + - "\fListTotpKeys\x12,.org.signal.chat.account.ListTotpKeysRequest\x1a-.org.signal.chat.account.ListTotpKeysResponse\"\x00\x12\x7f\n" + - "\x12SetTotpKeyMetadata\x122.org.signal.chat.account.SetTotpKeyMetadataRequest\x1a3.org.signal.chat.account.SetTotpKeyMetadataResponse\"\x00\x12p\n" + - "\rRemoveTotpKey\x12-.org.signal.chat.account.RemoveTotpKeyRequest\x1a..org.signal.chat.account.RemoveTotpKeyResponse\"\x00\x1a\x04\xc8\xd5\"\x012\xb1\x04\n" + - "\x11AccountsAnonymous\x12\x88\x01\n" + - "\x15CheckAccountExistence\x125.org.signal.chat.account.CheckAccountExistenceRequest\x1a6.org.signal.chat.account.CheckAccountExistenceResponse\"\x00\x12\x7f\n" + - "\x12LookupUsernameHash\x122.org.signal.chat.account.LookupUsernameHashRequest\x1a3.org.signal.chat.account.LookupUsernameHashResponse\"\x00\x12\x7f\n" + - "\x12LookupUsernameLink\x122.org.signal.chat.account.LookupUsernameLinkRequest\x1a3.org.signal.chat.account.LookupUsernameLinkResponse\"\x00\x12\x88\x01\n" + - "\x0fGetCapabilities\x128.org.signal.chat.account.GetCapabilitiesAnonymousRequest\x1a9.org.signal.chat.account.GetCapabilitiesAnonymousResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_account_proto_rawDescOnce sync.Once - file_org_signal_chat_account_proto_rawDescData []byte -) - -func file_org_signal_chat_account_proto_rawDescGZIP() []byte { - file_org_signal_chat_account_proto_rawDescOnce.Do(func() { - file_org_signal_chat_account_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_account_proto_rawDesc), len(file_org_signal_chat_account_proto_rawDesc))) - }) - return file_org_signal_chat_account_proto_rawDescData -} - -var file_org_signal_chat_account_proto_msgTypes = make([]protoimpl.MessageInfo, 69) -var file_org_signal_chat_account_proto_goTypes = []any{ - (*GetAccountIdentityRequest)(nil), // 0: org.signal.chat.account.GetAccountIdentityRequest - (*GetAccountIdentityResponse)(nil), // 1: org.signal.chat.account.GetAccountIdentityResponse - (*GetEntitlementsRequest)(nil), // 2: org.signal.chat.account.GetEntitlementsRequest - (*GetEntitlementsResponse)(nil), // 3: org.signal.chat.account.GetEntitlementsResponse - (*DeleteAccountRequest)(nil), // 4: org.signal.chat.account.DeleteAccountRequest - (*DeleteAccountResponse)(nil), // 5: org.signal.chat.account.DeleteAccountResponse - (*SetRegistrationLockRequest)(nil), // 6: org.signal.chat.account.SetRegistrationLockRequest - (*SetRegistrationLockResponse)(nil), // 7: org.signal.chat.account.SetRegistrationLockResponse - (*ClearRegistrationLockRequest)(nil), // 8: org.signal.chat.account.ClearRegistrationLockRequest - (*ClearRegistrationLockResponse)(nil), // 9: org.signal.chat.account.ClearRegistrationLockResponse - (*ReserveUsernameHashRequest)(nil), // 10: org.signal.chat.account.ReserveUsernameHashRequest - (*UsernameNotAvailable)(nil), // 11: org.signal.chat.account.UsernameNotAvailable - (*ReserveUsernameHashResponse)(nil), // 12: org.signal.chat.account.ReserveUsernameHashResponse - (*ConfirmUsernameHashRequest)(nil), // 13: org.signal.chat.account.ConfirmUsernameHashRequest - (*ConfirmUsernameHashResponse)(nil), // 14: org.signal.chat.account.ConfirmUsernameHashResponse - (*DeleteUsernameHashRequest)(nil), // 15: org.signal.chat.account.DeleteUsernameHashRequest - (*DeleteUsernameHashResponse)(nil), // 16: org.signal.chat.account.DeleteUsernameHashResponse - (*SetUsernameLinkRequest)(nil), // 17: org.signal.chat.account.SetUsernameLinkRequest - (*SetUsernameLinkResponse)(nil), // 18: org.signal.chat.account.SetUsernameLinkResponse - (*DeleteUsernameLinkRequest)(nil), // 19: org.signal.chat.account.DeleteUsernameLinkRequest - (*DeleteUsernameLinkResponse)(nil), // 20: org.signal.chat.account.DeleteUsernameLinkResponse - (*ConfigureUnidentifiedAccessRequest)(nil), // 21: org.signal.chat.account.ConfigureUnidentifiedAccessRequest - (*ConfigureUnidentifiedAccessResponse)(nil), // 22: org.signal.chat.account.ConfigureUnidentifiedAccessResponse - (*SetDiscoverableByPhoneNumberRequest)(nil), // 23: org.signal.chat.account.SetDiscoverableByPhoneNumberRequest - (*SetDiscoverableByPhoneNumberResponse)(nil), // 24: org.signal.chat.account.SetDiscoverableByPhoneNumberResponse - (*SetRegistrationRecoveryPasswordRequest)(nil), // 25: org.signal.chat.account.SetRegistrationRecoveryPasswordRequest - (*SetRegistrationRecoveryPasswordResponse)(nil), // 26: org.signal.chat.account.SetRegistrationRecoveryPasswordResponse - (*CheckAccountExistenceRequest)(nil), // 27: org.signal.chat.account.CheckAccountExistenceRequest - (*CheckAccountExistenceResponse)(nil), // 28: org.signal.chat.account.CheckAccountExistenceResponse - (*LookupUsernameHashRequest)(nil), // 29: org.signal.chat.account.LookupUsernameHashRequest - (*LookupUsernameHashResponse)(nil), // 30: org.signal.chat.account.LookupUsernameHashResponse - (*LookupUsernameLinkRequest)(nil), // 31: org.signal.chat.account.LookupUsernameLinkRequest - (*LookupUsernameLinkResponse)(nil), // 32: org.signal.chat.account.LookupUsernameLinkResponse - (*SetZkCredentialKeyRequest)(nil), // 33: org.signal.chat.account.SetZkCredentialKeyRequest - (*SetZkCredentialKeyResponse)(nil), // 34: org.signal.chat.account.SetZkCredentialKeyResponse - (*ChangeNumberRequest)(nil), // 35: org.signal.chat.account.ChangeNumberRequest - (*ChangeNumberResponse)(nil), // 36: org.signal.chat.account.ChangeNumberResponse - (*RegistrationLockFailure)(nil), // 37: org.signal.chat.account.RegistrationLockFailure - (*ExternalServiceCredentials)(nil), // 38: org.signal.chat.account.ExternalServiceCredentials - (*StaleDevices)(nil), // 39: org.signal.chat.account.StaleDevices - (*GetAccountDataReportRequest)(nil), // 40: org.signal.chat.account.GetAccountDataReportRequest - (*GetAccountDataReportResponse)(nil), // 41: org.signal.chat.account.GetAccountDataReportResponse - (*GetCapabilitiesRequest)(nil), // 42: org.signal.chat.account.GetCapabilitiesRequest - (*Capabilities)(nil), // 43: org.signal.chat.account.Capabilities - (*GetCapabilitiesResponse)(nil), // 44: org.signal.chat.account.GetCapabilitiesResponse - (*GetCapabilitiesAnonymousRequest)(nil), // 45: org.signal.chat.account.GetCapabilitiesAnonymousRequest - (*GetCapabilitiesAnonymousResponse)(nil), // 46: org.signal.chat.account.GetCapabilitiesAnonymousResponse - (*TotpParameters)(nil), // 47: org.signal.chat.account.TotpParameters - (*GenerateTotpKeyRequest)(nil), // 48: org.signal.chat.account.GenerateTotpKeyRequest - (*GenerateTotpKeyResponse)(nil), // 49: org.signal.chat.account.GenerateTotpKeyResponse - (*ConfirmTotpKeyRequest)(nil), // 50: org.signal.chat.account.ConfirmTotpKeyRequest - (*ConfirmTotpKeyResponse)(nil), // 51: org.signal.chat.account.ConfirmTotpKeyResponse - (*ListTotpKeysRequest)(nil), // 52: org.signal.chat.account.ListTotpKeysRequest - (*ListTotpKeysResponse)(nil), // 53: org.signal.chat.account.ListTotpKeysResponse - (*SetTotpKeyMetadataRequest)(nil), // 54: org.signal.chat.account.SetTotpKeyMetadataRequest - (*SetTotpKeyMetadataResponse)(nil), // 55: org.signal.chat.account.SetTotpKeyMetadataResponse - (*RemoveTotpKeyRequest)(nil), // 56: org.signal.chat.account.RemoveTotpKeyRequest - (*RemoveTotpKeyResponse)(nil), // 57: org.signal.chat.account.RemoveTotpKeyResponse - (*GetEntitlementsResponse_BadgeEntitlement)(nil), // 58: org.signal.chat.account.GetEntitlementsResponse.BadgeEntitlement - (*GetEntitlementsResponse_BackupEntitlement)(nil), // 59: org.signal.chat.account.GetEntitlementsResponse.BackupEntitlement - (*ConfirmUsernameHashResponse_ConfirmedUsernameHash)(nil), // 60: org.signal.chat.account.ConfirmUsernameHashResponse.ConfirmedUsernameHash - nil, // 61: org.signal.chat.account.ChangeNumberRequest.DevicePniSignedPreKeysEntry - nil, // 62: org.signal.chat.account.ChangeNumberRequest.DevicePniPqLastResortPreKeysEntry - nil, // 63: org.signal.chat.account.ChangeNumberRequest.PniRegistrationIdsEntry - (*GenerateTotpKeyResponse_KeyGenerated)(nil), // 64: org.signal.chat.account.GenerateTotpKeyResponse.KeyGenerated - (*ConfirmTotpKeyResponse_KeyConfirmed)(nil), // 65: org.signal.chat.account.ConfirmTotpKeyResponse.KeyConfirmed - (*ListTotpKeysResponse_TotpKeyMetadata)(nil), // 66: org.signal.chat.account.ListTotpKeysResponse.TotpKeyMetadata - nil, // 67: org.signal.chat.account.ListTotpKeysResponse.KeysEntry - (*SetTotpKeyMetadataResponse_MetadataUpdated)(nil), // 68: org.signal.chat.account.SetTotpKeyMetadataResponse.MetadataUpdated - (*common.AccountIdentifiers)(nil), // 69: org.signal.chat.common.AccountIdentifiers - (*errors.FailedPrecondition)(nil), // 70: org.signal.chat.errors.FailedPrecondition - (*emptypb.Empty)(nil), // 71: google.protobuf.Empty - (*common.ServiceIdentifier)(nil), // 72: org.signal.chat.common.ServiceIdentifier - (*errors.NotFound)(nil), // 73: org.signal.chat.errors.NotFound - (*messages.IndividualRecipientMessageBundle)(nil), // 74: org.signal.chat.messages.IndividualRecipientMessageBundle - (*messages.MismatchedDevices)(nil), // 75: org.signal.chat.messages.MismatchedDevices - (common.DeviceCapability)(0), // 76: org.signal.chat.common.DeviceCapability - (*errors.FailedUnidentifiedAuthorization)(nil), // 77: org.signal.chat.errors.FailedUnidentifiedAuthorization - (*common.EcSignedPreKey)(nil), // 78: org.signal.chat.common.EcSignedPreKey - (*common.KemSignedPreKey)(nil), // 79: org.signal.chat.common.KemSignedPreKey -} -var file_org_signal_chat_account_proto_depIdxs = []int32{ - 69, // 0: org.signal.chat.account.GetAccountIdentityResponse.account_identifiers:type_name -> org.signal.chat.common.AccountIdentifiers - 58, // 1: org.signal.chat.account.GetEntitlementsResponse.badges:type_name -> org.signal.chat.account.GetEntitlementsResponse.BadgeEntitlement - 59, // 2: org.signal.chat.account.GetEntitlementsResponse.backup:type_name -> org.signal.chat.account.GetEntitlementsResponse.BackupEntitlement - 11, // 3: org.signal.chat.account.ReserveUsernameHashResponse.username_not_available:type_name -> org.signal.chat.account.UsernameNotAvailable - 60, // 4: org.signal.chat.account.ConfirmUsernameHashResponse.confirmed_username_hash:type_name -> org.signal.chat.account.ConfirmUsernameHashResponse.ConfirmedUsernameHash - 70, // 5: org.signal.chat.account.ConfirmUsernameHashResponse.reservation_not_found:type_name -> org.signal.chat.errors.FailedPrecondition - 11, // 6: org.signal.chat.account.ConfirmUsernameHashResponse.username_not_available:type_name -> org.signal.chat.account.UsernameNotAvailable - 70, // 7: org.signal.chat.account.SetUsernameLinkResponse.no_username_set:type_name -> org.signal.chat.errors.FailedPrecondition - 71, // 8: org.signal.chat.account.ConfigureUnidentifiedAccessRequest.allow_unrestricted_unidentified_access:type_name -> google.protobuf.Empty - 72, // 9: org.signal.chat.account.CheckAccountExistenceRequest.service_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 72, // 10: org.signal.chat.account.LookupUsernameHashResponse.service_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 73, // 11: org.signal.chat.account.LookupUsernameHashResponse.not_found:type_name -> org.signal.chat.errors.NotFound - 73, // 12: org.signal.chat.account.LookupUsernameLinkResponse.not_found:type_name -> org.signal.chat.errors.NotFound - 74, // 13: org.signal.chat.account.ChangeNumberRequest.device_messages:type_name -> org.signal.chat.messages.IndividualRecipientMessageBundle - 61, // 14: org.signal.chat.account.ChangeNumberRequest.device_pni_signed_pre_keys:type_name -> org.signal.chat.account.ChangeNumberRequest.DevicePniSignedPreKeysEntry - 62, // 15: org.signal.chat.account.ChangeNumberRequest.device_pni_pq_last_resort_pre_keys:type_name -> org.signal.chat.account.ChangeNumberRequest.DevicePniPqLastResortPreKeysEntry - 63, // 16: org.signal.chat.account.ChangeNumberRequest.pni_registration_ids:type_name -> org.signal.chat.account.ChangeNumberRequest.PniRegistrationIdsEntry - 69, // 17: org.signal.chat.account.ChangeNumberResponse.account_identifiers:type_name -> org.signal.chat.common.AccountIdentifiers - 75, // 18: org.signal.chat.account.ChangeNumberResponse.mismatched_devices:type_name -> org.signal.chat.messages.MismatchedDevices - 37, // 19: org.signal.chat.account.ChangeNumberResponse.registration_lock_failure:type_name -> org.signal.chat.account.RegistrationLockFailure - 39, // 20: org.signal.chat.account.ChangeNumberResponse.stale_devices:type_name -> org.signal.chat.account.StaleDevices - 70, // 21: org.signal.chat.account.ChangeNumberResponse.message_too_large:type_name -> org.signal.chat.errors.FailedPrecondition - 70, // 22: org.signal.chat.account.ChangeNumberResponse.unverified_registration_session:type_name -> org.signal.chat.errors.FailedPrecondition - 70, // 23: org.signal.chat.account.ChangeNumberResponse.invalid_registration_session:type_name -> org.signal.chat.errors.FailedPrecondition - 70, // 24: org.signal.chat.account.ChangeNumberResponse.recovery_password_verification_failed:type_name -> org.signal.chat.errors.FailedPrecondition - 38, // 25: org.signal.chat.account.RegistrationLockFailure.svr2_credentials:type_name -> org.signal.chat.account.ExternalServiceCredentials - 76, // 26: org.signal.chat.account.Capabilities.capabilities:type_name -> org.signal.chat.common.DeviceCapability - 43, // 27: org.signal.chat.account.GetCapabilitiesResponse.capabilities:type_name -> org.signal.chat.account.Capabilities - 72, // 28: org.signal.chat.account.GetCapabilitiesAnonymousRequest.account_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 43, // 29: org.signal.chat.account.GetCapabilitiesAnonymousResponse.capabilities:type_name -> org.signal.chat.account.Capabilities - 73, // 30: org.signal.chat.account.GetCapabilitiesAnonymousResponse.not_found:type_name -> org.signal.chat.errors.NotFound - 77, // 31: org.signal.chat.account.GetCapabilitiesAnonymousResponse.failed_unidentified_authorization:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 64, // 32: org.signal.chat.account.GenerateTotpKeyResponse.key_generated:type_name -> org.signal.chat.account.GenerateTotpKeyResponse.KeyGenerated - 70, // 33: org.signal.chat.account.GenerateTotpKeyResponse.too_many_totp_keys:type_name -> org.signal.chat.errors.FailedPrecondition - 65, // 34: org.signal.chat.account.ConfirmTotpKeyResponse.key_confirmed:type_name -> org.signal.chat.account.ConfirmTotpKeyResponse.KeyConfirmed - 70, // 35: org.signal.chat.account.ConfirmTotpKeyResponse.one_time_password_not_verified:type_name -> org.signal.chat.errors.FailedPrecondition - 67, // 36: org.signal.chat.account.ListTotpKeysResponse.keys:type_name -> org.signal.chat.account.ListTotpKeysResponse.KeysEntry - 68, // 37: org.signal.chat.account.SetTotpKeyMetadataResponse.metadata_updated:type_name -> org.signal.chat.account.SetTotpKeyMetadataResponse.MetadataUpdated - 73, // 38: org.signal.chat.account.SetTotpKeyMetadataResponse.key_not_found:type_name -> org.signal.chat.errors.NotFound - 78, // 39: org.signal.chat.account.ChangeNumberRequest.DevicePniSignedPreKeysEntry.value:type_name -> org.signal.chat.common.EcSignedPreKey - 79, // 40: org.signal.chat.account.ChangeNumberRequest.DevicePniPqLastResortPreKeysEntry.value:type_name -> org.signal.chat.common.KemSignedPreKey - 47, // 41: org.signal.chat.account.GenerateTotpKeyResponse.KeyGenerated.totp_parameters:type_name -> org.signal.chat.account.TotpParameters - 47, // 42: org.signal.chat.account.ListTotpKeysResponse.TotpKeyMetadata.totp_parameters:type_name -> org.signal.chat.account.TotpParameters - 66, // 43: org.signal.chat.account.ListTotpKeysResponse.KeysEntry.value:type_name -> org.signal.chat.account.ListTotpKeysResponse.TotpKeyMetadata - 0, // 44: org.signal.chat.account.Accounts.GetAccountIdentity:input_type -> org.signal.chat.account.GetAccountIdentityRequest - 2, // 45: org.signal.chat.account.Accounts.GetEntitlements:input_type -> org.signal.chat.account.GetEntitlementsRequest - 4, // 46: org.signal.chat.account.Accounts.DeleteAccount:input_type -> org.signal.chat.account.DeleteAccountRequest - 6, // 47: org.signal.chat.account.Accounts.SetRegistrationLock:input_type -> org.signal.chat.account.SetRegistrationLockRequest - 8, // 48: org.signal.chat.account.Accounts.ClearRegistrationLock:input_type -> org.signal.chat.account.ClearRegistrationLockRequest - 10, // 49: org.signal.chat.account.Accounts.ReserveUsernameHash:input_type -> org.signal.chat.account.ReserveUsernameHashRequest - 13, // 50: org.signal.chat.account.Accounts.ConfirmUsernameHash:input_type -> org.signal.chat.account.ConfirmUsernameHashRequest - 15, // 51: org.signal.chat.account.Accounts.DeleteUsernameHash:input_type -> org.signal.chat.account.DeleteUsernameHashRequest - 17, // 52: org.signal.chat.account.Accounts.SetUsernameLink:input_type -> org.signal.chat.account.SetUsernameLinkRequest - 19, // 53: org.signal.chat.account.Accounts.DeleteUsernameLink:input_type -> org.signal.chat.account.DeleteUsernameLinkRequest - 21, // 54: org.signal.chat.account.Accounts.ConfigureUnidentifiedAccess:input_type -> org.signal.chat.account.ConfigureUnidentifiedAccessRequest - 23, // 55: org.signal.chat.account.Accounts.SetDiscoverableByPhoneNumber:input_type -> org.signal.chat.account.SetDiscoverableByPhoneNumberRequest - 25, // 56: org.signal.chat.account.Accounts.SetRegistrationRecoveryPassword:input_type -> org.signal.chat.account.SetRegistrationRecoveryPasswordRequest - 33, // 57: org.signal.chat.account.Accounts.SetZkCredentialKey:input_type -> org.signal.chat.account.SetZkCredentialKeyRequest - 35, // 58: org.signal.chat.account.Accounts.ChangeNumber:input_type -> org.signal.chat.account.ChangeNumberRequest - 40, // 59: org.signal.chat.account.Accounts.GetAccountDataReport:input_type -> org.signal.chat.account.GetAccountDataReportRequest - 42, // 60: org.signal.chat.account.Accounts.GetCapabilities:input_type -> org.signal.chat.account.GetCapabilitiesRequest - 48, // 61: org.signal.chat.account.Accounts.GenerateTotpKey:input_type -> org.signal.chat.account.GenerateTotpKeyRequest - 50, // 62: org.signal.chat.account.Accounts.ConfirmTotpKey:input_type -> org.signal.chat.account.ConfirmTotpKeyRequest - 52, // 63: org.signal.chat.account.Accounts.ListTotpKeys:input_type -> org.signal.chat.account.ListTotpKeysRequest - 54, // 64: org.signal.chat.account.Accounts.SetTotpKeyMetadata:input_type -> org.signal.chat.account.SetTotpKeyMetadataRequest - 56, // 65: org.signal.chat.account.Accounts.RemoveTotpKey:input_type -> org.signal.chat.account.RemoveTotpKeyRequest - 27, // 66: org.signal.chat.account.AccountsAnonymous.CheckAccountExistence:input_type -> org.signal.chat.account.CheckAccountExistenceRequest - 29, // 67: org.signal.chat.account.AccountsAnonymous.LookupUsernameHash:input_type -> org.signal.chat.account.LookupUsernameHashRequest - 31, // 68: org.signal.chat.account.AccountsAnonymous.LookupUsernameLink:input_type -> org.signal.chat.account.LookupUsernameLinkRequest - 45, // 69: org.signal.chat.account.AccountsAnonymous.GetCapabilities:input_type -> org.signal.chat.account.GetCapabilitiesAnonymousRequest - 1, // 70: org.signal.chat.account.Accounts.GetAccountIdentity:output_type -> org.signal.chat.account.GetAccountIdentityResponse - 3, // 71: org.signal.chat.account.Accounts.GetEntitlements:output_type -> org.signal.chat.account.GetEntitlementsResponse - 5, // 72: org.signal.chat.account.Accounts.DeleteAccount:output_type -> org.signal.chat.account.DeleteAccountResponse - 7, // 73: org.signal.chat.account.Accounts.SetRegistrationLock:output_type -> org.signal.chat.account.SetRegistrationLockResponse - 9, // 74: org.signal.chat.account.Accounts.ClearRegistrationLock:output_type -> org.signal.chat.account.ClearRegistrationLockResponse - 12, // 75: org.signal.chat.account.Accounts.ReserveUsernameHash:output_type -> org.signal.chat.account.ReserveUsernameHashResponse - 14, // 76: org.signal.chat.account.Accounts.ConfirmUsernameHash:output_type -> org.signal.chat.account.ConfirmUsernameHashResponse - 16, // 77: org.signal.chat.account.Accounts.DeleteUsernameHash:output_type -> org.signal.chat.account.DeleteUsernameHashResponse - 18, // 78: org.signal.chat.account.Accounts.SetUsernameLink:output_type -> org.signal.chat.account.SetUsernameLinkResponse - 20, // 79: org.signal.chat.account.Accounts.DeleteUsernameLink:output_type -> org.signal.chat.account.DeleteUsernameLinkResponse - 22, // 80: org.signal.chat.account.Accounts.ConfigureUnidentifiedAccess:output_type -> org.signal.chat.account.ConfigureUnidentifiedAccessResponse - 24, // 81: org.signal.chat.account.Accounts.SetDiscoverableByPhoneNumber:output_type -> org.signal.chat.account.SetDiscoverableByPhoneNumberResponse - 26, // 82: org.signal.chat.account.Accounts.SetRegistrationRecoveryPassword:output_type -> org.signal.chat.account.SetRegistrationRecoveryPasswordResponse - 34, // 83: org.signal.chat.account.Accounts.SetZkCredentialKey:output_type -> org.signal.chat.account.SetZkCredentialKeyResponse - 36, // 84: org.signal.chat.account.Accounts.ChangeNumber:output_type -> org.signal.chat.account.ChangeNumberResponse - 41, // 85: org.signal.chat.account.Accounts.GetAccountDataReport:output_type -> org.signal.chat.account.GetAccountDataReportResponse - 44, // 86: org.signal.chat.account.Accounts.GetCapabilities:output_type -> org.signal.chat.account.GetCapabilitiesResponse - 49, // 87: org.signal.chat.account.Accounts.GenerateTotpKey:output_type -> org.signal.chat.account.GenerateTotpKeyResponse - 51, // 88: org.signal.chat.account.Accounts.ConfirmTotpKey:output_type -> org.signal.chat.account.ConfirmTotpKeyResponse - 53, // 89: org.signal.chat.account.Accounts.ListTotpKeys:output_type -> org.signal.chat.account.ListTotpKeysResponse - 55, // 90: org.signal.chat.account.Accounts.SetTotpKeyMetadata:output_type -> org.signal.chat.account.SetTotpKeyMetadataResponse - 57, // 91: org.signal.chat.account.Accounts.RemoveTotpKey:output_type -> org.signal.chat.account.RemoveTotpKeyResponse - 28, // 92: org.signal.chat.account.AccountsAnonymous.CheckAccountExistence:output_type -> org.signal.chat.account.CheckAccountExistenceResponse - 30, // 93: org.signal.chat.account.AccountsAnonymous.LookupUsernameHash:output_type -> org.signal.chat.account.LookupUsernameHashResponse - 32, // 94: org.signal.chat.account.AccountsAnonymous.LookupUsernameLink:output_type -> org.signal.chat.account.LookupUsernameLinkResponse - 46, // 95: org.signal.chat.account.AccountsAnonymous.GetCapabilities:output_type -> org.signal.chat.account.GetCapabilitiesAnonymousResponse - 70, // [70:96] is the sub-list for method output_type - 44, // [44:70] is the sub-list for method input_type - 44, // [44:44] is the sub-list for extension type_name - 44, // [44:44] is the sub-list for extension extendee - 0, // [0:44] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_account_proto_init() } -func file_org_signal_chat_account_proto_init() { - if File_org_signal_chat_account_proto != nil { - return - } - file_org_signal_chat_account_proto_msgTypes[12].OneofWrappers = []any{ - (*ReserveUsernameHashResponse_UsernameHash)(nil), - (*ReserveUsernameHashResponse_UsernameNotAvailable)(nil), - } - file_org_signal_chat_account_proto_msgTypes[14].OneofWrappers = []any{ - (*ConfirmUsernameHashResponse_ConfirmedUsernameHash_)(nil), - (*ConfirmUsernameHashResponse_ReservationNotFound)(nil), - (*ConfirmUsernameHashResponse_UsernameNotAvailable)(nil), - } - file_org_signal_chat_account_proto_msgTypes[18].OneofWrappers = []any{ - (*SetUsernameLinkResponse_UsernameLinkHandle)(nil), - (*SetUsernameLinkResponse_NoUsernameSet)(nil), - } - file_org_signal_chat_account_proto_msgTypes[21].OneofWrappers = []any{ - (*ConfigureUnidentifiedAccessRequest_UnidentifiedAccessKey)(nil), - (*ConfigureUnidentifiedAccessRequest_AllowUnrestrictedUnidentifiedAccess)(nil), - } - file_org_signal_chat_account_proto_msgTypes[30].OneofWrappers = []any{ - (*LookupUsernameHashResponse_ServiceIdentifier)(nil), - (*LookupUsernameHashResponse_NotFound)(nil), - } - file_org_signal_chat_account_proto_msgTypes[32].OneofWrappers = []any{ - (*LookupUsernameLinkResponse_UsernameCiphertext)(nil), - (*LookupUsernameLinkResponse_NotFound)(nil), - } - file_org_signal_chat_account_proto_msgTypes[35].OneofWrappers = []any{ - (*ChangeNumberRequest_SessionId)(nil), - (*ChangeNumberRequest_RecoveryPassword)(nil), - } - file_org_signal_chat_account_proto_msgTypes[36].OneofWrappers = []any{ - (*ChangeNumberResponse_AccountIdentifiers)(nil), - (*ChangeNumberResponse_MismatchedDevices)(nil), - (*ChangeNumberResponse_RegistrationLockFailure)(nil), - (*ChangeNumberResponse_StaleDevices)(nil), - (*ChangeNumberResponse_MessageTooLarge)(nil), - (*ChangeNumberResponse_UnverifiedRegistrationSession)(nil), - (*ChangeNumberResponse_InvalidRegistrationSession)(nil), - (*ChangeNumberResponse_RecoveryPasswordVerificationFailed)(nil), - } - file_org_signal_chat_account_proto_msgTypes[45].OneofWrappers = []any{ - (*GetCapabilitiesAnonymousRequest_UnidentifiedAccessKey)(nil), - (*GetCapabilitiesAnonymousRequest_GroupSendToken)(nil), - } - file_org_signal_chat_account_proto_msgTypes[46].OneofWrappers = []any{ - (*GetCapabilitiesAnonymousResponse_Capabilities)(nil), - (*GetCapabilitiesAnonymousResponse_NotFound)(nil), - (*GetCapabilitiesAnonymousResponse_FailedUnidentifiedAuthorization)(nil), - } - file_org_signal_chat_account_proto_msgTypes[49].OneofWrappers = []any{ - (*GenerateTotpKeyResponse_KeyGenerated_)(nil), - (*GenerateTotpKeyResponse_TooManyTotpKeys)(nil), - } - file_org_signal_chat_account_proto_msgTypes[51].OneofWrappers = []any{ - (*ConfirmTotpKeyResponse_KeyConfirmed_)(nil), - (*ConfirmTotpKeyResponse_OneTimePasswordNotVerified)(nil), - } - file_org_signal_chat_account_proto_msgTypes[55].OneofWrappers = []any{ - (*SetTotpKeyMetadataResponse_MetadataUpdated_)(nil), - (*SetTotpKeyMetadataResponse_KeyNotFound)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_account_proto_rawDesc), len(file_org_signal_chat_account_proto_rawDesc)), - NumEnums: 0, - NumMessages: 69, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_org_signal_chat_account_proto_goTypes, - DependencyIndexes: file_org_signal_chat_account_proto_depIdxs, - MessageInfos: file_org_signal_chat_account_proto_msgTypes, - }.Build() - File_org_signal_chat_account_proto = out.File - file_org_signal_chat_account_proto_goTypes = nil - file_org_signal_chat_account_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/account/account_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/account/account_grpc.pb.go deleted file mode 100644 index 609e7d6..0000000 --- a/pkg/signalmeow/protobuf/rpc/account/account_grpc.pb.go +++ /dev/null @@ -1,1231 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/account.proto - -package account - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Accounts_GetAccountIdentity_FullMethodName = "/org.signal.chat.account.Accounts/GetAccountIdentity" - Accounts_GetEntitlements_FullMethodName = "/org.signal.chat.account.Accounts/GetEntitlements" - Accounts_DeleteAccount_FullMethodName = "/org.signal.chat.account.Accounts/DeleteAccount" - Accounts_SetRegistrationLock_FullMethodName = "/org.signal.chat.account.Accounts/SetRegistrationLock" - Accounts_ClearRegistrationLock_FullMethodName = "/org.signal.chat.account.Accounts/ClearRegistrationLock" - Accounts_ReserveUsernameHash_FullMethodName = "/org.signal.chat.account.Accounts/ReserveUsernameHash" - Accounts_ConfirmUsernameHash_FullMethodName = "/org.signal.chat.account.Accounts/ConfirmUsernameHash" - Accounts_DeleteUsernameHash_FullMethodName = "/org.signal.chat.account.Accounts/DeleteUsernameHash" - Accounts_SetUsernameLink_FullMethodName = "/org.signal.chat.account.Accounts/SetUsernameLink" - Accounts_DeleteUsernameLink_FullMethodName = "/org.signal.chat.account.Accounts/DeleteUsernameLink" - Accounts_ConfigureUnidentifiedAccess_FullMethodName = "/org.signal.chat.account.Accounts/ConfigureUnidentifiedAccess" - Accounts_SetDiscoverableByPhoneNumber_FullMethodName = "/org.signal.chat.account.Accounts/SetDiscoverableByPhoneNumber" - Accounts_SetRegistrationRecoveryPassword_FullMethodName = "/org.signal.chat.account.Accounts/SetRegistrationRecoveryPassword" - Accounts_SetZkCredentialKey_FullMethodName = "/org.signal.chat.account.Accounts/SetZkCredentialKey" - Accounts_ChangeNumber_FullMethodName = "/org.signal.chat.account.Accounts/ChangeNumber" - Accounts_GetAccountDataReport_FullMethodName = "/org.signal.chat.account.Accounts/GetAccountDataReport" - Accounts_GetCapabilities_FullMethodName = "/org.signal.chat.account.Accounts/GetCapabilities" - Accounts_GenerateTotpKey_FullMethodName = "/org.signal.chat.account.Accounts/GenerateTotpKey" - Accounts_ConfirmTotpKey_FullMethodName = "/org.signal.chat.account.Accounts/ConfirmTotpKey" - Accounts_ListTotpKeys_FullMethodName = "/org.signal.chat.account.Accounts/ListTotpKeys" - Accounts_SetTotpKeyMetadata_FullMethodName = "/org.signal.chat.account.Accounts/SetTotpKeyMetadata" - Accounts_RemoveTotpKey_FullMethodName = "/org.signal.chat.account.Accounts/RemoveTotpKey" -) - -// AccountsClient is the client API for Accounts service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with Signal accounts. -type AccountsClient interface { - // Returns basic identifiers for the authenticated account. - GetAccountIdentity(ctx context.Context, in *GetAccountIdentityRequest, opts ...grpc.CallOption) (*GetAccountIdentityResponse, error) - // Returns entitlements for the authenticated account. - GetEntitlements(ctx context.Context, in *GetEntitlementsRequest, opts ...grpc.CallOption) (*GetEntitlementsResponse, error) - // Deletes the authenticated account, purging all associated data in the - // process. - DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) - // Sets the registration lock secret for the authenticated account. To remove - // a registration lock, please use `ClearRegistrationLock`. - SetRegistrationLock(ctx context.Context, in *SetRegistrationLockRequest, opts ...grpc.CallOption) (*SetRegistrationLockResponse, error) - // Removes any registration lock credentials from the authenticated account. - ClearRegistrationLock(ctx context.Context, in *ClearRegistrationLockRequest, opts ...grpc.CallOption) (*ClearRegistrationLockResponse, error) - // Attempts to reserve one of multiple given username hashes. Reserved - // usernames may be claimed later via `ConfirmUsernameHash`. - ReserveUsernameHash(ctx context.Context, in *ReserveUsernameHashRequest, opts ...grpc.CallOption) (*ReserveUsernameHashResponse, error) - // Sets the username hash/encrypted username to a previously-reserved value - // (see `ReserveUsernameHash`). - ConfirmUsernameHash(ctx context.Context, in *ConfirmUsernameHashRequest, opts ...grpc.CallOption) (*ConfirmUsernameHashResponse, error) - // Clears the current username hash, ciphertext, and link for the - // authenticated user. - DeleteUsernameHash(ctx context.Context, in *DeleteUsernameHashRequest, opts ...grpc.CallOption) (*DeleteUsernameHashResponse, error) - // Associates the given username ciphertext with the account, replacing any - // previously stored ciphertext. A new link handle will optionally be created, - // and the link handle to use will be returned in any event. - SetUsernameLink(ctx context.Context, in *SetUsernameLinkRequest, opts ...grpc.CallOption) (*SetUsernameLinkResponse, error) - // Clears any username link associated with the authenticated account. - DeleteUsernameLink(ctx context.Context, in *DeleteUsernameLinkRequest, opts ...grpc.CallOption) (*DeleteUsernameLinkResponse, error) - // Configures "unidentified access" keys and preferences for the authenticated - // account. Other users permitted to interact with this account anonymously - // may take actions like fetching pre-keys and profiles for this account or - // sending sealed-sender messages without providing identifying credentials. - ConfigureUnidentifiedAccess(ctx context.Context, in *ConfigureUnidentifiedAccessRequest, opts ...grpc.CallOption) (*ConfigureUnidentifiedAccessResponse, error) - // Sets whether the authenticated account may be discovered by phone number - // via the Contact Discovery Service (CDS). - SetDiscoverableByPhoneNumber(ctx context.Context, in *SetDiscoverableByPhoneNumberRequest, opts ...grpc.CallOption) (*SetDiscoverableByPhoneNumberResponse, error) - // Sets the registration recovery password for the authenticated account. - SetRegistrationRecoveryPassword(ctx context.Context, in *SetRegistrationRecoveryPasswordRequest, opts ...grpc.CallOption) (*SetRegistrationRecoveryPasswordResponse, error) - // Store a public key used to issue and verify zero-knowledge (anonymous) credentials for the account. - SetZkCredentialKey(ctx context.Context, in *SetZkCredentialKeyRequest, opts ...grpc.CallOption) (*SetZkCredentialKeyResponse, error) - // Changes the phone number associated with the authenticated account. - ChangeNumber(ctx context.Context, in *ChangeNumberRequest, opts ...grpc.CallOption) (*ChangeNumberResponse, error) - // Produces a report of non-ephemeral account data stored by the service - GetAccountDataReport(ctx context.Context, in *GetAccountDataReportRequest, opts ...grpc.CallOption) (*GetAccountDataReportResponse, error) - // Gets the capabilities for the authenticated account. - GetCapabilities(ctx context.Context, in *GetCapabilitiesRequest, opts ...grpc.CallOption) (*GetCapabilitiesResponse, error) - // Generates and stores a pending TOTP key for the authenticated account. - // To "activate" the key, callers must call the `ConfirmTotpKey` endpoint. - GenerateTotpKey(ctx context.Context, in *GenerateTotpKeyRequest, opts ...grpc.CallOption) (*GenerateTotpKeyResponse, error) - // Confirms that the caller has stored and can derive one-time passwords from - // a pending TOTP key generated via `GenerateTotpKey` and stores/activates the - // key for the caller's account - ConfirmTotpKey(ctx context.Context, in *ConfirmTotpKeyRequest, opts ...grpc.CallOption) (*ConfirmTotpKeyResponse, error) - // Returns a list of confirmed TOTP keys for the authenticated account - ListTotpKeys(ctx context.Context, in *ListTotpKeysRequest, opts ...grpc.CallOption) (*ListTotpKeysResponse, error) - // Updates encrypted, user-supplied metadata (e.g. a human-readable name and - // creation timestamp) for an existing, confirmed TOTP key - SetTotpKeyMetadata(ctx context.Context, in *SetTotpKeyMetadataRequest, opts ...grpc.CallOption) (*SetTotpKeyMetadataResponse, error) - // Removes a TOTP from the authenticated account - RemoveTotpKey(ctx context.Context, in *RemoveTotpKeyRequest, opts ...grpc.CallOption) (*RemoveTotpKeyResponse, error) -} - -type accountsClient struct { - cc grpc.ClientConnInterface -} - -func NewAccountsClient(cc grpc.ClientConnInterface) AccountsClient { - return &accountsClient{cc} -} - -func (c *accountsClient) GetAccountIdentity(ctx context.Context, in *GetAccountIdentityRequest, opts ...grpc.CallOption) (*GetAccountIdentityResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetAccountIdentityResponse) - err := c.cc.Invoke(ctx, Accounts_GetAccountIdentity_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) GetEntitlements(ctx context.Context, in *GetEntitlementsRequest, opts ...grpc.CallOption) (*GetEntitlementsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetEntitlementsResponse) - err := c.cc.Invoke(ctx, Accounts_GetEntitlements_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteAccountResponse) - err := c.cc.Invoke(ctx, Accounts_DeleteAccount_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) SetRegistrationLock(ctx context.Context, in *SetRegistrationLockRequest, opts ...grpc.CallOption) (*SetRegistrationLockResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetRegistrationLockResponse) - err := c.cc.Invoke(ctx, Accounts_SetRegistrationLock_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) ClearRegistrationLock(ctx context.Context, in *ClearRegistrationLockRequest, opts ...grpc.CallOption) (*ClearRegistrationLockResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ClearRegistrationLockResponse) - err := c.cc.Invoke(ctx, Accounts_ClearRegistrationLock_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) ReserveUsernameHash(ctx context.Context, in *ReserveUsernameHashRequest, opts ...grpc.CallOption) (*ReserveUsernameHashResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ReserveUsernameHashResponse) - err := c.cc.Invoke(ctx, Accounts_ReserveUsernameHash_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) ConfirmUsernameHash(ctx context.Context, in *ConfirmUsernameHashRequest, opts ...grpc.CallOption) (*ConfirmUsernameHashResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ConfirmUsernameHashResponse) - err := c.cc.Invoke(ctx, Accounts_ConfirmUsernameHash_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) DeleteUsernameHash(ctx context.Context, in *DeleteUsernameHashRequest, opts ...grpc.CallOption) (*DeleteUsernameHashResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteUsernameHashResponse) - err := c.cc.Invoke(ctx, Accounts_DeleteUsernameHash_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) SetUsernameLink(ctx context.Context, in *SetUsernameLinkRequest, opts ...grpc.CallOption) (*SetUsernameLinkResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetUsernameLinkResponse) - err := c.cc.Invoke(ctx, Accounts_SetUsernameLink_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) DeleteUsernameLink(ctx context.Context, in *DeleteUsernameLinkRequest, opts ...grpc.CallOption) (*DeleteUsernameLinkResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteUsernameLinkResponse) - err := c.cc.Invoke(ctx, Accounts_DeleteUsernameLink_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) ConfigureUnidentifiedAccess(ctx context.Context, in *ConfigureUnidentifiedAccessRequest, opts ...grpc.CallOption) (*ConfigureUnidentifiedAccessResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ConfigureUnidentifiedAccessResponse) - err := c.cc.Invoke(ctx, Accounts_ConfigureUnidentifiedAccess_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) SetDiscoverableByPhoneNumber(ctx context.Context, in *SetDiscoverableByPhoneNumberRequest, opts ...grpc.CallOption) (*SetDiscoverableByPhoneNumberResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetDiscoverableByPhoneNumberResponse) - err := c.cc.Invoke(ctx, Accounts_SetDiscoverableByPhoneNumber_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) SetRegistrationRecoveryPassword(ctx context.Context, in *SetRegistrationRecoveryPasswordRequest, opts ...grpc.CallOption) (*SetRegistrationRecoveryPasswordResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetRegistrationRecoveryPasswordResponse) - err := c.cc.Invoke(ctx, Accounts_SetRegistrationRecoveryPassword_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) SetZkCredentialKey(ctx context.Context, in *SetZkCredentialKeyRequest, opts ...grpc.CallOption) (*SetZkCredentialKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetZkCredentialKeyResponse) - err := c.cc.Invoke(ctx, Accounts_SetZkCredentialKey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) ChangeNumber(ctx context.Context, in *ChangeNumberRequest, opts ...grpc.CallOption) (*ChangeNumberResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ChangeNumberResponse) - err := c.cc.Invoke(ctx, Accounts_ChangeNumber_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) GetAccountDataReport(ctx context.Context, in *GetAccountDataReportRequest, opts ...grpc.CallOption) (*GetAccountDataReportResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetAccountDataReportResponse) - err := c.cc.Invoke(ctx, Accounts_GetAccountDataReport_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) GetCapabilities(ctx context.Context, in *GetCapabilitiesRequest, opts ...grpc.CallOption) (*GetCapabilitiesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetCapabilitiesResponse) - err := c.cc.Invoke(ctx, Accounts_GetCapabilities_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) GenerateTotpKey(ctx context.Context, in *GenerateTotpKeyRequest, opts ...grpc.CallOption) (*GenerateTotpKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GenerateTotpKeyResponse) - err := c.cc.Invoke(ctx, Accounts_GenerateTotpKey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) ConfirmTotpKey(ctx context.Context, in *ConfirmTotpKeyRequest, opts ...grpc.CallOption) (*ConfirmTotpKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ConfirmTotpKeyResponse) - err := c.cc.Invoke(ctx, Accounts_ConfirmTotpKey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) ListTotpKeys(ctx context.Context, in *ListTotpKeysRequest, opts ...grpc.CallOption) (*ListTotpKeysResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListTotpKeysResponse) - err := c.cc.Invoke(ctx, Accounts_ListTotpKeys_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) SetTotpKeyMetadata(ctx context.Context, in *SetTotpKeyMetadataRequest, opts ...grpc.CallOption) (*SetTotpKeyMetadataResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetTotpKeyMetadataResponse) - err := c.cc.Invoke(ctx, Accounts_SetTotpKeyMetadata_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsClient) RemoveTotpKey(ctx context.Context, in *RemoveTotpKeyRequest, opts ...grpc.CallOption) (*RemoveTotpKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveTotpKeyResponse) - err := c.cc.Invoke(ctx, Accounts_RemoveTotpKey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AccountsServer is the server API for Accounts service. -// All implementations must embed UnimplementedAccountsServer -// for forward compatibility. -// -// Provides methods for working with Signal accounts. -type AccountsServer interface { - // Returns basic identifiers for the authenticated account. - GetAccountIdentity(context.Context, *GetAccountIdentityRequest) (*GetAccountIdentityResponse, error) - // Returns entitlements for the authenticated account. - GetEntitlements(context.Context, *GetEntitlementsRequest) (*GetEntitlementsResponse, error) - // Deletes the authenticated account, purging all associated data in the - // process. - DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error) - // Sets the registration lock secret for the authenticated account. To remove - // a registration lock, please use `ClearRegistrationLock`. - SetRegistrationLock(context.Context, *SetRegistrationLockRequest) (*SetRegistrationLockResponse, error) - // Removes any registration lock credentials from the authenticated account. - ClearRegistrationLock(context.Context, *ClearRegistrationLockRequest) (*ClearRegistrationLockResponse, error) - // Attempts to reserve one of multiple given username hashes. Reserved - // usernames may be claimed later via `ConfirmUsernameHash`. - ReserveUsernameHash(context.Context, *ReserveUsernameHashRequest) (*ReserveUsernameHashResponse, error) - // Sets the username hash/encrypted username to a previously-reserved value - // (see `ReserveUsernameHash`). - ConfirmUsernameHash(context.Context, *ConfirmUsernameHashRequest) (*ConfirmUsernameHashResponse, error) - // Clears the current username hash, ciphertext, and link for the - // authenticated user. - DeleteUsernameHash(context.Context, *DeleteUsernameHashRequest) (*DeleteUsernameHashResponse, error) - // Associates the given username ciphertext with the account, replacing any - // previously stored ciphertext. A new link handle will optionally be created, - // and the link handle to use will be returned in any event. - SetUsernameLink(context.Context, *SetUsernameLinkRequest) (*SetUsernameLinkResponse, error) - // Clears any username link associated with the authenticated account. - DeleteUsernameLink(context.Context, *DeleteUsernameLinkRequest) (*DeleteUsernameLinkResponse, error) - // Configures "unidentified access" keys and preferences for the authenticated - // account. Other users permitted to interact with this account anonymously - // may take actions like fetching pre-keys and profiles for this account or - // sending sealed-sender messages without providing identifying credentials. - ConfigureUnidentifiedAccess(context.Context, *ConfigureUnidentifiedAccessRequest) (*ConfigureUnidentifiedAccessResponse, error) - // Sets whether the authenticated account may be discovered by phone number - // via the Contact Discovery Service (CDS). - SetDiscoverableByPhoneNumber(context.Context, *SetDiscoverableByPhoneNumberRequest) (*SetDiscoverableByPhoneNumberResponse, error) - // Sets the registration recovery password for the authenticated account. - SetRegistrationRecoveryPassword(context.Context, *SetRegistrationRecoveryPasswordRequest) (*SetRegistrationRecoveryPasswordResponse, error) - // Store a public key used to issue and verify zero-knowledge (anonymous) credentials for the account. - SetZkCredentialKey(context.Context, *SetZkCredentialKeyRequest) (*SetZkCredentialKeyResponse, error) - // Changes the phone number associated with the authenticated account. - ChangeNumber(context.Context, *ChangeNumberRequest) (*ChangeNumberResponse, error) - // Produces a report of non-ephemeral account data stored by the service - GetAccountDataReport(context.Context, *GetAccountDataReportRequest) (*GetAccountDataReportResponse, error) - // Gets the capabilities for the authenticated account. - GetCapabilities(context.Context, *GetCapabilitiesRequest) (*GetCapabilitiesResponse, error) - // Generates and stores a pending TOTP key for the authenticated account. - // To "activate" the key, callers must call the `ConfirmTotpKey` endpoint. - GenerateTotpKey(context.Context, *GenerateTotpKeyRequest) (*GenerateTotpKeyResponse, error) - // Confirms that the caller has stored and can derive one-time passwords from - // a pending TOTP key generated via `GenerateTotpKey` and stores/activates the - // key for the caller's account - ConfirmTotpKey(context.Context, *ConfirmTotpKeyRequest) (*ConfirmTotpKeyResponse, error) - // Returns a list of confirmed TOTP keys for the authenticated account - ListTotpKeys(context.Context, *ListTotpKeysRequest) (*ListTotpKeysResponse, error) - // Updates encrypted, user-supplied metadata (e.g. a human-readable name and - // creation timestamp) for an existing, confirmed TOTP key - SetTotpKeyMetadata(context.Context, *SetTotpKeyMetadataRequest) (*SetTotpKeyMetadataResponse, error) - // Removes a TOTP from the authenticated account - RemoveTotpKey(context.Context, *RemoveTotpKeyRequest) (*RemoveTotpKeyResponse, error) - mustEmbedUnimplementedAccountsServer() -} - -// UnimplementedAccountsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAccountsServer struct{} - -func (UnimplementedAccountsServer) GetAccountIdentity(context.Context, *GetAccountIdentityRequest) (*GetAccountIdentityResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetAccountIdentity not implemented") -} -func (UnimplementedAccountsServer) GetEntitlements(context.Context, *GetEntitlementsRequest) (*GetEntitlementsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetEntitlements not implemented") -} -func (UnimplementedAccountsServer) DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DeleteAccount not implemented") -} -func (UnimplementedAccountsServer) SetRegistrationLock(context.Context, *SetRegistrationLockRequest) (*SetRegistrationLockResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetRegistrationLock not implemented") -} -func (UnimplementedAccountsServer) ClearRegistrationLock(context.Context, *ClearRegistrationLockRequest) (*ClearRegistrationLockResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ClearRegistrationLock not implemented") -} -func (UnimplementedAccountsServer) ReserveUsernameHash(context.Context, *ReserveUsernameHashRequest) (*ReserveUsernameHashResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ReserveUsernameHash not implemented") -} -func (UnimplementedAccountsServer) ConfirmUsernameHash(context.Context, *ConfirmUsernameHashRequest) (*ConfirmUsernameHashResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ConfirmUsernameHash not implemented") -} -func (UnimplementedAccountsServer) DeleteUsernameHash(context.Context, *DeleteUsernameHashRequest) (*DeleteUsernameHashResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DeleteUsernameHash not implemented") -} -func (UnimplementedAccountsServer) SetUsernameLink(context.Context, *SetUsernameLinkRequest) (*SetUsernameLinkResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetUsernameLink not implemented") -} -func (UnimplementedAccountsServer) DeleteUsernameLink(context.Context, *DeleteUsernameLinkRequest) (*DeleteUsernameLinkResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DeleteUsernameLink not implemented") -} -func (UnimplementedAccountsServer) ConfigureUnidentifiedAccess(context.Context, *ConfigureUnidentifiedAccessRequest) (*ConfigureUnidentifiedAccessResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ConfigureUnidentifiedAccess not implemented") -} -func (UnimplementedAccountsServer) SetDiscoverableByPhoneNumber(context.Context, *SetDiscoverableByPhoneNumberRequest) (*SetDiscoverableByPhoneNumberResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetDiscoverableByPhoneNumber not implemented") -} -func (UnimplementedAccountsServer) SetRegistrationRecoveryPassword(context.Context, *SetRegistrationRecoveryPasswordRequest) (*SetRegistrationRecoveryPasswordResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetRegistrationRecoveryPassword not implemented") -} -func (UnimplementedAccountsServer) SetZkCredentialKey(context.Context, *SetZkCredentialKeyRequest) (*SetZkCredentialKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetZkCredentialKey not implemented") -} -func (UnimplementedAccountsServer) ChangeNumber(context.Context, *ChangeNumberRequest) (*ChangeNumberResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ChangeNumber not implemented") -} -func (UnimplementedAccountsServer) GetAccountDataReport(context.Context, *GetAccountDataReportRequest) (*GetAccountDataReportResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetAccountDataReport not implemented") -} -func (UnimplementedAccountsServer) GetCapabilities(context.Context, *GetCapabilitiesRequest) (*GetCapabilitiesResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetCapabilities not implemented") -} -func (UnimplementedAccountsServer) GenerateTotpKey(context.Context, *GenerateTotpKeyRequest) (*GenerateTotpKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GenerateTotpKey not implemented") -} -func (UnimplementedAccountsServer) ConfirmTotpKey(context.Context, *ConfirmTotpKeyRequest) (*ConfirmTotpKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ConfirmTotpKey not implemented") -} -func (UnimplementedAccountsServer) ListTotpKeys(context.Context, *ListTotpKeysRequest) (*ListTotpKeysResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ListTotpKeys not implemented") -} -func (UnimplementedAccountsServer) SetTotpKeyMetadata(context.Context, *SetTotpKeyMetadataRequest) (*SetTotpKeyMetadataResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetTotpKeyMetadata not implemented") -} -func (UnimplementedAccountsServer) RemoveTotpKey(context.Context, *RemoveTotpKeyRequest) (*RemoveTotpKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method RemoveTotpKey not implemented") -} -func (UnimplementedAccountsServer) mustEmbedUnimplementedAccountsServer() {} -func (UnimplementedAccountsServer) testEmbeddedByValue() {} - -// UnsafeAccountsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AccountsServer will -// result in compilation errors. -type UnsafeAccountsServer interface { - mustEmbedUnimplementedAccountsServer() -} - -func RegisterAccountsServer(s grpc.ServiceRegistrar, srv AccountsServer) { - // If the following call panics, it indicates UnimplementedAccountsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Accounts_ServiceDesc, srv) -} - -func _Accounts_GetAccountIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAccountIdentityRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).GetAccountIdentity(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_GetAccountIdentity_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).GetAccountIdentity(ctx, req.(*GetAccountIdentityRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_GetEntitlements_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetEntitlementsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).GetEntitlements(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_GetEntitlements_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).GetEntitlements(ctx, req.(*GetEntitlementsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_DeleteAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAccountRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).DeleteAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_DeleteAccount_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).DeleteAccount(ctx, req.(*DeleteAccountRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_SetRegistrationLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetRegistrationLockRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).SetRegistrationLock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_SetRegistrationLock_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).SetRegistrationLock(ctx, req.(*SetRegistrationLockRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_ClearRegistrationLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ClearRegistrationLockRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).ClearRegistrationLock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_ClearRegistrationLock_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).ClearRegistrationLock(ctx, req.(*ClearRegistrationLockRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_ReserveUsernameHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ReserveUsernameHashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).ReserveUsernameHash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_ReserveUsernameHash_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).ReserveUsernameHash(ctx, req.(*ReserveUsernameHashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_ConfirmUsernameHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfirmUsernameHashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).ConfirmUsernameHash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_ConfirmUsernameHash_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).ConfirmUsernameHash(ctx, req.(*ConfirmUsernameHashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_DeleteUsernameHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUsernameHashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).DeleteUsernameHash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_DeleteUsernameHash_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).DeleteUsernameHash(ctx, req.(*DeleteUsernameHashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_SetUsernameLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetUsernameLinkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).SetUsernameLink(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_SetUsernameLink_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).SetUsernameLink(ctx, req.(*SetUsernameLinkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_DeleteUsernameLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUsernameLinkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).DeleteUsernameLink(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_DeleteUsernameLink_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).DeleteUsernameLink(ctx, req.(*DeleteUsernameLinkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_ConfigureUnidentifiedAccess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfigureUnidentifiedAccessRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).ConfigureUnidentifiedAccess(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_ConfigureUnidentifiedAccess_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).ConfigureUnidentifiedAccess(ctx, req.(*ConfigureUnidentifiedAccessRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_SetDiscoverableByPhoneNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetDiscoverableByPhoneNumberRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).SetDiscoverableByPhoneNumber(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_SetDiscoverableByPhoneNumber_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).SetDiscoverableByPhoneNumber(ctx, req.(*SetDiscoverableByPhoneNumberRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_SetRegistrationRecoveryPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetRegistrationRecoveryPasswordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).SetRegistrationRecoveryPassword(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_SetRegistrationRecoveryPassword_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).SetRegistrationRecoveryPassword(ctx, req.(*SetRegistrationRecoveryPasswordRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_SetZkCredentialKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetZkCredentialKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).SetZkCredentialKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_SetZkCredentialKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).SetZkCredentialKey(ctx, req.(*SetZkCredentialKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_ChangeNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ChangeNumberRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).ChangeNumber(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_ChangeNumber_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).ChangeNumber(ctx, req.(*ChangeNumberRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_GetAccountDataReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAccountDataReportRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).GetAccountDataReport(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_GetAccountDataReport_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).GetAccountDataReport(ctx, req.(*GetAccountDataReportRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_GetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCapabilitiesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).GetCapabilities(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_GetCapabilities_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).GetCapabilities(ctx, req.(*GetCapabilitiesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_GenerateTotpKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GenerateTotpKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).GenerateTotpKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_GenerateTotpKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).GenerateTotpKey(ctx, req.(*GenerateTotpKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_ConfirmTotpKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfirmTotpKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).ConfirmTotpKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_ConfirmTotpKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).ConfirmTotpKey(ctx, req.(*ConfirmTotpKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_ListTotpKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTotpKeysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).ListTotpKeys(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_ListTotpKeys_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).ListTotpKeys(ctx, req.(*ListTotpKeysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_SetTotpKeyMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetTotpKeyMetadataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).SetTotpKeyMetadata(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_SetTotpKeyMetadata_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).SetTotpKeyMetadata(ctx, req.(*SetTotpKeyMetadataRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Accounts_RemoveTotpKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveTotpKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsServer).RemoveTotpKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Accounts_RemoveTotpKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServer).RemoveTotpKey(ctx, req.(*RemoveTotpKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Accounts_ServiceDesc is the grpc.ServiceDesc for Accounts service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Accounts_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.account.Accounts", - HandlerType: (*AccountsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetAccountIdentity", - Handler: _Accounts_GetAccountIdentity_Handler, - }, - { - MethodName: "GetEntitlements", - Handler: _Accounts_GetEntitlements_Handler, - }, - { - MethodName: "DeleteAccount", - Handler: _Accounts_DeleteAccount_Handler, - }, - { - MethodName: "SetRegistrationLock", - Handler: _Accounts_SetRegistrationLock_Handler, - }, - { - MethodName: "ClearRegistrationLock", - Handler: _Accounts_ClearRegistrationLock_Handler, - }, - { - MethodName: "ReserveUsernameHash", - Handler: _Accounts_ReserveUsernameHash_Handler, - }, - { - MethodName: "ConfirmUsernameHash", - Handler: _Accounts_ConfirmUsernameHash_Handler, - }, - { - MethodName: "DeleteUsernameHash", - Handler: _Accounts_DeleteUsernameHash_Handler, - }, - { - MethodName: "SetUsernameLink", - Handler: _Accounts_SetUsernameLink_Handler, - }, - { - MethodName: "DeleteUsernameLink", - Handler: _Accounts_DeleteUsernameLink_Handler, - }, - { - MethodName: "ConfigureUnidentifiedAccess", - Handler: _Accounts_ConfigureUnidentifiedAccess_Handler, - }, - { - MethodName: "SetDiscoverableByPhoneNumber", - Handler: _Accounts_SetDiscoverableByPhoneNumber_Handler, - }, - { - MethodName: "SetRegistrationRecoveryPassword", - Handler: _Accounts_SetRegistrationRecoveryPassword_Handler, - }, - { - MethodName: "SetZkCredentialKey", - Handler: _Accounts_SetZkCredentialKey_Handler, - }, - { - MethodName: "ChangeNumber", - Handler: _Accounts_ChangeNumber_Handler, - }, - { - MethodName: "GetAccountDataReport", - Handler: _Accounts_GetAccountDataReport_Handler, - }, - { - MethodName: "GetCapabilities", - Handler: _Accounts_GetCapabilities_Handler, - }, - { - MethodName: "GenerateTotpKey", - Handler: _Accounts_GenerateTotpKey_Handler, - }, - { - MethodName: "ConfirmTotpKey", - Handler: _Accounts_ConfirmTotpKey_Handler, - }, - { - MethodName: "ListTotpKeys", - Handler: _Accounts_ListTotpKeys_Handler, - }, - { - MethodName: "SetTotpKeyMetadata", - Handler: _Accounts_SetTotpKeyMetadata_Handler, - }, - { - MethodName: "RemoveTotpKey", - Handler: _Accounts_RemoveTotpKey_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/account.proto", -} - -const ( - AccountsAnonymous_CheckAccountExistence_FullMethodName = "/org.signal.chat.account.AccountsAnonymous/CheckAccountExistence" - AccountsAnonymous_LookupUsernameHash_FullMethodName = "/org.signal.chat.account.AccountsAnonymous/LookupUsernameHash" - AccountsAnonymous_LookupUsernameLink_FullMethodName = "/org.signal.chat.account.AccountsAnonymous/LookupUsernameLink" - AccountsAnonymous_GetCapabilities_FullMethodName = "/org.signal.chat.account.AccountsAnonymous/GetCapabilities" -) - -// AccountsAnonymousClient is the client API for AccountsAnonymous service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for looking up Signal accounts. Callers must not provide -// identifying credentials when calling methods in this service. -type AccountsAnonymousClient interface { - // Checks whether an account with the given service identifier exists. - CheckAccountExistence(ctx context.Context, in *CheckAccountExistenceRequest, opts ...grpc.CallOption) (*CheckAccountExistenceResponse, error) - // Finds the service identifier of the account associated with the given - // username hash. - LookupUsernameHash(ctx context.Context, in *LookupUsernameHashRequest, opts ...grpc.CallOption) (*LookupUsernameHashResponse, error) - // Finds the encrypted username identified by a given username link handle. - LookupUsernameLink(ctx context.Context, in *LookupUsernameLinkRequest, opts ...grpc.CallOption) (*LookupUsernameLinkResponse, error) - // Gets the publicly-visible capabilities enabled on the account identified by - // the provided ACI. - GetCapabilities(ctx context.Context, in *GetCapabilitiesAnonymousRequest, opts ...grpc.CallOption) (*GetCapabilitiesAnonymousResponse, error) -} - -type accountsAnonymousClient struct { - cc grpc.ClientConnInterface -} - -func NewAccountsAnonymousClient(cc grpc.ClientConnInterface) AccountsAnonymousClient { - return &accountsAnonymousClient{cc} -} - -func (c *accountsAnonymousClient) CheckAccountExistence(ctx context.Context, in *CheckAccountExistenceRequest, opts ...grpc.CallOption) (*CheckAccountExistenceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CheckAccountExistenceResponse) - err := c.cc.Invoke(ctx, AccountsAnonymous_CheckAccountExistence_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsAnonymousClient) LookupUsernameHash(ctx context.Context, in *LookupUsernameHashRequest, opts ...grpc.CallOption) (*LookupUsernameHashResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LookupUsernameHashResponse) - err := c.cc.Invoke(ctx, AccountsAnonymous_LookupUsernameHash_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsAnonymousClient) LookupUsernameLink(ctx context.Context, in *LookupUsernameLinkRequest, opts ...grpc.CallOption) (*LookupUsernameLinkResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LookupUsernameLinkResponse) - err := c.cc.Invoke(ctx, AccountsAnonymous_LookupUsernameLink_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *accountsAnonymousClient) GetCapabilities(ctx context.Context, in *GetCapabilitiesAnonymousRequest, opts ...grpc.CallOption) (*GetCapabilitiesAnonymousResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetCapabilitiesAnonymousResponse) - err := c.cc.Invoke(ctx, AccountsAnonymous_GetCapabilities_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AccountsAnonymousServer is the server API for AccountsAnonymous service. -// All implementations must embed UnimplementedAccountsAnonymousServer -// for forward compatibility. -// -// Provides methods for looking up Signal accounts. Callers must not provide -// identifying credentials when calling methods in this service. -type AccountsAnonymousServer interface { - // Checks whether an account with the given service identifier exists. - CheckAccountExistence(context.Context, *CheckAccountExistenceRequest) (*CheckAccountExistenceResponse, error) - // Finds the service identifier of the account associated with the given - // username hash. - LookupUsernameHash(context.Context, *LookupUsernameHashRequest) (*LookupUsernameHashResponse, error) - // Finds the encrypted username identified by a given username link handle. - LookupUsernameLink(context.Context, *LookupUsernameLinkRequest) (*LookupUsernameLinkResponse, error) - // Gets the publicly-visible capabilities enabled on the account identified by - // the provided ACI. - GetCapabilities(context.Context, *GetCapabilitiesAnonymousRequest) (*GetCapabilitiesAnonymousResponse, error) - mustEmbedUnimplementedAccountsAnonymousServer() -} - -// UnimplementedAccountsAnonymousServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAccountsAnonymousServer struct{} - -func (UnimplementedAccountsAnonymousServer) CheckAccountExistence(context.Context, *CheckAccountExistenceRequest) (*CheckAccountExistenceResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CheckAccountExistence not implemented") -} -func (UnimplementedAccountsAnonymousServer) LookupUsernameHash(context.Context, *LookupUsernameHashRequest) (*LookupUsernameHashResponse, error) { - return nil, status.Error(codes.Unimplemented, "method LookupUsernameHash not implemented") -} -func (UnimplementedAccountsAnonymousServer) LookupUsernameLink(context.Context, *LookupUsernameLinkRequest) (*LookupUsernameLinkResponse, error) { - return nil, status.Error(codes.Unimplemented, "method LookupUsernameLink not implemented") -} -func (UnimplementedAccountsAnonymousServer) GetCapabilities(context.Context, *GetCapabilitiesAnonymousRequest) (*GetCapabilitiesAnonymousResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetCapabilities not implemented") -} -func (UnimplementedAccountsAnonymousServer) mustEmbedUnimplementedAccountsAnonymousServer() {} -func (UnimplementedAccountsAnonymousServer) testEmbeddedByValue() {} - -// UnsafeAccountsAnonymousServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AccountsAnonymousServer will -// result in compilation errors. -type UnsafeAccountsAnonymousServer interface { - mustEmbedUnimplementedAccountsAnonymousServer() -} - -func RegisterAccountsAnonymousServer(s grpc.ServiceRegistrar, srv AccountsAnonymousServer) { - // If the following call panics, it indicates UnimplementedAccountsAnonymousServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AccountsAnonymous_ServiceDesc, srv) -} - -func _AccountsAnonymous_CheckAccountExistence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckAccountExistenceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsAnonymousServer).CheckAccountExistence(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccountsAnonymous_CheckAccountExistence_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsAnonymousServer).CheckAccountExistence(ctx, req.(*CheckAccountExistenceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountsAnonymous_LookupUsernameHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LookupUsernameHashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsAnonymousServer).LookupUsernameHash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccountsAnonymous_LookupUsernameHash_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsAnonymousServer).LookupUsernameHash(ctx, req.(*LookupUsernameHashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountsAnonymous_LookupUsernameLink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LookupUsernameLinkRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsAnonymousServer).LookupUsernameLink(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccountsAnonymous_LookupUsernameLink_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsAnonymousServer).LookupUsernameLink(ctx, req.(*LookupUsernameLinkRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AccountsAnonymous_GetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCapabilitiesAnonymousRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AccountsAnonymousServer).GetCapabilities(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AccountsAnonymous_GetCapabilities_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsAnonymousServer).GetCapabilities(ctx, req.(*GetCapabilitiesAnonymousRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AccountsAnonymous_ServiceDesc is the grpc.ServiceDesc for AccountsAnonymous service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AccountsAnonymous_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.account.AccountsAnonymous", - HandlerType: (*AccountsAnonymousServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CheckAccountExistence", - Handler: _AccountsAnonymous_CheckAccountExistence_Handler, - }, - { - MethodName: "LookupUsernameHash", - Handler: _AccountsAnonymous_LookupUsernameHash_Handler, - }, - { - MethodName: "LookupUsernameLink", - Handler: _AccountsAnonymous_LookupUsernameLink_Handler, - }, - { - MethodName: "GetCapabilities", - Handler: _AccountsAnonymous_GetCapabilities_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/account.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/attachments/attachments.pb.go b/pkg/signalmeow/protobuf/rpc/attachments/attachments.pb.go deleted file mode 100644 index da9464d..0000000 --- a/pkg/signalmeow/protobuf/rpc/attachments/attachments.pb.go +++ /dev/null @@ -1,357 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/attachments.proto - -package attachments - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetUploadFormRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The length of the attachment for the requested upload form. Uploads - // performed with this form will be limited to the provided length. - UploadLength uint64 `protobuf:"varint,1,opt,name=uploadLength,proto3" json:"uploadLength,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUploadFormRequest) Reset() { - *x = GetUploadFormRequest{} - mi := &file_org_signal_chat_attachments_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUploadFormRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUploadFormRequest) ProtoMessage() {} - -func (x *GetUploadFormRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_attachments_proto_msgTypes[0] - 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 GetUploadFormRequest.ProtoReflect.Descriptor instead. -func (*GetUploadFormRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_attachments_proto_rawDescGZIP(), []int{0} -} - -func (x *GetUploadFormRequest) GetUploadLength() uint64 { - if x != nil { - return x.UploadLength - } - return 0 -} - -type GetUploadFormResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Outcome: - // - // *GetUploadFormResponse_UploadForm - // *GetUploadFormResponse_ExceedsMaxUploadLength - Outcome isGetUploadFormResponse_Outcome `protobuf_oneof:"outcome"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUploadFormResponse) Reset() { - *x = GetUploadFormResponse{} - mi := &file_org_signal_chat_attachments_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUploadFormResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUploadFormResponse) ProtoMessage() {} - -func (x *GetUploadFormResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_attachments_proto_msgTypes[1] - 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 GetUploadFormResponse.ProtoReflect.Descriptor instead. -func (*GetUploadFormResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_attachments_proto_rawDescGZIP(), []int{1} -} - -func (x *GetUploadFormResponse) GetOutcome() isGetUploadFormResponse_Outcome { - if x != nil { - return x.Outcome - } - return nil -} - -func (x *GetUploadFormResponse) GetUploadForm() *common.UploadForm { - if x != nil { - if x, ok := x.Outcome.(*GetUploadFormResponse_UploadForm); ok { - return x.UploadForm - } - } - return nil -} - -func (x *GetUploadFormResponse) GetExceedsMaxUploadLength() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Outcome.(*GetUploadFormResponse_ExceedsMaxUploadLength); ok { - return x.ExceedsMaxUploadLength - } - } - return nil -} - -type isGetUploadFormResponse_Outcome interface { - isGetUploadFormResponse_Outcome() -} - -type GetUploadFormResponse_UploadForm struct { - UploadForm *common.UploadForm `protobuf:"bytes,1,opt,name=upload_form,json=uploadForm,proto3,oneof"` -} - -type GetUploadFormResponse_ExceedsMaxUploadLength struct { - // The request size was larger than the maximum supported upload size. The - // maximum upload size is subject to change and is governed by - // `global.attachments.maxBytes` - ExceedsMaxUploadLength *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=exceeds_max_upload_length,json=exceedsMaxUploadLength,proto3,oneof"` -} - -func (*GetUploadFormResponse_UploadForm) isGetUploadFormResponse_Outcome() {} - -func (*GetUploadFormResponse_ExceedsMaxUploadLength) isGetUploadFormResponse_Outcome() {} - -type GetStickerUploadFormRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The number of stickers in the sticker pack to upload - StickerCount uint32 `protobuf:"varint,1,opt,name=sticker_count,json=stickerCount,proto3" json:"sticker_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetStickerUploadFormRequest) Reset() { - *x = GetStickerUploadFormRequest{} - mi := &file_org_signal_chat_attachments_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetStickerUploadFormRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetStickerUploadFormRequest) ProtoMessage() {} - -func (x *GetStickerUploadFormRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_attachments_proto_msgTypes[2] - 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 GetStickerUploadFormRequest.ProtoReflect.Descriptor instead. -func (*GetStickerUploadFormRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_attachments_proto_rawDescGZIP(), []int{2} -} - -func (x *GetStickerUploadFormRequest) GetStickerCount() uint32 { - if x != nil { - return x.StickerCount - } - return 0 -} - -type GetStickerUploadFormResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A randomly-generated ID for the new sticker pack - PackId string `protobuf:"bytes,1,opt,name=pack_id,json=packId,proto3" json:"pack_id,omitempty"` - // An upload form clients must use to upload a manifest for the sticker pack - ManifestUploadForm *common.S3UploadForm `protobuf:"bytes,2,opt,name=manifest_upload_form,json=manifestUploadForm,proto3" json:"manifest_upload_form,omitempty"` - // Upload forms for individual stickers within the sticker pack - StickerUploadForms []*common.S3UploadForm `protobuf:"bytes,3,rep,name=sticker_upload_forms,json=stickerUploadForms,proto3" json:"sticker_upload_forms,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetStickerUploadFormResponse) Reset() { - *x = GetStickerUploadFormResponse{} - mi := &file_org_signal_chat_attachments_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetStickerUploadFormResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetStickerUploadFormResponse) ProtoMessage() {} - -func (x *GetStickerUploadFormResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_attachments_proto_msgTypes[3] - 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 GetStickerUploadFormResponse.ProtoReflect.Descriptor instead. -func (*GetStickerUploadFormResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_attachments_proto_rawDescGZIP(), []int{3} -} - -func (x *GetStickerUploadFormResponse) GetPackId() string { - if x != nil { - return x.PackId - } - return "" -} - -func (x *GetStickerUploadFormResponse) GetManifestUploadForm() *common.S3UploadForm { - if x != nil { - return x.ManifestUploadForm - } - return nil -} - -func (x *GetStickerUploadFormResponse) GetStickerUploadForms() []*common.S3UploadForm { - if x != nil { - return x.StickerUploadForms - } - return nil -} - -var File_org_signal_chat_attachments_proto protoreflect.FileDescriptor - -const file_org_signal_chat_attachments_proto_rawDesc = "" + - "\n" + - "!org/signal/chat/attachments.proto\x12\x1borg.signal.chat.attachments\x1a\x1corg/signal/chat/common.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x19org/signal/chat/tag.proto\"B\n" + - "\x14GetUploadFormRequest\x12*\n" + - "\fuploadLength\x18\x01 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\fuploadLength\"\xe7\x01\n" + - "\x15GetUploadFormResponse\x12E\n" + - "\vupload_form\x18\x01 \x01(\v2\".org.signal.chat.common.UploadFormH\x00R\n" + - "uploadForm\x12|\n" + - "\x19exceeds_max_upload_length\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x13\xc2\xd5\"\x0foversize_uploadH\x00R\x16exceedsMaxUploadLengthB\t\n" + - "\aoutcome\"M\n" + - "\x1bGetStickerUploadFormRequest\x12.\n" + - "\rsticker_count\x18\x01 \x01(\rB\t\xb2\x97\"\x05\b\x01\x10\xc9\x01R\fstickerCount\"\xe7\x01\n" + - "\x1cGetStickerUploadFormResponse\x12\x17\n" + - "\apack_id\x18\x01 \x01(\tR\x06packId\x12V\n" + - "\x14manifest_upload_form\x18\x02 \x01(\v2$.org.signal.chat.common.S3UploadFormR\x12manifestUploadForm\x12V\n" + - "\x14sticker_upload_forms\x18\x03 \x03(\v2$.org.signal.chat.common.S3UploadFormR\x12stickerUploadForms2\x9d\x02\n" + - "\vAttachments\x12x\n" + - "\rGetUploadForm\x121.org.signal.chat.attachments.GetUploadFormRequest\x1a2.org.signal.chat.attachments.GetUploadFormResponse\"\x00\x12\x8d\x01\n" + - "\x14GetStickerUploadForm\x128.org.signal.chat.attachments.GetStickerUploadFormRequest\x1a9.org.signal.chat.attachments.GetStickerUploadFormResponse\"\x00\x1a\x04\xc8\xd5\"\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_attachments_proto_rawDescOnce sync.Once - file_org_signal_chat_attachments_proto_rawDescData []byte -) - -func file_org_signal_chat_attachments_proto_rawDescGZIP() []byte { - file_org_signal_chat_attachments_proto_rawDescOnce.Do(func() { - file_org_signal_chat_attachments_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_attachments_proto_rawDesc), len(file_org_signal_chat_attachments_proto_rawDesc))) - }) - return file_org_signal_chat_attachments_proto_rawDescData -} - -var file_org_signal_chat_attachments_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_org_signal_chat_attachments_proto_goTypes = []any{ - (*GetUploadFormRequest)(nil), // 0: org.signal.chat.attachments.GetUploadFormRequest - (*GetUploadFormResponse)(nil), // 1: org.signal.chat.attachments.GetUploadFormResponse - (*GetStickerUploadFormRequest)(nil), // 2: org.signal.chat.attachments.GetStickerUploadFormRequest - (*GetStickerUploadFormResponse)(nil), // 3: org.signal.chat.attachments.GetStickerUploadFormResponse - (*common.UploadForm)(nil), // 4: org.signal.chat.common.UploadForm - (*errors.FailedPrecondition)(nil), // 5: org.signal.chat.errors.FailedPrecondition - (*common.S3UploadForm)(nil), // 6: org.signal.chat.common.S3UploadForm -} -var file_org_signal_chat_attachments_proto_depIdxs = []int32{ - 4, // 0: org.signal.chat.attachments.GetUploadFormResponse.upload_form:type_name -> org.signal.chat.common.UploadForm - 5, // 1: org.signal.chat.attachments.GetUploadFormResponse.exceeds_max_upload_length:type_name -> org.signal.chat.errors.FailedPrecondition - 6, // 2: org.signal.chat.attachments.GetStickerUploadFormResponse.manifest_upload_form:type_name -> org.signal.chat.common.S3UploadForm - 6, // 3: org.signal.chat.attachments.GetStickerUploadFormResponse.sticker_upload_forms:type_name -> org.signal.chat.common.S3UploadForm - 0, // 4: org.signal.chat.attachments.Attachments.GetUploadForm:input_type -> org.signal.chat.attachments.GetUploadFormRequest - 2, // 5: org.signal.chat.attachments.Attachments.GetStickerUploadForm:input_type -> org.signal.chat.attachments.GetStickerUploadFormRequest - 1, // 6: org.signal.chat.attachments.Attachments.GetUploadForm:output_type -> org.signal.chat.attachments.GetUploadFormResponse - 3, // 7: org.signal.chat.attachments.Attachments.GetStickerUploadForm:output_type -> org.signal.chat.attachments.GetStickerUploadFormResponse - 6, // [6:8] is the sub-list for method output_type - 4, // [4:6] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_attachments_proto_init() } -func file_org_signal_chat_attachments_proto_init() { - if File_org_signal_chat_attachments_proto != nil { - return - } - file_org_signal_chat_attachments_proto_msgTypes[1].OneofWrappers = []any{ - (*GetUploadFormResponse_UploadForm)(nil), - (*GetUploadFormResponse_ExceedsMaxUploadLength)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_attachments_proto_rawDesc), len(file_org_signal_chat_attachments_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_attachments_proto_goTypes, - DependencyIndexes: file_org_signal_chat_attachments_proto_depIdxs, - MessageInfos: file_org_signal_chat_attachments_proto_msgTypes, - }.Build() - File_org_signal_chat_attachments_proto = out.File - file_org_signal_chat_attachments_proto_goTypes = nil - file_org_signal_chat_attachments_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/attachments/attachments_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/attachments/attachments_grpc.pb.go deleted file mode 100644 index 2452d12..0000000 --- a/pkg/signalmeow/protobuf/rpc/attachments/attachments_grpc.pb.go +++ /dev/null @@ -1,167 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/attachments.proto - -package attachments - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Attachments_GetUploadForm_FullMethodName = "/org.signal.chat.attachments.Attachments/GetUploadForm" - Attachments_GetStickerUploadForm_FullMethodName = "/org.signal.chat.attachments.Attachments/GetStickerUploadForm" -) - -// AttachmentsClient is the client API for Attachments service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AttachmentsClient interface { - // Retrieve an upload form that can be used to perform a resumable upload - GetUploadForm(ctx context.Context, in *GetUploadFormRequest, opts ...grpc.CallOption) (*GetUploadFormResponse, error) - // Retrieve an upload form that can be used to upload a sticker pack - GetStickerUploadForm(ctx context.Context, in *GetStickerUploadFormRequest, opts ...grpc.CallOption) (*GetStickerUploadFormResponse, error) -} - -type attachmentsClient struct { - cc grpc.ClientConnInterface -} - -func NewAttachmentsClient(cc grpc.ClientConnInterface) AttachmentsClient { - return &attachmentsClient{cc} -} - -func (c *attachmentsClient) GetUploadForm(ctx context.Context, in *GetUploadFormRequest, opts ...grpc.CallOption) (*GetUploadFormResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetUploadFormResponse) - err := c.cc.Invoke(ctx, Attachments_GetUploadForm_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *attachmentsClient) GetStickerUploadForm(ctx context.Context, in *GetStickerUploadFormRequest, opts ...grpc.CallOption) (*GetStickerUploadFormResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetStickerUploadFormResponse) - err := c.cc.Invoke(ctx, Attachments_GetStickerUploadForm_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AttachmentsServer is the server API for Attachments service. -// All implementations must embed UnimplementedAttachmentsServer -// for forward compatibility. -type AttachmentsServer interface { - // Retrieve an upload form that can be used to perform a resumable upload - GetUploadForm(context.Context, *GetUploadFormRequest) (*GetUploadFormResponse, error) - // Retrieve an upload form that can be used to upload a sticker pack - GetStickerUploadForm(context.Context, *GetStickerUploadFormRequest) (*GetStickerUploadFormResponse, error) - mustEmbedUnimplementedAttachmentsServer() -} - -// UnimplementedAttachmentsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAttachmentsServer struct{} - -func (UnimplementedAttachmentsServer) GetUploadForm(context.Context, *GetUploadFormRequest) (*GetUploadFormResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetUploadForm not implemented") -} -func (UnimplementedAttachmentsServer) GetStickerUploadForm(context.Context, *GetStickerUploadFormRequest) (*GetStickerUploadFormResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetStickerUploadForm not implemented") -} -func (UnimplementedAttachmentsServer) mustEmbedUnimplementedAttachmentsServer() {} -func (UnimplementedAttachmentsServer) testEmbeddedByValue() {} - -// UnsafeAttachmentsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AttachmentsServer will -// result in compilation errors. -type UnsafeAttachmentsServer interface { - mustEmbedUnimplementedAttachmentsServer() -} - -func RegisterAttachmentsServer(s grpc.ServiceRegistrar, srv AttachmentsServer) { - // If the following call panics, it indicates UnimplementedAttachmentsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Attachments_ServiceDesc, srv) -} - -func _Attachments_GetUploadForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUploadFormRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentsServer).GetUploadForm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Attachments_GetUploadForm_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentsServer).GetUploadForm(ctx, req.(*GetUploadFormRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Attachments_GetStickerUploadForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetStickerUploadFormRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AttachmentsServer).GetStickerUploadForm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Attachments_GetStickerUploadForm_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AttachmentsServer).GetStickerUploadForm(ctx, req.(*GetStickerUploadFormRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Attachments_ServiceDesc is the grpc.ServiceDesc for Attachments service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Attachments_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.attachments.Attachments", - HandlerType: (*AttachmentsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetUploadForm", - Handler: _Attachments_GetUploadForm_Handler, - }, - { - MethodName: "GetStickerUploadForm", - Handler: _Attachments_GetStickerUploadForm_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/attachments.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/backups/backups.pb.go b/pkg/signalmeow/protobuf/rpc/backups/backups.pb.go deleted file mode 100644 index 91a3fc7..0000000 --- a/pkg/signalmeow/protobuf/rpc/backups/backups.pb.go +++ /dev/null @@ -1,3268 +0,0 @@ -// -// Copyright 2024 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/backups.proto - -package backups - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SetBackupIdRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A BackupAuthCredentialRequest containing a blinded encrypted backup-id, - // encoded in standard padded base64. This backup-id should be used for - // message backups only, and must have the message backup type set on the - // credential. If absent, the message credential request will not be updated. - MessagesBackupAuthCredentialRequest []byte `protobuf:"bytes,1,opt,name=messages_backup_auth_credential_request,json=messagesBackupAuthCredentialRequest,proto3" json:"messages_backup_auth_credential_request,omitempty"` - // A BackupAuthCredentialRequest containing a blinded encrypted backup-id, - // encoded in standard padded base64. This backup-id should be used for - // media only, and must have the media type set on the credential. If absent, - // the media credential request will not be updated. - MediaBackupAuthCredentialRequest []byte `protobuf:"bytes,2,opt,name=media_backup_auth_credential_request,json=mediaBackupAuthCredentialRequest,proto3" json:"media_backup_auth_credential_request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetBackupIdRequest) Reset() { - *x = SetBackupIdRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetBackupIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetBackupIdRequest) ProtoMessage() {} - -func (x *SetBackupIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[0] - 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 SetBackupIdRequest.ProtoReflect.Descriptor instead. -func (*SetBackupIdRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{0} -} - -func (x *SetBackupIdRequest) GetMessagesBackupAuthCredentialRequest() []byte { - if x != nil { - return x.MessagesBackupAuthCredentialRequest - } - return nil -} - -func (x *SetBackupIdRequest) GetMediaBackupAuthCredentialRequest() []byte { - if x != nil { - return x.MediaBackupAuthCredentialRequest - } - return nil -} - -type SetBackupIdResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetBackupIdResponse) Reset() { - *x = SetBackupIdResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetBackupIdResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetBackupIdResponse) ProtoMessage() {} - -func (x *SetBackupIdResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[1] - 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 SetBackupIdResponse.ProtoReflect.Descriptor instead. -func (*SetBackupIdResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{1} -} - -type RedeemReceiptRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Presentation for a previously acquired receipt, serialized with libsignal - Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RedeemReceiptRequest) Reset() { - *x = RedeemReceiptRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RedeemReceiptRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RedeemReceiptRequest) ProtoMessage() {} - -func (x *RedeemReceiptRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[2] - 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 RedeemReceiptRequest.ProtoReflect.Descriptor instead. -func (*RedeemReceiptRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{2} -} - -func (x *RedeemReceiptRequest) GetPresentation() []byte { - if x != nil { - return x.Presentation - } - return nil -} - -type RedeemReceiptResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *RedeemReceiptResponse_Success - // *RedeemReceiptResponse_AccountMissingCommitment - // *RedeemReceiptResponse_InvalidReceipt - Response isRedeemReceiptResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RedeemReceiptResponse) Reset() { - *x = RedeemReceiptResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RedeemReceiptResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RedeemReceiptResponse) ProtoMessage() {} - -func (x *RedeemReceiptResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[3] - 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 RedeemReceiptResponse.ProtoReflect.Descriptor instead. -func (*RedeemReceiptResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{3} -} - -func (x *RedeemReceiptResponse) GetResponse() isRedeemReceiptResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *RedeemReceiptResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*RedeemReceiptResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *RedeemReceiptResponse) GetAccountMissingCommitment() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*RedeemReceiptResponse_AccountMissingCommitment); ok { - return x.AccountMissingCommitment - } - } - return nil -} - -func (x *RedeemReceiptResponse) GetInvalidReceipt() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*RedeemReceiptResponse_InvalidReceipt); ok { - return x.InvalidReceipt - } - } - return nil -} - -type isRedeemReceiptResponse_Response interface { - isRedeemReceiptResponse_Response() -} - -type RedeemReceiptResponse_Success struct { - // The receipt was successfully redeemed - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type RedeemReceiptResponse_AccountMissingCommitment struct { - // The target account does not have a backup-id commitment - AccountMissingCommitment *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=account_missing_commitment,json=accountMissingCommitment,proto3,oneof"` -} - -type RedeemReceiptResponse_InvalidReceipt struct { - // The provided receipt presentation was malformed or expired - InvalidReceipt *errors.FailedPrecondition `protobuf:"bytes,3,opt,name=invalid_receipt,json=invalidReceipt,proto3,oneof"` -} - -func (*RedeemReceiptResponse_Success) isRedeemReceiptResponse_Response() {} - -func (*RedeemReceiptResponse_AccountMissingCommitment) isRedeemReceiptResponse_Response() {} - -func (*RedeemReceiptResponse_InvalidReceipt) isRedeemReceiptResponse_Response() {} - -type GetBackupAuthCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The redemption time for the first credential. This must be a day-aligned - // seconds since epoch in UTC. - RedemptionStart int64 `protobuf:"varint,1,opt,name=redemption_start,json=redemptionStart,proto3" json:"redemption_start,omitempty"` - // The redemption time for the last credential. This must be a day-aligned - // seconds since epoch in UTC. The span between redemptionStart and - // redemptionEnd must not exceed 7 days. - RedemptionStop int64 `protobuf:"varint,2,opt,name=redemption_stop,json=redemptionStop,proto3" json:"redemption_stop,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBackupAuthCredentialsRequest) Reset() { - *x = GetBackupAuthCredentialsRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBackupAuthCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBackupAuthCredentialsRequest) ProtoMessage() {} - -func (x *GetBackupAuthCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[4] - 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 GetBackupAuthCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetBackupAuthCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{4} -} - -func (x *GetBackupAuthCredentialsRequest) GetRedemptionStart() int64 { - if x != nil { - return x.RedemptionStart - } - return 0 -} - -func (x *GetBackupAuthCredentialsRequest) GetRedemptionStop() int64 { - if x != nil { - return x.RedemptionStop - } - return 0 -} - -type GetBackupAuthCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The requested credentials. If absent, there was no existing blinded - // backup id associated with the provided account. - Credentials *GetBackupAuthCredentialsResponse_Credentials `protobuf:"bytes,1,opt,name=credentials,proto3" json:"credentials,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBackupAuthCredentialsResponse) Reset() { - *x = GetBackupAuthCredentialsResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBackupAuthCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBackupAuthCredentialsResponse) ProtoMessage() {} - -func (x *GetBackupAuthCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[5] - 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 GetBackupAuthCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetBackupAuthCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{5} -} - -func (x *GetBackupAuthCredentialsResponse) GetCredentials() *GetBackupAuthCredentialsResponse_Credentials { - if x != nil { - return x.Credentials - } - return nil -} - -type SignedPresentation struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Presentation of a BackupAuthCredential previously retrieved from - // GetBackupAuthCredentials on the authenticated channel - Presentation []byte `protobuf:"bytes,1,opt,name=presentation,proto3" json:"presentation,omitempty"` - // The presentation signed with the private key corresponding to the public - // key set with SetPublicKey - PresentationSignature []byte `protobuf:"bytes,2,opt,name=presentation_signature,json=presentationSignature,proto3" json:"presentation_signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SignedPresentation) Reset() { - *x = SignedPresentation{} - mi := &file_org_signal_chat_backups_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SignedPresentation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignedPresentation) ProtoMessage() {} - -func (x *SignedPresentation) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[6] - 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 SignedPresentation.ProtoReflect.Descriptor instead. -func (*SignedPresentation) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{6} -} - -func (x *SignedPresentation) GetPresentation() []byte { - if x != nil { - return x.Presentation - } - return nil -} - -func (x *SignedPresentation) GetPresentationSignature() []byte { - if x != nil { - return x.PresentationSignature - } - return nil -} - -type SetPublicKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - // The public key, serialized in libsignal's elliptic-curve public key format. - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetPublicKeyRequest) Reset() { - *x = SetPublicKeyRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetPublicKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetPublicKeyRequest) ProtoMessage() {} - -func (x *SetPublicKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[7] - 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 SetPublicKeyRequest.ProtoReflect.Descriptor instead. -func (*SetPublicKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{7} -} - -func (x *SetPublicKeyRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -func (x *SetPublicKeyRequest) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -type SetPublicKeyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetPublicKeyResponse_Success - // *SetPublicKeyResponse_FailedAuthentication - Response isSetPublicKeyResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetPublicKeyResponse) Reset() { - *x = SetPublicKeyResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetPublicKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetPublicKeyResponse) ProtoMessage() {} - -func (x *SetPublicKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 SetPublicKeyResponse.ProtoReflect.Descriptor instead. -func (*SetPublicKeyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{8} -} - -func (x *SetPublicKeyResponse) GetResponse() isSetPublicKeyResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetPublicKeyResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*SetPublicKeyResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SetPublicKeyResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*SetPublicKeyResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isSetPublicKeyResponse_Response interface { - isSetPublicKeyResponse_Response() -} - -type SetPublicKeyResponse_Success struct { - // The public key was successfully set - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SetPublicKeyResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - // - // This may also be returned if there was an existing public key and the - // provided public key did not match. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*SetPublicKeyResponse_Success) isSetPublicKeyResponse_Response() {} - -func (*SetPublicKeyResponse_FailedAuthentication) isSetPublicKeyResponse_Response() {} - -type GetCdnCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - Cdn uint32 `protobuf:"varint,2,opt,name=cdn,proto3" json:"cdn,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCdnCredentialsRequest) Reset() { - *x = GetCdnCredentialsRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCdnCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCdnCredentialsRequest) ProtoMessage() {} - -func (x *GetCdnCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetCdnCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetCdnCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{9} -} - -func (x *GetCdnCredentialsRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -func (x *GetCdnCredentialsRequest) GetCdn() uint32 { - if x != nil { - return x.Cdn - } - return 0 -} - -type GetCdnCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetCdnCredentialsResponse_CdnCredentials_ - // *GetCdnCredentialsResponse_FailedAuthentication - Response isGetCdnCredentialsResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCdnCredentialsResponse) Reset() { - *x = GetCdnCredentialsResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCdnCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCdnCredentialsResponse) ProtoMessage() {} - -func (x *GetCdnCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetCdnCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetCdnCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{10} -} - -func (x *GetCdnCredentialsResponse) GetResponse() isGetCdnCredentialsResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetCdnCredentialsResponse) GetCdnCredentials() *GetCdnCredentialsResponse_CdnCredentials { - if x != nil { - if x, ok := x.Response.(*GetCdnCredentialsResponse_CdnCredentials_); ok { - return x.CdnCredentials - } - } - return nil -} - -func (x *GetCdnCredentialsResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*GetCdnCredentialsResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isGetCdnCredentialsResponse_Response interface { - isGetCdnCredentialsResponse_Response() -} - -type GetCdnCredentialsResponse_CdnCredentials_ struct { - // Headers to include with requests to the read from the backup CDN. Includes - // time limited read-only credentials. - CdnCredentials *GetCdnCredentialsResponse_CdnCredentials `protobuf:"bytes,1,opt,name=cdn_credentials,json=cdnCredentials,proto3,oneof"` -} - -type GetCdnCredentialsResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*GetCdnCredentialsResponse_CdnCredentials_) isGetCdnCredentialsResponse_Response() {} - -func (*GetCdnCredentialsResponse_FailedAuthentication) isGetCdnCredentialsResponse_Response() {} - -type GetSvrBCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSvrBCredentialsRequest) Reset() { - *x = GetSvrBCredentialsRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSvrBCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSvrBCredentialsRequest) ProtoMessage() {} - -func (x *GetSvrBCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[11] - 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 GetSvrBCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetSvrBCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{11} -} - -func (x *GetSvrBCredentialsRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -type GetSvrBCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetSvrBCredentialsResponse_SvrbCredentials - // *GetSvrBCredentialsResponse_FailedAuthentication - Response isGetSvrBCredentialsResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSvrBCredentialsResponse) Reset() { - *x = GetSvrBCredentialsResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSvrBCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSvrBCredentialsResponse) ProtoMessage() {} - -func (x *GetSvrBCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetSvrBCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetSvrBCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{12} -} - -func (x *GetSvrBCredentialsResponse) GetResponse() isGetSvrBCredentialsResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetSvrBCredentialsResponse) GetSvrbCredentials() *GetSvrBCredentialsResponse_SvrBCredentials { - if x != nil { - if x, ok := x.Response.(*GetSvrBCredentialsResponse_SvrbCredentials); ok { - return x.SvrbCredentials - } - } - return nil -} - -func (x *GetSvrBCredentialsResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*GetSvrBCredentialsResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isGetSvrBCredentialsResponse_Response interface { - isGetSvrBCredentialsResponse_Response() -} - -type GetSvrBCredentialsResponse_SvrbCredentials struct { - SvrbCredentials *GetSvrBCredentialsResponse_SvrBCredentials `protobuf:"bytes,1,opt,name=svrb_credentials,json=svrbCredentials,proto3,oneof"` -} - -type GetSvrBCredentialsResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*GetSvrBCredentialsResponse_SvrbCredentials) isGetSvrBCredentialsResponse_Response() {} - -func (*GetSvrBCredentialsResponse_FailedAuthentication) isGetSvrBCredentialsResponse_Response() {} - -type GetBackupInfoRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBackupInfoRequest) Reset() { - *x = GetBackupInfoRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBackupInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBackupInfoRequest) ProtoMessage() {} - -func (x *GetBackupInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetBackupInfoRequest.ProtoReflect.Descriptor instead. -func (*GetBackupInfoRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{13} -} - -func (x *GetBackupInfoRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -type GetMessageBackupInfoResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetMessageBackupInfoResponse_BackupInfo - // *GetMessageBackupInfoResponse_FailedAuthentication - Response isGetMessageBackupInfoResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMessageBackupInfoResponse) Reset() { - *x = GetMessageBackupInfoResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMessageBackupInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMessageBackupInfoResponse) ProtoMessage() {} - -func (x *GetMessageBackupInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetMessageBackupInfoResponse.ProtoReflect.Descriptor instead. -func (*GetMessageBackupInfoResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{14} -} - -func (x *GetMessageBackupInfoResponse) GetResponse() isGetMessageBackupInfoResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetMessageBackupInfoResponse) GetBackupInfo() *GetMessageBackupInfoResponse_MessageBackupInfo { - if x != nil { - if x, ok := x.Response.(*GetMessageBackupInfoResponse_BackupInfo); ok { - return x.BackupInfo - } - } - return nil -} - -func (x *GetMessageBackupInfoResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*GetMessageBackupInfoResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isGetMessageBackupInfoResponse_Response interface { - isGetMessageBackupInfoResponse_Response() -} - -type GetMessageBackupInfoResponse_BackupInfo struct { - BackupInfo *GetMessageBackupInfoResponse_MessageBackupInfo `protobuf:"bytes,1,opt,name=backup_info,json=backupInfo,proto3,oneof"` -} - -type GetMessageBackupInfoResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*GetMessageBackupInfoResponse_BackupInfo) isGetMessageBackupInfoResponse_Response() {} - -func (*GetMessageBackupInfoResponse_FailedAuthentication) isGetMessageBackupInfoResponse_Response() {} - -type GetMediaBackupInfoResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetMediaBackupInfoResponse_BackupInfo - // *GetMediaBackupInfoResponse_FailedAuthentication - Response isGetMediaBackupInfoResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMediaBackupInfoResponse) Reset() { - *x = GetMediaBackupInfoResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMediaBackupInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMediaBackupInfoResponse) ProtoMessage() {} - -func (x *GetMediaBackupInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetMediaBackupInfoResponse.ProtoReflect.Descriptor instead. -func (*GetMediaBackupInfoResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{15} -} - -func (x *GetMediaBackupInfoResponse) GetResponse() isGetMediaBackupInfoResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetMediaBackupInfoResponse) GetBackupInfo() *GetMediaBackupInfoResponse_MediaBackupInfo { - if x != nil { - if x, ok := x.Response.(*GetMediaBackupInfoResponse_BackupInfo); ok { - return x.BackupInfo - } - } - return nil -} - -func (x *GetMediaBackupInfoResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*GetMediaBackupInfoResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isGetMediaBackupInfoResponse_Response interface { - isGetMediaBackupInfoResponse_Response() -} - -type GetMediaBackupInfoResponse_BackupInfo struct { - BackupInfo *GetMediaBackupInfoResponse_MediaBackupInfo `protobuf:"bytes,1,opt,name=backup_info,json=backupInfo,proto3,oneof"` -} - -type GetMediaBackupInfoResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*GetMediaBackupInfoResponse_BackupInfo) isGetMediaBackupInfoResponse_Response() {} - -func (*GetMediaBackupInfoResponse_FailedAuthentication) isGetMediaBackupInfoResponse_Response() {} - -type RefreshRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RefreshRequest) Reset() { - *x = RefreshRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RefreshRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshRequest) ProtoMessage() {} - -func (x *RefreshRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[16] - 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 RefreshRequest.ProtoReflect.Descriptor instead. -func (*RefreshRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{16} -} - -func (x *RefreshRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -type RefreshResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *RefreshResponse_Success - // *RefreshResponse_FailedAuthentication - Response isRefreshResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RefreshResponse) Reset() { - *x = RefreshResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RefreshResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshResponse) ProtoMessage() {} - -func (x *RefreshResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[17] - 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 RefreshResponse.ProtoReflect.Descriptor instead. -func (*RefreshResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{17} -} - -func (x *RefreshResponse) GetResponse() isRefreshResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *RefreshResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*RefreshResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *RefreshResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*RefreshResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isRefreshResponse_Response interface { - isRefreshResponse_Response() -} - -type RefreshResponse_Success struct { - // The backup was successfully refreshed - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type RefreshResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*RefreshResponse_Success) isRefreshResponse_Response() {} - -func (*RefreshResponse_FailedAuthentication) isRefreshResponse_Response() {} - -type GetUploadFormRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - // Types that are valid to be assigned to UploadType: - // - // *GetUploadFormRequest_Messages - // *GetUploadFormRequest_Media - UploadType isGetUploadFormRequest_UploadType `protobuf_oneof:"upload_type"` - // The length of the attachment for the requested upload form. Uploads - // performed with this form will be limited to the provided length. - UploadLength uint64 `protobuf:"varint,4,opt,name=uploadLength,proto3" json:"uploadLength,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUploadFormRequest) Reset() { - *x = GetUploadFormRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUploadFormRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUploadFormRequest) ProtoMessage() {} - -func (x *GetUploadFormRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[18] - 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 GetUploadFormRequest.ProtoReflect.Descriptor instead. -func (*GetUploadFormRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{18} -} - -func (x *GetUploadFormRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -func (x *GetUploadFormRequest) GetUploadType() isGetUploadFormRequest_UploadType { - if x != nil { - return x.UploadType - } - return nil -} - -func (x *GetUploadFormRequest) GetMessages() *GetUploadFormRequest_MessagesUploadType { - if x != nil { - if x, ok := x.UploadType.(*GetUploadFormRequest_Messages); ok { - return x.Messages - } - } - return nil -} - -func (x *GetUploadFormRequest) GetMedia() *GetUploadFormRequest_MediaUploadType { - if x != nil { - if x, ok := x.UploadType.(*GetUploadFormRequest_Media); ok { - return x.Media - } - } - return nil -} - -func (x *GetUploadFormRequest) GetUploadLength() uint64 { - if x != nil { - return x.UploadLength - } - return 0 -} - -type isGetUploadFormRequest_UploadType interface { - isGetUploadFormRequest_UploadType() -} - -type GetUploadFormRequest_Messages struct { - // Retrieve an upload form that can be used to perform a resumable upload of - // a message backup. The finished upload will be available on the backup cdn. - Messages *GetUploadFormRequest_MessagesUploadType `protobuf:"bytes,2,opt,name=messages,proto3,oneof"` -} - -type GetUploadFormRequest_Media struct { - // Retrieve an upload form for a temporary location that can be used to - // perform a resumable upload of an attachment. After uploading, the - // attachment can be copied into the backup via CopyMedia. - // - // Behaves identically to the account authenticated version at /attachments. - Media *GetUploadFormRequest_MediaUploadType `protobuf:"bytes,3,opt,name=media,proto3,oneof"` -} - -func (*GetUploadFormRequest_Messages) isGetUploadFormRequest_UploadType() {} - -func (*GetUploadFormRequest_Media) isGetUploadFormRequest_UploadType() {} - -type GetUploadFormResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetUploadFormResponse_UploadForm - // *GetUploadFormResponse_FailedAuthentication - // *GetUploadFormResponse_ExceedsMaxUploadLength - Response isGetUploadFormResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUploadFormResponse) Reset() { - *x = GetUploadFormResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUploadFormResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUploadFormResponse) ProtoMessage() {} - -func (x *GetUploadFormResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[19] - 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 GetUploadFormResponse.ProtoReflect.Descriptor instead. -func (*GetUploadFormResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{19} -} - -func (x *GetUploadFormResponse) GetResponse() isGetUploadFormResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetUploadFormResponse) GetUploadForm() *common.UploadForm { - if x != nil { - if x, ok := x.Response.(*GetUploadFormResponse_UploadForm); ok { - return x.UploadForm - } - } - return nil -} - -func (x *GetUploadFormResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*GetUploadFormResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -func (x *GetUploadFormResponse) GetExceedsMaxUploadLength() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*GetUploadFormResponse_ExceedsMaxUploadLength); ok { - return x.ExceedsMaxUploadLength - } - } - return nil -} - -type isGetUploadFormResponse_Response interface { - isGetUploadFormResponse_Response() -} - -type GetUploadFormResponse_UploadForm struct { - UploadForm *common.UploadForm `protobuf:"bytes,1,opt,name=upload_form,json=uploadForm,proto3,oneof"` -} - -type GetUploadFormResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -type GetUploadFormResponse_ExceedsMaxUploadLength struct { - // The request size was larger than the maximum supported upload size. The - // maximum upload size is subject to change and is governed by - // `global.attachments.maxBytes` - ExceedsMaxUploadLength *errors.FailedPrecondition `protobuf:"bytes,3,opt,name=exceeds_max_upload_length,json=exceedsMaxUploadLength,proto3,oneof"` -} - -func (*GetUploadFormResponse_UploadForm) isGetUploadFormResponse_Response() {} - -func (*GetUploadFormResponse_FailedAuthentication) isGetUploadFormResponse_Response() {} - -func (*GetUploadFormResponse_ExceedsMaxUploadLength) isGetUploadFormResponse_Response() {} - -type CopyMediaItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The attachment cdn of the object to copy into the backup - SourceAttachmentCdn uint32 `protobuf:"varint,1,opt,name=source_attachment_cdn,json=sourceAttachmentCdn,proto3" json:"source_attachment_cdn,omitempty"` - // The attachment key of the object to copy into the backup - SourceKey string `protobuf:"bytes,2,opt,name=source_key,json=sourceKey,proto3" json:"source_key,omitempty"` - // The length of the source attachment before the encryption applied by the - // copy operation - ObjectLength uint64 `protobuf:"varint,3,opt,name=object_length,json=objectLength,proto3" json:"object_length,omitempty"` - // media_id to copy on to the backup CDN - MediaId []byte `protobuf:"bytes,4,opt,name=media_id,json=mediaId,proto3" json:"media_id,omitempty"` - // A 32-byte key for the MAC - HmacKey []byte `protobuf:"bytes,5,opt,name=hmac_key,json=hmacKey,proto3" json:"hmac_key,omitempty"` - // A 32-byte encryption key for AES - EncryptionKey []byte `protobuf:"bytes,6,opt,name=encryption_key,json=encryptionKey,proto3" json:"encryption_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CopyMediaItem) Reset() { - *x = CopyMediaItem{} - mi := &file_org_signal_chat_backups_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CopyMediaItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CopyMediaItem) ProtoMessage() {} - -func (x *CopyMediaItem) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 CopyMediaItem.ProtoReflect.Descriptor instead. -func (*CopyMediaItem) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{20} -} - -func (x *CopyMediaItem) GetSourceAttachmentCdn() uint32 { - if x != nil { - return x.SourceAttachmentCdn - } - return 0 -} - -func (x *CopyMediaItem) GetSourceKey() string { - if x != nil { - return x.SourceKey - } - return "" -} - -func (x *CopyMediaItem) GetObjectLength() uint64 { - if x != nil { - return x.ObjectLength - } - return 0 -} - -func (x *CopyMediaItem) GetMediaId() []byte { - if x != nil { - return x.MediaId - } - return nil -} - -func (x *CopyMediaItem) GetHmacKey() []byte { - if x != nil { - return x.HmacKey - } - return nil -} - -func (x *CopyMediaItem) GetEncryptionKey() []byte { - if x != nil { - return x.EncryptionKey - } - return nil -} - -type CopyMediaRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - // Items to copy - Items []*CopyMediaItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CopyMediaRequest) Reset() { - *x = CopyMediaRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CopyMediaRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CopyMediaRequest) ProtoMessage() {} - -func (x *CopyMediaRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[21] - 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 CopyMediaRequest.ProtoReflect.Descriptor instead. -func (*CopyMediaRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{21} -} - -func (x *CopyMediaRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -func (x *CopyMediaRequest) GetItems() []*CopyMediaItem { - if x != nil { - return x.Items - } - return nil -} - -type CopyMediaResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The 15-byte media_id from the corresponding CopyMediaItem in the request - MediaId []byte `protobuf:"bytes,1,opt,name=media_id,json=mediaId,proto3" json:"media_id,omitempty"` - // Types that are valid to be assigned to Response: - // - // *CopyMediaResponse_Success - // *CopyMediaResponse_SourceNotFound_ - // *CopyMediaResponse_WrongSourceLength_ - // *CopyMediaResponse_OutOfSpace_ - Response isCopyMediaResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CopyMediaResponse) Reset() { - *x = CopyMediaResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CopyMediaResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CopyMediaResponse) ProtoMessage() {} - -func (x *CopyMediaResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[22] - 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 CopyMediaResponse.ProtoReflect.Descriptor instead. -func (*CopyMediaResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{22} -} - -func (x *CopyMediaResponse) GetMediaId() []byte { - if x != nil { - return x.MediaId - } - return nil -} - -func (x *CopyMediaResponse) GetResponse() isCopyMediaResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *CopyMediaResponse) GetSuccess() *CopyMediaResponse_CopySuccess { - if x != nil { - if x, ok := x.Response.(*CopyMediaResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *CopyMediaResponse) GetSourceNotFound() *CopyMediaResponse_SourceNotFound { - if x != nil { - if x, ok := x.Response.(*CopyMediaResponse_SourceNotFound_); ok { - return x.SourceNotFound - } - } - return nil -} - -func (x *CopyMediaResponse) GetWrongSourceLength() *CopyMediaResponse_WrongSourceLength { - if x != nil { - if x, ok := x.Response.(*CopyMediaResponse_WrongSourceLength_); ok { - return x.WrongSourceLength - } - } - return nil -} - -func (x *CopyMediaResponse) GetOutOfSpace() *CopyMediaResponse_OutOfSpace { - if x != nil { - if x, ok := x.Response.(*CopyMediaResponse_OutOfSpace_); ok { - return x.OutOfSpace - } - } - return nil -} - -type isCopyMediaResponse_Response interface { - isCopyMediaResponse_Response() -} - -type CopyMediaResponse_Success struct { - // The media item was successfully copied into the backup - Success *CopyMediaResponse_CopySuccess `protobuf:"bytes,2,opt,name=success,proto3,oneof"` -} - -type CopyMediaResponse_SourceNotFound_ struct { - // The source object was not found - SourceNotFound *CopyMediaResponse_SourceNotFound `protobuf:"bytes,3,opt,name=source_not_found,json=sourceNotFound,proto3,oneof"` -} - -type CopyMediaResponse_WrongSourceLength_ struct { - // The provided object length was incorrect - WrongSourceLength *CopyMediaResponse_WrongSourceLength `protobuf:"bytes,4,opt,name=wrong_source_length,json=wrongSourceLength,proto3,oneof"` -} - -type CopyMediaResponse_OutOfSpace_ struct { - // All media capacity has been consumed. Free some space to continue. - OutOfSpace *CopyMediaResponse_OutOfSpace `protobuf:"bytes,5,opt,name=out_of_space,json=outOfSpace,proto3,oneof"` -} - -func (*CopyMediaResponse_Success) isCopyMediaResponse_Response() {} - -func (*CopyMediaResponse_SourceNotFound_) isCopyMediaResponse_Response() {} - -func (*CopyMediaResponse_WrongSourceLength_) isCopyMediaResponse_Response() {} - -func (*CopyMediaResponse_OutOfSpace_) isCopyMediaResponse_Response() {} - -// The reason why a media stream RPC is being prematurely closed by the server. -type BackupStreamClosed struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Reason: - // - // *BackupStreamClosed_FailedAuthentication - Reason isBackupStreamClosed_Reason `protobuf_oneof:"reason"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupStreamClosed) Reset() { - *x = BackupStreamClosed{} - mi := &file_org_signal_chat_backups_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupStreamClosed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupStreamClosed) ProtoMessage() {} - -func (x *BackupStreamClosed) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[23] - 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 BackupStreamClosed.ProtoReflect.Descriptor instead. -func (*BackupStreamClosed) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{23} -} - -func (x *BackupStreamClosed) GetReason() isBackupStreamClosed_Reason { - if x != nil { - return x.Reason - } - return nil -} - -func (x *BackupStreamClosed) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Reason.(*BackupStreamClosed_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isBackupStreamClosed_Reason interface { - isBackupStreamClosed_Reason() -} - -type BackupStreamClosed_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,1,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*BackupStreamClosed_FailedAuthentication) isBackupStreamClosed_Reason() {} - -type ListMediaRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - // A cursor returned by a previous call to ListMedia, absent on the first call - Cursor *string `protobuf:"bytes,2,opt,name=cursor,proto3,oneof" json:"cursor,omitempty"` - // If provided, the maximum number of entries to return in a page. If absent, - // a server-chosen default is used. - Limit *uint32 `protobuf:"varint,3,opt,name=limit,proto3,oneof" json:"limit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListMediaRequest) Reset() { - *x = ListMediaRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListMediaRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListMediaRequest) ProtoMessage() {} - -func (x *ListMediaRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[24] - 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 ListMediaRequest.ProtoReflect.Descriptor instead. -func (*ListMediaRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{24} -} - -func (x *ListMediaRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -func (x *ListMediaRequest) GetCursor() string { - if x != nil && x.Cursor != nil { - return *x.Cursor - } - return "" -} - -func (x *ListMediaRequest) GetLimit() uint32 { - if x != nil && x.Limit != nil { - return *x.Limit - } - return 0 -} - -type ListMediaResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *ListMediaResponse_ListResult_ - // *ListMediaResponse_FailedAuthentication - Response isListMediaResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListMediaResponse) Reset() { - *x = ListMediaResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListMediaResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListMediaResponse) ProtoMessage() {} - -func (x *ListMediaResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[25] - 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 ListMediaResponse.ProtoReflect.Descriptor instead. -func (*ListMediaResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{25} -} - -func (x *ListMediaResponse) GetResponse() isListMediaResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *ListMediaResponse) GetListResult() *ListMediaResponse_ListResult { - if x != nil { - if x, ok := x.Response.(*ListMediaResponse_ListResult_); ok { - return x.ListResult - } - } - return nil -} - -func (x *ListMediaResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*ListMediaResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isListMediaResponse_Response interface { - isListMediaResponse_Response() -} - -type ListMediaResponse_ListResult_ struct { - ListResult *ListMediaResponse_ListResult `protobuf:"bytes,1,opt,name=list_result,json=listResult,proto3,oneof"` -} - -type ListMediaResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*ListMediaResponse_ListResult_) isListMediaResponse_Response() {} - -func (*ListMediaResponse_FailedAuthentication) isListMediaResponse_Response() {} - -type DeleteAllRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAllRequest) Reset() { - *x = DeleteAllRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAllRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAllRequest) ProtoMessage() {} - -func (x *DeleteAllRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[26] - 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 DeleteAllRequest.ProtoReflect.Descriptor instead. -func (*DeleteAllRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{26} -} - -func (x *DeleteAllRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -type DeleteAllResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *DeleteAllResponse_Success - // *DeleteAllResponse_FailedAuthentication - Response isDeleteAllResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAllResponse) Reset() { - *x = DeleteAllResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAllResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAllResponse) ProtoMessage() {} - -func (x *DeleteAllResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[27] - 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 DeleteAllResponse.ProtoReflect.Descriptor instead. -func (*DeleteAllResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{27} -} - -func (x *DeleteAllResponse) GetResponse() isDeleteAllResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *DeleteAllResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*DeleteAllResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *DeleteAllResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*DeleteAllResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -type isDeleteAllResponse_Response interface { - isDeleteAllResponse_Response() -} - -type DeleteAllResponse_Success struct { - // The backup was successfully scheduled for deletion - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type DeleteAllResponse_FailedAuthentication struct { - // The provided backup auth credential presentation could not be - // authenticated. Either, the presentation could not be verified, or - // the public key signature was invalid, or there is no backup associated - // with the backup-id in the presentation. - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -func (*DeleteAllResponse_Success) isDeleteAllResponse_Response() {} - -func (*DeleteAllResponse_FailedAuthentication) isDeleteAllResponse_Response() {} - -type DeleteMediaItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The backup cdn where this media object is stored - Cdn uint32 `protobuf:"varint,1,opt,name=cdn,proto3" json:"cdn,omitempty"` - // The media_id of the object to delete - MediaId []byte `protobuf:"bytes,2,opt,name=media_id,json=mediaId,proto3" json:"media_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteMediaItem) Reset() { - *x = DeleteMediaItem{} - mi := &file_org_signal_chat_backups_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteMediaItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteMediaItem) ProtoMessage() {} - -func (x *DeleteMediaItem) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[28] - 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 DeleteMediaItem.ProtoReflect.Descriptor instead. -func (*DeleteMediaItem) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{28} -} - -func (x *DeleteMediaItem) GetCdn() uint32 { - if x != nil { - return x.Cdn - } - return 0 -} - -func (x *DeleteMediaItem) GetMediaId() []byte { - if x != nil { - return x.MediaId - } - return nil -} - -type DeleteMediaRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SignedPresentation *SignedPresentation `protobuf:"bytes,1,opt,name=signed_presentation,json=signedPresentation,proto3" json:"signed_presentation,omitempty"` - Items []*DeleteMediaItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteMediaRequest) Reset() { - *x = DeleteMediaRequest{} - mi := &file_org_signal_chat_backups_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteMediaRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteMediaRequest) ProtoMessage() {} - -func (x *DeleteMediaRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[29] - 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 DeleteMediaRequest.ProtoReflect.Descriptor instead. -func (*DeleteMediaRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{29} -} - -func (x *DeleteMediaRequest) GetSignedPresentation() *SignedPresentation { - if x != nil { - return x.SignedPresentation - } - return nil -} - -func (x *DeleteMediaRequest) GetItems() []*DeleteMediaItem { - if x != nil { - return x.Items - } - return nil -} - -type DeleteMediaResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - DeletedItem *DeleteMediaItem `protobuf:"bytes,1,opt,name=deleted_item,json=deletedItem,proto3" json:"deleted_item,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteMediaResponse) Reset() { - *x = DeleteMediaResponse{} - mi := &file_org_signal_chat_backups_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteMediaResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteMediaResponse) ProtoMessage() {} - -func (x *DeleteMediaResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[30] - 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 DeleteMediaResponse.ProtoReflect.Descriptor instead. -func (*DeleteMediaResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{30} -} - -func (x *DeleteMediaResponse) GetDeletedItem() *DeleteMediaItem { - if x != nil { - return x.DeletedItem - } - return nil -} - -type GetBackupAuthCredentialsResponse_Credentials struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The requested message backup ZkCredentials indexed by the start of their - // validity period. The smallest key should be for the requested - // redemption_start, the largest for the requested redemption_end. - MessageCredentials map[int64]*common.ZkCredential `protobuf:"bytes,1,rep,name=message_credentials,json=messageCredentials,proto3" json:"message_credentials,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // The requested media backup ZkCredentials indexed by the start of their - // validity period. The smallest key should be for the requested - // redemption_start, the largest for the requested redemption_end. - MediaCredentials map[int64]*common.ZkCredential `protobuf:"bytes,2,rep,name=media_credentials,json=mediaCredentials,proto3" json:"media_credentials,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBackupAuthCredentialsResponse_Credentials) Reset() { - *x = GetBackupAuthCredentialsResponse_Credentials{} - mi := &file_org_signal_chat_backups_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBackupAuthCredentialsResponse_Credentials) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBackupAuthCredentialsResponse_Credentials) ProtoMessage() {} - -func (x *GetBackupAuthCredentialsResponse_Credentials) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[31] - 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 GetBackupAuthCredentialsResponse_Credentials.ProtoReflect.Descriptor instead. -func (*GetBackupAuthCredentialsResponse_Credentials) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *GetBackupAuthCredentialsResponse_Credentials) GetMessageCredentials() map[int64]*common.ZkCredential { - if x != nil { - return x.MessageCredentials - } - return nil -} - -func (x *GetBackupAuthCredentialsResponse_Credentials) GetMediaCredentials() map[int64]*common.ZkCredential { - if x != nil { - return x.MediaCredentials - } - return nil -} - -type GetCdnCredentialsResponse_CdnCredentials struct { - state protoimpl.MessageState `protogen:"open.v1"` - Headers map[string]string `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCdnCredentialsResponse_CdnCredentials) Reset() { - *x = GetCdnCredentialsResponse_CdnCredentials{} - mi := &file_org_signal_chat_backups_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCdnCredentialsResponse_CdnCredentials) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCdnCredentialsResponse_CdnCredentials) ProtoMessage() {} - -func (x *GetCdnCredentialsResponse_CdnCredentials) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[34] - 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 GetCdnCredentialsResponse_CdnCredentials.ProtoReflect.Descriptor instead. -func (*GetCdnCredentialsResponse_CdnCredentials) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{10, 0} -} - -func (x *GetCdnCredentialsResponse_CdnCredentials) GetHeaders() map[string]string { - if x != nil { - return x.Headers - } - return nil -} - -type GetSvrBCredentialsResponse_SvrBCredentials struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A username that can be presented to authenticate with SVRB - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - // A password that can be presented to authenticate with SVRB - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSvrBCredentialsResponse_SvrBCredentials) Reset() { - *x = GetSvrBCredentialsResponse_SvrBCredentials{} - mi := &file_org_signal_chat_backups_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSvrBCredentialsResponse_SvrBCredentials) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSvrBCredentialsResponse_SvrBCredentials) ProtoMessage() {} - -func (x *GetSvrBCredentialsResponse_SvrBCredentials) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[36] - 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 GetSvrBCredentialsResponse_SvrBCredentials.ProtoReflect.Descriptor instead. -func (*GetSvrBCredentialsResponse_SvrBCredentials) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{12, 0} -} - -func (x *GetSvrBCredentialsResponse_SvrBCredentials) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *GetSvrBCredentialsResponse_SvrBCredentials) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type GetMessageBackupInfoResponse_MessageBackupInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The base directory of your backup data on the cdn. Always non-empty, even - // if a backup has not actually been stored to the cdn. If a backup was - // previously uploaded and has not expired, it can be found in the returned - // cdn at /backup_dir/backup_name. - BackupDir string `protobuf:"bytes,1,opt,name=backup_dir,json=backupDir,proto3" json:"backup_dir,omitempty"` - // The CDN type where the message backup is stored. Media may be stored - // elsewhere. - Cdn uint32 `protobuf:"varint,2,opt,name=cdn,proto3" json:"cdn,omitempty"` - // The location of the message backup on the cdn. Always non-empty, even - // if a backup has not actually been stored to the cdn. If a backup was - // previously uploaded and has not expired, it can be found in the returned - // cdn at /backup_dir/backup_name. - BackupName string `protobuf:"bytes,3,opt,name=backup_name,json=backupName,proto3" json:"backup_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMessageBackupInfoResponse_MessageBackupInfo) Reset() { - *x = GetMessageBackupInfoResponse_MessageBackupInfo{} - mi := &file_org_signal_chat_backups_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMessageBackupInfoResponse_MessageBackupInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMessageBackupInfoResponse_MessageBackupInfo) ProtoMessage() {} - -func (x *GetMessageBackupInfoResponse_MessageBackupInfo) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetMessageBackupInfoResponse_MessageBackupInfo.ProtoReflect.Descriptor instead. -func (*GetMessageBackupInfoResponse_MessageBackupInfo) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{14, 0} -} - -func (x *GetMessageBackupInfoResponse_MessageBackupInfo) GetBackupDir() string { - if x != nil { - return x.BackupDir - } - return "" -} - -func (x *GetMessageBackupInfoResponse_MessageBackupInfo) GetCdn() uint32 { - if x != nil { - return x.Cdn - } - return 0 -} - -func (x *GetMessageBackupInfoResponse_MessageBackupInfo) GetBackupName() string { - if x != nil { - return x.BackupName - } - return "" -} - -type GetMediaBackupInfoResponse_MediaBackupInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The base directory of your backup data on the cdn. Always non-empty, even - // if no media has been stored to the cdn or the credential is for a tier - // that does not support media. - BackupDir string `protobuf:"bytes,1,opt,name=backup_dir,json=backupDir,proto3" json:"backup_dir,omitempty"` - // The prefix path component for media objects on a cdn. Stored media for a - // media_id can be found at /backup_dir/media_dir/media_id, where the - // media_id is encoded in unpadded url-safe base64. Always non-empty, even - // if no media has been stored to the cdn or the credential is for a tier - // that does not support media. - MediaDir string `protobuf:"bytes,2,opt,name=media_dir,json=mediaDir,proto3" json:"media_dir,omitempty"` - // The amount of space used to store media - UsedSpace uint64 `protobuf:"varint,3,opt,name=used_space,json=usedSpace,proto3" json:"used_space,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMediaBackupInfoResponse_MediaBackupInfo) Reset() { - *x = GetMediaBackupInfoResponse_MediaBackupInfo{} - mi := &file_org_signal_chat_backups_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMediaBackupInfoResponse_MediaBackupInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMediaBackupInfoResponse_MediaBackupInfo) ProtoMessage() {} - -func (x *GetMediaBackupInfoResponse_MediaBackupInfo) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetMediaBackupInfoResponse_MediaBackupInfo.ProtoReflect.Descriptor instead. -func (*GetMediaBackupInfoResponse_MediaBackupInfo) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{15, 0} -} - -func (x *GetMediaBackupInfoResponse_MediaBackupInfo) GetBackupDir() string { - if x != nil { - return x.BackupDir - } - return "" -} - -func (x *GetMediaBackupInfoResponse_MediaBackupInfo) GetMediaDir() string { - if x != nil { - return x.MediaDir - } - return "" -} - -func (x *GetMediaBackupInfoResponse_MediaBackupInfo) GetUsedSpace() uint64 { - if x != nil { - return x.UsedSpace - } - return 0 -} - -type GetUploadFormRequest_MessagesUploadType struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUploadFormRequest_MessagesUploadType) Reset() { - *x = GetUploadFormRequest_MessagesUploadType{} - mi := &file_org_signal_chat_backups_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUploadFormRequest_MessagesUploadType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUploadFormRequest_MessagesUploadType) ProtoMessage() {} - -func (x *GetUploadFormRequest_MessagesUploadType) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetUploadFormRequest_MessagesUploadType.ProtoReflect.Descriptor instead. -func (*GetUploadFormRequest_MessagesUploadType) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{18, 0} -} - -type GetUploadFormRequest_MediaUploadType struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUploadFormRequest_MediaUploadType) Reset() { - *x = GetUploadFormRequest_MediaUploadType{} - mi := &file_org_signal_chat_backups_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUploadFormRequest_MediaUploadType) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUploadFormRequest_MediaUploadType) ProtoMessage() {} - -func (x *GetUploadFormRequest_MediaUploadType) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 GetUploadFormRequest_MediaUploadType.ProtoReflect.Descriptor instead. -func (*GetUploadFormRequest_MediaUploadType) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{18, 1} -} - -type CopyMediaResponse_SourceNotFound struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CopyMediaResponse_SourceNotFound) Reset() { - *x = CopyMediaResponse_SourceNotFound{} - mi := &file_org_signal_chat_backups_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CopyMediaResponse_SourceNotFound) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CopyMediaResponse_SourceNotFound) ProtoMessage() {} - -func (x *CopyMediaResponse_SourceNotFound) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 CopyMediaResponse_SourceNotFound.ProtoReflect.Descriptor instead. -func (*CopyMediaResponse_SourceNotFound) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{22, 0} -} - -type CopyMediaResponse_WrongSourceLength struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CopyMediaResponse_WrongSourceLength) Reset() { - *x = CopyMediaResponse_WrongSourceLength{} - mi := &file_org_signal_chat_backups_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CopyMediaResponse_WrongSourceLength) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CopyMediaResponse_WrongSourceLength) ProtoMessage() {} - -func (x *CopyMediaResponse_WrongSourceLength) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_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 CopyMediaResponse_WrongSourceLength.ProtoReflect.Descriptor instead. -func (*CopyMediaResponse_WrongSourceLength) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{22, 1} -} - -type CopyMediaResponse_OutOfSpace struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CopyMediaResponse_OutOfSpace) Reset() { - *x = CopyMediaResponse_OutOfSpace{} - mi := &file_org_signal_chat_backups_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CopyMediaResponse_OutOfSpace) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CopyMediaResponse_OutOfSpace) ProtoMessage() {} - -func (x *CopyMediaResponse_OutOfSpace) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[43] - 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 CopyMediaResponse_OutOfSpace.ProtoReflect.Descriptor instead. -func (*CopyMediaResponse_OutOfSpace) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{22, 2} -} - -type CopyMediaResponse_CopySuccess struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The backup cdn where this media object is stored - Cdn uint32 `protobuf:"varint,1,opt,name=cdn,proto3" json:"cdn,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CopyMediaResponse_CopySuccess) Reset() { - *x = CopyMediaResponse_CopySuccess{} - mi := &file_org_signal_chat_backups_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CopyMediaResponse_CopySuccess) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CopyMediaResponse_CopySuccess) ProtoMessage() {} - -func (x *CopyMediaResponse_CopySuccess) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[44] - 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 CopyMediaResponse_CopySuccess.ProtoReflect.Descriptor instead. -func (*CopyMediaResponse_CopySuccess) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{22, 3} -} - -func (x *CopyMediaResponse_CopySuccess) GetCdn() uint32 { - if x != nil { - return x.Cdn - } - return 0 -} - -type ListMediaResponse_ListEntry struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The backup cdn where this media object is stored - Cdn uint32 `protobuf:"varint,1,opt,name=cdn,proto3" json:"cdn,omitempty"` - // The media_id of the object - MediaId []byte `protobuf:"bytes,2,opt,name=media_id,json=mediaId,proto3" json:"media_id,omitempty"` - // The length of the object in bytes - Length uint64 `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListMediaResponse_ListEntry) Reset() { - *x = ListMediaResponse_ListEntry{} - mi := &file_org_signal_chat_backups_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListMediaResponse_ListEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListMediaResponse_ListEntry) ProtoMessage() {} - -func (x *ListMediaResponse_ListEntry) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[45] - 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 ListMediaResponse_ListEntry.ProtoReflect.Descriptor instead. -func (*ListMediaResponse_ListEntry) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{25, 0} -} - -func (x *ListMediaResponse_ListEntry) GetCdn() uint32 { - if x != nil { - return x.Cdn - } - return 0 -} - -func (x *ListMediaResponse_ListEntry) GetMediaId() []byte { - if x != nil { - return x.MediaId - } - return nil -} - -func (x *ListMediaResponse_ListEntry) GetLength() uint64 { - if x != nil { - return x.Length - } - return 0 -} - -type ListMediaResponse_ListResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A page of media objects stored for this backup ID - Page []*ListMediaResponse_ListEntry `protobuf:"bytes,1,rep,name=page,proto3" json:"page,omitempty"` - // The base directory of the backup data on the cdn. The stored media can be - // found at /backup_dir/media_dir/media_id, where the media_id is encoded with - // unpadded url-safe base64. - BackupDir string `protobuf:"bytes,2,opt,name=backup_dir,json=backupDir,proto3" json:"backup_dir,omitempty"` - // The prefix path component for the media objects. The stored media for - // media_id can be found at /backup_dir/media_dir/media_id, where the media_id - // is encoded with unpadded url-safe base64. - MediaDir string `protobuf:"bytes,3,opt,name=media_dir,json=mediaDir,proto3" json:"media_dir,omitempty"` - // If set, the cursor value to pass to the next list request to continue - // listing. If absent, all objects have been listed - Cursor *string `protobuf:"bytes,4,opt,name=cursor,proto3,oneof" json:"cursor,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ListMediaResponse_ListResult) Reset() { - *x = ListMediaResponse_ListResult{} - mi := &file_org_signal_chat_backups_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ListMediaResponse_ListResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListMediaResponse_ListResult) ProtoMessage() {} - -func (x *ListMediaResponse_ListResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_backups_proto_msgTypes[46] - 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 ListMediaResponse_ListResult.ProtoReflect.Descriptor instead. -func (*ListMediaResponse_ListResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_backups_proto_rawDescGZIP(), []int{25, 1} -} - -func (x *ListMediaResponse_ListResult) GetPage() []*ListMediaResponse_ListEntry { - if x != nil { - return x.Page - } - return nil -} - -func (x *ListMediaResponse_ListResult) GetBackupDir() string { - if x != nil { - return x.BackupDir - } - return "" -} - -func (x *ListMediaResponse_ListResult) GetMediaDir() string { - if x != nil { - return x.MediaDir - } - return "" -} - -func (x *ListMediaResponse_ListResult) GetCursor() string { - if x != nil && x.Cursor != nil { - return *x.Cursor - } - return "" -} - -var File_org_signal_chat_backups_proto protoreflect.FileDescriptor - -const file_org_signal_chat_backups_proto_rawDesc = "" + - "\n" + - "\x1dorg/signal/chat/backups.proto\x12\x16org.signal.chat.backup\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1corg/signal/chat/common.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x19org/signal/chat/tag.proto\"\xba\x01\n" + - "\x12SetBackupIdRequest\x12T\n" + - "'messages_backup_auth_credential_request\x18\x01 \x01(\fR#messagesBackupAuthCredentialRequest\x12N\n" + - "$media_backup_auth_credential_request\x18\x02 \x01(\fR mediaBackupAuthCredentialRequest\"\x15\n" + - "\x13SetBackupIdResponse\":\n" + - "\x14RedeemReceiptRequest\x12\"\n" + - "\fpresentation\x18\x01 \x01(\fR\fpresentation\"\xd0\x02\n" + - "\x15RedeemReceiptResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12\x8a\x01\n" + - "\x1aaccount_missing_commitment\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1e\xc2\xd5\"\x1aaccount_missing_commitmentH\x00R\x18accountMissingCommitment\x12j\n" + - "\x0finvalid_receipt\x18\x03 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x13\xc2\xd5\"\x0finvalid_receiptH\x00R\x0einvalidReceiptB\n" + - "\n" + - "\bresponse\"\x85\x01\n" + - "\x1fGetBackupAuthCredentialsRequest\x121\n" + - "\x10redemption_start\x18\x01 \x01(\x03B\x06\xb2\x97\"\x02\b\x01R\x0fredemptionStart\x12/\n" + - "\x0fredemption_stop\x18\x02 \x01(\x03B\x06\xb2\x97\"\x02\b\x01R\x0eredemptionStop\"\x8c\x05\n" + - " GetBackupAuthCredentialsResponse\x12f\n" + - "\vcredentials\x18\x01 \x01(\v2D.org.signal.chat.backup.GetBackupAuthCredentialsResponse.CredentialsR\vcredentials\x1a\xff\x03\n" + - "\vCredentials\x12\x8d\x01\n" + - "\x13message_credentials\x18\x01 \x03(\v2\\.org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MessageCredentialsEntryR\x12messageCredentials\x12\x87\x01\n" + - "\x11media_credentials\x18\x02 \x03(\v2Z.org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MediaCredentialsEntryR\x10mediaCredentials\x1ak\n" + - "\x17MessageCredentialsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x03R\x03key\x12:\n" + - "\x05value\x18\x02 \x01(\v2$.org.signal.chat.common.ZkCredentialR\x05value:\x028\x01\x1ai\n" + - "\x15MediaCredentialsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x03R\x03key\x12:\n" + - "\x05value\x18\x02 \x01(\v2$.org.signal.chat.common.ZkCredentialR\x05value:\x028\x01\"{\n" + - "\x12SignedPresentation\x12(\n" + - "\fpresentation\x18\x01 \x01(\fB\x04\x88\x97\"\x01R\fpresentation\x12;\n" + - "\x16presentation_signature\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\x15presentationSignature\"\x97\x01\n" + - "\x13SetPublicKeyRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\x12#\n" + - "\n" + - "public_key\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\tpublicKey\"\xd9\x01\n" + - "\x14SetPublicKeyResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthenticationB\n" + - "\n" + - "\bresponse\"\x89\x01\n" + - "\x18GetCdnCredentialsRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\x12\x10\n" + - "\x03cdn\x18\x02 \x01(\rR\x03cdn\"\xcf\x03\n" + - "\x19GetCdnCredentialsResponse\x12k\n" + - "\x0fcdn_credentials\x18\x01 \x01(\v2@.org.signal.chat.backup.GetCdnCredentialsResponse.CdnCredentialsH\x00R\x0ecdnCredentials\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthentication\x1a\xb5\x01\n" + - "\x0eCdnCredentials\x12g\n" + - "\aheaders\x18\x01 \x03(\v2M.org.signal.chat.backup.GetCdnCredentialsResponse.CdnCredentials.HeadersEntryR\aheaders\x1a:\n" + - "\fHeadersEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01B\n" + - "\n" + - "\bresponse\"x\n" + - "\x19GetSvrBCredentialsRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\"\xe7\x02\n" + - "\x1aGetSvrBCredentialsResponse\x12o\n" + - "\x10svrb_credentials\x18\x01 \x01(\v2B.org.signal.chat.backup.GetSvrBCredentialsResponse.SvrBCredentialsH\x00R\x0fsvrbCredentials\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthentication\x1aI\n" + - "\x0fSvrBCredentials\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpasswordB\n" + - "\n" + - "\bresponse\"s\n" + - "\x14GetBackupInfoRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\"\xff\x02\n" + - "\x1cGetMessageBackupInfoResponse\x12i\n" + - "\vbackup_info\x18\x01 \x01(\v2F.org.signal.chat.backup.GetMessageBackupInfoResponse.MessageBackupInfoH\x00R\n" + - "backupInfo\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthentication\x1ae\n" + - "\x11MessageBackupInfo\x12\x1d\n" + - "\n" + - "backup_dir\x18\x01 \x01(\tR\tbackupDir\x12\x10\n" + - "\x03cdn\x18\x02 \x01(\rR\x03cdn\x12\x1f\n" + - "\vbackup_name\x18\x03 \x01(\tR\n" + - "backupNameB\n" + - "\n" + - "\bresponse\"\x80\x03\n" + - "\x1aGetMediaBackupInfoResponse\x12e\n" + - "\vbackup_info\x18\x01 \x01(\v2B.org.signal.chat.backup.GetMediaBackupInfoResponse.MediaBackupInfoH\x00R\n" + - "backupInfo\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthentication\x1al\n" + - "\x0fMediaBackupInfo\x12\x1d\n" + - "\n" + - "backup_dir\x18\x01 \x01(\tR\tbackupDir\x12\x1b\n" + - "\tmedia_dir\x18\x02 \x01(\tR\bmediaDir\x12\x1d\n" + - "\n" + - "used_space\x18\x03 \x01(\x04R\tusedSpaceB\n" + - "\n" + - "\bresponse\"m\n" + - "\x0eRefreshRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\"\xd4\x01\n" + - "\x0fRefreshResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthenticationB\n" + - "\n" + - "\bresponse\"\x8c\x03\n" + - "\x14GetUploadFormRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\x12]\n" + - "\bmessages\x18\x02 \x01(\v2?.org.signal.chat.backup.GetUploadFormRequest.MessagesUploadTypeH\x00R\bmessages\x12T\n" + - "\x05media\x18\x03 \x01(\v2<.org.signal.chat.backup.GetUploadFormRequest.MediaUploadTypeH\x00R\x05media\x12*\n" + - "\fuploadLength\x18\x04 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\fuploadLength\x1a\x14\n" + - "\x12MessagesUploadType\x1a\x11\n" + - "\x0fMediaUploadTypeB\r\n" + - "\vupload_type\"\xeb\x02\n" + - "\x15GetUploadFormResponse\x12E\n" + - "\vupload_form\x18\x01 \x01(\v2\".org.signal.chat.common.UploadFormH\x00R\n" + - "uploadForm\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthentication\x12|\n" + - "\x19exceeds_max_upload_length\x18\x03 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x13\xc2\xd5\"\x0foversize_uploadH\x00R\x16exceedsMaxUploadLengthB\n" + - "\n" + - "\bresponse\"\x8d\x02\n" + - "\rCopyMediaItem\x12<\n" + - "\x15source_attachment_cdn\x18\x01 \x01(\rB\b\xb2\x97\"\x04\b\x01\x10\x03R\x13sourceAttachmentCdn\x12'\n" + - "\n" + - "source_key\x18\x02 \x01(\tB\b\x88\x97\"\x01\xc0\x97\"\x01R\tsourceKey\x12#\n" + - "\robject_length\x18\x03 \x01(\x04R\fobjectLength\x12 \n" + - "\bmedia_id\x18\x04 \x01(\fB\x05\xa2\x97\"\x01\x0fR\amediaId\x12 \n" + - "\bhmac_key\x18\x05 \x01(\fB\x05\xa2\x97\"\x01 R\ahmacKey\x12,\n" + - "\x0eencryption_key\x18\x06 \x01(\fB\x05\xa2\x97\"\x01 R\rencryptionKey\"\xb7\x01\n" + - "\x10CopyMediaRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\x12F\n" + - "\x05items\x18\x02 \x03(\v2%.org.signal.chat.backup.CopyMediaItemB\t\x9a\x97\"\x05\b\x01\x10\xe8\aR\x05items\"\xd4\x04\n" + - "\x11CopyMediaResponse\x12\x19\n" + - "\bmedia_id\x18\x01 \x01(\fR\amediaId\x12Q\n" + - "\asuccess\x18\x02 \x01(\v25.org.signal.chat.backup.CopyMediaResponse.CopySuccessH\x00R\asuccess\x12z\n" + - "\x10source_not_found\x18\x03 \x01(\v28.org.signal.chat.backup.CopyMediaResponse.SourceNotFoundB\x14\xc2\xd5\"\x10source_not_foundH\x00R\x0esourceNotFound\x12\x86\x01\n" + - "\x13wrong_source_length\x18\x04 \x01(\v2;.org.signal.chat.backup.CopyMediaResponse.WrongSourceLengthB\x17\xc2\xd5\"\x13wrong_source_lengthH\x00R\x11wrongSourceLength\x12j\n" + - "\fout_of_space\x18\x05 \x01(\v24.org.signal.chat.backup.CopyMediaResponse.OutOfSpaceB\x10\xc2\xd5\"\fout_of_spaceH\x00R\n" + - "outOfSpace\x1a\x10\n" + - "\x0eSourceNotFound\x1a\x13\n" + - "\x11WrongSourceLength\x1a\f\n" + - "\n" + - "OutOfSpace\x1a\x1f\n" + - "\vCopySuccess\x12\x10\n" + - "\x03cdn\x18\x01 \x01(\rR\x03cdnB\n" + - "\n" + - "\bresponse\"\xa1\x01\n" + - "\x12BackupStreamClosed\x12\x80\x01\n" + - "\x15failed_authentication\x18\x01 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthenticationB\b\n" + - "\x06reason\"\xc7\x01\n" + - "\x10ListMediaRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\x12\x1b\n" + - "\x06cursor\x18\x02 \x01(\tH\x00R\x06cursor\x88\x01\x01\x12$\n" + - "\x05limit\x18\x03 \x01(\rB\t\xb2\x97\"\x05\b\x01\x10\x90NH\x01R\x05limit\x88\x01\x01B\t\n" + - "\a_cursorB\b\n" + - "\x06_limit\"\x89\x04\n" + - "\x11ListMediaResponse\x12W\n" + - "\vlist_result\x18\x01 \x01(\v24.org.signal.chat.backup.ListMediaResponse.ListResultH\x00R\n" + - "listResult\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthentication\x1aP\n" + - "\tListEntry\x12\x10\n" + - "\x03cdn\x18\x01 \x01(\rR\x03cdn\x12\x19\n" + - "\bmedia_id\x18\x02 \x01(\fR\amediaId\x12\x16\n" + - "\x06length\x18\x03 \x01(\x04R\x06length\x1a\xb9\x01\n" + - "\n" + - "ListResult\x12G\n" + - "\x04page\x18\x01 \x03(\v23.org.signal.chat.backup.ListMediaResponse.ListEntryR\x04page\x12\x1d\n" + - "\n" + - "backup_dir\x18\x02 \x01(\tR\tbackupDir\x12\x1b\n" + - "\tmedia_dir\x18\x03 \x01(\tR\bmediaDir\x12\x1b\n" + - "\x06cursor\x18\x04 \x01(\tH\x00R\x06cursor\x88\x01\x01B\t\n" + - "\a_cursorB\n" + - "\n" + - "\bresponse\"o\n" + - "\x10DeleteAllRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\"\xd6\x01\n" + - "\x11DeleteAllResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthenticationB\n" + - "\n" + - "\bresponse\"E\n" + - "\x0fDeleteMediaItem\x12\x10\n" + - "\x03cdn\x18\x01 \x01(\rR\x03cdn\x12 \n" + - "\bmedia_id\x18\x02 \x01(\fB\x05\xa2\x97\"\x01\x0fR\amediaId\"\xbb\x01\n" + - "\x12DeleteMediaRequest\x12[\n" + - "\x13signed_presentation\x18\x01 \x01(\v2*.org.signal.chat.backup.SignedPresentationR\x12signedPresentation\x12H\n" + - "\x05items\x18\x02 \x03(\v2'.org.signal.chat.backup.DeleteMediaItemB\t\x9a\x97\"\x05\b\x01\x10\xe8\aR\x05items\"a\n" + - "\x13DeleteMediaResponse\x12J\n" + - "\fdeleted_item\x18\x01 \x01(\v2'.org.signal.chat.backup.DeleteMediaItemR\vdeletedItem2\xfb\x02\n" + - "\aBackups\x12h\n" + - "\vSetBackupId\x12*.org.signal.chat.backup.SetBackupIdRequest\x1a+.org.signal.chat.backup.SetBackupIdResponse\"\x00\x12n\n" + - "\rRedeemReceipt\x12,.org.signal.chat.backup.RedeemReceiptRequest\x1a-.org.signal.chat.backup.RedeemReceiptResponse\"\x00\x12\x8f\x01\n" + - "\x18GetBackupAuthCredentials\x127.org.signal.chat.backup.GetBackupAuthCredentialsRequest\x1a8.org.signal.chat.backup.GetBackupAuthCredentialsResponse\"\x00\x1a\x04\xc8\xd5\"\x012\xe0\t\n" + - "\x10BackupsAnonymous\x12z\n" + - "\x11GetCdnCredentials\x120.org.signal.chat.backup.GetCdnCredentialsRequest\x1a1.org.signal.chat.backup.GetCdnCredentialsResponse\"\x00\x12}\n" + - "\x12GetSvrBCredentials\x121.org.signal.chat.backup.GetSvrBCredentialsRequest\x1a2.org.signal.chat.backup.GetSvrBCredentialsResponse\"\x00\x12|\n" + - "\x14GetMessageBackupInfo\x12,.org.signal.chat.backup.GetBackupInfoRequest\x1a4.org.signal.chat.backup.GetMessageBackupInfoResponse\"\x00\x12x\n" + - "\x12GetMediaBackupInfo\x12,.org.signal.chat.backup.GetBackupInfoRequest\x1a2.org.signal.chat.backup.GetMediaBackupInfoResponse\"\x00\x12k\n" + - "\fSetPublicKey\x12+.org.signal.chat.backup.SetPublicKeyRequest\x1a,.org.signal.chat.backup.SetPublicKeyResponse\"\x00\x12\\\n" + - "\aRefresh\x12&.org.signal.chat.backup.RefreshRequest\x1a'.org.signal.chat.backup.RefreshResponse\"\x00\x12n\n" + - "\rGetUploadForm\x12,.org.signal.chat.backup.GetUploadFormRequest\x1a-.org.signal.chat.backup.GetUploadFormResponse\"\x00\x12d\n" + - "\tCopyMedia\x12(.org.signal.chat.backup.CopyMediaRequest\x1a).org.signal.chat.backup.CopyMediaResponse\"\x000\x01\x12b\n" + - "\tListMedia\x12(.org.signal.chat.backup.ListMediaRequest\x1a).org.signal.chat.backup.ListMediaResponse\"\x00\x12j\n" + - "\vDeleteMedia\x12*.org.signal.chat.backup.DeleteMediaRequest\x1a+.org.signal.chat.backup.DeleteMediaResponse\"\x000\x01\x12b\n" + - "\tDeleteAll\x12(.org.signal.chat.backup.DeleteAllRequest\x1a).org.signal.chat.backup.DeleteAllResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_backups_proto_rawDescOnce sync.Once - file_org_signal_chat_backups_proto_rawDescData []byte -) - -func file_org_signal_chat_backups_proto_rawDescGZIP() []byte { - file_org_signal_chat_backups_proto_rawDescOnce.Do(func() { - file_org_signal_chat_backups_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_backups_proto_rawDesc), len(file_org_signal_chat_backups_proto_rawDesc))) - }) - return file_org_signal_chat_backups_proto_rawDescData -} - -var file_org_signal_chat_backups_proto_msgTypes = make([]protoimpl.MessageInfo, 47) -var file_org_signal_chat_backups_proto_goTypes = []any{ - (*SetBackupIdRequest)(nil), // 0: org.signal.chat.backup.SetBackupIdRequest - (*SetBackupIdResponse)(nil), // 1: org.signal.chat.backup.SetBackupIdResponse - (*RedeemReceiptRequest)(nil), // 2: org.signal.chat.backup.RedeemReceiptRequest - (*RedeemReceiptResponse)(nil), // 3: org.signal.chat.backup.RedeemReceiptResponse - (*GetBackupAuthCredentialsRequest)(nil), // 4: org.signal.chat.backup.GetBackupAuthCredentialsRequest - (*GetBackupAuthCredentialsResponse)(nil), // 5: org.signal.chat.backup.GetBackupAuthCredentialsResponse - (*SignedPresentation)(nil), // 6: org.signal.chat.backup.SignedPresentation - (*SetPublicKeyRequest)(nil), // 7: org.signal.chat.backup.SetPublicKeyRequest - (*SetPublicKeyResponse)(nil), // 8: org.signal.chat.backup.SetPublicKeyResponse - (*GetCdnCredentialsRequest)(nil), // 9: org.signal.chat.backup.GetCdnCredentialsRequest - (*GetCdnCredentialsResponse)(nil), // 10: org.signal.chat.backup.GetCdnCredentialsResponse - (*GetSvrBCredentialsRequest)(nil), // 11: org.signal.chat.backup.GetSvrBCredentialsRequest - (*GetSvrBCredentialsResponse)(nil), // 12: org.signal.chat.backup.GetSvrBCredentialsResponse - (*GetBackupInfoRequest)(nil), // 13: org.signal.chat.backup.GetBackupInfoRequest - (*GetMessageBackupInfoResponse)(nil), // 14: org.signal.chat.backup.GetMessageBackupInfoResponse - (*GetMediaBackupInfoResponse)(nil), // 15: org.signal.chat.backup.GetMediaBackupInfoResponse - (*RefreshRequest)(nil), // 16: org.signal.chat.backup.RefreshRequest - (*RefreshResponse)(nil), // 17: org.signal.chat.backup.RefreshResponse - (*GetUploadFormRequest)(nil), // 18: org.signal.chat.backup.GetUploadFormRequest - (*GetUploadFormResponse)(nil), // 19: org.signal.chat.backup.GetUploadFormResponse - (*CopyMediaItem)(nil), // 20: org.signal.chat.backup.CopyMediaItem - (*CopyMediaRequest)(nil), // 21: org.signal.chat.backup.CopyMediaRequest - (*CopyMediaResponse)(nil), // 22: org.signal.chat.backup.CopyMediaResponse - (*BackupStreamClosed)(nil), // 23: org.signal.chat.backup.BackupStreamClosed - (*ListMediaRequest)(nil), // 24: org.signal.chat.backup.ListMediaRequest - (*ListMediaResponse)(nil), // 25: org.signal.chat.backup.ListMediaResponse - (*DeleteAllRequest)(nil), // 26: org.signal.chat.backup.DeleteAllRequest - (*DeleteAllResponse)(nil), // 27: org.signal.chat.backup.DeleteAllResponse - (*DeleteMediaItem)(nil), // 28: org.signal.chat.backup.DeleteMediaItem - (*DeleteMediaRequest)(nil), // 29: org.signal.chat.backup.DeleteMediaRequest - (*DeleteMediaResponse)(nil), // 30: org.signal.chat.backup.DeleteMediaResponse - (*GetBackupAuthCredentialsResponse_Credentials)(nil), // 31: org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials - nil, // 32: org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MessageCredentialsEntry - nil, // 33: org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MediaCredentialsEntry - (*GetCdnCredentialsResponse_CdnCredentials)(nil), // 34: org.signal.chat.backup.GetCdnCredentialsResponse.CdnCredentials - nil, // 35: org.signal.chat.backup.GetCdnCredentialsResponse.CdnCredentials.HeadersEntry - (*GetSvrBCredentialsResponse_SvrBCredentials)(nil), // 36: org.signal.chat.backup.GetSvrBCredentialsResponse.SvrBCredentials - (*GetMessageBackupInfoResponse_MessageBackupInfo)(nil), // 37: org.signal.chat.backup.GetMessageBackupInfoResponse.MessageBackupInfo - (*GetMediaBackupInfoResponse_MediaBackupInfo)(nil), // 38: org.signal.chat.backup.GetMediaBackupInfoResponse.MediaBackupInfo - (*GetUploadFormRequest_MessagesUploadType)(nil), // 39: org.signal.chat.backup.GetUploadFormRequest.MessagesUploadType - (*GetUploadFormRequest_MediaUploadType)(nil), // 40: org.signal.chat.backup.GetUploadFormRequest.MediaUploadType - (*CopyMediaResponse_SourceNotFound)(nil), // 41: org.signal.chat.backup.CopyMediaResponse.SourceNotFound - (*CopyMediaResponse_WrongSourceLength)(nil), // 42: org.signal.chat.backup.CopyMediaResponse.WrongSourceLength - (*CopyMediaResponse_OutOfSpace)(nil), // 43: org.signal.chat.backup.CopyMediaResponse.OutOfSpace - (*CopyMediaResponse_CopySuccess)(nil), // 44: org.signal.chat.backup.CopyMediaResponse.CopySuccess - (*ListMediaResponse_ListEntry)(nil), // 45: org.signal.chat.backup.ListMediaResponse.ListEntry - (*ListMediaResponse_ListResult)(nil), // 46: org.signal.chat.backup.ListMediaResponse.ListResult - (*emptypb.Empty)(nil), // 47: google.protobuf.Empty - (*errors.FailedPrecondition)(nil), // 48: org.signal.chat.errors.FailedPrecondition - (*errors.FailedZkAuthentication)(nil), // 49: org.signal.chat.errors.FailedZkAuthentication - (*common.UploadForm)(nil), // 50: org.signal.chat.common.UploadForm - (*common.ZkCredential)(nil), // 51: org.signal.chat.common.ZkCredential -} -var file_org_signal_chat_backups_proto_depIdxs = []int32{ - 47, // 0: org.signal.chat.backup.RedeemReceiptResponse.success:type_name -> google.protobuf.Empty - 48, // 1: org.signal.chat.backup.RedeemReceiptResponse.account_missing_commitment:type_name -> org.signal.chat.errors.FailedPrecondition - 48, // 2: org.signal.chat.backup.RedeemReceiptResponse.invalid_receipt:type_name -> org.signal.chat.errors.FailedPrecondition - 31, // 3: org.signal.chat.backup.GetBackupAuthCredentialsResponse.credentials:type_name -> org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials - 6, // 4: org.signal.chat.backup.SetPublicKeyRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 47, // 5: org.signal.chat.backup.SetPublicKeyResponse.success:type_name -> google.protobuf.Empty - 49, // 6: org.signal.chat.backup.SetPublicKeyResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 7: org.signal.chat.backup.GetCdnCredentialsRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 34, // 8: org.signal.chat.backup.GetCdnCredentialsResponse.cdn_credentials:type_name -> org.signal.chat.backup.GetCdnCredentialsResponse.CdnCredentials - 49, // 9: org.signal.chat.backup.GetCdnCredentialsResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 10: org.signal.chat.backup.GetSvrBCredentialsRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 36, // 11: org.signal.chat.backup.GetSvrBCredentialsResponse.svrb_credentials:type_name -> org.signal.chat.backup.GetSvrBCredentialsResponse.SvrBCredentials - 49, // 12: org.signal.chat.backup.GetSvrBCredentialsResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 13: org.signal.chat.backup.GetBackupInfoRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 37, // 14: org.signal.chat.backup.GetMessageBackupInfoResponse.backup_info:type_name -> org.signal.chat.backup.GetMessageBackupInfoResponse.MessageBackupInfo - 49, // 15: org.signal.chat.backup.GetMessageBackupInfoResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 38, // 16: org.signal.chat.backup.GetMediaBackupInfoResponse.backup_info:type_name -> org.signal.chat.backup.GetMediaBackupInfoResponse.MediaBackupInfo - 49, // 17: org.signal.chat.backup.GetMediaBackupInfoResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 18: org.signal.chat.backup.RefreshRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 47, // 19: org.signal.chat.backup.RefreshResponse.success:type_name -> google.protobuf.Empty - 49, // 20: org.signal.chat.backup.RefreshResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 21: org.signal.chat.backup.GetUploadFormRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 39, // 22: org.signal.chat.backup.GetUploadFormRequest.messages:type_name -> org.signal.chat.backup.GetUploadFormRequest.MessagesUploadType - 40, // 23: org.signal.chat.backup.GetUploadFormRequest.media:type_name -> org.signal.chat.backup.GetUploadFormRequest.MediaUploadType - 50, // 24: org.signal.chat.backup.GetUploadFormResponse.upload_form:type_name -> org.signal.chat.common.UploadForm - 49, // 25: org.signal.chat.backup.GetUploadFormResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 48, // 26: org.signal.chat.backup.GetUploadFormResponse.exceeds_max_upload_length:type_name -> org.signal.chat.errors.FailedPrecondition - 6, // 27: org.signal.chat.backup.CopyMediaRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 20, // 28: org.signal.chat.backup.CopyMediaRequest.items:type_name -> org.signal.chat.backup.CopyMediaItem - 44, // 29: org.signal.chat.backup.CopyMediaResponse.success:type_name -> org.signal.chat.backup.CopyMediaResponse.CopySuccess - 41, // 30: org.signal.chat.backup.CopyMediaResponse.source_not_found:type_name -> org.signal.chat.backup.CopyMediaResponse.SourceNotFound - 42, // 31: org.signal.chat.backup.CopyMediaResponse.wrong_source_length:type_name -> org.signal.chat.backup.CopyMediaResponse.WrongSourceLength - 43, // 32: org.signal.chat.backup.CopyMediaResponse.out_of_space:type_name -> org.signal.chat.backup.CopyMediaResponse.OutOfSpace - 49, // 33: org.signal.chat.backup.BackupStreamClosed.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 34: org.signal.chat.backup.ListMediaRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 46, // 35: org.signal.chat.backup.ListMediaResponse.list_result:type_name -> org.signal.chat.backup.ListMediaResponse.ListResult - 49, // 36: org.signal.chat.backup.ListMediaResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 37: org.signal.chat.backup.DeleteAllRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 47, // 38: org.signal.chat.backup.DeleteAllResponse.success:type_name -> google.protobuf.Empty - 49, // 39: org.signal.chat.backup.DeleteAllResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 40: org.signal.chat.backup.DeleteMediaRequest.signed_presentation:type_name -> org.signal.chat.backup.SignedPresentation - 28, // 41: org.signal.chat.backup.DeleteMediaRequest.items:type_name -> org.signal.chat.backup.DeleteMediaItem - 28, // 42: org.signal.chat.backup.DeleteMediaResponse.deleted_item:type_name -> org.signal.chat.backup.DeleteMediaItem - 32, // 43: org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.message_credentials:type_name -> org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MessageCredentialsEntry - 33, // 44: org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.media_credentials:type_name -> org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MediaCredentialsEntry - 51, // 45: org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MessageCredentialsEntry.value:type_name -> org.signal.chat.common.ZkCredential - 51, // 46: org.signal.chat.backup.GetBackupAuthCredentialsResponse.Credentials.MediaCredentialsEntry.value:type_name -> org.signal.chat.common.ZkCredential - 35, // 47: org.signal.chat.backup.GetCdnCredentialsResponse.CdnCredentials.headers:type_name -> org.signal.chat.backup.GetCdnCredentialsResponse.CdnCredentials.HeadersEntry - 45, // 48: org.signal.chat.backup.ListMediaResponse.ListResult.page:type_name -> org.signal.chat.backup.ListMediaResponse.ListEntry - 0, // 49: org.signal.chat.backup.Backups.SetBackupId:input_type -> org.signal.chat.backup.SetBackupIdRequest - 2, // 50: org.signal.chat.backup.Backups.RedeemReceipt:input_type -> org.signal.chat.backup.RedeemReceiptRequest - 4, // 51: org.signal.chat.backup.Backups.GetBackupAuthCredentials:input_type -> org.signal.chat.backup.GetBackupAuthCredentialsRequest - 9, // 52: org.signal.chat.backup.BackupsAnonymous.GetCdnCredentials:input_type -> org.signal.chat.backup.GetCdnCredentialsRequest - 11, // 53: org.signal.chat.backup.BackupsAnonymous.GetSvrBCredentials:input_type -> org.signal.chat.backup.GetSvrBCredentialsRequest - 13, // 54: org.signal.chat.backup.BackupsAnonymous.GetMessageBackupInfo:input_type -> org.signal.chat.backup.GetBackupInfoRequest - 13, // 55: org.signal.chat.backup.BackupsAnonymous.GetMediaBackupInfo:input_type -> org.signal.chat.backup.GetBackupInfoRequest - 7, // 56: org.signal.chat.backup.BackupsAnonymous.SetPublicKey:input_type -> org.signal.chat.backup.SetPublicKeyRequest - 16, // 57: org.signal.chat.backup.BackupsAnonymous.Refresh:input_type -> org.signal.chat.backup.RefreshRequest - 18, // 58: org.signal.chat.backup.BackupsAnonymous.GetUploadForm:input_type -> org.signal.chat.backup.GetUploadFormRequest - 21, // 59: org.signal.chat.backup.BackupsAnonymous.CopyMedia:input_type -> org.signal.chat.backup.CopyMediaRequest - 24, // 60: org.signal.chat.backup.BackupsAnonymous.ListMedia:input_type -> org.signal.chat.backup.ListMediaRequest - 29, // 61: org.signal.chat.backup.BackupsAnonymous.DeleteMedia:input_type -> org.signal.chat.backup.DeleteMediaRequest - 26, // 62: org.signal.chat.backup.BackupsAnonymous.DeleteAll:input_type -> org.signal.chat.backup.DeleteAllRequest - 1, // 63: org.signal.chat.backup.Backups.SetBackupId:output_type -> org.signal.chat.backup.SetBackupIdResponse - 3, // 64: org.signal.chat.backup.Backups.RedeemReceipt:output_type -> org.signal.chat.backup.RedeemReceiptResponse - 5, // 65: org.signal.chat.backup.Backups.GetBackupAuthCredentials:output_type -> org.signal.chat.backup.GetBackupAuthCredentialsResponse - 10, // 66: org.signal.chat.backup.BackupsAnonymous.GetCdnCredentials:output_type -> org.signal.chat.backup.GetCdnCredentialsResponse - 12, // 67: org.signal.chat.backup.BackupsAnonymous.GetSvrBCredentials:output_type -> org.signal.chat.backup.GetSvrBCredentialsResponse - 14, // 68: org.signal.chat.backup.BackupsAnonymous.GetMessageBackupInfo:output_type -> org.signal.chat.backup.GetMessageBackupInfoResponse - 15, // 69: org.signal.chat.backup.BackupsAnonymous.GetMediaBackupInfo:output_type -> org.signal.chat.backup.GetMediaBackupInfoResponse - 8, // 70: org.signal.chat.backup.BackupsAnonymous.SetPublicKey:output_type -> org.signal.chat.backup.SetPublicKeyResponse - 17, // 71: org.signal.chat.backup.BackupsAnonymous.Refresh:output_type -> org.signal.chat.backup.RefreshResponse - 19, // 72: org.signal.chat.backup.BackupsAnonymous.GetUploadForm:output_type -> org.signal.chat.backup.GetUploadFormResponse - 22, // 73: org.signal.chat.backup.BackupsAnonymous.CopyMedia:output_type -> org.signal.chat.backup.CopyMediaResponse - 25, // 74: org.signal.chat.backup.BackupsAnonymous.ListMedia:output_type -> org.signal.chat.backup.ListMediaResponse - 30, // 75: org.signal.chat.backup.BackupsAnonymous.DeleteMedia:output_type -> org.signal.chat.backup.DeleteMediaResponse - 27, // 76: org.signal.chat.backup.BackupsAnonymous.DeleteAll:output_type -> org.signal.chat.backup.DeleteAllResponse - 63, // [63:77] is the sub-list for method output_type - 49, // [49:63] is the sub-list for method input_type - 49, // [49:49] is the sub-list for extension type_name - 49, // [49:49] is the sub-list for extension extendee - 0, // [0:49] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_backups_proto_init() } -func file_org_signal_chat_backups_proto_init() { - if File_org_signal_chat_backups_proto != nil { - return - } - file_org_signal_chat_backups_proto_msgTypes[3].OneofWrappers = []any{ - (*RedeemReceiptResponse_Success)(nil), - (*RedeemReceiptResponse_AccountMissingCommitment)(nil), - (*RedeemReceiptResponse_InvalidReceipt)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[8].OneofWrappers = []any{ - (*SetPublicKeyResponse_Success)(nil), - (*SetPublicKeyResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[10].OneofWrappers = []any{ - (*GetCdnCredentialsResponse_CdnCredentials_)(nil), - (*GetCdnCredentialsResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[12].OneofWrappers = []any{ - (*GetSvrBCredentialsResponse_SvrbCredentials)(nil), - (*GetSvrBCredentialsResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[14].OneofWrappers = []any{ - (*GetMessageBackupInfoResponse_BackupInfo)(nil), - (*GetMessageBackupInfoResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[15].OneofWrappers = []any{ - (*GetMediaBackupInfoResponse_BackupInfo)(nil), - (*GetMediaBackupInfoResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[17].OneofWrappers = []any{ - (*RefreshResponse_Success)(nil), - (*RefreshResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[18].OneofWrappers = []any{ - (*GetUploadFormRequest_Messages)(nil), - (*GetUploadFormRequest_Media)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[19].OneofWrappers = []any{ - (*GetUploadFormResponse_UploadForm)(nil), - (*GetUploadFormResponse_FailedAuthentication)(nil), - (*GetUploadFormResponse_ExceedsMaxUploadLength)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[22].OneofWrappers = []any{ - (*CopyMediaResponse_Success)(nil), - (*CopyMediaResponse_SourceNotFound_)(nil), - (*CopyMediaResponse_WrongSourceLength_)(nil), - (*CopyMediaResponse_OutOfSpace_)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[23].OneofWrappers = []any{ - (*BackupStreamClosed_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[24].OneofWrappers = []any{} - file_org_signal_chat_backups_proto_msgTypes[25].OneofWrappers = []any{ - (*ListMediaResponse_ListResult_)(nil), - (*ListMediaResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[27].OneofWrappers = []any{ - (*DeleteAllResponse_Success)(nil), - (*DeleteAllResponse_FailedAuthentication)(nil), - } - file_org_signal_chat_backups_proto_msgTypes[46].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_backups_proto_rawDesc), len(file_org_signal_chat_backups_proto_rawDesc)), - NumEnums: 0, - NumMessages: 47, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_org_signal_chat_backups_proto_goTypes, - DependencyIndexes: file_org_signal_chat_backups_proto_depIdxs, - MessageInfos: file_org_signal_chat_backups_proto_msgTypes, - }.Build() - File_org_signal_chat_backups_proto = out.File - file_org_signal_chat_backups_proto_goTypes = nil - file_org_signal_chat_backups_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/backups/backups_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/backups/backups_grpc.pb.go deleted file mode 100644 index b7079e3..0000000 --- a/pkg/signalmeow/protobuf/rpc/backups/backups_grpc.pb.go +++ /dev/null @@ -1,878 +0,0 @@ -// -// Copyright 2024 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/backups.proto - -package backups - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Backups_SetBackupId_FullMethodName = "/org.signal.chat.backup.Backups/SetBackupId" - Backups_RedeemReceipt_FullMethodName = "/org.signal.chat.backup.Backups/RedeemReceipt" - Backups_GetBackupAuthCredentials_FullMethodName = "/org.signal.chat.backup.Backups/GetBackupAuthCredentials" -) - -// BackupsClient is the client API for Backups service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Service for backup operations that require account authentication. -// -// Most actual backup operations operate on the backup-id and cannot be linked -// to the caller's account, but setting up anonymous credentials and changing -// backup tier requires account authentication. -type BackupsClient interface { - // Set (blinded) backup-id(s) for the account. - // - // Each account may have a single active backup-id for each credential type - // that can be used to store and retrieve backups. Once the backup-id is set, - // BackupAuthCredentials can be generated using GetBackupAuthCredentials. - // - // The blinded backup-id and the key-pair used to blind it must be derived - // from a recoverable secret. - // - // At least one of the credential types must be set on the request. - // Only the primary device can set a blinded backup-id. - SetBackupId(ctx context.Context, in *SetBackupIdRequest, opts ...grpc.CallOption) (*SetBackupIdResponse, error) - // Redeem a receipt acquired from /v1/subscription/{subscriberId}/receipt_credentials - // to mark the account as eligible for the paid backup tier. - // - // After successful redemption, subsequent requests to - // GetBackupAuthCredentials will return credentials with the level on the - // provided receipt until the expiration time on the receipt. - RedeemReceipt(ctx context.Context, in *RedeemReceiptRequest, opts ...grpc.CallOption) (*RedeemReceiptResponse, error) - // After setting a blinded backup-id with PUT /v1/archives/, this fetches - // credentials that can be used to perform operations against that backup-id. - // Clients may (and should) request up to 7 days of credentials at a time. - // - // The redemption_start and redemption_end seconds must be UTC day aligned, and - // must not span more than 7 days. - // - // Each credential contains a receipt level which indicates the backup level - // the credential is good for. If the account has paid backup access that - // expires at some point in the provided redemption window, credentials with - // redemption times after the expiration may be on a lower backup level. - // - // Clients must validate the receipt level on the credential matches a known - // receipt level before using it. - GetBackupAuthCredentials(ctx context.Context, in *GetBackupAuthCredentialsRequest, opts ...grpc.CallOption) (*GetBackupAuthCredentialsResponse, error) -} - -type backupsClient struct { - cc grpc.ClientConnInterface -} - -func NewBackupsClient(cc grpc.ClientConnInterface) BackupsClient { - return &backupsClient{cc} -} - -func (c *backupsClient) SetBackupId(ctx context.Context, in *SetBackupIdRequest, opts ...grpc.CallOption) (*SetBackupIdResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetBackupIdResponse) - err := c.cc.Invoke(ctx, Backups_SetBackupId_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsClient) RedeemReceipt(ctx context.Context, in *RedeemReceiptRequest, opts ...grpc.CallOption) (*RedeemReceiptResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RedeemReceiptResponse) - err := c.cc.Invoke(ctx, Backups_RedeemReceipt_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsClient) GetBackupAuthCredentials(ctx context.Context, in *GetBackupAuthCredentialsRequest, opts ...grpc.CallOption) (*GetBackupAuthCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBackupAuthCredentialsResponse) - err := c.cc.Invoke(ctx, Backups_GetBackupAuthCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BackupsServer is the server API for Backups service. -// All implementations must embed UnimplementedBackupsServer -// for forward compatibility. -// -// Service for backup operations that require account authentication. -// -// Most actual backup operations operate on the backup-id and cannot be linked -// to the caller's account, but setting up anonymous credentials and changing -// backup tier requires account authentication. -type BackupsServer interface { - // Set (blinded) backup-id(s) for the account. - // - // Each account may have a single active backup-id for each credential type - // that can be used to store and retrieve backups. Once the backup-id is set, - // BackupAuthCredentials can be generated using GetBackupAuthCredentials. - // - // The blinded backup-id and the key-pair used to blind it must be derived - // from a recoverable secret. - // - // At least one of the credential types must be set on the request. - // Only the primary device can set a blinded backup-id. - SetBackupId(context.Context, *SetBackupIdRequest) (*SetBackupIdResponse, error) - // Redeem a receipt acquired from /v1/subscription/{subscriberId}/receipt_credentials - // to mark the account as eligible for the paid backup tier. - // - // After successful redemption, subsequent requests to - // GetBackupAuthCredentials will return credentials with the level on the - // provided receipt until the expiration time on the receipt. - RedeemReceipt(context.Context, *RedeemReceiptRequest) (*RedeemReceiptResponse, error) - // After setting a blinded backup-id with PUT /v1/archives/, this fetches - // credentials that can be used to perform operations against that backup-id. - // Clients may (and should) request up to 7 days of credentials at a time. - // - // The redemption_start and redemption_end seconds must be UTC day aligned, and - // must not span more than 7 days. - // - // Each credential contains a receipt level which indicates the backup level - // the credential is good for. If the account has paid backup access that - // expires at some point in the provided redemption window, credentials with - // redemption times after the expiration may be on a lower backup level. - // - // Clients must validate the receipt level on the credential matches a known - // receipt level before using it. - GetBackupAuthCredentials(context.Context, *GetBackupAuthCredentialsRequest) (*GetBackupAuthCredentialsResponse, error) - mustEmbedUnimplementedBackupsServer() -} - -// UnimplementedBackupsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBackupsServer struct{} - -func (UnimplementedBackupsServer) SetBackupId(context.Context, *SetBackupIdRequest) (*SetBackupIdResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetBackupId not implemented") -} -func (UnimplementedBackupsServer) RedeemReceipt(context.Context, *RedeemReceiptRequest) (*RedeemReceiptResponse, error) { - return nil, status.Error(codes.Unimplemented, "method RedeemReceipt not implemented") -} -func (UnimplementedBackupsServer) GetBackupAuthCredentials(context.Context, *GetBackupAuthCredentialsRequest) (*GetBackupAuthCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetBackupAuthCredentials not implemented") -} -func (UnimplementedBackupsServer) mustEmbedUnimplementedBackupsServer() {} -func (UnimplementedBackupsServer) testEmbeddedByValue() {} - -// UnsafeBackupsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BackupsServer will -// result in compilation errors. -type UnsafeBackupsServer interface { - mustEmbedUnimplementedBackupsServer() -} - -func RegisterBackupsServer(s grpc.ServiceRegistrar, srv BackupsServer) { - // If the following call panics, it indicates UnimplementedBackupsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Backups_ServiceDesc, srv) -} - -func _Backups_SetBackupId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetBackupIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsServer).SetBackupId(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backups_SetBackupId_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsServer).SetBackupId(ctx, req.(*SetBackupIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backups_RedeemReceipt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RedeemReceiptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsServer).RedeemReceipt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backups_RedeemReceipt_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsServer).RedeemReceipt(ctx, req.(*RedeemReceiptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Backups_GetBackupAuthCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBackupAuthCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsServer).GetBackupAuthCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Backups_GetBackupAuthCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsServer).GetBackupAuthCredentials(ctx, req.(*GetBackupAuthCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Backups_ServiceDesc is the grpc.ServiceDesc for Backups service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Backups_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.backup.Backups", - HandlerType: (*BackupsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SetBackupId", - Handler: _Backups_SetBackupId_Handler, - }, - { - MethodName: "RedeemReceipt", - Handler: _Backups_RedeemReceipt_Handler, - }, - { - MethodName: "GetBackupAuthCredentials", - Handler: _Backups_GetBackupAuthCredentials_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/backups.proto", -} - -const ( - BackupsAnonymous_GetCdnCredentials_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/GetCdnCredentials" - BackupsAnonymous_GetSvrBCredentials_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/GetSvrBCredentials" - BackupsAnonymous_GetMessageBackupInfo_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/GetMessageBackupInfo" - BackupsAnonymous_GetMediaBackupInfo_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/GetMediaBackupInfo" - BackupsAnonymous_SetPublicKey_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/SetPublicKey" - BackupsAnonymous_Refresh_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/Refresh" - BackupsAnonymous_GetUploadForm_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/GetUploadForm" - BackupsAnonymous_CopyMedia_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/CopyMedia" - BackupsAnonymous_ListMedia_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/ListMedia" - BackupsAnonymous_DeleteMedia_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/DeleteMedia" - BackupsAnonymous_DeleteAll_FullMethodName = "/org.signal.chat.backup.BackupsAnonymous/DeleteAll" -) - -// BackupsAnonymousClient is the client API for BackupsAnonymous service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// # Service for backup operations with anonymous credentials -// -// This service never requires account authentication. It instead requires a -// backup-id authenticated with an anonymous credential that cannot be linked -// to the account. -// -// To register an anonymous credential: -// -// 1. Set a backup-id on the authenticated channel via Backups::SetBackupId -// 2. Retrieve BackupAuthCredentials via Backups::GetBackupAuthCredentials -// 3. Generate a key pair and set the public key via -// BackupsAnonymous::SetPublicKey -// -// Unless otherwise noted, requests for this service require a -// SignedPresentation, which includes: -// -// - a presentation generated from a BackupAuthCredential issued by -// GetBackupAuthCredentials -// - a signature of that presentation using the private key of a key pair -// previously set with SetPublicKey. -type BackupsAnonymousClient interface { - // Retrieve credentials used to read objects stored on the backup cdn - GetCdnCredentials(ctx context.Context, in *GetCdnCredentialsRequest, opts ...grpc.CallOption) (*GetCdnCredentialsResponse, error) - // Retrieve credentials used to interact with the SecureValueRecoveryB service - GetSvrBCredentials(ctx context.Context, in *GetSvrBCredentialsRequest, opts ...grpc.CallOption) (*GetSvrBCredentialsResponse, error) - // Retrieve information about the currently stored message backup - GetMessageBackupInfo(ctx context.Context, in *GetBackupInfoRequest, opts ...grpc.CallOption) (*GetMessageBackupInfoResponse, error) - // Retrieve information about the currently stored media backup - GetMediaBackupInfo(ctx context.Context, in *GetBackupInfoRequest, opts ...grpc.CallOption) (*GetMediaBackupInfoResponse, error) - // Permanently set the public key of an ED25519 key-pair for the backup-id. - // All requests (including this one!) must sign their BackupAuthCredential - // presentations with the private key corresponding to the provided public key. - SetPublicKey(ctx context.Context, in *SetPublicKeyRequest, opts ...grpc.CallOption) (*SetPublicKeyResponse, error) - // Refresh the backup, indicating that the backup is still active. Clients - // must periodically upload new backups or perform a refresh. If a backup has - // not been active for 30 days, it may be deleted. - Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) - // Retrieve an upload form that can be used to perform a resumable upload - GetUploadForm(ctx context.Context, in *GetUploadFormRequest, opts ...grpc.CallOption) (*GetUploadFormResponse, error) - // Copy and re-encrypt media from the attachments cdn into the backup cdn. - // The original, already encrypted, attachments will be encrypted with the - // provided key material before being copied. - // - // The copy operation is not atomic and responses will be returned as copy - // operations complete with detailed information about the outcome. If an - // error is encountered, not all requests may be reflected in the responses. - // - // On retries, a particular destination media id must not be reused with a - // different source media id or different encryption parameters. - // - // The response stream may be closed with STREAM_CLOSED error reason. In this - // case, a BackupStreamClosed message will be present in the error details. - CopyMedia(ctx context.Context, in *CopyMediaRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CopyMediaResponse], error) - // Retrieve a page of media objects stored for this backup-id. A client may - // have previously stored media objects that are no longer referenced in their - // current backup. To reclaim storage space used by these orphaned objects, - // perform a list operation and remove any unreferenced media objects - // via DeleteMedia. - ListMedia(ctx context.Context, in *ListMediaRequest, opts ...grpc.CallOption) (*ListMediaResponse, error) - // Delete media objects stored with this backup-id. Streams the locations of - // media items back when the item has successfully been removed. - // - // The response stream may be closed with STREAM_CLOSED error reason. In this - // case, a BackupStreamClosed message will be present in the error details. - DeleteMedia(ctx context.Context, in *DeleteMediaRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DeleteMediaResponse], error) - // Delete all backup metadata, objects, and stored public key. To use - // backups again, a public key must be resupplied. - DeleteAll(ctx context.Context, in *DeleteAllRequest, opts ...grpc.CallOption) (*DeleteAllResponse, error) -} - -type backupsAnonymousClient struct { - cc grpc.ClientConnInterface -} - -func NewBackupsAnonymousClient(cc grpc.ClientConnInterface) BackupsAnonymousClient { - return &backupsAnonymousClient{cc} -} - -func (c *backupsAnonymousClient) GetCdnCredentials(ctx context.Context, in *GetCdnCredentialsRequest, opts ...grpc.CallOption) (*GetCdnCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetCdnCredentialsResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_GetCdnCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) GetSvrBCredentials(ctx context.Context, in *GetSvrBCredentialsRequest, opts ...grpc.CallOption) (*GetSvrBCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetSvrBCredentialsResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_GetSvrBCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) GetMessageBackupInfo(ctx context.Context, in *GetBackupInfoRequest, opts ...grpc.CallOption) (*GetMessageBackupInfoResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMessageBackupInfoResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_GetMessageBackupInfo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) GetMediaBackupInfo(ctx context.Context, in *GetBackupInfoRequest, opts ...grpc.CallOption) (*GetMediaBackupInfoResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMediaBackupInfoResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_GetMediaBackupInfo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) SetPublicKey(ctx context.Context, in *SetPublicKeyRequest, opts ...grpc.CallOption) (*SetPublicKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetPublicKeyResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_SetPublicKey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RefreshResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_Refresh_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) GetUploadForm(ctx context.Context, in *GetUploadFormRequest, opts ...grpc.CallOption) (*GetUploadFormResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetUploadFormResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_GetUploadForm_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) CopyMedia(ctx context.Context, in *CopyMediaRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[CopyMediaResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &BackupsAnonymous_ServiceDesc.Streams[0], BackupsAnonymous_CopyMedia_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[CopyMediaRequest, CopyMediaResponse]{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackupsAnonymous_CopyMediaClient = grpc.ServerStreamingClient[CopyMediaResponse] - -func (c *backupsAnonymousClient) ListMedia(ctx context.Context, in *ListMediaRequest, opts ...grpc.CallOption) (*ListMediaResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ListMediaResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_ListMedia_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *backupsAnonymousClient) DeleteMedia(ctx context.Context, in *DeleteMediaRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[DeleteMediaResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &BackupsAnonymous_ServiceDesc.Streams[1], BackupsAnonymous_DeleteMedia_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[DeleteMediaRequest, DeleteMediaResponse]{ClientStream: stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackupsAnonymous_DeleteMediaClient = grpc.ServerStreamingClient[DeleteMediaResponse] - -func (c *backupsAnonymousClient) DeleteAll(ctx context.Context, in *DeleteAllRequest, opts ...grpc.CallOption) (*DeleteAllResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteAllResponse) - err := c.cc.Invoke(ctx, BackupsAnonymous_DeleteAll_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// BackupsAnonymousServer is the server API for BackupsAnonymous service. -// All implementations must embed UnimplementedBackupsAnonymousServer -// for forward compatibility. -// -// # Service for backup operations with anonymous credentials -// -// This service never requires account authentication. It instead requires a -// backup-id authenticated with an anonymous credential that cannot be linked -// to the account. -// -// To register an anonymous credential: -// -// 1. Set a backup-id on the authenticated channel via Backups::SetBackupId -// 2. Retrieve BackupAuthCredentials via Backups::GetBackupAuthCredentials -// 3. Generate a key pair and set the public key via -// BackupsAnonymous::SetPublicKey -// -// Unless otherwise noted, requests for this service require a -// SignedPresentation, which includes: -// -// - a presentation generated from a BackupAuthCredential issued by -// GetBackupAuthCredentials -// - a signature of that presentation using the private key of a key pair -// previously set with SetPublicKey. -type BackupsAnonymousServer interface { - // Retrieve credentials used to read objects stored on the backup cdn - GetCdnCredentials(context.Context, *GetCdnCredentialsRequest) (*GetCdnCredentialsResponse, error) - // Retrieve credentials used to interact with the SecureValueRecoveryB service - GetSvrBCredentials(context.Context, *GetSvrBCredentialsRequest) (*GetSvrBCredentialsResponse, error) - // Retrieve information about the currently stored message backup - GetMessageBackupInfo(context.Context, *GetBackupInfoRequest) (*GetMessageBackupInfoResponse, error) - // Retrieve information about the currently stored media backup - GetMediaBackupInfo(context.Context, *GetBackupInfoRequest) (*GetMediaBackupInfoResponse, error) - // Permanently set the public key of an ED25519 key-pair for the backup-id. - // All requests (including this one!) must sign their BackupAuthCredential - // presentations with the private key corresponding to the provided public key. - SetPublicKey(context.Context, *SetPublicKeyRequest) (*SetPublicKeyResponse, error) - // Refresh the backup, indicating that the backup is still active. Clients - // must periodically upload new backups or perform a refresh. If a backup has - // not been active for 30 days, it may be deleted. - Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) - // Retrieve an upload form that can be used to perform a resumable upload - GetUploadForm(context.Context, *GetUploadFormRequest) (*GetUploadFormResponse, error) - // Copy and re-encrypt media from the attachments cdn into the backup cdn. - // The original, already encrypted, attachments will be encrypted with the - // provided key material before being copied. - // - // The copy operation is not atomic and responses will be returned as copy - // operations complete with detailed information about the outcome. If an - // error is encountered, not all requests may be reflected in the responses. - // - // On retries, a particular destination media id must not be reused with a - // different source media id or different encryption parameters. - // - // The response stream may be closed with STREAM_CLOSED error reason. In this - // case, a BackupStreamClosed message will be present in the error details. - CopyMedia(*CopyMediaRequest, grpc.ServerStreamingServer[CopyMediaResponse]) error - // Retrieve a page of media objects stored for this backup-id. A client may - // have previously stored media objects that are no longer referenced in their - // current backup. To reclaim storage space used by these orphaned objects, - // perform a list operation and remove any unreferenced media objects - // via DeleteMedia. - ListMedia(context.Context, *ListMediaRequest) (*ListMediaResponse, error) - // Delete media objects stored with this backup-id. Streams the locations of - // media items back when the item has successfully been removed. - // - // The response stream may be closed with STREAM_CLOSED error reason. In this - // case, a BackupStreamClosed message will be present in the error details. - DeleteMedia(*DeleteMediaRequest, grpc.ServerStreamingServer[DeleteMediaResponse]) error - // Delete all backup metadata, objects, and stored public key. To use - // backups again, a public key must be resupplied. - DeleteAll(context.Context, *DeleteAllRequest) (*DeleteAllResponse, error) - mustEmbedUnimplementedBackupsAnonymousServer() -} - -// UnimplementedBackupsAnonymousServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedBackupsAnonymousServer struct{} - -func (UnimplementedBackupsAnonymousServer) GetCdnCredentials(context.Context, *GetCdnCredentialsRequest) (*GetCdnCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetCdnCredentials not implemented") -} -func (UnimplementedBackupsAnonymousServer) GetSvrBCredentials(context.Context, *GetSvrBCredentialsRequest) (*GetSvrBCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetSvrBCredentials not implemented") -} -func (UnimplementedBackupsAnonymousServer) GetMessageBackupInfo(context.Context, *GetBackupInfoRequest) (*GetMessageBackupInfoResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetMessageBackupInfo not implemented") -} -func (UnimplementedBackupsAnonymousServer) GetMediaBackupInfo(context.Context, *GetBackupInfoRequest) (*GetMediaBackupInfoResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetMediaBackupInfo not implemented") -} -func (UnimplementedBackupsAnonymousServer) SetPublicKey(context.Context, *SetPublicKeyRequest) (*SetPublicKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetPublicKey not implemented") -} -func (UnimplementedBackupsAnonymousServer) Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) { - return nil, status.Error(codes.Unimplemented, "method Refresh not implemented") -} -func (UnimplementedBackupsAnonymousServer) GetUploadForm(context.Context, *GetUploadFormRequest) (*GetUploadFormResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetUploadForm not implemented") -} -func (UnimplementedBackupsAnonymousServer) CopyMedia(*CopyMediaRequest, grpc.ServerStreamingServer[CopyMediaResponse]) error { - return status.Error(codes.Unimplemented, "method CopyMedia not implemented") -} -func (UnimplementedBackupsAnonymousServer) ListMedia(context.Context, *ListMediaRequest) (*ListMediaResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ListMedia not implemented") -} -func (UnimplementedBackupsAnonymousServer) DeleteMedia(*DeleteMediaRequest, grpc.ServerStreamingServer[DeleteMediaResponse]) error { - return status.Error(codes.Unimplemented, "method DeleteMedia not implemented") -} -func (UnimplementedBackupsAnonymousServer) DeleteAll(context.Context, *DeleteAllRequest) (*DeleteAllResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DeleteAll not implemented") -} -func (UnimplementedBackupsAnonymousServer) mustEmbedUnimplementedBackupsAnonymousServer() {} -func (UnimplementedBackupsAnonymousServer) testEmbeddedByValue() {} - -// UnsafeBackupsAnonymousServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to BackupsAnonymousServer will -// result in compilation errors. -type UnsafeBackupsAnonymousServer interface { - mustEmbedUnimplementedBackupsAnonymousServer() -} - -func RegisterBackupsAnonymousServer(s grpc.ServiceRegistrar, srv BackupsAnonymousServer) { - // If the following call panics, it indicates UnimplementedBackupsAnonymousServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&BackupsAnonymous_ServiceDesc, srv) -} - -func _BackupsAnonymous_GetCdnCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCdnCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).GetCdnCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_GetCdnCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).GetCdnCredentials(ctx, req.(*GetCdnCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_GetSvrBCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSvrBCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).GetSvrBCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_GetSvrBCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).GetSvrBCredentials(ctx, req.(*GetSvrBCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_GetMessageBackupInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBackupInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).GetMessageBackupInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_GetMessageBackupInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).GetMessageBackupInfo(ctx, req.(*GetBackupInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_GetMediaBackupInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBackupInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).GetMediaBackupInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_GetMediaBackupInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).GetMediaBackupInfo(ctx, req.(*GetBackupInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_SetPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetPublicKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).SetPublicKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_SetPublicKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).SetPublicKey(ctx, req.(*SetPublicKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RefreshRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).Refresh(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_Refresh_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).Refresh(ctx, req.(*RefreshRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_GetUploadForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUploadFormRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).GetUploadForm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_GetUploadForm_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).GetUploadForm(ctx, req.(*GetUploadFormRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_CopyMedia_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(CopyMediaRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(BackupsAnonymousServer).CopyMedia(m, &grpc.GenericServerStream[CopyMediaRequest, CopyMediaResponse]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackupsAnonymous_CopyMediaServer = grpc.ServerStreamingServer[CopyMediaResponse] - -func _BackupsAnonymous_ListMedia_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListMediaRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).ListMedia(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_ListMedia_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).ListMedia(ctx, req.(*ListMediaRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _BackupsAnonymous_DeleteMedia_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(DeleteMediaRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(BackupsAnonymousServer).DeleteMedia(m, &grpc.GenericServerStream[DeleteMediaRequest, DeleteMediaResponse]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type BackupsAnonymous_DeleteMediaServer = grpc.ServerStreamingServer[DeleteMediaResponse] - -func _BackupsAnonymous_DeleteAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAllRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(BackupsAnonymousServer).DeleteAll(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: BackupsAnonymous_DeleteAll_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BackupsAnonymousServer).DeleteAll(ctx, req.(*DeleteAllRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// BackupsAnonymous_ServiceDesc is the grpc.ServiceDesc for BackupsAnonymous service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var BackupsAnonymous_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.backup.BackupsAnonymous", - HandlerType: (*BackupsAnonymousServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetCdnCredentials", - Handler: _BackupsAnonymous_GetCdnCredentials_Handler, - }, - { - MethodName: "GetSvrBCredentials", - Handler: _BackupsAnonymous_GetSvrBCredentials_Handler, - }, - { - MethodName: "GetMessageBackupInfo", - Handler: _BackupsAnonymous_GetMessageBackupInfo_Handler, - }, - { - MethodName: "GetMediaBackupInfo", - Handler: _BackupsAnonymous_GetMediaBackupInfo_Handler, - }, - { - MethodName: "SetPublicKey", - Handler: _BackupsAnonymous_SetPublicKey_Handler, - }, - { - MethodName: "Refresh", - Handler: _BackupsAnonymous_Refresh_Handler, - }, - { - MethodName: "GetUploadForm", - Handler: _BackupsAnonymous_GetUploadForm_Handler, - }, - { - MethodName: "ListMedia", - Handler: _BackupsAnonymous_ListMedia_Handler, - }, - { - MethodName: "DeleteAll", - Handler: _BackupsAnonymous_DeleteAll_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "CopyMedia", - Handler: _BackupsAnonymous_CopyMedia_Handler, - ServerStreams: true, - }, - { - StreamName: "DeleteMedia", - Handler: _BackupsAnonymous_DeleteMedia_Handler, - ServerStreams: true, - }, - }, - Metadata: "org/signal/chat/backups.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/call_quality/call_quality.pb.go b/pkg/signalmeow/protobuf/rpc/call_quality/call_quality.pb.go deleted file mode 100644 index 9e023d8..0000000 --- a/pkg/signalmeow/protobuf/rpc/call_quality/call_quality.pb.go +++ /dev/null @@ -1,426 +0,0 @@ -// -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/call_quality.proto - -package call_quality - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SubmitCallQualitySurveyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Indicates whether the caller was generally satisfied with the quality of - // the call - UserSatisfied bool `protobuf:"varint,1,opt,name=user_satisfied,json=userSatisfied,proto3" json:"user_satisfied,omitempty"` - // A list of call quality issues selected by the caller - CallQualityIssues []string `protobuf:"bytes,2,rep,name=call_quality_issues,json=callQualityIssues,proto3" json:"call_quality_issues,omitempty"` - // A free-form description of any additional issues as written by the caller - AdditionalIssuesDescription *string `protobuf:"bytes,3,opt,name=additional_issues_description,json=additionalIssuesDescription,proto3,oneof" json:"additional_issues_description,omitempty"` - // A URL for a set of debug logs associated with the call if the caller chose - // to submit debug logs - DebugLogUrl *string `protobuf:"bytes,4,opt,name=debug_log_url,json=debugLogUrl,proto3,oneof" json:"debug_log_url,omitempty"` - // The time at which the call started in milliseconds since the epoch - StartTimestamp int64 `protobuf:"varint,5,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"` - // The time at which the call ended in milliseconds since the epoch - EndTimestamp int64 `protobuf:"varint,6,opt,name=end_timestamp,json=endTimestamp,proto3" json:"end_timestamp,omitempty"` - // The type of call; note that direct voice calls can become video calls and - // vice versa, and this field indicates which mode was selected at call - // initiation time. At the time of writing, expected call types are - // "direct_voice", "direct_video", "group", and "call_link". - CallType string `protobuf:"bytes,7,opt,name=call_type,json=callType,proto3" json:"call_type,omitempty"` - // Indicates whether the call completed without error or if it terminated - // abnormally - Success bool `protobuf:"varint,8,opt,name=success,proto3" json:"success,omitempty"` - // A client-defined, but human-readable reason for call termination - CallEndReason string `protobuf:"bytes,9,opt,name=call_end_reason,json=callEndReason,proto3" json:"call_end_reason,omitempty"` - // The median round-trip time, measured in milliseconds, for STUN/ICE packets - // (i.e. connection maintenance and establishment) - ConnectionRttMedian *float32 `protobuf:"fixed32,10,opt,name=connection_rtt_median,json=connectionRttMedian,proto3,oneof" json:"connection_rtt_median,omitempty"` - // The median round-trip time, measured in milliseconds, for RTP/RTCP packets - // for audio streams - AudioRttMedian *float32 `protobuf:"fixed32,11,opt,name=audio_rtt_median,json=audioRttMedian,proto3,oneof" json:"audio_rtt_median,omitempty"` - // The median round-trip time, measured in milliseconds, for RTP/RTCP packets - // for video streams - VideoRttMedian *float32 `protobuf:"fixed32,12,opt,name=video_rtt_median,json=videoRttMedian,proto3,oneof" json:"video_rtt_median,omitempty"` - // The median jitter for audio streams, measured in milliseconds, for the - // duration of the call as measured by the client submitting the survey - AudioRecvJitterMedian *float32 `protobuf:"fixed32,13,opt,name=audio_recv_jitter_median,json=audioRecvJitterMedian,proto3,oneof" json:"audio_recv_jitter_median,omitempty"` - // The median jitter for video streams, measured in milliseconds, for the - // duration of the call as measured by the client submitting the survey - VideoRecvJitterMedian *float32 `protobuf:"fixed32,14,opt,name=video_recv_jitter_median,json=videoRecvJitterMedian,proto3,oneof" json:"video_recv_jitter_median,omitempty"` - // The median jitter for audio streams, measured in milliseconds, for the - // duration of the call as measured by the remote endpoint in the call (either - // the peer of the client submitting the survey in a direct call or the SFU in - // a group call) - AudioSendJitterMedian *float32 `protobuf:"fixed32,15,opt,name=audio_send_jitter_median,json=audioSendJitterMedian,proto3,oneof" json:"audio_send_jitter_median,omitempty"` - // The median jitter for video streams, measured in milliseconds, for the - // duration of the call as measured by the remote endpoint in the call (either - // the peer of the client submitting the survey in a direct call or the SFU in - // a group call) - VideoSendJitterMedian *float32 `protobuf:"fixed32,16,opt,name=video_send_jitter_median,json=videoSendJitterMedian,proto3,oneof" json:"video_send_jitter_median,omitempty"` - // The fraction of audio packets lost over the duration of the call as - // measured by the client submitting the survey - AudioRecvPacketLossFraction *float32 `protobuf:"fixed32,17,opt,name=audio_recv_packet_loss_fraction,json=audioRecvPacketLossFraction,proto3,oneof" json:"audio_recv_packet_loss_fraction,omitempty"` - // The fraction of video packets lost over the duration of the call as - // measured by the client submitting the survey - VideoRecvPacketLossFraction *float32 `protobuf:"fixed32,18,opt,name=video_recv_packet_loss_fraction,json=videoRecvPacketLossFraction,proto3,oneof" json:"video_recv_packet_loss_fraction,omitempty"` - // The fraction of audio packets lost over the duration of the call as - // measured by the remote endpoint in the call (either the peer of the client - // submitting the survey in a direct call or the SFU in a group call) - AudioSendPacketLossFraction *float32 `protobuf:"fixed32,19,opt,name=audio_send_packet_loss_fraction,json=audioSendPacketLossFraction,proto3,oneof" json:"audio_send_packet_loss_fraction,omitempty"` - // The fraction of video packets lost over the duration of the call as - // measured by the remote endpoint in the call (either the peer of the client - // submitting the survey in a direct call or the SFU in a group call) - VideoSendPacketLossFraction *float32 `protobuf:"fixed32,20,opt,name=video_send_packet_loss_fraction,json=videoSendPacketLossFraction,proto3,oneof" json:"video_send_packet_loss_fraction,omitempty"` - // Machine-generated telemetry from the call; this is a serialized protobuf - // entity generated (and, critically, explained to the user!) by the calling - // library - CallTelemetry []byte `protobuf:"bytes,21,opt,name=call_telemetry,json=callTelemetry,proto3,oneof" json:"call_telemetry,omitempty"` - // A hash of a call ID (shared between clients and never sent to the calling - // server) that can be used to correlate survey responses from multiple - // participants in a call - CallIdHash []byte `protobuf:"bytes,22,opt,name=call_id_hash,json=callIdHash,proto3,oneof" json:"call_id_hash,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubmitCallQualitySurveyRequest) Reset() { - *x = SubmitCallQualitySurveyRequest{} - mi := &file_org_signal_chat_call_quality_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubmitCallQualitySurveyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubmitCallQualitySurveyRequest) ProtoMessage() {} - -func (x *SubmitCallQualitySurveyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_call_quality_proto_msgTypes[0] - 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 SubmitCallQualitySurveyRequest.ProtoReflect.Descriptor instead. -func (*SubmitCallQualitySurveyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_call_quality_proto_rawDescGZIP(), []int{0} -} - -func (x *SubmitCallQualitySurveyRequest) GetUserSatisfied() bool { - if x != nil { - return x.UserSatisfied - } - return false -} - -func (x *SubmitCallQualitySurveyRequest) GetCallQualityIssues() []string { - if x != nil { - return x.CallQualityIssues - } - return nil -} - -func (x *SubmitCallQualitySurveyRequest) GetAdditionalIssuesDescription() string { - if x != nil && x.AdditionalIssuesDescription != nil { - return *x.AdditionalIssuesDescription - } - return "" -} - -func (x *SubmitCallQualitySurveyRequest) GetDebugLogUrl() string { - if x != nil && x.DebugLogUrl != nil { - return *x.DebugLogUrl - } - return "" -} - -func (x *SubmitCallQualitySurveyRequest) GetStartTimestamp() int64 { - if x != nil { - return x.StartTimestamp - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetEndTimestamp() int64 { - if x != nil { - return x.EndTimestamp - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetCallType() string { - if x != nil { - return x.CallType - } - return "" -} - -func (x *SubmitCallQualitySurveyRequest) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *SubmitCallQualitySurveyRequest) GetCallEndReason() string { - if x != nil { - return x.CallEndReason - } - return "" -} - -func (x *SubmitCallQualitySurveyRequest) GetConnectionRttMedian() float32 { - if x != nil && x.ConnectionRttMedian != nil { - return *x.ConnectionRttMedian - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetAudioRttMedian() float32 { - if x != nil && x.AudioRttMedian != nil { - return *x.AudioRttMedian - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetVideoRttMedian() float32 { - if x != nil && x.VideoRttMedian != nil { - return *x.VideoRttMedian - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetAudioRecvJitterMedian() float32 { - if x != nil && x.AudioRecvJitterMedian != nil { - return *x.AudioRecvJitterMedian - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetVideoRecvJitterMedian() float32 { - if x != nil && x.VideoRecvJitterMedian != nil { - return *x.VideoRecvJitterMedian - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetAudioSendJitterMedian() float32 { - if x != nil && x.AudioSendJitterMedian != nil { - return *x.AudioSendJitterMedian - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetVideoSendJitterMedian() float32 { - if x != nil && x.VideoSendJitterMedian != nil { - return *x.VideoSendJitterMedian - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetAudioRecvPacketLossFraction() float32 { - if x != nil && x.AudioRecvPacketLossFraction != nil { - return *x.AudioRecvPacketLossFraction - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetVideoRecvPacketLossFraction() float32 { - if x != nil && x.VideoRecvPacketLossFraction != nil { - return *x.VideoRecvPacketLossFraction - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetAudioSendPacketLossFraction() float32 { - if x != nil && x.AudioSendPacketLossFraction != nil { - return *x.AudioSendPacketLossFraction - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetVideoSendPacketLossFraction() float32 { - if x != nil && x.VideoSendPacketLossFraction != nil { - return *x.VideoSendPacketLossFraction - } - return 0 -} - -func (x *SubmitCallQualitySurveyRequest) GetCallTelemetry() []byte { - if x != nil { - return x.CallTelemetry - } - return nil -} - -func (x *SubmitCallQualitySurveyRequest) GetCallIdHash() []byte { - if x != nil { - return x.CallIdHash - } - return nil -} - -type SubmitCallQualitySurveyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SubmitCallQualitySurveyResponse) Reset() { - *x = SubmitCallQualitySurveyResponse{} - mi := &file_org_signal_chat_call_quality_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SubmitCallQualitySurveyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubmitCallQualitySurveyResponse) ProtoMessage() {} - -func (x *SubmitCallQualitySurveyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_call_quality_proto_msgTypes[1] - 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 SubmitCallQualitySurveyResponse.ProtoReflect.Descriptor instead. -func (*SubmitCallQualitySurveyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_call_quality_proto_rawDescGZIP(), []int{1} -} - -var File_org_signal_chat_call_quality_proto protoreflect.FileDescriptor - -const file_org_signal_chat_call_quality_proto_rawDesc = "" + - "\n" + - "\"org/signal/chat/call_quality.proto\x12\x1forg.signal.chat.calling.quality\x1a\x1dorg/signal/chat/require.proto\"\xc4\f\n" + - "\x1eSubmitCallQualitySurveyRequest\x12%\n" + - "\x0euser_satisfied\x18\x01 \x01(\bR\ruserSatisfied\x12.\n" + - "\x13call_quality_issues\x18\x02 \x03(\tR\x11callQualityIssues\x12G\n" + - "\x1dadditional_issues_description\x18\x03 \x01(\tH\x00R\x1badditionalIssuesDescription\x88\x01\x01\x12'\n" + - "\rdebug_log_url\x18\x04 \x01(\tH\x01R\vdebugLogUrl\x88\x01\x01\x12'\n" + - "\x0fstart_timestamp\x18\x05 \x01(\x03R\x0estartTimestamp\x12#\n" + - "\rend_timestamp\x18\x06 \x01(\x03R\fendTimestamp\x12\x1b\n" + - "\tcall_type\x18\a \x01(\tR\bcallType\x12\x18\n" + - "\asuccess\x18\b \x01(\bR\asuccess\x12&\n" + - "\x0fcall_end_reason\x18\t \x01(\tR\rcallEndReason\x127\n" + - "\x15connection_rtt_median\x18\n" + - " \x01(\x02H\x02R\x13connectionRttMedian\x88\x01\x01\x12-\n" + - "\x10audio_rtt_median\x18\v \x01(\x02H\x03R\x0eaudioRttMedian\x88\x01\x01\x12-\n" + - "\x10video_rtt_median\x18\f \x01(\x02H\x04R\x0evideoRttMedian\x88\x01\x01\x12<\n" + - "\x18audio_recv_jitter_median\x18\r \x01(\x02H\x05R\x15audioRecvJitterMedian\x88\x01\x01\x12<\n" + - "\x18video_recv_jitter_median\x18\x0e \x01(\x02H\x06R\x15videoRecvJitterMedian\x88\x01\x01\x12<\n" + - "\x18audio_send_jitter_median\x18\x0f \x01(\x02H\aR\x15audioSendJitterMedian\x88\x01\x01\x12<\n" + - "\x18video_send_jitter_median\x18\x10 \x01(\x02H\bR\x15videoSendJitterMedian\x88\x01\x01\x12I\n" + - "\x1faudio_recv_packet_loss_fraction\x18\x11 \x01(\x02H\tR\x1baudioRecvPacketLossFraction\x88\x01\x01\x12I\n" + - "\x1fvideo_recv_packet_loss_fraction\x18\x12 \x01(\x02H\n" + - "R\x1bvideoRecvPacketLossFraction\x88\x01\x01\x12I\n" + - "\x1faudio_send_packet_loss_fraction\x18\x13 \x01(\x02H\vR\x1baudioSendPacketLossFraction\x88\x01\x01\x12I\n" + - "\x1fvideo_send_packet_loss_fraction\x18\x14 \x01(\x02H\fR\x1bvideoSendPacketLossFraction\x88\x01\x01\x12*\n" + - "\x0ecall_telemetry\x18\x15 \x01(\fH\rR\rcallTelemetry\x88\x01\x01\x12%\n" + - "\fcall_id_hash\x18\x16 \x01(\fH\x0eR\n" + - "callIdHash\x88\x01\x01B \n" + - "\x1e_additional_issues_descriptionB\x10\n" + - "\x0e_debug_log_urlB\x18\n" + - "\x16_connection_rtt_medianB\x13\n" + - "\x11_audio_rtt_medianB\x13\n" + - "\x11_video_rtt_medianB\x1b\n" + - "\x19_audio_recv_jitter_medianB\x1b\n" + - "\x19_video_recv_jitter_medianB\x1b\n" + - "\x19_audio_send_jitter_medianB\x1b\n" + - "\x19_video_send_jitter_medianB\"\n" + - " _audio_recv_packet_loss_fractionB\"\n" + - " _video_recv_packet_loss_fractionB\"\n" + - " _audio_send_packet_loss_fractionB\"\n" + - " _video_send_packet_loss_fractionB\x11\n" + - "\x0f_call_telemetryB\x0f\n" + - "\r_call_id_hash\"!\n" + - "\x1fSubmitCallQualitySurveyResponse2\xb4\x01\n" + - "\vCallQuality\x12\x9e\x01\n" + - "\x17SubmitCallQualitySurvey\x12?.org.signal.chat.calling.quality.SubmitCallQualitySurveyRequest\x1a@.org.signal.chat.calling.quality.SubmitCallQualitySurveyResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_call_quality_proto_rawDescOnce sync.Once - file_org_signal_chat_call_quality_proto_rawDescData []byte -) - -func file_org_signal_chat_call_quality_proto_rawDescGZIP() []byte { - file_org_signal_chat_call_quality_proto_rawDescOnce.Do(func() { - file_org_signal_chat_call_quality_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_call_quality_proto_rawDesc), len(file_org_signal_chat_call_quality_proto_rawDesc))) - }) - return file_org_signal_chat_call_quality_proto_rawDescData -} - -var file_org_signal_chat_call_quality_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_org_signal_chat_call_quality_proto_goTypes = []any{ - (*SubmitCallQualitySurveyRequest)(nil), // 0: org.signal.chat.calling.quality.SubmitCallQualitySurveyRequest - (*SubmitCallQualitySurveyResponse)(nil), // 1: org.signal.chat.calling.quality.SubmitCallQualitySurveyResponse -} -var file_org_signal_chat_call_quality_proto_depIdxs = []int32{ - 0, // 0: org.signal.chat.calling.quality.CallQuality.SubmitCallQualitySurvey:input_type -> org.signal.chat.calling.quality.SubmitCallQualitySurveyRequest - 1, // 1: org.signal.chat.calling.quality.CallQuality.SubmitCallQualitySurvey:output_type -> org.signal.chat.calling.quality.SubmitCallQualitySurveyResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_call_quality_proto_init() } -func file_org_signal_chat_call_quality_proto_init() { - if File_org_signal_chat_call_quality_proto != nil { - return - } - file_org_signal_chat_call_quality_proto_msgTypes[0].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_call_quality_proto_rawDesc), len(file_org_signal_chat_call_quality_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_call_quality_proto_goTypes, - DependencyIndexes: file_org_signal_chat_call_quality_proto_depIdxs, - MessageInfos: file_org_signal_chat_call_quality_proto_msgTypes, - }.Build() - File_org_signal_chat_call_quality_proto = out.File - file_org_signal_chat_call_quality_proto_goTypes = nil - file_org_signal_chat_call_quality_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/call_quality/call_quality_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/call_quality/call_quality_grpc.pb.go deleted file mode 100644 index da99137..0000000 --- a/pkg/signalmeow/protobuf/rpc/call_quality/call_quality_grpc.pb.go +++ /dev/null @@ -1,131 +0,0 @@ -// -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/call_quality.proto - -package call_quality - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - CallQuality_SubmitCallQualitySurvey_FullMethodName = "/org.signal.chat.calling.quality.CallQuality/SubmitCallQualitySurvey" -) - -// CallQualityClient is the client API for CallQuality service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for submitting call quality surveys -type CallQualityClient interface { - // Submits a call quality survey response. - SubmitCallQualitySurvey(ctx context.Context, in *SubmitCallQualitySurveyRequest, opts ...grpc.CallOption) (*SubmitCallQualitySurveyResponse, error) -} - -type callQualityClient struct { - cc grpc.ClientConnInterface -} - -func NewCallQualityClient(cc grpc.ClientConnInterface) CallQualityClient { - return &callQualityClient{cc} -} - -func (c *callQualityClient) SubmitCallQualitySurvey(ctx context.Context, in *SubmitCallQualitySurveyRequest, opts ...grpc.CallOption) (*SubmitCallQualitySurveyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SubmitCallQualitySurveyResponse) - err := c.cc.Invoke(ctx, CallQuality_SubmitCallQualitySurvey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CallQualityServer is the server API for CallQuality service. -// All implementations must embed UnimplementedCallQualityServer -// for forward compatibility. -// -// Provides methods for submitting call quality surveys -type CallQualityServer interface { - // Submits a call quality survey response. - SubmitCallQualitySurvey(context.Context, *SubmitCallQualitySurveyRequest) (*SubmitCallQualitySurveyResponse, error) - mustEmbedUnimplementedCallQualityServer() -} - -// UnimplementedCallQualityServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedCallQualityServer struct{} - -func (UnimplementedCallQualityServer) SubmitCallQualitySurvey(context.Context, *SubmitCallQualitySurveyRequest) (*SubmitCallQualitySurveyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SubmitCallQualitySurvey not implemented") -} -func (UnimplementedCallQualityServer) mustEmbedUnimplementedCallQualityServer() {} -func (UnimplementedCallQualityServer) testEmbeddedByValue() {} - -// UnsafeCallQualityServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CallQualityServer will -// result in compilation errors. -type UnsafeCallQualityServer interface { - mustEmbedUnimplementedCallQualityServer() -} - -func RegisterCallQualityServer(s grpc.ServiceRegistrar, srv CallQualityServer) { - // If the following call panics, it indicates UnimplementedCallQualityServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&CallQuality_ServiceDesc, srv) -} - -func _CallQuality_SubmitCallQualitySurvey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SubmitCallQualitySurveyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CallQualityServer).SubmitCallQualitySurvey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CallQuality_SubmitCallQualitySurvey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CallQualityServer).SubmitCallQualitySurvey(ctx, req.(*SubmitCallQualitySurveyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// CallQuality_ServiceDesc is the grpc.ServiceDesc for CallQuality service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CallQuality_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.calling.quality.CallQuality", - HandlerType: (*CallQualityServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SubmitCallQualitySurvey", - Handler: _CallQuality_SubmitCallQualitySurvey_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/call_quality.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/calling/calling.pb.go b/pkg/signalmeow/protobuf/rpc/calling/calling.pb.go deleted file mode 100644 index 7b68f1a..0000000 --- a/pkg/signalmeow/protobuf/rpc/calling/calling.pb.go +++ /dev/null @@ -1,379 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/calling.proto - -package calling - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetCallingRelaysRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCallingRelaysRequest) Reset() { - *x = GetCallingRelaysRequest{} - mi := &file_org_signal_chat_calling_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCallingRelaysRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCallingRelaysRequest) ProtoMessage() {} - -func (x *GetCallingRelaysRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_calling_proto_msgTypes[0] - 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 GetCallingRelaysRequest.ProtoReflect.Descriptor instead. -func (*GetCallingRelaysRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_calling_proto_rawDescGZIP(), []int{0} -} - -type GetCallingRelaysResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A collection of calling relays a client may use for one-on-one calls. - Relays []*GetCallingRelaysResponse_Relay `protobuf:"bytes,1,rep,name=relays,proto3" json:"relays,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCallingRelaysResponse) Reset() { - *x = GetCallingRelaysResponse{} - mi := &file_org_signal_chat_calling_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCallingRelaysResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCallingRelaysResponse) ProtoMessage() {} - -func (x *GetCallingRelaysResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_calling_proto_msgTypes[1] - 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 GetCallingRelaysResponse.ProtoReflect.Descriptor instead. -func (*GetCallingRelaysResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_calling_proto_rawDescGZIP(), []int{1} -} - -func (x *GetCallingRelaysResponse) GetRelays() []*GetCallingRelaysResponse_Relay { - if x != nil { - return x.Relays - } - return nil -} - -type GetCallingRelaysResponse_HostnameUrlList struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A collection of hostname-based TURN, TURNS, or STUN URLs a client can use - // to connect to a relay. - Urls []string `protobuf:"bytes,1,rep,name=urls,proto3" json:"urls,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCallingRelaysResponse_HostnameUrlList) Reset() { - *x = GetCallingRelaysResponse_HostnameUrlList{} - mi := &file_org_signal_chat_calling_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCallingRelaysResponse_HostnameUrlList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCallingRelaysResponse_HostnameUrlList) ProtoMessage() {} - -func (x *GetCallingRelaysResponse_HostnameUrlList) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_calling_proto_msgTypes[2] - 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 GetCallingRelaysResponse_HostnameUrlList.ProtoReflect.Descriptor instead. -func (*GetCallingRelaysResponse_HostnameUrlList) Descriptor() ([]byte, []int) { - return file_org_signal_chat_calling_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *GetCallingRelaysResponse_HostnameUrlList) GetUrls() []string { - if x != nil { - return x.Urls - } - return nil -} - -type GetCallingRelaysResponse_IpUrlList struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A collection of IP-based TURN, TURNS, or STUN URLs a client can use to - // connect to a relay. - Urls []string `protobuf:"bytes,1,rep,name=urls,proto3" json:"urls,omitempty"` - // A hostname clients must use to validate the relay's TLS certificate when - // connecting via an IP-based TURNS URL. May not be specified if `urls` - // contains no TURNS URLs. - Hostname *string `protobuf:"bytes,2,opt,name=hostname,proto3,oneof" json:"hostname,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCallingRelaysResponse_IpUrlList) Reset() { - *x = GetCallingRelaysResponse_IpUrlList{} - mi := &file_org_signal_chat_calling_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCallingRelaysResponse_IpUrlList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCallingRelaysResponse_IpUrlList) ProtoMessage() {} - -func (x *GetCallingRelaysResponse_IpUrlList) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_calling_proto_msgTypes[3] - 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 GetCallingRelaysResponse_IpUrlList.ProtoReflect.Descriptor instead. -func (*GetCallingRelaysResponse_IpUrlList) Descriptor() ([]byte, []int) { - return file_org_signal_chat_calling_proto_rawDescGZIP(), []int{1, 1} -} - -func (x *GetCallingRelaysResponse_IpUrlList) GetUrls() []string { - if x != nil { - return x.Urls - } - return nil -} - -func (x *GetCallingRelaysResponse_IpUrlList) GetHostname() string { - if x != nil && x.Hostname != nil { - return *x.Hostname - } - return "" -} - -type GetCallingRelaysResponse_Relay struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A username that can be presented to authenticate with a TURN server. - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - // A password that can be presented to authenticate with a TURN server. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - // The duration, in seconds, after which the included username and password - // will no longer be valid. - CredentialTtlSeconds uint64 `protobuf:"varint,3,opt,name=credential_ttl_seconds,json=credentialTtlSeconds,proto3" json:"credential_ttl_seconds,omitempty"` - // A collection of hostname-based URLs clients may use to connect to this - // relay. - HostnameUrls *GetCallingRelaysResponse_HostnameUrlList `protobuf:"bytes,4,opt,name=hostname_urls,json=hostnameUrls,proto3,oneof" json:"hostname_urls,omitempty"` - // A collection of IP-based URLs clients may use to connect to this relay. - IpUrls *GetCallingRelaysResponse_IpUrlList `protobuf:"bytes,5,opt,name=ip_urls,json=ipUrls,proto3,oneof" json:"ip_urls,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCallingRelaysResponse_Relay) Reset() { - *x = GetCallingRelaysResponse_Relay{} - mi := &file_org_signal_chat_calling_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCallingRelaysResponse_Relay) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCallingRelaysResponse_Relay) ProtoMessage() {} - -func (x *GetCallingRelaysResponse_Relay) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_calling_proto_msgTypes[4] - 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 GetCallingRelaysResponse_Relay.ProtoReflect.Descriptor instead. -func (*GetCallingRelaysResponse_Relay) Descriptor() ([]byte, []int) { - return file_org_signal_chat_calling_proto_rawDescGZIP(), []int{1, 2} -} - -func (x *GetCallingRelaysResponse_Relay) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *GetCallingRelaysResponse_Relay) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *GetCallingRelaysResponse_Relay) GetCredentialTtlSeconds() uint64 { - if x != nil { - return x.CredentialTtlSeconds - } - return 0 -} - -func (x *GetCallingRelaysResponse_Relay) GetHostnameUrls() *GetCallingRelaysResponse_HostnameUrlList { - if x != nil { - return x.HostnameUrls - } - return nil -} - -func (x *GetCallingRelaysResponse_Relay) GetIpUrls() *GetCallingRelaysResponse_IpUrlList { - if x != nil { - return x.IpUrls - } - return nil -} - -var File_org_signal_chat_calling_proto protoreflect.FileDescriptor - -const file_org_signal_chat_calling_proto_rawDesc = "" + - "\n" + - "\x1dorg/signal/chat/calling.proto\x12\x17org.signal.chat.calling\x1a\x1dorg/signal/chat/require.proto\"\x19\n" + - "\x17GetCallingRelaysRequest\"\xbf\x04\n" + - "\x18GetCallingRelaysResponse\x12O\n" + - "\x06relays\x18\x01 \x03(\v27.org.signal.chat.calling.GetCallingRelaysResponse.RelayR\x06relays\x1a%\n" + - "\x0fHostnameUrlList\x12\x12\n" + - "\x04urls\x18\x01 \x03(\tR\x04urls\x1aM\n" + - "\tIpUrlList\x12\x12\n" + - "\x04urls\x18\x01 \x03(\tR\x04urls\x12\x1f\n" + - "\bhostname\x18\x02 \x01(\tH\x00R\bhostname\x88\x01\x01B\v\n" + - "\t_hostname\x1a\xdb\x02\n" + - "\x05Relay\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x124\n" + - "\x16credential_ttl_seconds\x18\x03 \x01(\x04R\x14credentialTtlSeconds\x12k\n" + - "\rhostname_urls\x18\x04 \x01(\v2A.org.signal.chat.calling.GetCallingRelaysResponse.HostnameUrlListH\x00R\fhostnameUrls\x88\x01\x01\x12Y\n" + - "\aip_urls\x18\x05 \x01(\v2;.org.signal.chat.calling.GetCallingRelaysResponse.IpUrlListH\x01R\x06ipUrls\x88\x01\x01B\x10\n" + - "\x0e_hostname_urlsB\n" + - "\n" + - "\b_ip_urls2\x8a\x01\n" + - "\aCalling\x12y\n" + - "\x10GetCallingRelays\x120.org.signal.chat.calling.GetCallingRelaysRequest\x1a1.org.signal.chat.calling.GetCallingRelaysResponse\"\x00\x1a\x04\xc8\xd5\"\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_calling_proto_rawDescOnce sync.Once - file_org_signal_chat_calling_proto_rawDescData []byte -) - -func file_org_signal_chat_calling_proto_rawDescGZIP() []byte { - file_org_signal_chat_calling_proto_rawDescOnce.Do(func() { - file_org_signal_chat_calling_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_calling_proto_rawDesc), len(file_org_signal_chat_calling_proto_rawDesc))) - }) - return file_org_signal_chat_calling_proto_rawDescData -} - -var file_org_signal_chat_calling_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_org_signal_chat_calling_proto_goTypes = []any{ - (*GetCallingRelaysRequest)(nil), // 0: org.signal.chat.calling.GetCallingRelaysRequest - (*GetCallingRelaysResponse)(nil), // 1: org.signal.chat.calling.GetCallingRelaysResponse - (*GetCallingRelaysResponse_HostnameUrlList)(nil), // 2: org.signal.chat.calling.GetCallingRelaysResponse.HostnameUrlList - (*GetCallingRelaysResponse_IpUrlList)(nil), // 3: org.signal.chat.calling.GetCallingRelaysResponse.IpUrlList - (*GetCallingRelaysResponse_Relay)(nil), // 4: org.signal.chat.calling.GetCallingRelaysResponse.Relay -} -var file_org_signal_chat_calling_proto_depIdxs = []int32{ - 4, // 0: org.signal.chat.calling.GetCallingRelaysResponse.relays:type_name -> org.signal.chat.calling.GetCallingRelaysResponse.Relay - 2, // 1: org.signal.chat.calling.GetCallingRelaysResponse.Relay.hostname_urls:type_name -> org.signal.chat.calling.GetCallingRelaysResponse.HostnameUrlList - 3, // 2: org.signal.chat.calling.GetCallingRelaysResponse.Relay.ip_urls:type_name -> org.signal.chat.calling.GetCallingRelaysResponse.IpUrlList - 0, // 3: org.signal.chat.calling.Calling.GetCallingRelays:input_type -> org.signal.chat.calling.GetCallingRelaysRequest - 1, // 4: org.signal.chat.calling.Calling.GetCallingRelays:output_type -> org.signal.chat.calling.GetCallingRelaysResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_calling_proto_init() } -func file_org_signal_chat_calling_proto_init() { - if File_org_signal_chat_calling_proto != nil { - return - } - file_org_signal_chat_calling_proto_msgTypes[3].OneofWrappers = []any{} - file_org_signal_chat_calling_proto_msgTypes[4].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_calling_proto_rawDesc), len(file_org_signal_chat_calling_proto_rawDesc)), - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_calling_proto_goTypes, - DependencyIndexes: file_org_signal_chat_calling_proto_depIdxs, - MessageInfos: file_org_signal_chat_calling_proto_msgTypes, - }.Build() - File_org_signal_chat_calling_proto = out.File - file_org_signal_chat_calling_proto_goTypes = nil - file_org_signal_chat_calling_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/calling/calling_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/calling/calling_grpc.pb.go deleted file mode 100644 index 87ec6d7..0000000 --- a/pkg/signalmeow/protobuf/rpc/calling/calling_grpc.pb.go +++ /dev/null @@ -1,133 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/calling.proto - -package calling - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Calling_GetCallingRelays_FullMethodName = "/org.signal.chat.calling.Calling/GetCallingRelays" -) - -// CallingClient is the client API for Calling service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for getting credentials and relay options for one-on-one -// calls. -type CallingClient interface { - // Retrieves TURN credentials and relay options for one-on-one calls. - GetCallingRelays(ctx context.Context, in *GetCallingRelaysRequest, opts ...grpc.CallOption) (*GetCallingRelaysResponse, error) -} - -type callingClient struct { - cc grpc.ClientConnInterface -} - -func NewCallingClient(cc grpc.ClientConnInterface) CallingClient { - return &callingClient{cc} -} - -func (c *callingClient) GetCallingRelays(ctx context.Context, in *GetCallingRelaysRequest, opts ...grpc.CallOption) (*GetCallingRelaysResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetCallingRelaysResponse) - err := c.cc.Invoke(ctx, Calling_GetCallingRelays_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CallingServer is the server API for Calling service. -// All implementations must embed UnimplementedCallingServer -// for forward compatibility. -// -// Provides methods for getting credentials and relay options for one-on-one -// calls. -type CallingServer interface { - // Retrieves TURN credentials and relay options for one-on-one calls. - GetCallingRelays(context.Context, *GetCallingRelaysRequest) (*GetCallingRelaysResponse, error) - mustEmbedUnimplementedCallingServer() -} - -// UnimplementedCallingServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedCallingServer struct{} - -func (UnimplementedCallingServer) GetCallingRelays(context.Context, *GetCallingRelaysRequest) (*GetCallingRelaysResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetCallingRelays not implemented") -} -func (UnimplementedCallingServer) mustEmbedUnimplementedCallingServer() {} -func (UnimplementedCallingServer) testEmbeddedByValue() {} - -// UnsafeCallingServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CallingServer will -// result in compilation errors. -type UnsafeCallingServer interface { - mustEmbedUnimplementedCallingServer() -} - -func RegisterCallingServer(s grpc.ServiceRegistrar, srv CallingServer) { - // If the following call panics, it indicates UnimplementedCallingServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Calling_ServiceDesc, srv) -} - -func _Calling_GetCallingRelays_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCallingRelaysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CallingServer).GetCallingRelays(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Calling_GetCallingRelays_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CallingServer).GetCallingRelays(ctx, req.(*GetCallingRelaysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Calling_ServiceDesc is the grpc.ServiceDesc for Calling service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Calling_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.calling.Calling", - HandlerType: (*CallingServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetCallingRelays", - Handler: _Calling_GetCallingRelays_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/calling.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/challenge/challenge.pb.go b/pkg/signalmeow/protobuf/rpc/challenge/challenge.pb.go deleted file mode 100644 index 3643365..0000000 --- a/pkg/signalmeow/protobuf/rpc/challenge/challenge.pb.go +++ /dev/null @@ -1,333 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/challenge.proto - -package challenge - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type AnswerChallengeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The opaque token id from the ChallengeRequired response returned by the - // server endpoint that requested the challenge - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - // Types that are valid to be assigned to Request: - // - // *AnswerChallengeRequest_Push - // *AnswerChallengeRequest_Captcha - Request isAnswerChallengeRequest_Request `protobuf_oneof:"request"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AnswerChallengeRequest) Reset() { - *x = AnswerChallengeRequest{} - mi := &file_org_signal_chat_challenge_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AnswerChallengeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnswerChallengeRequest) ProtoMessage() {} - -func (x *AnswerChallengeRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_challenge_proto_msgTypes[0] - 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 AnswerChallengeRequest.ProtoReflect.Descriptor instead. -func (*AnswerChallengeRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_challenge_proto_rawDescGZIP(), []int{0} -} - -func (x *AnswerChallengeRequest) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *AnswerChallengeRequest) GetRequest() isAnswerChallengeRequest_Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *AnswerChallengeRequest) GetPush() *AnswerChallengeRequest_AnswerPushChallengeRequest { - if x != nil { - if x, ok := x.Request.(*AnswerChallengeRequest_Push); ok { - return x.Push - } - } - return nil -} - -func (x *AnswerChallengeRequest) GetCaptcha() *AnswerChallengeRequest_AnswerCaptchaChallengeRequest { - if x != nil { - if x, ok := x.Request.(*AnswerChallengeRequest_Captcha); ok { - return x.Captcha - } - } - return nil -} - -type isAnswerChallengeRequest_Request interface { - isAnswerChallengeRequest_Request() -} - -type AnswerChallengeRequest_Push struct { - Push *AnswerChallengeRequest_AnswerPushChallengeRequest `protobuf:"bytes,2,opt,name=push,proto3,oneof"` -} - -type AnswerChallengeRequest_Captcha struct { - Captcha *AnswerChallengeRequest_AnswerCaptchaChallengeRequest `protobuf:"bytes,3,opt,name=captcha,proto3,oneof"` -} - -func (*AnswerChallengeRequest_Push) isAnswerChallengeRequest_Request() {} - -func (*AnswerChallengeRequest_Captcha) isAnswerChallengeRequest_Request() {} - -type AnswerChallengeResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Whether the challenge proof was accepted - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AnswerChallengeResponse) Reset() { - *x = AnswerChallengeResponse{} - mi := &file_org_signal_chat_challenge_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AnswerChallengeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnswerChallengeResponse) ProtoMessage() {} - -func (x *AnswerChallengeResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_challenge_proto_msgTypes[1] - 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 AnswerChallengeResponse.ProtoReflect.Descriptor instead. -func (*AnswerChallengeResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_challenge_proto_rawDescGZIP(), []int{1} -} - -func (x *AnswerChallengeResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -type AnswerChallengeRequest_AnswerPushChallengeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The challenge string provided to the client via a push payload - Challenge string `protobuf:"bytes,1,opt,name=challenge,proto3" json:"challenge,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AnswerChallengeRequest_AnswerPushChallengeRequest) Reset() { - *x = AnswerChallengeRequest_AnswerPushChallengeRequest{} - mi := &file_org_signal_chat_challenge_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AnswerChallengeRequest_AnswerPushChallengeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnswerChallengeRequest_AnswerPushChallengeRequest) ProtoMessage() {} - -func (x *AnswerChallengeRequest_AnswerPushChallengeRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_challenge_proto_msgTypes[2] - 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 AnswerChallengeRequest_AnswerPushChallengeRequest.ProtoReflect.Descriptor instead. -func (*AnswerChallengeRequest_AnswerPushChallengeRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_challenge_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *AnswerChallengeRequest_AnswerPushChallengeRequest) GetChallenge() string { - if x != nil { - return x.Challenge - } - return "" -} - -type AnswerChallengeRequest_AnswerCaptchaChallengeRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A string representing a solved captcha - // Example: signal-hcaptcha.30b01b46-d8c9-4c30-bbd7-9719acfe0c10.challenge.abcdefg1345 - Captcha string `protobuf:"bytes,1,opt,name=captcha,proto3" json:"captcha,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AnswerChallengeRequest_AnswerCaptchaChallengeRequest) Reset() { - *x = AnswerChallengeRequest_AnswerCaptchaChallengeRequest{} - mi := &file_org_signal_chat_challenge_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AnswerChallengeRequest_AnswerCaptchaChallengeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AnswerChallengeRequest_AnswerCaptchaChallengeRequest) ProtoMessage() {} - -func (x *AnswerChallengeRequest_AnswerCaptchaChallengeRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_challenge_proto_msgTypes[3] - 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 AnswerChallengeRequest_AnswerCaptchaChallengeRequest.ProtoReflect.Descriptor instead. -func (*AnswerChallengeRequest_AnswerCaptchaChallengeRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_challenge_proto_rawDescGZIP(), []int{0, 1} -} - -func (x *AnswerChallengeRequest_AnswerCaptchaChallengeRequest) GetCaptcha() string { - if x != nil { - return x.Captcha - } - return "" -} - -var File_org_signal_chat_challenge_proto protoreflect.FileDescriptor - -const file_org_signal_chat_challenge_proto_rawDesc = "" + - "\n" + - "\x1forg/signal/chat/challenge.proto\x12\x19org.signal.chat.challenge\x1a\x1dorg/signal/chat/require.proto\"\x93\x03\n" + - "\x16AnswerChallengeRequest\x12\x1a\n" + - "\x05token\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\x05token\x12b\n" + - "\x04push\x18\x02 \x01(\v2L.org.signal.chat.challenge.AnswerChallengeRequest.AnswerPushChallengeRequestH\x00R\x04push\x12k\n" + - "\acaptcha\x18\x03 \x01(\v2O.org.signal.chat.challenge.AnswerChallengeRequest.AnswerCaptchaChallengeRequestH\x00R\acaptcha\x1a@\n" + - "\x1aAnswerPushChallengeRequest\x12\"\n" + - "\tchallenge\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\tchallenge\x1a?\n" + - "\x1dAnswerCaptchaChallengeRequest\x12\x1e\n" + - "\acaptcha\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\acaptchaB\t\n" + - "\arequest\"3\n" + - "\x17AnswerChallengeResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess2\x96\x01\n" + - "\tChallenge\x12\x82\x01\n" + - "\x17HandleChallengeResponse\x121.org.signal.chat.challenge.AnswerChallengeRequest\x1a2.org.signal.chat.challenge.AnswerChallengeResponse\"\x00\x1a\x04\xc8\xd5\"\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_challenge_proto_rawDescOnce sync.Once - file_org_signal_chat_challenge_proto_rawDescData []byte -) - -func file_org_signal_chat_challenge_proto_rawDescGZIP() []byte { - file_org_signal_chat_challenge_proto_rawDescOnce.Do(func() { - file_org_signal_chat_challenge_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_challenge_proto_rawDesc), len(file_org_signal_chat_challenge_proto_rawDesc))) - }) - return file_org_signal_chat_challenge_proto_rawDescData -} - -var file_org_signal_chat_challenge_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_org_signal_chat_challenge_proto_goTypes = []any{ - (*AnswerChallengeRequest)(nil), // 0: org.signal.chat.challenge.AnswerChallengeRequest - (*AnswerChallengeResponse)(nil), // 1: org.signal.chat.challenge.AnswerChallengeResponse - (*AnswerChallengeRequest_AnswerPushChallengeRequest)(nil), // 2: org.signal.chat.challenge.AnswerChallengeRequest.AnswerPushChallengeRequest - (*AnswerChallengeRequest_AnswerCaptchaChallengeRequest)(nil), // 3: org.signal.chat.challenge.AnswerChallengeRequest.AnswerCaptchaChallengeRequest -} -var file_org_signal_chat_challenge_proto_depIdxs = []int32{ - 2, // 0: org.signal.chat.challenge.AnswerChallengeRequest.push:type_name -> org.signal.chat.challenge.AnswerChallengeRequest.AnswerPushChallengeRequest - 3, // 1: org.signal.chat.challenge.AnswerChallengeRequest.captcha:type_name -> org.signal.chat.challenge.AnswerChallengeRequest.AnswerCaptchaChallengeRequest - 0, // 2: org.signal.chat.challenge.Challenge.HandleChallengeResponse:input_type -> org.signal.chat.challenge.AnswerChallengeRequest - 1, // 3: org.signal.chat.challenge.Challenge.HandleChallengeResponse:output_type -> org.signal.chat.challenge.AnswerChallengeResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_challenge_proto_init() } -func file_org_signal_chat_challenge_proto_init() { - if File_org_signal_chat_challenge_proto != nil { - return - } - file_org_signal_chat_challenge_proto_msgTypes[0].OneofWrappers = []any{ - (*AnswerChallengeRequest_Push)(nil), - (*AnswerChallengeRequest_Captcha)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_challenge_proto_rawDesc), len(file_org_signal_chat_challenge_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_challenge_proto_goTypes, - DependencyIndexes: file_org_signal_chat_challenge_proto_depIdxs, - MessageInfos: file_org_signal_chat_challenge_proto_msgTypes, - }.Build() - File_org_signal_chat_challenge_proto = out.File - file_org_signal_chat_challenge_proto_goTypes = nil - file_org_signal_chat_challenge_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/challenge/challenge_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/challenge/challenge_grpc.pb.go deleted file mode 100644 index e242637..0000000 --- a/pkg/signalmeow/protobuf/rpc/challenge/challenge_grpc.pb.go +++ /dev/null @@ -1,133 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/challenge.proto - -package challenge - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Challenge_HandleChallengeResponse_FullMethodName = "/org.signal.chat.challenge.Challenge/HandleChallengeResponse" -) - -// ChallengeClient is the client API for Challenge service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type ChallengeClient interface { - // Some server endpoints (the "send message" endpoint, for example) may return - // a response indicating the client must complete a challenge before continuing. - // Clients may use this endpoint to provide proof of a completed challenge. - // If successful, the client may then continue their original operation. - HandleChallengeResponse(ctx context.Context, in *AnswerChallengeRequest, opts ...grpc.CallOption) (*AnswerChallengeResponse, error) -} - -type challengeClient struct { - cc grpc.ClientConnInterface -} - -func NewChallengeClient(cc grpc.ClientConnInterface) ChallengeClient { - return &challengeClient{cc} -} - -func (c *challengeClient) HandleChallengeResponse(ctx context.Context, in *AnswerChallengeRequest, opts ...grpc.CallOption) (*AnswerChallengeResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AnswerChallengeResponse) - err := c.cc.Invoke(ctx, Challenge_HandleChallengeResponse_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ChallengeServer is the server API for Challenge service. -// All implementations must embed UnimplementedChallengeServer -// for forward compatibility. -type ChallengeServer interface { - // Some server endpoints (the "send message" endpoint, for example) may return - // a response indicating the client must complete a challenge before continuing. - // Clients may use this endpoint to provide proof of a completed challenge. - // If successful, the client may then continue their original operation. - HandleChallengeResponse(context.Context, *AnswerChallengeRequest) (*AnswerChallengeResponse, error) - mustEmbedUnimplementedChallengeServer() -} - -// UnimplementedChallengeServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedChallengeServer struct{} - -func (UnimplementedChallengeServer) HandleChallengeResponse(context.Context, *AnswerChallengeRequest) (*AnswerChallengeResponse, error) { - return nil, status.Error(codes.Unimplemented, "method HandleChallengeResponse not implemented") -} -func (UnimplementedChallengeServer) mustEmbedUnimplementedChallengeServer() {} -func (UnimplementedChallengeServer) testEmbeddedByValue() {} - -// UnsafeChallengeServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ChallengeServer will -// result in compilation errors. -type UnsafeChallengeServer interface { - mustEmbedUnimplementedChallengeServer() -} - -func RegisterChallengeServer(s grpc.ServiceRegistrar, srv ChallengeServer) { - // If the following call panics, it indicates UnimplementedChallengeServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Challenge_ServiceDesc, srv) -} - -func _Challenge_HandleChallengeResponse_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AnswerChallengeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ChallengeServer).HandleChallengeResponse(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Challenge_HandleChallengeResponse_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ChallengeServer).HandleChallengeResponse(ctx, req.(*AnswerChallengeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Challenge_ServiceDesc is the grpc.ServiceDesc for Challenge service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Challenge_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.challenge.Challenge", - HandlerType: (*ChallengeServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "HandleChallengeResponse", - Handler: _Challenge_HandleChallengeResponse_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/challenge.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/common/common.pb.go b/pkg/signalmeow/protobuf/rpc/common/common.pb.go deleted file mode 100644 index 551d115..0000000 --- a/pkg/signalmeow/protobuf/rpc/common/common.pb.go +++ /dev/null @@ -1,986 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/common.proto - -package common - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type IdentityType int32 - -const ( - IdentityType_IDENTITY_TYPE_UNSPECIFIED IdentityType = 0 - IdentityType_IDENTITY_TYPE_ACI IdentityType = 1 - IdentityType_IDENTITY_TYPE_PNI IdentityType = 2 -) - -// Enum value maps for IdentityType. -var ( - IdentityType_name = map[int32]string{ - 0: "IDENTITY_TYPE_UNSPECIFIED", - 1: "IDENTITY_TYPE_ACI", - 2: "IDENTITY_TYPE_PNI", - } - IdentityType_value = map[string]int32{ - "IDENTITY_TYPE_UNSPECIFIED": 0, - "IDENTITY_TYPE_ACI": 1, - "IDENTITY_TYPE_PNI": 2, - } -) - -func (x IdentityType) Enum() *IdentityType { - p := new(IdentityType) - *p = x - return p -} - -func (x IdentityType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IdentityType) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_common_proto_enumTypes[0].Descriptor() -} - -func (IdentityType) Type() protoreflect.EnumType { - return &file_org_signal_chat_common_proto_enumTypes[0] -} - -func (x IdentityType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IdentityType.Descriptor instead. -func (IdentityType) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{0} -} - -type DeviceCapability int32 - -const ( - DeviceCapability_DEVICE_CAPABILITY_UNSPECIFIED DeviceCapability = 0 - DeviceCapability_DEVICE_CAPABILITY_STORAGE DeviceCapability = 1 - DeviceCapability_DEVICE_CAPABILITY_TRANSFER DeviceCapability = 2 - DeviceCapability_DEVICE_CAPABILITY_ATTACHMENT_BACKFILL DeviceCapability = 6 - DeviceCapability_DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET DeviceCapability = 7 - DeviceCapability_DEVICE_CAPABILITY_PROFILES_V2 DeviceCapability = 8 - DeviceCapability_DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE DeviceCapability = 9 - DeviceCapability_DEVICE_CAPABILITY_OPTIONAL_PHONE_NUMBER DeviceCapability = 10 -) - -// Enum value maps for DeviceCapability. -var ( - DeviceCapability_name = map[int32]string{ - 0: "DEVICE_CAPABILITY_UNSPECIFIED", - 1: "DEVICE_CAPABILITY_STORAGE", - 2: "DEVICE_CAPABILITY_TRANSFER", - 6: "DEVICE_CAPABILITY_ATTACHMENT_BACKFILL", - 7: "DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET", - 8: "DEVICE_CAPABILITY_PROFILES_V2", - 9: "DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE", - 10: "DEVICE_CAPABILITY_OPTIONAL_PHONE_NUMBER", - } - DeviceCapability_value = map[string]int32{ - "DEVICE_CAPABILITY_UNSPECIFIED": 0, - "DEVICE_CAPABILITY_STORAGE": 1, - "DEVICE_CAPABILITY_TRANSFER": 2, - "DEVICE_CAPABILITY_ATTACHMENT_BACKFILL": 6, - "DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET": 7, - "DEVICE_CAPABILITY_PROFILES_V2": 8, - "DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE": 9, - "DEVICE_CAPABILITY_OPTIONAL_PHONE_NUMBER": 10, - } -) - -func (x DeviceCapability) Enum() *DeviceCapability { - p := new(DeviceCapability) - *p = x - return p -} - -func (x DeviceCapability) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DeviceCapability) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_common_proto_enumTypes[1].Descriptor() -} - -func (DeviceCapability) Type() protoreflect.EnumType { - return &file_org_signal_chat_common_proto_enumTypes[1] -} - -func (x DeviceCapability) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DeviceCapability.Descriptor instead. -func (DeviceCapability) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{1} -} - -type ServiceIdentifier struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The type of identity represented by this service identifier. - IdentityType IdentityType `protobuf:"varint,1,opt,name=identity_type,json=identityType,proto3,enum=org.signal.chat.common.IdentityType" json:"identity_type,omitempty"` - // The UUID of the identity represented by this service identifier. - Uuid []byte `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ServiceIdentifier) Reset() { - *x = ServiceIdentifier{} - mi := &file_org_signal_chat_common_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ServiceIdentifier) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceIdentifier) ProtoMessage() {} - -func (x *ServiceIdentifier) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[0] - 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 ServiceIdentifier.ProtoReflect.Descriptor instead. -func (*ServiceIdentifier) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{0} -} - -func (x *ServiceIdentifier) GetIdentityType() IdentityType { - if x != nil { - return x.IdentityType - } - return IdentityType_IDENTITY_TYPE_UNSPECIFIED -} - -func (x *ServiceIdentifier) GetUuid() []byte { - if x != nil { - return x.Uuid - } - return nil -} - -// All identifiers associated with an account. -type AccountIdentifiers struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of service identifiers for the identified account. Always includes - // exactly one ACI service identifier and at most one PNI service identifier. - ServiceIdentifiers []*ServiceIdentifier `protobuf:"bytes,1,rep,name=service_identifiers,json=serviceIdentifiers,proto3" json:"service_identifiers,omitempty"` - // The phone number associated with the identified account. May be empty if - // the given account does not have a phone number. - E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` - // The username hash (if any) associated with the identified account. May be - // empty if no username is associated with the identified account. - UsernameHash []byte `protobuf:"bytes,3,opt,name=username_hash,json=usernameHash,proto3" json:"username_hash,omitempty"` - // The username link handle UUID associated with the identified account. - // May be empty if no username is associated with the identified account. - UsernameLinkHandle []byte `protobuf:"bytes,4,opt,name=username_link_handle,json=usernameLinkHandle,proto3" json:"username_link_handle,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountIdentifiers) Reset() { - *x = AccountIdentifiers{} - mi := &file_org_signal_chat_common_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountIdentifiers) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountIdentifiers) ProtoMessage() {} - -func (x *AccountIdentifiers) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[1] - 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 AccountIdentifiers.ProtoReflect.Descriptor instead. -func (*AccountIdentifiers) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{1} -} - -func (x *AccountIdentifiers) GetServiceIdentifiers() []*ServiceIdentifier { - if x != nil { - return x.ServiceIdentifiers - } - return nil -} - -func (x *AccountIdentifiers) GetE164() string { - if x != nil { - return x.E164 - } - return "" -} - -func (x *AccountIdentifiers) GetUsernameHash() []byte { - if x != nil { - return x.UsernameHash - } - return nil -} - -func (x *AccountIdentifiers) GetUsernameLinkHandle() []byte { - if x != nil { - return x.UsernameLinkHandle - } - return nil -} - -type EcPreKey struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A locally-unique identifier for this key, which will be provided by - // peers using this key to encrypt messages so the private key can be looked - // up. - KeyId int32 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - // The public key, serialized in libsignal's elliptic-curve public key format. - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EcPreKey) Reset() { - *x = EcPreKey{} - mi := &file_org_signal_chat_common_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EcPreKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EcPreKey) ProtoMessage() {} - -func (x *EcPreKey) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[2] - 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 EcPreKey.ProtoReflect.Descriptor instead. -func (*EcPreKey) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{2} -} - -func (x *EcPreKey) GetKeyId() int32 { - if x != nil { - return x.KeyId - } - return 0 -} - -func (x *EcPreKey) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -type EcSignedPreKey struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A locally-unique identifier for this key, which will be provided by - // peers using this key to encrypt messages so the private key can be looked - // up. - KeyId int32 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - // The public key, serialized in libsignal's elliptic-curve public key format. - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // A signature of the public key, verifiable with the identity key for the - // account/identity associated with this pre-key. - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EcSignedPreKey) Reset() { - *x = EcSignedPreKey{} - mi := &file_org_signal_chat_common_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EcSignedPreKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EcSignedPreKey) ProtoMessage() {} - -func (x *EcSignedPreKey) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[3] - 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 EcSignedPreKey.ProtoReflect.Descriptor instead. -func (*EcSignedPreKey) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{3} -} - -func (x *EcSignedPreKey) GetKeyId() int32 { - if x != nil { - return x.KeyId - } - return 0 -} - -func (x *EcSignedPreKey) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *EcSignedPreKey) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type KemSignedPreKey struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An locally-unique identifier for this key, which will be provided by peers - // using this key to encrypt messages so the private key can be looked up. - KeyId int32 `protobuf:"varint,1,opt,name=key_id,json=keyId,proto3" json:"key_id,omitempty"` - // The public key, serialized in libsignal's Kyber1024 public key format. - PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` - // A signature of the public key, verifiable with the identity key for the - // account/identity associated with this pre-key. - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *KemSignedPreKey) Reset() { - *x = KemSignedPreKey{} - mi := &file_org_signal_chat_common_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *KemSignedPreKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KemSignedPreKey) ProtoMessage() {} - -func (x *KemSignedPreKey) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[4] - 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 KemSignedPreKey.ProtoReflect.Descriptor instead. -func (*KemSignedPreKey) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{4} -} - -func (x *KemSignedPreKey) GetKeyId() int32 { - if x != nil { - return x.KeyId - } - return 0 -} - -func (x *KemSignedPreKey) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *KemSignedPreKey) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type ZkCredential struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Day on which this credential can be redeemed, in UTC seconds since epoch - RedemptionTime int64 `protobuf:"varint,1,opt,name=redemption_time,json=redemptionTime,proto3" json:"redemption_time,omitempty"` - // The ZK credential, using libsignal's serialization - Credential []byte `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ZkCredential) Reset() { - *x = ZkCredential{} - mi := &file_org_signal_chat_common_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ZkCredential) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ZkCredential) ProtoMessage() {} - -func (x *ZkCredential) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[5] - 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 ZkCredential.ProtoReflect.Descriptor instead. -func (*ZkCredential) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{5} -} - -func (x *ZkCredential) GetRedemptionTime() int64 { - if x != nil { - return x.RedemptionTime - } - return 0 -} - -func (x *ZkCredential) GetCredential() []byte { - if x != nil { - return x.Credential - } - return nil -} - -// An upload location and credentials which may be used to upload an object -// to an external CDN -type UploadForm struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Indicates the CDN type. 3 indicates resumable uploads using TUS - Cdn uint32 `protobuf:"varint,1,opt,name=cdn,proto3" json:"cdn,omitempty"` - // The location within the specified cdn where the finished upload can be found - Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - // A map of headers to include with all upload requests. Potentially contains - // time-limited upload credentials - Headers map[string]string `protobuf:"bytes,3,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // The URL to upload to with the appropriate protocol - SignedUploadLocation string `protobuf:"bytes,4,opt,name=signed_upload_location,json=signedUploadLocation,proto3" json:"signed_upload_location,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UploadForm) Reset() { - *x = UploadForm{} - mi := &file_org_signal_chat_common_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UploadForm) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadForm) ProtoMessage() {} - -func (x *UploadForm) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[6] - 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 UploadForm.ProtoReflect.Descriptor instead. -func (*UploadForm) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{6} -} - -func (x *UploadForm) GetCdn() uint32 { - if x != nil { - return x.Cdn - } - return 0 -} - -func (x *UploadForm) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *UploadForm) GetHeaders() map[string]string { - if x != nil { - return x.Headers - } - return nil -} - -func (x *UploadForm) GetSignedUploadLocation() string { - if x != nil { - return x.SignedUploadLocation - } - return "" -} - -// An upload location, credentials, and metadata which may be used to upload an -// object to AWS S3 -type S3UploadForm struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The S3 key (i.e. path and filename) for the uploaded file. - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // A scoped credential. Includes the AWS access key, date, region targeted, - // and AWS service. - Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"` - // The type of access control for the uploaded file. - Acl string `protobuf:"bytes,3,opt,name=acl,proto3" json:"acl,omitempty"` - // The algorithm used to calculate a signature on the S3 policy. - Algorithm string `protobuf:"bytes,4,opt,name=algorithm,proto3" json:"algorithm,omitempty"` - // The timestamp (formatted as "yyyyMMdd'T'HHmmssX") at which the S3 policy - // and signature were generated. - Date string `protobuf:"bytes,5,opt,name=date,proto3" json:"date,omitempty"` - // The S3 policy (as a base64-encoded JSON string) used to upload the file. - Policy string `protobuf:"bytes,6,opt,name=policy,proto3" json:"policy,omitempty"` - // A digital signature (formatted as a hex string) on the S3 policy. - Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *S3UploadForm) Reset() { - *x = S3UploadForm{} - mi := &file_org_signal_chat_common_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *S3UploadForm) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*S3UploadForm) ProtoMessage() {} - -func (x *S3UploadForm) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_proto_msgTypes[7] - 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 S3UploadForm.ProtoReflect.Descriptor instead. -func (*S3UploadForm) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{7} -} - -func (x *S3UploadForm) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *S3UploadForm) GetCredential() string { - if x != nil { - return x.Credential - } - return "" -} - -func (x *S3UploadForm) GetAcl() string { - if x != nil { - return x.Acl - } - return "" -} - -func (x *S3UploadForm) GetAlgorithm() string { - if x != nil { - return x.Algorithm - } - return "" -} - -func (x *S3UploadForm) GetDate() string { - if x != nil { - return x.Date - } - return "" -} - -func (x *S3UploadForm) GetPolicy() string { - if x != nil { - return x.Policy - } - return "" -} - -func (x *S3UploadForm) GetSignature() string { - if x != nil { - return x.Signature - } - return "" -} - -type BadgeSvg struct { - state protoimpl.MessageState `protogen:"open.v1"` - // File name of the scalable vector graphic for light mode. - Light string `protobuf:"bytes,1,opt,name=light,proto3" json:"light,omitempty"` - // File name of the scalable vector graphic for dark mode. - Dark string `protobuf:"bytes,2,opt,name=dark,proto3" json:"dark,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BadgeSvg) Reset() { - *x = BadgeSvg{} - mi := &file_org_signal_chat_common_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BadgeSvg) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BadgeSvg) ProtoMessage() {} - -func (x *BadgeSvg) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_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 BadgeSvg.ProtoReflect.Descriptor instead. -func (*BadgeSvg) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{8} -} - -func (x *BadgeSvg) GetLight() string { - if x != nil { - return x.Light - } - return "" -} - -func (x *BadgeSvg) GetDark() string { - if x != nil { - return x.Dark - } - return "" -} - -type Badge struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An ID that uniquely identifies the badge. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The category the badge falls in ("donor" or "other"). - Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` - // The badge name. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // The badge description. - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // Different size badge SVG files. - Sprites6 []string `protobuf:"bytes,5,rep,name=sprites6,proto3" json:"sprites6,omitempty"` - // File name of the scalable vector graphic representing this badge. - Svg string `protobuf:"bytes,6,opt,name=svg,proto3" json:"svg,omitempty"` - // Pairs of light/dark SVG files designed for display at different sizes. - Svgs []*BadgeSvg `protobuf:"bytes,7,rep,name=svgs,proto3" json:"svgs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Badge) Reset() { - *x = Badge{} - mi := &file_org_signal_chat_common_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Badge) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Badge) ProtoMessage() {} - -func (x *Badge) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_common_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 Badge.ProtoReflect.Descriptor instead. -func (*Badge) Descriptor() ([]byte, []int) { - return file_org_signal_chat_common_proto_rawDescGZIP(), []int{9} -} - -func (x *Badge) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Badge) GetCategory() string { - if x != nil { - return x.Category - } - return "" -} - -func (x *Badge) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Badge) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Badge) GetSprites6() []string { - if x != nil { - return x.Sprites6 - } - return nil -} - -func (x *Badge) GetSvg() string { - if x != nil { - return x.Svg - } - return "" -} - -func (x *Badge) GetSvgs() []*BadgeSvg { - if x != nil { - return x.Svgs - } - return nil -} - -var File_org_signal_chat_common_proto protoreflect.FileDescriptor - -const file_org_signal_chat_common_proto_rawDesc = "" + - "\n" + - "\x1corg/signal/chat/common.proto\x12\x16org.signal.chat.common\x1a\x1dorg/signal/chat/require.proto\"\x7f\n" + - "\x11ServiceIdentifier\x12O\n" + - "\ridentity_type\x18\x01 \x01(\x0e2$.org.signal.chat.common.IdentityTypeB\x04\x90\x97\"\x01R\fidentityType\x12\x19\n" + - "\x04uuid\x18\x02 \x01(\fB\x05\xa2\x97\"\x01\x10R\x04uuid\"\xf1\x01\n" + - "\x12AccountIdentifiers\x12Z\n" + - "\x13service_identifiers\x18\x01 \x03(\v2).org.signal.chat.common.ServiceIdentifierR\x12serviceIdentifiers\x12\x18\n" + - "\x04e164\x18\x02 \x01(\tB\x04\xa8\x97\"\x01R\x04e164\x12+\n" + - "\rusername_hash\x18\x03 \x01(\fB\x06\xa2\x97\"\x02\x00 R\fusernameHash\x128\n" + - "\x14username_link_handle\x18\x04 \x01(\fB\x06\xa2\x97\"\x02\x00\x10R\x12usernameLinkHandle\"N\n" + - "\bEcPreKey\x12\x1d\n" + - "\x06key_id\x18\x01 \x01(\x05B\x06\xb2\x97\"\x02\b\x00R\x05keyId\x12#\n" + - "\n" + - "public_key\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\tpublicKey\"x\n" + - "\x0eEcSignedPreKey\x12\x1d\n" + - "\x06key_id\x18\x01 \x01(\x05B\x06\xb2\x97\"\x02\b\x00R\x05keyId\x12#\n" + - "\n" + - "public_key\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\tpublicKey\x12\"\n" + - "\tsignature\x18\x03 \x01(\fB\x04\x88\x97\"\x01R\tsignature\"y\n" + - "\x0fKemSignedPreKey\x12\x1d\n" + - "\x06key_id\x18\x01 \x01(\x05B\x06\xb2\x97\"\x02\b\x00R\x05keyId\x12#\n" + - "\n" + - "public_key\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\tpublicKey\x12\"\n" + - "\tsignature\x18\x03 \x01(\fB\x04\x88\x97\"\x01R\tsignature\"]\n" + - "\fZkCredential\x12'\n" + - "\x0fredemption_time\x18\x01 \x01(\x03R\x0eredemptionTime\x12$\n" + - "\n" + - "credential\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\n" + - "credential\"\xed\x01\n" + - "\n" + - "UploadForm\x12\x10\n" + - "\x03cdn\x18\x01 \x01(\rR\x03cdn\x12\x10\n" + - "\x03key\x18\x02 \x01(\tR\x03key\x12I\n" + - "\aheaders\x18\x03 \x03(\v2/.org.signal.chat.common.UploadForm.HeadersEntryR\aheaders\x124\n" + - "\x16signed_upload_location\x18\x04 \x01(\tR\x14signedUploadLocation\x1a:\n" + - "\fHeadersEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\xba\x01\n" + - "\fS3UploadForm\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x1e\n" + - "\n" + - "credential\x18\x02 \x01(\tR\n" + - "credential\x12\x10\n" + - "\x03acl\x18\x03 \x01(\tR\x03acl\x12\x1c\n" + - "\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\"4\n" + - "\bBadgeSvg\x12\x14\n" + - "\x05light\x18\x01 \x01(\tR\x05light\x12\x12\n" + - "\x04dark\x18\x02 \x01(\tR\x04dark\"\xcd\x01\n" + - "\x05Badge\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + - "\bcategory\x18\x02 \x01(\tR\bcategory\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x1a\n" + - "\bsprites6\x18\x05 \x03(\tR\bsprites6\x12\x10\n" + - "\x03svg\x18\x06 \x01(\tR\x03svg\x124\n" + - "\x04svgs\x18\a \x03(\v2 .org.signal.chat.common.BadgeSvgR\x04svgs*[\n" + - "\fIdentityType\x12\x1d\n" + - "\x19IDENTITY_TYPE_UNSPECIFIED\x10\x00\x12\x15\n" + - "\x11IDENTITY_TYPE_ACI\x10\x01\x12\x15\n" + - "\x11IDENTITY_TYPE_PNI\x10\x02*\xe8\x02\n" + - "\x10DeviceCapability\x12!\n" + - "\x1dDEVICE_CAPABILITY_UNSPECIFIED\x10\x00\x12\x1d\n" + - "\x19DEVICE_CAPABILITY_STORAGE\x10\x01\x12\x1e\n" + - "\x1aDEVICE_CAPABILITY_TRANSFER\x10\x02\x12)\n" + - "%DEVICE_CAPABILITY_ATTACHMENT_BACKFILL\x10\x06\x121\n" + - "-DEVICE_CAPABILITY_SPARSE_POST_QUANTUM_RATCHET\x10\a\x12!\n" + - "\x1dDEVICE_CAPABILITY_PROFILES_V2\x10\b\x122\n" + - ".DEVICE_CAPABILITY_USERNAME_CHANGE_SYNC_MESSAGE\x10\t\x12+\n" + - "'DEVICE_CAPABILITY_OPTIONAL_PHONE_NUMBER\x10\n" + - "\"\x04\b\x03\x10\x03\"\x04\b\x04\x10\x04\"\x04\b\x05\x10\x05B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_common_proto_rawDescOnce sync.Once - file_org_signal_chat_common_proto_rawDescData []byte -) - -func file_org_signal_chat_common_proto_rawDescGZIP() []byte { - file_org_signal_chat_common_proto_rawDescOnce.Do(func() { - file_org_signal_chat_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_common_proto_rawDesc), len(file_org_signal_chat_common_proto_rawDesc))) - }) - return file_org_signal_chat_common_proto_rawDescData -} - -var file_org_signal_chat_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_org_signal_chat_common_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_org_signal_chat_common_proto_goTypes = []any{ - (IdentityType)(0), // 0: org.signal.chat.common.IdentityType - (DeviceCapability)(0), // 1: org.signal.chat.common.DeviceCapability - (*ServiceIdentifier)(nil), // 2: org.signal.chat.common.ServiceIdentifier - (*AccountIdentifiers)(nil), // 3: org.signal.chat.common.AccountIdentifiers - (*EcPreKey)(nil), // 4: org.signal.chat.common.EcPreKey - (*EcSignedPreKey)(nil), // 5: org.signal.chat.common.EcSignedPreKey - (*KemSignedPreKey)(nil), // 6: org.signal.chat.common.KemSignedPreKey - (*ZkCredential)(nil), // 7: org.signal.chat.common.ZkCredential - (*UploadForm)(nil), // 8: org.signal.chat.common.UploadForm - (*S3UploadForm)(nil), // 9: org.signal.chat.common.S3UploadForm - (*BadgeSvg)(nil), // 10: org.signal.chat.common.BadgeSvg - (*Badge)(nil), // 11: org.signal.chat.common.Badge - nil, // 12: org.signal.chat.common.UploadForm.HeadersEntry -} -var file_org_signal_chat_common_proto_depIdxs = []int32{ - 0, // 0: org.signal.chat.common.ServiceIdentifier.identity_type:type_name -> org.signal.chat.common.IdentityType - 2, // 1: org.signal.chat.common.AccountIdentifiers.service_identifiers:type_name -> org.signal.chat.common.ServiceIdentifier - 12, // 2: org.signal.chat.common.UploadForm.headers:type_name -> org.signal.chat.common.UploadForm.HeadersEntry - 10, // 3: org.signal.chat.common.Badge.svgs:type_name -> org.signal.chat.common.BadgeSvg - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_common_proto_init() } -func file_org_signal_chat_common_proto_init() { - if File_org_signal_chat_common_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_common_proto_rawDesc), len(file_org_signal_chat_common_proto_rawDesc)), - NumEnums: 2, - NumMessages: 11, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_org_signal_chat_common_proto_goTypes, - DependencyIndexes: file_org_signal_chat_common_proto_depIdxs, - EnumInfos: file_org_signal_chat_common_proto_enumTypes, - MessageInfos: file_org_signal_chat_common_proto_msgTypes, - }.Build() - File_org_signal_chat_common_proto = out.File - file_org_signal_chat_common_proto_goTypes = nil - file_org_signal_chat_common_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/credentials/credentials.pb.go b/pkg/signalmeow/protobuf/rpc/credentials/credentials.pb.go deleted file mode 100644 index 569347f..0000000 --- a/pkg/signalmeow/protobuf/rpc/credentials/credentials.pb.go +++ /dev/null @@ -1,855 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/credentials.proto - -package credentials - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ExternalServiceType int32 - -const ( - ExternalServiceType_EXTERNAL_SERVICE_TYPE_UNSPECIFIED ExternalServiceType = 0 - ExternalServiceType_EXTERNAL_SERVICE_TYPE_DIRECTORY ExternalServiceType = 1 - ExternalServiceType_EXTERNAL_SERVICE_TYPE_PAYMENTS ExternalServiceType = 2 - ExternalServiceType_EXTERNAL_SERVICE_TYPE_STORAGE ExternalServiceType = 3 - ExternalServiceType_EXTERNAL_SERVICE_TYPE_SVR ExternalServiceType = 4 -) - -// Enum value maps for ExternalServiceType. -var ( - ExternalServiceType_name = map[int32]string{ - 0: "EXTERNAL_SERVICE_TYPE_UNSPECIFIED", - 1: "EXTERNAL_SERVICE_TYPE_DIRECTORY", - 2: "EXTERNAL_SERVICE_TYPE_PAYMENTS", - 3: "EXTERNAL_SERVICE_TYPE_STORAGE", - 4: "EXTERNAL_SERVICE_TYPE_SVR", - } - ExternalServiceType_value = map[string]int32{ - "EXTERNAL_SERVICE_TYPE_UNSPECIFIED": 0, - "EXTERNAL_SERVICE_TYPE_DIRECTORY": 1, - "EXTERNAL_SERVICE_TYPE_PAYMENTS": 2, - "EXTERNAL_SERVICE_TYPE_STORAGE": 3, - "EXTERNAL_SERVICE_TYPE_SVR": 4, - } -) - -func (x ExternalServiceType) Enum() *ExternalServiceType { - p := new(ExternalServiceType) - *p = x - return p -} - -func (x ExternalServiceType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ExternalServiceType) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_credentials_proto_enumTypes[0].Descriptor() -} - -func (ExternalServiceType) Type() protoreflect.EnumType { - return &file_org_signal_chat_credentials_proto_enumTypes[0] -} - -func (x ExternalServiceType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ExternalServiceType.Descriptor instead. -func (ExternalServiceType) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{0} -} - -type AuthCheckResult int32 - -const ( - AuthCheckResult_AUTH_CHECK_RESULT_UNSPECIFIED AuthCheckResult = 0 - // The credentials could be used to make a call to SVR service by the user - // associated with the `CheckSvrCredentialsRequest.number` phone number. - AuthCheckResult_AUTH_CHECK_RESULT_MATCH AuthCheckResult = 1 - // The credentials were generated by a different user. - AuthCheckResult_AUTH_CHECK_RESULT_NO_MATCH AuthCheckResult = 2 - // This status indicates that the corresponding credentials token should no longer be used. - // This may be because it has expired or invalid, but it can also mean that there is a more - // recent token in the request which should be used instead. - AuthCheckResult_AUTH_CHECK_RESULT_INVALID AuthCheckResult = 3 -) - -// Enum value maps for AuthCheckResult. -var ( - AuthCheckResult_name = map[int32]string{ - 0: "AUTH_CHECK_RESULT_UNSPECIFIED", - 1: "AUTH_CHECK_RESULT_MATCH", - 2: "AUTH_CHECK_RESULT_NO_MATCH", - 3: "AUTH_CHECK_RESULT_INVALID", - } - AuthCheckResult_value = map[string]int32{ - "AUTH_CHECK_RESULT_UNSPECIFIED": 0, - "AUTH_CHECK_RESULT_MATCH": 1, - "AUTH_CHECK_RESULT_NO_MATCH": 2, - "AUTH_CHECK_RESULT_INVALID": 3, - } -) - -func (x AuthCheckResult) Enum() *AuthCheckResult { - p := new(AuthCheckResult) - *p = x - return p -} - -func (x AuthCheckResult) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AuthCheckResult) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_credentials_proto_enumTypes[1].Descriptor() -} - -func (AuthCheckResult) Type() protoreflect.EnumType { - return &file_org_signal_chat_credentials_proto_enumTypes[1] -} - -func (x AuthCheckResult) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AuthCheckResult.Descriptor instead. -func (AuthCheckResult) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{1} -} - -type GetExternalServiceCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A service to request credentials for. - ExternalService ExternalServiceType `protobuf:"varint,1,opt,name=externalService,proto3,enum=org.signal.chat.credentials.ExternalServiceType" json:"externalService,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExternalServiceCredentialsRequest) Reset() { - *x = GetExternalServiceCredentialsRequest{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExternalServiceCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExternalServiceCredentialsRequest) ProtoMessage() {} - -func (x *GetExternalServiceCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[0] - 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 GetExternalServiceCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetExternalServiceCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{0} -} - -func (x *GetExternalServiceCredentialsRequest) GetExternalService() ExternalServiceType { - if x != nil { - return x.ExternalService - } - return ExternalServiceType_EXTERNAL_SERVICE_TYPE_UNSPECIFIED -} - -type GetExternalServiceCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A username that can be presented to authenticate with the external service. - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - // A password that can be presented to authenticate with the external service. - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExternalServiceCredentialsResponse) Reset() { - *x = GetExternalServiceCredentialsResponse{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExternalServiceCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExternalServiceCredentialsResponse) ProtoMessage() {} - -func (x *GetExternalServiceCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[1] - 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 GetExternalServiceCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetExternalServiceCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{1} -} - -func (x *GetExternalServiceCredentialsResponse) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *GetExternalServiceCredentialsResponse) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type CheckSvrCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A phone number in the E164 format to check the passwords against. - // Only passwords generated for the user associated with the given number will be marked as `AUTH_CHECK_RESULT_MATCH`. - Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"` - // A list of credentials from previously made calls to `ExternalServiceCredentials.GetExternalServiceCredentials()` - // for `EXTERNAL_SERVICE_TYPE_SVR`. This list may contain credentials generated by different users. Up to 10 credentials - // can be checked. - Passwords []string `protobuf:"bytes,2,rep,name=passwords,proto3" json:"passwords,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckSvrCredentialsRequest) Reset() { - *x = CheckSvrCredentialsRequest{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckSvrCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckSvrCredentialsRequest) ProtoMessage() {} - -func (x *CheckSvrCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[2] - 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 CheckSvrCredentialsRequest.ProtoReflect.Descriptor instead. -func (*CheckSvrCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{2} -} - -func (x *CheckSvrCredentialsRequest) GetNumber() string { - if x != nil { - return x.Number - } - return "" -} - -func (x *CheckSvrCredentialsRequest) GetPasswords() []string { - if x != nil { - return x.Passwords - } - return nil -} - -// For each of the credentials tokens in the `CheckSvrCredentialsRequest` contains the result of the check. -type CheckSvrCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Matches map[string]AuthCheckResult `protobuf:"bytes,1,rep,name=matches,proto3" json:"matches,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=org.signal.chat.credentials.AuthCheckResult"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckSvrCredentialsResponse) Reset() { - *x = CheckSvrCredentialsResponse{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckSvrCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckSvrCredentialsResponse) ProtoMessage() {} - -func (x *CheckSvrCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[3] - 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 CheckSvrCredentialsResponse.ProtoReflect.Descriptor instead. -func (*CheckSvrCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{3} -} - -func (x *CheckSvrCredentialsResponse) GetMatches() map[string]AuthCheckResult { - if x != nil { - return x.Matches - } - return nil -} - -type GetDeliveryCertificateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetDeliveryCertificateRequest) Reset() { - *x = GetDeliveryCertificateRequest{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetDeliveryCertificateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDeliveryCertificateRequest) ProtoMessage() {} - -func (x *GetDeliveryCertificateRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[4] - 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 GetDeliveryCertificateRequest.ProtoReflect.Descriptor instead. -func (*GetDeliveryCertificateRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{4} -} - -// A pair of message delivery certificates. The response unconditionally -// includes certificates with and without the caller's phone number so the -// server never learns anything about the caller's intent to share their phone -// number with their contacts. -type GetDeliveryCertificateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A delivery receipt that includes the caller's phone number; may be empty if - // the authenticated account does not have a phone number - CertificateWithE164 []byte `protobuf:"bytes,1,opt,name=certificate_with_e164,json=certificateWithE164,proto3" json:"certificate_with_e164,omitempty"` - // A delivery receipt that does not include the caller's phone number - CertificateWithoutE164 []byte `protobuf:"bytes,2,opt,name=certificate_without_e164,json=certificateWithoutE164,proto3" json:"certificate_without_e164,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetDeliveryCertificateResponse) Reset() { - *x = GetDeliveryCertificateResponse{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetDeliveryCertificateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDeliveryCertificateResponse) ProtoMessage() {} - -func (x *GetDeliveryCertificateResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[5] - 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 GetDeliveryCertificateResponse.ProtoReflect.Descriptor instead. -func (*GetDeliveryCertificateResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{5} -} - -func (x *GetDeliveryCertificateResponse) GetCertificateWithE164() []byte { - if x != nil { - return x.CertificateWithE164 - } - return nil -} - -func (x *GetDeliveryCertificateResponse) GetCertificateWithoutE164() []byte { - if x != nil { - return x.CertificateWithoutE164 - } - return nil -} - -type GetGroupCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The earliest time for which to issue group credentials; must be aligned to - // a UTC day boundary and may be no more than one day in the past at the time - // of the call. - RedemptionStartSeconds uint64 `protobuf:"varint,1,opt,name=redemption_start_seconds,json=redemptionStartSeconds,proto3" json:"redemption_start_seconds,omitempty"` - // The latest time for which to issue group credentials; must be aligned to a - // UTC day boundary and no more than seven days in the future at the time of - // the call. - RedemptionEndSeconds uint64 `protobuf:"varint,2,opt,name=redemption_end_seconds,json=redemptionEndSeconds,proto3" json:"redemption_end_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetGroupCredentialsRequest) Reset() { - *x = GetGroupCredentialsRequest{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetGroupCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGroupCredentialsRequest) ProtoMessage() {} - -func (x *GetGroupCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[6] - 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 GetGroupCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetGroupCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{6} -} - -func (x *GetGroupCredentialsRequest) GetRedemptionStartSeconds() uint64 { - if x != nil { - return x.RedemptionStartSeconds - } - return 0 -} - -func (x *GetGroupCredentialsRequest) GetRedemptionEndSeconds() uint64 { - if x != nil { - return x.RedemptionEndSeconds - } - return 0 -} - -type GetGroupCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A collection of credentials allowing the holder to anonymously - // authenticate themselves for group-related actions - GroupCredentials []*GetGroupCredentialsResponse_CredentialAndRedemptionTime `protobuf:"bytes,1,rep,name=group_credentials,json=groupCredentials,proto3" json:"group_credentials,omitempty"` - // A collection of credentials allowing the holder to read, update, and delete - // group call links - CallLinkAuthCredentials []*GetGroupCredentialsResponse_CredentialAndRedemptionTime `protobuf:"bytes,2,rep,name=call_link_auth_credentials,json=callLinkAuthCredentials,proto3" json:"call_link_auth_credentials,omitempty"` - // The phone number identifier for which the included credentials were - // generated. Empty if the account does not have a phone number. - Pni []byte `protobuf:"bytes,3,opt,name=pni,proto3" json:"pni,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetGroupCredentialsResponse) Reset() { - *x = GetGroupCredentialsResponse{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetGroupCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGroupCredentialsResponse) ProtoMessage() {} - -func (x *GetGroupCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[7] - 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 GetGroupCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetGroupCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{7} -} - -func (x *GetGroupCredentialsResponse) GetGroupCredentials() []*GetGroupCredentialsResponse_CredentialAndRedemptionTime { - if x != nil { - return x.GroupCredentials - } - return nil -} - -func (x *GetGroupCredentialsResponse) GetCallLinkAuthCredentials() []*GetGroupCredentialsResponse_CredentialAndRedemptionTime { - if x != nil { - return x.CallLinkAuthCredentials - } - return nil -} - -func (x *GetGroupCredentialsResponse) GetPni() []byte { - if x != nil { - return x.Pni - } - return nil -} - -type GetCreateCallLinkCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A zero-knowledge credential request - CredentialRequest []byte `protobuf:"bytes,1,opt,name=credential_request,json=credentialRequest,proto3" json:"credential_request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCreateCallLinkCredentialsRequest) Reset() { - *x = GetCreateCallLinkCredentialsRequest{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCreateCallLinkCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCreateCallLinkCredentialsRequest) ProtoMessage() {} - -func (x *GetCreateCallLinkCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_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 GetCreateCallLinkCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetCreateCallLinkCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{8} -} - -func (x *GetCreateCallLinkCredentialsRequest) GetCredentialRequest() []byte { - if x != nil { - return x.CredentialRequest - } - return nil -} - -type GetCreateCallLinkCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A zero-knowledge credential that may be redeemed at or up to one day after - // the given redemption time - Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` - // The earliest time, in seconds since the epoch, at which the associated - // credential may be redeemed - RedemptionTimeSeconds uint64 `protobuf:"varint,2,opt,name=redemption_time_seconds,json=redemptionTimeSeconds,proto3" json:"redemption_time_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCreateCallLinkCredentialsResponse) Reset() { - *x = GetCreateCallLinkCredentialsResponse{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCreateCallLinkCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCreateCallLinkCredentialsResponse) ProtoMessage() {} - -func (x *GetCreateCallLinkCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_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 GetCreateCallLinkCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetCreateCallLinkCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{9} -} - -func (x *GetCreateCallLinkCredentialsResponse) GetCredential() []byte { - if x != nil { - return x.Credential - } - return nil -} - -func (x *GetCreateCallLinkCredentialsResponse) GetRedemptionTimeSeconds() uint64 { - if x != nil { - return x.RedemptionTimeSeconds - } - return 0 -} - -// A zero-knowledge credential that may be redeemed at or up to one day after -// the given redemption time -type GetGroupCredentialsResponse_CredentialAndRedemptionTime struct { - state protoimpl.MessageState `protogen:"open.v1"` - Credential []byte `protobuf:"bytes,1,opt,name=credential,proto3" json:"credential,omitempty"` - RedemptionTimeSeconds uint64 `protobuf:"varint,2,opt,name=redemption_time_seconds,json=redemptionTimeSeconds,proto3" json:"redemption_time_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetGroupCredentialsResponse_CredentialAndRedemptionTime) Reset() { - *x = GetGroupCredentialsResponse_CredentialAndRedemptionTime{} - mi := &file_org_signal_chat_credentials_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetGroupCredentialsResponse_CredentialAndRedemptionTime) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGroupCredentialsResponse_CredentialAndRedemptionTime) ProtoMessage() {} - -func (x *GetGroupCredentialsResponse_CredentialAndRedemptionTime) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_credentials_proto_msgTypes[11] - 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 GetGroupCredentialsResponse_CredentialAndRedemptionTime.ProtoReflect.Descriptor instead. -func (*GetGroupCredentialsResponse_CredentialAndRedemptionTime) Descriptor() ([]byte, []int) { - return file_org_signal_chat_credentials_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *GetGroupCredentialsResponse_CredentialAndRedemptionTime) GetCredential() []byte { - if x != nil { - return x.Credential - } - return nil -} - -func (x *GetGroupCredentialsResponse_CredentialAndRedemptionTime) GetRedemptionTimeSeconds() uint64 { - if x != nil { - return x.RedemptionTimeSeconds - } - return 0 -} - -var File_org_signal_chat_credentials_proto protoreflect.FileDescriptor - -const file_org_signal_chat_credentials_proto_rawDesc = "" + - "\n" + - "!org/signal/chat/credentials.proto\x12\x1borg.signal.chat.credentials\x1a\x1dorg/signal/chat/require.proto\"\x82\x01\n" + - "$GetExternalServiceCredentialsRequest\x12Z\n" + - "\x0fexternalService\x18\x01 \x01(\x0e20.org.signal.chat.credentials.ExternalServiceTypeR\x0fexternalService\"_\n" + - "%GetExternalServiceCredentialsResponse\x12\x1a\n" + - "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\"^\n" + - "\x1aCheckSvrCredentialsRequest\x12\x16\n" + - "\x06number\x18\x01 \x01(\tR\x06number\x12(\n" + - "\tpasswords\x18\x02 \x03(\tB\n" + - "\x88\x97\"\x01\x9a\x97\"\x02\x10\n" + - "R\tpasswords\"\xe8\x01\n" + - "\x1bCheckSvrCredentialsResponse\x12_\n" + - "\amatches\x18\x01 \x03(\v2E.org.signal.chat.credentials.CheckSvrCredentialsResponse.MatchesEntryR\amatches\x1ah\n" + - "\fMatchesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12B\n" + - "\x05value\x18\x02 \x01(\x0e2,.org.signal.chat.credentials.AuthCheckResultR\x05value:\x028\x01\"\x1f\n" + - "\x1dGetDeliveryCertificateRequest\"\x8e\x01\n" + - "\x1eGetDeliveryCertificateResponse\x122\n" + - "\x15certificate_with_e164\x18\x01 \x01(\fR\x13certificateWithE164\x128\n" + - "\x18certificate_without_e164\x18\x02 \x01(\fR\x16certificateWithoutE164\"\x8c\x01\n" + - "\x1aGetGroupCredentialsRequest\x128\n" + - "\x18redemption_start_seconds\x18\x01 \x01(\x04R\x16redemptionStartSeconds\x124\n" + - "\x16redemption_end_seconds\x18\x02 \x01(\x04R\x14redemptionEndSeconds\"\xbe\x03\n" + - "\x1bGetGroupCredentialsResponse\x12\x81\x01\n" + - "\x11group_credentials\x18\x01 \x03(\v2T.org.signal.chat.credentials.GetGroupCredentialsResponse.CredentialAndRedemptionTimeR\x10groupCredentials\x12\x91\x01\n" + - "\x1acall_link_auth_credentials\x18\x02 \x03(\v2T.org.signal.chat.credentials.GetGroupCredentialsResponse.CredentialAndRedemptionTimeR\x17callLinkAuthCredentials\x12\x10\n" + - "\x03pni\x18\x03 \x01(\fR\x03pni\x1au\n" + - "\x1bCredentialAndRedemptionTime\x12\x1e\n" + - "\n" + - "credential\x18\x01 \x01(\fR\n" + - "credential\x126\n" + - "\x17redemption_time_seconds\x18\x02 \x01(\x04R\x15redemptionTimeSeconds\"T\n" + - "#GetCreateCallLinkCredentialsRequest\x12-\n" + - "\x12credential_request\x18\x01 \x01(\fR\x11credentialRequest\"~\n" + - "$GetCreateCallLinkCredentialsResponse\x12\x1e\n" + - "\n" + - "credential\x18\x01 \x01(\fR\n" + - "credential\x126\n" + - "\x17redemption_time_seconds\x18\x02 \x01(\x04R\x15redemptionTimeSeconds*\xc7\x01\n" + - "\x13ExternalServiceType\x12%\n" + - "!EXTERNAL_SERVICE_TYPE_UNSPECIFIED\x10\x00\x12#\n" + - "\x1fEXTERNAL_SERVICE_TYPE_DIRECTORY\x10\x01\x12\"\n" + - "\x1eEXTERNAL_SERVICE_TYPE_PAYMENTS\x10\x02\x12!\n" + - "\x1dEXTERNAL_SERVICE_TYPE_STORAGE\x10\x03\x12\x1d\n" + - "\x19EXTERNAL_SERVICE_TYPE_SVR\x10\x04*\x90\x01\n" + - "\x0fAuthCheckResult\x12!\n" + - "\x1dAUTH_CHECK_RESULT_UNSPECIFIED\x10\x00\x12\x1b\n" + - "\x17AUTH_CHECK_RESULT_MATCH\x10\x01\x12\x1e\n" + - "\x1aAUTH_CHECK_RESULT_NO_MATCH\x10\x02\x12\x1d\n" + - "\x19AUTH_CHECK_RESULT_INVALID\x10\x032\x89\x05\n" + - "\vCredentials\x12\xa8\x01\n" + - "\x1dGetExternalServiceCredentials\x12A.org.signal.chat.credentials.GetExternalServiceCredentialsRequest\x1aB.org.signal.chat.credentials.GetExternalServiceCredentialsResponse\"\x00\x12\x93\x01\n" + - "\x16GetDeliveryCertificate\x12:.org.signal.chat.credentials.GetDeliveryCertificateRequest\x1a;.org.signal.chat.credentials.GetDeliveryCertificateResponse\"\x00\x12\x8a\x01\n" + - "\x13GetGroupCredentials\x127.org.signal.chat.credentials.GetGroupCredentialsRequest\x1a8.org.signal.chat.credentials.GetGroupCredentialsResponse\"\x00\x12\xa5\x01\n" + - "\x1cGetCreateCallLinkCredentials\x12@.org.signal.chat.credentials.GetCreateCallLinkCredentialsRequest\x1aA.org.signal.chat.credentials.GetCreateCallLinkCredentialsResponse\"\x00\x1a\x04\xc8\xd5\"\x012\xa9\x01\n" + - "\x14CredentialsAnonymous\x12\x8a\x01\n" + - "\x13CheckSvrCredentials\x127.org.signal.chat.credentials.CheckSvrCredentialsRequest\x1a8.org.signal.chat.credentials.CheckSvrCredentialsResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_credentials_proto_rawDescOnce sync.Once - file_org_signal_chat_credentials_proto_rawDescData []byte -) - -func file_org_signal_chat_credentials_proto_rawDescGZIP() []byte { - file_org_signal_chat_credentials_proto_rawDescOnce.Do(func() { - file_org_signal_chat_credentials_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_credentials_proto_rawDesc), len(file_org_signal_chat_credentials_proto_rawDesc))) - }) - return file_org_signal_chat_credentials_proto_rawDescData -} - -var file_org_signal_chat_credentials_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_org_signal_chat_credentials_proto_msgTypes = make([]protoimpl.MessageInfo, 12) -var file_org_signal_chat_credentials_proto_goTypes = []any{ - (ExternalServiceType)(0), // 0: org.signal.chat.credentials.ExternalServiceType - (AuthCheckResult)(0), // 1: org.signal.chat.credentials.AuthCheckResult - (*GetExternalServiceCredentialsRequest)(nil), // 2: org.signal.chat.credentials.GetExternalServiceCredentialsRequest - (*GetExternalServiceCredentialsResponse)(nil), // 3: org.signal.chat.credentials.GetExternalServiceCredentialsResponse - (*CheckSvrCredentialsRequest)(nil), // 4: org.signal.chat.credentials.CheckSvrCredentialsRequest - (*CheckSvrCredentialsResponse)(nil), // 5: org.signal.chat.credentials.CheckSvrCredentialsResponse - (*GetDeliveryCertificateRequest)(nil), // 6: org.signal.chat.credentials.GetDeliveryCertificateRequest - (*GetDeliveryCertificateResponse)(nil), // 7: org.signal.chat.credentials.GetDeliveryCertificateResponse - (*GetGroupCredentialsRequest)(nil), // 8: org.signal.chat.credentials.GetGroupCredentialsRequest - (*GetGroupCredentialsResponse)(nil), // 9: org.signal.chat.credentials.GetGroupCredentialsResponse - (*GetCreateCallLinkCredentialsRequest)(nil), // 10: org.signal.chat.credentials.GetCreateCallLinkCredentialsRequest - (*GetCreateCallLinkCredentialsResponse)(nil), // 11: org.signal.chat.credentials.GetCreateCallLinkCredentialsResponse - nil, // 12: org.signal.chat.credentials.CheckSvrCredentialsResponse.MatchesEntry - (*GetGroupCredentialsResponse_CredentialAndRedemptionTime)(nil), // 13: org.signal.chat.credentials.GetGroupCredentialsResponse.CredentialAndRedemptionTime -} -var file_org_signal_chat_credentials_proto_depIdxs = []int32{ - 0, // 0: org.signal.chat.credentials.GetExternalServiceCredentialsRequest.externalService:type_name -> org.signal.chat.credentials.ExternalServiceType - 12, // 1: org.signal.chat.credentials.CheckSvrCredentialsResponse.matches:type_name -> org.signal.chat.credentials.CheckSvrCredentialsResponse.MatchesEntry - 13, // 2: org.signal.chat.credentials.GetGroupCredentialsResponse.group_credentials:type_name -> org.signal.chat.credentials.GetGroupCredentialsResponse.CredentialAndRedemptionTime - 13, // 3: org.signal.chat.credentials.GetGroupCredentialsResponse.call_link_auth_credentials:type_name -> org.signal.chat.credentials.GetGroupCredentialsResponse.CredentialAndRedemptionTime - 1, // 4: org.signal.chat.credentials.CheckSvrCredentialsResponse.MatchesEntry.value:type_name -> org.signal.chat.credentials.AuthCheckResult - 2, // 5: org.signal.chat.credentials.Credentials.GetExternalServiceCredentials:input_type -> org.signal.chat.credentials.GetExternalServiceCredentialsRequest - 6, // 6: org.signal.chat.credentials.Credentials.GetDeliveryCertificate:input_type -> org.signal.chat.credentials.GetDeliveryCertificateRequest - 8, // 7: org.signal.chat.credentials.Credentials.GetGroupCredentials:input_type -> org.signal.chat.credentials.GetGroupCredentialsRequest - 10, // 8: org.signal.chat.credentials.Credentials.GetCreateCallLinkCredentials:input_type -> org.signal.chat.credentials.GetCreateCallLinkCredentialsRequest - 4, // 9: org.signal.chat.credentials.CredentialsAnonymous.CheckSvrCredentials:input_type -> org.signal.chat.credentials.CheckSvrCredentialsRequest - 3, // 10: org.signal.chat.credentials.Credentials.GetExternalServiceCredentials:output_type -> org.signal.chat.credentials.GetExternalServiceCredentialsResponse - 7, // 11: org.signal.chat.credentials.Credentials.GetDeliveryCertificate:output_type -> org.signal.chat.credentials.GetDeliveryCertificateResponse - 9, // 12: org.signal.chat.credentials.Credentials.GetGroupCredentials:output_type -> org.signal.chat.credentials.GetGroupCredentialsResponse - 11, // 13: org.signal.chat.credentials.Credentials.GetCreateCallLinkCredentials:output_type -> org.signal.chat.credentials.GetCreateCallLinkCredentialsResponse - 5, // 14: org.signal.chat.credentials.CredentialsAnonymous.CheckSvrCredentials:output_type -> org.signal.chat.credentials.CheckSvrCredentialsResponse - 10, // [10:15] is the sub-list for method output_type - 5, // [5:10] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_credentials_proto_init() } -func file_org_signal_chat_credentials_proto_init() { - if File_org_signal_chat_credentials_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_credentials_proto_rawDesc), len(file_org_signal_chat_credentials_proto_rawDesc)), - NumEnums: 2, - NumMessages: 12, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_org_signal_chat_credentials_proto_goTypes, - DependencyIndexes: file_org_signal_chat_credentials_proto_depIdxs, - EnumInfos: file_org_signal_chat_credentials_proto_enumTypes, - MessageInfos: file_org_signal_chat_credentials_proto_msgTypes, - }.Build() - File_org_signal_chat_credentials_proto = out.File - file_org_signal_chat_credentials_proto_goTypes = nil - file_org_signal_chat_credentials_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/credentials/credentials_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/credentials/credentials_grpc.pb.go deleted file mode 100644 index c7934c0..0000000 --- a/pkg/signalmeow/protobuf/rpc/credentials/credentials_grpc.pb.go +++ /dev/null @@ -1,377 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/credentials.proto - -package credentials - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Credentials_GetExternalServiceCredentials_FullMethodName = "/org.signal.chat.credentials.Credentials/GetExternalServiceCredentials" - Credentials_GetDeliveryCertificate_FullMethodName = "/org.signal.chat.credentials.Credentials/GetDeliveryCertificate" - Credentials_GetGroupCredentials_FullMethodName = "/org.signal.chat.credentials.Credentials/GetGroupCredentials" - Credentials_GetCreateCallLinkCredentials_FullMethodName = "/org.signal.chat.credentials.Credentials/GetCreateCallLinkCredentials" -) - -// CredentialsClient is the client API for Credentials service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for obtaining and verifying credentials that allow an -// authenticated user to authenticate in another service or context without -// revealing their identity. -type CredentialsClient interface { - // Generates and returns an external service credentials for the caller. - GetExternalServiceCredentials(ctx context.Context, in *GetExternalServiceCredentialsRequest, opts ...grpc.CallOption) (*GetExternalServiceCredentialsResponse, error) - // Generates a pair of delivery certificates that the holder can include to - // identify themselves to a message recipient (but not the server) in a - // sealed-sender message. - GetDeliveryCertificate(ctx context.Context, in *GetDeliveryCertificateRequest, opts ...grpc.CallOption) (*GetDeliveryCertificateResponse, error) - // Generates a set of zero-knowledge credentials for various group-related - // actions. - GetGroupCredentials(ctx context.Context, in *GetGroupCredentialsRequest, opts ...grpc.CallOption) (*GetGroupCredentialsResponse, error) - // Generates zero-knowledge credentials for creating call links. - GetCreateCallLinkCredentials(ctx context.Context, in *GetCreateCallLinkCredentialsRequest, opts ...grpc.CallOption) (*GetCreateCallLinkCredentialsResponse, error) -} - -type credentialsClient struct { - cc grpc.ClientConnInterface -} - -func NewCredentialsClient(cc grpc.ClientConnInterface) CredentialsClient { - return &credentialsClient{cc} -} - -func (c *credentialsClient) GetExternalServiceCredentials(ctx context.Context, in *GetExternalServiceCredentialsRequest, opts ...grpc.CallOption) (*GetExternalServiceCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetExternalServiceCredentialsResponse) - err := c.cc.Invoke(ctx, Credentials_GetExternalServiceCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *credentialsClient) GetDeliveryCertificate(ctx context.Context, in *GetDeliveryCertificateRequest, opts ...grpc.CallOption) (*GetDeliveryCertificateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetDeliveryCertificateResponse) - err := c.cc.Invoke(ctx, Credentials_GetDeliveryCertificate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *credentialsClient) GetGroupCredentials(ctx context.Context, in *GetGroupCredentialsRequest, opts ...grpc.CallOption) (*GetGroupCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetGroupCredentialsResponse) - err := c.cc.Invoke(ctx, Credentials_GetGroupCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *credentialsClient) GetCreateCallLinkCredentials(ctx context.Context, in *GetCreateCallLinkCredentialsRequest, opts ...grpc.CallOption) (*GetCreateCallLinkCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetCreateCallLinkCredentialsResponse) - err := c.cc.Invoke(ctx, Credentials_GetCreateCallLinkCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CredentialsServer is the server API for Credentials service. -// All implementations must embed UnimplementedCredentialsServer -// for forward compatibility. -// -// Provides methods for obtaining and verifying credentials that allow an -// authenticated user to authenticate in another service or context without -// revealing their identity. -type CredentialsServer interface { - // Generates and returns an external service credentials for the caller. - GetExternalServiceCredentials(context.Context, *GetExternalServiceCredentialsRequest) (*GetExternalServiceCredentialsResponse, error) - // Generates a pair of delivery certificates that the holder can include to - // identify themselves to a message recipient (but not the server) in a - // sealed-sender message. - GetDeliveryCertificate(context.Context, *GetDeliveryCertificateRequest) (*GetDeliveryCertificateResponse, error) - // Generates a set of zero-knowledge credentials for various group-related - // actions. - GetGroupCredentials(context.Context, *GetGroupCredentialsRequest) (*GetGroupCredentialsResponse, error) - // Generates zero-knowledge credentials for creating call links. - GetCreateCallLinkCredentials(context.Context, *GetCreateCallLinkCredentialsRequest) (*GetCreateCallLinkCredentialsResponse, error) - mustEmbedUnimplementedCredentialsServer() -} - -// UnimplementedCredentialsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedCredentialsServer struct{} - -func (UnimplementedCredentialsServer) GetExternalServiceCredentials(context.Context, *GetExternalServiceCredentialsRequest) (*GetExternalServiceCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetExternalServiceCredentials not implemented") -} -func (UnimplementedCredentialsServer) GetDeliveryCertificate(context.Context, *GetDeliveryCertificateRequest) (*GetDeliveryCertificateResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetDeliveryCertificate not implemented") -} -func (UnimplementedCredentialsServer) GetGroupCredentials(context.Context, *GetGroupCredentialsRequest) (*GetGroupCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetGroupCredentials not implemented") -} -func (UnimplementedCredentialsServer) GetCreateCallLinkCredentials(context.Context, *GetCreateCallLinkCredentialsRequest) (*GetCreateCallLinkCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetCreateCallLinkCredentials not implemented") -} -func (UnimplementedCredentialsServer) mustEmbedUnimplementedCredentialsServer() {} -func (UnimplementedCredentialsServer) testEmbeddedByValue() {} - -// UnsafeCredentialsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CredentialsServer will -// result in compilation errors. -type UnsafeCredentialsServer interface { - mustEmbedUnimplementedCredentialsServer() -} - -func RegisterCredentialsServer(s grpc.ServiceRegistrar, srv CredentialsServer) { - // If the following call panics, it indicates UnimplementedCredentialsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Credentials_ServiceDesc, srv) -} - -func _Credentials_GetExternalServiceCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExternalServiceCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CredentialsServer).GetExternalServiceCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Credentials_GetExternalServiceCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CredentialsServer).GetExternalServiceCredentials(ctx, req.(*GetExternalServiceCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Credentials_GetDeliveryCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDeliveryCertificateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CredentialsServer).GetDeliveryCertificate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Credentials_GetDeliveryCertificate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CredentialsServer).GetDeliveryCertificate(ctx, req.(*GetDeliveryCertificateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Credentials_GetGroupCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetGroupCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CredentialsServer).GetGroupCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Credentials_GetGroupCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CredentialsServer).GetGroupCredentials(ctx, req.(*GetGroupCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Credentials_GetCreateCallLinkCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCreateCallLinkCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CredentialsServer).GetCreateCallLinkCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Credentials_GetCreateCallLinkCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CredentialsServer).GetCreateCallLinkCredentials(ctx, req.(*GetCreateCallLinkCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Credentials_ServiceDesc is the grpc.ServiceDesc for Credentials service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Credentials_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.credentials.Credentials", - HandlerType: (*CredentialsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetExternalServiceCredentials", - Handler: _Credentials_GetExternalServiceCredentials_Handler, - }, - { - MethodName: "GetDeliveryCertificate", - Handler: _Credentials_GetDeliveryCertificate_Handler, - }, - { - MethodName: "GetGroupCredentials", - Handler: _Credentials_GetGroupCredentials_Handler, - }, - { - MethodName: "GetCreateCallLinkCredentials", - Handler: _Credentials_GetCreateCallLinkCredentials_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/credentials.proto", -} - -const ( - CredentialsAnonymous_CheckSvrCredentials_FullMethodName = "/org.signal.chat.credentials.CredentialsAnonymous/CheckSvrCredentials" -) - -// CredentialsAnonymousClient is the client API for CredentialsAnonymous service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with previously-generated credentials without -// revealing an association between the credentials and the caller's identity to -// the server. -type CredentialsAnonymousClient interface { - // Given a list of secure value recovery (SVR) service credentials and a phone - // number, checks and returns which of the provided credentials were generated - // by the user with the given phone number and have not yet expired. - CheckSvrCredentials(ctx context.Context, in *CheckSvrCredentialsRequest, opts ...grpc.CallOption) (*CheckSvrCredentialsResponse, error) -} - -type credentialsAnonymousClient struct { - cc grpc.ClientConnInterface -} - -func NewCredentialsAnonymousClient(cc grpc.ClientConnInterface) CredentialsAnonymousClient { - return &credentialsAnonymousClient{cc} -} - -func (c *credentialsAnonymousClient) CheckSvrCredentials(ctx context.Context, in *CheckSvrCredentialsRequest, opts ...grpc.CallOption) (*CheckSvrCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CheckSvrCredentialsResponse) - err := c.cc.Invoke(ctx, CredentialsAnonymous_CheckSvrCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// CredentialsAnonymousServer is the server API for CredentialsAnonymous service. -// All implementations must embed UnimplementedCredentialsAnonymousServer -// for forward compatibility. -// -// Provides methods for working with previously-generated credentials without -// revealing an association between the credentials and the caller's identity to -// the server. -type CredentialsAnonymousServer interface { - // Given a list of secure value recovery (SVR) service credentials and a phone - // number, checks and returns which of the provided credentials were generated - // by the user with the given phone number and have not yet expired. - CheckSvrCredentials(context.Context, *CheckSvrCredentialsRequest) (*CheckSvrCredentialsResponse, error) - mustEmbedUnimplementedCredentialsAnonymousServer() -} - -// UnimplementedCredentialsAnonymousServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedCredentialsAnonymousServer struct{} - -func (UnimplementedCredentialsAnonymousServer) CheckSvrCredentials(context.Context, *CheckSvrCredentialsRequest) (*CheckSvrCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CheckSvrCredentials not implemented") -} -func (UnimplementedCredentialsAnonymousServer) mustEmbedUnimplementedCredentialsAnonymousServer() {} -func (UnimplementedCredentialsAnonymousServer) testEmbeddedByValue() {} - -// UnsafeCredentialsAnonymousServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to CredentialsAnonymousServer will -// result in compilation errors. -type UnsafeCredentialsAnonymousServer interface { - mustEmbedUnimplementedCredentialsAnonymousServer() -} - -func RegisterCredentialsAnonymousServer(s grpc.ServiceRegistrar, srv CredentialsAnonymousServer) { - // If the following call panics, it indicates UnimplementedCredentialsAnonymousServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&CredentialsAnonymous_ServiceDesc, srv) -} - -func _CredentialsAnonymous_CheckSvrCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CheckSvrCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CredentialsAnonymousServer).CheckSvrCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: CredentialsAnonymous_CheckSvrCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CredentialsAnonymousServer).CheckSvrCredentials(ctx, req.(*CheckSvrCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// CredentialsAnonymous_ServiceDesc is the grpc.ServiceDesc for CredentialsAnonymous service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var CredentialsAnonymous_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.credentials.CredentialsAnonymous", - HandlerType: (*CredentialsAnonymousServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CheckSvrCredentials", - Handler: _CredentialsAnonymous_CheckSvrCredentials_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/credentials.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/device/device.pb.go b/pkg/signalmeow/protobuf/rpc/device/device.pb.go deleted file mode 100644 index c9881f6..0000000 --- a/pkg/signalmeow/protobuf/rpc/device/device.pb.go +++ /dev/null @@ -1,922 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/device.proto - -package device - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetDevicesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetDevicesRequest) Reset() { - *x = GetDevicesRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetDevicesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDevicesRequest) ProtoMessage() {} - -func (x *GetDevicesRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[0] - 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 GetDevicesRequest.ProtoReflect.Descriptor instead. -func (*GetDevicesRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{0} -} - -type GetDevicesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of devices linked to the authenticated account. - Devices []*GetDevicesResponse_LinkedDevice `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetDevicesResponse) Reset() { - *x = GetDevicesResponse{} - mi := &file_org_signal_chat_device_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetDevicesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDevicesResponse) ProtoMessage() {} - -func (x *GetDevicesResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[1] - 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 GetDevicesResponse.ProtoReflect.Descriptor instead. -func (*GetDevicesResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{1} -} - -func (x *GetDevicesResponse) GetDevices() []*GetDevicesResponse_LinkedDevice { - if x != nil { - return x.Devices - } - return nil -} - -type RemoveDeviceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identifier for the device to remove from the authenticated account. The - // identifier must not be for the primary device. - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveDeviceRequest) Reset() { - *x = RemoveDeviceRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveDeviceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveDeviceRequest) ProtoMessage() {} - -func (x *RemoveDeviceRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[2] - 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 RemoveDeviceRequest.ProtoReflect.Descriptor instead. -func (*RemoveDeviceRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{2} -} - -func (x *RemoveDeviceRequest) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -type SetDeviceNameRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A sequence of bytes that encodes an encrypted human-readable name for this - // device. - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The identifier for the device for which to set a name. - Id uint32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDeviceNameRequest) Reset() { - *x = SetDeviceNameRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDeviceNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDeviceNameRequest) ProtoMessage() {} - -func (x *SetDeviceNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[3] - 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 SetDeviceNameRequest.ProtoReflect.Descriptor instead. -func (*SetDeviceNameRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{3} -} - -func (x *SetDeviceNameRequest) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *SetDeviceNameRequest) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -type SetDeviceNameResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetDeviceNameResponse_Success - // *SetDeviceNameResponse_TargetDeviceNotFound - Response isSetDeviceNameResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDeviceNameResponse) Reset() { - *x = SetDeviceNameResponse{} - mi := &file_org_signal_chat_device_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDeviceNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDeviceNameResponse) ProtoMessage() {} - -func (x *SetDeviceNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[4] - 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 SetDeviceNameResponse.ProtoReflect.Descriptor instead. -func (*SetDeviceNameResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{4} -} - -func (x *SetDeviceNameResponse) GetResponse() isSetDeviceNameResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetDeviceNameResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*SetDeviceNameResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SetDeviceNameResponse) GetTargetDeviceNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*SetDeviceNameResponse_TargetDeviceNotFound); ok { - return x.TargetDeviceNotFound - } - } - return nil -} - -type isSetDeviceNameResponse_Response interface { - isSetDeviceNameResponse_Response() -} - -type SetDeviceNameResponse_Success struct { - // The device name was successfully set - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SetDeviceNameResponse_TargetDeviceNotFound struct { - // No device with the provided identifier was found on the account - TargetDeviceNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=target_device_not_found,json=targetDeviceNotFound,proto3,oneof"` -} - -func (*SetDeviceNameResponse_Success) isSetDeviceNameResponse_Response() {} - -func (*SetDeviceNameResponse_TargetDeviceNotFound) isSetDeviceNameResponse_Response() {} - -type RemoveDeviceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RemoveDeviceResponse) Reset() { - *x = RemoveDeviceResponse{} - mi := &file_org_signal_chat_device_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RemoveDeviceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveDeviceResponse) ProtoMessage() {} - -func (x *RemoveDeviceResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[5] - 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 RemoveDeviceResponse.ProtoReflect.Descriptor instead. -func (*RemoveDeviceResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{5} -} - -type SetPushTokenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to TokenRequest: - // - // *SetPushTokenRequest_ApnsTokenRequest_ - // *SetPushTokenRequest_FcmTokenRequest_ - TokenRequest isSetPushTokenRequest_TokenRequest `protobuf_oneof:"token_request"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetPushTokenRequest) Reset() { - *x = SetPushTokenRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetPushTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetPushTokenRequest) ProtoMessage() {} - -func (x *SetPushTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[6] - 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 SetPushTokenRequest.ProtoReflect.Descriptor instead. -func (*SetPushTokenRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{6} -} - -func (x *SetPushTokenRequest) GetTokenRequest() isSetPushTokenRequest_TokenRequest { - if x != nil { - return x.TokenRequest - } - return nil -} - -func (x *SetPushTokenRequest) GetApnsTokenRequest() *SetPushTokenRequest_ApnsTokenRequest { - if x != nil { - if x, ok := x.TokenRequest.(*SetPushTokenRequest_ApnsTokenRequest_); ok { - return x.ApnsTokenRequest - } - } - return nil -} - -func (x *SetPushTokenRequest) GetFcmTokenRequest() *SetPushTokenRequest_FcmTokenRequest { - if x != nil { - if x, ok := x.TokenRequest.(*SetPushTokenRequest_FcmTokenRequest_); ok { - return x.FcmTokenRequest - } - } - return nil -} - -type isSetPushTokenRequest_TokenRequest interface { - isSetPushTokenRequest_TokenRequest() -} - -type SetPushTokenRequest_ApnsTokenRequest_ struct { - // If present, specifies the APNs device token(s) the server will use to - // send new message notifications to the authenticated device. - ApnsTokenRequest *SetPushTokenRequest_ApnsTokenRequest `protobuf:"bytes,1,opt,name=apns_token_request,json=apnsTokenRequest,proto3,oneof"` -} - -type SetPushTokenRequest_FcmTokenRequest_ struct { - // If present, specifies the FCM push token the server will use to send new - // message notifications to the authenticated device. - FcmTokenRequest *SetPushTokenRequest_FcmTokenRequest `protobuf:"bytes,2,opt,name=fcm_token_request,json=fcmTokenRequest,proto3,oneof"` -} - -func (*SetPushTokenRequest_ApnsTokenRequest_) isSetPushTokenRequest_TokenRequest() {} - -func (*SetPushTokenRequest_FcmTokenRequest_) isSetPushTokenRequest_TokenRequest() {} - -type SetPushTokenResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetPushTokenResponse) Reset() { - *x = SetPushTokenResponse{} - mi := &file_org_signal_chat_device_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetPushTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetPushTokenResponse) ProtoMessage() {} - -func (x *SetPushTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[7] - 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 SetPushTokenResponse.ProtoReflect.Descriptor instead. -func (*SetPushTokenResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{7} -} - -type ClearPushTokenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClearPushTokenRequest) Reset() { - *x = ClearPushTokenRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClearPushTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClearPushTokenRequest) ProtoMessage() {} - -func (x *ClearPushTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_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 ClearPushTokenRequest.ProtoReflect.Descriptor instead. -func (*ClearPushTokenRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{8} -} - -type ClearPushTokenResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ClearPushTokenResponse) Reset() { - *x = ClearPushTokenResponse{} - mi := &file_org_signal_chat_device_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ClearPushTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ClearPushTokenResponse) ProtoMessage() {} - -func (x *ClearPushTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_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 ClearPushTokenResponse.ProtoReflect.Descriptor instead. -func (*ClearPushTokenResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{9} -} - -type SetCapabilitiesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Capabilities []common.DeviceCapability `protobuf:"varint,1,rep,packed,name=capabilities,proto3,enum=org.signal.chat.common.DeviceCapability" json:"capabilities,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetCapabilitiesRequest) Reset() { - *x = SetCapabilitiesRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetCapabilitiesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetCapabilitiesRequest) ProtoMessage() {} - -func (x *SetCapabilitiesRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_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 SetCapabilitiesRequest.ProtoReflect.Descriptor instead. -func (*SetCapabilitiesRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{10} -} - -func (x *SetCapabilitiesRequest) GetCapabilities() []common.DeviceCapability { - if x != nil { - return x.Capabilities - } - return nil -} - -type SetCapabilitiesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetCapabilitiesResponse) Reset() { - *x = SetCapabilitiesResponse{} - mi := &file_org_signal_chat_device_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetCapabilitiesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetCapabilitiesResponse) ProtoMessage() {} - -func (x *SetCapabilitiesResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_proto_msgTypes[11] - 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 SetCapabilitiesResponse.ProtoReflect.Descriptor instead. -func (*SetCapabilitiesResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{11} -} - -type GetDevicesResponse_LinkedDevice struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identifier for the device within an account. - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // A sequence of bytes that encodes an encrypted human-readable name for - // this device. - Name []byte `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The approximate time, in milliseconds since the epoch, at which this - // device last connected to the server. - LastSeen uint64 `protobuf:"varint,3,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` - // The registration ID of the given device. - RegistrationId uint32 `protobuf:"varint,4,opt,name=registration_id,json=registrationId,proto3" json:"registration_id,omitempty"` - // A sequence of bytes that encodes the time, - // in milliseconds since the epoch, at which this device was - // attached to its parent account. - CreatedAtCiphertext []byte `protobuf:"bytes,5,opt,name=created_at_ciphertext,json=createdAtCiphertext,proto3" json:"created_at_ciphertext,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetDevicesResponse_LinkedDevice) Reset() { - *x = GetDevicesResponse_LinkedDevice{} - mi := &file_org_signal_chat_device_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetDevicesResponse_LinkedDevice) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetDevicesResponse_LinkedDevice) ProtoMessage() {} - -func (x *GetDevicesResponse_LinkedDevice) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_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 GetDevicesResponse_LinkedDevice.ProtoReflect.Descriptor instead. -func (*GetDevicesResponse_LinkedDevice) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *GetDevicesResponse_LinkedDevice) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *GetDevicesResponse_LinkedDevice) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *GetDevicesResponse_LinkedDevice) GetLastSeen() uint64 { - if x != nil { - return x.LastSeen - } - return 0 -} - -func (x *GetDevicesResponse_LinkedDevice) GetRegistrationId() uint32 { - if x != nil { - return x.RegistrationId - } - return 0 -} - -func (x *GetDevicesResponse_LinkedDevice) GetCreatedAtCiphertext() []byte { - if x != nil { - return x.CreatedAtCiphertext - } - return nil -} - -type SetPushTokenRequest_ApnsTokenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A "standard" APNs device token. - ApnsToken string `protobuf:"bytes,1,opt,name=apns_token,json=apnsToken,proto3" json:"apns_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetPushTokenRequest_ApnsTokenRequest) Reset() { - *x = SetPushTokenRequest_ApnsTokenRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetPushTokenRequest_ApnsTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetPushTokenRequest_ApnsTokenRequest) ProtoMessage() {} - -func (x *SetPushTokenRequest_ApnsTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_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 SetPushTokenRequest_ApnsTokenRequest.ProtoReflect.Descriptor instead. -func (*SetPushTokenRequest_ApnsTokenRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *SetPushTokenRequest_ApnsTokenRequest) GetApnsToken() string { - if x != nil { - return x.ApnsToken - } - return "" -} - -type SetPushTokenRequest_FcmTokenRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An FCM push token. - FcmToken string `protobuf:"bytes,1,opt,name=fcm_token,json=fcmToken,proto3" json:"fcm_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetPushTokenRequest_FcmTokenRequest) Reset() { - *x = SetPushTokenRequest_FcmTokenRequest{} - mi := &file_org_signal_chat_device_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetPushTokenRequest_FcmTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetPushTokenRequest_FcmTokenRequest) ProtoMessage() {} - -func (x *SetPushTokenRequest_FcmTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_device_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 SetPushTokenRequest_FcmTokenRequest.ProtoReflect.Descriptor instead. -func (*SetPushTokenRequest_FcmTokenRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_device_proto_rawDescGZIP(), []int{6, 1} -} - -func (x *SetPushTokenRequest_FcmTokenRequest) GetFcmToken() string { - if x != nil { - return x.FcmToken - } - return "" -} - -var File_org_signal_chat_device_proto protoreflect.FileDescriptor - -const file_org_signal_chat_device_proto_rawDesc = "" + - "\n" + - "\x1corg/signal/chat/device.proto\x12\x16org.signal.chat.device\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1corg/signal/chat/common.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x19org/signal/chat/tag.proto\"\x13\n" + - "\x11GetDevicesRequest\"\x9f\x02\n" + - "\x12GetDevicesResponse\x12Q\n" + - "\adevices\x18\x01 \x03(\v27.org.signal.chat.device.GetDevicesResponse.LinkedDeviceR\adevices\x1a\xb5\x01\n" + - "\fLinkedDevice\x12\x0e\n" + - "\x02id\x18\x01 \x01(\rR\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\fR\x04name\x12\x1b\n" + - "\tlast_seen\x18\x03 \x01(\x04R\blastSeen\x120\n" + - "\x0fregistration_id\x18\x04 \x01(\rB\a\xb2\x97\"\x03\x10\xff\x7fR\x0eregistrationId\x122\n" + - "\x15created_at_ciphertext\x18\x05 \x01(\fR\x13createdAtCiphertext\"%\n" + - "\x13RemoveDeviceRequest\x12\x0e\n" + - "\x02id\x18\x01 \x01(\rR\x02id\"E\n" + - "\x14SetDeviceNameRequest\x12\x1d\n" + - "\x04name\x18\x01 \x01(\fB\t\x9a\x97\"\x05\b\x01\x10\xe1\x01R\x04name\x12\x0e\n" + - "\x02id\x18\x02 \x01(\rR\x02id\"\xc1\x01\n" + - "\x15SetDeviceNameResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12h\n" + - "\x17target_device_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\r\xc2\xd5\"\tnot_foundH\x00R\x14targetDeviceNotFoundB\n" + - "\n" + - "\bresponse\"\x16\n" + - "\x14RemoveDeviceResponse\"\xee\x02\n" + - "\x13SetPushTokenRequest\x12l\n" + - "\x12apns_token_request\x18\x01 \x01(\v2<.org.signal.chat.device.SetPushTokenRequest.ApnsTokenRequestH\x00R\x10apnsTokenRequest\x12i\n" + - "\x11fcm_token_request\x18\x02 \x01(\v2;.org.signal.chat.device.SetPushTokenRequest.FcmTokenRequestH\x00R\x0ffcmTokenRequest\x1a7\n" + - "\x10ApnsTokenRequest\x12#\n" + - "\n" + - "apns_token\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\tapnsToken\x1a4\n" + - "\x0fFcmTokenRequest\x12!\n" + - "\tfcm_token\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\bfcmTokenB\x0f\n" + - "\rtoken_request\"\x16\n" + - "\x14SetPushTokenResponse\"\x17\n" + - "\x15ClearPushTokenRequest\"\x18\n" + - "\x16ClearPushTokenResponse\"f\n" + - "\x16SetCapabilitiesRequest\x12L\n" + - "\fcapabilities\x18\x01 \x03(\x0e2(.org.signal.chat.common.DeviceCapabilityR\fcapabilities\"\x19\n" + - "\x17SetCapabilitiesResponse2\xa9\x05\n" + - "\aDevices\x12e\n" + - "\n" + - "GetDevices\x12).org.signal.chat.device.GetDevicesRequest\x1a*.org.signal.chat.device.GetDevicesResponse\"\x00\x12k\n" + - "\fRemoveDevice\x12+.org.signal.chat.device.RemoveDeviceRequest\x1a,.org.signal.chat.device.RemoveDeviceResponse\"\x00\x12n\n" + - "\rSetDeviceName\x12,.org.signal.chat.device.SetDeviceNameRequest\x1a-.org.signal.chat.device.SetDeviceNameResponse\"\x00\x12k\n" + - "\fSetPushToken\x12+.org.signal.chat.device.SetPushTokenRequest\x1a,.org.signal.chat.device.SetPushTokenResponse\"\x00\x12q\n" + - "\x0eClearPushToken\x12-.org.signal.chat.device.ClearPushTokenRequest\x1a..org.signal.chat.device.ClearPushTokenResponse\"\x00\x12t\n" + - "\x0fSetCapabilities\x12..org.signal.chat.device.SetCapabilitiesRequest\x1a/.org.signal.chat.device.SetCapabilitiesResponse\"\x00\x1a\x04\xc8\xd5\"\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_device_proto_rawDescOnce sync.Once - file_org_signal_chat_device_proto_rawDescData []byte -) - -func file_org_signal_chat_device_proto_rawDescGZIP() []byte { - file_org_signal_chat_device_proto_rawDescOnce.Do(func() { - file_org_signal_chat_device_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_device_proto_rawDesc), len(file_org_signal_chat_device_proto_rawDesc))) - }) - return file_org_signal_chat_device_proto_rawDescData -} - -var file_org_signal_chat_device_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_org_signal_chat_device_proto_goTypes = []any{ - (*GetDevicesRequest)(nil), // 0: org.signal.chat.device.GetDevicesRequest - (*GetDevicesResponse)(nil), // 1: org.signal.chat.device.GetDevicesResponse - (*RemoveDeviceRequest)(nil), // 2: org.signal.chat.device.RemoveDeviceRequest - (*SetDeviceNameRequest)(nil), // 3: org.signal.chat.device.SetDeviceNameRequest - (*SetDeviceNameResponse)(nil), // 4: org.signal.chat.device.SetDeviceNameResponse - (*RemoveDeviceResponse)(nil), // 5: org.signal.chat.device.RemoveDeviceResponse - (*SetPushTokenRequest)(nil), // 6: org.signal.chat.device.SetPushTokenRequest - (*SetPushTokenResponse)(nil), // 7: org.signal.chat.device.SetPushTokenResponse - (*ClearPushTokenRequest)(nil), // 8: org.signal.chat.device.ClearPushTokenRequest - (*ClearPushTokenResponse)(nil), // 9: org.signal.chat.device.ClearPushTokenResponse - (*SetCapabilitiesRequest)(nil), // 10: org.signal.chat.device.SetCapabilitiesRequest - (*SetCapabilitiesResponse)(nil), // 11: org.signal.chat.device.SetCapabilitiesResponse - (*GetDevicesResponse_LinkedDevice)(nil), // 12: org.signal.chat.device.GetDevicesResponse.LinkedDevice - (*SetPushTokenRequest_ApnsTokenRequest)(nil), // 13: org.signal.chat.device.SetPushTokenRequest.ApnsTokenRequest - (*SetPushTokenRequest_FcmTokenRequest)(nil), // 14: org.signal.chat.device.SetPushTokenRequest.FcmTokenRequest - (*emptypb.Empty)(nil), // 15: google.protobuf.Empty - (*errors.NotFound)(nil), // 16: org.signal.chat.errors.NotFound - (common.DeviceCapability)(0), // 17: org.signal.chat.common.DeviceCapability -} -var file_org_signal_chat_device_proto_depIdxs = []int32{ - 12, // 0: org.signal.chat.device.GetDevicesResponse.devices:type_name -> org.signal.chat.device.GetDevicesResponse.LinkedDevice - 15, // 1: org.signal.chat.device.SetDeviceNameResponse.success:type_name -> google.protobuf.Empty - 16, // 2: org.signal.chat.device.SetDeviceNameResponse.target_device_not_found:type_name -> org.signal.chat.errors.NotFound - 13, // 3: org.signal.chat.device.SetPushTokenRequest.apns_token_request:type_name -> org.signal.chat.device.SetPushTokenRequest.ApnsTokenRequest - 14, // 4: org.signal.chat.device.SetPushTokenRequest.fcm_token_request:type_name -> org.signal.chat.device.SetPushTokenRequest.FcmTokenRequest - 17, // 5: org.signal.chat.device.SetCapabilitiesRequest.capabilities:type_name -> org.signal.chat.common.DeviceCapability - 0, // 6: org.signal.chat.device.Devices.GetDevices:input_type -> org.signal.chat.device.GetDevicesRequest - 2, // 7: org.signal.chat.device.Devices.RemoveDevice:input_type -> org.signal.chat.device.RemoveDeviceRequest - 3, // 8: org.signal.chat.device.Devices.SetDeviceName:input_type -> org.signal.chat.device.SetDeviceNameRequest - 6, // 9: org.signal.chat.device.Devices.SetPushToken:input_type -> org.signal.chat.device.SetPushTokenRequest - 8, // 10: org.signal.chat.device.Devices.ClearPushToken:input_type -> org.signal.chat.device.ClearPushTokenRequest - 10, // 11: org.signal.chat.device.Devices.SetCapabilities:input_type -> org.signal.chat.device.SetCapabilitiesRequest - 1, // 12: org.signal.chat.device.Devices.GetDevices:output_type -> org.signal.chat.device.GetDevicesResponse - 5, // 13: org.signal.chat.device.Devices.RemoveDevice:output_type -> org.signal.chat.device.RemoveDeviceResponse - 4, // 14: org.signal.chat.device.Devices.SetDeviceName:output_type -> org.signal.chat.device.SetDeviceNameResponse - 7, // 15: org.signal.chat.device.Devices.SetPushToken:output_type -> org.signal.chat.device.SetPushTokenResponse - 9, // 16: org.signal.chat.device.Devices.ClearPushToken:output_type -> org.signal.chat.device.ClearPushTokenResponse - 11, // 17: org.signal.chat.device.Devices.SetCapabilities:output_type -> org.signal.chat.device.SetCapabilitiesResponse - 12, // [12:18] is the sub-list for method output_type - 6, // [6:12] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_device_proto_init() } -func file_org_signal_chat_device_proto_init() { - if File_org_signal_chat_device_proto != nil { - return - } - file_org_signal_chat_device_proto_msgTypes[4].OneofWrappers = []any{ - (*SetDeviceNameResponse_Success)(nil), - (*SetDeviceNameResponse_TargetDeviceNotFound)(nil), - } - file_org_signal_chat_device_proto_msgTypes[6].OneofWrappers = []any{ - (*SetPushTokenRequest_ApnsTokenRequest_)(nil), - (*SetPushTokenRequest_FcmTokenRequest_)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_device_proto_rawDesc), len(file_org_signal_chat_device_proto_rawDesc)), - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_device_proto_goTypes, - DependencyIndexes: file_org_signal_chat_device_proto_depIdxs, - MessageInfos: file_org_signal_chat_device_proto_msgTypes, - }.Build() - File_org_signal_chat_device_proto = out.File - file_org_signal_chat_device_proto_goTypes = nil - file_org_signal_chat_device_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/device/device_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/device/device_grpc.pb.go deleted file mode 100644 index fb11aa6..0000000 --- a/pkg/signalmeow/protobuf/rpc/device/device_grpc.pb.go +++ /dev/null @@ -1,349 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/device.proto - -package device - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Devices_GetDevices_FullMethodName = "/org.signal.chat.device.Devices/GetDevices" - Devices_RemoveDevice_FullMethodName = "/org.signal.chat.device.Devices/RemoveDevice" - Devices_SetDeviceName_FullMethodName = "/org.signal.chat.device.Devices/SetDeviceName" - Devices_SetPushToken_FullMethodName = "/org.signal.chat.device.Devices/SetPushToken" - Devices_ClearPushToken_FullMethodName = "/org.signal.chat.device.Devices/ClearPushToken" - Devices_SetCapabilities_FullMethodName = "/org.signal.chat.device.Devices/SetCapabilities" -) - -// DevicesClient is the client API for Devices service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with devices attached to a Signal account. -type DevicesClient interface { - // Returns a list of devices associated with the caller's account. - GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (*GetDevicesResponse, error) - // Removes a linked device from the caller's account. - // - // Linked devices may only remove themselves. Primary devices may remove - // any device other than themselves. - RemoveDevice(ctx context.Context, in *RemoveDeviceRequest, opts ...grpc.CallOption) (*RemoveDeviceResponse, error) - // Sets the encrypted human-readable name for a specific devices. Primary - // devices may change the name of any device associated with their account, - // but linked devices may only change their own name. The response will - // indicate if the target device was not found. - SetDeviceName(ctx context.Context, in *SetDeviceNameRequest, opts ...grpc.CallOption) (*SetDeviceNameResponse, error) - // Sets the token(s) the server should use to send new message notifications - // to the authenticated device. - SetPushToken(ctx context.Context, in *SetPushTokenRequest, opts ...grpc.CallOption) (*SetPushTokenResponse, error) - // Removes any push tokens associated with the authenticated device. After - // calling this method, the server will assume that the authenticated device - // will periodically poll for new messages. - ClearPushToken(ctx context.Context, in *ClearPushTokenRequest, opts ...grpc.CallOption) (*ClearPushTokenResponse, error) - // Declares that the authenticated device supports certain features. - SetCapabilities(ctx context.Context, in *SetCapabilitiesRequest, opts ...grpc.CallOption) (*SetCapabilitiesResponse, error) -} - -type devicesClient struct { - cc grpc.ClientConnInterface -} - -func NewDevicesClient(cc grpc.ClientConnInterface) DevicesClient { - return &devicesClient{cc} -} - -func (c *devicesClient) GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (*GetDevicesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetDevicesResponse) - err := c.cc.Invoke(ctx, Devices_GetDevices_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *devicesClient) RemoveDevice(ctx context.Context, in *RemoveDeviceRequest, opts ...grpc.CallOption) (*RemoveDeviceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RemoveDeviceResponse) - err := c.cc.Invoke(ctx, Devices_RemoveDevice_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *devicesClient) SetDeviceName(ctx context.Context, in *SetDeviceNameRequest, opts ...grpc.CallOption) (*SetDeviceNameResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetDeviceNameResponse) - err := c.cc.Invoke(ctx, Devices_SetDeviceName_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *devicesClient) SetPushToken(ctx context.Context, in *SetPushTokenRequest, opts ...grpc.CallOption) (*SetPushTokenResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetPushTokenResponse) - err := c.cc.Invoke(ctx, Devices_SetPushToken_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *devicesClient) ClearPushToken(ctx context.Context, in *ClearPushTokenRequest, opts ...grpc.CallOption) (*ClearPushTokenResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ClearPushTokenResponse) - err := c.cc.Invoke(ctx, Devices_ClearPushToken_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *devicesClient) SetCapabilities(ctx context.Context, in *SetCapabilitiesRequest, opts ...grpc.CallOption) (*SetCapabilitiesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetCapabilitiesResponse) - err := c.cc.Invoke(ctx, Devices_SetCapabilities_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DevicesServer is the server API for Devices service. -// All implementations must embed UnimplementedDevicesServer -// for forward compatibility. -// -// Provides methods for working with devices attached to a Signal account. -type DevicesServer interface { - // Returns a list of devices associated with the caller's account. - GetDevices(context.Context, *GetDevicesRequest) (*GetDevicesResponse, error) - // Removes a linked device from the caller's account. - // - // Linked devices may only remove themselves. Primary devices may remove - // any device other than themselves. - RemoveDevice(context.Context, *RemoveDeviceRequest) (*RemoveDeviceResponse, error) - // Sets the encrypted human-readable name for a specific devices. Primary - // devices may change the name of any device associated with their account, - // but linked devices may only change their own name. The response will - // indicate if the target device was not found. - SetDeviceName(context.Context, *SetDeviceNameRequest) (*SetDeviceNameResponse, error) - // Sets the token(s) the server should use to send new message notifications - // to the authenticated device. - SetPushToken(context.Context, *SetPushTokenRequest) (*SetPushTokenResponse, error) - // Removes any push tokens associated with the authenticated device. After - // calling this method, the server will assume that the authenticated device - // will periodically poll for new messages. - ClearPushToken(context.Context, *ClearPushTokenRequest) (*ClearPushTokenResponse, error) - // Declares that the authenticated device supports certain features. - SetCapabilities(context.Context, *SetCapabilitiesRequest) (*SetCapabilitiesResponse, error) - mustEmbedUnimplementedDevicesServer() -} - -// UnimplementedDevicesServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedDevicesServer struct{} - -func (UnimplementedDevicesServer) GetDevices(context.Context, *GetDevicesRequest) (*GetDevicesResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetDevices not implemented") -} -func (UnimplementedDevicesServer) RemoveDevice(context.Context, *RemoveDeviceRequest) (*RemoveDeviceResponse, error) { - return nil, status.Error(codes.Unimplemented, "method RemoveDevice not implemented") -} -func (UnimplementedDevicesServer) SetDeviceName(context.Context, *SetDeviceNameRequest) (*SetDeviceNameResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetDeviceName not implemented") -} -func (UnimplementedDevicesServer) SetPushToken(context.Context, *SetPushTokenRequest) (*SetPushTokenResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetPushToken not implemented") -} -func (UnimplementedDevicesServer) ClearPushToken(context.Context, *ClearPushTokenRequest) (*ClearPushTokenResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ClearPushToken not implemented") -} -func (UnimplementedDevicesServer) SetCapabilities(context.Context, *SetCapabilitiesRequest) (*SetCapabilitiesResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetCapabilities not implemented") -} -func (UnimplementedDevicesServer) mustEmbedUnimplementedDevicesServer() {} -func (UnimplementedDevicesServer) testEmbeddedByValue() {} - -// UnsafeDevicesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DevicesServer will -// result in compilation errors. -type UnsafeDevicesServer interface { - mustEmbedUnimplementedDevicesServer() -} - -func RegisterDevicesServer(s grpc.ServiceRegistrar, srv DevicesServer) { - // If the following call panics, it indicates UnimplementedDevicesServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Devices_ServiceDesc, srv) -} - -func _Devices_GetDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDevicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DevicesServer).GetDevices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Devices_GetDevices_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DevicesServer).GetDevices(ctx, req.(*GetDevicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Devices_RemoveDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveDeviceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DevicesServer).RemoveDevice(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Devices_RemoveDevice_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DevicesServer).RemoveDevice(ctx, req.(*RemoveDeviceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Devices_SetDeviceName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetDeviceNameRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DevicesServer).SetDeviceName(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Devices_SetDeviceName_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DevicesServer).SetDeviceName(ctx, req.(*SetDeviceNameRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Devices_SetPushToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetPushTokenRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DevicesServer).SetPushToken(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Devices_SetPushToken_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DevicesServer).SetPushToken(ctx, req.(*SetPushTokenRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Devices_ClearPushToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ClearPushTokenRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DevicesServer).ClearPushToken(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Devices_ClearPushToken_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DevicesServer).ClearPushToken(ctx, req.(*ClearPushTokenRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Devices_SetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetCapabilitiesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DevicesServer).SetCapabilities(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Devices_SetCapabilities_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DevicesServer).SetCapabilities(ctx, req.(*SetCapabilitiesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Devices_ServiceDesc is the grpc.ServiceDesc for Devices service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Devices_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.device.Devices", - HandlerType: (*DevicesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetDevices", - Handler: _Devices_GetDevices_Handler, - }, - { - MethodName: "RemoveDevice", - Handler: _Devices_RemoveDevice_Handler, - }, - { - MethodName: "SetDeviceName", - Handler: _Devices_SetDeviceName_Handler, - }, - { - MethodName: "SetPushToken", - Handler: _Devices_SetPushToken_Handler, - }, - { - MethodName: "ClearPushToken", - Handler: _Devices_ClearPushToken_Handler, - }, - { - MethodName: "SetCapabilities", - Handler: _Devices_SetCapabilities_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/device.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/donations/donations.pb.go b/pkg/signalmeow/protobuf/rpc/donations/donations.pb.go deleted file mode 100644 index df63597..0000000 --- a/pkg/signalmeow/protobuf/rpc/donations/donations.pb.go +++ /dev/null @@ -1,373 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/donations.proto - -package donations - -import ( - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RedeemReceiptRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Presentation of the ZK receipt acquired when the subscription was created - ReceiptCredentialPresentation []byte `protobuf:"bytes,1,opt,name=receiptCredentialPresentation,proto3" json:"receiptCredentialPresentation,omitempty"` - // If true, the corresponding badge should be visible on the profile - Visible bool `protobuf:"varint,2,opt,name=visible,proto3" json:"visible,omitempty"` - // If true, and the new badge is visible, it should be the primary badge on the profile - Primary bool `protobuf:"varint,3,opt,name=primary,proto3" json:"primary,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RedeemReceiptRequest) Reset() { - *x = RedeemReceiptRequest{} - mi := &file_org_signal_chat_donations_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RedeemReceiptRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RedeemReceiptRequest) ProtoMessage() {} - -func (x *RedeemReceiptRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_donations_proto_msgTypes[0] - 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 RedeemReceiptRequest.ProtoReflect.Descriptor instead. -func (*RedeemReceiptRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_donations_proto_rawDescGZIP(), []int{0} -} - -func (x *RedeemReceiptRequest) GetReceiptCredentialPresentation() []byte { - if x != nil { - return x.ReceiptCredentialPresentation - } - return nil -} - -func (x *RedeemReceiptRequest) GetVisible() bool { - if x != nil { - return x.Visible - } - return false -} - -func (x *RedeemReceiptRequest) GetPrimary() bool { - if x != nil { - return x.Primary - } - return false -} - -type RedeemReceiptResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *RedeemReceiptResponse_Success - // *RedeemReceiptResponse_FailedAuthentication - // *RedeemReceiptResponse_AlreadyRedeemed - Response isRedeemReceiptResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RedeemReceiptResponse) Reset() { - *x = RedeemReceiptResponse{} - mi := &file_org_signal_chat_donations_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RedeemReceiptResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RedeemReceiptResponse) ProtoMessage() {} - -func (x *RedeemReceiptResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_donations_proto_msgTypes[1] - 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 RedeemReceiptResponse.ProtoReflect.Descriptor instead. -func (*RedeemReceiptResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_donations_proto_rawDescGZIP(), []int{1} -} - -func (x *RedeemReceiptResponse) GetResponse() isRedeemReceiptResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *RedeemReceiptResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*RedeemReceiptResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *RedeemReceiptResponse) GetFailedAuthentication() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*RedeemReceiptResponse_FailedAuthentication); ok { - return x.FailedAuthentication - } - } - return nil -} - -func (x *RedeemReceiptResponse) GetAlreadyRedeemed() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*RedeemReceiptResponse_AlreadyRedeemed); ok { - return x.AlreadyRedeemed - } - } - return nil -} - -type isRedeemReceiptResponse_Response interface { - isRedeemReceiptResponse_Response() -} - -type RedeemReceiptResponse_Success struct { - // The receipt was successfully redeemed - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type RedeemReceiptResponse_FailedAuthentication struct { - // The provided presentation is invalid - FailedAuthentication *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=failed_authentication,json=failedAuthentication,proto3,oneof"` -} - -type RedeemReceiptResponse_AlreadyRedeemed struct { - // The receipt was already redeemed for a different account - AlreadyRedeemed *errors.FailedPrecondition `protobuf:"bytes,3,opt,name=already_redeemed,json=alreadyRedeemed,proto3,oneof"` -} - -func (*RedeemReceiptResponse_Success) isRedeemReceiptResponse_Response() {} - -func (*RedeemReceiptResponse_FailedAuthentication) isRedeemReceiptResponse_Response() {} - -func (*RedeemReceiptResponse_AlreadyRedeemed) isRedeemReceiptResponse_Response() {} - -type CreateDonationPermitRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // a serialized libsignal DonationPermitRequest - DonationPermitRequest []byte `protobuf:"bytes,1,opt,name=donation_permit_request,json=donationPermitRequest,proto3" json:"donation_permit_request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateDonationPermitRequest) Reset() { - *x = CreateDonationPermitRequest{} - mi := &file_org_signal_chat_donations_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateDonationPermitRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateDonationPermitRequest) ProtoMessage() {} - -func (x *CreateDonationPermitRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_donations_proto_msgTypes[2] - 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 CreateDonationPermitRequest.ProtoReflect.Descriptor instead. -func (*CreateDonationPermitRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_donations_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateDonationPermitRequest) GetDonationPermitRequest() []byte { - if x != nil { - return x.DonationPermitRequest - } - return nil -} - -type CreateDonationPermitResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // a serialized libsignal DonationPermitResponse - DonationPermitResponse []byte `protobuf:"bytes,1,opt,name=donation_permit_response,json=donationPermitResponse,proto3" json:"donation_permit_response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateDonationPermitResponse) Reset() { - *x = CreateDonationPermitResponse{} - mi := &file_org_signal_chat_donations_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateDonationPermitResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateDonationPermitResponse) ProtoMessage() {} - -func (x *CreateDonationPermitResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_donations_proto_msgTypes[3] - 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 CreateDonationPermitResponse.ProtoReflect.Descriptor instead. -func (*CreateDonationPermitResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_donations_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateDonationPermitResponse) GetDonationPermitResponse() []byte { - if x != nil { - return x.DonationPermitResponse - } - return nil -} - -var File_org_signal_chat_donations_proto protoreflect.FileDescriptor - -const file_org_signal_chat_donations_proto_rawDesc = "" + - "\n" + - "\x1forg/signal/chat/donations.proto\x12\x19org.signal.chat.donations\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x19org/signal/chat/tag.proto\"\x98\x01\n" + - "\x14RedeemReceiptRequest\x12L\n" + - "\x1dreceiptCredentialPresentation\x18\x01 \x01(\fB\x06\xa2\x97\"\x02\xc9\x02R\x1dreceiptCredentialPresentation\x12\x18\n" + - "\avisible\x18\x02 \x01(\bR\avisible\x12\x18\n" + - "\aprimary\x18\x03 \x01(\bR\aprimary\"\xc9\x02\n" + - "\x15RedeemReceiptResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12\x80\x01\n" + - "\x15failed_authentication\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x19\xc2\xd5\"\x15failed_authenticationH\x00R\x14failedAuthentication\x12m\n" + - "\x10already_redeemed\x18\x03 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x14\xc2\xd5\"\x10already_redeemedH\x00R\x0falreadyRedeemedB\n" + - "\n" + - "\bresponse\"[\n" + - "\x1bCreateDonationPermitRequest\x12<\n" + - "\x17donation_permit_request\x18\x01 \x01(\fB\x04\x88\x97\"\x01R\x15donationPermitRequest\"X\n" + - "\x1cCreateDonationPermitResponse\x128\n" + - "\x18donation_permit_response\x18\x01 \x01(\fR\x16donationPermitResponse2\x93\x02\n" + - "\tDonations\x12t\n" + - "\rRedeemReceipt\x12/.org.signal.chat.donations.RedeemReceiptRequest\x1a0.org.signal.chat.donations.RedeemReceiptResponse\"\x00\x12\x89\x01\n" + - "\x14CreateDonationPermit\x126.org.signal.chat.donations.CreateDonationPermitRequest\x1a7.org.signal.chat.donations.CreateDonationPermitResponse\"\x00\x1a\x04\xc8\xd5\"\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_donations_proto_rawDescOnce sync.Once - file_org_signal_chat_donations_proto_rawDescData []byte -) - -func file_org_signal_chat_donations_proto_rawDescGZIP() []byte { - file_org_signal_chat_donations_proto_rawDescOnce.Do(func() { - file_org_signal_chat_donations_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_donations_proto_rawDesc), len(file_org_signal_chat_donations_proto_rawDesc))) - }) - return file_org_signal_chat_donations_proto_rawDescData -} - -var file_org_signal_chat_donations_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_org_signal_chat_donations_proto_goTypes = []any{ - (*RedeemReceiptRequest)(nil), // 0: org.signal.chat.donations.RedeemReceiptRequest - (*RedeemReceiptResponse)(nil), // 1: org.signal.chat.donations.RedeemReceiptResponse - (*CreateDonationPermitRequest)(nil), // 2: org.signal.chat.donations.CreateDonationPermitRequest - (*CreateDonationPermitResponse)(nil), // 3: org.signal.chat.donations.CreateDonationPermitResponse - (*emptypb.Empty)(nil), // 4: google.protobuf.Empty - (*errors.FailedZkAuthentication)(nil), // 5: org.signal.chat.errors.FailedZkAuthentication - (*errors.FailedPrecondition)(nil), // 6: org.signal.chat.errors.FailedPrecondition -} -var file_org_signal_chat_donations_proto_depIdxs = []int32{ - 4, // 0: org.signal.chat.donations.RedeemReceiptResponse.success:type_name -> google.protobuf.Empty - 5, // 1: org.signal.chat.donations.RedeemReceiptResponse.failed_authentication:type_name -> org.signal.chat.errors.FailedZkAuthentication - 6, // 2: org.signal.chat.donations.RedeemReceiptResponse.already_redeemed:type_name -> org.signal.chat.errors.FailedPrecondition - 0, // 3: org.signal.chat.donations.Donations.RedeemReceipt:input_type -> org.signal.chat.donations.RedeemReceiptRequest - 2, // 4: org.signal.chat.donations.Donations.CreateDonationPermit:input_type -> org.signal.chat.donations.CreateDonationPermitRequest - 1, // 5: org.signal.chat.donations.Donations.RedeemReceipt:output_type -> org.signal.chat.donations.RedeemReceiptResponse - 3, // 6: org.signal.chat.donations.Donations.CreateDonationPermit:output_type -> org.signal.chat.donations.CreateDonationPermitResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_donations_proto_init() } -func file_org_signal_chat_donations_proto_init() { - if File_org_signal_chat_donations_proto != nil { - return - } - file_org_signal_chat_donations_proto_msgTypes[1].OneofWrappers = []any{ - (*RedeemReceiptResponse_Success)(nil), - (*RedeemReceiptResponse_FailedAuthentication)(nil), - (*RedeemReceiptResponse_AlreadyRedeemed)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_donations_proto_rawDesc), len(file_org_signal_chat_donations_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_donations_proto_goTypes, - DependencyIndexes: file_org_signal_chat_donations_proto_depIdxs, - MessageInfos: file_org_signal_chat_donations_proto_msgTypes, - }.Build() - File_org_signal_chat_donations_proto = out.File - file_org_signal_chat_donations_proto_goTypes = nil - file_org_signal_chat_donations_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/donations/donations_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/donations/donations_grpc.pb.go deleted file mode 100644 index 7868dd8..0000000 --- a/pkg/signalmeow/protobuf/rpc/donations/donations_grpc.pb.go +++ /dev/null @@ -1,177 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/donations.proto - -package donations - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Donations_RedeemReceipt_FullMethodName = "/org.signal.chat.donations.Donations/RedeemReceipt" - Donations_CreateDonationPermit_FullMethodName = "/org.signal.chat.donations.Donations/CreateDonationPermit" -) - -// DonationsClient is the client API for Donations service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type DonationsClient interface { - // Redeem a receipt acquired from Subscriptions.CreateSubscriptionReceiptCredentials - // to add a badge to the account. After successful redemption, profile - // responses will include the corresponding badge (if configured as visible) - // until the expiration time on the receipt. - RedeemReceipt(ctx context.Context, in *RedeemReceiptRequest, opts ...grpc.CallOption) (*RedeemReceiptResponse, error) - // Generate a set of anonymous, single-use, permits for use with /v1/subscription endpoints. - // - // If rate limited, reduce requested permit count and/or try again after the prescribed delay. - CreateDonationPermit(ctx context.Context, in *CreateDonationPermitRequest, opts ...grpc.CallOption) (*CreateDonationPermitResponse, error) -} - -type donationsClient struct { - cc grpc.ClientConnInterface -} - -func NewDonationsClient(cc grpc.ClientConnInterface) DonationsClient { - return &donationsClient{cc} -} - -func (c *donationsClient) RedeemReceipt(ctx context.Context, in *RedeemReceiptRequest, opts ...grpc.CallOption) (*RedeemReceiptResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RedeemReceiptResponse) - err := c.cc.Invoke(ctx, Donations_RedeemReceipt_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *donationsClient) CreateDonationPermit(ctx context.Context, in *CreateDonationPermitRequest, opts ...grpc.CallOption) (*CreateDonationPermitResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateDonationPermitResponse) - err := c.cc.Invoke(ctx, Donations_CreateDonationPermit_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// DonationsServer is the server API for Donations service. -// All implementations must embed UnimplementedDonationsServer -// for forward compatibility. -type DonationsServer interface { - // Redeem a receipt acquired from Subscriptions.CreateSubscriptionReceiptCredentials - // to add a badge to the account. After successful redemption, profile - // responses will include the corresponding badge (if configured as visible) - // until the expiration time on the receipt. - RedeemReceipt(context.Context, *RedeemReceiptRequest) (*RedeemReceiptResponse, error) - // Generate a set of anonymous, single-use, permits for use with /v1/subscription endpoints. - // - // If rate limited, reduce requested permit count and/or try again after the prescribed delay. - CreateDonationPermit(context.Context, *CreateDonationPermitRequest) (*CreateDonationPermitResponse, error) - mustEmbedUnimplementedDonationsServer() -} - -// UnimplementedDonationsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedDonationsServer struct{} - -func (UnimplementedDonationsServer) RedeemReceipt(context.Context, *RedeemReceiptRequest) (*RedeemReceiptResponse, error) { - return nil, status.Error(codes.Unimplemented, "method RedeemReceipt not implemented") -} -func (UnimplementedDonationsServer) CreateDonationPermit(context.Context, *CreateDonationPermitRequest) (*CreateDonationPermitResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreateDonationPermit not implemented") -} -func (UnimplementedDonationsServer) mustEmbedUnimplementedDonationsServer() {} -func (UnimplementedDonationsServer) testEmbeddedByValue() {} - -// UnsafeDonationsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to DonationsServer will -// result in compilation errors. -type UnsafeDonationsServer interface { - mustEmbedUnimplementedDonationsServer() -} - -func RegisterDonationsServer(s grpc.ServiceRegistrar, srv DonationsServer) { - // If the following call panics, it indicates UnimplementedDonationsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Donations_ServiceDesc, srv) -} - -func _Donations_RedeemReceipt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RedeemReceiptRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DonationsServer).RedeemReceipt(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Donations_RedeemReceipt_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DonationsServer).RedeemReceipt(ctx, req.(*RedeemReceiptRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Donations_CreateDonationPermit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateDonationPermitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(DonationsServer).CreateDonationPermit(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Donations_CreateDonationPermit_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(DonationsServer).CreateDonationPermit(ctx, req.(*CreateDonationPermitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Donations_ServiceDesc is the grpc.ServiceDesc for Donations service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Donations_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.donations.Donations", - HandlerType: (*DonationsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RedeemReceipt", - Handler: _Donations_RedeemReceipt_Handler, - }, - { - MethodName: "CreateDonationPermit", - Handler: _Donations_CreateDonationPermit_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/donations.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/errors/errors.pb.go b/pkg/signalmeow/protobuf/rpc/errors/errors.pb.go deleted file mode 100644 index ba862bd..0000000 --- a/pkg/signalmeow/protobuf/rpc/errors/errors.pb.go +++ /dev/null @@ -1,269 +0,0 @@ -// -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/errors.proto - -package errors - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Response message that indicates a particular resource was not found. -type NotFound struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NotFound) Reset() { - *x = NotFound{} - mi := &file_org_signal_chat_errors_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NotFound) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotFound) ProtoMessage() {} - -func (x *NotFound) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_errors_proto_msgTypes[0] - 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 NotFound.ProtoReflect.Descriptor instead. -func (*NotFound) Descriptor() ([]byte, []int) { - return file_org_signal_chat_errors_proto_rawDescGZIP(), []int{0} -} - -// Response message that indicates that some precondition of the request was not -// met. For example, if there was a request to update foo, but foo had not been -// set, this would be an appropriate error. -type FailedPrecondition struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An optional description indicating what precondition failed. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FailedPrecondition) Reset() { - *x = FailedPrecondition{} - mi := &file_org_signal_chat_errors_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FailedPrecondition) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FailedPrecondition) ProtoMessage() {} - -func (x *FailedPrecondition) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_errors_proto_msgTypes[1] - 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 FailedPrecondition.ProtoReflect.Descriptor instead. -func (*FailedPrecondition) Descriptor() ([]byte, []int) { - return file_org_signal_chat_errors_proto_rawDescGZIP(), []int{1} -} - -func (x *FailedPrecondition) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -// Response message that authentication via an anonymous credential failed. -type FailedZkAuthentication struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An optional description with additional information about the failure. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FailedZkAuthentication) Reset() { - *x = FailedZkAuthentication{} - mi := &file_org_signal_chat_errors_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FailedZkAuthentication) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FailedZkAuthentication) ProtoMessage() {} - -func (x *FailedZkAuthentication) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_errors_proto_msgTypes[2] - 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 FailedZkAuthentication.ProtoReflect.Descriptor instead. -func (*FailedZkAuthentication) Descriptor() ([]byte, []int) { - return file_org_signal_chat_errors_proto_rawDescGZIP(), []int{2} -} - -func (x *FailedZkAuthentication) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -// Response message that indicates authorization to perform an unidentified -// operation via an endorsement or access key failed -type FailedUnidentifiedAuthorization struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An optional description with additional information about the failure. - Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *FailedUnidentifiedAuthorization) Reset() { - *x = FailedUnidentifiedAuthorization{} - mi := &file_org_signal_chat_errors_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *FailedUnidentifiedAuthorization) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FailedUnidentifiedAuthorization) ProtoMessage() {} - -func (x *FailedUnidentifiedAuthorization) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_errors_proto_msgTypes[3] - 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 FailedUnidentifiedAuthorization.ProtoReflect.Descriptor instead. -func (*FailedUnidentifiedAuthorization) Descriptor() ([]byte, []int) { - return file_org_signal_chat_errors_proto_rawDescGZIP(), []int{3} -} - -func (x *FailedUnidentifiedAuthorization) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -var File_org_signal_chat_errors_proto protoreflect.FileDescriptor - -const file_org_signal_chat_errors_proto_rawDesc = "" + - "\n" + - "\x1corg/signal/chat/errors.proto\x12\x16org.signal.chat.errors\"\n" + - "\n" + - "\bNotFound\"6\n" + - "\x12FailedPrecondition\x12 \n" + - "\vdescription\x18\x01 \x01(\tR\vdescription\":\n" + - "\x16FailedZkAuthentication\x12 \n" + - "\vdescription\x18\x01 \x01(\tR\vdescription\"C\n" + - "\x1fFailedUnidentifiedAuthorization\x12 \n" + - "\vdescription\x18\x01 \x01(\tR\vdescriptionB\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_errors_proto_rawDescOnce sync.Once - file_org_signal_chat_errors_proto_rawDescData []byte -) - -func file_org_signal_chat_errors_proto_rawDescGZIP() []byte { - file_org_signal_chat_errors_proto_rawDescOnce.Do(func() { - file_org_signal_chat_errors_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_errors_proto_rawDesc), len(file_org_signal_chat_errors_proto_rawDesc))) - }) - return file_org_signal_chat_errors_proto_rawDescData -} - -var file_org_signal_chat_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_org_signal_chat_errors_proto_goTypes = []any{ - (*NotFound)(nil), // 0: org.signal.chat.errors.NotFound - (*FailedPrecondition)(nil), // 1: org.signal.chat.errors.FailedPrecondition - (*FailedZkAuthentication)(nil), // 2: org.signal.chat.errors.FailedZkAuthentication - (*FailedUnidentifiedAuthorization)(nil), // 3: org.signal.chat.errors.FailedUnidentifiedAuthorization -} -var file_org_signal_chat_errors_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_errors_proto_init() } -func file_org_signal_chat_errors_proto_init() { - if File_org_signal_chat_errors_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_errors_proto_rawDesc), len(file_org_signal_chat_errors_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_org_signal_chat_errors_proto_goTypes, - DependencyIndexes: file_org_signal_chat_errors_proto_depIdxs, - MessageInfos: file_org_signal_chat_errors_proto_msgTypes, - }.Build() - File_org_signal_chat_errors_proto = out.File - file_org_signal_chat_errors_proto_goTypes = nil - file_org_signal_chat_errors_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/keys/keys.pb.go b/pkg/signalmeow/protobuf/rpc/keys/keys.pb.go deleted file mode 100644 index 89be3b3..0000000 --- a/pkg/signalmeow/protobuf/rpc/keys/keys.pb.go +++ /dev/null @@ -1,1217 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/keys.proto - -package keys - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetPreKeyCountRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPreKeyCountRequest) Reset() { - *x = GetPreKeyCountRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPreKeyCountRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPreKeyCountRequest) ProtoMessage() {} - -func (x *GetPreKeyCountRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[0] - 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 GetPreKeyCountRequest.ProtoReflect.Descriptor instead. -func (*GetPreKeyCountRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{0} -} - -type GetPreKeyCountResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The approximate number of one-time EC pre-keys stored for the - // authenticated device and associated with the caller's ACI. - AciEcPreKeyCount uint32 `protobuf:"varint,1,opt,name=aci_ec_pre_key_count,json=aciEcPreKeyCount,proto3" json:"aci_ec_pre_key_count,omitempty"` - // The approximate number of one-time Kyber pre-keys stored for the - // authenticated device and associated with the caller's ACI. - AciKemPreKeyCount uint32 `protobuf:"varint,2,opt,name=aci_kem_pre_key_count,json=aciKemPreKeyCount,proto3" json:"aci_kem_pre_key_count,omitempty"` - // The approximate number of one-time EC pre-keys stored for the - // authenticated device and associated with the caller's PNI. 0 if - // the account does not possess a phone number. - PniEcPreKeyCount uint32 `protobuf:"varint,3,opt,name=pni_ec_pre_key_count,json=pniEcPreKeyCount,proto3" json:"pni_ec_pre_key_count,omitempty"` - // The approximate number of one-time KEM pre-keys stored for the - // authenticated device and associated with the caller's PNI. 0 if - // the account does not possess a phone number. - PniKemPreKeyCount uint32 `protobuf:"varint,4,opt,name=pni_kem_pre_key_count,json=pniKemPreKeyCount,proto3" json:"pni_kem_pre_key_count,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPreKeyCountResponse) Reset() { - *x = GetPreKeyCountResponse{} - mi := &file_org_signal_chat_keys_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPreKeyCountResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPreKeyCountResponse) ProtoMessage() {} - -func (x *GetPreKeyCountResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[1] - 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 GetPreKeyCountResponse.ProtoReflect.Descriptor instead. -func (*GetPreKeyCountResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{1} -} - -func (x *GetPreKeyCountResponse) GetAciEcPreKeyCount() uint32 { - if x != nil { - return x.AciEcPreKeyCount - } - return 0 -} - -func (x *GetPreKeyCountResponse) GetAciKemPreKeyCount() uint32 { - if x != nil { - return x.AciKemPreKeyCount - } - return 0 -} - -func (x *GetPreKeyCountResponse) GetPniEcPreKeyCount() uint32 { - if x != nil { - return x.PniEcPreKeyCount - } - return 0 -} - -func (x *GetPreKeyCountResponse) GetPniKemPreKeyCount() uint32 { - if x != nil { - return x.PniKemPreKeyCount - } - return 0 -} - -type GetPreKeysRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier of the account for which to retrieve pre-keys. - TargetIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=target_identifier,json=targetIdentifier,proto3" json:"target_identifier,omitempty"` - // The ID of the device associated with the targeted account for which to - // retrieve pre-keys. If not set, pre-keys are returned for all devices - // associated with the targeted account. - DeviceId *uint32 `protobuf:"varint,2,opt,name=device_id,json=deviceId,proto3,oneof" json:"device_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPreKeysRequest) Reset() { - *x = GetPreKeysRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPreKeysRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPreKeysRequest) ProtoMessage() {} - -func (x *GetPreKeysRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[2] - 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 GetPreKeysRequest.ProtoReflect.Descriptor instead. -func (*GetPreKeysRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{2} -} - -func (x *GetPreKeysRequest) GetTargetIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.TargetIdentifier - } - return nil -} - -func (x *GetPreKeysRequest) GetDeviceId() uint32 { - if x != nil && x.DeviceId != nil { - return *x.DeviceId - } - return 0 -} - -type GetPreKeysAnonymousRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The request to retrieve pre-keys for a specific account/device(s). - Request *GetPreKeysRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // A means to authorize the request. - // - // Types that are valid to be assigned to Authorization: - // - // *GetPreKeysAnonymousRequest_UnidentifiedAccessKey - // *GetPreKeysAnonymousRequest_GroupSendToken - // *GetPreKeysAnonymousRequest_UnrestrictedAccess - Authorization isGetPreKeysAnonymousRequest_Authorization `protobuf_oneof:"authorization"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPreKeysAnonymousRequest) Reset() { - *x = GetPreKeysAnonymousRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPreKeysAnonymousRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPreKeysAnonymousRequest) ProtoMessage() {} - -func (x *GetPreKeysAnonymousRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[3] - 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 GetPreKeysAnonymousRequest.ProtoReflect.Descriptor instead. -func (*GetPreKeysAnonymousRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{3} -} - -func (x *GetPreKeysAnonymousRequest) GetRequest() *GetPreKeysRequest { - if x != nil { - return x.Request - } - return nil -} - -func (x *GetPreKeysAnonymousRequest) GetAuthorization() isGetPreKeysAnonymousRequest_Authorization { - if x != nil { - return x.Authorization - } - return nil -} - -func (x *GetPreKeysAnonymousRequest) GetUnidentifiedAccessKey() []byte { - if x != nil { - if x, ok := x.Authorization.(*GetPreKeysAnonymousRequest_UnidentifiedAccessKey); ok { - return x.UnidentifiedAccessKey - } - } - return nil -} - -func (x *GetPreKeysAnonymousRequest) GetGroupSendToken() []byte { - if x != nil { - if x, ok := x.Authorization.(*GetPreKeysAnonymousRequest_GroupSendToken); ok { - return x.GroupSendToken - } - } - return nil -} - -func (x *GetPreKeysAnonymousRequest) GetUnrestrictedAccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Authorization.(*GetPreKeysAnonymousRequest_UnrestrictedAccess); ok { - return x.UnrestrictedAccess - } - } - return nil -} - -type isGetPreKeysAnonymousRequest_Authorization interface { - isGetPreKeysAnonymousRequest_Authorization() -} - -type GetPreKeysAnonymousRequest_UnidentifiedAccessKey struct { - // The unidentified access key (UAK) for the targeted account. - UnidentifiedAccessKey []byte `protobuf:"bytes,2,opt,name=unidentified_access_key,json=unidentifiedAccessKey,proto3,oneof"` -} - -type GetPreKeysAnonymousRequest_GroupSendToken struct { - // A group send endorsement token for the targeted account. - GroupSendToken []byte `protobuf:"bytes,3,opt,name=group_send_token,json=groupSendToken,proto3,oneof"` -} - -type GetPreKeysAnonymousRequest_UnrestrictedAccess struct { - // The destination account allows unrestricted unidentified access - UnrestrictedAccess *emptypb.Empty `protobuf:"bytes,4,opt,name=unrestricted_access,json=unrestrictedAccess,proto3,oneof"` -} - -func (*GetPreKeysAnonymousRequest_UnidentifiedAccessKey) isGetPreKeysAnonymousRequest_Authorization() { -} - -func (*GetPreKeysAnonymousRequest_GroupSendToken) isGetPreKeysAnonymousRequest_Authorization() {} - -func (*GetPreKeysAnonymousRequest_UnrestrictedAccess) isGetPreKeysAnonymousRequest_Authorization() {} - -type DevicePreKeyBundle struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The EC signed pre-key associated with the targeted - // account/device/identity. - EcSignedPreKey *common.EcSignedPreKey `protobuf:"bytes,1,opt,name=ec_signed_pre_key,json=ecSignedPreKey,proto3" json:"ec_signed_pre_key,omitempty"` - // A one-time EC pre-key for the targeted account/device/identity. May not - // be set if no one-time EC pre-keys are available. - EcOneTimePreKey *common.EcPreKey `protobuf:"bytes,2,opt,name=ec_one_time_pre_key,json=ecOneTimePreKey,proto3" json:"ec_one_time_pre_key,omitempty"` - // A one-time KEM pre-key (or a last-resort KEM pre-key) for the targeted - // account/device/identity. - KemOneTimePreKey *common.KemSignedPreKey `protobuf:"bytes,3,opt,name=kem_one_time_pre_key,json=kemOneTimePreKey,proto3" json:"kem_one_time_pre_key,omitempty"` - // The registration ID for the targeted account/device/identity. - RegistrationId uint32 `protobuf:"varint,4,opt,name=registration_id,json=registrationId,proto3" json:"registration_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DevicePreKeyBundle) Reset() { - *x = DevicePreKeyBundle{} - mi := &file_org_signal_chat_keys_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DevicePreKeyBundle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DevicePreKeyBundle) ProtoMessage() {} - -func (x *DevicePreKeyBundle) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[4] - 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 DevicePreKeyBundle.ProtoReflect.Descriptor instead. -func (*DevicePreKeyBundle) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{4} -} - -func (x *DevicePreKeyBundle) GetEcSignedPreKey() *common.EcSignedPreKey { - if x != nil { - return x.EcSignedPreKey - } - return nil -} - -func (x *DevicePreKeyBundle) GetEcOneTimePreKey() *common.EcPreKey { - if x != nil { - return x.EcOneTimePreKey - } - return nil -} - -func (x *DevicePreKeyBundle) GetKemOneTimePreKey() *common.KemSignedPreKey { - if x != nil { - return x.KemOneTimePreKey - } - return nil -} - -func (x *DevicePreKeyBundle) GetRegistrationId() uint32 { - if x != nil { - return x.RegistrationId - } - return 0 -} - -type AccountPreKeyBundles struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identity key associated with the targeted account/identity. - IdentityKey []byte `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` - // A map of device IDs to pre-key "bundles" for the targeted account. - DevicePreKeys map[uint32]*DevicePreKeyBundle `protobuf:"bytes,2,rep,name=device_pre_keys,json=devicePreKeys,proto3" json:"device_pre_keys,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Whether the account has enabled sealed sender from anyone. Always false - // if the request was for a PNI, which does not allow any unidentified access. - UnrestrictedUnidentifiedAccess bool `protobuf:"varint,3,opt,name=unrestricted_unidentified_access,json=unrestrictedUnidentifiedAccess,proto3" json:"unrestricted_unidentified_access,omitempty"` - // If the target supports unidentified access and has an unidentified access - // key, a fingerprint of the target's UAK. This may be used to detect a change - // in the UAK that the sender has for the target before actually sending a message. Otherwise, empty. - UnidentifiedAccessKeyFingerprint []byte `protobuf:"bytes,4,opt,name=unidentified_access_key_fingerprint,json=unidentifiedAccessKeyFingerprint,proto3" json:"unidentified_access_key_fingerprint,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountPreKeyBundles) Reset() { - *x = AccountPreKeyBundles{} - mi := &file_org_signal_chat_keys_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountPreKeyBundles) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountPreKeyBundles) ProtoMessage() {} - -func (x *AccountPreKeyBundles) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[5] - 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 AccountPreKeyBundles.ProtoReflect.Descriptor instead. -func (*AccountPreKeyBundles) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{5} -} - -func (x *AccountPreKeyBundles) GetIdentityKey() []byte { - if x != nil { - return x.IdentityKey - } - return nil -} - -func (x *AccountPreKeyBundles) GetDevicePreKeys() map[uint32]*DevicePreKeyBundle { - if x != nil { - return x.DevicePreKeys - } - return nil -} - -func (x *AccountPreKeyBundles) GetUnrestrictedUnidentifiedAccess() bool { - if x != nil { - return x.UnrestrictedUnidentifiedAccess - } - return false -} - -func (x *AccountPreKeyBundles) GetUnidentifiedAccessKeyFingerprint() []byte { - if x != nil { - return x.UnidentifiedAccessKeyFingerprint - } - return nil -} - -type GetPreKeysResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetPreKeysResponse_PreKeys - // *GetPreKeysResponse_TargetNotFound - Response isGetPreKeysResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPreKeysResponse) Reset() { - *x = GetPreKeysResponse{} - mi := &file_org_signal_chat_keys_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPreKeysResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPreKeysResponse) ProtoMessage() {} - -func (x *GetPreKeysResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[6] - 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 GetPreKeysResponse.ProtoReflect.Descriptor instead. -func (*GetPreKeysResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{6} -} - -func (x *GetPreKeysResponse) GetResponse() isGetPreKeysResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetPreKeysResponse) GetPreKeys() *AccountPreKeyBundles { - if x != nil { - if x, ok := x.Response.(*GetPreKeysResponse_PreKeys); ok { - return x.PreKeys - } - } - return nil -} - -func (x *GetPreKeysResponse) GetTargetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetPreKeysResponse_TargetNotFound); ok { - return x.TargetNotFound - } - } - return nil -} - -type isGetPreKeysResponse_Response interface { - isGetPreKeysResponse_Response() -} - -type GetPreKeysResponse_PreKeys struct { - // The requested pre-key bundles - PreKeys *AccountPreKeyBundles `protobuf:"bytes,1,opt,name=pre_keys,json=preKeys,proto3,oneof"` -} - -type GetPreKeysResponse_TargetNotFound struct { - // Either the target account was not found, no active device with the given - // ID (if specified) was found on the target account. - TargetNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=target_not_found,json=targetNotFound,proto3,oneof"` -} - -func (*GetPreKeysResponse_PreKeys) isGetPreKeysResponse_Response() {} - -func (*GetPreKeysResponse_TargetNotFound) isGetPreKeysResponse_Response() {} - -type GetPreKeysAnonymousResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetPreKeysAnonymousResponse_PreKeys - // *GetPreKeysAnonymousResponse_TargetNotFound - // *GetPreKeysAnonymousResponse_FailedUnidentifiedAuthorization - Response isGetPreKeysAnonymousResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPreKeysAnonymousResponse) Reset() { - *x = GetPreKeysAnonymousResponse{} - mi := &file_org_signal_chat_keys_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPreKeysAnonymousResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPreKeysAnonymousResponse) ProtoMessage() {} - -func (x *GetPreKeysAnonymousResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[7] - 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 GetPreKeysAnonymousResponse.ProtoReflect.Descriptor instead. -func (*GetPreKeysAnonymousResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{7} -} - -func (x *GetPreKeysAnonymousResponse) GetResponse() isGetPreKeysAnonymousResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetPreKeysAnonymousResponse) GetPreKeys() *AccountPreKeyBundles { - if x != nil { - if x, ok := x.Response.(*GetPreKeysAnonymousResponse_PreKeys); ok { - return x.PreKeys - } - } - return nil -} - -func (x *GetPreKeysAnonymousResponse) GetTargetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetPreKeysAnonymousResponse_TargetNotFound); ok { - return x.TargetNotFound - } - } - return nil -} - -func (x *GetPreKeysAnonymousResponse) GetFailedUnidentifiedAuthorization() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*GetPreKeysAnonymousResponse_FailedUnidentifiedAuthorization); ok { - return x.FailedUnidentifiedAuthorization - } - } - return nil -} - -type isGetPreKeysAnonymousResponse_Response interface { - isGetPreKeysAnonymousResponse_Response() -} - -type GetPreKeysAnonymousResponse_PreKeys struct { - // The requested pre-key bundles - PreKeys *AccountPreKeyBundles `protobuf:"bytes,1,opt,name=pre_keys,json=preKeys,proto3,oneof"` -} - -type GetPreKeysAnonymousResponse_TargetNotFound struct { - // Either the target account was not found, no active device with the given - // ID (if specified) was found on the target account. - TargetNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=target_not_found,json=targetNotFound,proto3,oneof"` -} - -type GetPreKeysAnonymousResponse_FailedUnidentifiedAuthorization struct { - // The provided unidentified authorization credential was invalid - FailedUnidentifiedAuthorization *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=failed_unidentified_authorization,json=failedUnidentifiedAuthorization,proto3,oneof"` -} - -func (*GetPreKeysAnonymousResponse_PreKeys) isGetPreKeysAnonymousResponse_Response() {} - -func (*GetPreKeysAnonymousResponse_TargetNotFound) isGetPreKeysAnonymousResponse_Response() {} - -func (*GetPreKeysAnonymousResponse_FailedUnidentifiedAuthorization) isGetPreKeysAnonymousResponse_Response() { -} - -type SetOneTimeEcPreKeysRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identity type (i.e. ACI/PNI) with which the keys in this request are - // associated. - IdentityType common.IdentityType `protobuf:"varint,1,opt,name=identity_type,json=identityType,proto3,enum=org.signal.chat.common.IdentityType" json:"identity_type,omitempty"` - // The unsigned EC pre-keys to be stored. - PreKeys []*common.EcPreKey `protobuf:"bytes,2,rep,name=pre_keys,json=preKeys,proto3" json:"pre_keys,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetOneTimeEcPreKeysRequest) Reset() { - *x = SetOneTimeEcPreKeysRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetOneTimeEcPreKeysRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetOneTimeEcPreKeysRequest) ProtoMessage() {} - -func (x *SetOneTimeEcPreKeysRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_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 SetOneTimeEcPreKeysRequest.ProtoReflect.Descriptor instead. -func (*SetOneTimeEcPreKeysRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{8} -} - -func (x *SetOneTimeEcPreKeysRequest) GetIdentityType() common.IdentityType { - if x != nil { - return x.IdentityType - } - return common.IdentityType(0) -} - -func (x *SetOneTimeEcPreKeysRequest) GetPreKeys() []*common.EcPreKey { - if x != nil { - return x.PreKeys - } - return nil -} - -type SetOneTimeKemSignedPreKeysRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identity type (i.e. ACI/PNI) with which the keys in this request are - // associated. - IdentityType common.IdentityType `protobuf:"varint,1,opt,name=identity_type,json=identityType,proto3,enum=org.signal.chat.common.IdentityType" json:"identity_type,omitempty"` - // The KEM pre-keys to be stored. - PreKeys []*common.KemSignedPreKey `protobuf:"bytes,2,rep,name=pre_keys,json=preKeys,proto3" json:"pre_keys,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetOneTimeKemSignedPreKeysRequest) Reset() { - *x = SetOneTimeKemSignedPreKeysRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetOneTimeKemSignedPreKeysRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetOneTimeKemSignedPreKeysRequest) ProtoMessage() {} - -func (x *SetOneTimeKemSignedPreKeysRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_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 SetOneTimeKemSignedPreKeysRequest.ProtoReflect.Descriptor instead. -func (*SetOneTimeKemSignedPreKeysRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{9} -} - -func (x *SetOneTimeKemSignedPreKeysRequest) GetIdentityType() common.IdentityType { - if x != nil { - return x.IdentityType - } - return common.IdentityType(0) -} - -func (x *SetOneTimeKemSignedPreKeysRequest) GetPreKeys() []*common.KemSignedPreKey { - if x != nil { - return x.PreKeys - } - return nil -} - -type SetEcSignedPreKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identity type (i.e. ACI/PNI) with which this key is associated. - IdentityType common.IdentityType `protobuf:"varint,1,opt,name=identity_type,json=identityType,proto3,enum=org.signal.chat.common.IdentityType" json:"identity_type,omitempty"` - // The signed EC pre-key itself. - SignedPreKey *common.EcSignedPreKey `protobuf:"bytes,2,opt,name=signed_pre_key,json=signedPreKey,proto3" json:"signed_pre_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetEcSignedPreKeyRequest) Reset() { - *x = SetEcSignedPreKeyRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetEcSignedPreKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetEcSignedPreKeyRequest) ProtoMessage() {} - -func (x *SetEcSignedPreKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_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 SetEcSignedPreKeyRequest.ProtoReflect.Descriptor instead. -func (*SetEcSignedPreKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{10} -} - -func (x *SetEcSignedPreKeyRequest) GetIdentityType() common.IdentityType { - if x != nil { - return x.IdentityType - } - return common.IdentityType(0) -} - -func (x *SetEcSignedPreKeyRequest) GetSignedPreKey() *common.EcSignedPreKey { - if x != nil { - return x.SignedPreKey - } - return nil -} - -type SetKemLastResortPreKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The identity type (i.e. ACI/PNI) with which this key is associated. - IdentityType common.IdentityType `protobuf:"varint,1,opt,name=identity_type,json=identityType,proto3,enum=org.signal.chat.common.IdentityType" json:"identity_type,omitempty"` - // The signed KEM pre-key itself. - SignedPreKey *common.KemSignedPreKey `protobuf:"bytes,2,opt,name=signed_pre_key,json=signedPreKey,proto3" json:"signed_pre_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetKemLastResortPreKeyRequest) Reset() { - *x = SetKemLastResortPreKeyRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetKemLastResortPreKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetKemLastResortPreKeyRequest) ProtoMessage() {} - -func (x *SetKemLastResortPreKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_proto_msgTypes[11] - 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 SetKemLastResortPreKeyRequest.ProtoReflect.Descriptor instead. -func (*SetKemLastResortPreKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{11} -} - -func (x *SetKemLastResortPreKeyRequest) GetIdentityType() common.IdentityType { - if x != nil { - return x.IdentityType - } - return common.IdentityType(0) -} - -func (x *SetKemLastResortPreKeyRequest) GetSignedPreKey() *common.KemSignedPreKey { - if x != nil { - return x.SignedPreKey - } - return nil -} - -type SetPreKeyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetPreKeyResponse) Reset() { - *x = SetPreKeyResponse{} - mi := &file_org_signal_chat_keys_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetPreKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetPreKeyResponse) ProtoMessage() {} - -func (x *SetPreKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_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 SetPreKeyResponse.ProtoReflect.Descriptor instead. -func (*SetPreKeyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{12} -} - -type CheckIdentityKeyRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier of the account for which we want to check the associated identity key fingerprint. - TargetIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=target_identifier,json=targetIdentifier,proto3" json:"target_identifier,omitempty"` - // The most significant 4 bytes of the SHA-256 hash of the identity key associated with the target account/identity type. - Fingerprint []byte `protobuf:"bytes,2,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckIdentityKeyRequest) Reset() { - *x = CheckIdentityKeyRequest{} - mi := &file_org_signal_chat_keys_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckIdentityKeyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckIdentityKeyRequest) ProtoMessage() {} - -func (x *CheckIdentityKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_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 CheckIdentityKeyRequest.ProtoReflect.Descriptor instead. -func (*CheckIdentityKeyRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{13} -} - -func (x *CheckIdentityKeyRequest) GetTargetIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.TargetIdentifier - } - return nil -} - -func (x *CheckIdentityKeyRequest) GetFingerprint() []byte { - if x != nil { - return x.Fingerprint - } - return nil -} - -type CheckIdentityKeyResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier of the account for which there is a mismatch between the client and server identity key fingerprints. - TargetIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=target_identifier,json=targetIdentifier,proto3" json:"target_identifier,omitempty"` - // The identity key that is stored by the server for the target account/identity type. - IdentityKey []byte `protobuf:"bytes,2,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CheckIdentityKeyResponse) Reset() { - *x = CheckIdentityKeyResponse{} - mi := &file_org_signal_chat_keys_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CheckIdentityKeyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CheckIdentityKeyResponse) ProtoMessage() {} - -func (x *CheckIdentityKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_keys_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 CheckIdentityKeyResponse.ProtoReflect.Descriptor instead. -func (*CheckIdentityKeyResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_keys_proto_rawDescGZIP(), []int{14} -} - -func (x *CheckIdentityKeyResponse) GetTargetIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.TargetIdentifier - } - return nil -} - -func (x *CheckIdentityKeyResponse) GetIdentityKey() []byte { - if x != nil { - return x.IdentityKey - } - return nil -} - -var File_org_signal_chat_keys_proto protoreflect.FileDescriptor - -const file_org_signal_chat_keys_proto_rawDesc = "" + - "\n" + - "\x1aorg/signal/chat/keys.proto\x12\x14org.signal.chat.keys\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1corg/signal/chat/common.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x19org/signal/chat/tag.proto\"\x17\n" + - "\x15GetPreKeyCountRequest\"\xdc\x01\n" + - "\x16GetPreKeyCountResponse\x12.\n" + - "\x14aci_ec_pre_key_count\x18\x01 \x01(\rR\x10aciEcPreKeyCount\x120\n" + - "\x15aci_kem_pre_key_count\x18\x02 \x01(\rR\x11aciKemPreKeyCount\x12.\n" + - "\x14pni_ec_pre_key_count\x18\x03 \x01(\rR\x10pniEcPreKeyCount\x120\n" + - "\x15pni_kem_pre_key_count\x18\x04 \x01(\rR\x11pniKemPreKeyCount\"\x9b\x01\n" + - "\x11GetPreKeysRequest\x12V\n" + - "\x11target_identifier\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\x10targetIdentifier\x12 \n" + - "\tdevice_id\x18\x02 \x01(\rH\x00R\bdeviceId\x88\x01\x01B\f\n" + - "\n" + - "_device_id\"\xa1\x02\n" + - "\x1aGetPreKeysAnonymousRequest\x12A\n" + - "\arequest\x18\x01 \x01(\v2'.org.signal.chat.keys.GetPreKeysRequestR\arequest\x128\n" + - "\x17unidentified_access_key\x18\x02 \x01(\fH\x00R\x15unidentifiedAccessKey\x12*\n" + - "\x10group_send_token\x18\x03 \x01(\fH\x00R\x0egroupSendToken\x12I\n" + - "\x13unrestricted_access\x18\x04 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x12unrestrictedAccessB\x0f\n" + - "\rauthorization\"\xb9\x02\n" + - "\x12DevicePreKeyBundle\x12Q\n" + - "\x11ec_signed_pre_key\x18\x01 \x01(\v2&.org.signal.chat.common.EcSignedPreKeyR\x0eecSignedPreKey\x12N\n" + - "\x13ec_one_time_pre_key\x18\x02 \x01(\v2 .org.signal.chat.common.EcPreKeyR\x0fecOneTimePreKey\x12W\n" + - "\x14kem_one_time_pre_key\x18\x03 \x01(\v2'.org.signal.chat.common.KemSignedPreKeyR\x10kemOneTimePreKey\x12'\n" + - "\x0fregistration_id\x18\x04 \x01(\rR\x0eregistrationId\"\xa5\x03\n" + - "\x14AccountPreKeyBundles\x12!\n" + - "\fidentity_key\x18\x01 \x01(\fR\videntityKey\x12e\n" + - "\x0fdevice_pre_keys\x18\x02 \x03(\v2=.org.signal.chat.keys.AccountPreKeyBundles.DevicePreKeysEntryR\rdevicePreKeys\x12H\n" + - " unrestricted_unidentified_access\x18\x03 \x01(\bR\x1eunrestrictedUnidentifiedAccess\x12M\n" + - "#unidentified_access_key_fingerprint\x18\x04 \x01(\fR unidentifiedAccessKeyFingerprint\x1aj\n" + - "\x12DevicePreKeysEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\rR\x03key\x12>\n" + - "\x05value\x18\x02 \x01(\v2(.org.signal.chat.keys.DevicePreKeyBundleR\x05value:\x028\x01\"\xc6\x01\n" + - "\x12GetPreKeysResponse\x12G\n" + - "\bpre_keys\x18\x01 \x01(\v2*.org.signal.chat.keys.AccountPreKeyBundlesH\x00R\apreKeys\x12[\n" + - "\x10target_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\r\xc2\xd5\"\tnot_foundH\x00R\x0etargetNotFoundB\n" + - "\n" + - "\bresponse\"\xfe\x02\n" + - "\x1bGetPreKeysAnonymousResponse\x12G\n" + - "\bpre_keys\x18\x01 \x01(\v2*.org.signal.chat.keys.AccountPreKeyBundlesH\x00R\apreKeys\x12[\n" + - "\x10target_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\r\xc2\xd5\"\tnot_foundH\x00R\x0etargetNotFound\x12\xac\x01\n" + - "!failed_unidentified_authorization\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB%\xc2\xd5\"!failed_unidentified_authorizationH\x00R\x1ffailedUnidentifiedAuthorizationB\n" + - "\n" + - "\bresponse\"\xae\x01\n" + - "\x1aSetOneTimeEcPreKeysRequest\x12I\n" + - "\ridentity_type\x18\x01 \x01(\x0e2$.org.signal.chat.common.IdentityTypeR\fidentityType\x12E\n" + - "\bpre_keys\x18\x02 \x03(\v2 .org.signal.chat.common.EcPreKeyB\b\x9a\x97\"\x04\b\x01\x10dR\apreKeys\"\xbc\x01\n" + - "!SetOneTimeKemSignedPreKeysRequest\x12I\n" + - "\ridentity_type\x18\x01 \x01(\x0e2$.org.signal.chat.common.IdentityTypeR\fidentityType\x12L\n" + - "\bpre_keys\x18\x02 \x03(\v2'.org.signal.chat.common.KemSignedPreKeyB\b\x9a\x97\"\x04\b\x01\x10dR\apreKeys\"\xb9\x01\n" + - "\x18SetEcSignedPreKeyRequest\x12I\n" + - "\ridentity_type\x18\x01 \x01(\x0e2$.org.signal.chat.common.IdentityTypeR\fidentityType\x12R\n" + - "\x0esigned_pre_key\x18\x02 \x01(\v2&.org.signal.chat.common.EcSignedPreKeyB\x04\xb8\x97\"\x01R\fsignedPreKey\"\xbf\x01\n" + - "\x1dSetKemLastResortPreKeyRequest\x12I\n" + - "\ridentity_type\x18\x01 \x01(\x0e2$.org.signal.chat.common.IdentityTypeR\fidentityType\x12S\n" + - "\x0esigned_pre_key\x18\x02 \x01(\v2'.org.signal.chat.common.KemSignedPreKeyB\x04\xb8\x97\"\x01R\fsignedPreKey\"\x13\n" + - "\x11SetPreKeyResponse\"\x9a\x01\n" + - "\x17CheckIdentityKeyRequest\x12V\n" + - "\x11target_identifier\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\x10targetIdentifier\x12'\n" + - "\vfingerprint\x18\x02 \x01(\fB\x05\xa2\x97\"\x01\x04R\vfingerprint\"\x95\x01\n" + - "\x18CheckIdentityKeyResponse\x12V\n" + - "\x11target_identifier\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\x10targetIdentifier\x12!\n" + - "\fidentity_key\x18\x02 \x01(\fR\videntityKey2\xbf\x05\n" + - "\x04Keys\x12m\n" + - "\x0eGetPreKeyCount\x12+.org.signal.chat.keys.GetPreKeyCountRequest\x1a,.org.signal.chat.keys.GetPreKeyCountResponse\"\x00\x12a\n" + - "\n" + - "GetPreKeys\x12'.org.signal.chat.keys.GetPreKeysRequest\x1a(.org.signal.chat.keys.GetPreKeysResponse\"\x00\x12r\n" + - "\x13SetOneTimeEcPreKeys\x120.org.signal.chat.keys.SetOneTimeEcPreKeysRequest\x1a'.org.signal.chat.keys.SetPreKeyResponse\"\x00\x12\x80\x01\n" + - "\x1aSetOneTimeKemSignedPreKeys\x127.org.signal.chat.keys.SetOneTimeKemSignedPreKeysRequest\x1a'.org.signal.chat.keys.SetPreKeyResponse\"\x00\x12n\n" + - "\x11SetEcSignedPreKey\x12..org.signal.chat.keys.SetEcSignedPreKeyRequest\x1a'.org.signal.chat.keys.SetPreKeyResponse\"\x00\x12x\n" + - "\x16SetKemLastResortPreKey\x123.org.signal.chat.keys.SetKemLastResortPreKeyRequest\x1a'.org.signal.chat.keys.SetPreKeyResponse\"\x00\x1a\x04\xc8\xd5\"\x012\x84\x02\n" + - "\rKeysAnonymous\x12s\n" + - "\n" + - "GetPreKeys\x120.org.signal.chat.keys.GetPreKeysAnonymousRequest\x1a1.org.signal.chat.keys.GetPreKeysAnonymousResponse\"\x00\x12x\n" + - "\x11CheckIdentityKeys\x12-.org.signal.chat.keys.CheckIdentityKeyRequest\x1a..org.signal.chat.keys.CheckIdentityKeyResponse\"\x00(\x010\x01\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_keys_proto_rawDescOnce sync.Once - file_org_signal_chat_keys_proto_rawDescData []byte -) - -func file_org_signal_chat_keys_proto_rawDescGZIP() []byte { - file_org_signal_chat_keys_proto_rawDescOnce.Do(func() { - file_org_signal_chat_keys_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_keys_proto_rawDesc), len(file_org_signal_chat_keys_proto_rawDesc))) - }) - return file_org_signal_chat_keys_proto_rawDescData -} - -var file_org_signal_chat_keys_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_org_signal_chat_keys_proto_goTypes = []any{ - (*GetPreKeyCountRequest)(nil), // 0: org.signal.chat.keys.GetPreKeyCountRequest - (*GetPreKeyCountResponse)(nil), // 1: org.signal.chat.keys.GetPreKeyCountResponse - (*GetPreKeysRequest)(nil), // 2: org.signal.chat.keys.GetPreKeysRequest - (*GetPreKeysAnonymousRequest)(nil), // 3: org.signal.chat.keys.GetPreKeysAnonymousRequest - (*DevicePreKeyBundle)(nil), // 4: org.signal.chat.keys.DevicePreKeyBundle - (*AccountPreKeyBundles)(nil), // 5: org.signal.chat.keys.AccountPreKeyBundles - (*GetPreKeysResponse)(nil), // 6: org.signal.chat.keys.GetPreKeysResponse - (*GetPreKeysAnonymousResponse)(nil), // 7: org.signal.chat.keys.GetPreKeysAnonymousResponse - (*SetOneTimeEcPreKeysRequest)(nil), // 8: org.signal.chat.keys.SetOneTimeEcPreKeysRequest - (*SetOneTimeKemSignedPreKeysRequest)(nil), // 9: org.signal.chat.keys.SetOneTimeKemSignedPreKeysRequest - (*SetEcSignedPreKeyRequest)(nil), // 10: org.signal.chat.keys.SetEcSignedPreKeyRequest - (*SetKemLastResortPreKeyRequest)(nil), // 11: org.signal.chat.keys.SetKemLastResortPreKeyRequest - (*SetPreKeyResponse)(nil), // 12: org.signal.chat.keys.SetPreKeyResponse - (*CheckIdentityKeyRequest)(nil), // 13: org.signal.chat.keys.CheckIdentityKeyRequest - (*CheckIdentityKeyResponse)(nil), // 14: org.signal.chat.keys.CheckIdentityKeyResponse - nil, // 15: org.signal.chat.keys.AccountPreKeyBundles.DevicePreKeysEntry - (*common.ServiceIdentifier)(nil), // 16: org.signal.chat.common.ServiceIdentifier - (*emptypb.Empty)(nil), // 17: google.protobuf.Empty - (*common.EcSignedPreKey)(nil), // 18: org.signal.chat.common.EcSignedPreKey - (*common.EcPreKey)(nil), // 19: org.signal.chat.common.EcPreKey - (*common.KemSignedPreKey)(nil), // 20: org.signal.chat.common.KemSignedPreKey - (*errors.NotFound)(nil), // 21: org.signal.chat.errors.NotFound - (*errors.FailedUnidentifiedAuthorization)(nil), // 22: org.signal.chat.errors.FailedUnidentifiedAuthorization - (common.IdentityType)(0), // 23: org.signal.chat.common.IdentityType -} -var file_org_signal_chat_keys_proto_depIdxs = []int32{ - 16, // 0: org.signal.chat.keys.GetPreKeysRequest.target_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 2, // 1: org.signal.chat.keys.GetPreKeysAnonymousRequest.request:type_name -> org.signal.chat.keys.GetPreKeysRequest - 17, // 2: org.signal.chat.keys.GetPreKeysAnonymousRequest.unrestricted_access:type_name -> google.protobuf.Empty - 18, // 3: org.signal.chat.keys.DevicePreKeyBundle.ec_signed_pre_key:type_name -> org.signal.chat.common.EcSignedPreKey - 19, // 4: org.signal.chat.keys.DevicePreKeyBundle.ec_one_time_pre_key:type_name -> org.signal.chat.common.EcPreKey - 20, // 5: org.signal.chat.keys.DevicePreKeyBundle.kem_one_time_pre_key:type_name -> org.signal.chat.common.KemSignedPreKey - 15, // 6: org.signal.chat.keys.AccountPreKeyBundles.device_pre_keys:type_name -> org.signal.chat.keys.AccountPreKeyBundles.DevicePreKeysEntry - 5, // 7: org.signal.chat.keys.GetPreKeysResponse.pre_keys:type_name -> org.signal.chat.keys.AccountPreKeyBundles - 21, // 8: org.signal.chat.keys.GetPreKeysResponse.target_not_found:type_name -> org.signal.chat.errors.NotFound - 5, // 9: org.signal.chat.keys.GetPreKeysAnonymousResponse.pre_keys:type_name -> org.signal.chat.keys.AccountPreKeyBundles - 21, // 10: org.signal.chat.keys.GetPreKeysAnonymousResponse.target_not_found:type_name -> org.signal.chat.errors.NotFound - 22, // 11: org.signal.chat.keys.GetPreKeysAnonymousResponse.failed_unidentified_authorization:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 23, // 12: org.signal.chat.keys.SetOneTimeEcPreKeysRequest.identity_type:type_name -> org.signal.chat.common.IdentityType - 19, // 13: org.signal.chat.keys.SetOneTimeEcPreKeysRequest.pre_keys:type_name -> org.signal.chat.common.EcPreKey - 23, // 14: org.signal.chat.keys.SetOneTimeKemSignedPreKeysRequest.identity_type:type_name -> org.signal.chat.common.IdentityType - 20, // 15: org.signal.chat.keys.SetOneTimeKemSignedPreKeysRequest.pre_keys:type_name -> org.signal.chat.common.KemSignedPreKey - 23, // 16: org.signal.chat.keys.SetEcSignedPreKeyRequest.identity_type:type_name -> org.signal.chat.common.IdentityType - 18, // 17: org.signal.chat.keys.SetEcSignedPreKeyRequest.signed_pre_key:type_name -> org.signal.chat.common.EcSignedPreKey - 23, // 18: org.signal.chat.keys.SetKemLastResortPreKeyRequest.identity_type:type_name -> org.signal.chat.common.IdentityType - 20, // 19: org.signal.chat.keys.SetKemLastResortPreKeyRequest.signed_pre_key:type_name -> org.signal.chat.common.KemSignedPreKey - 16, // 20: org.signal.chat.keys.CheckIdentityKeyRequest.target_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 16, // 21: org.signal.chat.keys.CheckIdentityKeyResponse.target_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 4, // 22: org.signal.chat.keys.AccountPreKeyBundles.DevicePreKeysEntry.value:type_name -> org.signal.chat.keys.DevicePreKeyBundle - 0, // 23: org.signal.chat.keys.Keys.GetPreKeyCount:input_type -> org.signal.chat.keys.GetPreKeyCountRequest - 2, // 24: org.signal.chat.keys.Keys.GetPreKeys:input_type -> org.signal.chat.keys.GetPreKeysRequest - 8, // 25: org.signal.chat.keys.Keys.SetOneTimeEcPreKeys:input_type -> org.signal.chat.keys.SetOneTimeEcPreKeysRequest - 9, // 26: org.signal.chat.keys.Keys.SetOneTimeKemSignedPreKeys:input_type -> org.signal.chat.keys.SetOneTimeKemSignedPreKeysRequest - 10, // 27: org.signal.chat.keys.Keys.SetEcSignedPreKey:input_type -> org.signal.chat.keys.SetEcSignedPreKeyRequest - 11, // 28: org.signal.chat.keys.Keys.SetKemLastResortPreKey:input_type -> org.signal.chat.keys.SetKemLastResortPreKeyRequest - 3, // 29: org.signal.chat.keys.KeysAnonymous.GetPreKeys:input_type -> org.signal.chat.keys.GetPreKeysAnonymousRequest - 13, // 30: org.signal.chat.keys.KeysAnonymous.CheckIdentityKeys:input_type -> org.signal.chat.keys.CheckIdentityKeyRequest - 1, // 31: org.signal.chat.keys.Keys.GetPreKeyCount:output_type -> org.signal.chat.keys.GetPreKeyCountResponse - 6, // 32: org.signal.chat.keys.Keys.GetPreKeys:output_type -> org.signal.chat.keys.GetPreKeysResponse - 12, // 33: org.signal.chat.keys.Keys.SetOneTimeEcPreKeys:output_type -> org.signal.chat.keys.SetPreKeyResponse - 12, // 34: org.signal.chat.keys.Keys.SetOneTimeKemSignedPreKeys:output_type -> org.signal.chat.keys.SetPreKeyResponse - 12, // 35: org.signal.chat.keys.Keys.SetEcSignedPreKey:output_type -> org.signal.chat.keys.SetPreKeyResponse - 12, // 36: org.signal.chat.keys.Keys.SetKemLastResortPreKey:output_type -> org.signal.chat.keys.SetPreKeyResponse - 7, // 37: org.signal.chat.keys.KeysAnonymous.GetPreKeys:output_type -> org.signal.chat.keys.GetPreKeysAnonymousResponse - 14, // 38: org.signal.chat.keys.KeysAnonymous.CheckIdentityKeys:output_type -> org.signal.chat.keys.CheckIdentityKeyResponse - 31, // [31:39] is the sub-list for method output_type - 23, // [23:31] is the sub-list for method input_type - 23, // [23:23] is the sub-list for extension type_name - 23, // [23:23] is the sub-list for extension extendee - 0, // [0:23] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_keys_proto_init() } -func file_org_signal_chat_keys_proto_init() { - if File_org_signal_chat_keys_proto != nil { - return - } - file_org_signal_chat_keys_proto_msgTypes[2].OneofWrappers = []any{} - file_org_signal_chat_keys_proto_msgTypes[3].OneofWrappers = []any{ - (*GetPreKeysAnonymousRequest_UnidentifiedAccessKey)(nil), - (*GetPreKeysAnonymousRequest_GroupSendToken)(nil), - (*GetPreKeysAnonymousRequest_UnrestrictedAccess)(nil), - } - file_org_signal_chat_keys_proto_msgTypes[6].OneofWrappers = []any{ - (*GetPreKeysResponse_PreKeys)(nil), - (*GetPreKeysResponse_TargetNotFound)(nil), - } - file_org_signal_chat_keys_proto_msgTypes[7].OneofWrappers = []any{ - (*GetPreKeysAnonymousResponse_PreKeys)(nil), - (*GetPreKeysAnonymousResponse_TargetNotFound)(nil), - (*GetPreKeysAnonymousResponse_FailedUnidentifiedAuthorization)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_keys_proto_rawDesc), len(file_org_signal_chat_keys_proto_rawDesc)), - NumEnums: 0, - NumMessages: 16, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_org_signal_chat_keys_proto_goTypes, - DependencyIndexes: file_org_signal_chat_keys_proto_depIdxs, - MessageInfos: file_org_signal_chat_keys_proto_msgTypes, - }.Build() - File_org_signal_chat_keys_proto = out.File - file_org_signal_chat_keys_proto_goTypes = nil - file_org_signal_chat_keys_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/keys/keys_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/keys/keys_grpc.pb.go deleted file mode 100644 index c2a20c4..0000000 --- a/pkg/signalmeow/protobuf/rpc/keys/keys_grpc.pb.go +++ /dev/null @@ -1,524 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/keys.proto - -package keys - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Keys_GetPreKeyCount_FullMethodName = "/org.signal.chat.keys.Keys/GetPreKeyCount" - Keys_GetPreKeys_FullMethodName = "/org.signal.chat.keys.Keys/GetPreKeys" - Keys_SetOneTimeEcPreKeys_FullMethodName = "/org.signal.chat.keys.Keys/SetOneTimeEcPreKeys" - Keys_SetOneTimeKemSignedPreKeys_FullMethodName = "/org.signal.chat.keys.Keys/SetOneTimeKemSignedPreKeys" - Keys_SetEcSignedPreKey_FullMethodName = "/org.signal.chat.keys.Keys/SetEcSignedPreKey" - Keys_SetKemLastResortPreKey_FullMethodName = "/org.signal.chat.keys.Keys/SetKemLastResortPreKey" -) - -// KeysClient is the client API for Keys service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with pre-keys. -type KeysClient interface { - // Retrieves an approximate count of the number of the various kinds of - // pre-keys stored for the authenticated device. - GetPreKeyCount(ctx context.Context, in *GetPreKeyCountRequest, opts ...grpc.CallOption) (*GetPreKeyCountResponse, error) - // Retrieves a set of pre-keys for establishing a session with the targeted - // device or devices. Note that callers with an unidentified access key for - // the targeted account should use the version of this method in - // `KeysAnonymous` instead. - GetPreKeys(ctx context.Context, in *GetPreKeysRequest, opts ...grpc.CallOption) (*GetPreKeysResponse, error) - // Uploads a new set of one-time EC pre-keys for the authenticated device, - // clearing any previously-stored pre-keys. Note that all keys submitted via - // a single call to this method _must_ have the same identity type (i.e. if - // the first key has an ACI identity type, then all other keys in the same - // stream must also have an ACI identity type). The provided list of pre-keys - // must be non-empty. - SetOneTimeEcPreKeys(ctx context.Context, in *SetOneTimeEcPreKeysRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) - // Uploads a new set of one-time KEM pre-keys for the authenticated device, - // clearing any previously-stored pre-keys. Note that all keys submitted via - // a single call to this method _must_ have the same identity type (i.e. if - // the first key has an ACI identity type, then all other keys in the same - // stream must also have an ACI identity type). The provided list of pre-keys - // must be non-empty. - SetOneTimeKemSignedPreKeys(ctx context.Context, in *SetOneTimeKemSignedPreKeysRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) - // Sets the signed EC pre-key for one identity (i.e. ACI or PNI) associated - // with the authenticated device. - SetEcSignedPreKey(ctx context.Context, in *SetEcSignedPreKeyRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) - // Sets the last-resort KEM pre-key for one identity (i.e. ACI or PNI) - // associated with the authenticated device. - SetKemLastResortPreKey(ctx context.Context, in *SetKemLastResortPreKeyRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) -} - -type keysClient struct { - cc grpc.ClientConnInterface -} - -func NewKeysClient(cc grpc.ClientConnInterface) KeysClient { - return &keysClient{cc} -} - -func (c *keysClient) GetPreKeyCount(ctx context.Context, in *GetPreKeyCountRequest, opts ...grpc.CallOption) (*GetPreKeyCountResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetPreKeyCountResponse) - err := c.cc.Invoke(ctx, Keys_GetPreKeyCount_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keysClient) GetPreKeys(ctx context.Context, in *GetPreKeysRequest, opts ...grpc.CallOption) (*GetPreKeysResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetPreKeysResponse) - err := c.cc.Invoke(ctx, Keys_GetPreKeys_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keysClient) SetOneTimeEcPreKeys(ctx context.Context, in *SetOneTimeEcPreKeysRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetPreKeyResponse) - err := c.cc.Invoke(ctx, Keys_SetOneTimeEcPreKeys_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keysClient) SetOneTimeKemSignedPreKeys(ctx context.Context, in *SetOneTimeKemSignedPreKeysRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetPreKeyResponse) - err := c.cc.Invoke(ctx, Keys_SetOneTimeKemSignedPreKeys_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keysClient) SetEcSignedPreKey(ctx context.Context, in *SetEcSignedPreKeyRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetPreKeyResponse) - err := c.cc.Invoke(ctx, Keys_SetEcSignedPreKey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keysClient) SetKemLastResortPreKey(ctx context.Context, in *SetKemLastResortPreKeyRequest, opts ...grpc.CallOption) (*SetPreKeyResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetPreKeyResponse) - err := c.cc.Invoke(ctx, Keys_SetKemLastResortPreKey_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// KeysServer is the server API for Keys service. -// All implementations must embed UnimplementedKeysServer -// for forward compatibility. -// -// Provides methods for working with pre-keys. -type KeysServer interface { - // Retrieves an approximate count of the number of the various kinds of - // pre-keys stored for the authenticated device. - GetPreKeyCount(context.Context, *GetPreKeyCountRequest) (*GetPreKeyCountResponse, error) - // Retrieves a set of pre-keys for establishing a session with the targeted - // device or devices. Note that callers with an unidentified access key for - // the targeted account should use the version of this method in - // `KeysAnonymous` instead. - GetPreKeys(context.Context, *GetPreKeysRequest) (*GetPreKeysResponse, error) - // Uploads a new set of one-time EC pre-keys for the authenticated device, - // clearing any previously-stored pre-keys. Note that all keys submitted via - // a single call to this method _must_ have the same identity type (i.e. if - // the first key has an ACI identity type, then all other keys in the same - // stream must also have an ACI identity type). The provided list of pre-keys - // must be non-empty. - SetOneTimeEcPreKeys(context.Context, *SetOneTimeEcPreKeysRequest) (*SetPreKeyResponse, error) - // Uploads a new set of one-time KEM pre-keys for the authenticated device, - // clearing any previously-stored pre-keys. Note that all keys submitted via - // a single call to this method _must_ have the same identity type (i.e. if - // the first key has an ACI identity type, then all other keys in the same - // stream must also have an ACI identity type). The provided list of pre-keys - // must be non-empty. - SetOneTimeKemSignedPreKeys(context.Context, *SetOneTimeKemSignedPreKeysRequest) (*SetPreKeyResponse, error) - // Sets the signed EC pre-key for one identity (i.e. ACI or PNI) associated - // with the authenticated device. - SetEcSignedPreKey(context.Context, *SetEcSignedPreKeyRequest) (*SetPreKeyResponse, error) - // Sets the last-resort KEM pre-key for one identity (i.e. ACI or PNI) - // associated with the authenticated device. - SetKemLastResortPreKey(context.Context, *SetKemLastResortPreKeyRequest) (*SetPreKeyResponse, error) - mustEmbedUnimplementedKeysServer() -} - -// UnimplementedKeysServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedKeysServer struct{} - -func (UnimplementedKeysServer) GetPreKeyCount(context.Context, *GetPreKeyCountRequest) (*GetPreKeyCountResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetPreKeyCount not implemented") -} -func (UnimplementedKeysServer) GetPreKeys(context.Context, *GetPreKeysRequest) (*GetPreKeysResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetPreKeys not implemented") -} -func (UnimplementedKeysServer) SetOneTimeEcPreKeys(context.Context, *SetOneTimeEcPreKeysRequest) (*SetPreKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetOneTimeEcPreKeys not implemented") -} -func (UnimplementedKeysServer) SetOneTimeKemSignedPreKeys(context.Context, *SetOneTimeKemSignedPreKeysRequest) (*SetPreKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetOneTimeKemSignedPreKeys not implemented") -} -func (UnimplementedKeysServer) SetEcSignedPreKey(context.Context, *SetEcSignedPreKeyRequest) (*SetPreKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetEcSignedPreKey not implemented") -} -func (UnimplementedKeysServer) SetKemLastResortPreKey(context.Context, *SetKemLastResortPreKeyRequest) (*SetPreKeyResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetKemLastResortPreKey not implemented") -} -func (UnimplementedKeysServer) mustEmbedUnimplementedKeysServer() {} -func (UnimplementedKeysServer) testEmbeddedByValue() {} - -// UnsafeKeysServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to KeysServer will -// result in compilation errors. -type UnsafeKeysServer interface { - mustEmbedUnimplementedKeysServer() -} - -func RegisterKeysServer(s grpc.ServiceRegistrar, srv KeysServer) { - // If the following call panics, it indicates UnimplementedKeysServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Keys_ServiceDesc, srv) -} - -func _Keys_GetPreKeyCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPreKeyCountRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeysServer).GetPreKeyCount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Keys_GetPreKeyCount_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeysServer).GetPreKeyCount(ctx, req.(*GetPreKeyCountRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Keys_GetPreKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPreKeysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeysServer).GetPreKeys(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Keys_GetPreKeys_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeysServer).GetPreKeys(ctx, req.(*GetPreKeysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Keys_SetOneTimeEcPreKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetOneTimeEcPreKeysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeysServer).SetOneTimeEcPreKeys(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Keys_SetOneTimeEcPreKeys_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeysServer).SetOneTimeEcPreKeys(ctx, req.(*SetOneTimeEcPreKeysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Keys_SetOneTimeKemSignedPreKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetOneTimeKemSignedPreKeysRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeysServer).SetOneTimeKemSignedPreKeys(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Keys_SetOneTimeKemSignedPreKeys_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeysServer).SetOneTimeKemSignedPreKeys(ctx, req.(*SetOneTimeKemSignedPreKeysRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Keys_SetEcSignedPreKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetEcSignedPreKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeysServer).SetEcSignedPreKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Keys_SetEcSignedPreKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeysServer).SetEcSignedPreKey(ctx, req.(*SetEcSignedPreKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Keys_SetKemLastResortPreKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetKemLastResortPreKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeysServer).SetKemLastResortPreKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Keys_SetKemLastResortPreKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeysServer).SetKemLastResortPreKey(ctx, req.(*SetKemLastResortPreKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Keys_ServiceDesc is the grpc.ServiceDesc for Keys service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Keys_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.keys.Keys", - HandlerType: (*KeysServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetPreKeyCount", - Handler: _Keys_GetPreKeyCount_Handler, - }, - { - MethodName: "GetPreKeys", - Handler: _Keys_GetPreKeys_Handler, - }, - { - MethodName: "SetOneTimeEcPreKeys", - Handler: _Keys_SetOneTimeEcPreKeys_Handler, - }, - { - MethodName: "SetOneTimeKemSignedPreKeys", - Handler: _Keys_SetOneTimeKemSignedPreKeys_Handler, - }, - { - MethodName: "SetEcSignedPreKey", - Handler: _Keys_SetEcSignedPreKey_Handler, - }, - { - MethodName: "SetKemLastResortPreKey", - Handler: _Keys_SetKemLastResortPreKey_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/keys.proto", -} - -const ( - KeysAnonymous_GetPreKeys_FullMethodName = "/org.signal.chat.keys.KeysAnonymous/GetPreKeys" - KeysAnonymous_CheckIdentityKeys_FullMethodName = "/org.signal.chat.keys.KeysAnonymous/CheckIdentityKeys" -) - -// KeysAnonymousClient is the client API for KeysAnonymous service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with pre-keys using "unidentified access" -// credentials. -type KeysAnonymousClient interface { - // Retrieves a set of pre-keys for establishing a session with the targeted - // device or devices. Callers must not submit any self-identifying credentials - // when calling this method and must instead present the targeted account's - // unidentified access key as an anonymous authentication mechanism. Callers - // without an unidentified access key should use the equivalent, authenticated - // method in `Keys` instead. - GetPreKeys(ctx context.Context, in *GetPreKeysAnonymousRequest, opts ...grpc.CallOption) (*GetPreKeysAnonymousResponse, error) - // Checks identity key fingerprints of the target accounts. - // - // Returns a stream of elements, each one representing an account that had a mismatched - // identity key fingerprint with the server and the corresponding identity key stored by the server. - CheckIdentityKeys(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CheckIdentityKeyRequest, CheckIdentityKeyResponse], error) -} - -type keysAnonymousClient struct { - cc grpc.ClientConnInterface -} - -func NewKeysAnonymousClient(cc grpc.ClientConnInterface) KeysAnonymousClient { - return &keysAnonymousClient{cc} -} - -func (c *keysAnonymousClient) GetPreKeys(ctx context.Context, in *GetPreKeysAnonymousRequest, opts ...grpc.CallOption) (*GetPreKeysAnonymousResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetPreKeysAnonymousResponse) - err := c.cc.Invoke(ctx, KeysAnonymous_GetPreKeys_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *keysAnonymousClient) CheckIdentityKeys(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[CheckIdentityKeyRequest, CheckIdentityKeyResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &KeysAnonymous_ServiceDesc.Streams[0], KeysAnonymous_CheckIdentityKeys_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[CheckIdentityKeyRequest, CheckIdentityKeyResponse]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type KeysAnonymous_CheckIdentityKeysClient = grpc.BidiStreamingClient[CheckIdentityKeyRequest, CheckIdentityKeyResponse] - -// KeysAnonymousServer is the server API for KeysAnonymous service. -// All implementations must embed UnimplementedKeysAnonymousServer -// for forward compatibility. -// -// Provides methods for working with pre-keys using "unidentified access" -// credentials. -type KeysAnonymousServer interface { - // Retrieves a set of pre-keys for establishing a session with the targeted - // device or devices. Callers must not submit any self-identifying credentials - // when calling this method and must instead present the targeted account's - // unidentified access key as an anonymous authentication mechanism. Callers - // without an unidentified access key should use the equivalent, authenticated - // method in `Keys` instead. - GetPreKeys(context.Context, *GetPreKeysAnonymousRequest) (*GetPreKeysAnonymousResponse, error) - // Checks identity key fingerprints of the target accounts. - // - // Returns a stream of elements, each one representing an account that had a mismatched - // identity key fingerprint with the server and the corresponding identity key stored by the server. - CheckIdentityKeys(grpc.BidiStreamingServer[CheckIdentityKeyRequest, CheckIdentityKeyResponse]) error - mustEmbedUnimplementedKeysAnonymousServer() -} - -// UnimplementedKeysAnonymousServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedKeysAnonymousServer struct{} - -func (UnimplementedKeysAnonymousServer) GetPreKeys(context.Context, *GetPreKeysAnonymousRequest) (*GetPreKeysAnonymousResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetPreKeys not implemented") -} -func (UnimplementedKeysAnonymousServer) CheckIdentityKeys(grpc.BidiStreamingServer[CheckIdentityKeyRequest, CheckIdentityKeyResponse]) error { - return status.Error(codes.Unimplemented, "method CheckIdentityKeys not implemented") -} -func (UnimplementedKeysAnonymousServer) mustEmbedUnimplementedKeysAnonymousServer() {} -func (UnimplementedKeysAnonymousServer) testEmbeddedByValue() {} - -// UnsafeKeysAnonymousServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to KeysAnonymousServer will -// result in compilation errors. -type UnsafeKeysAnonymousServer interface { - mustEmbedUnimplementedKeysAnonymousServer() -} - -func RegisterKeysAnonymousServer(s grpc.ServiceRegistrar, srv KeysAnonymousServer) { - // If the following call panics, it indicates UnimplementedKeysAnonymousServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&KeysAnonymous_ServiceDesc, srv) -} - -func _KeysAnonymous_GetPreKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPreKeysAnonymousRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(KeysAnonymousServer).GetPreKeys(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: KeysAnonymous_GetPreKeys_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KeysAnonymousServer).GetPreKeys(ctx, req.(*GetPreKeysAnonymousRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _KeysAnonymous_CheckIdentityKeys_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(KeysAnonymousServer).CheckIdentityKeys(&grpc.GenericServerStream[CheckIdentityKeyRequest, CheckIdentityKeyResponse]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type KeysAnonymous_CheckIdentityKeysServer = grpc.BidiStreamingServer[CheckIdentityKeyRequest, CheckIdentityKeyResponse] - -// KeysAnonymous_ServiceDesc is the grpc.ServiceDesc for KeysAnonymous service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var KeysAnonymous_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.keys.KeysAnonymous", - HandlerType: (*KeysAnonymousServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetPreKeys", - Handler: _KeysAnonymous_GetPreKeys_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "CheckIdentityKeys", - Handler: _KeysAnonymous_CheckIdentityKeys_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "org/signal/chat/keys.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/login_purchase/login_purchase.pb.go b/pkg/signalmeow/protobuf/rpc/login_purchase/login_purchase.pb.go deleted file mode 100644 index 7a75a86..0000000 --- a/pkg/signalmeow/protobuf/rpc/login_purchase/login_purchase.pb.go +++ /dev/null @@ -1,378 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/login_purchase.proto - -package login_purchase - -import ( - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - subscriptions "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/subscriptions" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CreateLoginReceiptCredentialRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The payment processor. Currently, only GOOGLE_PLAY_BILLING and - // APPLE_APP_STORE are supported. - Processor subscriptions.PaymentProvider `protobuf:"varint,1,opt,name=processor,proto3,enum=org.signal.chat.purchase.PaymentProvider" json:"processor,omitempty"` - // The identifier of a completed purchase for a signal login within the - // payment provider - PurchaseIdentifier string `protobuf:"bytes,2,opt,name=purchase_identifier,json=purchaseIdentifier,proto3" json:"purchase_identifier,omitempty"` - // The receipt credential request. Subsequent retries to create a login - // credential for the same purchase_identifier must use an identical - // receipt_credential_request. - // - // Callers must validate that the generated receipt credential has the - // following properties: - // - // - Level == 300 (The login level) - // - ExpirationTime % 86400 == 0 - // - ExpirationTime == PurchaseTime + (5 * 366 * 86400) +/- (7 * 86400) - ReceiptCredentialRequest []byte `protobuf:"bytes,3,opt,name=receipt_credential_request,json=receiptCredentialRequest,proto3" json:"receipt_credential_request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateLoginReceiptCredentialRequest) Reset() { - *x = CreateLoginReceiptCredentialRequest{} - mi := &file_org_signal_chat_login_purchase_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateLoginReceiptCredentialRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateLoginReceiptCredentialRequest) ProtoMessage() {} - -func (x *CreateLoginReceiptCredentialRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_login_purchase_proto_msgTypes[0] - 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 CreateLoginReceiptCredentialRequest.ProtoReflect.Descriptor instead. -func (*CreateLoginReceiptCredentialRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_login_purchase_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateLoginReceiptCredentialRequest) GetProcessor() subscriptions.PaymentProvider { - if x != nil { - return x.Processor - } - return subscriptions.PaymentProvider(0) -} - -func (x *CreateLoginReceiptCredentialRequest) GetPurchaseIdentifier() string { - if x != nil { - return x.PurchaseIdentifier - } - return "" -} - -func (x *CreateLoginReceiptCredentialRequest) GetReceiptCredentialRequest() []byte { - if x != nil { - return x.ReceiptCredentialRequest - } - return nil -} - -type CreateLoginReceiptCredentialResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *CreateLoginReceiptCredentialResponse_Result - // *CreateLoginReceiptCredentialResponse_PaymentStillProcessing - // *CreateLoginReceiptCredentialResponse_PaymentRequired - // *CreateLoginReceiptCredentialResponse_PaymentNotFound - // *CreateLoginReceiptCredentialResponse_ReceiptAlreadyIssued - Response isCreateLoginReceiptCredentialResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateLoginReceiptCredentialResponse) Reset() { - *x = CreateLoginReceiptCredentialResponse{} - mi := &file_org_signal_chat_login_purchase_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateLoginReceiptCredentialResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateLoginReceiptCredentialResponse) ProtoMessage() {} - -func (x *CreateLoginReceiptCredentialResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_login_purchase_proto_msgTypes[1] - 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 CreateLoginReceiptCredentialResponse.ProtoReflect.Descriptor instead. -func (*CreateLoginReceiptCredentialResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_login_purchase_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateLoginReceiptCredentialResponse) GetResponse() isCreateLoginReceiptCredentialResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *CreateLoginReceiptCredentialResponse) GetResult() *CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult { - if x != nil { - if x, ok := x.Response.(*CreateLoginReceiptCredentialResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *CreateLoginReceiptCredentialResponse) GetPaymentStillProcessing() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreateLoginReceiptCredentialResponse_PaymentStillProcessing); ok { - return x.PaymentStillProcessing - } - } - return nil -} - -func (x *CreateLoginReceiptCredentialResponse) GetPaymentRequired() *subscriptions.PaymentRequired { - if x != nil { - if x, ok := x.Response.(*CreateLoginReceiptCredentialResponse_PaymentRequired); ok { - return x.PaymentRequired - } - } - return nil -} - -func (x *CreateLoginReceiptCredentialResponse) GetPaymentNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*CreateLoginReceiptCredentialResponse_PaymentNotFound); ok { - return x.PaymentNotFound - } - } - return nil -} - -func (x *CreateLoginReceiptCredentialResponse) GetReceiptAlreadyIssued() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreateLoginReceiptCredentialResponse_ReceiptAlreadyIssued); ok { - return x.ReceiptAlreadyIssued - } - } - return nil -} - -type isCreateLoginReceiptCredentialResponse_Response interface { - isCreateLoginReceiptCredentialResponse_Response() -} - -type CreateLoginReceiptCredentialResponse_Result struct { - Result *CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type CreateLoginReceiptCredentialResponse_PaymentStillProcessing struct { - // The purchase is still pending with the payment provider. The client may retry later. - PaymentStillProcessing *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=payment_still_processing,json=paymentStillProcessing,proto3,oneof"` -} - -type CreateLoginReceiptCredentialResponse_PaymentRequired struct { - // The purchase did not complete successfully. - PaymentRequired *subscriptions.PaymentRequired `protobuf:"bytes,3,opt,name=payment_required,json=paymentRequired,proto3,oneof"` -} - -type CreateLoginReceiptCredentialResponse_PaymentNotFound struct { - // The payment provider has no purchase with the provided purchase_identifier - PaymentNotFound *errors.NotFound `protobuf:"bytes,4,opt,name=payment_not_found,json=paymentNotFound,proto3,oneof"` -} - -type CreateLoginReceiptCredentialResponse_ReceiptAlreadyIssued struct { - // The purchase was already redeemed for a receipt credential, but with a different receipt credential request - ReceiptAlreadyIssued *errors.FailedPrecondition `protobuf:"bytes,5,opt,name=receipt_already_issued,json=receiptAlreadyIssued,proto3,oneof"` -} - -func (*CreateLoginReceiptCredentialResponse_Result) isCreateLoginReceiptCredentialResponse_Response() { -} - -func (*CreateLoginReceiptCredentialResponse_PaymentStillProcessing) isCreateLoginReceiptCredentialResponse_Response() { -} - -func (*CreateLoginReceiptCredentialResponse_PaymentRequired) isCreateLoginReceiptCredentialResponse_Response() { -} - -func (*CreateLoginReceiptCredentialResponse_PaymentNotFound) isCreateLoginReceiptCredentialResponse_Response() { -} - -func (*CreateLoginReceiptCredentialResponse_ReceiptAlreadyIssued) isCreateLoginReceiptCredentialResponse_Response() { -} - -type CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - ReceiptCredentialResponse []byte `protobuf:"bytes,1,opt,name=receipt_credential_response,json=receiptCredentialResponse,proto3" json:"receipt_credential_response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult) Reset() { - *x = CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult{} - mi := &file_org_signal_chat_login_purchase_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult) ProtoMessage() {} - -func (x *CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_login_purchase_proto_msgTypes[2] - 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 CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult.ProtoReflect.Descriptor instead. -func (*CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_login_purchase_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult) GetReceiptCredentialResponse() []byte { - if x != nil { - return x.ReceiptCredentialResponse - } - return nil -} - -var File_org_signal_chat_login_purchase_proto protoreflect.FileDescriptor - -const file_org_signal_chat_login_purchase_proto_rawDesc = "" + - "\n" + - "$org/signal/chat/login_purchase.proto\x12\x18org.signal.chat.purchase\x1a\x1dorg/signal/chat/require.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x19org/signal/chat/tag.proto\x1a#org/signal/chat/subscriptions.proto\"\xef\x01\n" + - "#CreateLoginReceiptCredentialRequest\x12M\n" + - "\tprocessor\x18\x01 \x01(\x0e2).org.signal.chat.purchase.PaymentProviderB\x04\x90\x97\"\x01R\tprocessor\x125\n" + - "\x13purchase_identifier\x18\x02 \x01(\tB\x04\x88\x97\"\x01R\x12purchaseIdentifier\x12B\n" + - "\x1areceipt_credential_request\x18\x03 \x01(\fB\x04\x88\x97\"\x01R\x18receiptCredentialRequest\"\xf1\x05\n" + - "$CreateLoginReceiptCredentialResponse\x12{\n" + - "\x06result\x18\x01 \x01(\v2a.org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.CreateLoginReceiptCredentialResultH\x00R\x06result\x12\x84\x01\n" + - "\x18payment_still_processing\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1c\xc2\xd5\"\x18payment_still_processingH\x00R\x16paymentStillProcessing\x12l\n" + - "\x10payment_required\x18\x03 \x01(\v2).org.signal.chat.purchase.PaymentRequiredB\x14\xc2\xd5\"\x10payment_requiredH\x00R\x0fpaymentRequired\x12e\n" + - "\x11payment_not_found\x18\x04 \x01(\v2 .org.signal.chat.errors.NotFoundB\x15\xc2\xd5\"\x11payment_not_foundH\x00R\x0fpaymentNotFound\x12~\n" + - "\x16receipt_already_issued\x18\x05 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1a\xc2\xd5\"\x16receipt_already_issuedH\x00R\x14receiptAlreadyIssued\x1ad\n" + - "\"CreateLoginReceiptCredentialResult\x12>\n" + - "\x1breceipt_credential_response\x18\x01 \x01(\fR\x19receiptCredentialResponseB\n" + - "\n" + - "\bresponse2\xb7\x01\n" + - "\rLoginPurchase\x12\x9f\x01\n" + - "\x1cCreateLoginReceiptCredential\x12=.org.signal.chat.purchase.CreateLoginReceiptCredentialRequest\x1a>.org.signal.chat.purchase.CreateLoginReceiptCredentialResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_login_purchase_proto_rawDescOnce sync.Once - file_org_signal_chat_login_purchase_proto_rawDescData []byte -) - -func file_org_signal_chat_login_purchase_proto_rawDescGZIP() []byte { - file_org_signal_chat_login_purchase_proto_rawDescOnce.Do(func() { - file_org_signal_chat_login_purchase_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_login_purchase_proto_rawDesc), len(file_org_signal_chat_login_purchase_proto_rawDesc))) - }) - return file_org_signal_chat_login_purchase_proto_rawDescData -} - -var file_org_signal_chat_login_purchase_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_org_signal_chat_login_purchase_proto_goTypes = []any{ - (*CreateLoginReceiptCredentialRequest)(nil), // 0: org.signal.chat.purchase.CreateLoginReceiptCredentialRequest - (*CreateLoginReceiptCredentialResponse)(nil), // 1: org.signal.chat.purchase.CreateLoginReceiptCredentialResponse - (*CreateLoginReceiptCredentialResponse_CreateLoginReceiptCredentialResult)(nil), // 2: org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.CreateLoginReceiptCredentialResult - (subscriptions.PaymentProvider)(0), // 3: org.signal.chat.purchase.PaymentProvider - (*errors.FailedPrecondition)(nil), // 4: org.signal.chat.errors.FailedPrecondition - (*subscriptions.PaymentRequired)(nil), // 5: org.signal.chat.purchase.PaymentRequired - (*errors.NotFound)(nil), // 6: org.signal.chat.errors.NotFound -} -var file_org_signal_chat_login_purchase_proto_depIdxs = []int32{ - 3, // 0: org.signal.chat.purchase.CreateLoginReceiptCredentialRequest.processor:type_name -> org.signal.chat.purchase.PaymentProvider - 2, // 1: org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.result:type_name -> org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.CreateLoginReceiptCredentialResult - 4, // 2: org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.payment_still_processing:type_name -> org.signal.chat.errors.FailedPrecondition - 5, // 3: org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.payment_required:type_name -> org.signal.chat.purchase.PaymentRequired - 6, // 4: org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.payment_not_found:type_name -> org.signal.chat.errors.NotFound - 4, // 5: org.signal.chat.purchase.CreateLoginReceiptCredentialResponse.receipt_already_issued:type_name -> org.signal.chat.errors.FailedPrecondition - 0, // 6: org.signal.chat.purchase.LoginPurchase.CreateLoginReceiptCredential:input_type -> org.signal.chat.purchase.CreateLoginReceiptCredentialRequest - 1, // 7: org.signal.chat.purchase.LoginPurchase.CreateLoginReceiptCredential:output_type -> org.signal.chat.purchase.CreateLoginReceiptCredentialResponse - 7, // [7:8] is the sub-list for method output_type - 6, // [6:7] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_login_purchase_proto_init() } -func file_org_signal_chat_login_purchase_proto_init() { - if File_org_signal_chat_login_purchase_proto != nil { - return - } - file_org_signal_chat_login_purchase_proto_msgTypes[1].OneofWrappers = []any{ - (*CreateLoginReceiptCredentialResponse_Result)(nil), - (*CreateLoginReceiptCredentialResponse_PaymentStillProcessing)(nil), - (*CreateLoginReceiptCredentialResponse_PaymentRequired)(nil), - (*CreateLoginReceiptCredentialResponse_PaymentNotFound)(nil), - (*CreateLoginReceiptCredentialResponse_ReceiptAlreadyIssued)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_login_purchase_proto_rawDesc), len(file_org_signal_chat_login_purchase_proto_rawDesc)), - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_login_purchase_proto_goTypes, - DependencyIndexes: file_org_signal_chat_login_purchase_proto_depIdxs, - MessageInfos: file_org_signal_chat_login_purchase_proto_msgTypes, - }.Build() - File_org_signal_chat_login_purchase_proto = out.File - file_org_signal_chat_login_purchase_proto_goTypes = nil - file_org_signal_chat_login_purchase_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/login_purchase/login_purchase_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/login_purchase/login_purchase_grpc.pb.go deleted file mode 100644 index 38d4ce3..0000000 --- a/pkg/signalmeow/protobuf/rpc/login_purchase/login_purchase_grpc.pb.go +++ /dev/null @@ -1,135 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/login_purchase.proto - -package login_purchase - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - LoginPurchase_CreateLoginReceiptCredential_FullMethodName = "/org.signal.chat.purchase.LoginPurchase/CreateLoginReceiptCredential" -) - -// LoginPurchaseClient is the client API for LoginPurchase service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Service for one-time purchases of logins -type LoginPurchaseClient interface { - // Obtain a ZK receipt credential for a completed one-time login payment. - // - // The receipt credential can then be presented at registration - CreateLoginReceiptCredential(ctx context.Context, in *CreateLoginReceiptCredentialRequest, opts ...grpc.CallOption) (*CreateLoginReceiptCredentialResponse, error) -} - -type loginPurchaseClient struct { - cc grpc.ClientConnInterface -} - -func NewLoginPurchaseClient(cc grpc.ClientConnInterface) LoginPurchaseClient { - return &loginPurchaseClient{cc} -} - -func (c *loginPurchaseClient) CreateLoginReceiptCredential(ctx context.Context, in *CreateLoginReceiptCredentialRequest, opts ...grpc.CallOption) (*CreateLoginReceiptCredentialResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateLoginReceiptCredentialResponse) - err := c.cc.Invoke(ctx, LoginPurchase_CreateLoginReceiptCredential_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LoginPurchaseServer is the server API for LoginPurchase service. -// All implementations must embed UnimplementedLoginPurchaseServer -// for forward compatibility. -// -// Service for one-time purchases of logins -type LoginPurchaseServer interface { - // Obtain a ZK receipt credential for a completed one-time login payment. - // - // The receipt credential can then be presented at registration - CreateLoginReceiptCredential(context.Context, *CreateLoginReceiptCredentialRequest) (*CreateLoginReceiptCredentialResponse, error) - mustEmbedUnimplementedLoginPurchaseServer() -} - -// UnimplementedLoginPurchaseServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedLoginPurchaseServer struct{} - -func (UnimplementedLoginPurchaseServer) CreateLoginReceiptCredential(context.Context, *CreateLoginReceiptCredentialRequest) (*CreateLoginReceiptCredentialResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreateLoginReceiptCredential not implemented") -} -func (UnimplementedLoginPurchaseServer) mustEmbedUnimplementedLoginPurchaseServer() {} -func (UnimplementedLoginPurchaseServer) testEmbeddedByValue() {} - -// UnsafeLoginPurchaseServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to LoginPurchaseServer will -// result in compilation errors. -type UnsafeLoginPurchaseServer interface { - mustEmbedUnimplementedLoginPurchaseServer() -} - -func RegisterLoginPurchaseServer(s grpc.ServiceRegistrar, srv LoginPurchaseServer) { - // If the following call panics, it indicates UnimplementedLoginPurchaseServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&LoginPurchase_ServiceDesc, srv) -} - -func _LoginPurchase_CreateLoginReceiptCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateLoginReceiptCredentialRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LoginPurchaseServer).CreateLoginReceiptCredential(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: LoginPurchase_CreateLoginReceiptCredential_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LoginPurchaseServer).CreateLoginReceiptCredential(ctx, req.(*CreateLoginReceiptCredentialRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// LoginPurchase_ServiceDesc is the grpc.ServiceDesc for LoginPurchase service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var LoginPurchase_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.purchase.LoginPurchase", - HandlerType: (*LoginPurchaseServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateLoginReceiptCredential", - Handler: _LoginPurchase_CreateLoginReceiptCredential_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/login_purchase.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/messages/messages.pb.go b/pkg/signalmeow/protobuf/rpc/messages/messages.pb.go deleted file mode 100644 index 2286bd3..0000000 --- a/pkg/signalmeow/protobuf/rpc/messages/messages.pb.go +++ /dev/null @@ -1,1986 +0,0 @@ -// -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/messages.proto - -package messages - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SendMessageType int32 - -const ( - SendMessageType_UNSPECIFIED SendMessageType = 0 - // A double-ratchet message represents a "normal," "unsealed-sender" message - // encrypted using the Double Ratchet within an established Signal session. - SendMessageType_DOUBLE_RATCHET SendMessageType = 1 - // 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. - SendMessageType_PREKEY_MESSAGE SendMessageType = 2 - // 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. - SendMessageType_PLAINTEXT_CONTENT SendMessageType = 3 - // An unidentified sender message is an encrypted message. No other - // information about the type of the encrypted message is known to the server. - // - // Unidenitfied sender messages require an unidentified access token or a - // group send endorsement token to prove the unidentified sender is authorized - // to send messages to the destination. - SendMessageType_UNIDENTIFIED_SENDER SendMessageType = 4 -) - -// Enum value maps for SendMessageType. -var ( - SendMessageType_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "DOUBLE_RATCHET", - 2: "PREKEY_MESSAGE", - 3: "PLAINTEXT_CONTENT", - 4: "UNIDENTIFIED_SENDER", - } - SendMessageType_value = map[string]int32{ - "UNSPECIFIED": 0, - "DOUBLE_RATCHET": 1, - "PREKEY_MESSAGE": 2, - "PLAINTEXT_CONTENT": 3, - "UNIDENTIFIED_SENDER": 4, - } -) - -func (x SendMessageType) Enum() *SendMessageType { - p := new(SendMessageType) - *p = x - return p -} - -func (x SendMessageType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SendMessageType) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_messages_proto_enumTypes[0].Descriptor() -} - -func (SendMessageType) Type() protoreflect.EnumType { - return &file_org_signal_chat_messages_proto_enumTypes[0] -} - -func (x SendMessageType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SendMessageType.Descriptor instead. -func (SendMessageType) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{0} -} - -type ChallengeRequired_ChallengeType int32 - -const ( - ChallengeRequired_UNSPECIFIED ChallengeRequired_ChallengeType = 0 - // A challenge that callers can fulfill by completing a captcha. - ChallengeRequired_CAPTCHA ChallengeRequired_ChallengeType = 1 - // A challenge that callers can fulfill by supplying a token delivered via - // push notification. - ChallengeRequired_PUSH_CHALLENGE ChallengeRequired_ChallengeType = 2 -) - -// Enum value maps for ChallengeRequired_ChallengeType. -var ( - ChallengeRequired_ChallengeType_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "CAPTCHA", - 2: "PUSH_CHALLENGE", - } - ChallengeRequired_ChallengeType_value = map[string]int32{ - "UNSPECIFIED": 0, - "CAPTCHA": 1, - "PUSH_CHALLENGE": 2, - } -) - -func (x ChallengeRequired_ChallengeType) Enum() *ChallengeRequired_ChallengeType { - p := new(ChallengeRequired_ChallengeType) - *p = x - return p -} - -func (x ChallengeRequired_ChallengeType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ChallengeRequired_ChallengeType) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_messages_proto_enumTypes[1].Descriptor() -} - -func (ChallengeRequired_ChallengeType) Type() protoreflect.EnumType { - return &file_org_signal_chat_messages_proto_enumTypes[1] -} - -func (x ChallengeRequired_ChallengeType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ChallengeRequired_ChallengeType.Descriptor instead. -func (ChallengeRequired_ChallengeType) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{17, 0} -} - -type GetMessagesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Request: - // - // *GetMessagesRequest_Options - // *GetMessagesRequest_ServerGuidAck - Request isGetMessagesRequest_Request `protobuf_oneof:"request"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMessagesRequest) Reset() { - *x = GetMessagesRequest{} - mi := &file_org_signal_chat_messages_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMessagesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMessagesRequest) ProtoMessage() {} - -func (x *GetMessagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[0] - 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 GetMessagesRequest.ProtoReflect.Descriptor instead. -func (*GetMessagesRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{0} -} - -func (x *GetMessagesRequest) GetRequest() isGetMessagesRequest_Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *GetMessagesRequest) GetOptions() *GetMessagesRequest_GetMessageOptions { - if x != nil { - if x, ok := x.Request.(*GetMessagesRequest_Options); ok { - return x.Options - } - } - return nil -} - -func (x *GetMessagesRequest) GetServerGuidAck() []byte { - if x != nil { - if x, ok := x.Request.(*GetMessagesRequest_ServerGuidAck); ok { - return x.ServerGuidAck - } - } - return nil -} - -type isGetMessagesRequest_Request interface { - isGetMessagesRequest_Request() -} - -type GetMessagesRequest_Options struct { - // Configuration options for the message stream. Required for the first - // request of the stream, forbidden on subsequent reqeusts. - Options *GetMessagesRequest_GetMessageOptions `protobuf:"bytes,1,opt,name=options,proto3,oneof"` -} - -type GetMessagesRequest_ServerGuidAck struct { - // The server_guid of an envelope previously returned in a - // GetMessagesResponse that has been successfully processed by the caller. - // Forbidden on the first request of the stream, required on subsequent - // requests. - ServerGuidAck []byte `protobuf:"bytes,2,opt,name=server_guid_ack,json=serverGuidAck,proto3,oneof"` -} - -func (*GetMessagesRequest_Options) isGetMessagesRequest_Request() {} - -func (*GetMessagesRequest_ServerGuidAck) isGetMessagesRequest_Request() {} - -// The reason why a GetMessages RPC is being closed by the server. -type GetMessagesStreamClosed struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Reason: - // - // *GetMessagesStreamClosed_ConflictingStream - Reason isGetMessagesStreamClosed_Reason `protobuf_oneof:"reason"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMessagesStreamClosed) Reset() { - *x = GetMessagesStreamClosed{} - mi := &file_org_signal_chat_messages_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMessagesStreamClosed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMessagesStreamClosed) ProtoMessage() {} - -func (x *GetMessagesStreamClosed) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[1] - 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 GetMessagesStreamClosed.ProtoReflect.Descriptor instead. -func (*GetMessagesStreamClosed) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{1} -} - -func (x *GetMessagesStreamClosed) GetReason() isGetMessagesStreamClosed_Reason { - if x != nil { - return x.Reason - } - return nil -} - -func (x *GetMessagesStreamClosed) GetConflictingStream() *emptypb.Empty { - if x != nil { - if x, ok := x.Reason.(*GetMessagesStreamClosed_ConflictingStream); ok { - return x.ConflictingStream - } - } - return nil -} - -type isGetMessagesStreamClosed_Reason interface { - isGetMessagesStreamClosed_Reason() -} - -type GetMessagesStreamClosed_ConflictingStream struct { - // Another caller has opened a GetMessages stream for the same device. - ConflictingStream *emptypb.Empty `protobuf:"bytes,1,opt,name=conflicting_stream,json=conflictingStream,proto3,oneof"` -} - -func (*GetMessagesStreamClosed_ConflictingStream) isGetMessagesStreamClosed_Reason() {} - -type GetMessagesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetMessagesResponse_Envelope - // *GetMessagesResponse_QueueEmpty - Response isGetMessagesResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMessagesResponse) Reset() { - *x = GetMessagesResponse{} - mi := &file_org_signal_chat_messages_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMessagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMessagesResponse) ProtoMessage() {} - -func (x *GetMessagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[2] - 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 GetMessagesResponse.ProtoReflect.Descriptor instead. -func (*GetMessagesResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{2} -} - -func (x *GetMessagesResponse) GetResponse() isGetMessagesResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetMessagesResponse) GetEnvelope() *signalpb.Envelope { - if x != nil { - if x, ok := x.Response.(*GetMessagesResponse_Envelope); ok { - return x.Envelope - } - } - return nil -} - -func (x *GetMessagesResponse) GetQueueEmpty() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*GetMessagesResponse_QueueEmpty); ok { - return x.QueueEmpty - } - } - return nil -} - -type isGetMessagesResponse_Response interface { - isGetMessagesResponse_Response() -} - -type GetMessagesResponse_Envelope struct { - // A message. On successful receipt of an envelope the caller should ack - // the envelope by sending a GetMessagesRequest with the envelope's server - // guid. Acks should only be sent for envelopes received on the currently - // open RPC. - Envelope *signalpb.Envelope `protobuf:"bytes,1,opt,name=envelope,proto3,oneof"` -} - -type GetMessagesResponse_QueueEmpty struct { - // An indicator that all outstanding messages for the device have been - // drained and acked by the client. The stream will remain open and continue - // to deliver newly arrived messages. - QueueEmpty *emptypb.Empty `protobuf:"bytes,2,opt,name=queue_empty,json=queueEmpty,proto3,oneof"` -} - -func (*GetMessagesResponse_Envelope) isGetMessagesResponse_Response() {} - -func (*GetMessagesResponse_QueueEmpty) isGetMessagesResponse_Response() {} - -type IndividualRecipientMessageBundle struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The time, in milliseconds since the epoch, at which this message was - // originally sent from the perspective of the sender. Note that the maximum - // allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date - // for additional details and discussion. - Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // A map of device IDs to individual messages. Generally, callers must include - // one message for each device linked to the destination account. In cases of - // "sync messages" where a sender is distributing information to other devices - // linked to the sender's account, senders may omit a message for the sending - // device. - Messages map[uint32]*IndividualRecipientMessageBundle_Message `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IndividualRecipientMessageBundle) Reset() { - *x = IndividualRecipientMessageBundle{} - mi := &file_org_signal_chat_messages_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IndividualRecipientMessageBundle) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IndividualRecipientMessageBundle) ProtoMessage() {} - -func (x *IndividualRecipientMessageBundle) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[3] - 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 IndividualRecipientMessageBundle.ProtoReflect.Descriptor instead. -func (*IndividualRecipientMessageBundle) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{3} -} - -func (x *IndividualRecipientMessageBundle) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *IndividualRecipientMessageBundle) GetMessages() map[uint32]*IndividualRecipientMessageBundle_Message { - if x != nil { - return x.Messages - } - return nil -} - -type SendAuthenticatedSenderMessageRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier of the account to which to deliver the message. - Destination *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` - // If true, this message will only be delivered to destination devices that - // have an active message delivery channel with a Signal server. - Ephemeral bool `protobuf:"varint,2,opt,name=ephemeral,proto3" json:"ephemeral,omitempty"` - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - Urgent bool `protobuf:"varint,3,opt,name=urgent,proto3" json:"urgent,omitempty"` - // The messages to send to the destination account. - Messages *IndividualRecipientMessageBundle `protobuf:"bytes,4,opt,name=messages,proto3" json:"messages,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendAuthenticatedSenderMessageRequest) Reset() { - *x = SendAuthenticatedSenderMessageRequest{} - mi := &file_org_signal_chat_messages_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendAuthenticatedSenderMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendAuthenticatedSenderMessageRequest) ProtoMessage() {} - -func (x *SendAuthenticatedSenderMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[4] - 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 SendAuthenticatedSenderMessageRequest.ProtoReflect.Descriptor instead. -func (*SendAuthenticatedSenderMessageRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{4} -} - -func (x *SendAuthenticatedSenderMessageRequest) GetDestination() *common.ServiceIdentifier { - if x != nil { - return x.Destination - } - return nil -} - -func (x *SendAuthenticatedSenderMessageRequest) GetEphemeral() bool { - if x != nil { - return x.Ephemeral - } - return false -} - -func (x *SendAuthenticatedSenderMessageRequest) GetUrgent() bool { - if x != nil { - return x.Urgent - } - return false -} - -func (x *SendAuthenticatedSenderMessageRequest) GetMessages() *IndividualRecipientMessageBundle { - if x != nil { - return x.Messages - } - return nil -} - -type SendMessageAuthenticatedSenderResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The outcome of the message delivery - // - // Types that are valid to be assigned to Response: - // - // *SendMessageAuthenticatedSenderResponse_Success - // *SendMessageAuthenticatedSenderResponse_MismatchedDevices - // *SendMessageAuthenticatedSenderResponse_ChallengeRequired - // *SendMessageAuthenticatedSenderResponse_DestinationNotFound - Response isSendMessageAuthenticatedSenderResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendMessageAuthenticatedSenderResponse) Reset() { - *x = SendMessageAuthenticatedSenderResponse{} - mi := &file_org_signal_chat_messages_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendMessageAuthenticatedSenderResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendMessageAuthenticatedSenderResponse) ProtoMessage() {} - -func (x *SendMessageAuthenticatedSenderResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[5] - 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 SendMessageAuthenticatedSenderResponse.ProtoReflect.Descriptor instead. -func (*SendMessageAuthenticatedSenderResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{5} -} - -func (x *SendMessageAuthenticatedSenderResponse) GetResponse() isSendMessageAuthenticatedSenderResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SendMessageAuthenticatedSenderResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*SendMessageAuthenticatedSenderResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SendMessageAuthenticatedSenderResponse) GetMismatchedDevices() *MismatchedDevices { - if x != nil { - if x, ok := x.Response.(*SendMessageAuthenticatedSenderResponse_MismatchedDevices); ok { - return x.MismatchedDevices - } - } - return nil -} - -func (x *SendMessageAuthenticatedSenderResponse) GetChallengeRequired() *ChallengeRequired { - if x != nil { - if x, ok := x.Response.(*SendMessageAuthenticatedSenderResponse_ChallengeRequired); ok { - return x.ChallengeRequired - } - } - return nil -} - -func (x *SendMessageAuthenticatedSenderResponse) GetDestinationNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*SendMessageAuthenticatedSenderResponse_DestinationNotFound); ok { - return x.DestinationNotFound - } - } - return nil -} - -type isSendMessageAuthenticatedSenderResponse_Response interface { - isSendMessageAuthenticatedSenderResponse_Response() -} - -type SendMessageAuthenticatedSenderResponse_Success struct { - // The message was successfully delivered to all destination devices - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SendMessageAuthenticatedSenderResponse_MismatchedDevices struct { - // A list of discrepancies between the destination devices identified in a - // request to send a message and the devices that are actually linked to an - // account. - MismatchedDevices *MismatchedDevices `protobuf:"bytes,2,opt,name=mismatched_devices,json=mismatchedDevices,proto3,oneof"` -} - -type SendMessageAuthenticatedSenderResponse_ChallengeRequired struct { - // A description of a challenge callers must complete before sending - // additional messages. - ChallengeRequired *ChallengeRequired `protobuf:"bytes,3,opt,name=challenge_required,json=challengeRequired,proto3,oneof"` -} - -type SendMessageAuthenticatedSenderResponse_DestinationNotFound struct { - // The destination account did not exist - DestinationNotFound *errors.NotFound `protobuf:"bytes,4,opt,name=destination_not_found,json=destinationNotFound,proto3,oneof"` -} - -func (*SendMessageAuthenticatedSenderResponse_Success) isSendMessageAuthenticatedSenderResponse_Response() { -} - -func (*SendMessageAuthenticatedSenderResponse_MismatchedDevices) isSendMessageAuthenticatedSenderResponse_Response() { -} - -func (*SendMessageAuthenticatedSenderResponse_ChallengeRequired) isSendMessageAuthenticatedSenderResponse_Response() { -} - -func (*SendMessageAuthenticatedSenderResponse_DestinationNotFound) isSendMessageAuthenticatedSenderResponse_Response() { -} - -type SendSyncMessageRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - Urgent bool `protobuf:"varint,1,opt,name=urgent,proto3" json:"urgent,omitempty"` - // The messages to send to the destination account. - Messages *IndividualRecipientMessageBundle `protobuf:"bytes,2,opt,name=messages,proto3" json:"messages,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendSyncMessageRequest) Reset() { - *x = SendSyncMessageRequest{} - mi := &file_org_signal_chat_messages_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendSyncMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendSyncMessageRequest) ProtoMessage() {} - -func (x *SendSyncMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[6] - 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 SendSyncMessageRequest.ProtoReflect.Descriptor instead. -func (*SendSyncMessageRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{6} -} - -func (x *SendSyncMessageRequest) GetUrgent() bool { - if x != nil { - return x.Urgent - } - return false -} - -func (x *SendSyncMessageRequest) GetMessages() *IndividualRecipientMessageBundle { - if x != nil { - return x.Messages - } - return nil -} - -type SendSealedSenderMessageRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier of the account to which to deliver the message. - Destination *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` - // If true, this message will only be delivered to destination devices that - // have an active message delivery channel with a Signal server. - Ephemeral bool `protobuf:"varint,2,opt,name=ephemeral,proto3" json:"ephemeral,omitempty"` - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - Urgent bool `protobuf:"varint,3,opt,name=urgent,proto3" json:"urgent,omitempty"` - // The messages to send to the destination account. - Messages *IndividualRecipientMessageBundle `protobuf:"bytes,4,opt,name=messages,proto3" json:"messages,omitempty"` - // A means to authorize the request. - // - // Types that are valid to be assigned to Authorization: - // - // *SendSealedSenderMessageRequest_UnidentifiedAccessKey - // *SendSealedSenderMessageRequest_GroupSendToken - // *SendSealedSenderMessageRequest_UnrestrictedAccess - Authorization isSendSealedSenderMessageRequest_Authorization `protobuf_oneof:"authorization"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendSealedSenderMessageRequest) Reset() { - *x = SendSealedSenderMessageRequest{} - mi := &file_org_signal_chat_messages_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendSealedSenderMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendSealedSenderMessageRequest) ProtoMessage() {} - -func (x *SendSealedSenderMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[7] - 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 SendSealedSenderMessageRequest.ProtoReflect.Descriptor instead. -func (*SendSealedSenderMessageRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{7} -} - -func (x *SendSealedSenderMessageRequest) GetDestination() *common.ServiceIdentifier { - if x != nil { - return x.Destination - } - return nil -} - -func (x *SendSealedSenderMessageRequest) GetEphemeral() bool { - if x != nil { - return x.Ephemeral - } - return false -} - -func (x *SendSealedSenderMessageRequest) GetUrgent() bool { - if x != nil { - return x.Urgent - } - return false -} - -func (x *SendSealedSenderMessageRequest) GetMessages() *IndividualRecipientMessageBundle { - if x != nil { - return x.Messages - } - return nil -} - -func (x *SendSealedSenderMessageRequest) GetAuthorization() isSendSealedSenderMessageRequest_Authorization { - if x != nil { - return x.Authorization - } - return nil -} - -func (x *SendSealedSenderMessageRequest) GetUnidentifiedAccessKey() []byte { - if x != nil { - if x, ok := x.Authorization.(*SendSealedSenderMessageRequest_UnidentifiedAccessKey); ok { - return x.UnidentifiedAccessKey - } - } - return nil -} - -func (x *SendSealedSenderMessageRequest) GetGroupSendToken() []byte { - if x != nil { - if x, ok := x.Authorization.(*SendSealedSenderMessageRequest_GroupSendToken); ok { - return x.GroupSendToken - } - } - return nil -} - -func (x *SendSealedSenderMessageRequest) GetUnrestrictedAccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Authorization.(*SendSealedSenderMessageRequest_UnrestrictedAccess); ok { - return x.UnrestrictedAccess - } - } - return nil -} - -type isSendSealedSenderMessageRequest_Authorization interface { - isSendSealedSenderMessageRequest_Authorization() -} - -type SendSealedSenderMessageRequest_UnidentifiedAccessKey struct { - // The unidentified access key (UAK) for the destination account. - UnidentifiedAccessKey []byte `protobuf:"bytes,5,opt,name=unidentified_access_key,json=unidentifiedAccessKey,proto3,oneof"` -} - -type SendSealedSenderMessageRequest_GroupSendToken struct { - // A group send endorsement token for the destination account. - GroupSendToken []byte `protobuf:"bytes,6,opt,name=group_send_token,json=groupSendToken,proto3,oneof"` -} - -type SendSealedSenderMessageRequest_UnrestrictedAccess struct { - // The destination account allows unrestricted unidentified access - UnrestrictedAccess *emptypb.Empty `protobuf:"bytes,7,opt,name=unrestricted_access,json=unrestrictedAccess,proto3,oneof"` -} - -func (*SendSealedSenderMessageRequest_UnidentifiedAccessKey) isSendSealedSenderMessageRequest_Authorization() { -} - -func (*SendSealedSenderMessageRequest_GroupSendToken) isSendSealedSenderMessageRequest_Authorization() { -} - -func (*SendSealedSenderMessageRequest_UnrestrictedAccess) isSendSealedSenderMessageRequest_Authorization() { -} - -type SendStoryMessageRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier of the account to which to deliver the message. - Destination *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - Urgent bool `protobuf:"varint,2,opt,name=urgent,proto3" json:"urgent,omitempty"` - // The messages to send to the destination account. - Messages *IndividualRecipientMessageBundle `protobuf:"bytes,3,opt,name=messages,proto3" json:"messages,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendStoryMessageRequest) Reset() { - *x = SendStoryMessageRequest{} - mi := &file_org_signal_chat_messages_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendStoryMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendStoryMessageRequest) ProtoMessage() {} - -func (x *SendStoryMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_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 SendStoryMessageRequest.ProtoReflect.Descriptor instead. -func (*SendStoryMessageRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{8} -} - -func (x *SendStoryMessageRequest) GetDestination() *common.ServiceIdentifier { - if x != nil { - return x.Destination - } - return nil -} - -func (x *SendStoryMessageRequest) GetUrgent() bool { - if x != nil { - return x.Urgent - } - return false -} - -func (x *SendStoryMessageRequest) GetMessages() *IndividualRecipientMessageBundle { - if x != nil { - return x.Messages - } - return nil -} - -type SendMessageResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The outcome of the message delivery - // - // Types that are valid to be assigned to Response: - // - // *SendMessageResponse_Success - // *SendMessageResponse_MismatchedDevices - // *SendMessageResponse_FailedUnidentifiedAuthorization - // *SendMessageResponse_DestinationNotFound - Response isSendMessageResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendMessageResponse) Reset() { - *x = SendMessageResponse{} - mi := &file_org_signal_chat_messages_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendMessageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendMessageResponse) ProtoMessage() {} - -func (x *SendMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_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 SendMessageResponse.ProtoReflect.Descriptor instead. -func (*SendMessageResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{9} -} - -func (x *SendMessageResponse) GetResponse() isSendMessageResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SendMessageResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*SendMessageResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SendMessageResponse) GetMismatchedDevices() *MismatchedDevices { - if x != nil { - if x, ok := x.Response.(*SendMessageResponse_MismatchedDevices); ok { - return x.MismatchedDevices - } - } - return nil -} - -func (x *SendMessageResponse) GetFailedUnidentifiedAuthorization() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*SendMessageResponse_FailedUnidentifiedAuthorization); ok { - return x.FailedUnidentifiedAuthorization - } - } - return nil -} - -func (x *SendMessageResponse) GetDestinationNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*SendMessageResponse_DestinationNotFound); ok { - return x.DestinationNotFound - } - } - return nil -} - -type isSendMessageResponse_Response interface { - isSendMessageResponse_Response() -} - -type SendMessageResponse_Success struct { - // The message was successfully delivered to all destination devices - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SendMessageResponse_MismatchedDevices struct { - // A list of discrepancies between the destination devices identified in a - // request to send a message and the devices that are actually linked to an - // account. - MismatchedDevices *MismatchedDevices `protobuf:"bytes,2,opt,name=mismatched_devices,json=mismatchedDevices,proto3,oneof"` -} - -type SendMessageResponse_FailedUnidentifiedAuthorization struct { - // The provided unidentified authorization credential was invalid - FailedUnidentifiedAuthorization *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=failed_unidentified_authorization,json=failedUnidentifiedAuthorization,proto3,oneof"` -} - -type SendMessageResponse_DestinationNotFound struct { - // The destination account did not exist - DestinationNotFound *errors.NotFound `protobuf:"bytes,4,opt,name=destination_not_found,json=destinationNotFound,proto3,oneof"` -} - -func (*SendMessageResponse_Success) isSendMessageResponse_Response() {} - -func (*SendMessageResponse_MismatchedDevices) isSendMessageResponse_Response() {} - -func (*SendMessageResponse_FailedUnidentifiedAuthorization) isSendMessageResponse_Response() {} - -func (*SendMessageResponse_DestinationNotFound) isSendMessageResponse_Response() {} - -type MultiRecipientMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The time, in milliseconds since the epoch, at which this message was - // originally sent from the perspective of the sender. Note that the maximum - // allowable timestamp for JavaScript clients is less than Long.MAX_VALUE; see - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#the_epoch_timestamps_and_invalid_date - // for additional details and discussion. - Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // The serialized multi-recipient message payload. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // 256 KiB payload + (5000 * 100) of overhead - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MultiRecipientMessage) Reset() { - *x = MultiRecipientMessage{} - mi := &file_org_signal_chat_messages_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MultiRecipientMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MultiRecipientMessage) ProtoMessage() {} - -func (x *MultiRecipientMessage) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_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 MultiRecipientMessage.ProtoReflect.Descriptor instead. -func (*MultiRecipientMessage) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{10} -} - -func (x *MultiRecipientMessage) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *MultiRecipientMessage) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -type SendMultiRecipientMessageRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If true, this message will only be delivered to destination devices that - // have an active message delivery channel with a Signal server. - Ephemeral bool `protobuf:"varint,1,opt,name=ephemeral,proto3" json:"ephemeral,omitempty"` - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - Urgent bool `protobuf:"varint,2,opt,name=urgent,proto3" json:"urgent,omitempty"` - // The multi-recipient message to send to all destination accounts and - // devices. - Message *MultiRecipientMessage `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - // A group send endorsement token for the destination account. - GroupSendToken []byte `protobuf:"bytes,4,opt,name=group_send_token,json=groupSendToken,proto3" json:"group_send_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendMultiRecipientMessageRequest) Reset() { - *x = SendMultiRecipientMessageRequest{} - mi := &file_org_signal_chat_messages_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendMultiRecipientMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendMultiRecipientMessageRequest) ProtoMessage() {} - -func (x *SendMultiRecipientMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[11] - 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 SendMultiRecipientMessageRequest.ProtoReflect.Descriptor instead. -func (*SendMultiRecipientMessageRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{11} -} - -func (x *SendMultiRecipientMessageRequest) GetEphemeral() bool { - if x != nil { - return x.Ephemeral - } - return false -} - -func (x *SendMultiRecipientMessageRequest) GetUrgent() bool { - if x != nil { - return x.Urgent - } - return false -} - -func (x *SendMultiRecipientMessageRequest) GetMessage() *MultiRecipientMessage { - if x != nil { - return x.Message - } - return nil -} - -func (x *SendMultiRecipientMessageRequest) GetGroupSendToken() []byte { - if x != nil { - return x.GroupSendToken - } - return nil -} - -type SendMultiRecipientStoryRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Indicates whether this message is urgent and should trigger a high-priority - // notification if the destination device does not have an active message - // delivery channel with a Signal server - Urgent bool `protobuf:"varint,1,opt,name=urgent,proto3" json:"urgent,omitempty"` - // The multi-recipient story message to send to all destination accounts and - // devices. - Message *MultiRecipientMessage `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendMultiRecipientStoryRequest) Reset() { - *x = SendMultiRecipientStoryRequest{} - mi := &file_org_signal_chat_messages_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendMultiRecipientStoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendMultiRecipientStoryRequest) ProtoMessage() {} - -func (x *SendMultiRecipientStoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_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 SendMultiRecipientStoryRequest.ProtoReflect.Descriptor instead. -func (*SendMultiRecipientStoryRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{12} -} - -func (x *SendMultiRecipientStoryRequest) GetUrgent() bool { - if x != nil { - return x.Urgent - } - return false -} - -func (x *SendMultiRecipientStoryRequest) GetMessage() *MultiRecipientMessage { - if x != nil { - return x.Message - } - return nil -} - -type MultiRecipientSuccess struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of destination service identifiers that could not be resolved to - // registered Signal accounts. The message in the original request was sent - // to all service identifiers/devices in the original request except for the - // destination devices associated with the service identifiers in this list. - UnresolvedRecipients []*common.ServiceIdentifier `protobuf:"bytes,1,rep,name=unresolved_recipients,json=unresolvedRecipients,proto3" json:"unresolved_recipients,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MultiRecipientSuccess) Reset() { - *x = MultiRecipientSuccess{} - mi := &file_org_signal_chat_messages_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MultiRecipientSuccess) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MultiRecipientSuccess) ProtoMessage() {} - -func (x *MultiRecipientSuccess) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_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 MultiRecipientSuccess.ProtoReflect.Descriptor instead. -func (*MultiRecipientSuccess) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{13} -} - -func (x *MultiRecipientSuccess) GetUnresolvedRecipients() []*common.ServiceIdentifier { - if x != nil { - return x.UnresolvedRecipients - } - return nil -} - -type SendMultiRecipientMessageResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The outcome of the message delivery - // - // Types that are valid to be assigned to Response: - // - // *SendMultiRecipientMessageResponse_Success - // *SendMultiRecipientMessageResponse_MismatchedDevices - // *SendMultiRecipientMessageResponse_FailedUnidentifiedAuthorization - Response isSendMultiRecipientMessageResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendMultiRecipientMessageResponse) Reset() { - *x = SendMultiRecipientMessageResponse{} - mi := &file_org_signal_chat_messages_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendMultiRecipientMessageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendMultiRecipientMessageResponse) ProtoMessage() {} - -func (x *SendMultiRecipientMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_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 SendMultiRecipientMessageResponse.ProtoReflect.Descriptor instead. -func (*SendMultiRecipientMessageResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{14} -} - -func (x *SendMultiRecipientMessageResponse) GetResponse() isSendMultiRecipientMessageResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SendMultiRecipientMessageResponse) GetSuccess() *MultiRecipientSuccess { - if x != nil { - if x, ok := x.Response.(*SendMultiRecipientMessageResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SendMultiRecipientMessageResponse) GetMismatchedDevices() *MultiRecipientMismatchedDevices { - if x != nil { - if x, ok := x.Response.(*SendMultiRecipientMessageResponse_MismatchedDevices); ok { - return x.MismatchedDevices - } - } - return nil -} - -func (x *SendMultiRecipientMessageResponse) GetFailedUnidentifiedAuthorization() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*SendMultiRecipientMessageResponse_FailedUnidentifiedAuthorization); ok { - return x.FailedUnidentifiedAuthorization - } - } - return nil -} - -type isSendMultiRecipientMessageResponse_Response interface { - isSendMultiRecipientMessageResponse_Response() -} - -type SendMultiRecipientMessageResponse_Success struct { - // The message was sent to at least some of the destination accounts/devices - // identified in the original request. - Success *MultiRecipientSuccess `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SendMultiRecipientMessageResponse_MismatchedDevices struct { - // A list of sets of discrepancies between the destination devices - // identified in a request to send a message and the devices that are - // actually linked to a destination account. - MismatchedDevices *MultiRecipientMismatchedDevices `protobuf:"bytes,2,opt,name=mismatched_devices,json=mismatchedDevices,proto3,oneof"` -} - -type SendMultiRecipientMessageResponse_FailedUnidentifiedAuthorization struct { - // The provided unidentified authorization credential was invalid - FailedUnidentifiedAuthorization *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=failed_unidentified_authorization,json=failedUnidentifiedAuthorization,proto3,oneof"` -} - -func (*SendMultiRecipientMessageResponse_Success) isSendMultiRecipientMessageResponse_Response() {} - -func (*SendMultiRecipientMessageResponse_MismatchedDevices) isSendMultiRecipientMessageResponse_Response() { -} - -func (*SendMultiRecipientMessageResponse_FailedUnidentifiedAuthorization) isSendMultiRecipientMessageResponse_Response() { -} - -type MismatchedDevices struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The service identifier to which the devices named in this object are - // linked. - ServiceIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=service_identifier,json=serviceIdentifier,proto3" json:"service_identifier,omitempty"` - // A list of device IDs that are linked to the destination account, but were - // not included in the collection of messages bound for the destination - // account. - MissingDevices []uint32 `protobuf:"varint,2,rep,packed,name=missing_devices,json=missingDevices,proto3" json:"missing_devices,omitempty"` - // A list of device IDs that were included in the collection of messages bound - // for the destination account, but are not currently linked to the - // destination account. - ExtraDevices []uint32 `protobuf:"varint,3,rep,packed,name=extra_devices,json=extraDevices,proto3" json:"extra_devices,omitempty"` - // A list of device IDs that present in the collection of messages bound for - // the destination account and are linked to the destination account, but have - // a different registration ID than the registration ID presented by the - // sender (indicating that the destination device has likely been replaced by - // another device). - StaleDevices []uint32 `protobuf:"varint,4,rep,packed,name=stale_devices,json=staleDevices,proto3" json:"stale_devices,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MismatchedDevices) Reset() { - *x = MismatchedDevices{} - mi := &file_org_signal_chat_messages_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MismatchedDevices) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MismatchedDevices) ProtoMessage() {} - -func (x *MismatchedDevices) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_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 MismatchedDevices.ProtoReflect.Descriptor instead. -func (*MismatchedDevices) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{15} -} - -func (x *MismatchedDevices) GetServiceIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.ServiceIdentifier - } - return nil -} - -func (x *MismatchedDevices) GetMissingDevices() []uint32 { - if x != nil { - return x.MissingDevices - } - return nil -} - -func (x *MismatchedDevices) GetExtraDevices() []uint32 { - if x != nil { - return x.ExtraDevices - } - return nil -} - -func (x *MismatchedDevices) GetStaleDevices() []uint32 { - if x != nil { - return x.StaleDevices - } - return nil -} - -type MultiRecipientMismatchedDevices struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A list of sets of discrepancies between the destination devices identified - // in a request to send a message and the devices that are actually linked to - // a destination account. - MismatchedDevices []*MismatchedDevices `protobuf:"bytes,1,rep,name=mismatched_devices,json=mismatchedDevices,proto3" json:"mismatched_devices,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MultiRecipientMismatchedDevices) Reset() { - *x = MultiRecipientMismatchedDevices{} - mi := &file_org_signal_chat_messages_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MultiRecipientMismatchedDevices) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MultiRecipientMismatchedDevices) ProtoMessage() {} - -func (x *MultiRecipientMismatchedDevices) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[16] - 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 MultiRecipientMismatchedDevices.ProtoReflect.Descriptor instead. -func (*MultiRecipientMismatchedDevices) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{16} -} - -func (x *MultiRecipientMismatchedDevices) GetMismatchedDevices() []*MismatchedDevices { - if x != nil { - return x.MismatchedDevices - } - return nil -} - -type ChallengeRequired struct { - state protoimpl.MessageState `protogen:"open.v1"` - // An opaque token identifying this challenge request. Clients must generally - // submit this token when submitting a challenge response. - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - // A list of challenge types callers may choose to complete to resolve the - // challenge requirement. May be empty, in which case callers cannot resolve - // the challenge by any means other than waiting. - ChallengeOptions []ChallengeRequired_ChallengeType `protobuf:"varint,2,rep,packed,name=challenge_options,json=challengeOptions,proto3,enum=org.signal.chat.messages.ChallengeRequired_ChallengeType" json:"challenge_options,omitempty"` - // A duration (in seconds) after which the challenge requirement may be - // resolved by simply waiting. May not be set if the challenge cannot be - // resolved by waiting. - RetryAfterSeconds *uint64 `protobuf:"varint,3,opt,name=retry_after_seconds,json=retryAfterSeconds,proto3,oneof" json:"retry_after_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChallengeRequired) Reset() { - *x = ChallengeRequired{} - mi := &file_org_signal_chat_messages_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChallengeRequired) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChallengeRequired) ProtoMessage() {} - -func (x *ChallengeRequired) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[17] - 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 ChallengeRequired.ProtoReflect.Descriptor instead. -func (*ChallengeRequired) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{17} -} - -func (x *ChallengeRequired) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -func (x *ChallengeRequired) GetChallengeOptions() []ChallengeRequired_ChallengeType { - if x != nil { - return x.ChallengeOptions - } - return nil -} - -func (x *ChallengeRequired) GetRetryAfterSeconds() uint64 { - if x != nil && x.RetryAfterSeconds != nil { - return *x.RetryAfterSeconds - } - return 0 -} - -type GetMessagesRequest_GetMessageOptions struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If present and true, the server will not deliver any messages with the - // story flag set. This flag may only be set on the first GetMessagesRequest - // sent from the client to the server in an RPC stream. - DropStories bool `protobuf:"varint,1,opt,name=drop_stories,json=dropStories,proto3" json:"drop_stories,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMessagesRequest_GetMessageOptions) Reset() { - *x = GetMessagesRequest_GetMessageOptions{} - mi := &file_org_signal_chat_messages_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMessagesRequest_GetMessageOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMessagesRequest_GetMessageOptions) ProtoMessage() {} - -func (x *GetMessagesRequest_GetMessageOptions) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[18] - 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 GetMessagesRequest_GetMessageOptions.ProtoReflect.Descriptor instead. -func (*GetMessagesRequest_GetMessageOptions) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *GetMessagesRequest_GetMessageOptions) GetDropStories() bool { - if x != nil { - return x.DropStories - } - return false -} - -// A message for an individual device linked to a destination account. -type IndividualRecipientMessageBundle_Message struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The registration ID for the destination device. - RegistrationId uint32 `protobuf:"varint,1,opt,name=registration_id,json=registrationId,proto3" json:"registration_id,omitempty"` - // The content of the message to deliver to the destination device. - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // 256 KiB - // The message type of the message. If this message is part of an - // unidentified send, this must be UNIDENTIFIED_SENDER - Type SendMessageType `protobuf:"varint,3,opt,name=type,proto3,enum=org.signal.chat.messages.SendMessageType" json:"type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IndividualRecipientMessageBundle_Message) Reset() { - *x = IndividualRecipientMessageBundle_Message{} - mi := &file_org_signal_chat_messages_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IndividualRecipientMessageBundle_Message) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IndividualRecipientMessageBundle_Message) ProtoMessage() {} - -func (x *IndividualRecipientMessageBundle_Message) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_messages_proto_msgTypes[19] - 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 IndividualRecipientMessageBundle_Message.ProtoReflect.Descriptor instead. -func (*IndividualRecipientMessageBundle_Message) Descriptor() ([]byte, []int) { - return file_org_signal_chat_messages_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *IndividualRecipientMessageBundle_Message) GetRegistrationId() uint32 { - if x != nil { - return x.RegistrationId - } - return 0 -} - -func (x *IndividualRecipientMessageBundle_Message) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *IndividualRecipientMessageBundle_Message) GetType() SendMessageType { - if x != nil { - return x.Type - } - return SendMessageType_UNSPECIFIED -} - -var File_org_signal_chat_messages_proto protoreflect.FileDescriptor - -const file_org_signal_chat_messages_proto_rawDesc = "" + - "\n" + - "\x1eorg/signal/chat/messages.proto\x12\x18org.signal.chat.messages\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1corg/signal/chat/common.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x19org/signal/chat/tag.proto\x1a\x1csignalpb/SignalService.proto\"\xdd\x01\n" + - "\x12GetMessagesRequest\x12Z\n" + - "\aoptions\x18\x01 \x01(\v2>.org.signal.chat.messages.GetMessagesRequest.GetMessageOptionsH\x00R\aoptions\x12(\n" + - "\x0fserver_guid_ack\x18\x02 \x01(\fH\x00R\rserverGuidAck\x1a6\n" + - "\x11GetMessageOptions\x12!\n" + - "\fdrop_stories\x18\x01 \x01(\bR\vdropStoriesB\t\n" + - "\arequest\"l\n" + - "\x17GetMessagesStreamClosed\x12G\n" + - "\x12conflicting_stream\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x11conflictingStreamB\b\n" + - "\x06reason\"\x93\x01\n" + - "\x13GetMessagesResponse\x125\n" + - "\benvelope\x18\x01 \x01(\v2\x17.signalservice.EnvelopeH\x00R\benvelope\x129\n" + - "\vqueue_empty\x18\x02 \x01(\v2\x16.google.protobuf.EmptyH\x00R\n" + - "queueEmptyB\n" + - "\n" + - "\bresponse\"\xe1\x03\n" + - " IndividualRecipientMessageBundle\x12-\n" + - "\ttimestamp\x18\x01 \x01(\x04B\x0f\xb2\x97\"\v\b\x01\x10\x80\x80\xf0\x96\x8c\xc1\xac\x0fR\ttimestamp\x12j\n" + - "\bmessages\x18\x02 \x03(\v2H.org.signal.chat.messages.IndividualRecipientMessageBundle.MessagesEntryB\x04\x88\x97\"\x01R\bmessages\x1a\xa0\x01\n" + - "\aMessage\x120\n" + - "\x0fregistration_id\x18\x01 \x01(\rB\a\xb2\x97\"\x03\x10\xff\x7fR\x0eregistrationId\x12$\n" + - "\apayload\x18\x02 \x01(\fB\n" + - "\x9a\x97\"\x06\b\x01\x10\x80\x80\x10R\apayload\x12=\n" + - "\x04type\x18\x03 \x01(\x0e2).org.signal.chat.messages.SendMessageTypeR\x04type\x1a\x7f\n" + - "\rMessagesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\rR\x03key\x12X\n" + - "\x05value\x18\x02 \x01(\v2B.org.signal.chat.messages.IndividualRecipientMessageBundle.MessageR\x05value:\x028\x01\"\x82\x02\n" + - "%SendAuthenticatedSenderMessageRequest\x12K\n" + - "\vdestination\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\vdestination\x12\x1c\n" + - "\tephemeral\x18\x02 \x01(\bR\tephemeral\x12\x16\n" + - "\x06urgent\x18\x03 \x01(\bR\x06urgent\x12V\n" + - "\bmessages\x18\x04 \x01(\v2:.org.signal.chat.messages.IndividualRecipientMessageBundleR\bmessages\"\xc7\x03\n" + - "&SendMessageAuthenticatedSenderResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12t\n" + - "\x12mismatched_devices\x18\x02 \x01(\v2+.org.signal.chat.messages.MismatchedDevicesB\x16\xc2\xd5\"\x12mismatched_devicesH\x00R\x11mismatchedDevices\x12t\n" + - "\x12challenge_required\x18\x03 \x01(\v2+.org.signal.chat.messages.ChallengeRequiredB\x16\xc2\xd5\"\x12challenge_requiredH\x00R\x11challengeRequired\x12q\n" + - "\x15destination_not_found\x18\x04 \x01(\v2 .org.signal.chat.errors.NotFoundB\x19\xc2\xd5\"\x15destination_not_foundH\x00R\x13destinationNotFoundB\n" + - "\n" + - "\bresponse\"\x88\x01\n" + - "\x16SendSyncMessageRequest\x12\x16\n" + - "\x06urgent\x18\x01 \x01(\bR\x06urgent\x12V\n" + - "\bmessages\x18\x02 \x01(\v2:.org.signal.chat.messages.IndividualRecipientMessageBundleR\bmessages\"\xc4\x03\n" + - "\x1eSendSealedSenderMessageRequest\x12K\n" + - "\vdestination\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\vdestination\x12\x1c\n" + - "\tephemeral\x18\x02 \x01(\bR\tephemeral\x12\x16\n" + - "\x06urgent\x18\x03 \x01(\bR\x06urgent\x12V\n" + - "\bmessages\x18\x04 \x01(\v2:.org.signal.chat.messages.IndividualRecipientMessageBundleR\bmessages\x12?\n" + - "\x17unidentified_access_key\x18\x05 \x01(\fB\x05\xa2\x97\"\x01\x10H\x00R\x15unidentifiedAccessKey\x12*\n" + - "\x10group_send_token\x18\x06 \x01(\fH\x00R\x0egroupSendToken\x12I\n" + - "\x13unrestricted_access\x18\a \x01(\v2\x16.google.protobuf.EmptyH\x00R\x12unrestrictedAccessB\x0f\n" + - "\rauthorization\"\xd6\x01\n" + - "\x17SendStoryMessageRequest\x12K\n" + - "\vdestination\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\vdestination\x12\x16\n" + - "\x06urgent\x18\x02 \x01(\bR\x06urgent\x12V\n" + - "\bmessages\x18\x03 \x01(\v2:.org.signal.chat.messages.IndividualRecipientMessageBundleR\bmessages\"\xed\x03\n" + - "\x13SendMessageResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12t\n" + - "\x12mismatched_devices\x18\x02 \x01(\v2+.org.signal.chat.messages.MismatchedDevicesB\x16\xc2\xd5\"\x12mismatched_devicesH\x00R\x11mismatchedDevices\x12\xac\x01\n" + - "!failed_unidentified_authorization\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB%\xc2\xd5\"!failed_unidentified_authorizationH\x00R\x1ffailedUnidentifiedAuthorization\x12q\n" + - "\x15destination_not_found\x18\x04 \x01(\v2 .org.signal.chat.errors.NotFoundB\x19\xc2\xd5\"\x15destination_not_foundH\x00R\x13destinationNotFoundB\n" + - "\n" + - "\bresponse\"j\n" + - "\x15MultiRecipientMessage\x12-\n" + - "\ttimestamp\x18\x01 \x01(\x04B\x0f\xb2\x97\"\v\b\x01\x10\x80\x80\xf0\x96\x8c\xc1\xac\x0fR\ttimestamp\x12\"\n" + - "\apayload\x18\x02 \x01(\fB\b\x9a\x97\"\x04\x10\xa0\xc2.R\apayload\"\xd3\x01\n" + - " SendMultiRecipientMessageRequest\x12\x1c\n" + - "\tephemeral\x18\x01 \x01(\bR\tephemeral\x12\x16\n" + - "\x06urgent\x18\x02 \x01(\bR\x06urgent\x12I\n" + - "\amessage\x18\x03 \x01(\v2/.org.signal.chat.messages.MultiRecipientMessageR\amessage\x12.\n" + - "\x10group_send_token\x18\x04 \x01(\fB\x04\x88\x97\"\x01R\x0egroupSendToken\"\x83\x01\n" + - "\x1eSendMultiRecipientStoryRequest\x12\x16\n" + - "\x06urgent\x18\x01 \x01(\bR\x06urgent\x12I\n" + - "\amessage\x18\x02 \x01(\v2/.org.signal.chat.messages.MultiRecipientMessageR\amessage\"w\n" + - "\x15MultiRecipientSuccess\x12^\n" + - "\x15unresolved_recipients\x18\x01 \x03(\v2).org.signal.chat.common.ServiceIdentifierR\x14unresolvedRecipients\"\xb0\x03\n" + - "!SendMultiRecipientMessageResponse\x12K\n" + - "\asuccess\x18\x01 \x01(\v2/.org.signal.chat.messages.MultiRecipientSuccessH\x00R\asuccess\x12\x82\x01\n" + - "\x12mismatched_devices\x18\x02 \x01(\v29.org.signal.chat.messages.MultiRecipientMismatchedDevicesB\x16\xc2\xd5\"\x12mismatched_devicesH\x00R\x11mismatchedDevices\x12\xac\x01\n" + - "!failed_unidentified_authorization\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB%\xc2\xd5\"!failed_unidentified_authorizationH\x00R\x1ffailedUnidentifiedAuthorizationB\n" + - "\n" + - "\bresponse\"\xfe\x01\n" + - "\x11MismatchedDevices\x12X\n" + - "\x12service_identifier\x18\x01 \x01(\v2).org.signal.chat.common.ServiceIdentifierR\x11serviceIdentifier\x121\n" + - "\x0fmissing_devices\x18\x02 \x03(\rB\bҗ\"\x042\x02\x10\x7fR\x0emissingDevices\x12-\n" + - "\rextra_devices\x18\x03 \x03(\rB\bҗ\"\x042\x02\x10\x7fR\fextraDevices\x12-\n" + - "\rstale_devices\x18\x04 \x03(\rB\bҗ\"\x042\x02\x10\x7fR\fstaleDevices\"}\n" + - "\x1fMultiRecipientMismatchedDevices\x12Z\n" + - "\x12mismatched_devices\x18\x01 \x03(\v2+.org.signal.chat.messages.MismatchedDevicesR\x11mismatchedDevices\"\xa1\x02\n" + - "\x11ChallengeRequired\x12\x14\n" + - "\x05token\x18\x01 \x01(\tR\x05token\x12f\n" + - "\x11challenge_options\x18\x02 \x03(\x0e29.org.signal.chat.messages.ChallengeRequired.ChallengeTypeR\x10challengeOptions\x123\n" + - "\x13retry_after_seconds\x18\x03 \x01(\x04H\x00R\x11retryAfterSeconds\x88\x01\x01\"A\n" + - "\rChallengeType\x12\x0f\n" + - "\vUNSPECIFIED\x10\x00\x12\v\n" + - "\aCAPTCHA\x10\x01\x12\x12\n" + - "\x0ePUSH_CHALLENGE\x10\x02B\x16\n" + - "\x14_retry_after_seconds*z\n" + - "\x0fSendMessageType\x12\x0f\n" + - "\vUNSPECIFIED\x10\x00\x12\x12\n" + - "\x0eDOUBLE_RATCHET\x10\x01\x12\x12\n" + - "\x0ePREKEY_MESSAGE\x10\x02\x12\x15\n" + - "\x11PLAINTEXT_CONTENT\x10\x03\x12\x17\n" + - "\x13UNIDENTIFIED_SENDER\x10\x042\xa1\x03\n" + - "\bMessages\x12\x92\x01\n" + - "\vSendMessage\x12?.org.signal.chat.messages.SendAuthenticatedSenderMessageRequest\x1a@.org.signal.chat.messages.SendMessageAuthenticatedSenderResponse\"\x00\x12\x87\x01\n" + - "\x0fSendSyncMessage\x120.org.signal.chat.messages.SendSyncMessageRequest\x1a@.org.signal.chat.messages.SendMessageAuthenticatedSenderResponse\"\x00\x12p\n" + - "\vGetMessages\x12,.org.signal.chat.messages.GetMessagesRequest\x1a-.org.signal.chat.messages.GetMessagesResponse\"\x00(\x010\x01\x1a\x04\xc8\xd5\"\x012\xc2\x04\n" + - "\x11MessagesAnonymous\x12\x87\x01\n" + - "\x1aSendSingleRecipientMessage\x128.org.signal.chat.messages.SendSealedSenderMessageRequest\x1a-.org.signal.chat.messages.SendMessageResponse\"\x00\x12\x96\x01\n" + - "\x19SendMultiRecipientMessage\x12:.org.signal.chat.messages.SendMultiRecipientMessageRequest\x1a;.org.signal.chat.messages.SendMultiRecipientMessageResponse\"\x00\x12o\n" + - "\tSendStory\x121.org.signal.chat.messages.SendStoryMessageRequest\x1a-.org.signal.chat.messages.SendMessageResponse\"\x00\x12\x92\x01\n" + - "\x17SendMultiRecipientStory\x128.org.signal.chat.messages.SendMultiRecipientStoryRequest\x1a;.org.signal.chat.messages.SendMultiRecipientMessageResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_messages_proto_rawDescOnce sync.Once - file_org_signal_chat_messages_proto_rawDescData []byte -) - -func file_org_signal_chat_messages_proto_rawDescGZIP() []byte { - file_org_signal_chat_messages_proto_rawDescOnce.Do(func() { - file_org_signal_chat_messages_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_messages_proto_rawDesc), len(file_org_signal_chat_messages_proto_rawDesc))) - }) - return file_org_signal_chat_messages_proto_rawDescData -} - -var file_org_signal_chat_messages_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_org_signal_chat_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 21) -var file_org_signal_chat_messages_proto_goTypes = []any{ - (SendMessageType)(0), // 0: org.signal.chat.messages.SendMessageType - (ChallengeRequired_ChallengeType)(0), // 1: org.signal.chat.messages.ChallengeRequired.ChallengeType - (*GetMessagesRequest)(nil), // 2: org.signal.chat.messages.GetMessagesRequest - (*GetMessagesStreamClosed)(nil), // 3: org.signal.chat.messages.GetMessagesStreamClosed - (*GetMessagesResponse)(nil), // 4: org.signal.chat.messages.GetMessagesResponse - (*IndividualRecipientMessageBundle)(nil), // 5: org.signal.chat.messages.IndividualRecipientMessageBundle - (*SendAuthenticatedSenderMessageRequest)(nil), // 6: org.signal.chat.messages.SendAuthenticatedSenderMessageRequest - (*SendMessageAuthenticatedSenderResponse)(nil), // 7: org.signal.chat.messages.SendMessageAuthenticatedSenderResponse - (*SendSyncMessageRequest)(nil), // 8: org.signal.chat.messages.SendSyncMessageRequest - (*SendSealedSenderMessageRequest)(nil), // 9: org.signal.chat.messages.SendSealedSenderMessageRequest - (*SendStoryMessageRequest)(nil), // 10: org.signal.chat.messages.SendStoryMessageRequest - (*SendMessageResponse)(nil), // 11: org.signal.chat.messages.SendMessageResponse - (*MultiRecipientMessage)(nil), // 12: org.signal.chat.messages.MultiRecipientMessage - (*SendMultiRecipientMessageRequest)(nil), // 13: org.signal.chat.messages.SendMultiRecipientMessageRequest - (*SendMultiRecipientStoryRequest)(nil), // 14: org.signal.chat.messages.SendMultiRecipientStoryRequest - (*MultiRecipientSuccess)(nil), // 15: org.signal.chat.messages.MultiRecipientSuccess - (*SendMultiRecipientMessageResponse)(nil), // 16: org.signal.chat.messages.SendMultiRecipientMessageResponse - (*MismatchedDevices)(nil), // 17: org.signal.chat.messages.MismatchedDevices - (*MultiRecipientMismatchedDevices)(nil), // 18: org.signal.chat.messages.MultiRecipientMismatchedDevices - (*ChallengeRequired)(nil), // 19: org.signal.chat.messages.ChallengeRequired - (*GetMessagesRequest_GetMessageOptions)(nil), // 20: org.signal.chat.messages.GetMessagesRequest.GetMessageOptions - (*IndividualRecipientMessageBundle_Message)(nil), // 21: org.signal.chat.messages.IndividualRecipientMessageBundle.Message - nil, // 22: org.signal.chat.messages.IndividualRecipientMessageBundle.MessagesEntry - (*emptypb.Empty)(nil), // 23: google.protobuf.Empty - (*signalpb.Envelope)(nil), // 24: signalservice.Envelope - (*common.ServiceIdentifier)(nil), // 25: org.signal.chat.common.ServiceIdentifier - (*errors.NotFound)(nil), // 26: org.signal.chat.errors.NotFound - (*errors.FailedUnidentifiedAuthorization)(nil), // 27: org.signal.chat.errors.FailedUnidentifiedAuthorization -} -var file_org_signal_chat_messages_proto_depIdxs = []int32{ - 20, // 0: org.signal.chat.messages.GetMessagesRequest.options:type_name -> org.signal.chat.messages.GetMessagesRequest.GetMessageOptions - 23, // 1: org.signal.chat.messages.GetMessagesStreamClosed.conflicting_stream:type_name -> google.protobuf.Empty - 24, // 2: org.signal.chat.messages.GetMessagesResponse.envelope:type_name -> signalservice.Envelope - 23, // 3: org.signal.chat.messages.GetMessagesResponse.queue_empty:type_name -> google.protobuf.Empty - 22, // 4: org.signal.chat.messages.IndividualRecipientMessageBundle.messages:type_name -> org.signal.chat.messages.IndividualRecipientMessageBundle.MessagesEntry - 25, // 5: org.signal.chat.messages.SendAuthenticatedSenderMessageRequest.destination:type_name -> org.signal.chat.common.ServiceIdentifier - 5, // 6: org.signal.chat.messages.SendAuthenticatedSenderMessageRequest.messages:type_name -> org.signal.chat.messages.IndividualRecipientMessageBundle - 23, // 7: org.signal.chat.messages.SendMessageAuthenticatedSenderResponse.success:type_name -> google.protobuf.Empty - 17, // 8: org.signal.chat.messages.SendMessageAuthenticatedSenderResponse.mismatched_devices:type_name -> org.signal.chat.messages.MismatchedDevices - 19, // 9: org.signal.chat.messages.SendMessageAuthenticatedSenderResponse.challenge_required:type_name -> org.signal.chat.messages.ChallengeRequired - 26, // 10: org.signal.chat.messages.SendMessageAuthenticatedSenderResponse.destination_not_found:type_name -> org.signal.chat.errors.NotFound - 5, // 11: org.signal.chat.messages.SendSyncMessageRequest.messages:type_name -> org.signal.chat.messages.IndividualRecipientMessageBundle - 25, // 12: org.signal.chat.messages.SendSealedSenderMessageRequest.destination:type_name -> org.signal.chat.common.ServiceIdentifier - 5, // 13: org.signal.chat.messages.SendSealedSenderMessageRequest.messages:type_name -> org.signal.chat.messages.IndividualRecipientMessageBundle - 23, // 14: org.signal.chat.messages.SendSealedSenderMessageRequest.unrestricted_access:type_name -> google.protobuf.Empty - 25, // 15: org.signal.chat.messages.SendStoryMessageRequest.destination:type_name -> org.signal.chat.common.ServiceIdentifier - 5, // 16: org.signal.chat.messages.SendStoryMessageRequest.messages:type_name -> org.signal.chat.messages.IndividualRecipientMessageBundle - 23, // 17: org.signal.chat.messages.SendMessageResponse.success:type_name -> google.protobuf.Empty - 17, // 18: org.signal.chat.messages.SendMessageResponse.mismatched_devices:type_name -> org.signal.chat.messages.MismatchedDevices - 27, // 19: org.signal.chat.messages.SendMessageResponse.failed_unidentified_authorization:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 26, // 20: org.signal.chat.messages.SendMessageResponse.destination_not_found:type_name -> org.signal.chat.errors.NotFound - 12, // 21: org.signal.chat.messages.SendMultiRecipientMessageRequest.message:type_name -> org.signal.chat.messages.MultiRecipientMessage - 12, // 22: org.signal.chat.messages.SendMultiRecipientStoryRequest.message:type_name -> org.signal.chat.messages.MultiRecipientMessage - 25, // 23: org.signal.chat.messages.MultiRecipientSuccess.unresolved_recipients:type_name -> org.signal.chat.common.ServiceIdentifier - 15, // 24: org.signal.chat.messages.SendMultiRecipientMessageResponse.success:type_name -> org.signal.chat.messages.MultiRecipientSuccess - 18, // 25: org.signal.chat.messages.SendMultiRecipientMessageResponse.mismatched_devices:type_name -> org.signal.chat.messages.MultiRecipientMismatchedDevices - 27, // 26: org.signal.chat.messages.SendMultiRecipientMessageResponse.failed_unidentified_authorization:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 25, // 27: org.signal.chat.messages.MismatchedDevices.service_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 17, // 28: org.signal.chat.messages.MultiRecipientMismatchedDevices.mismatched_devices:type_name -> org.signal.chat.messages.MismatchedDevices - 1, // 29: org.signal.chat.messages.ChallengeRequired.challenge_options:type_name -> org.signal.chat.messages.ChallengeRequired.ChallengeType - 0, // 30: org.signal.chat.messages.IndividualRecipientMessageBundle.Message.type:type_name -> org.signal.chat.messages.SendMessageType - 21, // 31: org.signal.chat.messages.IndividualRecipientMessageBundle.MessagesEntry.value:type_name -> org.signal.chat.messages.IndividualRecipientMessageBundle.Message - 6, // 32: org.signal.chat.messages.Messages.SendMessage:input_type -> org.signal.chat.messages.SendAuthenticatedSenderMessageRequest - 8, // 33: org.signal.chat.messages.Messages.SendSyncMessage:input_type -> org.signal.chat.messages.SendSyncMessageRequest - 2, // 34: org.signal.chat.messages.Messages.GetMessages:input_type -> org.signal.chat.messages.GetMessagesRequest - 9, // 35: org.signal.chat.messages.MessagesAnonymous.SendSingleRecipientMessage:input_type -> org.signal.chat.messages.SendSealedSenderMessageRequest - 13, // 36: org.signal.chat.messages.MessagesAnonymous.SendMultiRecipientMessage:input_type -> org.signal.chat.messages.SendMultiRecipientMessageRequest - 10, // 37: org.signal.chat.messages.MessagesAnonymous.SendStory:input_type -> org.signal.chat.messages.SendStoryMessageRequest - 14, // 38: org.signal.chat.messages.MessagesAnonymous.SendMultiRecipientStory:input_type -> org.signal.chat.messages.SendMultiRecipientStoryRequest - 7, // 39: org.signal.chat.messages.Messages.SendMessage:output_type -> org.signal.chat.messages.SendMessageAuthenticatedSenderResponse - 7, // 40: org.signal.chat.messages.Messages.SendSyncMessage:output_type -> org.signal.chat.messages.SendMessageAuthenticatedSenderResponse - 4, // 41: org.signal.chat.messages.Messages.GetMessages:output_type -> org.signal.chat.messages.GetMessagesResponse - 11, // 42: org.signal.chat.messages.MessagesAnonymous.SendSingleRecipientMessage:output_type -> org.signal.chat.messages.SendMessageResponse - 16, // 43: org.signal.chat.messages.MessagesAnonymous.SendMultiRecipientMessage:output_type -> org.signal.chat.messages.SendMultiRecipientMessageResponse - 11, // 44: org.signal.chat.messages.MessagesAnonymous.SendStory:output_type -> org.signal.chat.messages.SendMessageResponse - 16, // 45: org.signal.chat.messages.MessagesAnonymous.SendMultiRecipientStory:output_type -> org.signal.chat.messages.SendMultiRecipientMessageResponse - 39, // [39:46] is the sub-list for method output_type - 32, // [32:39] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_messages_proto_init() } -func file_org_signal_chat_messages_proto_init() { - if File_org_signal_chat_messages_proto != nil { - return - } - file_org_signal_chat_messages_proto_msgTypes[0].OneofWrappers = []any{ - (*GetMessagesRequest_Options)(nil), - (*GetMessagesRequest_ServerGuidAck)(nil), - } - file_org_signal_chat_messages_proto_msgTypes[1].OneofWrappers = []any{ - (*GetMessagesStreamClosed_ConflictingStream)(nil), - } - file_org_signal_chat_messages_proto_msgTypes[2].OneofWrappers = []any{ - (*GetMessagesResponse_Envelope)(nil), - (*GetMessagesResponse_QueueEmpty)(nil), - } - file_org_signal_chat_messages_proto_msgTypes[5].OneofWrappers = []any{ - (*SendMessageAuthenticatedSenderResponse_Success)(nil), - (*SendMessageAuthenticatedSenderResponse_MismatchedDevices)(nil), - (*SendMessageAuthenticatedSenderResponse_ChallengeRequired)(nil), - (*SendMessageAuthenticatedSenderResponse_DestinationNotFound)(nil), - } - file_org_signal_chat_messages_proto_msgTypes[7].OneofWrappers = []any{ - (*SendSealedSenderMessageRequest_UnidentifiedAccessKey)(nil), - (*SendSealedSenderMessageRequest_GroupSendToken)(nil), - (*SendSealedSenderMessageRequest_UnrestrictedAccess)(nil), - } - file_org_signal_chat_messages_proto_msgTypes[9].OneofWrappers = []any{ - (*SendMessageResponse_Success)(nil), - (*SendMessageResponse_MismatchedDevices)(nil), - (*SendMessageResponse_FailedUnidentifiedAuthorization)(nil), - (*SendMessageResponse_DestinationNotFound)(nil), - } - file_org_signal_chat_messages_proto_msgTypes[14].OneofWrappers = []any{ - (*SendMultiRecipientMessageResponse_Success)(nil), - (*SendMultiRecipientMessageResponse_MismatchedDevices)(nil), - (*SendMultiRecipientMessageResponse_FailedUnidentifiedAuthorization)(nil), - } - file_org_signal_chat_messages_proto_msgTypes[17].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_messages_proto_rawDesc), len(file_org_signal_chat_messages_proto_rawDesc)), - NumEnums: 2, - NumMessages: 21, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_org_signal_chat_messages_proto_goTypes, - DependencyIndexes: file_org_signal_chat_messages_proto_depIdxs, - EnumInfos: file_org_signal_chat_messages_proto_enumTypes, - MessageInfos: file_org_signal_chat_messages_proto_msgTypes, - }.Build() - File_org_signal_chat_messages_proto = out.File - file_org_signal_chat_messages_proto_goTypes = nil - file_org_signal_chat_messages_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/messages/messages_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/messages/messages_grpc.pb.go deleted file mode 100644 index d9b0a6d..0000000 --- a/pkg/signalmeow/protobuf/rpc/messages/messages_grpc.pb.go +++ /dev/null @@ -1,490 +0,0 @@ -// -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/messages.proto - -package messages - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Messages_SendMessage_FullMethodName = "/org.signal.chat.messages.Messages/SendMessage" - Messages_SendSyncMessage_FullMethodName = "/org.signal.chat.messages.Messages/SendSyncMessage" - Messages_GetMessages_FullMethodName = "/org.signal.chat.messages.Messages/GetMessages" -) - -// MessagesClient is the client API for Messages service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for sending "unsealed sender" messages. -type MessagesClient interface { - // Sends an "unsealed sender" message to all devices linked to a single - // destination account. - // - // The destination account must not be the same as the authenticated caller. - // Callers should use `SendSyncMessage` to send messages to themselves. - SendMessage(ctx context.Context, in *SendAuthenticatedSenderMessageRequest, opts ...grpc.CallOption) (*SendMessageAuthenticatedSenderResponse, error) - // Sends a "sync" message to all other devices linked to the authenticated - // sender's account. - SendSyncMessage(ctx context.Context, in *SendSyncMessageRequest, opts ...grpc.CallOption) (*SendMessageAuthenticatedSenderResponse, error) - // Retrieve messages for the authenticated device. When the caller receives - // and successfully processes a message returned in a GetMessagesResponse they - // must send a corresponding GetMessagesRequest indicating that the message - // has been processed (an ack). Acks should only be sent for messages - // delivered via the currently open RPC. - // - // Only the first GetMessagesRequest may contain request parameters that - // configure the stream. The first request must not contain an ack. - // - // The server will keep the stream open until the client disconnects. Only - // one GetMessages stream may be open per device. If a second GetMessages - // stream is opened, the server may terminate any of the streams with - // a STREAM_CLOSED error reason. A GetMessagesStreamClosed message will be - // present in the error details. - GetMessages(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GetMessagesRequest, GetMessagesResponse], error) -} - -type messagesClient struct { - cc grpc.ClientConnInterface -} - -func NewMessagesClient(cc grpc.ClientConnInterface) MessagesClient { - return &messagesClient{cc} -} - -func (c *messagesClient) SendMessage(ctx context.Context, in *SendAuthenticatedSenderMessageRequest, opts ...grpc.CallOption) (*SendMessageAuthenticatedSenderResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SendMessageAuthenticatedSenderResponse) - err := c.cc.Invoke(ctx, Messages_SendMessage_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *messagesClient) SendSyncMessage(ctx context.Context, in *SendSyncMessageRequest, opts ...grpc.CallOption) (*SendMessageAuthenticatedSenderResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SendMessageAuthenticatedSenderResponse) - err := c.cc.Invoke(ctx, Messages_SendSyncMessage_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *messagesClient) GetMessages(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GetMessagesRequest, GetMessagesResponse], error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - stream, err := c.cc.NewStream(ctx, &Messages_ServiceDesc.Streams[0], Messages_GetMessages_FullMethodName, cOpts...) - if err != nil { - return nil, err - } - x := &grpc.GenericClientStream[GetMessagesRequest, GetMessagesResponse]{ClientStream: stream} - return x, nil -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Messages_GetMessagesClient = grpc.BidiStreamingClient[GetMessagesRequest, GetMessagesResponse] - -// MessagesServer is the server API for Messages service. -// All implementations must embed UnimplementedMessagesServer -// for forward compatibility. -// -// Provides methods for sending "unsealed sender" messages. -type MessagesServer interface { - // Sends an "unsealed sender" message to all devices linked to a single - // destination account. - // - // The destination account must not be the same as the authenticated caller. - // Callers should use `SendSyncMessage` to send messages to themselves. - SendMessage(context.Context, *SendAuthenticatedSenderMessageRequest) (*SendMessageAuthenticatedSenderResponse, error) - // Sends a "sync" message to all other devices linked to the authenticated - // sender's account. - SendSyncMessage(context.Context, *SendSyncMessageRequest) (*SendMessageAuthenticatedSenderResponse, error) - // Retrieve messages for the authenticated device. When the caller receives - // and successfully processes a message returned in a GetMessagesResponse they - // must send a corresponding GetMessagesRequest indicating that the message - // has been processed (an ack). Acks should only be sent for messages - // delivered via the currently open RPC. - // - // Only the first GetMessagesRequest may contain request parameters that - // configure the stream. The first request must not contain an ack. - // - // The server will keep the stream open until the client disconnects. Only - // one GetMessages stream may be open per device. If a second GetMessages - // stream is opened, the server may terminate any of the streams with - // a STREAM_CLOSED error reason. A GetMessagesStreamClosed message will be - // present in the error details. - GetMessages(grpc.BidiStreamingServer[GetMessagesRequest, GetMessagesResponse]) error - mustEmbedUnimplementedMessagesServer() -} - -// UnimplementedMessagesServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedMessagesServer struct{} - -func (UnimplementedMessagesServer) SendMessage(context.Context, *SendAuthenticatedSenderMessageRequest) (*SendMessageAuthenticatedSenderResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SendMessage not implemented") -} -func (UnimplementedMessagesServer) SendSyncMessage(context.Context, *SendSyncMessageRequest) (*SendMessageAuthenticatedSenderResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SendSyncMessage not implemented") -} -func (UnimplementedMessagesServer) GetMessages(grpc.BidiStreamingServer[GetMessagesRequest, GetMessagesResponse]) error { - return status.Error(codes.Unimplemented, "method GetMessages not implemented") -} -func (UnimplementedMessagesServer) mustEmbedUnimplementedMessagesServer() {} -func (UnimplementedMessagesServer) testEmbeddedByValue() {} - -// UnsafeMessagesServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MessagesServer will -// result in compilation errors. -type UnsafeMessagesServer interface { - mustEmbedUnimplementedMessagesServer() -} - -func RegisterMessagesServer(s grpc.ServiceRegistrar, srv MessagesServer) { - // If the following call panics, it indicates UnimplementedMessagesServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Messages_ServiceDesc, srv) -} - -func _Messages_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendAuthenticatedSenderMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MessagesServer).SendMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Messages_SendMessage_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MessagesServer).SendMessage(ctx, req.(*SendAuthenticatedSenderMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Messages_SendSyncMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendSyncMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MessagesServer).SendSyncMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Messages_SendSyncMessage_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MessagesServer).SendSyncMessage(ctx, req.(*SendSyncMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Messages_GetMessages_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(MessagesServer).GetMessages(&grpc.GenericServerStream[GetMessagesRequest, GetMessagesResponse]{ServerStream: stream}) -} - -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type Messages_GetMessagesServer = grpc.BidiStreamingServer[GetMessagesRequest, GetMessagesResponse] - -// Messages_ServiceDesc is the grpc.ServiceDesc for Messages service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Messages_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.messages.Messages", - HandlerType: (*MessagesServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SendMessage", - Handler: _Messages_SendMessage_Handler, - }, - { - MethodName: "SendSyncMessage", - Handler: _Messages_SendSyncMessage_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetMessages", - Handler: _Messages_GetMessages_Handler, - ServerStreams: true, - ClientStreams: true, - }, - }, - Metadata: "org/signal/chat/messages.proto", -} - -const ( - MessagesAnonymous_SendSingleRecipientMessage_FullMethodName = "/org.signal.chat.messages.MessagesAnonymous/SendSingleRecipientMessage" - MessagesAnonymous_SendMultiRecipientMessage_FullMethodName = "/org.signal.chat.messages.MessagesAnonymous/SendMultiRecipientMessage" - MessagesAnonymous_SendStory_FullMethodName = "/org.signal.chat.messages.MessagesAnonymous/SendStory" - MessagesAnonymous_SendMultiRecipientStory_FullMethodName = "/org.signal.chat.messages.MessagesAnonymous/SendMultiRecipientStory" -) - -// MessagesAnonymousClient is the client API for MessagesAnonymous service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for sending "sealed sender" messages. -type MessagesAnonymousClient interface { - // Sends a "sealed sender" message to all devices linked to a single - // destination account. - // - // If this RPC is authorized with an unidentified access key, it will fail - // with an authorization failure if the credential is invalid OR if the - // destination account was not found. If it is authorized using a group send - // token, it will fail with an authorization failure if the credential is - // invalid and with an destination not found error if the account does not - // exist - SendSingleRecipientMessage(ctx context.Context, in *SendSealedSenderMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) - // Sends a "sealed sender" message with a common payload to all devices linked - // to multiple destination accounts. - SendMultiRecipientMessage(ctx context.Context, in *SendMultiRecipientMessageRequest, opts ...grpc.CallOption) (*SendMultiRecipientMessageResponse, error) - // Sends a story message to devices linked to a single destination account. - SendStory(ctx context.Context, in *SendStoryMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) - // Sends a story message with a common payload to devices linked to devices - // linked to multiple destination accounts. - SendMultiRecipientStory(ctx context.Context, in *SendMultiRecipientStoryRequest, opts ...grpc.CallOption) (*SendMultiRecipientMessageResponse, error) -} - -type messagesAnonymousClient struct { - cc grpc.ClientConnInterface -} - -func NewMessagesAnonymousClient(cc grpc.ClientConnInterface) MessagesAnonymousClient { - return &messagesAnonymousClient{cc} -} - -func (c *messagesAnonymousClient) SendSingleRecipientMessage(ctx context.Context, in *SendSealedSenderMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SendMessageResponse) - err := c.cc.Invoke(ctx, MessagesAnonymous_SendSingleRecipientMessage_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *messagesAnonymousClient) SendMultiRecipientMessage(ctx context.Context, in *SendMultiRecipientMessageRequest, opts ...grpc.CallOption) (*SendMultiRecipientMessageResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SendMultiRecipientMessageResponse) - err := c.cc.Invoke(ctx, MessagesAnonymous_SendMultiRecipientMessage_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *messagesAnonymousClient) SendStory(ctx context.Context, in *SendStoryMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SendMessageResponse) - err := c.cc.Invoke(ctx, MessagesAnonymous_SendStory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *messagesAnonymousClient) SendMultiRecipientStory(ctx context.Context, in *SendMultiRecipientStoryRequest, opts ...grpc.CallOption) (*SendMultiRecipientMessageResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SendMultiRecipientMessageResponse) - err := c.cc.Invoke(ctx, MessagesAnonymous_SendMultiRecipientStory_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MessagesAnonymousServer is the server API for MessagesAnonymous service. -// All implementations must embed UnimplementedMessagesAnonymousServer -// for forward compatibility. -// -// Provides methods for sending "sealed sender" messages. -type MessagesAnonymousServer interface { - // Sends a "sealed sender" message to all devices linked to a single - // destination account. - // - // If this RPC is authorized with an unidentified access key, it will fail - // with an authorization failure if the credential is invalid OR if the - // destination account was not found. If it is authorized using a group send - // token, it will fail with an authorization failure if the credential is - // invalid and with an destination not found error if the account does not - // exist - SendSingleRecipientMessage(context.Context, *SendSealedSenderMessageRequest) (*SendMessageResponse, error) - // Sends a "sealed sender" message with a common payload to all devices linked - // to multiple destination accounts. - SendMultiRecipientMessage(context.Context, *SendMultiRecipientMessageRequest) (*SendMultiRecipientMessageResponse, error) - // Sends a story message to devices linked to a single destination account. - SendStory(context.Context, *SendStoryMessageRequest) (*SendMessageResponse, error) - // Sends a story message with a common payload to devices linked to devices - // linked to multiple destination accounts. - SendMultiRecipientStory(context.Context, *SendMultiRecipientStoryRequest) (*SendMultiRecipientMessageResponse, error) - mustEmbedUnimplementedMessagesAnonymousServer() -} - -// UnimplementedMessagesAnonymousServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedMessagesAnonymousServer struct{} - -func (UnimplementedMessagesAnonymousServer) SendSingleRecipientMessage(context.Context, *SendSealedSenderMessageRequest) (*SendMessageResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SendSingleRecipientMessage not implemented") -} -func (UnimplementedMessagesAnonymousServer) SendMultiRecipientMessage(context.Context, *SendMultiRecipientMessageRequest) (*SendMultiRecipientMessageResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SendMultiRecipientMessage not implemented") -} -func (UnimplementedMessagesAnonymousServer) SendStory(context.Context, *SendStoryMessageRequest) (*SendMessageResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SendStory not implemented") -} -func (UnimplementedMessagesAnonymousServer) SendMultiRecipientStory(context.Context, *SendMultiRecipientStoryRequest) (*SendMultiRecipientMessageResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SendMultiRecipientStory not implemented") -} -func (UnimplementedMessagesAnonymousServer) mustEmbedUnimplementedMessagesAnonymousServer() {} -func (UnimplementedMessagesAnonymousServer) testEmbeddedByValue() {} - -// UnsafeMessagesAnonymousServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to MessagesAnonymousServer will -// result in compilation errors. -type UnsafeMessagesAnonymousServer interface { - mustEmbedUnimplementedMessagesAnonymousServer() -} - -func RegisterMessagesAnonymousServer(s grpc.ServiceRegistrar, srv MessagesAnonymousServer) { - // If the following call panics, it indicates UnimplementedMessagesAnonymousServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&MessagesAnonymous_ServiceDesc, srv) -} - -func _MessagesAnonymous_SendSingleRecipientMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendSealedSenderMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MessagesAnonymousServer).SendSingleRecipientMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MessagesAnonymous_SendSingleRecipientMessage_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MessagesAnonymousServer).SendSingleRecipientMessage(ctx, req.(*SendSealedSenderMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MessagesAnonymous_SendMultiRecipientMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendMultiRecipientMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MessagesAnonymousServer).SendMultiRecipientMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MessagesAnonymous_SendMultiRecipientMessage_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MessagesAnonymousServer).SendMultiRecipientMessage(ctx, req.(*SendMultiRecipientMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MessagesAnonymous_SendStory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendStoryMessageRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MessagesAnonymousServer).SendStory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MessagesAnonymous_SendStory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MessagesAnonymousServer).SendStory(ctx, req.(*SendStoryMessageRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _MessagesAnonymous_SendMultiRecipientStory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendMultiRecipientStoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MessagesAnonymousServer).SendMultiRecipientStory(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: MessagesAnonymous_SendMultiRecipientStory_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MessagesAnonymousServer).SendMultiRecipientStory(ctx, req.(*SendMultiRecipientStoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// MessagesAnonymous_ServiceDesc is the grpc.ServiceDesc for MessagesAnonymous service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var MessagesAnonymous_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.messages.MessagesAnonymous", - HandlerType: (*MessagesAnonymousServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SendSingleRecipientMessage", - Handler: _MessagesAnonymous_SendSingleRecipientMessage_Handler, - }, - { - MethodName: "SendMultiRecipientMessage", - Handler: _MessagesAnonymous_SendMultiRecipientMessage_Handler, - }, - { - MethodName: "SendStory", - Handler: _MessagesAnonymous_SendStory_Handler, - }, - { - MethodName: "SendMultiRecipientStory", - Handler: _MessagesAnonymous_SendMultiRecipientStory_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/messages.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/one_time_donations/one_time_donations.pb.go b/pkg/signalmeow/protobuf/rpc/one_time_donations/one_time_donations.pb.go deleted file mode 100644 index 507d508..0000000 --- a/pkg/signalmeow/protobuf/rpc/one_time_donations/one_time_donations.pb.go +++ /dev/null @@ -1,1345 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/one_time_donations.proto - -package one_time_donations - -import ( - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - subscriptions "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/subscriptions" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The amount is below the minimum for the currency. -type AmountBelowMinimumError struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The minimum amount for the currency - Minimum string `protobuf:"bytes,1,opt,name=minimum,proto3" json:"minimum,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AmountBelowMinimumError) Reset() { - *x = AmountBelowMinimumError{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AmountBelowMinimumError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AmountBelowMinimumError) ProtoMessage() {} - -func (x *AmountBelowMinimumError) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[0] - 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 AmountBelowMinimumError.ProtoReflect.Descriptor instead. -func (*AmountBelowMinimumError) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{0} -} - -func (x *AmountBelowMinimumError) GetMinimum() string { - if x != nil { - return x.Minimum - } - return "" -} - -// The SEPA Direct Debit amount exceeds the allowed maximum. -type AmountAboveSepaLimitError struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The maximum amount for a SEPA transaction - Maximum string `protobuf:"bytes,1,opt,name=maximum,proto3" json:"maximum,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AmountAboveSepaLimitError) Reset() { - *x = AmountAboveSepaLimitError{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AmountAboveSepaLimitError) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AmountAboveSepaLimitError) ProtoMessage() {} - -func (x *AmountAboveSepaLimitError) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[1] - 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 AmountAboveSepaLimitError.ProtoReflect.Descriptor instead. -func (*AmountAboveSepaLimitError) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{1} -} - -func (x *AmountAboveSepaLimitError) GetMaximum() string { - if x != nil { - return x.Maximum - } - return "" -} - -type CreateBoostRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // ISO 4217 currency code, case-insensitive (e.g. "usd", "EUR") - Currency string `protobuf:"bytes,1,opt,name=currency,proto3" json:"currency,omitempty"` - // The amount to pay in the [currency's minor unit](https://docs.stripe.com/currencies#minor-units) - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - // The level for the boost payment - Level uint64 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"` - // The payment method - PaymentMethod subscriptions.PaymentMethod `protobuf:"varint,4,opt,name=payment_method,json=paymentMethod,proto3,enum=org.signal.chat.purchase.PaymentMethod" json:"payment_method,omitempty"` - // A donation permit retrieved from Donations.createDonationPermit - DonationPermit []byte `protobuf:"bytes,5,opt,name=donation_permit,json=donationPermit,proto3" json:"donation_permit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateBoostRequest) Reset() { - *x = CreateBoostRequest{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateBoostRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBoostRequest) ProtoMessage() {} - -func (x *CreateBoostRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[2] - 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 CreateBoostRequest.ProtoReflect.Descriptor instead. -func (*CreateBoostRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateBoostRequest) GetCurrency() string { - if x != nil { - return x.Currency - } - return "" -} - -func (x *CreateBoostRequest) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -func (x *CreateBoostRequest) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *CreateBoostRequest) GetPaymentMethod() subscriptions.PaymentMethod { - if x != nil { - return x.PaymentMethod - } - return subscriptions.PaymentMethod(0) -} - -func (x *CreateBoostRequest) GetDonationPermit() []byte { - if x != nil { - return x.DonationPermit - } - return nil -} - -type CreateBoostResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *CreateBoostResponse_ClientSecret - // *CreateBoostResponse_AmountBelowMinimum - // *CreateBoostResponse_AmountAboveSepaLimit - // *CreateBoostResponse_UnsupportedCurrency - // *CreateBoostResponse_UnsupportedLevel - // *CreateBoostResponse_PermitRejected - // *CreateBoostResponse_InvalidAmount - Response isCreateBoostResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateBoostResponse) Reset() { - *x = CreateBoostResponse{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateBoostResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBoostResponse) ProtoMessage() {} - -func (x *CreateBoostResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[3] - 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 CreateBoostResponse.ProtoReflect.Descriptor instead. -func (*CreateBoostResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateBoostResponse) GetResponse() isCreateBoostResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *CreateBoostResponse) GetClientSecret() string { - if x != nil { - if x, ok := x.Response.(*CreateBoostResponse_ClientSecret); ok { - return x.ClientSecret - } - } - return "" -} - -func (x *CreateBoostResponse) GetAmountBelowMinimum() *AmountBelowMinimumError { - if x != nil { - if x, ok := x.Response.(*CreateBoostResponse_AmountBelowMinimum); ok { - return x.AmountBelowMinimum - } - } - return nil -} - -func (x *CreateBoostResponse) GetAmountAboveSepaLimit() *AmountAboveSepaLimitError { - if x != nil { - if x, ok := x.Response.(*CreateBoostResponse_AmountAboveSepaLimit); ok { - return x.AmountAboveSepaLimit - } - } - return nil -} - -func (x *CreateBoostResponse) GetUnsupportedCurrency() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreateBoostResponse_UnsupportedCurrency); ok { - return x.UnsupportedCurrency - } - } - return nil -} - -func (x *CreateBoostResponse) GetUnsupportedLevel() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreateBoostResponse_UnsupportedLevel); ok { - return x.UnsupportedLevel - } - } - return nil -} - -func (x *CreateBoostResponse) GetPermitRejected() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*CreateBoostResponse_PermitRejected); ok { - return x.PermitRejected - } - } - return nil -} - -func (x *CreateBoostResponse) GetInvalidAmount() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreateBoostResponse_InvalidAmount); ok { - return x.InvalidAmount - } - } - return nil -} - -type isCreateBoostResponse_Response interface { - isCreateBoostResponse_Response() -} - -type CreateBoostResponse_ClientSecret struct { - // A client secret that can be used to complete a stripe PaymentIntent - ClientSecret string `protobuf:"bytes,1,opt,name=client_secret,json=clientSecret,proto3,oneof"` -} - -type CreateBoostResponse_AmountBelowMinimum struct { - // The amount is below the minimum for the currency - AmountBelowMinimum *AmountBelowMinimumError `protobuf:"bytes,2,opt,name=amount_below_minimum,json=amountBelowMinimum,proto3,oneof"` -} - -type CreateBoostResponse_AmountAboveSepaLimit struct { - // The amount exceeds the maximum for SEPA Direct Debit - AmountAboveSepaLimit *AmountAboveSepaLimitError `protobuf:"bytes,3,opt,name=amount_above_sepa_limit,json=amountAboveSepaLimit,proto3,oneof"` -} - -type CreateBoostResponse_UnsupportedCurrency struct { - // The requested currency is not supported for the given payment method - UnsupportedCurrency *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=unsupported_currency,json=unsupportedCurrency,proto3,oneof"` -} - -type CreateBoostResponse_UnsupportedLevel struct { - // The requested level is not a valid one-time donation level - UnsupportedLevel *errors.FailedPrecondition `protobuf:"bytes,5,opt,name=unsupported_level,json=unsupportedLevel,proto3,oneof"` -} - -type CreateBoostResponse_PermitRejected struct { - // Donation permit was invalid or already spent - PermitRejected *errors.FailedZkAuthentication `protobuf:"bytes,6,opt,name=permit_rejected,json=permitRejected,proto3,oneof"` -} - -type CreateBoostResponse_InvalidAmount struct { - // The amount in the specified currency is not supported by the payment provider - InvalidAmount *errors.FailedPrecondition `protobuf:"bytes,7,opt,name=invalid_amount,json=invalidAmount,proto3,oneof"` -} - -func (*CreateBoostResponse_ClientSecret) isCreateBoostResponse_Response() {} - -func (*CreateBoostResponse_AmountBelowMinimum) isCreateBoostResponse_Response() {} - -func (*CreateBoostResponse_AmountAboveSepaLimit) isCreateBoostResponse_Response() {} - -func (*CreateBoostResponse_UnsupportedCurrency) isCreateBoostResponse_Response() {} - -func (*CreateBoostResponse_UnsupportedLevel) isCreateBoostResponse_Response() {} - -func (*CreateBoostResponse_PermitRejected) isCreateBoostResponse_Response() {} - -func (*CreateBoostResponse_InvalidAmount) isCreateBoostResponse_Response() {} - -type CreatePayPalBoostRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // ISO 4217 currency code, case-insensitive (e.g. "usd", "EUR") - Currency string `protobuf:"bytes,1,opt,name=currency,proto3" json:"currency,omitempty"` - // Amount in the currency's minor unit (e.g. cents for USD), must be >= 1 - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - // Donation level. - Level uint64 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"` - // URL to redirect the user to after PayPal approval - ReturnUrl string `protobuf:"bytes,4,opt,name=return_url,json=returnUrl,proto3" json:"return_url,omitempty"` - // URL to redirect the user to if they cancel - CancelUrl string `protobuf:"bytes,5,opt,name=cancel_url,json=cancelUrl,proto3" json:"cancel_url,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePayPalBoostRequest) Reset() { - *x = CreatePayPalBoostRequest{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePayPalBoostRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePayPalBoostRequest) ProtoMessage() {} - -func (x *CreatePayPalBoostRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[4] - 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 CreatePayPalBoostRequest.ProtoReflect.Descriptor instead. -func (*CreatePayPalBoostRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{4} -} - -func (x *CreatePayPalBoostRequest) GetCurrency() string { - if x != nil { - return x.Currency - } - return "" -} - -func (x *CreatePayPalBoostRequest) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -func (x *CreatePayPalBoostRequest) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *CreatePayPalBoostRequest) GetReturnUrl() string { - if x != nil { - return x.ReturnUrl - } - return "" -} - -func (x *CreatePayPalBoostRequest) GetCancelUrl() string { - if x != nil { - return x.CancelUrl - } - return "" -} - -type CreatePayPalBoostResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *CreatePayPalBoostResponse_Result - // *CreatePayPalBoostResponse_AmountBelowMinimum - // *CreatePayPalBoostResponse_UnsupportedCurrency - // *CreatePayPalBoostResponse_UnsupportedLevel - Response isCreatePayPalBoostResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePayPalBoostResponse) Reset() { - *x = CreatePayPalBoostResponse{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePayPalBoostResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePayPalBoostResponse) ProtoMessage() {} - -func (x *CreatePayPalBoostResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[5] - 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 CreatePayPalBoostResponse.ProtoReflect.Descriptor instead. -func (*CreatePayPalBoostResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{5} -} - -func (x *CreatePayPalBoostResponse) GetResponse() isCreatePayPalBoostResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *CreatePayPalBoostResponse) GetResult() *CreatePayPalBoostResponse_CreatePayPalBoostResult { - if x != nil { - if x, ok := x.Response.(*CreatePayPalBoostResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *CreatePayPalBoostResponse) GetAmountBelowMinimum() *AmountBelowMinimumError { - if x != nil { - if x, ok := x.Response.(*CreatePayPalBoostResponse_AmountBelowMinimum); ok { - return x.AmountBelowMinimum - } - } - return nil -} - -func (x *CreatePayPalBoostResponse) GetUnsupportedCurrency() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreatePayPalBoostResponse_UnsupportedCurrency); ok { - return x.UnsupportedCurrency - } - } - return nil -} - -func (x *CreatePayPalBoostResponse) GetUnsupportedLevel() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreatePayPalBoostResponse_UnsupportedLevel); ok { - return x.UnsupportedLevel - } - } - return nil -} - -type isCreatePayPalBoostResponse_Response interface { - isCreatePayPalBoostResponse_Response() -} - -type CreatePayPalBoostResponse_Result struct { - Result *CreatePayPalBoostResponse_CreatePayPalBoostResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type CreatePayPalBoostResponse_AmountBelowMinimum struct { - // The amount is below the minimum for the currency - AmountBelowMinimum *AmountBelowMinimumError `protobuf:"bytes,2,opt,name=amount_below_minimum,json=amountBelowMinimum,proto3,oneof"` -} - -type CreatePayPalBoostResponse_UnsupportedCurrency struct { - // The requested currency is not supported for PayPal - UnsupportedCurrency *errors.FailedPrecondition `protobuf:"bytes,3,opt,name=unsupported_currency,json=unsupportedCurrency,proto3,oneof"` -} - -type CreatePayPalBoostResponse_UnsupportedLevel struct { - // The requested level is not a valid one-time donation level - UnsupportedLevel *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=unsupported_level,json=unsupportedLevel,proto3,oneof"` -} - -func (*CreatePayPalBoostResponse_Result) isCreatePayPalBoostResponse_Response() {} - -func (*CreatePayPalBoostResponse_AmountBelowMinimum) isCreatePayPalBoostResponse_Response() {} - -func (*CreatePayPalBoostResponse_UnsupportedCurrency) isCreatePayPalBoostResponse_Response() {} - -func (*CreatePayPalBoostResponse_UnsupportedLevel) isCreatePayPalBoostResponse_Response() {} - -type ConfirmPayPalBoostRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // ISO 4217 currency code, case-insensitive (e.g. "usd", "EUR") - Currency string `protobuf:"bytes,1,opt,name=currency,proto3" json:"currency,omitempty"` - // Amount in the currency's minor unit, must be >= 1 - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - // Donation level. - Level uint64 `protobuf:"varint,3,opt,name=level,proto3" json:"level,omitempty"` - // PayPal payer ID from the approval redirect - PayerId string `protobuf:"bytes,4,opt,name=payer_id,json=payerId,proto3" json:"payer_id,omitempty"` - // PayPal payment ID (PAYID-…) from CreatePayPalBoost - PaymentId string `protobuf:"bytes,5,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"` - // PayPal payment token (EC-…) from the approval redirect - PaymentToken string `protobuf:"bytes,6,opt,name=payment_token,json=paymentToken,proto3" json:"payment_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmPayPalBoostRequest) Reset() { - *x = ConfirmPayPalBoostRequest{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmPayPalBoostRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmPayPalBoostRequest) ProtoMessage() {} - -func (x *ConfirmPayPalBoostRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[6] - 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 ConfirmPayPalBoostRequest.ProtoReflect.Descriptor instead. -func (*ConfirmPayPalBoostRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{6} -} - -func (x *ConfirmPayPalBoostRequest) GetCurrency() string { - if x != nil { - return x.Currency - } - return "" -} - -func (x *ConfirmPayPalBoostRequest) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -func (x *ConfirmPayPalBoostRequest) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *ConfirmPayPalBoostRequest) GetPayerId() string { - if x != nil { - return x.PayerId - } - return "" -} - -func (x *ConfirmPayPalBoostRequest) GetPaymentId() string { - if x != nil { - return x.PaymentId - } - return "" -} - -func (x *ConfirmPayPalBoostRequest) GetPaymentToken() string { - if x != nil { - return x.PaymentToken - } - return "" -} - -type ConfirmPayPalBoostResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *ConfirmPayPalBoostResponse_Result - // *ConfirmPayPalBoostResponse_AmountBelowMinimum - // *ConfirmPayPalBoostResponse_UnsupportedCurrency - // *ConfirmPayPalBoostResponse_UnsupportedLevel - // *ConfirmPayPalBoostResponse_ChargeFailure - Response isConfirmPayPalBoostResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmPayPalBoostResponse) Reset() { - *x = ConfirmPayPalBoostResponse{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmPayPalBoostResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmPayPalBoostResponse) ProtoMessage() {} - -func (x *ConfirmPayPalBoostResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[7] - 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 ConfirmPayPalBoostResponse.ProtoReflect.Descriptor instead. -func (*ConfirmPayPalBoostResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{7} -} - -func (x *ConfirmPayPalBoostResponse) GetResponse() isConfirmPayPalBoostResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *ConfirmPayPalBoostResponse) GetResult() *ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult { - if x != nil { - if x, ok := x.Response.(*ConfirmPayPalBoostResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *ConfirmPayPalBoostResponse) GetAmountBelowMinimum() *AmountBelowMinimumError { - if x != nil { - if x, ok := x.Response.(*ConfirmPayPalBoostResponse_AmountBelowMinimum); ok { - return x.AmountBelowMinimum - } - } - return nil -} - -func (x *ConfirmPayPalBoostResponse) GetUnsupportedCurrency() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ConfirmPayPalBoostResponse_UnsupportedCurrency); ok { - return x.UnsupportedCurrency - } - } - return nil -} - -func (x *ConfirmPayPalBoostResponse) GetUnsupportedLevel() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*ConfirmPayPalBoostResponse_UnsupportedLevel); ok { - return x.UnsupportedLevel - } - } - return nil -} - -func (x *ConfirmPayPalBoostResponse) GetChargeFailure() *subscriptions.ChargeFailure { - if x != nil { - if x, ok := x.Response.(*ConfirmPayPalBoostResponse_ChargeFailure); ok { - return x.ChargeFailure - } - } - return nil -} - -type isConfirmPayPalBoostResponse_Response interface { - isConfirmPayPalBoostResponse_Response() -} - -type ConfirmPayPalBoostResponse_Result struct { - Result *ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type ConfirmPayPalBoostResponse_AmountBelowMinimum struct { - // The amount is below the minimum for the currency - AmountBelowMinimum *AmountBelowMinimumError `protobuf:"bytes,2,opt,name=amount_below_minimum,json=amountBelowMinimum,proto3,oneof"` -} - -type ConfirmPayPalBoostResponse_UnsupportedCurrency struct { - // The requested currency is not supported for PayPal - UnsupportedCurrency *errors.FailedPrecondition `protobuf:"bytes,3,opt,name=unsupported_currency,json=unsupportedCurrency,proto3,oneof"` -} - -type ConfirmPayPalBoostResponse_UnsupportedLevel struct { - // The requested level is not a valid one-time donation level - UnsupportedLevel *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=unsupported_level,json=unsupportedLevel,proto3,oneof"` -} - -type ConfirmPayPalBoostResponse_ChargeFailure struct { - // The payment failed; see charge failure details - ChargeFailure *subscriptions.ChargeFailure `protobuf:"bytes,5,opt,name=charge_failure,json=chargeFailure,proto3,oneof"` -} - -func (*ConfirmPayPalBoostResponse_Result) isConfirmPayPalBoostResponse_Response() {} - -func (*ConfirmPayPalBoostResponse_AmountBelowMinimum) isConfirmPayPalBoostResponse_Response() {} - -func (*ConfirmPayPalBoostResponse_UnsupportedCurrency) isConfirmPayPalBoostResponse_Response() {} - -func (*ConfirmPayPalBoostResponse_UnsupportedLevel) isConfirmPayPalBoostResponse_Response() {} - -func (*ConfirmPayPalBoostResponse_ChargeFailure) isConfirmPayPalBoostResponse_Response() {} - -type CreateBoostReceiptCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // a payment ID from the processor - PaymentIntentId string `protobuf:"bytes,1,opt,name=payment_intent_id,json=paymentIntentId,proto3" json:"payment_intent_id,omitempty"` - // ZK blind-signature receipt credential request bytes - ReceiptCredentialRequest []byte `protobuf:"bytes,2,opt,name=receipt_credential_request,json=receiptCredentialRequest,proto3" json:"receipt_credential_request,omitempty"` - // The processor that handled the payment - Processor subscriptions.PaymentProvider `protobuf:"varint,3,opt,name=processor,proto3,enum=org.signal.chat.purchase.PaymentProvider" json:"processor,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateBoostReceiptCredentialsRequest) Reset() { - *x = CreateBoostReceiptCredentialsRequest{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateBoostReceiptCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBoostReceiptCredentialsRequest) ProtoMessage() {} - -func (x *CreateBoostReceiptCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_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 CreateBoostReceiptCredentialsRequest.ProtoReflect.Descriptor instead. -func (*CreateBoostReceiptCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{8} -} - -func (x *CreateBoostReceiptCredentialsRequest) GetPaymentIntentId() string { - if x != nil { - return x.PaymentIntentId - } - return "" -} - -func (x *CreateBoostReceiptCredentialsRequest) GetReceiptCredentialRequest() []byte { - if x != nil { - return x.ReceiptCredentialRequest - } - return nil -} - -func (x *CreateBoostReceiptCredentialsRequest) GetProcessor() subscriptions.PaymentProvider { - if x != nil { - return x.Processor - } - return subscriptions.PaymentProvider(0) -} - -type CreateBoostReceiptCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *CreateBoostReceiptCredentialsResponse_Result - // *CreateBoostReceiptCredentialsResponse_PaymentStillProcessing - // *CreateBoostReceiptCredentialsResponse_PaymentRequired - // *CreateBoostReceiptCredentialsResponse_PaymentNotFound - // *CreateBoostReceiptCredentialsResponse_ReceiptAlreadyIssued - Response isCreateBoostReceiptCredentialsResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateBoostReceiptCredentialsResponse) Reset() { - *x = CreateBoostReceiptCredentialsResponse{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateBoostReceiptCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBoostReceiptCredentialsResponse) ProtoMessage() {} - -func (x *CreateBoostReceiptCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_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 CreateBoostReceiptCredentialsResponse.ProtoReflect.Descriptor instead. -func (*CreateBoostReceiptCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{9} -} - -func (x *CreateBoostReceiptCredentialsResponse) GetResponse() isCreateBoostReceiptCredentialsResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *CreateBoostReceiptCredentialsResponse) GetResult() *CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult { - if x != nil { - if x, ok := x.Response.(*CreateBoostReceiptCredentialsResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *CreateBoostReceiptCredentialsResponse) GetPaymentStillProcessing() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreateBoostReceiptCredentialsResponse_PaymentStillProcessing); ok { - return x.PaymentStillProcessing - } - } - return nil -} - -func (x *CreateBoostReceiptCredentialsResponse) GetPaymentRequired() *subscriptions.PaymentRequired { - if x != nil { - if x, ok := x.Response.(*CreateBoostReceiptCredentialsResponse_PaymentRequired); ok { - return x.PaymentRequired - } - } - return nil -} - -func (x *CreateBoostReceiptCredentialsResponse) GetPaymentNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*CreateBoostReceiptCredentialsResponse_PaymentNotFound); ok { - return x.PaymentNotFound - } - } - return nil -} - -func (x *CreateBoostReceiptCredentialsResponse) GetReceiptAlreadyIssued() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreateBoostReceiptCredentialsResponse_ReceiptAlreadyIssued); ok { - return x.ReceiptAlreadyIssued - } - } - return nil -} - -type isCreateBoostReceiptCredentialsResponse_Response interface { - isCreateBoostReceiptCredentialsResponse_Response() -} - -type CreateBoostReceiptCredentialsResponse_Result struct { - Result *CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type CreateBoostReceiptCredentialsResponse_PaymentStillProcessing struct { - // Payment is still processing; client should retry - PaymentStillProcessing *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=payment_still_processing,json=paymentStillProcessing,proto3,oneof"` -} - -type CreateBoostReceiptCredentialsResponse_PaymentRequired struct { - // Payment failed - PaymentRequired *subscriptions.PaymentRequired `protobuf:"bytes,3,opt,name=payment_required,json=paymentRequired,proto3,oneof"` -} - -type CreateBoostReceiptCredentialsResponse_PaymentNotFound struct { - // Payment intent not found - PaymentNotFound *errors.NotFound `protobuf:"bytes,4,opt,name=payment_not_found,json=paymentNotFound,proto3,oneof"` -} - -type CreateBoostReceiptCredentialsResponse_ReceiptAlreadyIssued struct { - // A receipt credential was already issued for this payment - ReceiptAlreadyIssued *errors.FailedPrecondition `protobuf:"bytes,5,opt,name=receipt_already_issued,json=receiptAlreadyIssued,proto3,oneof"` -} - -func (*CreateBoostReceiptCredentialsResponse_Result) isCreateBoostReceiptCredentialsResponse_Response() { -} - -func (*CreateBoostReceiptCredentialsResponse_PaymentStillProcessing) isCreateBoostReceiptCredentialsResponse_Response() { -} - -func (*CreateBoostReceiptCredentialsResponse_PaymentRequired) isCreateBoostReceiptCredentialsResponse_Response() { -} - -func (*CreateBoostReceiptCredentialsResponse_PaymentNotFound) isCreateBoostReceiptCredentialsResponse_Response() { -} - -func (*CreateBoostReceiptCredentialsResponse_ReceiptAlreadyIssued) isCreateBoostReceiptCredentialsResponse_Response() { -} - -type CreatePayPalBoostResponse_CreatePayPalBoostResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - ApprovalUrl string `protobuf:"bytes,1,opt,name=approval_url,json=approvalUrl,proto3" json:"approval_url,omitempty"` - PaymentId string `protobuf:"bytes,2,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePayPalBoostResponse_CreatePayPalBoostResult) Reset() { - *x = CreatePayPalBoostResponse_CreatePayPalBoostResult{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePayPalBoostResponse_CreatePayPalBoostResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePayPalBoostResponse_CreatePayPalBoostResult) ProtoMessage() {} - -func (x *CreatePayPalBoostResponse_CreatePayPalBoostResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_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 CreatePayPalBoostResponse_CreatePayPalBoostResult.ProtoReflect.Descriptor instead. -func (*CreatePayPalBoostResponse_CreatePayPalBoostResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *CreatePayPalBoostResponse_CreatePayPalBoostResult) GetApprovalUrl() string { - if x != nil { - return x.ApprovalUrl - } - return "" -} - -func (x *CreatePayPalBoostResponse_CreatePayPalBoostResult) GetPaymentId() string { - if x != nil { - return x.PaymentId - } - return "" -} - -type ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - PaymentId string `protobuf:"bytes,1,opt,name=payment_id,json=paymentId,proto3" json:"payment_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult) Reset() { - *x = ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult) ProtoMessage() {} - -func (x *ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[11] - 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 ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult.ProtoReflect.Descriptor instead. -func (*ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult) GetPaymentId() string { - if x != nil { - return x.PaymentId - } - return "" -} - -type CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - ReceiptCredentialResponse []byte `protobuf:"bytes,1,opt,name=receipt_credential_response,json=receiptCredentialResponse,proto3" json:"receipt_credential_response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult) Reset() { - *x = CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult{} - mi := &file_org_signal_chat_one_time_donations_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult) ProtoMessage() {} - -func (x *CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_one_time_donations_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 CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult.ProtoReflect.Descriptor instead. -func (*CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_one_time_donations_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult) GetReceiptCredentialResponse() []byte { - if x != nil { - return x.ReceiptCredentialResponse - } - return nil -} - -var File_org_signal_chat_one_time_donations_proto protoreflect.FileDescriptor - -const file_org_signal_chat_one_time_donations_proto_rawDesc = "" + - "\n" + - "(org/signal/chat/one_time_donations.proto\x12\x18org.signal.chat.purchase\x1a\x1dorg/signal/chat/require.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x19org/signal/chat/tag.proto\x1a#org/signal/chat/subscriptions.proto\"3\n" + - "\x17AmountBelowMinimumError\x12\x18\n" + - "\aminimum\x18\x01 \x01(\tR\aminimum\"5\n" + - "\x19AmountAboveSepaLimitError\x12\x18\n" + - "\amaximum\x18\x01 \x01(\tR\amaximum\"\xfa\x01\n" + - "\x12CreateBoostRequest\x12!\n" + - "\bcurrency\x18\x01 \x01(\tB\x05\xa2\x97\"\x01\x03R\bcurrency\x12\x1e\n" + - "\x06amount\x18\x02 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\x06amount\x12\x1c\n" + - "\x05level\x18\x03 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\x05level\x12T\n" + - "\x0epayment_method\x18\x04 \x01(\x0e2'.org.signal.chat.purchase.PaymentMethodB\x04\x90\x97\"\x01R\rpaymentMethod\x12-\n" + - "\x0fdonation_permit\x18\x05 \x01(\fB\x04\x88\x97\"\x01R\x0edonationPermit\"\x9b\x06\n" + - "\x13CreateBoostResponse\x12%\n" + - "\rclient_secret\x18\x01 \x01(\tH\x00R\fclientSecret\x12\x7f\n" + - "\x14amount_below_minimum\x18\x02 \x01(\v21.org.signal.chat.purchase.AmountBelowMinimumErrorB\x18\xc2\xd5\"\x14amount_below_minimumH\x00R\x12amountBelowMinimum\x12\x89\x01\n" + - "\x17amount_above_sepa_limit\x18\x03 \x01(\v23.org.signal.chat.purchase.AmountAboveSepaLimitErrorB\x1b\xc2\xd5\"\x17amount_above_sepa_limitH\x00R\x14amountAboveSepaLimit\x12y\n" + - "\x14unsupported_currency\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x18\xc2\xd5\"\x14unsupported_currencyH\x00R\x13unsupportedCurrency\x12p\n" + - "\x11unsupported_level\x18\x05 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x15\xc2\xd5\"\x11unsupported_levelH\x00R\x10unsupportedLevel\x12n\n" + - "\x0fpermit_rejected\x18\x06 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x13\xc2\xd5\"\x0fpermit_rejectedH\x00R\x0epermitRejected\x12g\n" + - "\x0einvalid_amount\x18\a \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x12\xc2\xd5\"\x0einvalid_amountH\x00R\rinvalidAmountB\n" + - "\n" + - "\bresponse\"\xc5\x01\n" + - "\x18CreatePayPalBoostRequest\x12!\n" + - "\bcurrency\x18\x01 \x01(\tB\x05\xa2\x97\"\x01\x03R\bcurrency\x12\x1e\n" + - "\x06amount\x18\x02 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\x06amount\x12\x1c\n" + - "\x05level\x18\x03 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\x05level\x12#\n" + - "\n" + - "return_url\x18\x04 \x01(\tB\x04\x88\x97\"\x01R\treturnUrl\x12#\n" + - "\n" + - "cancel_url\x18\x05 \x01(\tB\x04\x88\x97\"\x01R\tcancelUrl\"\xd9\x04\n" + - "\x19CreatePayPalBoostResponse\x12e\n" + - "\x06result\x18\x01 \x01(\v2K.org.signal.chat.purchase.CreatePayPalBoostResponse.CreatePayPalBoostResultH\x00R\x06result\x12\x7f\n" + - "\x14amount_below_minimum\x18\x02 \x01(\v21.org.signal.chat.purchase.AmountBelowMinimumErrorB\x18\xc2\xd5\"\x14amount_below_minimumH\x00R\x12amountBelowMinimum\x12y\n" + - "\x14unsupported_currency\x18\x03 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x18\xc2\xd5\"\x14unsupported_currencyH\x00R\x13unsupportedCurrency\x12p\n" + - "\x11unsupported_level\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x15\xc2\xd5\"\x11unsupported_levelH\x00R\x10unsupportedLevel\x1a[\n" + - "\x17CreatePayPalBoostResult\x12!\n" + - "\fapproval_url\x18\x01 \x01(\tR\vapprovalUrl\x12\x1d\n" + - "\n" + - "payment_id\x18\x02 \x01(\tR\tpaymentIdB\n" + - "\n" + - "\bresponse\"\xed\x01\n" + - "\x19ConfirmPayPalBoostRequest\x12!\n" + - "\bcurrency\x18\x01 \x01(\tB\x05\xa2\x97\"\x01\x03R\bcurrency\x12\x1e\n" + - "\x06amount\x18\x02 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\x06amount\x12\x1c\n" + - "\x05level\x18\x03 \x01(\x04B\x06\xb2\x97\"\x02\b\x01R\x05level\x12\x1f\n" + - "\bpayer_id\x18\x04 \x01(\tB\x04\x88\x97\"\x01R\apayerId\x12#\n" + - "\n" + - "payment_id\x18\x05 \x01(\tB\x04\x88\x97\"\x01R\tpaymentId\x12)\n" + - "\rpayment_token\x18\x06 \x01(\tB\x04\x88\x97\"\x01R\fpaymentToken\"\xa0\x05\n" + - "\x1aConfirmPayPalBoostResponse\x12g\n" + - "\x06result\x18\x01 \x01(\v2M.org.signal.chat.purchase.ConfirmPayPalBoostResponse.ConfirmPayPalBoostResultH\x00R\x06result\x12\x7f\n" + - "\x14amount_below_minimum\x18\x02 \x01(\v21.org.signal.chat.purchase.AmountBelowMinimumErrorB\x18\xc2\xd5\"\x14amount_below_minimumH\x00R\x12amountBelowMinimum\x12y\n" + - "\x14unsupported_currency\x18\x03 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x18\xc2\xd5\"\x14unsupported_currencyH\x00R\x13unsupportedCurrency\x12p\n" + - "\x11unsupported_level\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x15\xc2\xd5\"\x11unsupported_levelH\x00R\x10unsupportedLevel\x12d\n" + - "\x0echarge_failure\x18\x05 \x01(\v2'.org.signal.chat.purchase.ChargeFailureB\x12\xc2\xd5\"\x0echarge_failureH\x00R\rchargeFailure\x1a9\n" + - "\x18ConfirmPayPalBoostResult\x12\x1d\n" + - "\n" + - "payment_id\x18\x01 \x01(\tR\tpaymentIdB\n" + - "\n" + - "\bresponse\"\xeb\x01\n" + - "$CreateBoostReceiptCredentialsRequest\x120\n" + - "\x11payment_intent_id\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\x0fpaymentIntentId\x12B\n" + - "\x1areceipt_credential_request\x18\x02 \x01(\fB\x04\x88\x97\"\x01R\x18receiptCredentialRequest\x12M\n" + - "\tprocessor\x18\x03 \x01(\x0e2).org.signal.chat.purchase.PaymentProviderB\x04\x90\x97\"\x01R\tprocessor\"\xf5\x05\n" + - "%CreateBoostReceiptCredentialsResponse\x12}\n" + - "\x06result\x18\x01 \x01(\v2c.org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.CreateBoostReceiptCredentialsResultH\x00R\x06result\x12\x84\x01\n" + - "\x18payment_still_processing\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1c\xc2\xd5\"\x18payment_still_processingH\x00R\x16paymentStillProcessing\x12l\n" + - "\x10payment_required\x18\x03 \x01(\v2).org.signal.chat.purchase.PaymentRequiredB\x14\xc2\xd5\"\x10payment_requiredH\x00R\x0fpaymentRequired\x12e\n" + - "\x11payment_not_found\x18\x04 \x01(\v2 .org.signal.chat.errors.NotFoundB\x15\xc2\xd5\"\x11payment_not_foundH\x00R\x0fpaymentNotFound\x12~\n" + - "\x16receipt_already_issued\x18\x05 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1a\xc2\xd5\"\x16receipt_already_issuedH\x00R\x14receiptAlreadyIssued\x1ae\n" + - "#CreateBoostReceiptCredentialsResult\x12>\n" + - "\x1breceipt_credential_response\x18\x01 \x01(\fR\x19receiptCredentialResponseB\n" + - "\n" + - "\bresponse2\xaf\x04\n" + - "\x10OneTimeDonations\x12l\n" + - "\vCreateBoost\x12,.org.signal.chat.purchase.CreateBoostRequest\x1a-.org.signal.chat.purchase.CreateBoostResponse\"\x00\x12~\n" + - "\x11CreatePayPalBoost\x122.org.signal.chat.purchase.CreatePayPalBoostRequest\x1a3.org.signal.chat.purchase.CreatePayPalBoostResponse\"\x00\x12\x81\x01\n" + - "\x12ConfirmPayPalBoost\x123.org.signal.chat.purchase.ConfirmPayPalBoostRequest\x1a4.org.signal.chat.purchase.ConfirmPayPalBoostResponse\"\x00\x12\xa2\x01\n" + - "\x1dCreateBoostReceiptCredentials\x12>.org.signal.chat.purchase.CreateBoostReceiptCredentialsRequest\x1a?.org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_one_time_donations_proto_rawDescOnce sync.Once - file_org_signal_chat_one_time_donations_proto_rawDescData []byte -) - -func file_org_signal_chat_one_time_donations_proto_rawDescGZIP() []byte { - file_org_signal_chat_one_time_donations_proto_rawDescOnce.Do(func() { - file_org_signal_chat_one_time_donations_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_one_time_donations_proto_rawDesc), len(file_org_signal_chat_one_time_donations_proto_rawDesc))) - }) - return file_org_signal_chat_one_time_donations_proto_rawDescData -} - -var file_org_signal_chat_one_time_donations_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_org_signal_chat_one_time_donations_proto_goTypes = []any{ - (*AmountBelowMinimumError)(nil), // 0: org.signal.chat.purchase.AmountBelowMinimumError - (*AmountAboveSepaLimitError)(nil), // 1: org.signal.chat.purchase.AmountAboveSepaLimitError - (*CreateBoostRequest)(nil), // 2: org.signal.chat.purchase.CreateBoostRequest - (*CreateBoostResponse)(nil), // 3: org.signal.chat.purchase.CreateBoostResponse - (*CreatePayPalBoostRequest)(nil), // 4: org.signal.chat.purchase.CreatePayPalBoostRequest - (*CreatePayPalBoostResponse)(nil), // 5: org.signal.chat.purchase.CreatePayPalBoostResponse - (*ConfirmPayPalBoostRequest)(nil), // 6: org.signal.chat.purchase.ConfirmPayPalBoostRequest - (*ConfirmPayPalBoostResponse)(nil), // 7: org.signal.chat.purchase.ConfirmPayPalBoostResponse - (*CreateBoostReceiptCredentialsRequest)(nil), // 8: org.signal.chat.purchase.CreateBoostReceiptCredentialsRequest - (*CreateBoostReceiptCredentialsResponse)(nil), // 9: org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse - (*CreatePayPalBoostResponse_CreatePayPalBoostResult)(nil), // 10: org.signal.chat.purchase.CreatePayPalBoostResponse.CreatePayPalBoostResult - (*ConfirmPayPalBoostResponse_ConfirmPayPalBoostResult)(nil), // 11: org.signal.chat.purchase.ConfirmPayPalBoostResponse.ConfirmPayPalBoostResult - (*CreateBoostReceiptCredentialsResponse_CreateBoostReceiptCredentialsResult)(nil), // 12: org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.CreateBoostReceiptCredentialsResult - (subscriptions.PaymentMethod)(0), // 13: org.signal.chat.purchase.PaymentMethod - (*errors.FailedPrecondition)(nil), // 14: org.signal.chat.errors.FailedPrecondition - (*errors.FailedZkAuthentication)(nil), // 15: org.signal.chat.errors.FailedZkAuthentication - (*subscriptions.ChargeFailure)(nil), // 16: org.signal.chat.purchase.ChargeFailure - (subscriptions.PaymentProvider)(0), // 17: org.signal.chat.purchase.PaymentProvider - (*subscriptions.PaymentRequired)(nil), // 18: org.signal.chat.purchase.PaymentRequired - (*errors.NotFound)(nil), // 19: org.signal.chat.errors.NotFound -} -var file_org_signal_chat_one_time_donations_proto_depIdxs = []int32{ - 13, // 0: org.signal.chat.purchase.CreateBoostRequest.payment_method:type_name -> org.signal.chat.purchase.PaymentMethod - 0, // 1: org.signal.chat.purchase.CreateBoostResponse.amount_below_minimum:type_name -> org.signal.chat.purchase.AmountBelowMinimumError - 1, // 2: org.signal.chat.purchase.CreateBoostResponse.amount_above_sepa_limit:type_name -> org.signal.chat.purchase.AmountAboveSepaLimitError - 14, // 3: org.signal.chat.purchase.CreateBoostResponse.unsupported_currency:type_name -> org.signal.chat.errors.FailedPrecondition - 14, // 4: org.signal.chat.purchase.CreateBoostResponse.unsupported_level:type_name -> org.signal.chat.errors.FailedPrecondition - 15, // 5: org.signal.chat.purchase.CreateBoostResponse.permit_rejected:type_name -> org.signal.chat.errors.FailedZkAuthentication - 14, // 6: org.signal.chat.purchase.CreateBoostResponse.invalid_amount:type_name -> org.signal.chat.errors.FailedPrecondition - 10, // 7: org.signal.chat.purchase.CreatePayPalBoostResponse.result:type_name -> org.signal.chat.purchase.CreatePayPalBoostResponse.CreatePayPalBoostResult - 0, // 8: org.signal.chat.purchase.CreatePayPalBoostResponse.amount_below_minimum:type_name -> org.signal.chat.purchase.AmountBelowMinimumError - 14, // 9: org.signal.chat.purchase.CreatePayPalBoostResponse.unsupported_currency:type_name -> org.signal.chat.errors.FailedPrecondition - 14, // 10: org.signal.chat.purchase.CreatePayPalBoostResponse.unsupported_level:type_name -> org.signal.chat.errors.FailedPrecondition - 11, // 11: org.signal.chat.purchase.ConfirmPayPalBoostResponse.result:type_name -> org.signal.chat.purchase.ConfirmPayPalBoostResponse.ConfirmPayPalBoostResult - 0, // 12: org.signal.chat.purchase.ConfirmPayPalBoostResponse.amount_below_minimum:type_name -> org.signal.chat.purchase.AmountBelowMinimumError - 14, // 13: org.signal.chat.purchase.ConfirmPayPalBoostResponse.unsupported_currency:type_name -> org.signal.chat.errors.FailedPrecondition - 14, // 14: org.signal.chat.purchase.ConfirmPayPalBoostResponse.unsupported_level:type_name -> org.signal.chat.errors.FailedPrecondition - 16, // 15: org.signal.chat.purchase.ConfirmPayPalBoostResponse.charge_failure:type_name -> org.signal.chat.purchase.ChargeFailure - 17, // 16: org.signal.chat.purchase.CreateBoostReceiptCredentialsRequest.processor:type_name -> org.signal.chat.purchase.PaymentProvider - 12, // 17: org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.result:type_name -> org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.CreateBoostReceiptCredentialsResult - 14, // 18: org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.payment_still_processing:type_name -> org.signal.chat.errors.FailedPrecondition - 18, // 19: org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.payment_required:type_name -> org.signal.chat.purchase.PaymentRequired - 19, // 20: org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.payment_not_found:type_name -> org.signal.chat.errors.NotFound - 14, // 21: org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse.receipt_already_issued:type_name -> org.signal.chat.errors.FailedPrecondition - 2, // 22: org.signal.chat.purchase.OneTimeDonations.CreateBoost:input_type -> org.signal.chat.purchase.CreateBoostRequest - 4, // 23: org.signal.chat.purchase.OneTimeDonations.CreatePayPalBoost:input_type -> org.signal.chat.purchase.CreatePayPalBoostRequest - 6, // 24: org.signal.chat.purchase.OneTimeDonations.ConfirmPayPalBoost:input_type -> org.signal.chat.purchase.ConfirmPayPalBoostRequest - 8, // 25: org.signal.chat.purchase.OneTimeDonations.CreateBoostReceiptCredentials:input_type -> org.signal.chat.purchase.CreateBoostReceiptCredentialsRequest - 3, // 26: org.signal.chat.purchase.OneTimeDonations.CreateBoost:output_type -> org.signal.chat.purchase.CreateBoostResponse - 5, // 27: org.signal.chat.purchase.OneTimeDonations.CreatePayPalBoost:output_type -> org.signal.chat.purchase.CreatePayPalBoostResponse - 7, // 28: org.signal.chat.purchase.OneTimeDonations.ConfirmPayPalBoost:output_type -> org.signal.chat.purchase.ConfirmPayPalBoostResponse - 9, // 29: org.signal.chat.purchase.OneTimeDonations.CreateBoostReceiptCredentials:output_type -> org.signal.chat.purchase.CreateBoostReceiptCredentialsResponse - 26, // [26:30] is the sub-list for method output_type - 22, // [22:26] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_one_time_donations_proto_init() } -func file_org_signal_chat_one_time_donations_proto_init() { - if File_org_signal_chat_one_time_donations_proto != nil { - return - } - file_org_signal_chat_one_time_donations_proto_msgTypes[3].OneofWrappers = []any{ - (*CreateBoostResponse_ClientSecret)(nil), - (*CreateBoostResponse_AmountBelowMinimum)(nil), - (*CreateBoostResponse_AmountAboveSepaLimit)(nil), - (*CreateBoostResponse_UnsupportedCurrency)(nil), - (*CreateBoostResponse_UnsupportedLevel)(nil), - (*CreateBoostResponse_PermitRejected)(nil), - (*CreateBoostResponse_InvalidAmount)(nil), - } - file_org_signal_chat_one_time_donations_proto_msgTypes[5].OneofWrappers = []any{ - (*CreatePayPalBoostResponse_Result)(nil), - (*CreatePayPalBoostResponse_AmountBelowMinimum)(nil), - (*CreatePayPalBoostResponse_UnsupportedCurrency)(nil), - (*CreatePayPalBoostResponse_UnsupportedLevel)(nil), - } - file_org_signal_chat_one_time_donations_proto_msgTypes[7].OneofWrappers = []any{ - (*ConfirmPayPalBoostResponse_Result)(nil), - (*ConfirmPayPalBoostResponse_AmountBelowMinimum)(nil), - (*ConfirmPayPalBoostResponse_UnsupportedCurrency)(nil), - (*ConfirmPayPalBoostResponse_UnsupportedLevel)(nil), - (*ConfirmPayPalBoostResponse_ChargeFailure)(nil), - } - file_org_signal_chat_one_time_donations_proto_msgTypes[9].OneofWrappers = []any{ - (*CreateBoostReceiptCredentialsResponse_Result)(nil), - (*CreateBoostReceiptCredentialsResponse_PaymentStillProcessing)(nil), - (*CreateBoostReceiptCredentialsResponse_PaymentRequired)(nil), - (*CreateBoostReceiptCredentialsResponse_PaymentNotFound)(nil), - (*CreateBoostReceiptCredentialsResponse_ReceiptAlreadyIssued)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_one_time_donations_proto_rawDesc), len(file_org_signal_chat_one_time_donations_proto_rawDesc)), - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_one_time_donations_proto_goTypes, - DependencyIndexes: file_org_signal_chat_one_time_donations_proto_depIdxs, - MessageInfos: file_org_signal_chat_one_time_donations_proto_msgTypes, - }.Build() - File_org_signal_chat_one_time_donations_proto = out.File - file_org_signal_chat_one_time_donations_proto_goTypes = nil - file_org_signal_chat_one_time_donations_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/one_time_donations/one_time_donations_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/one_time_donations/one_time_donations_grpc.pb.go deleted file mode 100644 index e80afa8..0000000 --- a/pkg/signalmeow/protobuf/rpc/one_time_donations/one_time_donations_grpc.pb.go +++ /dev/null @@ -1,263 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/one_time_donations.proto - -package one_time_donations - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - OneTimeDonations_CreateBoost_FullMethodName = "/org.signal.chat.purchase.OneTimeDonations/CreateBoost" - OneTimeDonations_CreatePayPalBoost_FullMethodName = "/org.signal.chat.purchase.OneTimeDonations/CreatePayPalBoost" - OneTimeDonations_ConfirmPayPalBoost_FullMethodName = "/org.signal.chat.purchase.OneTimeDonations/ConfirmPayPalBoost" - OneTimeDonations_CreateBoostReceiptCredentials_FullMethodName = "/org.signal.chat.purchase.OneTimeDonations/CreateBoostReceiptCredentials" -) - -// OneTimeDonationsClient is the client API for OneTimeDonations service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Service for making one-time donation payments (boost and gift) -// -// Configuration for one-time donations can be found in ProductConfiguration. -type OneTimeDonationsClient interface { - // Create a Stripe payment intent and return a client secret that can be used to complete the payment. - // Once the payment is complete, the paymentIntentId can be used with CreateBoostReceiptCredentials - CreateBoost(ctx context.Context, in *CreateBoostRequest, opts ...grpc.CallOption) (*CreateBoostResponse, error) - // Create a PayPal one-time payment. - // Once the payment is complete, call ConfirmPayPalBoost with the payment ID and token - CreatePayPalBoost(ctx context.Context, in *CreatePayPalBoostRequest, opts ...grpc.CallOption) (*CreatePayPalBoostResponse, error) - // Confirm a PayPal one-time payment - ConfirmPayPalBoost(ctx context.Context, in *ConfirmPayPalBoostRequest, opts ...grpc.CallOption) (*ConfirmPayPalBoostResponse, error) - // Obtain a ZK receipt credential for a completed one-time donation payment. - // The receipt credential can then be used to redeem the one-time donation entitlement - // via Donations.RedeemReceipt - CreateBoostReceiptCredentials(ctx context.Context, in *CreateBoostReceiptCredentialsRequest, opts ...grpc.CallOption) (*CreateBoostReceiptCredentialsResponse, error) -} - -type oneTimeDonationsClient struct { - cc grpc.ClientConnInterface -} - -func NewOneTimeDonationsClient(cc grpc.ClientConnInterface) OneTimeDonationsClient { - return &oneTimeDonationsClient{cc} -} - -func (c *oneTimeDonationsClient) CreateBoost(ctx context.Context, in *CreateBoostRequest, opts ...grpc.CallOption) (*CreateBoostResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateBoostResponse) - err := c.cc.Invoke(ctx, OneTimeDonations_CreateBoost_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *oneTimeDonationsClient) CreatePayPalBoost(ctx context.Context, in *CreatePayPalBoostRequest, opts ...grpc.CallOption) (*CreatePayPalBoostResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreatePayPalBoostResponse) - err := c.cc.Invoke(ctx, OneTimeDonations_CreatePayPalBoost_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *oneTimeDonationsClient) ConfirmPayPalBoost(ctx context.Context, in *ConfirmPayPalBoostRequest, opts ...grpc.CallOption) (*ConfirmPayPalBoostResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ConfirmPayPalBoostResponse) - err := c.cc.Invoke(ctx, OneTimeDonations_ConfirmPayPalBoost_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *oneTimeDonationsClient) CreateBoostReceiptCredentials(ctx context.Context, in *CreateBoostReceiptCredentialsRequest, opts ...grpc.CallOption) (*CreateBoostReceiptCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateBoostReceiptCredentialsResponse) - err := c.cc.Invoke(ctx, OneTimeDonations_CreateBoostReceiptCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// OneTimeDonationsServer is the server API for OneTimeDonations service. -// All implementations must embed UnimplementedOneTimeDonationsServer -// for forward compatibility. -// -// Service for making one-time donation payments (boost and gift) -// -// Configuration for one-time donations can be found in ProductConfiguration. -type OneTimeDonationsServer interface { - // Create a Stripe payment intent and return a client secret that can be used to complete the payment. - // Once the payment is complete, the paymentIntentId can be used with CreateBoostReceiptCredentials - CreateBoost(context.Context, *CreateBoostRequest) (*CreateBoostResponse, error) - // Create a PayPal one-time payment. - // Once the payment is complete, call ConfirmPayPalBoost with the payment ID and token - CreatePayPalBoost(context.Context, *CreatePayPalBoostRequest) (*CreatePayPalBoostResponse, error) - // Confirm a PayPal one-time payment - ConfirmPayPalBoost(context.Context, *ConfirmPayPalBoostRequest) (*ConfirmPayPalBoostResponse, error) - // Obtain a ZK receipt credential for a completed one-time donation payment. - // The receipt credential can then be used to redeem the one-time donation entitlement - // via Donations.RedeemReceipt - CreateBoostReceiptCredentials(context.Context, *CreateBoostReceiptCredentialsRequest) (*CreateBoostReceiptCredentialsResponse, error) - mustEmbedUnimplementedOneTimeDonationsServer() -} - -// UnimplementedOneTimeDonationsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedOneTimeDonationsServer struct{} - -func (UnimplementedOneTimeDonationsServer) CreateBoost(context.Context, *CreateBoostRequest) (*CreateBoostResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreateBoost not implemented") -} -func (UnimplementedOneTimeDonationsServer) CreatePayPalBoost(context.Context, *CreatePayPalBoostRequest) (*CreatePayPalBoostResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreatePayPalBoost not implemented") -} -func (UnimplementedOneTimeDonationsServer) ConfirmPayPalBoost(context.Context, *ConfirmPayPalBoostRequest) (*ConfirmPayPalBoostResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ConfirmPayPalBoost not implemented") -} -func (UnimplementedOneTimeDonationsServer) CreateBoostReceiptCredentials(context.Context, *CreateBoostReceiptCredentialsRequest) (*CreateBoostReceiptCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreateBoostReceiptCredentials not implemented") -} -func (UnimplementedOneTimeDonationsServer) mustEmbedUnimplementedOneTimeDonationsServer() {} -func (UnimplementedOneTimeDonationsServer) testEmbeddedByValue() {} - -// UnsafeOneTimeDonationsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to OneTimeDonationsServer will -// result in compilation errors. -type UnsafeOneTimeDonationsServer interface { - mustEmbedUnimplementedOneTimeDonationsServer() -} - -func RegisterOneTimeDonationsServer(s grpc.ServiceRegistrar, srv OneTimeDonationsServer) { - // If the following call panics, it indicates UnimplementedOneTimeDonationsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&OneTimeDonations_ServiceDesc, srv) -} - -func _OneTimeDonations_CreateBoost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateBoostRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OneTimeDonationsServer).CreateBoost(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: OneTimeDonations_CreateBoost_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OneTimeDonationsServer).CreateBoost(ctx, req.(*CreateBoostRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _OneTimeDonations_CreatePayPalBoost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreatePayPalBoostRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OneTimeDonationsServer).CreatePayPalBoost(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: OneTimeDonations_CreatePayPalBoost_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OneTimeDonationsServer).CreatePayPalBoost(ctx, req.(*CreatePayPalBoostRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _OneTimeDonations_ConfirmPayPalBoost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfirmPayPalBoostRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OneTimeDonationsServer).ConfirmPayPalBoost(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: OneTimeDonations_ConfirmPayPalBoost_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OneTimeDonationsServer).ConfirmPayPalBoost(ctx, req.(*ConfirmPayPalBoostRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _OneTimeDonations_CreateBoostReceiptCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateBoostReceiptCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OneTimeDonationsServer).CreateBoostReceiptCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: OneTimeDonations_CreateBoostReceiptCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OneTimeDonationsServer).CreateBoostReceiptCredentials(ctx, req.(*CreateBoostReceiptCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// OneTimeDonations_ServiceDesc is the grpc.ServiceDesc for OneTimeDonations service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var OneTimeDonations_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.purchase.OneTimeDonations", - HandlerType: (*OneTimeDonationsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateBoost", - Handler: _OneTimeDonations_CreateBoost_Handler, - }, - { - MethodName: "CreatePayPalBoost", - Handler: _OneTimeDonations_CreatePayPalBoost_Handler, - }, - { - MethodName: "ConfirmPayPalBoost", - Handler: _OneTimeDonations_ConfirmPayPalBoost_Handler, - }, - { - MethodName: "CreateBoostReceiptCredentials", - Handler: _OneTimeDonations_CreateBoostReceiptCredentials_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/one_time_donations.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/payments/payments.pb.go b/pkg/signalmeow/protobuf/rpc/payments/payments.pb.go deleted file mode 100644 index 4daf8a4..0000000 --- a/pkg/signalmeow/protobuf/rpc/payments/payments.pb.go +++ /dev/null @@ -1,242 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/payments.proto - -package payments - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetCurrencyConversionsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCurrencyConversionsRequest) Reset() { - *x = GetCurrencyConversionsRequest{} - mi := &file_org_signal_chat_payments_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCurrencyConversionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrencyConversionsRequest) ProtoMessage() {} - -func (x *GetCurrencyConversionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_payments_proto_msgTypes[0] - 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 GetCurrencyConversionsRequest.ProtoReflect.Descriptor instead. -func (*GetCurrencyConversionsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_payments_proto_rawDescGZIP(), []int{0} -} - -type GetCurrencyConversionsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Currencies []*GetCurrencyConversionsResponse_CurrencyConversionEntity `protobuf:"bytes,2,rep,name=currencies,proto3" json:"currencies,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCurrencyConversionsResponse) Reset() { - *x = GetCurrencyConversionsResponse{} - mi := &file_org_signal_chat_payments_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCurrencyConversionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrencyConversionsResponse) ProtoMessage() {} - -func (x *GetCurrencyConversionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_payments_proto_msgTypes[1] - 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 GetCurrencyConversionsResponse.ProtoReflect.Descriptor instead. -func (*GetCurrencyConversionsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_payments_proto_rawDescGZIP(), []int{1} -} - -func (x *GetCurrencyConversionsResponse) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -func (x *GetCurrencyConversionsResponse) GetCurrencies() []*GetCurrencyConversionsResponse_CurrencyConversionEntity { - if x != nil { - return x.Currencies - } - return nil -} - -type GetCurrencyConversionsResponse_CurrencyConversionEntity struct { - state protoimpl.MessageState `protogen:"open.v1"` - Base string `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` - Conversions map[string]string `protobuf:"bytes,2,rep,name=conversions,proto3" json:"conversions,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCurrencyConversionsResponse_CurrencyConversionEntity) Reset() { - *x = GetCurrencyConversionsResponse_CurrencyConversionEntity{} - mi := &file_org_signal_chat_payments_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCurrencyConversionsResponse_CurrencyConversionEntity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrencyConversionsResponse_CurrencyConversionEntity) ProtoMessage() {} - -func (x *GetCurrencyConversionsResponse_CurrencyConversionEntity) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_payments_proto_msgTypes[2] - 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 GetCurrencyConversionsResponse_CurrencyConversionEntity.ProtoReflect.Descriptor instead. -func (*GetCurrencyConversionsResponse_CurrencyConversionEntity) Descriptor() ([]byte, []int) { - return file_org_signal_chat_payments_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *GetCurrencyConversionsResponse_CurrencyConversionEntity) GetBase() string { - if x != nil { - return x.Base - } - return "" -} - -func (x *GetCurrencyConversionsResponse_CurrencyConversionEntity) GetConversions() map[string]string { - if x != nil { - return x.Conversions - } - return nil -} - -var File_org_signal_chat_payments_proto protoreflect.FileDescriptor - -const file_org_signal_chat_payments_proto_rawDesc = "" + - "\n" + - "\x1eorg/signal/chat/payments.proto\x12\x18org.signal.chat.payments\x1a\x1dorg/signal/chat/require.proto\"\x1f\n" + - "\x1dGetCurrencyConversionsRequest\"\xa9\x03\n" + - "\x1eGetCurrencyConversionsResponse\x12\x1c\n" + - "\ttimestamp\x18\x01 \x01(\x04R\ttimestamp\x12q\n" + - "\n" + - "currencies\x18\x02 \x03(\v2Q.org.signal.chat.payments.GetCurrencyConversionsResponse.CurrencyConversionEntityR\n" + - "currencies\x1a\xf5\x01\n" + - "\x18CurrencyConversionEntity\x12\x12\n" + - "\x04base\x18\x01 \x01(\tR\x04base\x12\x84\x01\n" + - "\vconversions\x18\x02 \x03(\v2b.org.signal.chat.payments.GetCurrencyConversionsResponse.CurrencyConversionEntity.ConversionsEntryR\vconversions\x1a>\n" + - "\x10ConversionsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x012\xa0\x01\n" + - "\bPayments\x12\x8d\x01\n" + - "\x16GetCurrencyConversions\x127.org.signal.chat.payments.GetCurrencyConversionsRequest\x1a8.org.signal.chat.payments.GetCurrencyConversionsResponse\"\x00\x1a\x04\xc8\xd5\"\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_payments_proto_rawDescOnce sync.Once - file_org_signal_chat_payments_proto_rawDescData []byte -) - -func file_org_signal_chat_payments_proto_rawDescGZIP() []byte { - file_org_signal_chat_payments_proto_rawDescOnce.Do(func() { - file_org_signal_chat_payments_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_payments_proto_rawDesc), len(file_org_signal_chat_payments_proto_rawDesc))) - }) - return file_org_signal_chat_payments_proto_rawDescData -} - -var file_org_signal_chat_payments_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_org_signal_chat_payments_proto_goTypes = []any{ - (*GetCurrencyConversionsRequest)(nil), // 0: org.signal.chat.payments.GetCurrencyConversionsRequest - (*GetCurrencyConversionsResponse)(nil), // 1: org.signal.chat.payments.GetCurrencyConversionsResponse - (*GetCurrencyConversionsResponse_CurrencyConversionEntity)(nil), // 2: org.signal.chat.payments.GetCurrencyConversionsResponse.CurrencyConversionEntity - nil, // 3: org.signal.chat.payments.GetCurrencyConversionsResponse.CurrencyConversionEntity.ConversionsEntry -} -var file_org_signal_chat_payments_proto_depIdxs = []int32{ - 2, // 0: org.signal.chat.payments.GetCurrencyConversionsResponse.currencies:type_name -> org.signal.chat.payments.GetCurrencyConversionsResponse.CurrencyConversionEntity - 3, // 1: org.signal.chat.payments.GetCurrencyConversionsResponse.CurrencyConversionEntity.conversions:type_name -> org.signal.chat.payments.GetCurrencyConversionsResponse.CurrencyConversionEntity.ConversionsEntry - 0, // 2: org.signal.chat.payments.Payments.GetCurrencyConversions:input_type -> org.signal.chat.payments.GetCurrencyConversionsRequest - 1, // 3: org.signal.chat.payments.Payments.GetCurrencyConversions:output_type -> org.signal.chat.payments.GetCurrencyConversionsResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_payments_proto_init() } -func file_org_signal_chat_payments_proto_init() { - if File_org_signal_chat_payments_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_payments_proto_rawDesc), len(file_org_signal_chat_payments_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_payments_proto_goTypes, - DependencyIndexes: file_org_signal_chat_payments_proto_depIdxs, - MessageInfos: file_org_signal_chat_payments_proto_msgTypes, - }.Build() - File_org_signal_chat_payments_proto = out.File - file_org_signal_chat_payments_proto_goTypes = nil - file_org_signal_chat_payments_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/payments/payments_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/payments/payments_grpc.pb.go deleted file mode 100644 index 7f79a03..0000000 --- a/pkg/signalmeow/protobuf/rpc/payments/payments_grpc.pb.go +++ /dev/null @@ -1,129 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/payments.proto - -package payments - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Payments_GetCurrencyConversions_FullMethodName = "/org.signal.chat.payments.Payments/GetCurrencyConversions" -) - -// PaymentsClient is the client API for Payments service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with payments. -type PaymentsClient interface { - GetCurrencyConversions(ctx context.Context, in *GetCurrencyConversionsRequest, opts ...grpc.CallOption) (*GetCurrencyConversionsResponse, error) -} - -type paymentsClient struct { - cc grpc.ClientConnInterface -} - -func NewPaymentsClient(cc grpc.ClientConnInterface) PaymentsClient { - return &paymentsClient{cc} -} - -func (c *paymentsClient) GetCurrencyConversions(ctx context.Context, in *GetCurrencyConversionsRequest, opts ...grpc.CallOption) (*GetCurrencyConversionsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetCurrencyConversionsResponse) - err := c.cc.Invoke(ctx, Payments_GetCurrencyConversions_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// PaymentsServer is the server API for Payments service. -// All implementations must embed UnimplementedPaymentsServer -// for forward compatibility. -// -// Provides methods for working with payments. -type PaymentsServer interface { - GetCurrencyConversions(context.Context, *GetCurrencyConversionsRequest) (*GetCurrencyConversionsResponse, error) - mustEmbedUnimplementedPaymentsServer() -} - -// UnimplementedPaymentsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedPaymentsServer struct{} - -func (UnimplementedPaymentsServer) GetCurrencyConversions(context.Context, *GetCurrencyConversionsRequest) (*GetCurrencyConversionsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetCurrencyConversions not implemented") -} -func (UnimplementedPaymentsServer) mustEmbedUnimplementedPaymentsServer() {} -func (UnimplementedPaymentsServer) testEmbeddedByValue() {} - -// UnsafePaymentsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to PaymentsServer will -// result in compilation errors. -type UnsafePaymentsServer interface { - mustEmbedUnimplementedPaymentsServer() -} - -func RegisterPaymentsServer(s grpc.ServiceRegistrar, srv PaymentsServer) { - // If the following call panics, it indicates UnimplementedPaymentsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Payments_ServiceDesc, srv) -} - -func _Payments_GetCurrencyConversions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCurrencyConversionsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PaymentsServer).GetCurrencyConversions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Payments_GetCurrencyConversions_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PaymentsServer).GetCurrencyConversions(ctx, req.(*GetCurrencyConversionsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Payments_ServiceDesc is the grpc.ServiceDesc for Payments service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Payments_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.payments.Payments", - HandlerType: (*PaymentsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetCurrencyConversions", - Handler: _Payments_GetCurrencyConversions_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/payments.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/product_configuration/product_configuration.pb.go b/pkg/signalmeow/protobuf/rpc/product_configuration/product_configuration.pb.go deleted file mode 100644 index bd1b669..0000000 --- a/pkg/signalmeow/protobuf/rpc/product_configuration/product_configuration.pb.go +++ /dev/null @@ -1,648 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/product_configuration.proto - -package product_configuration - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - subscriptions "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/subscriptions" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetConfigurationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetConfigurationRequest) Reset() { - *x = GetConfigurationRequest{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetConfigurationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetConfigurationRequest) ProtoMessage() {} - -func (x *GetConfigurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[0] - 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 GetConfigurationRequest.ProtoReflect.Descriptor instead. -func (*GetConfigurationRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{0} -} - -type GetConfigurationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Map of lower-cased ISO 3 currency codes to currency-specific configuration - Currencies map[string]*CurrencyConfiguration `protobuf:"bytes,1,rep,name=currencies,proto3" json:"currencies,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Map of numeric donation level IDs to level-specific badge configuration - BadgeLevels map[uint64]*LevelConfiguration `protobuf:"bytes,2,rep,name=badge_levels,json=badgeLevels,proto3" json:"badge_levels,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Configuration for backup subscription options - Backup *BackupConfiguration `protobuf:"bytes,3,opt,name=backup,proto3" json:"backup,omitempty"` - // Maximum value of a one-time SEPA donation - SepaMaximumEuros string `protobuf:"bytes,4,opt,name=sepa_maximum_euros,json=sepaMaximumEuros,proto3" json:"sepa_maximum_euros,omitempty"` - // Configuration for one-time Signal Login purchases - Login *LoginConfiguration `protobuf:"bytes,5,opt,name=login,proto3" json:"login,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetConfigurationResponse) Reset() { - *x = GetConfigurationResponse{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetConfigurationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetConfigurationResponse) ProtoMessage() {} - -func (x *GetConfigurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[1] - 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 GetConfigurationResponse.ProtoReflect.Descriptor instead. -func (*GetConfigurationResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{1} -} - -func (x *GetConfigurationResponse) GetCurrencies() map[string]*CurrencyConfiguration { - if x != nil { - return x.Currencies - } - return nil -} - -func (x *GetConfigurationResponse) GetBadgeLevels() map[uint64]*LevelConfiguration { - if x != nil { - return x.BadgeLevels - } - return nil -} - -func (x *GetConfigurationResponse) GetBackup() *BackupConfiguration { - if x != nil { - return x.Backup - } - return nil -} - -func (x *GetConfigurationResponse) GetSepaMaximumEuros() string { - if x != nil { - return x.SepaMaximumEuros - } - return "" -} - -func (x *GetConfigurationResponse) GetLogin() *LoginConfiguration { - if x != nil { - return x.Login - } - return nil -} - -type AmountList struct { - state protoimpl.MessageState `protogen:"open.v1"` - // NOTE: this is a string instead of a numeric type because it is intended - // for display purposes only - Amounts []string `protobuf:"bytes,1,rep,name=amounts,proto3" json:"amounts,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AmountList) Reset() { - *x = AmountList{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AmountList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AmountList) ProtoMessage() {} - -func (x *AmountList) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[2] - 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 AmountList.ProtoReflect.Descriptor instead. -func (*AmountList) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{2} -} - -func (x *AmountList) GetAmounts() []string { - if x != nil { - return x.Amounts - } - return nil -} - -type CurrencyConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Minimum one-time donation - // NOTE: this is a string instead of a numeric type because it is intended - // for display purposes only - Minimum string `protobuf:"bytes,1,opt,name=minimum,proto3" json:"minimum,omitempty"` - // Map of one-time donation level IDs to suggested amounts - OneTime map[uint64]*AmountList `protobuf:"bytes,2,rep,name=one_time,json=oneTime,proto3" json:"one_time,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Map of subscription level IDs to the amount charged - Subscription map[uint64]string `protobuf:"bytes,3,rep,name=subscription,proto3" json:"subscription,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // Map of backup subscription level IDs to the amount charged - BackupSubscription map[uint64]string `protobuf:"bytes,4,rep,name=backup_subscription,json=backupSubscription,proto3" json:"backup_subscription,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - SupportedPaymentMethods []subscriptions.PaymentMethod `protobuf:"varint,5,rep,packed,name=supported_payment_methods,json=supportedPaymentMethods,proto3,enum=org.signal.chat.purchase.PaymentMethod" json:"supported_payment_methods,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CurrencyConfiguration) Reset() { - *x = CurrencyConfiguration{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CurrencyConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CurrencyConfiguration) ProtoMessage() {} - -func (x *CurrencyConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[3] - 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 CurrencyConfiguration.ProtoReflect.Descriptor instead. -func (*CurrencyConfiguration) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{3} -} - -func (x *CurrencyConfiguration) GetMinimum() string { - if x != nil { - return x.Minimum - } - return "" -} - -func (x *CurrencyConfiguration) GetOneTime() map[uint64]*AmountList { - if x != nil { - return x.OneTime - } - return nil -} - -func (x *CurrencyConfiguration) GetSubscription() map[uint64]string { - if x != nil { - return x.Subscription - } - return nil -} - -func (x *CurrencyConfiguration) GetBackupSubscription() map[uint64]string { - if x != nil { - return x.BackupSubscription - } - return nil -} - -func (x *CurrencyConfiguration) GetSupportedPaymentMethods() []subscriptions.PaymentMethod { - if x != nil { - return x.SupportedPaymentMethods - } - return nil -} - -type LevelConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The ID of the badge awarded at this level. Resolve to full badge details - // via RemoteConfiguration.GetBadges. - BadgeId string `protobuf:"bytes,1,opt,name=badge_id,json=badgeId,proto3" json:"badge_id,omitempty"` - // The duration for which a badge is valid. Present only for - // one-time (boost, gift) badges - BadgeDurationSeconds *uint64 `protobuf:"varint,2,opt,name=badge_duration_seconds,json=badgeDurationSeconds,proto3,oneof" json:"badge_duration_seconds,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LevelConfiguration) Reset() { - *x = LevelConfiguration{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LevelConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LevelConfiguration) ProtoMessage() {} - -func (x *LevelConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[4] - 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 LevelConfiguration.ProtoReflect.Descriptor instead. -func (*LevelConfiguration) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{4} -} - -func (x *LevelConfiguration) GetBadgeId() string { - if x != nil { - return x.BadgeId - } - return "" -} - -func (x *LevelConfiguration) GetBadgeDurationSeconds() uint64 { - if x != nil && x.BadgeDurationSeconds != nil { - return *x.BadgeDurationSeconds - } - return 0 -} - -// Configuration for a backup level - use to present appropriate client interfaces -type BackupLevelConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The amount of media storage in bytes that a paying subscriber may store - StorageAllowanceBytes uint64 `protobuf:"varint,1,opt,name=storage_allowance_bytes,json=storageAllowanceBytes,proto3" json:"storage_allowance_bytes,omitempty"` - // The play billing productID associated with this backup level - PlayProductId string `protobuf:"bytes,2,opt,name=play_product_id,json=playProductId,proto3" json:"play_product_id,omitempty"` - // The duration, in days, for which your backed up media is retained on the server after you stop refreshing with a paid credential - MediaTtlDays uint64 `protobuf:"varint,3,opt,name=media_ttl_days,json=mediaTtlDays,proto3" json:"media_ttl_days,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupLevelConfiguration) Reset() { - *x = BackupLevelConfiguration{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupLevelConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupLevelConfiguration) ProtoMessage() {} - -func (x *BackupLevelConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[5] - 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 BackupLevelConfiguration.ProtoReflect.Descriptor instead. -func (*BackupLevelConfiguration) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{5} -} - -func (x *BackupLevelConfiguration) GetStorageAllowanceBytes() uint64 { - if x != nil { - return x.StorageAllowanceBytes - } - return 0 -} - -func (x *BackupLevelConfiguration) GetPlayProductId() string { - if x != nil { - return x.PlayProductId - } - return "" -} - -func (x *BackupLevelConfiguration) GetMediaTtlDays() uint64 { - if x != nil { - return x.MediaTtlDays - } - return 0 -} - -type BackupConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A map of numeric backup level IDs to level-specific backup configuration - Levels map[uint64]*BackupLevelConfiguration `protobuf:"bytes,1,rep,name=levels,proto3" json:"levels,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - // The number of days of media a free tier backup user gets - FreeTierMediaDays uint64 `protobuf:"varint,2,opt,name=free_tier_media_days,json=freeTierMediaDays,proto3" json:"free_tier_media_days,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BackupConfiguration) Reset() { - *x = BackupConfiguration{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BackupConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BackupConfiguration) ProtoMessage() {} - -func (x *BackupConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[6] - 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 BackupConfiguration.ProtoReflect.Descriptor instead. -func (*BackupConfiguration) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{6} -} - -func (x *BackupConfiguration) GetLevels() map[uint64]*BackupLevelConfiguration { - if x != nil { - return x.Levels - } - return nil -} - -func (x *BackupConfiguration) GetFreeTierMediaDays() uint64 { - if x != nil { - return x.FreeTierMediaDays - } - return 0 -} - -// Configuration for one-time Signal Login purchases -type LoginConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The receipt level associated with a Signal Login purchase - Level uint64 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` - // The play billing productID associated with a Signal Login purchase - PlayProductId string `protobuf:"bytes,2,opt,name=play_product_id,json=playProductId,proto3" json:"play_product_id,omitempty"` - // The App Store productID associated with a Signal Login purchase - AppStoreProductId string `protobuf:"bytes,3,opt,name=app_store_product_id,json=appStoreProductId,proto3" json:"app_store_product_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LoginConfiguration) Reset() { - *x = LoginConfiguration{} - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LoginConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginConfiguration) ProtoMessage() {} - -func (x *LoginConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_product_configuration_proto_msgTypes[7] - 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 LoginConfiguration.ProtoReflect.Descriptor instead. -func (*LoginConfiguration) Descriptor() ([]byte, []int) { - return file_org_signal_chat_product_configuration_proto_rawDescGZIP(), []int{7} -} - -func (x *LoginConfiguration) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *LoginConfiguration) GetPlayProductId() string { - if x != nil { - return x.PlayProductId - } - return "" -} - -func (x *LoginConfiguration) GetAppStoreProductId() string { - if x != nil { - return x.AppStoreProductId - } - return "" -} - -var File_org_signal_chat_product_configuration_proto protoreflect.FileDescriptor - -const file_org_signal_chat_product_configuration_proto_rawDesc = "" + - "\n" + - "+org/signal/chat/product_configuration.proto\x12\x18org.signal.chat.purchase\x1a\x1dorg/signal/chat/require.proto\x1a#org/signal/chat/subscriptions.proto\"\x19\n" + - "\x17GetConfigurationRequest\"\xfd\x04\n" + - "\x18GetConfigurationResponse\x12b\n" + - "\n" + - "currencies\x18\x01 \x03(\v2B.org.signal.chat.purchase.GetConfigurationResponse.CurrenciesEntryR\n" + - "currencies\x12f\n" + - "\fbadge_levels\x18\x02 \x03(\v2C.org.signal.chat.purchase.GetConfigurationResponse.BadgeLevelsEntryR\vbadgeLevels\x12E\n" + - "\x06backup\x18\x03 \x01(\v2-.org.signal.chat.purchase.BackupConfigurationR\x06backup\x12,\n" + - "\x12sepa_maximum_euros\x18\x04 \x01(\tR\x10sepaMaximumEuros\x12B\n" + - "\x05login\x18\x05 \x01(\v2,.org.signal.chat.purchase.LoginConfigurationR\x05login\x1an\n" + - "\x0fCurrenciesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12E\n" + - "\x05value\x18\x02 \x01(\v2/.org.signal.chat.purchase.CurrencyConfigurationR\x05value:\x028\x01\x1al\n" + - "\x10BadgeLevelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12B\n" + - "\x05value\x18\x02 \x01(\v2,.org.signal.chat.purchase.LevelConfigurationR\x05value:\x028\x01\"&\n" + - "\n" + - "AmountList\x12\x18\n" + - "\aamounts\x18\x01 \x03(\tR\aamounts\"\xba\x05\n" + - "\x15CurrencyConfiguration\x12\x18\n" + - "\aminimum\x18\x01 \x01(\tR\aminimum\x12W\n" + - "\bone_time\x18\x02 \x03(\v2<.org.signal.chat.purchase.CurrencyConfiguration.OneTimeEntryR\aoneTime\x12e\n" + - "\fsubscription\x18\x03 \x03(\v2A.org.signal.chat.purchase.CurrencyConfiguration.SubscriptionEntryR\fsubscription\x12x\n" + - "\x13backup_subscription\x18\x04 \x03(\v2G.org.signal.chat.purchase.CurrencyConfiguration.BackupSubscriptionEntryR\x12backupSubscription\x12c\n" + - "\x19supported_payment_methods\x18\x05 \x03(\x0e2'.org.signal.chat.purchase.PaymentMethodR\x17supportedPaymentMethods\x1a`\n" + - "\fOneTimeEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12:\n" + - "\x05value\x18\x02 \x01(\v2$.org.signal.chat.purchase.AmountListR\x05value:\x028\x01\x1a?\n" + - "\x11SubscriptionEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\x1aE\n" + - "\x17BackupSubscriptionEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x85\x01\n" + - "\x12LevelConfiguration\x12\x19\n" + - "\bbadge_id\x18\x01 \x01(\tR\abadgeId\x129\n" + - "\x16badge_duration_seconds\x18\x02 \x01(\x04H\x00R\x14badgeDurationSeconds\x88\x01\x01B\x19\n" + - "\x17_badge_duration_seconds\"\xa0\x01\n" + - "\x18BackupLevelConfiguration\x126\n" + - "\x17storage_allowance_bytes\x18\x01 \x01(\x04R\x15storageAllowanceBytes\x12&\n" + - "\x0fplay_product_id\x18\x02 \x01(\tR\rplayProductId\x12$\n" + - "\x0emedia_ttl_days\x18\x03 \x01(\x04R\fmediaTtlDays\"\x88\x02\n" + - "\x13BackupConfiguration\x12Q\n" + - "\x06levels\x18\x01 \x03(\v29.org.signal.chat.purchase.BackupConfiguration.LevelsEntryR\x06levels\x12/\n" + - "\x14free_tier_media_days\x18\x02 \x01(\x04R\x11freeTierMediaDays\x1am\n" + - "\vLevelsEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\x04R\x03key\x12H\n" + - "\x05value\x18\x02 \x01(\v22.org.signal.chat.purchase.BackupLevelConfigurationR\x05value:\x028\x01\"\x83\x01\n" + - "\x12LoginConfiguration\x12\x14\n" + - "\x05level\x18\x01 \x01(\x04R\x05level\x12&\n" + - "\x0fplay_product_id\x18\x02 \x01(\tR\rplayProductId\x12/\n" + - "\x14app_store_product_id\x18\x03 \x01(\tR\x11appStoreProductId2\x99\x01\n" + - "\x14ProductConfiguration\x12{\n" + - "\x10GetConfiguration\x121.org.signal.chat.purchase.GetConfigurationRequest\x1a2.org.signal.chat.purchase.GetConfigurationResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_product_configuration_proto_rawDescOnce sync.Once - file_org_signal_chat_product_configuration_proto_rawDescData []byte -) - -func file_org_signal_chat_product_configuration_proto_rawDescGZIP() []byte { - file_org_signal_chat_product_configuration_proto_rawDescOnce.Do(func() { - file_org_signal_chat_product_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_product_configuration_proto_rawDesc), len(file_org_signal_chat_product_configuration_proto_rawDesc))) - }) - return file_org_signal_chat_product_configuration_proto_rawDescData -} - -var file_org_signal_chat_product_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_org_signal_chat_product_configuration_proto_goTypes = []any{ - (*GetConfigurationRequest)(nil), // 0: org.signal.chat.purchase.GetConfigurationRequest - (*GetConfigurationResponse)(nil), // 1: org.signal.chat.purchase.GetConfigurationResponse - (*AmountList)(nil), // 2: org.signal.chat.purchase.AmountList - (*CurrencyConfiguration)(nil), // 3: org.signal.chat.purchase.CurrencyConfiguration - (*LevelConfiguration)(nil), // 4: org.signal.chat.purchase.LevelConfiguration - (*BackupLevelConfiguration)(nil), // 5: org.signal.chat.purchase.BackupLevelConfiguration - (*BackupConfiguration)(nil), // 6: org.signal.chat.purchase.BackupConfiguration - (*LoginConfiguration)(nil), // 7: org.signal.chat.purchase.LoginConfiguration - nil, // 8: org.signal.chat.purchase.GetConfigurationResponse.CurrenciesEntry - nil, // 9: org.signal.chat.purchase.GetConfigurationResponse.BadgeLevelsEntry - nil, // 10: org.signal.chat.purchase.CurrencyConfiguration.OneTimeEntry - nil, // 11: org.signal.chat.purchase.CurrencyConfiguration.SubscriptionEntry - nil, // 12: org.signal.chat.purchase.CurrencyConfiguration.BackupSubscriptionEntry - nil, // 13: org.signal.chat.purchase.BackupConfiguration.LevelsEntry - (subscriptions.PaymentMethod)(0), // 14: org.signal.chat.purchase.PaymentMethod -} -var file_org_signal_chat_product_configuration_proto_depIdxs = []int32{ - 8, // 0: org.signal.chat.purchase.GetConfigurationResponse.currencies:type_name -> org.signal.chat.purchase.GetConfigurationResponse.CurrenciesEntry - 9, // 1: org.signal.chat.purchase.GetConfigurationResponse.badge_levels:type_name -> org.signal.chat.purchase.GetConfigurationResponse.BadgeLevelsEntry - 6, // 2: org.signal.chat.purchase.GetConfigurationResponse.backup:type_name -> org.signal.chat.purchase.BackupConfiguration - 7, // 3: org.signal.chat.purchase.GetConfigurationResponse.login:type_name -> org.signal.chat.purchase.LoginConfiguration - 10, // 4: org.signal.chat.purchase.CurrencyConfiguration.one_time:type_name -> org.signal.chat.purchase.CurrencyConfiguration.OneTimeEntry - 11, // 5: org.signal.chat.purchase.CurrencyConfiguration.subscription:type_name -> org.signal.chat.purchase.CurrencyConfiguration.SubscriptionEntry - 12, // 6: org.signal.chat.purchase.CurrencyConfiguration.backup_subscription:type_name -> org.signal.chat.purchase.CurrencyConfiguration.BackupSubscriptionEntry - 14, // 7: org.signal.chat.purchase.CurrencyConfiguration.supported_payment_methods:type_name -> org.signal.chat.purchase.PaymentMethod - 13, // 8: org.signal.chat.purchase.BackupConfiguration.levels:type_name -> org.signal.chat.purchase.BackupConfiguration.LevelsEntry - 3, // 9: org.signal.chat.purchase.GetConfigurationResponse.CurrenciesEntry.value:type_name -> org.signal.chat.purchase.CurrencyConfiguration - 4, // 10: org.signal.chat.purchase.GetConfigurationResponse.BadgeLevelsEntry.value:type_name -> org.signal.chat.purchase.LevelConfiguration - 2, // 11: org.signal.chat.purchase.CurrencyConfiguration.OneTimeEntry.value:type_name -> org.signal.chat.purchase.AmountList - 5, // 12: org.signal.chat.purchase.BackupConfiguration.LevelsEntry.value:type_name -> org.signal.chat.purchase.BackupLevelConfiguration - 0, // 13: org.signal.chat.purchase.ProductConfiguration.GetConfiguration:input_type -> org.signal.chat.purchase.GetConfigurationRequest - 1, // 14: org.signal.chat.purchase.ProductConfiguration.GetConfiguration:output_type -> org.signal.chat.purchase.GetConfigurationResponse - 14, // [14:15] is the sub-list for method output_type - 13, // [13:14] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_product_configuration_proto_init() } -func file_org_signal_chat_product_configuration_proto_init() { - if File_org_signal_chat_product_configuration_proto != nil { - return - } - file_org_signal_chat_product_configuration_proto_msgTypes[4].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_product_configuration_proto_rawDesc), len(file_org_signal_chat_product_configuration_proto_rawDesc)), - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_product_configuration_proto_goTypes, - DependencyIndexes: file_org_signal_chat_product_configuration_proto_depIdxs, - MessageInfos: file_org_signal_chat_product_configuration_proto_msgTypes, - }.Build() - File_org_signal_chat_product_configuration_proto = out.File - file_org_signal_chat_product_configuration_proto_goTypes = nil - file_org_signal_chat_product_configuration_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/product_configuration/product_configuration_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/product_configuration/product_configuration_grpc.pb.go deleted file mode 100644 index 0802e59..0000000 --- a/pkg/signalmeow/protobuf/rpc/product_configuration/product_configuration_grpc.pb.go +++ /dev/null @@ -1,135 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/product_configuration.proto - -package product_configuration - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - ProductConfiguration_GetConfiguration_FullMethodName = "/org.signal.chat.purchase.ProductConfiguration/GetConfiguration" -) - -// ProductConfigurationClient is the client API for ProductConfiguration service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Retrieve product metadata for one-time donations, subscriptions, and backups -type ProductConfigurationClient interface { - // Returns configuration for donation subscriptions, backup subscriptions, and one-time donation ( - // "boost" and "gift") minimum and suggested amounts. Badges are referenced by ID only; resolve those - // IDs to full badge details via RemoteConfiguration.GetBadges. - GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) -} - -type productConfigurationClient struct { - cc grpc.ClientConnInterface -} - -func NewProductConfigurationClient(cc grpc.ClientConnInterface) ProductConfigurationClient { - return &productConfigurationClient{cc} -} - -func (c *productConfigurationClient) GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetConfigurationResponse) - err := c.cc.Invoke(ctx, ProductConfiguration_GetConfiguration_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ProductConfigurationServer is the server API for ProductConfiguration service. -// All implementations must embed UnimplementedProductConfigurationServer -// for forward compatibility. -// -// Retrieve product metadata for one-time donations, subscriptions, and backups -type ProductConfigurationServer interface { - // Returns configuration for donation subscriptions, backup subscriptions, and one-time donation ( - // "boost" and "gift") minimum and suggested amounts. Badges are referenced by ID only; resolve those - // IDs to full badge details via RemoteConfiguration.GetBadges. - GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) - mustEmbedUnimplementedProductConfigurationServer() -} - -// UnimplementedProductConfigurationServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedProductConfigurationServer struct{} - -func (UnimplementedProductConfigurationServer) GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetConfiguration not implemented") -} -func (UnimplementedProductConfigurationServer) mustEmbedUnimplementedProductConfigurationServer() {} -func (UnimplementedProductConfigurationServer) testEmbeddedByValue() {} - -// UnsafeProductConfigurationServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ProductConfigurationServer will -// result in compilation errors. -type UnsafeProductConfigurationServer interface { - mustEmbedUnimplementedProductConfigurationServer() -} - -func RegisterProductConfigurationServer(s grpc.ServiceRegistrar, srv ProductConfigurationServer) { - // If the following call panics, it indicates UnimplementedProductConfigurationServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ProductConfiguration_ServiceDesc, srv) -} - -func _ProductConfiguration_GetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProductConfigurationServer).GetConfiguration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ProductConfiguration_GetConfiguration_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProductConfigurationServer).GetConfiguration(ctx, req.(*GetConfigurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ProductConfiguration_ServiceDesc is the grpc.ServiceDesc for ProductConfiguration service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ProductConfiguration_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.purchase.ProductConfiguration", - HandlerType: (*ProductConfigurationServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetConfiguration", - Handler: _ProductConfiguration_GetConfiguration_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/product_configuration.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/profile/profile.pb.go b/pkg/signalmeow/protobuf/rpc/profile/profile.pb.go deleted file mode 100644 index 2c27314..0000000 --- a/pkg/signalmeow/protobuf/rpc/profile/profile.pb.go +++ /dev/null @@ -1,2418 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/profile.proto - -package profile - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type CredentialType int32 - -const ( - CredentialType_CREDENTIAL_TYPE_UNSPECIFIED CredentialType = 0 - CredentialType_CREDENTIAL_TYPE_EXPIRING_PROFILE_KEY CredentialType = 1 -) - -// Enum value maps for CredentialType. -var ( - CredentialType_name = map[int32]string{ - 0: "CREDENTIAL_TYPE_UNSPECIFIED", - 1: "CREDENTIAL_TYPE_EXPIRING_PROFILE_KEY", - } - CredentialType_value = map[string]int32{ - "CREDENTIAL_TYPE_UNSPECIFIED": 0, - "CREDENTIAL_TYPE_EXPIRING_PROFILE_KEY": 1, - } -) - -func (x CredentialType) Enum() *CredentialType { - p := new(CredentialType) - *p = x - return p -} - -func (x CredentialType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CredentialType) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_profile_proto_enumTypes[0].Descriptor() -} - -func (CredentialType) Type() protoreflect.EnumType { - return &file_org_signal_chat_profile_proto_enumTypes[0] -} - -func (x CredentialType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CredentialType.Descriptor instead. -func (CredentialType) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{0} -} - -type SetProfileV1Request_AvatarChange int32 - -const ( - SetProfileV1Request_AVATAR_CHANGE_UNCHANGED SetProfileV1Request_AvatarChange = 0 - SetProfileV1Request_AVATAR_CHANGE_CLEAR SetProfileV1Request_AvatarChange = 1 - SetProfileV1Request_AVATAR_CHANGE_UPDATE SetProfileV1Request_AvatarChange = 2 -) - -// Enum value maps for SetProfileV1Request_AvatarChange. -var ( - SetProfileV1Request_AvatarChange_name = map[int32]string{ - 0: "AVATAR_CHANGE_UNCHANGED", - 1: "AVATAR_CHANGE_CLEAR", - 2: "AVATAR_CHANGE_UPDATE", - } - SetProfileV1Request_AvatarChange_value = map[string]int32{ - "AVATAR_CHANGE_UNCHANGED": 0, - "AVATAR_CHANGE_CLEAR": 1, - "AVATAR_CHANGE_UPDATE": 2, - } -) - -func (x SetProfileV1Request_AvatarChange) Enum() *SetProfileV1Request_AvatarChange { - p := new(SetProfileV1Request_AvatarChange) - *p = x - return p -} - -func (x SetProfileV1Request_AvatarChange) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SetProfileV1Request_AvatarChange) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_profile_proto_enumTypes[1].Descriptor() -} - -func (SetProfileV1Request_AvatarChange) Type() protoreflect.EnumType { - return &file_org_signal_chat_profile_proto_enumTypes[1] -} - -func (x SetProfileV1Request_AvatarChange) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SetProfileV1Request_AvatarChange.Descriptor instead. -func (SetProfileV1Request_AvatarChange) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{0, 0} -} - -type SetProfileV1Request struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The ciphertext of a name that users must set on the profile. - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // An enum to indicate what change, if any, is made to the avatar with this request. - AvatarChange SetProfileV1Request_AvatarChange `protobuf:"varint,2,opt,name=avatar_change,json=avatarChange,proto3,enum=org.signal.chat.profile.SetProfileV1Request_AvatarChange" json:"avatar_change,omitempty"` - // The ciphertext of an emoji that users can set on their profile. - AboutEmoji []byte `protobuf:"bytes,3,opt,name=about_emoji,json=aboutEmoji,proto3" json:"about_emoji,omitempty"` - // The ciphertext of a description that users can set on their profile. - About []byte `protobuf:"bytes,4,opt,name=about,proto3" json:"about,omitempty"` - // The ciphertext of the phone-number sharing setting on the profile. 29-byte encrypted boolean. - PhoneNumberSharing []byte `protobuf:"bytes,6,opt,name=phone_number_sharing,json=phoneNumberSharing,proto3" json:"phone_number_sharing,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetProfileV1Request) Reset() { - *x = SetProfileV1Request{} - mi := &file_org_signal_chat_profile_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetProfileV1Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetProfileV1Request) ProtoMessage() {} - -func (x *SetProfileV1Request) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[0] - 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 SetProfileV1Request.ProtoReflect.Descriptor instead. -func (*SetProfileV1Request) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{0} -} - -func (x *SetProfileV1Request) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *SetProfileV1Request) GetAvatarChange() SetProfileV1Request_AvatarChange { - if x != nil { - return x.AvatarChange - } - return SetProfileV1Request_AVATAR_CHANGE_UNCHANGED -} - -func (x *SetProfileV1Request) GetAboutEmoji() []byte { - if x != nil { - return x.AboutEmoji - } - return nil -} - -func (x *SetProfileV1Request) GetAbout() []byte { - if x != nil { - return x.About - } - return nil -} - -func (x *SetProfileV1Request) GetPhoneNumberSharing() []byte { - if x != nil { - return x.PhoneNumberSharing - } - return nil -} - -type SetProfileRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The profile version. Required. - Version []byte `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // The ciphertext of a serialized Profile protobuf. Required. - // 937 max length = 909 plaintext serialization + 28 bytes encryption overhead - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - // The SHA-256 hash of the Profile ciphertext being replaced. - // This is used an optimistic lock against concurrent changes. - // - // Optional, if this is the initial request to create a version. - ExpectedCurrentDataHash []byte `protobuf:"bytes,3,opt,name=expected_current_data_hash,json=expectedCurrentDataHash,proto3" json:"expected_current_data_hash,omitempty"` - // The current profile version being updated. - // This is used as an optimistic lock against concurrent changes. - // - // Optional, if there is no current profile version for the account. - ExpectedCurrentVersion []byte `protobuf:"bytes,4,opt,name=expected_current_version,json=expectedCurrentVersion,proto3" json:"expected_current_version,omitempty"` - // The ciphertext of the MobileCoin wallet ID on the profile. - PaymentAddress []byte `protobuf:"bytes,5,opt,name=payment_address,json=paymentAddress,proto3" json:"payment_address,omitempty"` - // A list of badge IDs associated with the profile. - BadgeIds []string `protobuf:"bytes,6,rep,name=badge_ids,json=badgeIds,proto3" json:"badge_ids,omitempty"` - // The profile key commitment. Used to issue a profile key credential response. - // - // Required during the v1 -> v2 migration period. Afterwards will be optional, if this is an update to an existing version. - Commitment []byte `protobuf:"bytes,7,opt,name=commitment,proto3" json:"commitment,omitempty"` - // An embedded v1 request. Required during the v1 -> v2 migration period. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - V1Request *SetProfileV1Request `protobuf:"bytes,15,opt,name=v1Request,proto3" json:"v1Request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetProfileRequest) Reset() { - *x = SetProfileRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetProfileRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetProfileRequest) ProtoMessage() {} - -func (x *SetProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[1] - 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 SetProfileRequest.ProtoReflect.Descriptor instead. -func (*SetProfileRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{1} -} - -func (x *SetProfileRequest) GetVersion() []byte { - if x != nil { - return x.Version - } - return nil -} - -func (x *SetProfileRequest) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *SetProfileRequest) GetExpectedCurrentDataHash() []byte { - if x != nil { - return x.ExpectedCurrentDataHash - } - return nil -} - -func (x *SetProfileRequest) GetExpectedCurrentVersion() []byte { - if x != nil { - return x.ExpectedCurrentVersion - } - return nil -} - -func (x *SetProfileRequest) GetPaymentAddress() []byte { - if x != nil { - return x.PaymentAddress - } - return nil -} - -func (x *SetProfileRequest) GetBadgeIds() []string { - if x != nil { - return x.BadgeIds - } - return nil -} - -func (x *SetProfileRequest) GetCommitment() []byte { - if x != nil { - return x.Commitment - } - return nil -} - -func (x *SetProfileRequest) GetV1Request() *SetProfileV1Request { - if x != nil { - return x.V1Request - } - return nil -} - -// Indicates that the account is not permitted to set a payment address, -// due to a disallowed country prefix on the account's phone number. -type PaymentsForbiddenInRegion struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentsForbiddenInRegion) Reset() { - *x = PaymentsForbiddenInRegion{} - mi := &file_org_signal_chat_profile_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentsForbiddenInRegion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentsForbiddenInRegion) ProtoMessage() {} - -func (x *PaymentsForbiddenInRegion) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[2] - 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 PaymentsForbiddenInRegion.ProtoReflect.Descriptor instead. -func (*PaymentsForbiddenInRegion) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{2} -} - -// Indicates that the account does not have the Profiles v2 capability, which -// is required to call Profiles.SetProfile -type ProfilesV2CapabilityRequired struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProfilesV2CapabilityRequired) Reset() { - *x = ProfilesV2CapabilityRequired{} - mi := &file_org_signal_chat_profile_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProfilesV2CapabilityRequired) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProfilesV2CapabilityRequired) ProtoMessage() {} - -func (x *ProfilesV2CapabilityRequired) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[3] - 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 ProfilesV2CapabilityRequired.ProtoReflect.Descriptor instead. -func (*ProfilesV2CapabilityRequired) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{3} -} - -type SetProfileResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If the request included a v1 avatar change, this field contains the policy - // and credential used by clients to upload an avatar to the CDN. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - V1AvatarUploadForm *common.S3UploadForm `protobuf:"bytes,15,opt,name=v1_avatar_upload_form,json=v1AvatarUploadForm,proto3,oneof" json:"v1_avatar_upload_form,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetProfileResult) Reset() { - *x = SetProfileResult{} - mi := &file_org_signal_chat_profile_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetProfileResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetProfileResult) ProtoMessage() {} - -func (x *SetProfileResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[4] - 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 SetProfileResult.ProtoReflect.Descriptor instead. -func (*SetProfileResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{4} -} - -func (x *SetProfileResult) GetV1AvatarUploadForm() *common.S3UploadForm { - if x != nil { - return x.V1AvatarUploadForm - } - return nil -} - -type SetProfileResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetProfileResponse_Result - // *SetProfileResponse_ExpectedDataWriteConflict - // *SetProfileResponse_PaymentsForbiddenInRegion - // *SetProfileResponse_ExpectedVersionWriteConflict - // *SetProfileResponse_ProfilesV2CapabilityRequired - Response isSetProfileResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetProfileResponse) Reset() { - *x = SetProfileResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetProfileResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetProfileResponse) ProtoMessage() {} - -func (x *SetProfileResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[5] - 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 SetProfileResponse.ProtoReflect.Descriptor instead. -func (*SetProfileResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{5} -} - -func (x *SetProfileResponse) GetResponse() isSetProfileResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetProfileResponse) GetResult() *SetProfileResult { - if x != nil { - if x, ok := x.Response.(*SetProfileResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *SetProfileResponse) GetExpectedDataWriteConflict() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetProfileResponse_ExpectedDataWriteConflict); ok { - return x.ExpectedDataWriteConflict - } - } - return nil -} - -func (x *SetProfileResponse) GetPaymentsForbiddenInRegion() *PaymentsForbiddenInRegion { - if x != nil { - if x, ok := x.Response.(*SetProfileResponse_PaymentsForbiddenInRegion); ok { - return x.PaymentsForbiddenInRegion - } - } - return nil -} - -func (x *SetProfileResponse) GetExpectedVersionWriteConflict() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetProfileResponse_ExpectedVersionWriteConflict); ok { - return x.ExpectedVersionWriteConflict - } - } - return nil -} - -func (x *SetProfileResponse) GetProfilesV2CapabilityRequired() *ProfilesV2CapabilityRequired { - if x != nil { - if x, ok := x.Response.(*SetProfileResponse_ProfilesV2CapabilityRequired); ok { - return x.ProfilesV2CapabilityRequired - } - } - return nil -} - -type isSetProfileResponse_Response interface { - isSetProfileResponse_Response() -} - -type SetProfileResponse_Result struct { - Result *SetProfileResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type SetProfileResponse_ExpectedDataWriteConflict struct { - // The current data hash did not match the request's expectation, indicating - // another device on the account may have written an update the caller does not know about. - ExpectedDataWriteConflict *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=expected_data_write_conflict,json=expectedDataWriteConflict,proto3,oneof"` -} - -type SetProfileResponse_PaymentsForbiddenInRegion struct { - // Payments are not permitted in the account's region, based on its phone - // number or the caller's IP address if the account does not have a phone - // number. The request should be retried without `payment_address. - PaymentsForbiddenInRegion *PaymentsForbiddenInRegion `protobuf:"bytes,3,opt,name=payments_forbidden_in_region,json=paymentsForbiddenInRegion,proto3,oneof"` -} - -type SetProfileResponse_ExpectedVersionWriteConflict struct { - // The current version did not match the request's expectation, indicating - // another device on the account may have created a new version the caller does not know about. - ExpectedVersionWriteConflict *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=expected_version_write_conflict,json=expectedVersionWriteConflict,proto3,oneof"` -} - -type SetProfileResponse_ProfilesV2CapabilityRequired struct { - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - ProfilesV2CapabilityRequired *ProfilesV2CapabilityRequired `protobuf:"bytes,15,opt,name=profiles_v2_capability_required,json=profilesV2CapabilityRequired,proto3,oneof"` -} - -func (*SetProfileResponse_Result) isSetProfileResponse_Response() {} - -func (*SetProfileResponse_ExpectedDataWriteConflict) isSetProfileResponse_Response() {} - -func (*SetProfileResponse_PaymentsForbiddenInRegion) isSetProfileResponse_Response() {} - -func (*SetProfileResponse_ExpectedVersionWriteConflict) isSetProfileResponse_Response() {} - -func (*SetProfileResponse_ProfilesV2CapabilityRequired) isSetProfileResponse_Response() {} - -type GetProfileRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The ACI of the account for which to get profile data. - AccountIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=account_identifier,json=accountIdentifier,proto3" json:"account_identifier,omitempty"` - // The profile version to retrieve. - Version []byte `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - // The `etag` from the previous request for this Profile version. If - // unchanged, the response will omit `profile` and `etag_matched` will be - // `true`. - Etag []byte `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetProfileRequest) Reset() { - *x = GetProfileRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetProfileRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProfileRequest) ProtoMessage() {} - -func (x *GetProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[6] - 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 GetProfileRequest.ProtoReflect.Descriptor instead. -func (*GetProfileRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{6} -} - -func (x *GetProfileRequest) GetAccountIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.AccountIdentifier - } - return nil -} - -func (x *GetProfileRequest) GetVersion() []byte { - if x != nil { - return x.Version - } - return nil -} - -func (x *GetProfileRequest) GetEtag() []byte { - if x != nil { - return x.Etag - } - return nil -} - -type GetProfileAnonymousRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Contains the data necessary to request a profile. - Request *GetProfileRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // Types that are valid to be assigned to Authentication: - // - // *GetProfileAnonymousRequest_UnidentifiedAccessKey - // *GetProfileAnonymousRequest_GroupSendToken - Authentication isGetProfileAnonymousRequest_Authentication `protobuf_oneof:"authentication"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetProfileAnonymousRequest) Reset() { - *x = GetProfileAnonymousRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetProfileAnonymousRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProfileAnonymousRequest) ProtoMessage() {} - -func (x *GetProfileAnonymousRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[7] - 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 GetProfileAnonymousRequest.ProtoReflect.Descriptor instead. -func (*GetProfileAnonymousRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{7} -} - -func (x *GetProfileAnonymousRequest) GetRequest() *GetProfileRequest { - if x != nil { - return x.Request - } - return nil -} - -func (x *GetProfileAnonymousRequest) GetAuthentication() isGetProfileAnonymousRequest_Authentication { - if x != nil { - return x.Authentication - } - return nil -} - -func (x *GetProfileAnonymousRequest) GetUnidentifiedAccessKey() []byte { - if x != nil { - if x, ok := x.Authentication.(*GetProfileAnonymousRequest_UnidentifiedAccessKey); ok { - return x.UnidentifiedAccessKey - } - } - return nil -} - -func (x *GetProfileAnonymousRequest) GetGroupSendToken() []byte { - if x != nil { - if x, ok := x.Authentication.(*GetProfileAnonymousRequest_GroupSendToken); ok { - return x.GroupSendToken - } - } - return nil -} - -type isGetProfileAnonymousRequest_Authentication interface { - isGetProfileAnonymousRequest_Authentication() -} - -type GetProfileAnonymousRequest_UnidentifiedAccessKey struct { - // The unidentified access key for the targeted account. - UnidentifiedAccessKey []byte `protobuf:"bytes,2,opt,name=unidentified_access_key,json=unidentifiedAccessKey,proto3,oneof"` -} - -type GetProfileAnonymousRequest_GroupSendToken struct { - // A group send endorsement token for the targeted account. - GroupSendToken []byte `protobuf:"bytes,3,opt,name=group_send_token,json=groupSendToken,proto3,oneof"` -} - -func (*GetProfileAnonymousRequest_UnidentifiedAccessKey) isGetProfileAnonymousRequest_Authentication() { -} - -func (*GetProfileAnonymousRequest_GroupSendToken) isGetProfileAnonymousRequest_Authentication() {} - -type AccountInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The account identity key of the targeted account. - IdentityKey []byte `protobuf:"bytes,1,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"` - // A checksum of the unidentified access key for the targeted account. - UnidentifiedAccessKeyFingerprint []byte `protobuf:"bytes,2,opt,name=unidentified_access_key_fingerprint,json=unidentifiedAccessKeyFingerprint,proto3" json:"unidentified_access_key_fingerprint,omitempty"` - // Whether the account has enabled sealed sender from anyone. - UnrestrictedUnidentifiedAccess bool `protobuf:"varint,3,opt,name=unrestricted_unidentified_access,json=unrestrictedUnidentifiedAccess,proto3" json:"unrestricted_unidentified_access,omitempty"` - // A list of the badges ids associated with the account. Metadata to display - // badges may be obtained by cross-referencing badge ids with - // RemoteConfiguration.GetBadges. - BadgeIds []string `protobuf:"bytes,4,rep,name=badge_ids,json=badgeIds,proto3" json:"badge_ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountInfo) Reset() { - *x = AccountInfo{} - mi := &file_org_signal_chat_profile_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountInfo) ProtoMessage() {} - -func (x *AccountInfo) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 AccountInfo.ProtoReflect.Descriptor instead. -func (*AccountInfo) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{8} -} - -func (x *AccountInfo) GetIdentityKey() []byte { - if x != nil { - return x.IdentityKey - } - return nil -} - -func (x *AccountInfo) GetUnidentifiedAccessKeyFingerprint() []byte { - if x != nil { - return x.UnidentifiedAccessKeyFingerprint - } - return nil -} - -func (x *AccountInfo) GetUnrestrictedUnidentifiedAccess() bool { - if x != nil { - return x.UnrestrictedUnidentifiedAccess - } - return false -} - -func (x *AccountInfo) GetBadgeIds() []string { - if x != nil { - return x.BadgeIds - } - return nil -} - -type ProfileResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The ciphertext of the requested version of the profile - Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` - // The ciphertext of the MobileCoin wallet ID on the profile. - PaymentAddress []byte `protobuf:"bytes,2,opt,name=payment_address,json=paymentAddress,proto3" json:"payment_address,omitempty"` - // Information about the targeted account - AccountInfo *AccountInfo `protobuf:"bytes,3,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` - // An entity tag for the profile. This may be used in subsequent requests - // for this profile version to optimize bandwidth. - // - // Note that this hash will not match the expected_data_hash used on - // SetProfile for concurrency control. - // - // Clients may validate that the value has been correctly calculated by - // calculating a 10-byte truncated TupleHash256 as follows: - // - // ``` - // TupleHash256(S = "ProfileETag/v1", L = 80 bits, tuple = [ - // - // data, - // payment_address, - // account_info.identity_key, - // account_info.unidentified_access_key_fingerprint, - // account_info.unrestricted_unidentified_access ? 0x01 : 0x00, - // uint32BE(count(account_info.badge_ids)), - // utf8(id) for each id in sortLexAscendingByUtf8Bytes(account_info.badge_ids), - // - // ]) - // ``` - // - // Absent/empty fields contribute an empty element (not zero bytes omitted): - // a missing payment_address is still a present, zero-length tuple element. - // - // This etag will always exclusively cover the documented fields. If fields - // are added in the future, a new etag field must be introduced. - Etag []byte `protobuf:"bytes,4,opt,name=etag,proto3" json:"etag,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProfileResult) Reset() { - *x = ProfileResult{} - mi := &file_org_signal_chat_profile_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProfileResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProfileResult) ProtoMessage() {} - -func (x *ProfileResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 ProfileResult.ProtoReflect.Descriptor instead. -func (*ProfileResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{9} -} - -func (x *ProfileResult) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *ProfileResult) GetPaymentAddress() []byte { - if x != nil { - return x.PaymentAddress - } - return nil -} - -func (x *ProfileResult) GetAccountInfo() *AccountInfo { - if x != nil { - return x.AccountInfo - } - return nil -} - -func (x *ProfileResult) GetEtag() []byte { - if x != nil { - return x.Etag - } - return nil -} - -type LegacyProfileResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The ciphertext of the name on the profile. - Name []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The ciphertext of the description on the profile. - About []byte `protobuf:"bytes,2,opt,name=about,proto3" json:"about,omitempty"` - // The ciphertext of the emoji on the profile. - AboutEmoji []byte `protobuf:"bytes,3,opt,name=about_emoji,json=aboutEmoji,proto3" json:"about_emoji,omitempty"` - // The cdn0 path of the avatar on the profile. - Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` - // The ciphertext of the phone-number sharing setting on the profile. - PhoneNumberSharing []byte `protobuf:"bytes,5,opt,name=phone_number_sharing,json=phoneNumberSharing,proto3" json:"phone_number_sharing,omitempty"` - // The ciphertext of the MobileCoin wallet ID on the profile. - PaymentAddress []byte `protobuf:"bytes,6,opt,name=payment_address,json=paymentAddress,proto3" json:"payment_address,omitempty"` - // Information about the targeted account - AccountInfo *AccountInfo `protobuf:"bytes,7,opt,name=account_info,json=accountInfo,proto3" json:"account_info,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LegacyProfileResult) Reset() { - *x = LegacyProfileResult{} - mi := &file_org_signal_chat_profile_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LegacyProfileResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LegacyProfileResult) ProtoMessage() {} - -func (x *LegacyProfileResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 LegacyProfileResult.ProtoReflect.Descriptor instead. -func (*LegacyProfileResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{10} -} - -func (x *LegacyProfileResult) GetName() []byte { - if x != nil { - return x.Name - } - return nil -} - -func (x *LegacyProfileResult) GetAbout() []byte { - if x != nil { - return x.About - } - return nil -} - -func (x *LegacyProfileResult) GetAboutEmoji() []byte { - if x != nil { - return x.AboutEmoji - } - return nil -} - -func (x *LegacyProfileResult) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -func (x *LegacyProfileResult) GetPhoneNumberSharing() []byte { - if x != nil { - return x.PhoneNumberSharing - } - return nil -} - -func (x *LegacyProfileResult) GetPaymentAddress() []byte { - if x != nil { - return x.PaymentAddress - } - return nil -} - -func (x *LegacyProfileResult) GetAccountInfo() *AccountInfo { - if x != nil { - return x.AccountInfo - } - return nil -} - -type GetProfileResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetProfileResponse_Profile - // *GetProfileResponse_EtagMatched - // *GetProfileResponse_NotFound - // *GetProfileResponse_LegacyProfile - Response isGetProfileResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetProfileResponse) Reset() { - *x = GetProfileResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetProfileResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProfileResponse) ProtoMessage() {} - -func (x *GetProfileResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[11] - 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 GetProfileResponse.ProtoReflect.Descriptor instead. -func (*GetProfileResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{11} -} - -func (x *GetProfileResponse) GetResponse() isGetProfileResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetProfileResponse) GetProfile() *ProfileResult { - if x != nil { - if x, ok := x.Response.(*GetProfileResponse_Profile); ok { - return x.Profile - } - } - return nil -} - -func (x *GetProfileResponse) GetEtagMatched() bool { - if x != nil { - if x, ok := x.Response.(*GetProfileResponse_EtagMatched); ok { - return x.EtagMatched - } - } - return false -} - -func (x *GetProfileResponse) GetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetProfileResponse_NotFound); ok { - return x.NotFound - } - } - return nil -} - -func (x *GetProfileResponse) GetLegacyProfile() *LegacyProfileResult { - if x != nil { - if x, ok := x.Response.(*GetProfileResponse_LegacyProfile); ok { - return x.LegacyProfile - } - } - return nil -} - -type isGetProfileResponse_Response interface { - isGetProfileResponse_Response() -} - -type GetProfileResponse_Profile struct { - // The full profile data. The current profile did not match the provided - // etag (or no etag was provided). - Profile *ProfileResult `protobuf:"bytes,1,opt,name=profile,proto3,oneof"` -} - -type GetProfileResponse_EtagMatched struct { - // The current profile matched the provided etag. If present, this will always be true. - EtagMatched bool `protobuf:"varint,2,opt,name=etag_matched,json=etagMatched,proto3,oneof"` -} - -type GetProfileResponse_NotFound struct { - NotFound *errors.NotFound `protobuf:"bytes,3,opt,name=not_found,json=notFound,proto3,oneof"` -} - -type GetProfileResponse_LegacyProfile struct { - // Will be present if there is no v2 Profile data for this version. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - LegacyProfile *LegacyProfileResult `protobuf:"bytes,15,opt,name=legacy_profile,json=legacyProfile,proto3,oneof"` -} - -func (*GetProfileResponse_Profile) isGetProfileResponse_Response() {} - -func (*GetProfileResponse_EtagMatched) isGetProfileResponse_Response() {} - -func (*GetProfileResponse_NotFound) isGetProfileResponse_Response() {} - -func (*GetProfileResponse_LegacyProfile) isGetProfileResponse_Response() {} - -type GetProfileAnonymousResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetProfileAnonymousResponse_Profile - // *GetProfileAnonymousResponse_EtagMatched - // *GetProfileAnonymousResponse_NotFound - // *GetProfileAnonymousResponse_FailedUnidentifiedAuthorization - // *GetProfileAnonymousResponse_ProfileV1 - Response isGetProfileAnonymousResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetProfileAnonymousResponse) Reset() { - *x = GetProfileAnonymousResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetProfileAnonymousResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProfileAnonymousResponse) ProtoMessage() {} - -func (x *GetProfileAnonymousResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 GetProfileAnonymousResponse.ProtoReflect.Descriptor instead. -func (*GetProfileAnonymousResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{12} -} - -func (x *GetProfileAnonymousResponse) GetResponse() isGetProfileAnonymousResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetProfileAnonymousResponse) GetProfile() *ProfileResult { - if x != nil { - if x, ok := x.Response.(*GetProfileAnonymousResponse_Profile); ok { - return x.Profile - } - } - return nil -} - -func (x *GetProfileAnonymousResponse) GetEtagMatched() bool { - if x != nil { - if x, ok := x.Response.(*GetProfileAnonymousResponse_EtagMatched); ok { - return x.EtagMatched - } - } - return false -} - -func (x *GetProfileAnonymousResponse) GetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetProfileAnonymousResponse_NotFound); ok { - return x.NotFound - } - } - return nil -} - -func (x *GetProfileAnonymousResponse) GetFailedUnidentifiedAuthorization() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*GetProfileAnonymousResponse_FailedUnidentifiedAuthorization); ok { - return x.FailedUnidentifiedAuthorization - } - } - return nil -} - -func (x *GetProfileAnonymousResponse) GetProfileV1() *LegacyProfileResult { - if x != nil { - if x, ok := x.Response.(*GetProfileAnonymousResponse_ProfileV1); ok { - return x.ProfileV1 - } - } - return nil -} - -type isGetProfileAnonymousResponse_Response interface { - isGetProfileAnonymousResponse_Response() -} - -type GetProfileAnonymousResponse_Profile struct { - // The full profile data. The current profile did not match the provided - // etag (or no etag was provided). - Profile *ProfileResult `protobuf:"bytes,1,opt,name=profile,proto3,oneof"` -} - -type GetProfileAnonymousResponse_EtagMatched struct { - // The current profile matched the provided etag. If present, this will always be true. - EtagMatched bool `protobuf:"varint,2,opt,name=etag_matched,json=etagMatched,proto3,oneof"` -} - -type GetProfileAnonymousResponse_NotFound struct { - NotFound *errors.NotFound `protobuf:"bytes,3,opt,name=not_found,json=notFound,proto3,oneof"` -} - -type GetProfileAnonymousResponse_FailedUnidentifiedAuthorization struct { - FailedUnidentifiedAuthorization *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,4,opt,name=failed_unidentified_authorization,json=failedUnidentifiedAuthorization,proto3,oneof"` -} - -type GetProfileAnonymousResponse_ProfileV1 struct { - // Will be present if there is no v2 Profile data for this version. - // - // Because this is a temporary field during the migration, it has the highest - // field number without serialization overhead. This is purely aesthetic. - ProfileV1 *LegacyProfileResult `protobuf:"bytes,15,opt,name=profile_v1,json=profileV1,proto3,oneof"` -} - -func (*GetProfileAnonymousResponse_Profile) isGetProfileAnonymousResponse_Response() {} - -func (*GetProfileAnonymousResponse_EtagMatched) isGetProfileAnonymousResponse_Response() {} - -func (*GetProfileAnonymousResponse_NotFound) isGetProfileAnonymousResponse_Response() {} - -func (*GetProfileAnonymousResponse_FailedUnidentifiedAuthorization) isGetProfileAnonymousResponse_Response() { -} - -func (*GetProfileAnonymousResponse_ProfileV1) isGetProfileAnonymousResponse_Response() {} - -type GetExpiringProfileKeyCredentialRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The ACI of the account for which to get a profile key credential. - AccountIdentifier *common.ServiceIdentifier `protobuf:"bytes,1,opt,name=account_identifier,json=accountIdentifier,proto3" json:"account_identifier,omitempty"` - // A zkgroup request for a profile key credential. - CredentialRequest []byte `protobuf:"bytes,2,opt,name=credential_request,json=credentialRequest,proto3" json:"credential_request,omitempty"` - // The type of credential being requested. - CredentialType CredentialType `protobuf:"varint,3,opt,name=credential_type,json=credentialType,proto3,enum=org.signal.chat.profile.CredentialType" json:"credential_type,omitempty"` - // The profile version for which to generate a profile key credential. - Version []byte `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExpiringProfileKeyCredentialRequest) Reset() { - *x = GetExpiringProfileKeyCredentialRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExpiringProfileKeyCredentialRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExpiringProfileKeyCredentialRequest) ProtoMessage() {} - -func (x *GetExpiringProfileKeyCredentialRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 GetExpiringProfileKeyCredentialRequest.ProtoReflect.Descriptor instead. -func (*GetExpiringProfileKeyCredentialRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{13} -} - -func (x *GetExpiringProfileKeyCredentialRequest) GetAccountIdentifier() *common.ServiceIdentifier { - if x != nil { - return x.AccountIdentifier - } - return nil -} - -func (x *GetExpiringProfileKeyCredentialRequest) GetCredentialRequest() []byte { - if x != nil { - return x.CredentialRequest - } - return nil -} - -func (x *GetExpiringProfileKeyCredentialRequest) GetCredentialType() CredentialType { - if x != nil { - return x.CredentialType - } - return CredentialType_CREDENTIAL_TYPE_UNSPECIFIED -} - -func (x *GetExpiringProfileKeyCredentialRequest) GetVersion() []byte { - if x != nil { - return x.Version - } - return nil -} - -type GetExpiringProfileKeyCredentialAnonymousRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Contains the data necessary to request an expiring profile key credential. - Request *GetExpiringProfileKeyCredentialRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - // The unidentified access key for the targeted account. - UnidentifiedAccessKey []byte `protobuf:"bytes,2,opt,name=unidentified_access_key,json=unidentifiedAccessKey,proto3" json:"unidentified_access_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExpiringProfileKeyCredentialAnonymousRequest) Reset() { - *x = GetExpiringProfileKeyCredentialAnonymousRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExpiringProfileKeyCredentialAnonymousRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExpiringProfileKeyCredentialAnonymousRequest) ProtoMessage() {} - -func (x *GetExpiringProfileKeyCredentialAnonymousRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 GetExpiringProfileKeyCredentialAnonymousRequest.ProtoReflect.Descriptor instead. -func (*GetExpiringProfileKeyCredentialAnonymousRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{14} -} - -func (x *GetExpiringProfileKeyCredentialAnonymousRequest) GetRequest() *GetExpiringProfileKeyCredentialRequest { - if x != nil { - return x.Request - } - return nil -} - -func (x *GetExpiringProfileKeyCredentialAnonymousRequest) GetUnidentifiedAccessKey() []byte { - if x != nil { - return x.UnidentifiedAccessKey - } - return nil -} - -type GetExpiringProfileKeyCredentialResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A zkgroup credential used by a client to prove that it has the profile key - // of a targeted account. - ProfileKeyCredential []byte `protobuf:"bytes,1,opt,name=profile_key_credential,json=profileKeyCredential,proto3" json:"profile_key_credential,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExpiringProfileKeyCredentialResult) Reset() { - *x = GetExpiringProfileKeyCredentialResult{} - mi := &file_org_signal_chat_profile_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExpiringProfileKeyCredentialResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExpiringProfileKeyCredentialResult) ProtoMessage() {} - -func (x *GetExpiringProfileKeyCredentialResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 GetExpiringProfileKeyCredentialResult.ProtoReflect.Descriptor instead. -func (*GetExpiringProfileKeyCredentialResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{15} -} - -func (x *GetExpiringProfileKeyCredentialResult) GetProfileKeyCredential() []byte { - if x != nil { - return x.ProfileKeyCredential - } - return nil -} - -type GetExpiringProfileKeyCredentialAnonymousResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetExpiringProfileKeyCredentialAnonymousResponse_Result - // *GetExpiringProfileKeyCredentialAnonymousResponse_NotFound - // *GetExpiringProfileKeyCredentialAnonymousResponse_FailedUnidentifiedAuthorization - Response isGetExpiringProfileKeyCredentialAnonymousResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExpiringProfileKeyCredentialAnonymousResponse) Reset() { - *x = GetExpiringProfileKeyCredentialAnonymousResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExpiringProfileKeyCredentialAnonymousResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExpiringProfileKeyCredentialAnonymousResponse) ProtoMessage() {} - -func (x *GetExpiringProfileKeyCredentialAnonymousResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[16] - 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 GetExpiringProfileKeyCredentialAnonymousResponse.ProtoReflect.Descriptor instead. -func (*GetExpiringProfileKeyCredentialAnonymousResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{16} -} - -func (x *GetExpiringProfileKeyCredentialAnonymousResponse) GetResponse() isGetExpiringProfileKeyCredentialAnonymousResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetExpiringProfileKeyCredentialAnonymousResponse) GetResult() *GetExpiringProfileKeyCredentialResult { - if x != nil { - if x, ok := x.Response.(*GetExpiringProfileKeyCredentialAnonymousResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *GetExpiringProfileKeyCredentialAnonymousResponse) GetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetExpiringProfileKeyCredentialAnonymousResponse_NotFound); ok { - return x.NotFound - } - } - return nil -} - -func (x *GetExpiringProfileKeyCredentialAnonymousResponse) GetFailedUnidentifiedAuthorization() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*GetExpiringProfileKeyCredentialAnonymousResponse_FailedUnidentifiedAuthorization); ok { - return x.FailedUnidentifiedAuthorization - } - } - return nil -} - -type isGetExpiringProfileKeyCredentialAnonymousResponse_Response interface { - isGetExpiringProfileKeyCredentialAnonymousResponse_Response() -} - -type GetExpiringProfileKeyCredentialAnonymousResponse_Result struct { - Result *GetExpiringProfileKeyCredentialResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type GetExpiringProfileKeyCredentialAnonymousResponse_NotFound struct { - NotFound *errors.NotFound `protobuf:"bytes,2,opt,name=not_found,json=notFound,proto3,oneof"` -} - -type GetExpiringProfileKeyCredentialAnonymousResponse_FailedUnidentifiedAuthorization struct { - FailedUnidentifiedAuthorization *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=failed_unidentified_authorization,json=failedUnidentifiedAuthorization,proto3,oneof"` -} - -func (*GetExpiringProfileKeyCredentialAnonymousResponse_Result) isGetExpiringProfileKeyCredentialAnonymousResponse_Response() { -} - -func (*GetExpiringProfileKeyCredentialAnonymousResponse_NotFound) isGetExpiringProfileKeyCredentialAnonymousResponse_Response() { -} - -func (*GetExpiringProfileKeyCredentialAnonymousResponse_FailedUnidentifiedAuthorization) isGetExpiringProfileKeyCredentialAnonymousResponse_Response() { -} - -type GetAvatarCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AvatarCredentialsRequest []byte `protobuf:"bytes,1,opt,name=avatar_credentials_request,json=avatarCredentialsRequest,proto3" json:"avatar_credentials_request,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAvatarCredentialsRequest) Reset() { - *x = GetAvatarCredentialsRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAvatarCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAvatarCredentialsRequest) ProtoMessage() {} - -func (x *GetAvatarCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[17] - 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 GetAvatarCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetAvatarCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{17} -} - -func (x *GetAvatarCredentialsRequest) GetAvatarCredentialsRequest() []byte { - if x != nil { - return x.AvatarCredentialsRequest - } - return nil -} - -type GetAvatarCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetAvatarCredentialsResponse_AvatarCredentials - // *GetAvatarCredentialsResponse_MissingZkCredentialKey - Response isGetAvatarCredentialsResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAvatarCredentialsResponse) Reset() { - *x = GetAvatarCredentialsResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAvatarCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAvatarCredentialsResponse) ProtoMessage() {} - -func (x *GetAvatarCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[18] - 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 GetAvatarCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetAvatarCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{18} -} - -func (x *GetAvatarCredentialsResponse) GetResponse() isGetAvatarCredentialsResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetAvatarCredentialsResponse) GetAvatarCredentials() []byte { - if x != nil { - if x, ok := x.Response.(*GetAvatarCredentialsResponse_AvatarCredentials); ok { - return x.AvatarCredentials - } - } - return nil -} - -func (x *GetAvatarCredentialsResponse) GetMissingZkCredentialKey() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*GetAvatarCredentialsResponse_MissingZkCredentialKey); ok { - return x.MissingZkCredentialKey - } - } - return nil -} - -type isGetAvatarCredentialsResponse_Response interface { - isGetAvatarCredentialsResponse_Response() -} - -type GetAvatarCredentialsResponse_AvatarCredentials struct { - AvatarCredentials []byte `protobuf:"bytes,1,opt,name=avatar_credentials,json=avatarCredentials,proto3,oneof"` -} - -type GetAvatarCredentialsResponse_MissingZkCredentialKey struct { - // the client must call Accounts.SetZkCredentialKey to call this method - MissingZkCredentialKey *errors.FailedPrecondition `protobuf:"bytes,2,opt,name=missing_zk_credential_key,json=missingZkCredentialKey,proto3,oneof"` -} - -func (*GetAvatarCredentialsResponse_AvatarCredentials) isGetAvatarCredentialsResponse_Response() {} - -func (*GetAvatarCredentialsResponse_MissingZkCredentialKey) isGetAvatarCredentialsResponse_Response() { -} - -type GetAvatarUploadFormRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AvatarCredentialsPresentation []byte `protobuf:"bytes,1,opt,name=avatar_credentials_presentation,json=avatarCredentialsPresentation,proto3" json:"avatar_credentials_presentation,omitempty"` - // The length of the attachment for the requested upload form. Uploads - // performed with this form will be limited to the provided length. - UploadLength uint32 `protobuf:"varint,2,opt,name=upload_length,json=uploadLength,proto3" json:"upload_length,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAvatarUploadFormRequest) Reset() { - *x = GetAvatarUploadFormRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAvatarUploadFormRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAvatarUploadFormRequest) ProtoMessage() {} - -func (x *GetAvatarUploadFormRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[19] - 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 GetAvatarUploadFormRequest.ProtoReflect.Descriptor instead. -func (*GetAvatarUploadFormRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{19} -} - -func (x *GetAvatarUploadFormRequest) GetAvatarCredentialsPresentation() []byte { - if x != nil { - return x.AvatarCredentialsPresentation - } - return nil -} - -func (x *GetAvatarUploadFormRequest) GetUploadLength() uint32 { - if x != nil { - return x.UploadLength - } - return 0 -} - -type GetAvatarUploadFormResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetAvatarUploadFormResponse_AvatarUploadForm - // *GetAvatarUploadFormResponse_InvalidCredentialsPresentation - Response isGetAvatarUploadFormResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetAvatarUploadFormResponse) Reset() { - *x = GetAvatarUploadFormResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetAvatarUploadFormResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetAvatarUploadFormResponse) ProtoMessage() {} - -func (x *GetAvatarUploadFormResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_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 GetAvatarUploadFormResponse.ProtoReflect.Descriptor instead. -func (*GetAvatarUploadFormResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{20} -} - -func (x *GetAvatarUploadFormResponse) GetResponse() isGetAvatarUploadFormResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetAvatarUploadFormResponse) GetAvatarUploadForm() *common.S3UploadForm { - if x != nil { - if x, ok := x.Response.(*GetAvatarUploadFormResponse_AvatarUploadForm); ok { - return x.AvatarUploadForm - } - } - return nil -} - -func (x *GetAvatarUploadFormResponse) GetInvalidCredentialsPresentation() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*GetAvatarUploadFormResponse_InvalidCredentialsPresentation); ok { - return x.InvalidCredentialsPresentation - } - } - return nil -} - -type isGetAvatarUploadFormResponse_Response interface { - isGetAvatarUploadFormResponse_Response() -} - -type GetAvatarUploadFormResponse_AvatarUploadForm struct { - AvatarUploadForm *common.S3UploadForm `protobuf:"bytes,1,opt,name=avatar_upload_form,json=avatarUploadForm,proto3,oneof"` -} - -type GetAvatarUploadFormResponse_InvalidCredentialsPresentation struct { - InvalidCredentialsPresentation *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=invalid_credentials_presentation,json=invalidCredentialsPresentation,proto3,oneof"` -} - -func (*GetAvatarUploadFormResponse_AvatarUploadForm) isGetAvatarUploadFormResponse_Response() {} - -func (*GetAvatarUploadFormResponse_InvalidCredentialsPresentation) isGetAvatarUploadFormResponse_Response() { -} - -type ExtendAvatarTTLRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AvatarCredentialsPresentation []byte `protobuf:"bytes,1,opt,name=avatar_credentials_presentation,json=avatarCredentialsPresentation,proto3" json:"avatar_credentials_presentation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExtendAvatarTTLRequest) Reset() { - *x = ExtendAvatarTTLRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExtendAvatarTTLRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtendAvatarTTLRequest) ProtoMessage() {} - -func (x *ExtendAvatarTTLRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[21] - 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 ExtendAvatarTTLRequest.ProtoReflect.Descriptor instead. -func (*ExtendAvatarTTLRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{21} -} - -func (x *ExtendAvatarTTLRequest) GetAvatarCredentialsPresentation() []byte { - if x != nil { - return x.AvatarCredentialsPresentation - } - return nil -} - -type ExtendAvatarTTLResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *ExtendAvatarTTLResponse_Path - // *ExtendAvatarTTLResponse_InvalidCredentialsPresentation - // *ExtendAvatarTTLResponse_NotFound - Response isExtendAvatarTTLResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExtendAvatarTTLResponse) Reset() { - *x = ExtendAvatarTTLResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExtendAvatarTTLResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtendAvatarTTLResponse) ProtoMessage() {} - -func (x *ExtendAvatarTTLResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[22] - 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 ExtendAvatarTTLResponse.ProtoReflect.Descriptor instead. -func (*ExtendAvatarTTLResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{22} -} - -func (x *ExtendAvatarTTLResponse) GetResponse() isExtendAvatarTTLResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *ExtendAvatarTTLResponse) GetPath() string { - if x != nil { - if x, ok := x.Response.(*ExtendAvatarTTLResponse_Path); ok { - return x.Path - } - } - return "" -} - -func (x *ExtendAvatarTTLResponse) GetInvalidCredentialsPresentation() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*ExtendAvatarTTLResponse_InvalidCredentialsPresentation); ok { - return x.InvalidCredentialsPresentation - } - } - return nil -} - -func (x *ExtendAvatarTTLResponse) GetNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*ExtendAvatarTTLResponse_NotFound); ok { - return x.NotFound - } - } - return nil -} - -type isExtendAvatarTTLResponse_Response interface { - isExtendAvatarTTLResponse_Response() -} - -type ExtendAvatarTTLResponse_Path struct { - // The avatar that was extended. May be used as a check against state de-synchronization. - Path string `protobuf:"bytes,1,opt,name=path,proto3,oneof"` -} - -type ExtendAvatarTTLResponse_InvalidCredentialsPresentation struct { - InvalidCredentialsPresentation *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=invalid_credentials_presentation,json=invalidCredentialsPresentation,proto3,oneof"` -} - -type ExtendAvatarTTLResponse_NotFound struct { - // the identity does not have an active avatar - NotFound *errors.NotFound `protobuf:"bytes,3,opt,name=not_found,json=notFound,proto3,oneof"` -} - -func (*ExtendAvatarTTLResponse_Path) isExtendAvatarTTLResponse_Response() {} - -func (*ExtendAvatarTTLResponse_InvalidCredentialsPresentation) isExtendAvatarTTLResponse_Response() {} - -func (*ExtendAvatarTTLResponse_NotFound) isExtendAvatarTTLResponse_Response() {} - -type DeleteAvatarRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AvatarCredentialsPresentation []byte `protobuf:"bytes,1,opt,name=avatar_credentials_presentation,json=avatarCredentialsPresentation,proto3" json:"avatar_credentials_presentation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAvatarRequest) Reset() { - *x = DeleteAvatarRequest{} - mi := &file_org_signal_chat_profile_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAvatarRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAvatarRequest) ProtoMessage() {} - -func (x *DeleteAvatarRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[23] - 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 DeleteAvatarRequest.ProtoReflect.Descriptor instead. -func (*DeleteAvatarRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{23} -} - -func (x *DeleteAvatarRequest) GetAvatarCredentialsPresentation() []byte { - if x != nil { - return x.AvatarCredentialsPresentation - } - return nil -} - -type DeleteAvatarResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *DeleteAvatarResponse_Success - // *DeleteAvatarResponse_InvalidCredentialsPresentation - Response isDeleteAvatarResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteAvatarResponse) Reset() { - *x = DeleteAvatarResponse{} - mi := &file_org_signal_chat_profile_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteAvatarResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteAvatarResponse) ProtoMessage() {} - -func (x *DeleteAvatarResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_profile_proto_msgTypes[24] - 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 DeleteAvatarResponse.ProtoReflect.Descriptor instead. -func (*DeleteAvatarResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_profile_proto_rawDescGZIP(), []int{24} -} - -func (x *DeleteAvatarResponse) GetResponse() isDeleteAvatarResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *DeleteAvatarResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*DeleteAvatarResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *DeleteAvatarResponse) GetInvalidCredentialsPresentation() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*DeleteAvatarResponse_InvalidCredentialsPresentation); ok { - return x.InvalidCredentialsPresentation - } - } - return nil -} - -type isDeleteAvatarResponse_Response interface { - isDeleteAvatarResponse_Response() -} - -type DeleteAvatarResponse_Success struct { - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type DeleteAvatarResponse_InvalidCredentialsPresentation struct { - InvalidCredentialsPresentation *errors.FailedZkAuthentication `protobuf:"bytes,2,opt,name=invalid_credentials_presentation,json=invalidCredentialsPresentation,proto3,oneof"` -} - -func (*DeleteAvatarResponse_Success) isDeleteAvatarResponse_Response() {} - -func (*DeleteAvatarResponse_InvalidCredentialsPresentation) isDeleteAvatarResponse_Response() {} - -var File_org_signal_chat_profile_proto protoreflect.FileDescriptor - -const file_org_signal_chat_profile_proto_rawDesc = "" + - "\n" + - "\x1dorg/signal/chat/profile.proto\x12\x17org.signal.chat.profile\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1corg/signal/chat/common.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x19org/signal/chat/tag.proto\"\xf7\x02\n" + - "\x13SetProfileV1Request\x12\x1b\n" + - "\x04name\x18\x01 \x01(\fB\a\xa2\x97\"\x03Q\x9d\x02R\x04name\x12^\n" + - "\ravatar_change\x18\x02 \x01(\x0e29.org.signal.chat.profile.SetProfileV1Request.AvatarChangeR\favatarChange\x12'\n" + - "\vabout_emoji\x18\x03 \x01(\fB\x06\xa2\x97\"\x02\x00.org.signal.chat.profile.GetExpiringProfileKeyCredentialResultH\x00R\x06result\x12N\n" + - "\tnot_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\r\xc2\xd5\"\tnot_foundH\x00R\bnotFound\x12\xac\x01\n" + - "!failed_unidentified_authorization\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB%\xc2\xd5\"!failed_unidentified_authorizationH\x00R\x1ffailedUnidentifiedAuthorizationB\n" + - "\n" + - "\bresponse\"[\n" + - "\x1bGetAvatarCredentialsRequest\x12<\n" + - "\x1aavatar_credentials_request\x18\x01 \x01(\fR\x18avatarCredentialsRequest\"\xe4\x01\n" + - "\x1cGetAvatarCredentialsResponse\x12/\n" + - "\x12avatar_credentials\x18\x01 \x01(\fH\x00R\x11avatarCredentials\x12\x86\x01\n" + - "\x19missing_zk_credential_key\x18\x02 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1d\xc2\xd5\"\x19missing_zk_credential_keyH\x00R\x16missingZkCredentialKeyB\n" + - "\n" + - "\bresponse\"\x96\x01\n" + - "\x1aGetAvatarUploadFormRequest\x12F\n" + - "\x1favatar_credentials_presentation\x18\x01 \x01(\fR\x1davatarCredentialsPresentation\x120\n" + - "\rupload_length\x18\x02 \x01(\rB\v\xb2\x97\"\a\b\x01\x10\x80\x80\x80\x05R\fuploadLength\"\xa2\x02\n" + - "\x1bGetAvatarUploadFormResponse\x12T\n" + - "\x12avatar_upload_form\x18\x01 \x01(\v2$.org.signal.chat.common.S3UploadFormH\x00R\x10avatarUploadForm\x12\xa0\x01\n" + - " invalid_credentials_presentation\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB$\xc2\xd5\" invalid_credentials_presentationH\x00R\x1einvalidCredentialsPresentationB\n" + - "\n" + - "\bresponse\"`\n" + - "\x16ExtendAvatarTTLRequest\x12F\n" + - "\x1favatar_credentials_presentation\x18\x01 \x01(\fR\x1davatarCredentialsPresentation\"\xb5\x02\n" + - "\x17ExtendAvatarTTLResponse\x12\x14\n" + - "\x04path\x18\x01 \x01(\tH\x00R\x04path\x12\xa0\x01\n" + - " invalid_credentials_presentation\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB$\xc2\xd5\" invalid_credentials_presentationH\x00R\x1einvalidCredentialsPresentation\x12U\n" + - "\tnot_found\x18\x03 \x01(\v2 .org.signal.chat.errors.NotFoundB\x14\xc2\xd5\"\x10no_active_avatarH\x00R\bnotFoundB\n" + - "\n" + - "\bresponse\"]\n" + - "\x13DeleteAvatarRequest\x12F\n" + - "\x1favatar_credentials_presentation\x18\x01 \x01(\fR\x1davatarCredentialsPresentation\"\xf9\x01\n" + - "\x14DeleteAvatarResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12\xa0\x01\n" + - " invalid_credentials_presentation\x18\x02 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB$\xc2\xd5\" invalid_credentials_presentationH\x00R\x1einvalidCredentialsPresentationB\n" + - "\n" + - "\bresponse*[\n" + - "\x0eCredentialType\x12\x1f\n" + - "\x1bCREDENTIAL_TYPE_UNSPECIFIED\x10\x00\x12(\n" + - "$CREDENTIAL_TYPE_EXPIRING_PROFILE_KEY\x10\x012\xe9\x02\n" + - "\aProfile\x12g\n" + - "\n" + - "SetProfile\x12*.org.signal.chat.profile.SetProfileRequest\x1a+.org.signal.chat.profile.SetProfileResponse\"\x00\x12g\n" + - "\n" + - "GetProfile\x12*.org.signal.chat.profile.GetProfileRequest\x1a+.org.signal.chat.profile.GetProfileResponse\"\x00\x12\x85\x01\n" + - "\x14GetAvatarCredentials\x124.org.signal.chat.profile.GetAvatarCredentialsRequest\x1a5.org.signal.chat.profile.GetAvatarCredentialsResponse\"\x00\x1a\x04\xc8\xd5\"\x012\xba\x05\n" + - "\x10ProfileAnonymous\x12y\n" + - "\n" + - "GetProfile\x123.org.signal.chat.profile.GetProfileAnonymousRequest\x1a4.org.signal.chat.profile.GetProfileAnonymousResponse\"\x00\x12\xb8\x01\n" + - "\x1fGetExpiringProfileKeyCredential\x12H.org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousRequest\x1aI.org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousResponse\"\x00\x12\x82\x01\n" + - "\x13GetAvatarUploadForm\x123.org.signal.chat.profile.GetAvatarUploadFormRequest\x1a4.org.signal.chat.profile.GetAvatarUploadFormResponse\"\x00\x12v\n" + - "\x0fExtendAvatarTTL\x12/.org.signal.chat.profile.ExtendAvatarTTLRequest\x1a0.org.signal.chat.profile.ExtendAvatarTTLResponse\"\x00\x12m\n" + - "\fDeleteAvatar\x12,.org.signal.chat.profile.DeleteAvatarRequest\x1a-.org.signal.chat.profile.DeleteAvatarResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_profile_proto_rawDescOnce sync.Once - file_org_signal_chat_profile_proto_rawDescData []byte -) - -func file_org_signal_chat_profile_proto_rawDescGZIP() []byte { - file_org_signal_chat_profile_proto_rawDescOnce.Do(func() { - file_org_signal_chat_profile_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_profile_proto_rawDesc), len(file_org_signal_chat_profile_proto_rawDesc))) - }) - return file_org_signal_chat_profile_proto_rawDescData -} - -var file_org_signal_chat_profile_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_org_signal_chat_profile_proto_msgTypes = make([]protoimpl.MessageInfo, 25) -var file_org_signal_chat_profile_proto_goTypes = []any{ - (CredentialType)(0), // 0: org.signal.chat.profile.CredentialType - (SetProfileV1Request_AvatarChange)(0), // 1: org.signal.chat.profile.SetProfileV1Request.AvatarChange - (*SetProfileV1Request)(nil), // 2: org.signal.chat.profile.SetProfileV1Request - (*SetProfileRequest)(nil), // 3: org.signal.chat.profile.SetProfileRequest - (*PaymentsForbiddenInRegion)(nil), // 4: org.signal.chat.profile.PaymentsForbiddenInRegion - (*ProfilesV2CapabilityRequired)(nil), // 5: org.signal.chat.profile.ProfilesV2CapabilityRequired - (*SetProfileResult)(nil), // 6: org.signal.chat.profile.SetProfileResult - (*SetProfileResponse)(nil), // 7: org.signal.chat.profile.SetProfileResponse - (*GetProfileRequest)(nil), // 8: org.signal.chat.profile.GetProfileRequest - (*GetProfileAnonymousRequest)(nil), // 9: org.signal.chat.profile.GetProfileAnonymousRequest - (*AccountInfo)(nil), // 10: org.signal.chat.profile.AccountInfo - (*ProfileResult)(nil), // 11: org.signal.chat.profile.ProfileResult - (*LegacyProfileResult)(nil), // 12: org.signal.chat.profile.LegacyProfileResult - (*GetProfileResponse)(nil), // 13: org.signal.chat.profile.GetProfileResponse - (*GetProfileAnonymousResponse)(nil), // 14: org.signal.chat.profile.GetProfileAnonymousResponse - (*GetExpiringProfileKeyCredentialRequest)(nil), // 15: org.signal.chat.profile.GetExpiringProfileKeyCredentialRequest - (*GetExpiringProfileKeyCredentialAnonymousRequest)(nil), // 16: org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousRequest - (*GetExpiringProfileKeyCredentialResult)(nil), // 17: org.signal.chat.profile.GetExpiringProfileKeyCredentialResult - (*GetExpiringProfileKeyCredentialAnonymousResponse)(nil), // 18: org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousResponse - (*GetAvatarCredentialsRequest)(nil), // 19: org.signal.chat.profile.GetAvatarCredentialsRequest - (*GetAvatarCredentialsResponse)(nil), // 20: org.signal.chat.profile.GetAvatarCredentialsResponse - (*GetAvatarUploadFormRequest)(nil), // 21: org.signal.chat.profile.GetAvatarUploadFormRequest - (*GetAvatarUploadFormResponse)(nil), // 22: org.signal.chat.profile.GetAvatarUploadFormResponse - (*ExtendAvatarTTLRequest)(nil), // 23: org.signal.chat.profile.ExtendAvatarTTLRequest - (*ExtendAvatarTTLResponse)(nil), // 24: org.signal.chat.profile.ExtendAvatarTTLResponse - (*DeleteAvatarRequest)(nil), // 25: org.signal.chat.profile.DeleteAvatarRequest - (*DeleteAvatarResponse)(nil), // 26: org.signal.chat.profile.DeleteAvatarResponse - (*common.S3UploadForm)(nil), // 27: org.signal.chat.common.S3UploadForm - (*errors.FailedPrecondition)(nil), // 28: org.signal.chat.errors.FailedPrecondition - (*common.ServiceIdentifier)(nil), // 29: org.signal.chat.common.ServiceIdentifier - (*errors.NotFound)(nil), // 30: org.signal.chat.errors.NotFound - (*errors.FailedUnidentifiedAuthorization)(nil), // 31: org.signal.chat.errors.FailedUnidentifiedAuthorization - (*errors.FailedZkAuthentication)(nil), // 32: org.signal.chat.errors.FailedZkAuthentication - (*emptypb.Empty)(nil), // 33: google.protobuf.Empty -} -var file_org_signal_chat_profile_proto_depIdxs = []int32{ - 1, // 0: org.signal.chat.profile.SetProfileV1Request.avatar_change:type_name -> org.signal.chat.profile.SetProfileV1Request.AvatarChange - 2, // 1: org.signal.chat.profile.SetProfileRequest.v1Request:type_name -> org.signal.chat.profile.SetProfileV1Request - 27, // 2: org.signal.chat.profile.SetProfileResult.v1_avatar_upload_form:type_name -> org.signal.chat.common.S3UploadForm - 6, // 3: org.signal.chat.profile.SetProfileResponse.result:type_name -> org.signal.chat.profile.SetProfileResult - 28, // 4: org.signal.chat.profile.SetProfileResponse.expected_data_write_conflict:type_name -> org.signal.chat.errors.FailedPrecondition - 4, // 5: org.signal.chat.profile.SetProfileResponse.payments_forbidden_in_region:type_name -> org.signal.chat.profile.PaymentsForbiddenInRegion - 28, // 6: org.signal.chat.profile.SetProfileResponse.expected_version_write_conflict:type_name -> org.signal.chat.errors.FailedPrecondition - 5, // 7: org.signal.chat.profile.SetProfileResponse.profiles_v2_capability_required:type_name -> org.signal.chat.profile.ProfilesV2CapabilityRequired - 29, // 8: org.signal.chat.profile.GetProfileRequest.account_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 8, // 9: org.signal.chat.profile.GetProfileAnonymousRequest.request:type_name -> org.signal.chat.profile.GetProfileRequest - 10, // 10: org.signal.chat.profile.ProfileResult.account_info:type_name -> org.signal.chat.profile.AccountInfo - 10, // 11: org.signal.chat.profile.LegacyProfileResult.account_info:type_name -> org.signal.chat.profile.AccountInfo - 11, // 12: org.signal.chat.profile.GetProfileResponse.profile:type_name -> org.signal.chat.profile.ProfileResult - 30, // 13: org.signal.chat.profile.GetProfileResponse.not_found:type_name -> org.signal.chat.errors.NotFound - 12, // 14: org.signal.chat.profile.GetProfileResponse.legacy_profile:type_name -> org.signal.chat.profile.LegacyProfileResult - 11, // 15: org.signal.chat.profile.GetProfileAnonymousResponse.profile:type_name -> org.signal.chat.profile.ProfileResult - 30, // 16: org.signal.chat.profile.GetProfileAnonymousResponse.not_found:type_name -> org.signal.chat.errors.NotFound - 31, // 17: org.signal.chat.profile.GetProfileAnonymousResponse.failed_unidentified_authorization:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 12, // 18: org.signal.chat.profile.GetProfileAnonymousResponse.profile_v1:type_name -> org.signal.chat.profile.LegacyProfileResult - 29, // 19: org.signal.chat.profile.GetExpiringProfileKeyCredentialRequest.account_identifier:type_name -> org.signal.chat.common.ServiceIdentifier - 0, // 20: org.signal.chat.profile.GetExpiringProfileKeyCredentialRequest.credential_type:type_name -> org.signal.chat.profile.CredentialType - 15, // 21: org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousRequest.request:type_name -> org.signal.chat.profile.GetExpiringProfileKeyCredentialRequest - 17, // 22: org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousResponse.result:type_name -> org.signal.chat.profile.GetExpiringProfileKeyCredentialResult - 30, // 23: org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousResponse.not_found:type_name -> org.signal.chat.errors.NotFound - 31, // 24: org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousResponse.failed_unidentified_authorization:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 28, // 25: org.signal.chat.profile.GetAvatarCredentialsResponse.missing_zk_credential_key:type_name -> org.signal.chat.errors.FailedPrecondition - 27, // 26: org.signal.chat.profile.GetAvatarUploadFormResponse.avatar_upload_form:type_name -> org.signal.chat.common.S3UploadForm - 32, // 27: org.signal.chat.profile.GetAvatarUploadFormResponse.invalid_credentials_presentation:type_name -> org.signal.chat.errors.FailedZkAuthentication - 32, // 28: org.signal.chat.profile.ExtendAvatarTTLResponse.invalid_credentials_presentation:type_name -> org.signal.chat.errors.FailedZkAuthentication - 30, // 29: org.signal.chat.profile.ExtendAvatarTTLResponse.not_found:type_name -> org.signal.chat.errors.NotFound - 33, // 30: org.signal.chat.profile.DeleteAvatarResponse.success:type_name -> google.protobuf.Empty - 32, // 31: org.signal.chat.profile.DeleteAvatarResponse.invalid_credentials_presentation:type_name -> org.signal.chat.errors.FailedZkAuthentication - 3, // 32: org.signal.chat.profile.Profile.SetProfile:input_type -> org.signal.chat.profile.SetProfileRequest - 8, // 33: org.signal.chat.profile.Profile.GetProfile:input_type -> org.signal.chat.profile.GetProfileRequest - 19, // 34: org.signal.chat.profile.Profile.GetAvatarCredentials:input_type -> org.signal.chat.profile.GetAvatarCredentialsRequest - 9, // 35: org.signal.chat.profile.ProfileAnonymous.GetProfile:input_type -> org.signal.chat.profile.GetProfileAnonymousRequest - 16, // 36: org.signal.chat.profile.ProfileAnonymous.GetExpiringProfileKeyCredential:input_type -> org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousRequest - 21, // 37: org.signal.chat.profile.ProfileAnonymous.GetAvatarUploadForm:input_type -> org.signal.chat.profile.GetAvatarUploadFormRequest - 23, // 38: org.signal.chat.profile.ProfileAnonymous.ExtendAvatarTTL:input_type -> org.signal.chat.profile.ExtendAvatarTTLRequest - 25, // 39: org.signal.chat.profile.ProfileAnonymous.DeleteAvatar:input_type -> org.signal.chat.profile.DeleteAvatarRequest - 7, // 40: org.signal.chat.profile.Profile.SetProfile:output_type -> org.signal.chat.profile.SetProfileResponse - 13, // 41: org.signal.chat.profile.Profile.GetProfile:output_type -> org.signal.chat.profile.GetProfileResponse - 20, // 42: org.signal.chat.profile.Profile.GetAvatarCredentials:output_type -> org.signal.chat.profile.GetAvatarCredentialsResponse - 14, // 43: org.signal.chat.profile.ProfileAnonymous.GetProfile:output_type -> org.signal.chat.profile.GetProfileAnonymousResponse - 18, // 44: org.signal.chat.profile.ProfileAnonymous.GetExpiringProfileKeyCredential:output_type -> org.signal.chat.profile.GetExpiringProfileKeyCredentialAnonymousResponse - 22, // 45: org.signal.chat.profile.ProfileAnonymous.GetAvatarUploadForm:output_type -> org.signal.chat.profile.GetAvatarUploadFormResponse - 24, // 46: org.signal.chat.profile.ProfileAnonymous.ExtendAvatarTTL:output_type -> org.signal.chat.profile.ExtendAvatarTTLResponse - 26, // 47: org.signal.chat.profile.ProfileAnonymous.DeleteAvatar:output_type -> org.signal.chat.profile.DeleteAvatarResponse - 40, // [40:48] is the sub-list for method output_type - 32, // [32:40] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_profile_proto_init() } -func file_org_signal_chat_profile_proto_init() { - if File_org_signal_chat_profile_proto != nil { - return - } - file_org_signal_chat_profile_proto_msgTypes[4].OneofWrappers = []any{} - file_org_signal_chat_profile_proto_msgTypes[5].OneofWrappers = []any{ - (*SetProfileResponse_Result)(nil), - (*SetProfileResponse_ExpectedDataWriteConflict)(nil), - (*SetProfileResponse_PaymentsForbiddenInRegion)(nil), - (*SetProfileResponse_ExpectedVersionWriteConflict)(nil), - (*SetProfileResponse_ProfilesV2CapabilityRequired)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[7].OneofWrappers = []any{ - (*GetProfileAnonymousRequest_UnidentifiedAccessKey)(nil), - (*GetProfileAnonymousRequest_GroupSendToken)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[11].OneofWrappers = []any{ - (*GetProfileResponse_Profile)(nil), - (*GetProfileResponse_EtagMatched)(nil), - (*GetProfileResponse_NotFound)(nil), - (*GetProfileResponse_LegacyProfile)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[12].OneofWrappers = []any{ - (*GetProfileAnonymousResponse_Profile)(nil), - (*GetProfileAnonymousResponse_EtagMatched)(nil), - (*GetProfileAnonymousResponse_NotFound)(nil), - (*GetProfileAnonymousResponse_FailedUnidentifiedAuthorization)(nil), - (*GetProfileAnonymousResponse_ProfileV1)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[16].OneofWrappers = []any{ - (*GetExpiringProfileKeyCredentialAnonymousResponse_Result)(nil), - (*GetExpiringProfileKeyCredentialAnonymousResponse_NotFound)(nil), - (*GetExpiringProfileKeyCredentialAnonymousResponse_FailedUnidentifiedAuthorization)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[18].OneofWrappers = []any{ - (*GetAvatarCredentialsResponse_AvatarCredentials)(nil), - (*GetAvatarCredentialsResponse_MissingZkCredentialKey)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[20].OneofWrappers = []any{ - (*GetAvatarUploadFormResponse_AvatarUploadForm)(nil), - (*GetAvatarUploadFormResponse_InvalidCredentialsPresentation)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[22].OneofWrappers = []any{ - (*ExtendAvatarTTLResponse_Path)(nil), - (*ExtendAvatarTTLResponse_InvalidCredentialsPresentation)(nil), - (*ExtendAvatarTTLResponse_NotFound)(nil), - } - file_org_signal_chat_profile_proto_msgTypes[24].OneofWrappers = []any{ - (*DeleteAvatarResponse_Success)(nil), - (*DeleteAvatarResponse_InvalidCredentialsPresentation)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_profile_proto_rawDesc), len(file_org_signal_chat_profile_proto_rawDesc)), - NumEnums: 2, - NumMessages: 25, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_org_signal_chat_profile_proto_goTypes, - DependencyIndexes: file_org_signal_chat_profile_proto_depIdxs, - EnumInfos: file_org_signal_chat_profile_proto_enumTypes, - MessageInfos: file_org_signal_chat_profile_proto_msgTypes, - }.Build() - File_org_signal_chat_profile_proto = out.File - file_org_signal_chat_profile_proto_goTypes = nil - file_org_signal_chat_profile_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/profile/profile_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/profile/profile_grpc.pb.go deleted file mode 100644 index f7be155..0000000 --- a/pkg/signalmeow/protobuf/rpc/profile/profile_grpc.pb.go +++ /dev/null @@ -1,513 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/profile.proto - -package profile - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Profile_SetProfile_FullMethodName = "/org.signal.chat.profile.Profile/SetProfile" - Profile_GetProfile_FullMethodName = "/org.signal.chat.profile.Profile/GetProfile" - Profile_GetAvatarCredentials_FullMethodName = "/org.signal.chat.profile.Profile/GetAvatarCredentials" -) - -// ProfileClient is the client API for Profile service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with profiles and profile-related data. -type ProfileClient interface { - // Sets profile data and, if needed, returns credentials used by clients to upload a v1 avatar. - SetProfile(ctx context.Context, in *SetProfileRequest, opts ...grpc.CallOption) (*SetProfileResponse, error) - // Retrieves profile data. Callers with an unidentified access key for the account - // should use the version of this method in `ProfileAnonymous` instead. - GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error) - // Returns anonymous credentials that may be presented with avatar operations in ProfilesAnonymous - // - // Note: `Accounts.SetZkCredentialKey` is a pre-requisite for this RPC - GetAvatarCredentials(ctx context.Context, in *GetAvatarCredentialsRequest, opts ...grpc.CallOption) (*GetAvatarCredentialsResponse, error) -} - -type profileClient struct { - cc grpc.ClientConnInterface -} - -func NewProfileClient(cc grpc.ClientConnInterface) ProfileClient { - return &profileClient{cc} -} - -func (c *profileClient) SetProfile(ctx context.Context, in *SetProfileRequest, opts ...grpc.CallOption) (*SetProfileResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetProfileResponse) - err := c.cc.Invoke(ctx, Profile_SetProfile_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *profileClient) GetProfile(ctx context.Context, in *GetProfileRequest, opts ...grpc.CallOption) (*GetProfileResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetProfileResponse) - err := c.cc.Invoke(ctx, Profile_GetProfile_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *profileClient) GetAvatarCredentials(ctx context.Context, in *GetAvatarCredentialsRequest, opts ...grpc.CallOption) (*GetAvatarCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetAvatarCredentialsResponse) - err := c.cc.Invoke(ctx, Profile_GetAvatarCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ProfileServer is the server API for Profile service. -// All implementations must embed UnimplementedProfileServer -// for forward compatibility. -// -// Provides methods for working with profiles and profile-related data. -type ProfileServer interface { - // Sets profile data and, if needed, returns credentials used by clients to upload a v1 avatar. - SetProfile(context.Context, *SetProfileRequest) (*SetProfileResponse, error) - // Retrieves profile data. Callers with an unidentified access key for the account - // should use the version of this method in `ProfileAnonymous` instead. - GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error) - // Returns anonymous credentials that may be presented with avatar operations in ProfilesAnonymous - // - // Note: `Accounts.SetZkCredentialKey` is a pre-requisite for this RPC - GetAvatarCredentials(context.Context, *GetAvatarCredentialsRequest) (*GetAvatarCredentialsResponse, error) - mustEmbedUnimplementedProfileServer() -} - -// UnimplementedProfileServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedProfileServer struct{} - -func (UnimplementedProfileServer) SetProfile(context.Context, *SetProfileRequest) (*SetProfileResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetProfile not implemented") -} -func (UnimplementedProfileServer) GetProfile(context.Context, *GetProfileRequest) (*GetProfileResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented") -} -func (UnimplementedProfileServer) GetAvatarCredentials(context.Context, *GetAvatarCredentialsRequest) (*GetAvatarCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetAvatarCredentials not implemented") -} -func (UnimplementedProfileServer) mustEmbedUnimplementedProfileServer() {} -func (UnimplementedProfileServer) testEmbeddedByValue() {} - -// UnsafeProfileServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ProfileServer will -// result in compilation errors. -type UnsafeProfileServer interface { - mustEmbedUnimplementedProfileServer() -} - -func RegisterProfileServer(s grpc.ServiceRegistrar, srv ProfileServer) { - // If the following call panics, it indicates UnimplementedProfileServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Profile_ServiceDesc, srv) -} - -func _Profile_SetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetProfileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileServer).SetProfile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Profile_SetProfile_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileServer).SetProfile(ctx, req.(*SetProfileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Profile_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProfileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileServer).GetProfile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Profile_GetProfile_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileServer).GetProfile(ctx, req.(*GetProfileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Profile_GetAvatarCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAvatarCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileServer).GetAvatarCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Profile_GetAvatarCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileServer).GetAvatarCredentials(ctx, req.(*GetAvatarCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Profile_ServiceDesc is the grpc.ServiceDesc for Profile service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Profile_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.profile.Profile", - HandlerType: (*ProfileServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SetProfile", - Handler: _Profile_SetProfile_Handler, - }, - { - MethodName: "GetProfile", - Handler: _Profile_GetProfile_Handler, - }, - { - MethodName: "GetAvatarCredentials", - Handler: _Profile_GetAvatarCredentials_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/profile.proto", -} - -const ( - ProfileAnonymous_GetProfile_FullMethodName = "/org.signal.chat.profile.ProfileAnonymous/GetProfile" - ProfileAnonymous_GetExpiringProfileKeyCredential_FullMethodName = "/org.signal.chat.profile.ProfileAnonymous/GetExpiringProfileKeyCredential" - ProfileAnonymous_GetAvatarUploadForm_FullMethodName = "/org.signal.chat.profile.ProfileAnonymous/GetAvatarUploadForm" - ProfileAnonymous_ExtendAvatarTTL_FullMethodName = "/org.signal.chat.profile.ProfileAnonymous/ExtendAvatarTTL" - ProfileAnonymous_DeleteAvatar_FullMethodName = "/org.signal.chat.profile.ProfileAnonymous/DeleteAvatar" -) - -// ProfileAnonymousClient is the client API for ProfileAnonymous service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides methods for working with profiles and profile-related data using "unidentified access" -// credentials. Callers must not submit any self-identifying credentials -// when calling methods in this service and must instead present the targeted account's -// unidentified access key as an anonymous authentication mechanism. Callers -// without an unidentified access key should use the equivalent, authenticated -// methods in `Profile` instead. -type ProfileAnonymousClient interface { - // Retrieves profile data. - GetProfile(ctx context.Context, in *GetProfileAnonymousRequest, opts ...grpc.CallOption) (*GetProfileAnonymousResponse, error) - // Retrieves a profile key credential. - GetExpiringProfileKeyCredential(ctx context.Context, in *GetExpiringProfileKeyCredentialAnonymousRequest, opts ...grpc.CallOption) (*GetExpiringProfileKeyCredentialAnonymousResponse, error) - // Returns credentials to upload a v2 avatar. After uploading the avatar, the client - // must call SetProfile with the new avatar URL in the encrypted `data`. - // - // Because avatars are uploaded anonymously, they have an expiration equal to the - // idle account expiration. Clients must periodically (recommended: every 90 days) - // call ExtendAvatarTTL to extend the TTl. - // - // Note: any existing avatar associated with these credentials will be deleted immediately - GetAvatarUploadForm(ctx context.Context, in *GetAvatarUploadFormRequest, opts ...grpc.CallOption) (*GetAvatarUploadFormResponse, error) - // Extends the TTL of the avatar currently associated with the request’s avatar auth credential - ExtendAvatarTTL(ctx context.Context, in *ExtendAvatarTTLRequest, opts ...grpc.CallOption) (*ExtendAvatarTTLResponse, error) - // Deletes the avatar currently associated with the request’s avatar auth credential. - // - // Clients must also call SetProfile to remove the avatar from the encrypted `data`. - DeleteAvatar(ctx context.Context, in *DeleteAvatarRequest, opts ...grpc.CallOption) (*DeleteAvatarResponse, error) -} - -type profileAnonymousClient struct { - cc grpc.ClientConnInterface -} - -func NewProfileAnonymousClient(cc grpc.ClientConnInterface) ProfileAnonymousClient { - return &profileAnonymousClient{cc} -} - -func (c *profileAnonymousClient) GetProfile(ctx context.Context, in *GetProfileAnonymousRequest, opts ...grpc.CallOption) (*GetProfileAnonymousResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetProfileAnonymousResponse) - err := c.cc.Invoke(ctx, ProfileAnonymous_GetProfile_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *profileAnonymousClient) GetExpiringProfileKeyCredential(ctx context.Context, in *GetExpiringProfileKeyCredentialAnonymousRequest, opts ...grpc.CallOption) (*GetExpiringProfileKeyCredentialAnonymousResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetExpiringProfileKeyCredentialAnonymousResponse) - err := c.cc.Invoke(ctx, ProfileAnonymous_GetExpiringProfileKeyCredential_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *profileAnonymousClient) GetAvatarUploadForm(ctx context.Context, in *GetAvatarUploadFormRequest, opts ...grpc.CallOption) (*GetAvatarUploadFormResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetAvatarUploadFormResponse) - err := c.cc.Invoke(ctx, ProfileAnonymous_GetAvatarUploadForm_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *profileAnonymousClient) ExtendAvatarTTL(ctx context.Context, in *ExtendAvatarTTLRequest, opts ...grpc.CallOption) (*ExtendAvatarTTLResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ExtendAvatarTTLResponse) - err := c.cc.Invoke(ctx, ProfileAnonymous_ExtendAvatarTTL_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *profileAnonymousClient) DeleteAvatar(ctx context.Context, in *DeleteAvatarRequest, opts ...grpc.CallOption) (*DeleteAvatarResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteAvatarResponse) - err := c.cc.Invoke(ctx, ProfileAnonymous_DeleteAvatar_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ProfileAnonymousServer is the server API for ProfileAnonymous service. -// All implementations must embed UnimplementedProfileAnonymousServer -// for forward compatibility. -// -// Provides methods for working with profiles and profile-related data using "unidentified access" -// credentials. Callers must not submit any self-identifying credentials -// when calling methods in this service and must instead present the targeted account's -// unidentified access key as an anonymous authentication mechanism. Callers -// without an unidentified access key should use the equivalent, authenticated -// methods in `Profile` instead. -type ProfileAnonymousServer interface { - // Retrieves profile data. - GetProfile(context.Context, *GetProfileAnonymousRequest) (*GetProfileAnonymousResponse, error) - // Retrieves a profile key credential. - GetExpiringProfileKeyCredential(context.Context, *GetExpiringProfileKeyCredentialAnonymousRequest) (*GetExpiringProfileKeyCredentialAnonymousResponse, error) - // Returns credentials to upload a v2 avatar. After uploading the avatar, the client - // must call SetProfile with the new avatar URL in the encrypted `data`. - // - // Because avatars are uploaded anonymously, they have an expiration equal to the - // idle account expiration. Clients must periodically (recommended: every 90 days) - // call ExtendAvatarTTL to extend the TTl. - // - // Note: any existing avatar associated with these credentials will be deleted immediately - GetAvatarUploadForm(context.Context, *GetAvatarUploadFormRequest) (*GetAvatarUploadFormResponse, error) - // Extends the TTL of the avatar currently associated with the request’s avatar auth credential - ExtendAvatarTTL(context.Context, *ExtendAvatarTTLRequest) (*ExtendAvatarTTLResponse, error) - // Deletes the avatar currently associated with the request’s avatar auth credential. - // - // Clients must also call SetProfile to remove the avatar from the encrypted `data`. - DeleteAvatar(context.Context, *DeleteAvatarRequest) (*DeleteAvatarResponse, error) - mustEmbedUnimplementedProfileAnonymousServer() -} - -// UnimplementedProfileAnonymousServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedProfileAnonymousServer struct{} - -func (UnimplementedProfileAnonymousServer) GetProfile(context.Context, *GetProfileAnonymousRequest) (*GetProfileAnonymousResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetProfile not implemented") -} -func (UnimplementedProfileAnonymousServer) GetExpiringProfileKeyCredential(context.Context, *GetExpiringProfileKeyCredentialAnonymousRequest) (*GetExpiringProfileKeyCredentialAnonymousResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetExpiringProfileKeyCredential not implemented") -} -func (UnimplementedProfileAnonymousServer) GetAvatarUploadForm(context.Context, *GetAvatarUploadFormRequest) (*GetAvatarUploadFormResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetAvatarUploadForm not implemented") -} -func (UnimplementedProfileAnonymousServer) ExtendAvatarTTL(context.Context, *ExtendAvatarTTLRequest) (*ExtendAvatarTTLResponse, error) { - return nil, status.Error(codes.Unimplemented, "method ExtendAvatarTTL not implemented") -} -func (UnimplementedProfileAnonymousServer) DeleteAvatar(context.Context, *DeleteAvatarRequest) (*DeleteAvatarResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DeleteAvatar not implemented") -} -func (UnimplementedProfileAnonymousServer) mustEmbedUnimplementedProfileAnonymousServer() {} -func (UnimplementedProfileAnonymousServer) testEmbeddedByValue() {} - -// UnsafeProfileAnonymousServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ProfileAnonymousServer will -// result in compilation errors. -type UnsafeProfileAnonymousServer interface { - mustEmbedUnimplementedProfileAnonymousServer() -} - -func RegisterProfileAnonymousServer(s grpc.ServiceRegistrar, srv ProfileAnonymousServer) { - // If the following call panics, it indicates UnimplementedProfileAnonymousServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&ProfileAnonymous_ServiceDesc, srv) -} - -func _ProfileAnonymous_GetProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProfileAnonymousRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileAnonymousServer).GetProfile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ProfileAnonymous_GetProfile_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileAnonymousServer).GetProfile(ctx, req.(*GetProfileAnonymousRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ProfileAnonymous_GetExpiringProfileKeyCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExpiringProfileKeyCredentialAnonymousRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileAnonymousServer).GetExpiringProfileKeyCredential(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ProfileAnonymous_GetExpiringProfileKeyCredential_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileAnonymousServer).GetExpiringProfileKeyCredential(ctx, req.(*GetExpiringProfileKeyCredentialAnonymousRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ProfileAnonymous_GetAvatarUploadForm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetAvatarUploadFormRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileAnonymousServer).GetAvatarUploadForm(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ProfileAnonymous_GetAvatarUploadForm_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileAnonymousServer).GetAvatarUploadForm(ctx, req.(*GetAvatarUploadFormRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ProfileAnonymous_ExtendAvatarTTL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExtendAvatarTTLRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileAnonymousServer).ExtendAvatarTTL(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ProfileAnonymous_ExtendAvatarTTL_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileAnonymousServer).ExtendAvatarTTL(ctx, req.(*ExtendAvatarTTLRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ProfileAnonymous_DeleteAvatar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteAvatarRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ProfileAnonymousServer).DeleteAvatar(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ProfileAnonymous_DeleteAvatar_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ProfileAnonymousServer).DeleteAvatar(ctx, req.(*DeleteAvatarRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ProfileAnonymous_ServiceDesc is the grpc.ServiceDesc for ProfileAnonymous service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ProfileAnonymous_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.profile.ProfileAnonymous", - HandlerType: (*ProfileAnonymousServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetProfile", - Handler: _ProfileAnonymous_GetProfile_Handler, - }, - { - MethodName: "GetExpiringProfileKeyCredential", - Handler: _ProfileAnonymous_GetExpiringProfileKeyCredential_Handler, - }, - { - MethodName: "GetAvatarUploadForm", - Handler: _ProfileAnonymous_GetAvatarUploadForm_Handler, - }, - { - MethodName: "ExtendAvatarTTL", - Handler: _ProfileAnonymous_ExtendAvatarTTL_Handler, - }, - { - MethodName: "DeleteAvatar", - Handler: _ProfileAnonymous_DeleteAvatar_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/profile.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/remote_configuration/remote_configuration.pb.go b/pkg/signalmeow/protobuf/rpc/remote_configuration/remote_configuration.pb.go deleted file mode 100644 index 5747e77..0000000 --- a/pkg/signalmeow/protobuf/rpc/remote_configuration/remote_configuration.pb.go +++ /dev/null @@ -1,609 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/remote_configuration.proto - -package remote_configuration - -import ( - common "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetConfigurationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If present, the etag from a prior GetConfigurationResponse. If the - // provided etag matches the current configuration etag, the server may elide - // the configuration response. - Etag []byte `protobuf:"bytes,1,opt,name=etag,proto3" json:"etag,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetConfigurationRequest) Reset() { - *x = GetConfigurationRequest{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetConfigurationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetConfigurationRequest) ProtoMessage() {} - -func (x *GetConfigurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[0] - 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 GetConfigurationRequest.ProtoReflect.Descriptor instead. -func (*GetConfigurationRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{0} -} - -func (x *GetConfigurationRequest) GetEtag() []byte { - if x != nil { - return x.Etag - } - return nil -} - -type GetConfigurationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetConfigurationResponse_TaggedConfiguration - // *GetConfigurationResponse_EtagMatched - Response isGetConfigurationResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetConfigurationResponse) Reset() { - *x = GetConfigurationResponse{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetConfigurationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetConfigurationResponse) ProtoMessage() {} - -func (x *GetConfigurationResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[1] - 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 GetConfigurationResponse.ProtoReflect.Descriptor instead. -func (*GetConfigurationResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{1} -} - -func (x *GetConfigurationResponse) GetResponse() isGetConfigurationResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetConfigurationResponse) GetTaggedConfiguration() *TaggedConfiguration { - if x != nil { - if x, ok := x.Response.(*GetConfigurationResponse_TaggedConfiguration); ok { - return x.TaggedConfiguration - } - } - return nil -} - -func (x *GetConfigurationResponse) GetEtagMatched() bool { - if x != nil { - if x, ok := x.Response.(*GetConfigurationResponse_EtagMatched); ok { - return x.EtagMatched - } - } - return false -} - -type isGetConfigurationResponse_Response interface { - isGetConfigurationResponse_Response() -} - -type GetConfigurationResponse_TaggedConfiguration struct { - // The full configuration and corresponding etag. - TaggedConfiguration *TaggedConfiguration `protobuf:"bytes,1,opt,name=tagged_configuration,json=taggedConfiguration,proto3,oneof"` -} - -type GetConfigurationResponse_EtagMatched struct { - // The etag in the request matched the current configuration etag. - EtagMatched bool `protobuf:"varint,2,opt,name=etag_matched,json=etagMatched,proto3,oneof"` -} - -func (*GetConfigurationResponse_TaggedConfiguration) isGetConfigurationResponse_Response() {} - -func (*GetConfigurationResponse_EtagMatched) isGetConfigurationResponse_Response() {} - -type Configuration struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A map of namespaced configuration keys to their resolved values. All - // configuration values are represented as strings. boolean values are - // represented as the strings "true" or "false". - Configuration map[string]string `protobuf:"bytes,1,rep,name=configuration,proto3" json:"configuration,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Configuration) Reset() { - *x = Configuration{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Configuration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Configuration) ProtoMessage() {} - -func (x *Configuration) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[2] - 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 Configuration.ProtoReflect.Descriptor instead. -func (*Configuration) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{2} -} - -func (x *Configuration) GetConfiguration() map[string]string { - if x != nil { - return x.Configuration - } - return nil -} - -type TaggedConfiguration struct { - state protoimpl.MessageState `protogen:"open.v1"` - Configuration *Configuration `protobuf:"bytes,1,opt,name=configuration,proto3" json:"configuration,omitempty"` - // An entity tag for `configuration`. This may be supplied in a - // subsequent request to optimize bandwidth when the configuration has not - // changed. - Etag []byte `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TaggedConfiguration) Reset() { - *x = TaggedConfiguration{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TaggedConfiguration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TaggedConfiguration) ProtoMessage() {} - -func (x *TaggedConfiguration) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[3] - 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 TaggedConfiguration.ProtoReflect.Descriptor instead. -func (*TaggedConfiguration) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{3} -} - -func (x *TaggedConfiguration) GetConfiguration() *Configuration { - if x != nil { - return x.Configuration - } - return nil -} - -func (x *TaggedConfiguration) GetEtag() []byte { - if x != nil { - return x.Etag - } - return nil -} - -type GetBadgesRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // If present, the etag from a prior GetBadgesResponse. If the provided etag - // matches the current badge etag, the server may elide the badge response. - Etag []byte `protobuf:"bytes,1,opt,name=etag,proto3" json:"etag,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBadgesRequest) Reset() { - *x = GetBadgesRequest{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBadgesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBadgesRequest) ProtoMessage() {} - -func (x *GetBadgesRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[4] - 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 GetBadgesRequest.ProtoReflect.Descriptor instead. -func (*GetBadgesRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{4} -} - -func (x *GetBadgesRequest) GetEtag() []byte { - if x != nil { - return x.Etag - } - return nil -} - -type GetBadgesResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetBadgesResponse_TaggedBadges - // *GetBadgesResponse_EtagMatched - Response isGetBadgesResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBadgesResponse) Reset() { - *x = GetBadgesResponse{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBadgesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBadgesResponse) ProtoMessage() {} - -func (x *GetBadgesResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[5] - 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 GetBadgesResponse.ProtoReflect.Descriptor instead. -func (*GetBadgesResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{5} -} - -func (x *GetBadgesResponse) GetResponse() isGetBadgesResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetBadgesResponse) GetTaggedBadges() *TaggedBadges { - if x != nil { - if x, ok := x.Response.(*GetBadgesResponse_TaggedBadges); ok { - return x.TaggedBadges - } - } - return nil -} - -func (x *GetBadgesResponse) GetEtagMatched() bool { - if x != nil { - if x, ok := x.Response.(*GetBadgesResponse_EtagMatched); ok { - return x.EtagMatched - } - } - return false -} - -type isGetBadgesResponse_Response interface { - isGetBadgesResponse_Response() -} - -type GetBadgesResponse_TaggedBadges struct { - // The full set of badges and corresponding etag. - TaggedBadges *TaggedBadges `protobuf:"bytes,1,opt,name=tagged_badges,json=taggedBadges,proto3,oneof"` -} - -type GetBadgesResponse_EtagMatched struct { - // The etag in the request matched the current badge etag. - EtagMatched bool `protobuf:"varint,2,opt,name=etag_matched,json=etagMatched,proto3,oneof"` -} - -func (*GetBadgesResponse_TaggedBadges) isGetBadgesResponse_Response() {} - -func (*GetBadgesResponse_EtagMatched) isGetBadgesResponse_Response() {} - -type Badges struct { - state protoimpl.MessageState `protogen:"open.v1"` - // A map of badge ID to the detailed information for that badge. - Badges map[string]*common.Badge `protobuf:"bytes,1,rep,name=badges,proto3" json:"badges,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Badges) Reset() { - *x = Badges{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Badges) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Badges) ProtoMessage() {} - -func (x *Badges) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[6] - 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 Badges.ProtoReflect.Descriptor instead. -func (*Badges) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{6} -} - -func (x *Badges) GetBadges() map[string]*common.Badge { - if x != nil { - return x.Badges - } - return nil -} - -type TaggedBadges struct { - state protoimpl.MessageState `protogen:"open.v1"` - Badges *Badges `protobuf:"bytes,1,opt,name=badges,proto3" json:"badges,omitempty"` - // An entity tag for `badges`. This may be supplied in a subsequent request - // to optimize bandwidth when the set of badges has not changed. - Etag []byte `protobuf:"bytes,2,opt,name=etag,proto3" json:"etag,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TaggedBadges) Reset() { - *x = TaggedBadges{} - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TaggedBadges) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TaggedBadges) ProtoMessage() {} - -func (x *TaggedBadges) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_remote_configuration_proto_msgTypes[7] - 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 TaggedBadges.ProtoReflect.Descriptor instead. -func (*TaggedBadges) Descriptor() ([]byte, []int) { - return file_org_signal_chat_remote_configuration_proto_rawDescGZIP(), []int{7} -} - -func (x *TaggedBadges) GetBadges() *Badges { - if x != nil { - return x.Badges - } - return nil -} - -func (x *TaggedBadges) GetEtag() []byte { - if x != nil { - return x.Etag - } - return nil -} - -var File_org_signal_chat_remote_configuration_proto protoreflect.FileDescriptor - -const file_org_signal_chat_remote_configuration_proto_rawDesc = "" + - "\n" + - "*org/signal/chat/remote_configuration.proto\x12#org.signal.chat.remoteconfiguration\x1a\x1corg/signal/chat/common.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x19org/signal/chat/tag.proto\"-\n" + - "\x17GetConfigurationRequest\x12\x12\n" + - "\x04etag\x18\x01 \x01(\fR\x04etag\"\xca\x01\n" + - "\x18GetConfigurationResponse\x12m\n" + - "\x14tagged_configuration\x18\x01 \x01(\v28.org.signal.chat.remoteconfiguration.TaggedConfigurationH\x00R\x13taggedConfiguration\x123\n" + - "\fetag_matched\x18\x02 \x01(\bB\x0e\xc2\xd5\"\n" + - "etag_matchH\x00R\vetagMatchedB\n" + - "\n" + - "\bresponse\"\xbe\x01\n" + - "\rConfiguration\x12k\n" + - "\rconfiguration\x18\x01 \x03(\v2E.org.signal.chat.remoteconfiguration.Configuration.ConfigurationEntryR\rconfiguration\x1a@\n" + - "\x12ConfigurationEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x83\x01\n" + - "\x13TaggedConfiguration\x12X\n" + - "\rconfiguration\x18\x01 \x01(\v22.org.signal.chat.remoteconfiguration.ConfigurationR\rconfiguration\x12\x12\n" + - "\x04etag\x18\x02 \x01(\fR\x04etag\"&\n" + - "\x10GetBadgesRequest\x12\x12\n" + - "\x04etag\x18\x01 \x01(\fR\x04etag\"\xae\x01\n" + - "\x11GetBadgesResponse\x12X\n" + - "\rtagged_badges\x18\x01 \x01(\v21.org.signal.chat.remoteconfiguration.TaggedBadgesH\x00R\ftaggedBadges\x123\n" + - "\fetag_matched\x18\x02 \x01(\bB\x0e\xc2\xd5\"\n" + - "etag_matchH\x00R\vetagMatchedB\n" + - "\n" + - "\bresponse\"\xb3\x01\n" + - "\x06Badges\x12O\n" + - "\x06badges\x18\x01 \x03(\v27.org.signal.chat.remoteconfiguration.Badges.BadgesEntryR\x06badges\x1aX\n" + - "\vBadgesEntry\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x123\n" + - "\x05value\x18\x02 \x01(\v2\x1d.org.signal.chat.common.BadgeR\x05value:\x028\x01\"g\n" + - "\fTaggedBadges\x12C\n" + - "\x06badges\x18\x01 \x01(\v2+.org.signal.chat.remoteconfiguration.BadgesR\x06badges\x12\x12\n" + - "\x04etag\x18\x02 \x01(\fR\x04etag2\xad\x02\n" + - "\x13RemoteConfiguration\x12\x91\x01\n" + - "\x10GetConfiguration\x12<.org.signal.chat.remoteconfiguration.GetConfigurationRequest\x1a=.org.signal.chat.remoteconfiguration.GetConfigurationResponse\"\x00\x12|\n" + - "\tGetBadges\x125.org.signal.chat.remoteconfiguration.GetBadgesRequest\x1a6.org.signal.chat.remoteconfiguration.GetBadgesResponse\"\x00\x1a\x04\xc8\xd5\"\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_remote_configuration_proto_rawDescOnce sync.Once - file_org_signal_chat_remote_configuration_proto_rawDescData []byte -) - -func file_org_signal_chat_remote_configuration_proto_rawDescGZIP() []byte { - file_org_signal_chat_remote_configuration_proto_rawDescOnce.Do(func() { - file_org_signal_chat_remote_configuration_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_remote_configuration_proto_rawDesc), len(file_org_signal_chat_remote_configuration_proto_rawDesc))) - }) - return file_org_signal_chat_remote_configuration_proto_rawDescData -} - -var file_org_signal_chat_remote_configuration_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_org_signal_chat_remote_configuration_proto_goTypes = []any{ - (*GetConfigurationRequest)(nil), // 0: org.signal.chat.remoteconfiguration.GetConfigurationRequest - (*GetConfigurationResponse)(nil), // 1: org.signal.chat.remoteconfiguration.GetConfigurationResponse - (*Configuration)(nil), // 2: org.signal.chat.remoteconfiguration.Configuration - (*TaggedConfiguration)(nil), // 3: org.signal.chat.remoteconfiguration.TaggedConfiguration - (*GetBadgesRequest)(nil), // 4: org.signal.chat.remoteconfiguration.GetBadgesRequest - (*GetBadgesResponse)(nil), // 5: org.signal.chat.remoteconfiguration.GetBadgesResponse - (*Badges)(nil), // 6: org.signal.chat.remoteconfiguration.Badges - (*TaggedBadges)(nil), // 7: org.signal.chat.remoteconfiguration.TaggedBadges - nil, // 8: org.signal.chat.remoteconfiguration.Configuration.ConfigurationEntry - nil, // 9: org.signal.chat.remoteconfiguration.Badges.BadgesEntry - (*common.Badge)(nil), // 10: org.signal.chat.common.Badge -} -var file_org_signal_chat_remote_configuration_proto_depIdxs = []int32{ - 3, // 0: org.signal.chat.remoteconfiguration.GetConfigurationResponse.tagged_configuration:type_name -> org.signal.chat.remoteconfiguration.TaggedConfiguration - 8, // 1: org.signal.chat.remoteconfiguration.Configuration.configuration:type_name -> org.signal.chat.remoteconfiguration.Configuration.ConfigurationEntry - 2, // 2: org.signal.chat.remoteconfiguration.TaggedConfiguration.configuration:type_name -> org.signal.chat.remoteconfiguration.Configuration - 7, // 3: org.signal.chat.remoteconfiguration.GetBadgesResponse.tagged_badges:type_name -> org.signal.chat.remoteconfiguration.TaggedBadges - 9, // 4: org.signal.chat.remoteconfiguration.Badges.badges:type_name -> org.signal.chat.remoteconfiguration.Badges.BadgesEntry - 6, // 5: org.signal.chat.remoteconfiguration.TaggedBadges.badges:type_name -> org.signal.chat.remoteconfiguration.Badges - 10, // 6: org.signal.chat.remoteconfiguration.Badges.BadgesEntry.value:type_name -> org.signal.chat.common.Badge - 0, // 7: org.signal.chat.remoteconfiguration.RemoteConfiguration.GetConfiguration:input_type -> org.signal.chat.remoteconfiguration.GetConfigurationRequest - 4, // 8: org.signal.chat.remoteconfiguration.RemoteConfiguration.GetBadges:input_type -> org.signal.chat.remoteconfiguration.GetBadgesRequest - 1, // 9: org.signal.chat.remoteconfiguration.RemoteConfiguration.GetConfiguration:output_type -> org.signal.chat.remoteconfiguration.GetConfigurationResponse - 5, // 10: org.signal.chat.remoteconfiguration.RemoteConfiguration.GetBadges:output_type -> org.signal.chat.remoteconfiguration.GetBadgesResponse - 9, // [9:11] is the sub-list for method output_type - 7, // [7:9] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_remote_configuration_proto_init() } -func file_org_signal_chat_remote_configuration_proto_init() { - if File_org_signal_chat_remote_configuration_proto != nil { - return - } - file_org_signal_chat_remote_configuration_proto_msgTypes[1].OneofWrappers = []any{ - (*GetConfigurationResponse_TaggedConfiguration)(nil), - (*GetConfigurationResponse_EtagMatched)(nil), - } - file_org_signal_chat_remote_configuration_proto_msgTypes[5].OneofWrappers = []any{ - (*GetBadgesResponse_TaggedBadges)(nil), - (*GetBadgesResponse_EtagMatched)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_remote_configuration_proto_rawDesc), len(file_org_signal_chat_remote_configuration_proto_rawDesc)), - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_remote_configuration_proto_goTypes, - DependencyIndexes: file_org_signal_chat_remote_configuration_proto_depIdxs, - MessageInfos: file_org_signal_chat_remote_configuration_proto_msgTypes, - }.Build() - File_org_signal_chat_remote_configuration_proto = out.File - file_org_signal_chat_remote_configuration_proto_goTypes = nil - file_org_signal_chat_remote_configuration_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/remote_configuration/remote_configuration_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/remote_configuration/remote_configuration_grpc.pb.go deleted file mode 100644 index cd8032a..0000000 --- a/pkg/signalmeow/protobuf/rpc/remote_configuration/remote_configuration_grpc.pb.go +++ /dev/null @@ -1,189 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/remote_configuration.proto - -package remote_configuration - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - RemoteConfiguration_GetConfiguration_FullMethodName = "/org.signal.chat.remoteconfiguration.RemoteConfiguration/GetConfiguration" - RemoteConfiguration_GetBadges_FullMethodName = "/org.signal.chat.remoteconfiguration.RemoteConfiguration/GetBadges" -) - -// RemoteConfigurationClient is the client API for RemoteConfiguration service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// Provides remote configuration applicable to the authenticated user -type RemoteConfigurationClient interface { - // Fetches the configuration for the authenticated user. Returned - // values are based on the authenticated account and caller's client platform, - // which is derived from the "User-Agent" header. - GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) - // Returns detailed information for all configured badges, keyed by badge ID. - // - // Badge descriptions may contain localized strings. Callers should set their - // language preferences via an "Accept-Language" header on the request - // https://datatracker.ietf.org/doc/html/rfc3282#section-3 - // - // Callers may cache a badges result for up to 1 day before checking (via - // etag) if there are any new updates. - GetBadges(ctx context.Context, in *GetBadgesRequest, opts ...grpc.CallOption) (*GetBadgesResponse, error) -} - -type remoteConfigurationClient struct { - cc grpc.ClientConnInterface -} - -func NewRemoteConfigurationClient(cc grpc.ClientConnInterface) RemoteConfigurationClient { - return &remoteConfigurationClient{cc} -} - -func (c *remoteConfigurationClient) GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetConfigurationResponse) - err := c.cc.Invoke(ctx, RemoteConfiguration_GetConfiguration_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *remoteConfigurationClient) GetBadges(ctx context.Context, in *GetBadgesRequest, opts ...grpc.CallOption) (*GetBadgesResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBadgesResponse) - err := c.cc.Invoke(ctx, RemoteConfiguration_GetBadges_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RemoteConfigurationServer is the server API for RemoteConfiguration service. -// All implementations must embed UnimplementedRemoteConfigurationServer -// for forward compatibility. -// -// Provides remote configuration applicable to the authenticated user -type RemoteConfigurationServer interface { - // Fetches the configuration for the authenticated user. Returned - // values are based on the authenticated account and caller's client platform, - // which is derived from the "User-Agent" header. - GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) - // Returns detailed information for all configured badges, keyed by badge ID. - // - // Badge descriptions may contain localized strings. Callers should set their - // language preferences via an "Accept-Language" header on the request - // https://datatracker.ietf.org/doc/html/rfc3282#section-3 - // - // Callers may cache a badges result for up to 1 day before checking (via - // etag) if there are any new updates. - GetBadges(context.Context, *GetBadgesRequest) (*GetBadgesResponse, error) - mustEmbedUnimplementedRemoteConfigurationServer() -} - -// UnimplementedRemoteConfigurationServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedRemoteConfigurationServer struct{} - -func (UnimplementedRemoteConfigurationServer) GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetConfiguration not implemented") -} -func (UnimplementedRemoteConfigurationServer) GetBadges(context.Context, *GetBadgesRequest) (*GetBadgesResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetBadges not implemented") -} -func (UnimplementedRemoteConfigurationServer) mustEmbedUnimplementedRemoteConfigurationServer() {} -func (UnimplementedRemoteConfigurationServer) testEmbeddedByValue() {} - -// UnsafeRemoteConfigurationServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RemoteConfigurationServer will -// result in compilation errors. -type UnsafeRemoteConfigurationServer interface { - mustEmbedUnimplementedRemoteConfigurationServer() -} - -func RegisterRemoteConfigurationServer(s grpc.ServiceRegistrar, srv RemoteConfigurationServer) { - // If the following call panics, it indicates UnimplementedRemoteConfigurationServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&RemoteConfiguration_ServiceDesc, srv) -} - -func _RemoteConfiguration_GetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RemoteConfigurationServer).GetConfiguration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RemoteConfiguration_GetConfiguration_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteConfigurationServer).GetConfiguration(ctx, req.(*GetConfigurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RemoteConfiguration_GetBadges_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBadgesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RemoteConfigurationServer).GetBadges(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RemoteConfiguration_GetBadges_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RemoteConfigurationServer).GetBadges(ctx, req.(*GetBadgesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// RemoteConfiguration_ServiceDesc is the grpc.ServiceDesc for RemoteConfiguration service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var RemoteConfiguration_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.remoteconfiguration.RemoteConfiguration", - HandlerType: (*RemoteConfigurationServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetConfiguration", - Handler: _RemoteConfiguration_GetConfiguration_Handler, - }, - { - MethodName: "GetBadges", - Handler: _RemoteConfiguration_GetBadges_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/remote_configuration.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/require/require.pb.go b/pkg/signalmeow/protobuf/rpc/require/require.pb.go deleted file mode 100644 index 21b39f0..0000000 --- a/pkg/signalmeow/protobuf/rpc/require/require.pb.go +++ /dev/null @@ -1,765 +0,0 @@ -// -// Copyright 2023 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/require.proto - -package require - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Auth int32 - -const ( - Auth_AUTH_UNSPECIFIED Auth = 0 - Auth_AUTH_ONLY_AUTHENTICATED Auth = 1 - Auth_AUTH_ONLY_ANONYMOUS Auth = 2 -) - -// Enum value maps for Auth. -var ( - Auth_name = map[int32]string{ - 0: "AUTH_UNSPECIFIED", - 1: "AUTH_ONLY_AUTHENTICATED", - 2: "AUTH_ONLY_ANONYMOUS", - } - Auth_value = map[string]int32{ - "AUTH_UNSPECIFIED": 0, - "AUTH_ONLY_AUTHENTICATED": 1, - "AUTH_ONLY_ANONYMOUS": 2, - } -) - -func (x Auth) Enum() *Auth { - p := new(Auth) - *p = x - return p -} - -func (x Auth) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Auth) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_require_proto_enumTypes[0].Descriptor() -} - -func (Auth) Type() protoreflect.EnumType { - return &file_org_signal_chat_require_proto_enumTypes[0] -} - -func (x Auth) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Auth.Descriptor instead. -func (Auth) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_require_proto_rawDescGZIP(), []int{0} -} - -// This is duplicated from common.proto because: -// -// 1. importing would be a circular dependency -// 2. the canonical declaration belongs there -type IdentityType int32 - -const ( - IdentityType_IDENTITY_TYPE_UNSPECIFIED IdentityType = 0 - IdentityType_IDENTITY_TYPE_ACI IdentityType = 1 - IdentityType_IDENTITY_TYPE_PNI IdentityType = 2 -) - -// Enum value maps for IdentityType. -var ( - IdentityType_name = map[int32]string{ - 0: "IDENTITY_TYPE_UNSPECIFIED", - 1: "IDENTITY_TYPE_ACI", - 2: "IDENTITY_TYPE_PNI", - } - IdentityType_value = map[string]int32{ - "IDENTITY_TYPE_UNSPECIFIED": 0, - "IDENTITY_TYPE_ACI": 1, - "IDENTITY_TYPE_PNI": 2, - } -) - -func (x IdentityType) Enum() *IdentityType { - p := new(IdentityType) - *p = x - return p -} - -func (x IdentityType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (IdentityType) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_require_proto_enumTypes[1].Descriptor() -} - -func (IdentityType) Type() protoreflect.EnumType { - return &file_org_signal_chat_require_proto_enumTypes[1] -} - -func (x IdentityType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use IdentityType.Descriptor instead. -func (IdentityType) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_require_proto_rawDescGZIP(), []int{1} -} - -type ElementConstraint struct { - state protoimpl.MessageState `protogen:"open.v1"` - NonEmpty *bool `protobuf:"varint,1,opt,name=nonEmpty,proto3,oneof" json:"nonEmpty,omitempty"` - Size *SizeConstraint `protobuf:"bytes,2,opt,name=size,proto3,oneof" json:"size,omitempty"` - ExactlySize []uint32 `protobuf:"varint,3,rep,packed,name=exactlySize,proto3" json:"exactlySize,omitempty"` - E164 *bool `protobuf:"varint,4,opt,name=e164,proto3,oneof" json:"e164,omitempty"` - Base64Url *bool `protobuf:"varint,5,opt,name=base64url,proto3,oneof" json:"base64url,omitempty"` - Range *ValueRangeConstraint `protobuf:"bytes,6,opt,name=range,proto3,oneof" json:"range,omitempty"` - IdentityType *IdentityType `protobuf:"varint,7,opt,name=identityType,proto3,enum=org.signal.chat.require.IdentityType,oneof" json:"identityType,omitempty"` - Specified *bool `protobuf:"varint,8,opt,name=specified,proto3,oneof" json:"specified,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ElementConstraint) Reset() { - *x = ElementConstraint{} - mi := &file_org_signal_chat_require_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ElementConstraint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ElementConstraint) ProtoMessage() {} - -func (x *ElementConstraint) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_require_proto_msgTypes[0] - 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 ElementConstraint.ProtoReflect.Descriptor instead. -func (*ElementConstraint) Descriptor() ([]byte, []int) { - return file_org_signal_chat_require_proto_rawDescGZIP(), []int{0} -} - -func (x *ElementConstraint) GetNonEmpty() bool { - if x != nil && x.NonEmpty != nil { - return *x.NonEmpty - } - return false -} - -func (x *ElementConstraint) GetSize() *SizeConstraint { - if x != nil { - return x.Size - } - return nil -} - -func (x *ElementConstraint) GetExactlySize() []uint32 { - if x != nil { - return x.ExactlySize - } - return nil -} - -func (x *ElementConstraint) GetE164() bool { - if x != nil && x.E164 != nil { - return *x.E164 - } - return false -} - -func (x *ElementConstraint) GetBase64Url() bool { - if x != nil && x.Base64Url != nil { - return *x.Base64Url - } - return false -} - -func (x *ElementConstraint) GetRange() *ValueRangeConstraint { - if x != nil { - return x.Range - } - return nil -} - -func (x *ElementConstraint) GetIdentityType() IdentityType { - if x != nil && x.IdentityType != nil { - return *x.IdentityType - } - return IdentityType_IDENTITY_TYPE_UNSPECIFIED -} - -func (x *ElementConstraint) GetSpecified() bool { - if x != nil && x.Specified != nil { - return *x.Specified - } - return false -} - -type SizeConstraint struct { - state protoimpl.MessageState `protogen:"open.v1"` - Min *uint32 `protobuf:"varint,1,opt,name=min,proto3,oneof" json:"min,omitempty"` - Max *uint32 `protobuf:"varint,2,opt,name=max,proto3,oneof" json:"max,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SizeConstraint) Reset() { - *x = SizeConstraint{} - mi := &file_org_signal_chat_require_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SizeConstraint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SizeConstraint) ProtoMessage() {} - -func (x *SizeConstraint) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_require_proto_msgTypes[1] - 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 SizeConstraint.ProtoReflect.Descriptor instead. -func (*SizeConstraint) Descriptor() ([]byte, []int) { - return file_org_signal_chat_require_proto_rawDescGZIP(), []int{1} -} - -func (x *SizeConstraint) GetMin() uint32 { - if x != nil && x.Min != nil { - return *x.Min - } - return 0 -} - -func (x *SizeConstraint) GetMax() uint32 { - if x != nil && x.Max != nil { - return *x.Max - } - return 0 -} - -type ValueRangeConstraint struct { - state protoimpl.MessageState `protogen:"open.v1"` - Min *int64 `protobuf:"varint,1,opt,name=min,proto3,oneof" json:"min,omitempty"` - Max *int64 `protobuf:"varint,2,opt,name=max,proto3,oneof" json:"max,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ValueRangeConstraint) Reset() { - *x = ValueRangeConstraint{} - mi := &file_org_signal_chat_require_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ValueRangeConstraint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValueRangeConstraint) ProtoMessage() {} - -func (x *ValueRangeConstraint) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_require_proto_msgTypes[2] - 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 ValueRangeConstraint.ProtoReflect.Descriptor instead. -func (*ValueRangeConstraint) Descriptor() ([]byte, []int) { - return file_org_signal_chat_require_proto_rawDescGZIP(), []int{2} -} - -func (x *ValueRangeConstraint) GetMin() int64 { - if x != nil && x.Min != nil { - return *x.Min - } - return 0 -} - -func (x *ValueRangeConstraint) GetMax() int64 { - if x != nil && x.Max != nil { - return *x.Max - } - return 0 -} - -var file_org_signal_chat_require_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 70001, - Name: "org.signal.chat.require.nonEmpty", - Tag: "varint,70001,opt,name=nonEmpty", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 70002, - Name: "org.signal.chat.require.specified", - Tag: "varint,70002,opt,name=specified", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*SizeConstraint)(nil), - Field: 70003, - Name: "org.signal.chat.require.size", - Tag: "bytes,70003,opt,name=size", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: ([]uint32)(nil), - Field: 70004, - Name: "org.signal.chat.require.exactlySize", - Tag: "varint,70004,rep,packed,name=exactlySize", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 70005, - Name: "org.signal.chat.require.e164", - Tag: "varint,70005,opt,name=e164", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*ValueRangeConstraint)(nil), - Field: 70006, - Name: "org.signal.chat.require.range", - Tag: "bytes,70006,opt,name=range", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 70007, - Name: "org.signal.chat.require.present", - Tag: "varint,70007,opt,name=present", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 70008, - Name: "org.signal.chat.require.base64url", - Tag: "varint,70008,opt,name=base64url", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*IdentityType)(nil), - Field: 70009, - Name: "org.signal.chat.require.identityType", - Tag: "varint,70009,opt,name=identityType,enum=org.signal.chat.require.IdentityType", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*ElementConstraint)(nil), - Field: 70010, - Name: "org.signal.chat.require.each", - Tag: "bytes,70010,opt,name=each", - Filename: "org/signal/chat/require.proto", - }, - { - ExtendedType: (*descriptorpb.ServiceOptions)(nil), - ExtensionType: (*Auth)(nil), - Field: 71001, - Name: "org.signal.chat.require.auth", - Tag: "varint,71001,opt,name=auth,enum=org.signal.chat.require.Auth", - Filename: "org/signal/chat/require.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // Requires a field to have content of non-zero size/length. - // Applies to both `optional` and regular fields, i.e. if the field is not set - // or has a default value, it's considered to be empty. This does not apply - // to fields that are contained in a `oneof`. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // string nonEmptyString = 1 [(require.nonEmpty) = true]; - // bytes nonEmptyBytes = 2 [(require.nonEmpty) = true]; - // optional string nonEmptyStringOptional = 3 [(require.nonEmpty) = true]; - // optional bytes nonEmptyBytesOptional = 4 [(require.nonEmpty) = true]; - // repeated string nonEmptyList = 5 [(require.nonEmpty) = true]; - // } - // - // ``` - // - // Applicable to fields of type `string`, `byte`, and `repeated` fields. - // - // optional bool nonEmpty = 70001; - E_NonEmpty = &file_org_signal_chat_require_proto_extTypes[0] - // Requires a enum field to have value with an index greater than zero. - // Applies to both `optional` and regular fields, i.e. if the field is not set or has a default value, - // its index will be <= 0. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // Color color = 1 [(require.specified) = true]; - // } - // - // enum Color { - // COLOR_UNSPECIFIED = 0; - // COLOR_RED = 1; - // COLOR_GREEN = 2; - // COLOR_BLUE = 3; - // } - // - // ``` - // - // optional bool specified = 70002; - E_Specified = &file_org_signal_chat_require_proto_extTypes[1] - // Requires a size/length of a field to be within certain boundaries. - // Applies to both `optional` and regular fields, i.e. if the field is not set - // or has a default value, its size considered to be zero. However, if the - // field is contained in a `oneof` and is not set, this annotation does not - // apply. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // - // string name = 1 [(require.size) = {min: 3, max: 8}]; - // - // optional string address = 2 [(require.size) = {min: 3, max: 8}]; - // } - // - // ``` - // - // Applicable to fields of type `string`, `byte`, and `repeated` fields. - // - // optional org.signal.chat.require.SizeConstraint size = 70003; - E_Size = &file_org_signal_chat_require_proto_extTypes[2] - // Requires a size/length of a field to be within certain boundaries. - // Applies to both `optional` and regular fields, i.e. if the field is not set - // or has a default value, its size considered to be zero. However, if the - // field is contained in a `oneof` and is not set, this annotation does not - // apply. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // - // string zip = 1 [(require.exactlySize) = 5]; - // - // optional string exactlySizeVariants = 2 [(require.exactlySize) = 2, (require.exactlySize) = 4]; - // } - // - // ``` - // - // Applicable to fields of type `string`, `byte`, and `repeated` fields. - // - // repeated uint32 exactlySize = 70004; - E_ExactlySize = &file_org_signal_chat_require_proto_extTypes[3] - // Requires a value of a string field to be a valid E164-normalized phone number. - // If the field is `optional`, this check allows a value to be not set. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // string number = 1 [(require.e164)]; - // } - // ``` - // - // optional bool e164 = 70005; - E_E164 = &file_org_signal_chat_require_proto_extTypes[4] - // Requires an integer value to be within a certain range. The range boundaries are specified - // with the values of type `int32`, which should be enough for all practical purposes. - // - // If the field is `optional`, this check allows a value to be not set. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // int32 byte = 1 [(require.range) = {min: -128, max: 127}]; - // uint32 unsignedByte = 2 [(require.range).max = 255]; - // } - // - // ``` - // - // optional org.signal.chat.require.ValueRangeConstraint range = 70006; - E_Range = &file_org_signal_chat_require_proto_extTypes[5] - // Require a value of a message field to be present. - // - // Applies to both `optional` and regular fields (both of which have explicit - // presence for the message type anyways). This does not apply to fields that - // are contained in a `oneof`. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // message MyMessage {} - // MyMessage myMessage = 1 [(require.present) = true]; - // } - // - // ```` - // - // optional bool present = 70007; - E_Present = &file_org_signal_chat_require_proto_extTypes[6] - // Requires a value of a string field to be a valid base64 URL string. The - // string may be padded or unpadded. If the field is `optional`, this check - // allows a value to be not set. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // string myString = 1 [(require.base64url) = true]; - // } - // ``` - // - // optional bool base64url = 70008; - E_Base64Url = &file_org_signal_chat_require_proto_extTypes[7] - // Requires a common.ServiceIdentifier field to have its IdentityType - // be the given type (`aci` or `pni`). - // - // ``` - // import "org/signal/chat/require.proto"; - // import "org/signal/chat/common.proto"; - // - // message Data { - // common.ServiceIdentifier accountIdentifier = 1 [(require.identityType) = IDENTITY_TYPE_ACI]; - // } - // ``` - // - // optional org.signal.chat.require.IdentityType identityType = 70009; - E_IdentityType = &file_org_signal_chat_require_proto_extTypes[8] - // Applies element-wise constraints to the elements of a `repeated` field. - // Top-level `require.*` annotations on a `repeated` field constrain the - // collection itself (e.g. element count), `each` constrains the - // individual elements. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // message Data { - // // 1-20 username hashes, each exactly 32 bytes - // repeated bytes username_hashes = 1 [ - // (require.size) = {min: 1, max: 20}, - // (require.each) = { exactlySize: 32 } - // ]; - // } - // - // ``` - // - // Applicable only to `repeated` fields. - // - // optional org.signal.chat.require.ElementConstraint each = 70010; - E_Each = &file_org_signal_chat_require_proto_extTypes[9] -) - -// Extension fields to descriptorpb.ServiceOptions. -var ( - // Indicates that all methods in a given service require a certain kind of authentication. - // - // ``` - // import "org/signal/chat/require.proto"; - // - // service AuthService { - // option (require.auth) = AUTH_ONLY_AUTHENTICATED; - // - // rpc AuthenticatedMethod (google.protobuf.Empty) returns (google.protobuf.Empty) {} - // } - // - // ``` - // - // optional org.signal.chat.require.Auth auth = 71001; - E_Auth = &file_org_signal_chat_require_proto_extTypes[10] -) - -var File_org_signal_chat_require_proto protoreflect.FileDescriptor - -const file_org_signal_chat_require_proto_rawDesc = "" + - "\n" + - "\x1dorg/signal/chat/require.proto\x12\x17org.signal.chat.require\x1a google/protobuf/descriptor.proto\"\xe7\x03\n" + - "\x11ElementConstraint\x12\x1f\n" + - "\bnonEmpty\x18\x01 \x01(\bH\x00R\bnonEmpty\x88\x01\x01\x12@\n" + - "\x04size\x18\x02 \x01(\v2'.org.signal.chat.require.SizeConstraintH\x01R\x04size\x88\x01\x01\x12 \n" + - "\vexactlySize\x18\x03 \x03(\rR\vexactlySize\x12\x17\n" + - "\x04e164\x18\x04 \x01(\bH\x02R\x04e164\x88\x01\x01\x12!\n" + - "\tbase64url\x18\x05 \x01(\bH\x03R\tbase64url\x88\x01\x01\x12H\n" + - "\x05range\x18\x06 \x01(\v2-.org.signal.chat.require.ValueRangeConstraintH\x04R\x05range\x88\x01\x01\x12N\n" + - "\fidentityType\x18\a \x01(\x0e2%.org.signal.chat.require.IdentityTypeH\x05R\fidentityType\x88\x01\x01\x12!\n" + - "\tspecified\x18\b \x01(\bH\x06R\tspecified\x88\x01\x01B\v\n" + - "\t_nonEmptyB\a\n" + - "\x05_sizeB\a\n" + - "\x05_e164B\f\n" + - "\n" + - "_base64urlB\b\n" + - "\x06_rangeB\x0f\n" + - "\r_identityTypeB\f\n" + - "\n" + - "_specified\"N\n" + - "\x0eSizeConstraint\x12\x15\n" + - "\x03min\x18\x01 \x01(\rH\x00R\x03min\x88\x01\x01\x12\x15\n" + - "\x03max\x18\x02 \x01(\rH\x01R\x03max\x88\x01\x01B\x06\n" + - "\x04_minB\x06\n" + - "\x04_max\"T\n" + - "\x14ValueRangeConstraint\x12\x15\n" + - "\x03min\x18\x01 \x01(\x03H\x00R\x03min\x88\x01\x01\x12\x15\n" + - "\x03max\x18\x02 \x01(\x03H\x01R\x03max\x88\x01\x01B\x06\n" + - "\x04_minB\x06\n" + - "\x04_max*R\n" + - "\x04Auth\x12\x14\n" + - "\x10AUTH_UNSPECIFIED\x10\x00\x12\x1b\n" + - "\x17AUTH_ONLY_AUTHENTICATED\x10\x01\x12\x17\n" + - "\x13AUTH_ONLY_ANONYMOUS\x10\x02*[\n" + - "\fIdentityType\x12\x1d\n" + - "\x19IDENTITY_TYPE_UNSPECIFIED\x10\x00\x12\x15\n" + - "\x11IDENTITY_TYPE_ACI\x10\x01\x12\x15\n" + - "\x11IDENTITY_TYPE_PNI\x10\x02:>\n" + - "\bnonEmpty\x12\x1d.google.protobuf.FieldOptions\x18\xf1\xa2\x04 \x01(\bR\bnonEmpty\x88\x01\x01:@\n" + - "\tspecified\x12\x1d.google.protobuf.FieldOptions\x18\xf2\xa2\x04 \x01(\bR\tspecified\x88\x01\x01:_\n" + - "\x04size\x12\x1d.google.protobuf.FieldOptions\x18\xf3\xa2\x04 \x01(\v2'.org.signal.chat.require.SizeConstraintR\x04size\x88\x01\x01:A\n" + - "\vexactlySize\x12\x1d.google.protobuf.FieldOptions\x18\xf4\xa2\x04 \x03(\rR\vexactlySize:6\n" + - "\x04e164\x12\x1d.google.protobuf.FieldOptions\x18\xf5\xa2\x04 \x01(\bR\x04e164\x88\x01\x01:g\n" + - "\x05range\x12\x1d.google.protobuf.FieldOptions\x18\xf6\xa2\x04 \x01(\v2-.org.signal.chat.require.ValueRangeConstraintR\x05range\x88\x01\x01:<\n" + - "\apresent\x12\x1d.google.protobuf.FieldOptions\x18\xf7\xa2\x04 \x01(\bR\apresent\x88\x01\x01:@\n" + - "\tbase64url\x12\x1d.google.protobuf.FieldOptions\x18\xf8\xa2\x04 \x01(\bR\tbase64url\x88\x01\x01:m\n" + - "\fidentityType\x12\x1d.google.protobuf.FieldOptions\x18\xf9\xa2\x04 \x01(\x0e2%.org.signal.chat.require.IdentityTypeR\fidentityType\x88\x01\x01:b\n" + - "\x04each\x12\x1d.google.protobuf.FieldOptions\x18\xfa\xa2\x04 \x01(\v2*.org.signal.chat.require.ElementConstraintR\x04each\x88\x01\x01:W\n" + - "\x04auth\x12\x1f.google.protobuf.ServiceOptions\x18٪\x04 \x01(\x0e2\x1d.org.signal.chat.require.AuthR\x04auth\x88\x01\x01B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_require_proto_rawDescOnce sync.Once - file_org_signal_chat_require_proto_rawDescData []byte -) - -func file_org_signal_chat_require_proto_rawDescGZIP() []byte { - file_org_signal_chat_require_proto_rawDescOnce.Do(func() { - file_org_signal_chat_require_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_require_proto_rawDesc), len(file_org_signal_chat_require_proto_rawDesc))) - }) - return file_org_signal_chat_require_proto_rawDescData -} - -var file_org_signal_chat_require_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_org_signal_chat_require_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_org_signal_chat_require_proto_goTypes = []any{ - (Auth)(0), // 0: org.signal.chat.require.Auth - (IdentityType)(0), // 1: org.signal.chat.require.IdentityType - (*ElementConstraint)(nil), // 2: org.signal.chat.require.ElementConstraint - (*SizeConstraint)(nil), // 3: org.signal.chat.require.SizeConstraint - (*ValueRangeConstraint)(nil), // 4: org.signal.chat.require.ValueRangeConstraint - (*descriptorpb.FieldOptions)(nil), // 5: google.protobuf.FieldOptions - (*descriptorpb.ServiceOptions)(nil), // 6: google.protobuf.ServiceOptions -} -var file_org_signal_chat_require_proto_depIdxs = []int32{ - 3, // 0: org.signal.chat.require.ElementConstraint.size:type_name -> org.signal.chat.require.SizeConstraint - 4, // 1: org.signal.chat.require.ElementConstraint.range:type_name -> org.signal.chat.require.ValueRangeConstraint - 1, // 2: org.signal.chat.require.ElementConstraint.identityType:type_name -> org.signal.chat.require.IdentityType - 5, // 3: org.signal.chat.require.nonEmpty:extendee -> google.protobuf.FieldOptions - 5, // 4: org.signal.chat.require.specified:extendee -> google.protobuf.FieldOptions - 5, // 5: org.signal.chat.require.size:extendee -> google.protobuf.FieldOptions - 5, // 6: org.signal.chat.require.exactlySize:extendee -> google.protobuf.FieldOptions - 5, // 7: org.signal.chat.require.e164:extendee -> google.protobuf.FieldOptions - 5, // 8: org.signal.chat.require.range:extendee -> google.protobuf.FieldOptions - 5, // 9: org.signal.chat.require.present:extendee -> google.protobuf.FieldOptions - 5, // 10: org.signal.chat.require.base64url:extendee -> google.protobuf.FieldOptions - 5, // 11: org.signal.chat.require.identityType:extendee -> google.protobuf.FieldOptions - 5, // 12: org.signal.chat.require.each:extendee -> google.protobuf.FieldOptions - 6, // 13: org.signal.chat.require.auth:extendee -> google.protobuf.ServiceOptions - 3, // 14: org.signal.chat.require.size:type_name -> org.signal.chat.require.SizeConstraint - 4, // 15: org.signal.chat.require.range:type_name -> org.signal.chat.require.ValueRangeConstraint - 1, // 16: org.signal.chat.require.identityType:type_name -> org.signal.chat.require.IdentityType - 2, // 17: org.signal.chat.require.each:type_name -> org.signal.chat.require.ElementConstraint - 0, // 18: org.signal.chat.require.auth:type_name -> org.signal.chat.require.Auth - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 14, // [14:19] is the sub-list for extension type_name - 3, // [3:14] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_require_proto_init() } -func file_org_signal_chat_require_proto_init() { - if File_org_signal_chat_require_proto != nil { - return - } - file_org_signal_chat_require_proto_msgTypes[0].OneofWrappers = []any{} - file_org_signal_chat_require_proto_msgTypes[1].OneofWrappers = []any{} - file_org_signal_chat_require_proto_msgTypes[2].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_require_proto_rawDesc), len(file_org_signal_chat_require_proto_rawDesc)), - NumEnums: 2, - NumMessages: 3, - NumExtensions: 11, - NumServices: 0, - }, - GoTypes: file_org_signal_chat_require_proto_goTypes, - DependencyIndexes: file_org_signal_chat_require_proto_depIdxs, - EnumInfos: file_org_signal_chat_require_proto_enumTypes, - MessageInfos: file_org_signal_chat_require_proto_msgTypes, - ExtensionInfos: file_org_signal_chat_require_proto_extTypes, - }.Build() - File_org_signal_chat_require_proto = out.File - file_org_signal_chat_require_proto_goTypes = nil - file_org_signal_chat_require_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/subscriptions/subscriptions.pb.go b/pkg/signalmeow/protobuf/rpc/subscriptions/subscriptions.pb.go deleted file mode 100644 index f39f345..0000000 --- a/pkg/signalmeow/protobuf/rpc/subscriptions/subscriptions.pb.go +++ /dev/null @@ -1,3403 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/subscriptions.proto - -package subscriptions - -import ( - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/common" - errors "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/errors" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/require" - _ "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/tag" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - emptypb "google.golang.org/protobuf/types/known/emptypb" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type PaymentProvider int32 - -const ( - PaymentProvider_PAYMENT_PROVIDER_UNKNOWN PaymentProvider = 0 - PaymentProvider_PAYMENT_PROVIDER_STRIPE PaymentProvider = 1 - PaymentProvider_PAYMENT_PROVIDER_BRAINTREE PaymentProvider = 2 - PaymentProvider_PAYMENT_PROVIDER_GOOGLE_PLAY_BILLING PaymentProvider = 3 - PaymentProvider_PAYMENT_PROVIDER_APPLE_APP_STORE PaymentProvider = 4 -) - -// Enum value maps for PaymentProvider. -var ( - PaymentProvider_name = map[int32]string{ - 0: "PAYMENT_PROVIDER_UNKNOWN", - 1: "PAYMENT_PROVIDER_STRIPE", - 2: "PAYMENT_PROVIDER_BRAINTREE", - 3: "PAYMENT_PROVIDER_GOOGLE_PLAY_BILLING", - 4: "PAYMENT_PROVIDER_APPLE_APP_STORE", - } - PaymentProvider_value = map[string]int32{ - "PAYMENT_PROVIDER_UNKNOWN": 0, - "PAYMENT_PROVIDER_STRIPE": 1, - "PAYMENT_PROVIDER_BRAINTREE": 2, - "PAYMENT_PROVIDER_GOOGLE_PLAY_BILLING": 3, - "PAYMENT_PROVIDER_APPLE_APP_STORE": 4, - } -) - -func (x PaymentProvider) Enum() *PaymentProvider { - p := new(PaymentProvider) - *p = x - return p -} - -func (x PaymentProvider) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PaymentProvider) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_subscriptions_proto_enumTypes[0].Descriptor() -} - -func (PaymentProvider) Type() protoreflect.EnumType { - return &file_org_signal_chat_subscriptions_proto_enumTypes[0] -} - -func (x PaymentProvider) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PaymentProvider.Descriptor instead. -func (PaymentProvider) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{0} -} - -type PaymentMethod int32 - -const ( - PaymentMethod_PAYMENT_METHOD_UNKNOWN PaymentMethod = 0 - // A credit card or debit card, including those from Apple Pay and Google Pay - PaymentMethod_PAYMENT_METHOD_CARD PaymentMethod = 1 - // A SEPA debit account - PaymentMethod_PAYMENT_METHOD_SEPA_DEBIT PaymentMethod = 2 - // An iDEAL account - PaymentMethod_PAYMENT_METHOD_IDEAL PaymentMethod = 3 - // A PayPal account - PaymentMethod_PAYMENT_METHOD_PAYPAL PaymentMethod = 4 - PaymentMethod_PAYMENT_METHOD_GOOGLE_PLAY_BILLING PaymentMethod = 5 - PaymentMethod_PAYMENT_METHOD_APPLE_APP_STORE PaymentMethod = 6 -) - -// Enum value maps for PaymentMethod. -var ( - PaymentMethod_name = map[int32]string{ - 0: "PAYMENT_METHOD_UNKNOWN", - 1: "PAYMENT_METHOD_CARD", - 2: "PAYMENT_METHOD_SEPA_DEBIT", - 3: "PAYMENT_METHOD_IDEAL", - 4: "PAYMENT_METHOD_PAYPAL", - 5: "PAYMENT_METHOD_GOOGLE_PLAY_BILLING", - 6: "PAYMENT_METHOD_APPLE_APP_STORE", - } - PaymentMethod_value = map[string]int32{ - "PAYMENT_METHOD_UNKNOWN": 0, - "PAYMENT_METHOD_CARD": 1, - "PAYMENT_METHOD_SEPA_DEBIT": 2, - "PAYMENT_METHOD_IDEAL": 3, - "PAYMENT_METHOD_PAYPAL": 4, - "PAYMENT_METHOD_GOOGLE_PLAY_BILLING": 5, - "PAYMENT_METHOD_APPLE_APP_STORE": 6, - } -) - -func (x PaymentMethod) Enum() *PaymentMethod { - p := new(PaymentMethod) - *p = x - return p -} - -func (x PaymentMethod) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PaymentMethod) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_subscriptions_proto_enumTypes[1].Descriptor() -} - -func (PaymentMethod) Type() protoreflect.EnumType { - return &file_org_signal_chat_subscriptions_proto_enumTypes[1] -} - -func (x PaymentMethod) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PaymentMethod.Descriptor instead. -func (PaymentMethod) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{1} -} - -type SubscriptionStatus int32 - -const ( - SubscriptionStatus_SUBSCRIPTION_STATUS_UNKNOWN SubscriptionStatus = 0 - // The subscription is in good standing and the most recent payment was successful. - SubscriptionStatus_SUBSCRIPTION_STATUS_ACTIVE SubscriptionStatus = 1 - // Payment failed when creating the subscription, or the subscription's start date is in the future. - SubscriptionStatus_SUBSCRIPTION_STATUS_INCOMPLETE SubscriptionStatus = 2 - // Payment on the latest renewal failed but there are processor retries left, or payment wasn't attempted. - SubscriptionStatus_SUBSCRIPTION_STATUS_PAST_DUE SubscriptionStatus = 3 - // The subscription has been canceled. - SubscriptionStatus_SUBSCRIPTION_STATUS_CANCELED SubscriptionStatus = 4 - // The latest renewal hasn't been paid but the subscription remains in place. - SubscriptionStatus_SUBSCRIPTION_STATUS_UNPAID SubscriptionStatus = 5 -) - -// Enum value maps for SubscriptionStatus. -var ( - SubscriptionStatus_name = map[int32]string{ - 0: "SUBSCRIPTION_STATUS_UNKNOWN", - 1: "SUBSCRIPTION_STATUS_ACTIVE", - 2: "SUBSCRIPTION_STATUS_INCOMPLETE", - 3: "SUBSCRIPTION_STATUS_PAST_DUE", - 4: "SUBSCRIPTION_STATUS_CANCELED", - 5: "SUBSCRIPTION_STATUS_UNPAID", - } - SubscriptionStatus_value = map[string]int32{ - "SUBSCRIPTION_STATUS_UNKNOWN": 0, - "SUBSCRIPTION_STATUS_ACTIVE": 1, - "SUBSCRIPTION_STATUS_INCOMPLETE": 2, - "SUBSCRIPTION_STATUS_PAST_DUE": 3, - "SUBSCRIPTION_STATUS_CANCELED": 4, - "SUBSCRIPTION_STATUS_UNPAID": 5, - } -) - -func (x SubscriptionStatus) Enum() *SubscriptionStatus { - p := new(SubscriptionStatus) - *p = x - return p -} - -func (x SubscriptionStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SubscriptionStatus) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_subscriptions_proto_enumTypes[2].Descriptor() -} - -func (SubscriptionStatus) Type() protoreflect.EnumType { - return &file_org_signal_chat_subscriptions_proto_enumTypes[2] -} - -func (x SubscriptionStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SubscriptionStatus.Descriptor instead. -func (SubscriptionStatus) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{2} -} - -type BankTransferType int32 - -const ( - BankTransferType_BANK_TRANSFER_TYPE_UNKNOWN BankTransferType = 0 - BankTransferType_BANK_TRANSFER_TYPE_SEPA_DEBIT BankTransferType = 1 -) - -// Enum value maps for BankTransferType. -var ( - BankTransferType_name = map[int32]string{ - 0: "BANK_TRANSFER_TYPE_UNKNOWN", - 1: "BANK_TRANSFER_TYPE_SEPA_DEBIT", - } - BankTransferType_value = map[string]int32{ - "BANK_TRANSFER_TYPE_UNKNOWN": 0, - "BANK_TRANSFER_TYPE_SEPA_DEBIT": 1, - } -) - -func (x BankTransferType) Enum() *BankTransferType { - p := new(BankTransferType) - *p = x - return p -} - -func (x BankTransferType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BankTransferType) Descriptor() protoreflect.EnumDescriptor { - return file_org_signal_chat_subscriptions_proto_enumTypes[3].Descriptor() -} - -func (BankTransferType) Type() protoreflect.EnumType { - return &file_org_signal_chat_subscriptions_proto_enumTypes[3] -} - -func (x BankTransferType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BankTransferType.Descriptor instead. -func (BankTransferType) EnumDescriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{3} -} - -type UpdateSubscriberRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriber_id,json=subscriberId,proto3" json:"subscriber_id,omitempty"` - // A libsignal DonationPermit from rpc Donations.CreateDonationPermit. - // Not required if the subscriber already exists. - DonationPermit []byte `protobuf:"bytes,2,opt,name=donation_permit,json=donationPermit,proto3" json:"donation_permit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateSubscriberRequest) Reset() { - *x = UpdateSubscriberRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateSubscriberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSubscriberRequest) ProtoMessage() {} - -func (x *UpdateSubscriberRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[0] - 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 UpdateSubscriberRequest.ProtoReflect.Descriptor instead. -func (*UpdateSubscriberRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{0} -} - -func (x *UpdateSubscriberRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *UpdateSubscriberRequest) GetDonationPermit() []byte { - if x != nil { - return x.DonationPermit - } - return nil -} - -type UpdateSubscriberResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *UpdateSubscriberResponse_Success - // *UpdateSubscriberResponse_SubscriberIdMismatch - // *UpdateSubscriberResponse_PermitRejected - Response isUpdateSubscriberResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateSubscriberResponse) Reset() { - *x = UpdateSubscriberResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateSubscriberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateSubscriberResponse) ProtoMessage() {} - -func (x *UpdateSubscriberResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[1] - 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 UpdateSubscriberResponse.ProtoReflect.Descriptor instead. -func (*UpdateSubscriberResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{1} -} - -func (x *UpdateSubscriberResponse) GetResponse() isUpdateSubscriberResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *UpdateSubscriberResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*UpdateSubscriberResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *UpdateSubscriberResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*UpdateSubscriberResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -func (x *UpdateSubscriberResponse) GetPermitRejected() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*UpdateSubscriberResponse_PermitRejected); ok { - return x.PermitRejected - } - } - return nil -} - -type isUpdateSubscriberResponse_Response interface { - isUpdateSubscriberResponse_Response() -} - -type UpdateSubscriberResponse_Success struct { - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type UpdateSubscriberResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,2,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -type UpdateSubscriberResponse_PermitRejected struct { - // The donation permit was expired or already spent - PermitRejected *errors.FailedZkAuthentication `protobuf:"bytes,3,opt,name=permit_rejected,json=permitRejected,proto3,oneof"` -} - -func (*UpdateSubscriberResponse_Success) isUpdateSubscriberResponse_Response() {} - -func (*UpdateSubscriberResponse_SubscriberIdMismatch) isUpdateSubscriberResponse_Response() {} - -func (*UpdateSubscriberResponse_PermitRejected) isUpdateSubscriberResponse_Response() {} - -type DeleteSubscriberRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteSubscriberRequest) Reset() { - *x = DeleteSubscriberRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteSubscriberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSubscriberRequest) ProtoMessage() {} - -func (x *DeleteSubscriberRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[2] - 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 DeleteSubscriberRequest.ProtoReflect.Descriptor instead. -func (*DeleteSubscriberRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{2} -} - -func (x *DeleteSubscriberRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -type DeleteSubscriberResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *DeleteSubscriberResponse_Success - // *DeleteSubscriberResponse_SubscriberNotFound - // *DeleteSubscriberResponse_CannotCancelSubscription - Response isDeleteSubscriberResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteSubscriberResponse) Reset() { - *x = DeleteSubscriberResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteSubscriberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSubscriberResponse) ProtoMessage() {} - -func (x *DeleteSubscriberResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[3] - 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 DeleteSubscriberResponse.ProtoReflect.Descriptor instead. -func (*DeleteSubscriberResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{3} -} - -func (x *DeleteSubscriberResponse) GetResponse() isDeleteSubscriberResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *DeleteSubscriberResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*DeleteSubscriberResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *DeleteSubscriberResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*DeleteSubscriberResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *DeleteSubscriberResponse) GetCannotCancelSubscription() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*DeleteSubscriberResponse_CannotCancelSubscription); ok { - return x.CannotCancelSubscription - } - } - return nil -} - -type isDeleteSubscriberResponse_Response interface { - isDeleteSubscriberResponse_Response() -} - -type DeleteSubscriberResponse_Success struct { - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type DeleteSubscriberResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type DeleteSubscriberResponse_CannotCancelSubscription struct { - // The associated subscription is not a type that can be cancelled by the server. Cancel client-side, and then retry. - CannotCancelSubscription *errors.FailedPrecondition `protobuf:"bytes,3,opt,name=cannot_cancel_subscription,json=cannotCancelSubscription,proto3,oneof"` -} - -func (*DeleteSubscriberResponse_Success) isDeleteSubscriberResponse_Response() {} - -func (*DeleteSubscriberResponse_SubscriberNotFound) isDeleteSubscriberResponse_Response() {} - -func (*DeleteSubscriberResponse_CannotCancelSubscription) isDeleteSubscriberResponse_Response() {} - -type CreatePaymentMethodRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Only PAYMENT_METHOD_CARD, PAYMENT_METHOD_SEPA_DEBIT, and PAYMENT_METHOD_IDEAL are supported; - // other values will result in an INVALID_ARGUMENT error. - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriber_id,json=subscriberId,proto3" json:"subscriber_id,omitempty"` - PaymentMethod PaymentMethod `protobuf:"varint,2,opt,name=payment_method,json=paymentMethod,proto3,enum=org.signal.chat.purchase.PaymentMethod" json:"payment_method,omitempty"` - // a libsignal DonationPermit from rpc Donations.CreateDonationPermit - DonationPermit []byte `protobuf:"bytes,3,opt,name=donation_permit,json=donationPermit,proto3" json:"donation_permit,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePaymentMethodRequest) Reset() { - *x = CreatePaymentMethodRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePaymentMethodRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePaymentMethodRequest) ProtoMessage() {} - -func (x *CreatePaymentMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[4] - 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 CreatePaymentMethodRequest.ProtoReflect.Descriptor instead. -func (*CreatePaymentMethodRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{4} -} - -func (x *CreatePaymentMethodRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *CreatePaymentMethodRequest) GetPaymentMethod() PaymentMethod { - if x != nil { - return x.PaymentMethod - } - return PaymentMethod_PAYMENT_METHOD_UNKNOWN -} - -func (x *CreatePaymentMethodRequest) GetDonationPermit() []byte { - if x != nil { - return x.DonationPermit - } - return nil -} - -type CreatePaymentMethodResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *CreatePaymentMethodResponse_Result - // *CreatePaymentMethodResponse_SubscriberNotFound - // *CreatePaymentMethodResponse_SubscriberIdMismatch - // *CreatePaymentMethodResponse_SubscriptionProcessorConflict - // *CreatePaymentMethodResponse_PermitRejected - Response isCreatePaymentMethodResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePaymentMethodResponse) Reset() { - *x = CreatePaymentMethodResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePaymentMethodResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePaymentMethodResponse) ProtoMessage() {} - -func (x *CreatePaymentMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[5] - 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 CreatePaymentMethodResponse.ProtoReflect.Descriptor instead. -func (*CreatePaymentMethodResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{5} -} - -func (x *CreatePaymentMethodResponse) GetResponse() isCreatePaymentMethodResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *CreatePaymentMethodResponse) GetResult() *CreatePaymentMethodResponse_CreatePaymentMethodResult { - if x != nil { - if x, ok := x.Response.(*CreatePaymentMethodResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *CreatePaymentMethodResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*CreatePaymentMethodResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *CreatePaymentMethodResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*CreatePaymentMethodResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -func (x *CreatePaymentMethodResponse) GetSubscriptionProcessorConflict() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreatePaymentMethodResponse_SubscriptionProcessorConflict); ok { - return x.SubscriptionProcessorConflict - } - } - return nil -} - -func (x *CreatePaymentMethodResponse) GetPermitRejected() *errors.FailedZkAuthentication { - if x != nil { - if x, ok := x.Response.(*CreatePaymentMethodResponse_PermitRejected); ok { - return x.PermitRejected - } - } - return nil -} - -type isCreatePaymentMethodResponse_Response interface { - isCreatePaymentMethodResponse_Response() -} - -type CreatePaymentMethodResponse_Result struct { - Result *CreatePaymentMethodResponse_CreatePaymentMethodResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type CreatePaymentMethodResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type CreatePaymentMethodResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -type CreatePaymentMethodResponse_SubscriptionProcessorConflict struct { - // New payment processor does not match existing processor associated with the subscription - SubscriptionProcessorConflict *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=subscription_processor_conflict,json=subscriptionProcessorConflict,proto3,oneof"` -} - -type CreatePaymentMethodResponse_PermitRejected struct { - // The donation permit was expired or already spent - PermitRejected *errors.FailedZkAuthentication `protobuf:"bytes,5,opt,name=permit_rejected,json=permitRejected,proto3,oneof"` -} - -func (*CreatePaymentMethodResponse_Result) isCreatePaymentMethodResponse_Response() {} - -func (*CreatePaymentMethodResponse_SubscriberNotFound) isCreatePaymentMethodResponse_Response() {} - -func (*CreatePaymentMethodResponse_SubscriberIdMismatch) isCreatePaymentMethodResponse_Response() {} - -func (*CreatePaymentMethodResponse_SubscriptionProcessorConflict) isCreatePaymentMethodResponse_Response() { -} - -func (*CreatePaymentMethodResponse_PermitRejected) isCreatePaymentMethodResponse_Response() {} - -type CreatePayPalPaymentMethodRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - // a callback URL (e.g. an in-client URL handler) for when the user approved the payment - ReturnUrl string `protobuf:"bytes,2,opt,name=returnUrl,proto3" json:"returnUrl,omitempty"` - // a callback URL (e.g. an in-client URL handler) for when the user did not approve the payment - CancelUrl string `protobuf:"bytes,3,opt,name=cancelUrl,proto3" json:"cancelUrl,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePayPalPaymentMethodRequest) Reset() { - *x = CreatePayPalPaymentMethodRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePayPalPaymentMethodRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePayPalPaymentMethodRequest) ProtoMessage() {} - -func (x *CreatePayPalPaymentMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[6] - 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 CreatePayPalPaymentMethodRequest.ProtoReflect.Descriptor instead. -func (*CreatePayPalPaymentMethodRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{6} -} - -func (x *CreatePayPalPaymentMethodRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *CreatePayPalPaymentMethodRequest) GetReturnUrl() string { - if x != nil { - return x.ReturnUrl - } - return "" -} - -func (x *CreatePayPalPaymentMethodRequest) GetCancelUrl() string { - if x != nil { - return x.CancelUrl - } - return "" -} - -type CreatePayPalPaymentMethodResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *CreatePayPalPaymentMethodResponse_Result - // *CreatePayPalPaymentMethodResponse_SubscriberNotFound - // *CreatePayPalPaymentMethodResponse_SubscriberIdMismatch - // *CreatePayPalPaymentMethodResponse_SubscriptionProcessorConflict - Response isCreatePayPalPaymentMethodResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePayPalPaymentMethodResponse) Reset() { - *x = CreatePayPalPaymentMethodResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePayPalPaymentMethodResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePayPalPaymentMethodResponse) ProtoMessage() {} - -func (x *CreatePayPalPaymentMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[7] - 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 CreatePayPalPaymentMethodResponse.ProtoReflect.Descriptor instead. -func (*CreatePayPalPaymentMethodResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{7} -} - -func (x *CreatePayPalPaymentMethodResponse) GetResponse() isCreatePayPalPaymentMethodResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *CreatePayPalPaymentMethodResponse) GetResult() *CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult { - if x != nil { - if x, ok := x.Response.(*CreatePayPalPaymentMethodResponse_Result); ok { - return x.Result - } - } - return nil -} - -func (x *CreatePayPalPaymentMethodResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*CreatePayPalPaymentMethodResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *CreatePayPalPaymentMethodResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*CreatePayPalPaymentMethodResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -func (x *CreatePayPalPaymentMethodResponse) GetSubscriptionProcessorConflict() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*CreatePayPalPaymentMethodResponse_SubscriptionProcessorConflict); ok { - return x.SubscriptionProcessorConflict - } - } - return nil -} - -type isCreatePayPalPaymentMethodResponse_Response interface { - isCreatePayPalPaymentMethodResponse_Response() -} - -type CreatePayPalPaymentMethodResponse_Result struct { - Result *CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult `protobuf:"bytes,1,opt,name=result,proto3,oneof"` -} - -type CreatePayPalPaymentMethodResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type CreatePayPalPaymentMethodResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -type CreatePayPalPaymentMethodResponse_SubscriptionProcessorConflict struct { - // New payment processor does not match existing processor associated with the subscription - SubscriptionProcessorConflict *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=subscription_processor_conflict,json=subscriptionProcessorConflict,proto3,oneof"` -} - -func (*CreatePayPalPaymentMethodResponse_Result) isCreatePayPalPaymentMethodResponse_Response() {} - -func (*CreatePayPalPaymentMethodResponse_SubscriberNotFound) isCreatePayPalPaymentMethodResponse_Response() { -} - -func (*CreatePayPalPaymentMethodResponse_SubscriberIdMismatch) isCreatePayPalPaymentMethodResponse_Response() { -} - -func (*CreatePayPalPaymentMethodResponse_SubscriptionProcessorConflict) isCreatePayPalPaymentMethodResponse_Response() { -} - -type SetDefaultPaymentMethodRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - // Types that are valid to be assigned to Request: - // - // *SetDefaultPaymentMethodRequest_Stripe - // *SetDefaultPaymentMethodRequest_Braintree - // *SetDefaultPaymentMethodRequest_Sepa - Request isSetDefaultPaymentMethodRequest_Request `protobuf_oneof:"request"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDefaultPaymentMethodRequest) Reset() { - *x = SetDefaultPaymentMethodRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDefaultPaymentMethodRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDefaultPaymentMethodRequest) ProtoMessage() {} - -func (x *SetDefaultPaymentMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 SetDefaultPaymentMethodRequest.ProtoReflect.Descriptor instead. -func (*SetDefaultPaymentMethodRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{8} -} - -func (x *SetDefaultPaymentMethodRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *SetDefaultPaymentMethodRequest) GetRequest() isSetDefaultPaymentMethodRequest_Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *SetDefaultPaymentMethodRequest) GetStripe() *SetDefaultPaymentMethodRequest_StripePaymentMethod { - if x != nil { - if x, ok := x.Request.(*SetDefaultPaymentMethodRequest_Stripe); ok { - return x.Stripe - } - } - return nil -} - -func (x *SetDefaultPaymentMethodRequest) GetBraintree() *SetDefaultPaymentMethodRequest_BraintreePaymentMethod { - if x != nil { - if x, ok := x.Request.(*SetDefaultPaymentMethodRequest_Braintree); ok { - return x.Braintree - } - } - return nil -} - -func (x *SetDefaultPaymentMethodRequest) GetSepa() *SetDefaultPaymentMethodRequest_SepaPaymentMethod { - if x != nil { - if x, ok := x.Request.(*SetDefaultPaymentMethodRequest_Sepa); ok { - return x.Sepa - } - } - return nil -} - -type isSetDefaultPaymentMethodRequest_Request interface { - isSetDefaultPaymentMethodRequest_Request() -} - -type SetDefaultPaymentMethodRequest_Stripe struct { - Stripe *SetDefaultPaymentMethodRequest_StripePaymentMethod `protobuf:"bytes,2,opt,name=stripe,proto3,oneof"` -} - -type SetDefaultPaymentMethodRequest_Braintree struct { - Braintree *SetDefaultPaymentMethodRequest_BraintreePaymentMethod `protobuf:"bytes,3,opt,name=braintree,proto3,oneof"` -} - -type SetDefaultPaymentMethodRequest_Sepa struct { - Sepa *SetDefaultPaymentMethodRequest_SepaPaymentMethod `protobuf:"bytes,4,opt,name=sepa,proto3,oneof"` -} - -func (*SetDefaultPaymentMethodRequest_Stripe) isSetDefaultPaymentMethodRequest_Request() {} - -func (*SetDefaultPaymentMethodRequest_Braintree) isSetDefaultPaymentMethodRequest_Request() {} - -func (*SetDefaultPaymentMethodRequest_Sepa) isSetDefaultPaymentMethodRequest_Request() {} - -type SetDefaultPaymentMethodResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetDefaultPaymentMethodResponse_Success - // *SetDefaultPaymentMethodResponse_SubscriberNotFound - // *SetDefaultPaymentMethodResponse_SubscriberIdMismatch - // *SetDefaultPaymentMethodResponse_PaymentMethodNotSetUp - // *SetDefaultPaymentMethodResponse_SubscriptionProcessorConflict - Response isSetDefaultPaymentMethodResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDefaultPaymentMethodResponse) Reset() { - *x = SetDefaultPaymentMethodResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDefaultPaymentMethodResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDefaultPaymentMethodResponse) ProtoMessage() {} - -func (x *SetDefaultPaymentMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 SetDefaultPaymentMethodResponse.ProtoReflect.Descriptor instead. -func (*SetDefaultPaymentMethodResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{9} -} - -func (x *SetDefaultPaymentMethodResponse) GetResponse() isSetDefaultPaymentMethodResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetDefaultPaymentMethodResponse) GetSuccess() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*SetDefaultPaymentMethodResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SetDefaultPaymentMethodResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*SetDefaultPaymentMethodResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *SetDefaultPaymentMethodResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*SetDefaultPaymentMethodResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -func (x *SetDefaultPaymentMethodResponse) GetPaymentMethodNotSetUp() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetDefaultPaymentMethodResponse_PaymentMethodNotSetUp); ok { - return x.PaymentMethodNotSetUp - } - } - return nil -} - -func (x *SetDefaultPaymentMethodResponse) GetSubscriptionProcessorConflict() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetDefaultPaymentMethodResponse_SubscriptionProcessorConflict); ok { - return x.SubscriptionProcessorConflict - } - } - return nil -} - -type isSetDefaultPaymentMethodResponse_Response interface { - isSetDefaultPaymentMethodResponse_Response() -} - -type SetDefaultPaymentMethodResponse_Success struct { - Success *emptypb.Empty `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SetDefaultPaymentMethodResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type SetDefaultPaymentMethodResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -type SetDefaultPaymentMethodResponse_PaymentMethodNotSetUp struct { - PaymentMethodNotSetUp *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=payment_method_not_set_up,json=paymentMethodNotSetUp,proto3,oneof"` -} - -type SetDefaultPaymentMethodResponse_SubscriptionProcessorConflict struct { - // Payment processor does not match existing processor associated with the subscription - SubscriptionProcessorConflict *errors.FailedPrecondition `protobuf:"bytes,5,opt,name=subscription_processor_conflict,json=subscriptionProcessorConflict,proto3,oneof"` -} - -func (*SetDefaultPaymentMethodResponse_Success) isSetDefaultPaymentMethodResponse_Response() {} - -func (*SetDefaultPaymentMethodResponse_SubscriberNotFound) isSetDefaultPaymentMethodResponse_Response() { -} - -func (*SetDefaultPaymentMethodResponse_SubscriberIdMismatch) isSetDefaultPaymentMethodResponse_Response() { -} - -func (*SetDefaultPaymentMethodResponse_PaymentMethodNotSetUp) isSetDefaultPaymentMethodResponse_Response() { -} - -func (*SetDefaultPaymentMethodResponse_SubscriptionProcessorConflict) isSetDefaultPaymentMethodResponse_Response() { -} - -type SetSubscriptionLevelRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - Level uint64 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"` - Currency string `protobuf:"bytes,3,opt,name=currency,proto3" json:"currency,omitempty"` - IdempotencyKey string `protobuf:"bytes,4,opt,name=idempotencyKey,proto3" json:"idempotencyKey,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetSubscriptionLevelRequest) Reset() { - *x = SetSubscriptionLevelRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetSubscriptionLevelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetSubscriptionLevelRequest) ProtoMessage() {} - -func (x *SetSubscriptionLevelRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 SetSubscriptionLevelRequest.ProtoReflect.Descriptor instead. -func (*SetSubscriptionLevelRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{10} -} - -func (x *SetSubscriptionLevelRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *SetSubscriptionLevelRequest) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *SetSubscriptionLevelRequest) GetCurrency() string { - if x != nil { - return x.Currency - } - return "" -} - -func (x *SetSubscriptionLevelRequest) GetIdempotencyKey() string { - if x != nil { - return x.IdempotencyKey - } - return "" -} - -// Meaningfully interpreting chargeFailure response fields requires inspecting the processor field first. -// -// For Stripe, code will be one of the [codes defined here](https://stripe.com/docs/api/charges/object#charge_object-failure_code), -// while message [may contain a further textual description](https://stripe.com/docs/api/charges/object#charge_object-failure_message). -// The outcome fields are optional, but present values will directly map to Stripe [response properties](https://stripe.com/docs/api/charges/object#charge_object-outcome-network_status) -// -// For Braintree, the outcome fields will be null. The code and message will contain one of -// - a processor decline code (as a string) in code, and associated text in message, as defined this [table](https://developer.paypal.com/braintree/docs/reference/general/processor-responses/authorization-responses) -// - `gateway` in code, with a [reason](https://developer.paypal.com/braintree/articles/control-panel/transactions/gateway-rejections) in message -// - `code` = "unknown", message = "unknown" -// -// IAP payment processors will never include charge failure information, and detailed order information should be -// retrieved from the payment processor directly -type ChargeFailure struct { - state protoimpl.MessageState `protogen:"open.v1"` - Processor PaymentProvider `protobuf:"varint,1,opt,name=processor,proto3,enum=org.signal.chat.purchase.PaymentProvider" json:"processor,omitempty"` - // See [Stripe failure codes](https://stripe.com/docs/api/charges/object#charge_object-failure_code) or - // [Braintree decline codes](https://developer.paypal.com/braintree/docs/reference/general/processor-responses/authorization-responses#decline-codes) - // depending on which processor was used - Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` - // See [Stripe failure codes](https://stripe.com/docs/api/charges/object#charge_object-failure_code) or - // [Braintree decline codes](https://developer.paypal.com/braintree/docs/reference/general/processor-responses/authorization-responses#decline-codes) - // depending on which processor was used - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` - // See [Outcome Network Status](https://stripe.com/docs/api/charges/object#charge_object-outcome-network_status) - OutcomeNetworkStatus *string `protobuf:"bytes,4,opt,name=outcome_network_status,json=outcomeNetworkStatus,proto3,oneof" json:"outcome_network_status,omitempty"` - // See [Outcome Reason](https://stripe.com/docs/api/charges/object#charge_object-outcome-reason) - OutcomeReason *string `protobuf:"bytes,5,opt,name=outcome_reason,json=outcomeReason,proto3,oneof" json:"outcome_reason,omitempty"` - // See [Outcome Type](https://stripe.com/docs/api/charges/object#charge_object-outcome-type) - OutcomeType *string `protobuf:"bytes,6,opt,name=outcome_type,json=outcomeType,proto3,oneof" json:"outcome_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChargeFailure) Reset() { - *x = ChargeFailure{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChargeFailure) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChargeFailure) ProtoMessage() {} - -func (x *ChargeFailure) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[11] - 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 ChargeFailure.ProtoReflect.Descriptor instead. -func (*ChargeFailure) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{11} -} - -func (x *ChargeFailure) GetProcessor() PaymentProvider { - if x != nil { - return x.Processor - } - return PaymentProvider_PAYMENT_PROVIDER_UNKNOWN -} - -func (x *ChargeFailure) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -func (x *ChargeFailure) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *ChargeFailure) GetOutcomeNetworkStatus() string { - if x != nil && x.OutcomeNetworkStatus != nil { - return *x.OutcomeNetworkStatus - } - return "" -} - -func (x *ChargeFailure) GetOutcomeReason() string { - if x != nil && x.OutcomeReason != nil { - return *x.OutcomeReason - } - return "" -} - -func (x *ChargeFailure) GetOutcomeType() string { - if x != nil && x.OutcomeType != nil { - return *x.OutcomeType - } - return "" -} - -type PaymentRequired struct { - state protoimpl.MessageState `protogen:"open.v1"` - ChargeFailure *ChargeFailure `protobuf:"bytes,1,opt,name=charge_failure,json=chargeFailure,proto3,oneof" json:"charge_failure,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentRequired) Reset() { - *x = PaymentRequired{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentRequired) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentRequired) ProtoMessage() {} - -func (x *PaymentRequired) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 PaymentRequired.ProtoReflect.Descriptor instead. -func (*PaymentRequired) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{12} -} - -func (x *PaymentRequired) GetChargeFailure() *ChargeFailure { - if x != nil { - return x.ChargeFailure - } - return nil -} - -type SetSubscriptionLevelResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetSubscriptionLevelResponse_Success - // *SetSubscriptionLevelResponse_SubscriberNotFound - // *SetSubscriptionLevelResponse_SubscriberIdMismatch - // *SetSubscriptionLevelResponse_SubscriptionProcessorConflict - // *SetSubscriptionLevelResponse_PaymentMethodNotSetUp - // *SetSubscriptionLevelResponse_UnsupportedOperation - // *SetSubscriptionLevelResponse_UnsupportedLevel - // *SetSubscriptionLevelResponse_UnsupportedCurrency - // *SetSubscriptionLevelResponse_PaymentRequiresAction - // *SetSubscriptionLevelResponse_InvalidLevelTransition - // *SetSubscriptionLevelResponse_InvalidIdempotencyKey - // *SetSubscriptionLevelResponse_ChargeFailure - Response isSetSubscriptionLevelResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetSubscriptionLevelResponse) Reset() { - *x = SetSubscriptionLevelResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetSubscriptionLevelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetSubscriptionLevelResponse) ProtoMessage() {} - -func (x *SetSubscriptionLevelResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 SetSubscriptionLevelResponse.ProtoReflect.Descriptor instead. -func (*SetSubscriptionLevelResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{13} -} - -func (x *SetSubscriptionLevelResponse) GetResponse() isSetSubscriptionLevelResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetSuccess() *SetSubscriptionLevelResponse_SetSubscriptionLevelResult { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetSubscriptionProcessorConflict() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_SubscriptionProcessorConflict); ok { - return x.SubscriptionProcessorConflict - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetPaymentMethodNotSetUp() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_PaymentMethodNotSetUp); ok { - return x.PaymentMethodNotSetUp - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetUnsupportedOperation() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_UnsupportedOperation); ok { - return x.UnsupportedOperation - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetUnsupportedLevel() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_UnsupportedLevel); ok { - return x.UnsupportedLevel - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetUnsupportedCurrency() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_UnsupportedCurrency); ok { - return x.UnsupportedCurrency - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetPaymentRequiresAction() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_PaymentRequiresAction); ok { - return x.PaymentRequiresAction - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetInvalidLevelTransition() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_InvalidLevelTransition); ok { - return x.InvalidLevelTransition - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetInvalidIdempotencyKey() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_InvalidIdempotencyKey); ok { - return x.InvalidIdempotencyKey - } - } - return nil -} - -func (x *SetSubscriptionLevelResponse) GetChargeFailure() *ChargeFailure { - if x != nil { - if x, ok := x.Response.(*SetSubscriptionLevelResponse_ChargeFailure); ok { - return x.ChargeFailure - } - } - return nil -} - -type isSetSubscriptionLevelResponse_Response interface { - isSetSubscriptionLevelResponse_Response() -} - -type SetSubscriptionLevelResponse_Success struct { - Success *SetSubscriptionLevelResponse_SetSubscriptionLevelResult `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_SubscriptionProcessorConflict struct { - // New payment processor does not match existing processor associated with the subscription - SubscriptionProcessorConflict *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=subscription_processor_conflict,json=subscriptionProcessorConflict,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_PaymentMethodNotSetUp struct { - PaymentMethodNotSetUp *errors.FailedPrecondition `protobuf:"bytes,5,opt,name=payment_method_not_set_up,json=paymentMethodNotSetUp,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_UnsupportedOperation struct { - // The payment processor does not support this operation - UnsupportedOperation *errors.FailedPrecondition `protobuf:"bytes,6,opt,name=unsupported_operation,json=unsupportedOperation,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_UnsupportedLevel struct { - // The requested level was invalid - UnsupportedLevel *errors.FailedPrecondition `protobuf:"bytes,7,opt,name=unsupported_level,json=unsupportedLevel,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_UnsupportedCurrency struct { - // The requested currency was invalid - UnsupportedCurrency *errors.FailedPrecondition `protobuf:"bytes,8,opt,name=unsupported_currency,json=unsupportedCurrency,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_PaymentRequiresAction struct { - // The card could not be charged - PaymentRequiresAction *errors.FailedPrecondition `protobuf:"bytes,9,opt,name=payment_requires_action,json=paymentRequiresAction,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_InvalidLevelTransition struct { - // Cannot transition from existing level to the requested level - InvalidLevelTransition *errors.FailedPrecondition `protobuf:"bytes,10,opt,name=invalid_level_transition,json=invalidLevelTransition,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_InvalidIdempotencyKey struct { - // The idempotency key was invalid or re-used with a modified request - InvalidIdempotencyKey *errors.FailedPrecondition `protobuf:"bytes,11,opt,name=invalid_idempotency_key,json=invalidIdempotencyKey,proto3,oneof"` -} - -type SetSubscriptionLevelResponse_ChargeFailure struct { - // The payment failed; see charge failure details - ChargeFailure *ChargeFailure `protobuf:"bytes,12,opt,name=charge_failure,json=chargeFailure,proto3,oneof"` -} - -func (*SetSubscriptionLevelResponse_Success) isSetSubscriptionLevelResponse_Response() {} - -func (*SetSubscriptionLevelResponse_SubscriberNotFound) isSetSubscriptionLevelResponse_Response() {} - -func (*SetSubscriptionLevelResponse_SubscriberIdMismatch) isSetSubscriptionLevelResponse_Response() {} - -func (*SetSubscriptionLevelResponse_SubscriptionProcessorConflict) isSetSubscriptionLevelResponse_Response() { -} - -func (*SetSubscriptionLevelResponse_PaymentMethodNotSetUp) isSetSubscriptionLevelResponse_Response() { -} - -func (*SetSubscriptionLevelResponse_UnsupportedOperation) isSetSubscriptionLevelResponse_Response() {} - -func (*SetSubscriptionLevelResponse_UnsupportedLevel) isSetSubscriptionLevelResponse_Response() {} - -func (*SetSubscriptionLevelResponse_UnsupportedCurrency) isSetSubscriptionLevelResponse_Response() {} - -func (*SetSubscriptionLevelResponse_PaymentRequiresAction) isSetSubscriptionLevelResponse_Response() { -} - -func (*SetSubscriptionLevelResponse_InvalidLevelTransition) isSetSubscriptionLevelResponse_Response() { -} - -func (*SetSubscriptionLevelResponse_InvalidIdempotencyKey) isSetSubscriptionLevelResponse_Response() { -} - -func (*SetSubscriptionLevelResponse_ChargeFailure) isSetSubscriptionLevelResponse_Response() {} - -type SetIapSubscriptionRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - // Types that are valid to be assigned to Request: - // - // *SetIapSubscriptionRequest_AppStore - // *SetIapSubscriptionRequest_PlayBilling - Request isSetIapSubscriptionRequest_Request `protobuf_oneof:"request"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetIapSubscriptionRequest) Reset() { - *x = SetIapSubscriptionRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetIapSubscriptionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetIapSubscriptionRequest) ProtoMessage() {} - -func (x *SetIapSubscriptionRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 SetIapSubscriptionRequest.ProtoReflect.Descriptor instead. -func (*SetIapSubscriptionRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{14} -} - -func (x *SetIapSubscriptionRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *SetIapSubscriptionRequest) GetRequest() isSetIapSubscriptionRequest_Request { - if x != nil { - return x.Request - } - return nil -} - -func (x *SetIapSubscriptionRequest) GetAppStore() *SetIapSubscriptionRequest_AppStorePurchase { - if x != nil { - if x, ok := x.Request.(*SetIapSubscriptionRequest_AppStore); ok { - return x.AppStore - } - } - return nil -} - -func (x *SetIapSubscriptionRequest) GetPlayBilling() *SetIapSubscriptionRequest_PlayBillingPurchase { - if x != nil { - if x, ok := x.Request.(*SetIapSubscriptionRequest_PlayBilling); ok { - return x.PlayBilling - } - } - return nil -} - -type isSetIapSubscriptionRequest_Request interface { - isSetIapSubscriptionRequest_Request() -} - -type SetIapSubscriptionRequest_AppStore struct { - AppStore *SetIapSubscriptionRequest_AppStorePurchase `protobuf:"bytes,2,opt,name=app_store,json=appStore,proto3,oneof"` -} - -type SetIapSubscriptionRequest_PlayBilling struct { - PlayBilling *SetIapSubscriptionRequest_PlayBillingPurchase `protobuf:"bytes,3,opt,name=play_billing,json=playBilling,proto3,oneof"` -} - -func (*SetIapSubscriptionRequest_AppStore) isSetIapSubscriptionRequest_Request() {} - -func (*SetIapSubscriptionRequest_PlayBilling) isSetIapSubscriptionRequest_Request() {} - -type SetIapSubscriptionResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *SetIapSubscriptionResponse_Success - // *SetIapSubscriptionResponse_SubscriberNotFound - // *SetIapSubscriptionResponse_SubscriberIdMismatch - // *SetIapSubscriptionResponse_SubscriptionProcessorConflict - // *SetIapSubscriptionResponse_PaymentRequired - // *SetIapSubscriptionResponse_InvalidTransaction - Response isSetIapSubscriptionResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetIapSubscriptionResponse) Reset() { - *x = SetIapSubscriptionResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetIapSubscriptionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetIapSubscriptionResponse) ProtoMessage() {} - -func (x *SetIapSubscriptionResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 SetIapSubscriptionResponse.ProtoReflect.Descriptor instead. -func (*SetIapSubscriptionResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{15} -} - -func (x *SetIapSubscriptionResponse) GetResponse() isSetIapSubscriptionResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *SetIapSubscriptionResponse) GetSuccess() *SetIapSubscriptionResponse_SetIapSubscriptionResult { - if x != nil { - if x, ok := x.Response.(*SetIapSubscriptionResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *SetIapSubscriptionResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*SetIapSubscriptionResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *SetIapSubscriptionResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*SetIapSubscriptionResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -func (x *SetIapSubscriptionResponse) GetSubscriptionProcessorConflict() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetIapSubscriptionResponse_SubscriptionProcessorConflict); ok { - return x.SubscriptionProcessorConflict - } - } - return nil -} - -func (x *SetIapSubscriptionResponse) GetPaymentRequired() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetIapSubscriptionResponse_PaymentRequired); ok { - return x.PaymentRequired - } - } - return nil -} - -func (x *SetIapSubscriptionResponse) GetInvalidTransaction() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*SetIapSubscriptionResponse_InvalidTransaction); ok { - return x.InvalidTransaction - } - } - return nil -} - -type isSetIapSubscriptionResponse_Response interface { - isSetIapSubscriptionResponse_Response() -} - -type SetIapSubscriptionResponse_Success struct { - Success *SetIapSubscriptionResponse_SetIapSubscriptionResult `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type SetIapSubscriptionResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type SetIapSubscriptionResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -type SetIapSubscriptionResponse_SubscriptionProcessorConflict struct { - // New payment processor does not match existing processor associated with the subscription - SubscriptionProcessorConflict *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=subscription_processor_conflict,json=subscriptionProcessorConflict,proto3,oneof"` -} - -type SetIapSubscriptionResponse_PaymentRequired struct { - PaymentRequired *errors.FailedPrecondition `protobuf:"bytes,5,opt,name=payment_required,json=paymentRequired,proto3,oneof"` -} - -type SetIapSubscriptionResponse_InvalidTransaction struct { - InvalidTransaction *errors.FailedPrecondition `protobuf:"bytes,6,opt,name=invalid_transaction,json=invalidTransaction,proto3,oneof"` -} - -func (*SetIapSubscriptionResponse_Success) isSetIapSubscriptionResponse_Response() {} - -func (*SetIapSubscriptionResponse_SubscriberNotFound) isSetIapSubscriptionResponse_Response() {} - -func (*SetIapSubscriptionResponse_SubscriberIdMismatch) isSetIapSubscriptionResponse_Response() {} - -func (*SetIapSubscriptionResponse_SubscriptionProcessorConflict) isSetIapSubscriptionResponse_Response() { -} - -func (*SetIapSubscriptionResponse_PaymentRequired) isSetIapSubscriptionResponse_Response() {} - -func (*SetIapSubscriptionResponse_InvalidTransaction) isSetIapSubscriptionResponse_Response() {} - -type GetReceiptCredentialsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - ReceiptCredentialRequest []byte `protobuf:"bytes,2,opt,name=receiptCredentialRequest,proto3" json:"receiptCredentialRequest,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetReceiptCredentialsRequest) Reset() { - *x = GetReceiptCredentialsRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetReceiptCredentialsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReceiptCredentialsRequest) ProtoMessage() {} - -func (x *GetReceiptCredentialsRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[16] - 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 GetReceiptCredentialsRequest.ProtoReflect.Descriptor instead. -func (*GetReceiptCredentialsRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{16} -} - -func (x *GetReceiptCredentialsRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *GetReceiptCredentialsRequest) GetReceiptCredentialRequest() []byte { - if x != nil { - return x.ReceiptCredentialRequest - } - return nil -} - -type GetReceiptCredentialsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetReceiptCredentialsResponse_Success - // *GetReceiptCredentialsResponse_SubscriberNotFound - // *GetReceiptCredentialsResponse_SubscriberIdMismatch - // *GetReceiptCredentialsResponse_NoPaidInvoice - // *GetReceiptCredentialsResponse_PaymentRequired - // *GetReceiptCredentialsResponse_AlreadyRedeemed - Response isGetReceiptCredentialsResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetReceiptCredentialsResponse) Reset() { - *x = GetReceiptCredentialsResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetReceiptCredentialsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReceiptCredentialsResponse) ProtoMessage() {} - -func (x *GetReceiptCredentialsResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[17] - 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 GetReceiptCredentialsResponse.ProtoReflect.Descriptor instead. -func (*GetReceiptCredentialsResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{17} -} - -func (x *GetReceiptCredentialsResponse) GetResponse() isGetReceiptCredentialsResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetReceiptCredentialsResponse) GetSuccess() *GetReceiptCredentialsResponse_GetReceiptCredentialsResult { - if x != nil { - if x, ok := x.Response.(*GetReceiptCredentialsResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *GetReceiptCredentialsResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetReceiptCredentialsResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *GetReceiptCredentialsResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*GetReceiptCredentialsResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -func (x *GetReceiptCredentialsResponse) GetNoPaidInvoice() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*GetReceiptCredentialsResponse_NoPaidInvoice); ok { - return x.NoPaidInvoice - } - } - return nil -} - -func (x *GetReceiptCredentialsResponse) GetPaymentRequired() *PaymentRequired { - if x != nil { - if x, ok := x.Response.(*GetReceiptCredentialsResponse_PaymentRequired); ok { - return x.PaymentRequired - } - } - return nil -} - -func (x *GetReceiptCredentialsResponse) GetAlreadyRedeemed() *errors.FailedPrecondition { - if x != nil { - if x, ok := x.Response.(*GetReceiptCredentialsResponse_AlreadyRedeemed); ok { - return x.AlreadyRedeemed - } - } - return nil -} - -type isGetReceiptCredentialsResponse_Response interface { - isGetReceiptCredentialsResponse_Response() -} - -type GetReceiptCredentialsResponse_Success struct { - Success *GetReceiptCredentialsResponse_GetReceiptCredentialsResult `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type GetReceiptCredentialsResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,2,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type GetReceiptCredentialsResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,3,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -type GetReceiptCredentialsResponse_NoPaidInvoice struct { - // No invoice has been issued for this subscription OR invoice is in 'draft' or 'open' state - NoPaidInvoice *errors.FailedPrecondition `protobuf:"bytes,4,opt,name=no_paid_invoice,json=noPaidInvoice,proto3,oneof"` -} - -type GetReceiptCredentialsResponse_PaymentRequired struct { - // Invoice is in any state other than 'draft', 'open', or 'paid'; Charge failure details may be present - PaymentRequired *PaymentRequired `protobuf:"bytes,5,opt,name=payment_required,json=paymentRequired,proto3,oneof"` -} - -type GetReceiptCredentialsResponse_AlreadyRedeemed struct { - // Latest paid receipt on subscription was already redeemed for a receipt credential but with a different GetReceiptCredentialRequest - AlreadyRedeemed *errors.FailedPrecondition `protobuf:"bytes,6,opt,name=already_redeemed,json=alreadyRedeemed,proto3,oneof"` -} - -func (*GetReceiptCredentialsResponse_Success) isGetReceiptCredentialsResponse_Response() {} - -func (*GetReceiptCredentialsResponse_SubscriberNotFound) isGetReceiptCredentialsResponse_Response() {} - -func (*GetReceiptCredentialsResponse_SubscriberIdMismatch) isGetReceiptCredentialsResponse_Response() { -} - -func (*GetReceiptCredentialsResponse_NoPaidInvoice) isGetReceiptCredentialsResponse_Response() {} - -func (*GetReceiptCredentialsResponse_PaymentRequired) isGetReceiptCredentialsResponse_Response() {} - -func (*GetReceiptCredentialsResponse_AlreadyRedeemed) isGetReceiptCredentialsResponse_Response() {} - -type GetSubscriptionInformationRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSubscriptionInformationRequest) Reset() { - *x = GetSubscriptionInformationRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSubscriptionInformationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSubscriptionInformationRequest) ProtoMessage() {} - -func (x *GetSubscriptionInformationRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[18] - 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 GetSubscriptionInformationRequest.ProtoReflect.Descriptor instead. -func (*GetSubscriptionInformationRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{18} -} - -func (x *GetSubscriptionInformationRequest) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -type GetSubscriptionInformationResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Response: - // - // *GetSubscriptionInformationResponse_Success - // *GetSubscriptionInformationResponse_NoSubscription - // *GetSubscriptionInformationResponse_SubscriberNotFound - // *GetSubscriptionInformationResponse_SubscriberIdMismatch - Response isGetSubscriptionInformationResponse_Response `protobuf_oneof:"response"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSubscriptionInformationResponse) Reset() { - *x = GetSubscriptionInformationResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSubscriptionInformationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSubscriptionInformationResponse) ProtoMessage() {} - -func (x *GetSubscriptionInformationResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[19] - 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 GetSubscriptionInformationResponse.ProtoReflect.Descriptor instead. -func (*GetSubscriptionInformationResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{19} -} - -func (x *GetSubscriptionInformationResponse) GetResponse() isGetSubscriptionInformationResponse_Response { - if x != nil { - return x.Response - } - return nil -} - -func (x *GetSubscriptionInformationResponse) GetSuccess() *GetSubscriptionInformationResponse_Subscription { - if x != nil { - if x, ok := x.Response.(*GetSubscriptionInformationResponse_Success); ok { - return x.Success - } - } - return nil -} - -func (x *GetSubscriptionInformationResponse) GetNoSubscription() *emptypb.Empty { - if x != nil { - if x, ok := x.Response.(*GetSubscriptionInformationResponse_NoSubscription); ok { - return x.NoSubscription - } - } - return nil -} - -func (x *GetSubscriptionInformationResponse) GetSubscriberNotFound() *errors.NotFound { - if x != nil { - if x, ok := x.Response.(*GetSubscriptionInformationResponse_SubscriberNotFound); ok { - return x.SubscriberNotFound - } - } - return nil -} - -func (x *GetSubscriptionInformationResponse) GetSubscriberIdMismatch() *errors.FailedUnidentifiedAuthorization { - if x != nil { - if x, ok := x.Response.(*GetSubscriptionInformationResponse_SubscriberIdMismatch); ok { - return x.SubscriberIdMismatch - } - } - return nil -} - -type isGetSubscriptionInformationResponse_Response interface { - isGetSubscriptionInformationResponse_Response() -} - -type GetSubscriptionInformationResponse_Success struct { - Success *GetSubscriptionInformationResponse_Subscription `protobuf:"bytes,1,opt,name=success,proto3,oneof"` -} - -type GetSubscriptionInformationResponse_NoSubscription struct { - NoSubscription *emptypb.Empty `protobuf:"bytes,2,opt,name=no_subscription,json=noSubscription,proto3,oneof"` -} - -type GetSubscriptionInformationResponse_SubscriberNotFound struct { - SubscriberNotFound *errors.NotFound `protobuf:"bytes,3,opt,name=subscriber_not_found,json=subscriberNotFound,proto3,oneof"` -} - -type GetSubscriptionInformationResponse_SubscriberIdMismatch struct { - // subscriberId authentication failure - SubscriberIdMismatch *errors.FailedUnidentifiedAuthorization `protobuf:"bytes,4,opt,name=subscriber_id_mismatch,json=subscriberIdMismatch,proto3,oneof"` -} - -func (*GetSubscriptionInformationResponse_Success) isGetSubscriptionInformationResponse_Response() {} - -func (*GetSubscriptionInformationResponse_NoSubscription) isGetSubscriptionInformationResponse_Response() { -} - -func (*GetSubscriptionInformationResponse_SubscriberNotFound) isGetSubscriptionInformationResponse_Response() { -} - -func (*GetSubscriptionInformationResponse_SubscriberIdMismatch) isGetSubscriptionInformationResponse_Response() { -} - -type GetBankMandateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - BankTransferType BankTransferType `protobuf:"varint,1,opt,name=bank_transfer_type,json=bankTransferType,proto3,enum=org.signal.chat.purchase.BankTransferType" json:"bank_transfer_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBankMandateRequest) Reset() { - *x = GetBankMandateRequest{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBankMandateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBankMandateRequest) ProtoMessage() {} - -func (x *GetBankMandateRequest) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 GetBankMandateRequest.ProtoReflect.Descriptor instead. -func (*GetBankMandateRequest) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{20} -} - -func (x *GetBankMandateRequest) GetBankTransferType() BankTransferType { - if x != nil { - return x.BankTransferType - } - return BankTransferType_BANK_TRANSFER_TYPE_UNKNOWN -} - -type GetBankMandateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Mandate string `protobuf:"bytes,1,opt,name=mandate,proto3" json:"mandate,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBankMandateResponse) Reset() { - *x = GetBankMandateResponse{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBankMandateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBankMandateResponse) ProtoMessage() {} - -func (x *GetBankMandateResponse) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[21] - 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 GetBankMandateResponse.ProtoReflect.Descriptor instead. -func (*GetBankMandateResponse) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{21} -} - -func (x *GetBankMandateResponse) GetMandate() string { - if x != nil { - return x.Mandate - } - return "" -} - -type CreatePaymentMethodResponse_CreatePaymentMethodResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - ClientSecret string `protobuf:"bytes,1,opt,name=clientSecret,proto3" json:"clientSecret,omitempty"` - PaymentProvider PaymentProvider `protobuf:"varint,2,opt,name=paymentProvider,proto3,enum=org.signal.chat.purchase.PaymentProvider" json:"paymentProvider,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePaymentMethodResponse_CreatePaymentMethodResult) Reset() { - *x = CreatePaymentMethodResponse_CreatePaymentMethodResult{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePaymentMethodResponse_CreatePaymentMethodResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePaymentMethodResponse_CreatePaymentMethodResult) ProtoMessage() {} - -func (x *CreatePaymentMethodResponse_CreatePaymentMethodResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[22] - 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 CreatePaymentMethodResponse_CreatePaymentMethodResult.ProtoReflect.Descriptor instead. -func (*CreatePaymentMethodResponse_CreatePaymentMethodResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *CreatePaymentMethodResponse_CreatePaymentMethodResult) GetClientSecret() string { - if x != nil { - return x.ClientSecret - } - return "" -} - -func (x *CreatePaymentMethodResponse_CreatePaymentMethodResult) GetPaymentProvider() PaymentProvider { - if x != nil { - return x.PaymentProvider - } - return PaymentProvider_PAYMENT_PROVIDER_UNKNOWN -} - -type CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - // a URL to open where the user may approve the payment - ApprovalUrl string `protobuf:"bytes,1,opt,name=approvalUrl,proto3" json:"approvalUrl,omitempty"` - // an opaque PayPal payment identifier to use with SetDefaultPaymentMethodRequest - Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult) Reset() { - *x = CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult) ProtoMessage() {} - -func (x *CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[23] - 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 CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult.ProtoReflect.Descriptor instead. -func (*CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult) GetApprovalUrl() string { - if x != nil { - return x.ApprovalUrl - } - return "" -} - -func (x *CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -type SetDefaultPaymentMethodRequest_StripePaymentMethod struct { - state protoimpl.MessageState `protogen:"open.v1"` - PaymentMethodToken string `protobuf:"bytes,1,opt,name=paymentMethodToken,proto3" json:"paymentMethodToken,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDefaultPaymentMethodRequest_StripePaymentMethod) Reset() { - *x = SetDefaultPaymentMethodRequest_StripePaymentMethod{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDefaultPaymentMethodRequest_StripePaymentMethod) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDefaultPaymentMethodRequest_StripePaymentMethod) ProtoMessage() {} - -func (x *SetDefaultPaymentMethodRequest_StripePaymentMethod) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[24] - 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 SetDefaultPaymentMethodRequest_StripePaymentMethod.ProtoReflect.Descriptor instead. -func (*SetDefaultPaymentMethodRequest_StripePaymentMethod) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{8, 0} -} - -func (x *SetDefaultPaymentMethodRequest_StripePaymentMethod) GetPaymentMethodToken() string { - if x != nil { - return x.PaymentMethodToken - } - return "" -} - -type SetDefaultPaymentMethodRequest_BraintreePaymentMethod struct { - state protoimpl.MessageState `protogen:"open.v1"` - PaymentMethodToken string `protobuf:"bytes,1,opt,name=paymentMethodToken,proto3" json:"paymentMethodToken,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDefaultPaymentMethodRequest_BraintreePaymentMethod) Reset() { - *x = SetDefaultPaymentMethodRequest_BraintreePaymentMethod{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDefaultPaymentMethodRequest_BraintreePaymentMethod) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDefaultPaymentMethodRequest_BraintreePaymentMethod) ProtoMessage() {} - -func (x *SetDefaultPaymentMethodRequest_BraintreePaymentMethod) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[25] - 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 SetDefaultPaymentMethodRequest_BraintreePaymentMethod.ProtoReflect.Descriptor instead. -func (*SetDefaultPaymentMethodRequest_BraintreePaymentMethod) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{8, 1} -} - -func (x *SetDefaultPaymentMethodRequest_BraintreePaymentMethod) GetPaymentMethodToken() string { - if x != nil { - return x.PaymentMethodToken - } - return "" -} - -type SetDefaultPaymentMethodRequest_SepaPaymentMethod struct { - state protoimpl.MessageState `protogen:"open.v1"` - SetupIntentId string `protobuf:"bytes,1,opt,name=setupIntentId,proto3" json:"setupIntentId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetDefaultPaymentMethodRequest_SepaPaymentMethod) Reset() { - *x = SetDefaultPaymentMethodRequest_SepaPaymentMethod{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetDefaultPaymentMethodRequest_SepaPaymentMethod) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetDefaultPaymentMethodRequest_SepaPaymentMethod) ProtoMessage() {} - -func (x *SetDefaultPaymentMethodRequest_SepaPaymentMethod) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[26] - 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 SetDefaultPaymentMethodRequest_SepaPaymentMethod.ProtoReflect.Descriptor instead. -func (*SetDefaultPaymentMethodRequest_SepaPaymentMethod) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{8, 2} -} - -func (x *SetDefaultPaymentMethodRequest_SepaPaymentMethod) GetSetupIntentId() string { - if x != nil { - return x.SetupIntentId - } - return "" -} - -type SetSubscriptionLevelResponse_SetSubscriptionLevelResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Level uint64 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetSubscriptionLevelResponse_SetSubscriptionLevelResult) Reset() { - *x = SetSubscriptionLevelResponse_SetSubscriptionLevelResult{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetSubscriptionLevelResponse_SetSubscriptionLevelResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetSubscriptionLevelResponse_SetSubscriptionLevelResult) ProtoMessage() {} - -func (x *SetSubscriptionLevelResponse_SetSubscriptionLevelResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[27] - 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 SetSubscriptionLevelResponse_SetSubscriptionLevelResult.ProtoReflect.Descriptor instead. -func (*SetSubscriptionLevelResponse_SetSubscriptionLevelResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{13, 0} -} - -func (x *SetSubscriptionLevelResponse_SetSubscriptionLevelResult) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -type SetIapSubscriptionRequest_AppStorePurchase struct { - state protoimpl.MessageState `protogen:"open.v1"` - OriginalTransactionId string `protobuf:"bytes,1,opt,name=original_transaction_id,json=originalTransactionId,proto3" json:"original_transaction_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetIapSubscriptionRequest_AppStorePurchase) Reset() { - *x = SetIapSubscriptionRequest_AppStorePurchase{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetIapSubscriptionRequest_AppStorePurchase) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetIapSubscriptionRequest_AppStorePurchase) ProtoMessage() {} - -func (x *SetIapSubscriptionRequest_AppStorePurchase) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[28] - 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 SetIapSubscriptionRequest_AppStorePurchase.ProtoReflect.Descriptor instead. -func (*SetIapSubscriptionRequest_AppStorePurchase) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{14, 0} -} - -func (x *SetIapSubscriptionRequest_AppStorePurchase) GetOriginalTransactionId() string { - if x != nil { - return x.OriginalTransactionId - } - return "" -} - -type SetIapSubscriptionRequest_PlayBillingPurchase struct { - state protoimpl.MessageState `protogen:"open.v1"` - PurchaseToken string `protobuf:"bytes,1,opt,name=purchase_token,json=purchaseToken,proto3" json:"purchase_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetIapSubscriptionRequest_PlayBillingPurchase) Reset() { - *x = SetIapSubscriptionRequest_PlayBillingPurchase{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetIapSubscriptionRequest_PlayBillingPurchase) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetIapSubscriptionRequest_PlayBillingPurchase) ProtoMessage() {} - -func (x *SetIapSubscriptionRequest_PlayBillingPurchase) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[29] - 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 SetIapSubscriptionRequest_PlayBillingPurchase.ProtoReflect.Descriptor instead. -func (*SetIapSubscriptionRequest_PlayBillingPurchase) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{14, 1} -} - -func (x *SetIapSubscriptionRequest_PlayBillingPurchase) GetPurchaseToken() string { - if x != nil { - return x.PurchaseToken - } - return "" -} - -type SetIapSubscriptionResponse_SetIapSubscriptionResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - Level uint64 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SetIapSubscriptionResponse_SetIapSubscriptionResult) Reset() { - *x = SetIapSubscriptionResponse_SetIapSubscriptionResult{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SetIapSubscriptionResponse_SetIapSubscriptionResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetIapSubscriptionResponse_SetIapSubscriptionResult) ProtoMessage() {} - -func (x *SetIapSubscriptionResponse_SetIapSubscriptionResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[30] - 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 SetIapSubscriptionResponse_SetIapSubscriptionResult.ProtoReflect.Descriptor instead. -func (*SetIapSubscriptionResponse_SetIapSubscriptionResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{15, 0} -} - -func (x *SetIapSubscriptionResponse_SetIapSubscriptionResult) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -type GetReceiptCredentialsResponse_GetReceiptCredentialsResult struct { - state protoimpl.MessageState `protogen:"open.v1"` - ReceiptCredentialResponse []byte `protobuf:"bytes,1,opt,name=receiptCredentialResponse,proto3" json:"receiptCredentialResponse,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetReceiptCredentialsResponse_GetReceiptCredentialsResult) Reset() { - *x = GetReceiptCredentialsResponse_GetReceiptCredentialsResult{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetReceiptCredentialsResponse_GetReceiptCredentialsResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReceiptCredentialsResponse_GetReceiptCredentialsResult) ProtoMessage() {} - -func (x *GetReceiptCredentialsResponse_GetReceiptCredentialsResult) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[31] - 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 GetReceiptCredentialsResponse_GetReceiptCredentialsResult.ProtoReflect.Descriptor instead. -func (*GetReceiptCredentialsResponse_GetReceiptCredentialsResult) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{17, 0} -} - -func (x *GetReceiptCredentialsResponse_GetReceiptCredentialsResult) GetReceiptCredentialResponse() []byte { - if x != nil { - return x.ReceiptCredentialResponse - } - return nil -} - -type GetSubscriptionInformationResponse_Subscription struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The subscription level - Level uint64 `protobuf:"varint,1,opt,name=level,proto3" json:"level,omitempty"` - // If present, UNIX Epoch Timestamp in seconds, can be used to calculate next billing date. - BillingCycleAnchor *uint64 `protobuf:"varint,2,opt,name=billing_cycle_anchor,json=billingCycleAnchor,proto3,oneof" json:"billing_cycle_anchor,omitempty"` - // UNIX Epoch Timestamp in seconds, when the current subscription period ends - EndOfCurrentPeriod uint64 `protobuf:"varint,3,opt,name=end_of_current_period,json=endOfCurrentPeriod,proto3" json:"end_of_current_period,omitempty"` - // Whether there is a currently active subscription - Active bool `protobuf:"varint,4,opt,name=active,proto3" json:"active,omitempty"` - // If true, an active subscription will not auto-renew at the end of the current period - CancelAtPeriodEnd bool `protobuf:"varint,5,opt,name=cancel_at_period_end,json=cancelAtPeriodEnd,proto3" json:"cancel_at_period_end,omitempty"` - // A three-letter ISO 4217 currency code for currency used in the subscription - Currency string `protobuf:"bytes,6,opt,name=currency,proto3" json:"currency,omitempty"` - // The amount paid for the subscription in the currency's smallest unit - Amount uint64 `protobuf:"varint,7,opt,name=amount,proto3" json:"amount,omitempty"` - // The subscription's status, mapped to Stripe's statuses. trialing will never be returned - Status SubscriptionStatus `protobuf:"varint,8,opt,name=status,proto3,enum=org.signal.chat.purchase.SubscriptionStatus" json:"status,omitempty"` - // The payment provider associated with the subscription - Processor PaymentProvider `protobuf:"varint,9,opt,name=processor,proto3,enum=org.signal.chat.purchase.PaymentProvider" json:"processor,omitempty"` - // The payment method associated with the subscription - PaymentMethod PaymentMethod `protobuf:"varint,10,opt,name=payment_method,json=paymentMethod,proto3,enum=org.signal.chat.purchase.PaymentMethod" json:"payment_method,omitempty"` - // Whether the latest charge for the subscription is in a non-terminal state - PaymentProcessing bool `protobuf:"varint,11,opt,name=payment_processing,json=paymentProcessing,proto3" json:"payment_processing,omitempty"` - // if present, contains information that may be interpreted to help the user fix a failure - ChargeFailure *ChargeFailure `protobuf:"bytes,12,opt,name=charge_failure,json=chargeFailure,proto3,oneof" json:"charge_failure,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetSubscriptionInformationResponse_Subscription) Reset() { - *x = GetSubscriptionInformationResponse_Subscription{} - mi := &file_org_signal_chat_subscriptions_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetSubscriptionInformationResponse_Subscription) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSubscriptionInformationResponse_Subscription) ProtoMessage() {} - -func (x *GetSubscriptionInformationResponse_Subscription) ProtoReflect() protoreflect.Message { - mi := &file_org_signal_chat_subscriptions_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 GetSubscriptionInformationResponse_Subscription.ProtoReflect.Descriptor instead. -func (*GetSubscriptionInformationResponse_Subscription) Descriptor() ([]byte, []int) { - return file_org_signal_chat_subscriptions_proto_rawDescGZIP(), []int{19, 0} -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetLevel() uint64 { - if x != nil { - return x.Level - } - return 0 -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetBillingCycleAnchor() uint64 { - if x != nil && x.BillingCycleAnchor != nil { - return *x.BillingCycleAnchor - } - return 0 -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetEndOfCurrentPeriod() uint64 { - if x != nil { - return x.EndOfCurrentPeriod - } - return 0 -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetActive() bool { - if x != nil { - return x.Active - } - return false -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetCancelAtPeriodEnd() bool { - if x != nil { - return x.CancelAtPeriodEnd - } - return false -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetCurrency() string { - if x != nil { - return x.Currency - } - return "" -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetStatus() SubscriptionStatus { - if x != nil { - return x.Status - } - return SubscriptionStatus_SUBSCRIPTION_STATUS_UNKNOWN -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetProcessor() PaymentProvider { - if x != nil { - return x.Processor - } - return PaymentProvider_PAYMENT_PROVIDER_UNKNOWN -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetPaymentMethod() PaymentMethod { - if x != nil { - return x.PaymentMethod - } - return PaymentMethod_PAYMENT_METHOD_UNKNOWN -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetPaymentProcessing() bool { - if x != nil { - return x.PaymentProcessing - } - return false -} - -func (x *GetSubscriptionInformationResponse_Subscription) GetChargeFailure() *ChargeFailure { - if x != nil { - return x.ChargeFailure - } - return nil -} - -var File_org_signal_chat_subscriptions_proto protoreflect.FileDescriptor - -const file_org_signal_chat_subscriptions_proto_rawDesc = "" + - "\n" + - "#org/signal/chat/subscriptions.proto\x12\x18org.signal.chat.purchase\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1corg/signal/chat/common.proto\x1a\x1dorg/signal/chat/require.proto\x1a\x1corg/signal/chat/errors.proto\x1a\x19org/signal/chat/tag.proto\"n\n" + - "\x17UpdateSubscriberRequest\x12*\n" + - "\rsubscriber_id\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\x12'\n" + - "\x0fdonation_permit\x18\x02 \x01(\fR\x0edonationPermit\"\xd8\x02\n" + - "\x18UpdateSubscriberResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x02 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x12n\n" + - "\x0fpermit_rejected\x18\x03 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x13\xc2\xd5\"\x0fpermit_rejectedH\x00R\x0epermitRejectedB\n" + - "\n" + - "\bresponse\"D\n" + - "\x17DeleteSubscriberRequest\x12)\n" + - "\fsubscriberId\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\"\xd7\x02\n" + - "\x18DeleteSubscriberResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12n\n" + - "\x14subscriber_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8a\x01\n" + - "\x1acannot_cancel_subscription\x18\x03 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1e\xc2\xd5\"\x1acannot_cancel_subscriptionH\x00R\x18cannotCancelSubscriptionB\n" + - "\n" + - "\bresponse\"\xcd\x01\n" + - "\x1aCreatePaymentMethodRequest\x12*\n" + - "\rsubscriber_id\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\x12T\n" + - "\x0epayment_method\x18\x02 \x01(\x0e2'.org.signal.chat.purchase.PaymentMethodB\x04\x90\x97\"\x01R\rpaymentMethod\x12-\n" + - "\x0fdonation_permit\x18\x03 \x01(\fB\x04\x88\x97\"\x01R\x0edonationPermit\"\xb5\x06\n" + - "\x1bCreatePaymentMethodResponse\x12i\n" + - "\x06result\x18\x01 \x01(\v2O.org.signal.chat.purchase.CreatePaymentMethodResponse.CreatePaymentMethodResultH\x00R\x06result\x12n\n" + - "\x14subscriber_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x12\x99\x01\n" + - "\x1fsubscription_processor_conflict\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB#\xc2\xd5\"\x1fsubscription_processor_conflictH\x00R\x1dsubscriptionProcessorConflict\x12n\n" + - "\x0fpermit_rejected\x18\x05 \x01(\v2..org.signal.chat.errors.FailedZkAuthenticationB\x13\xc2\xd5\"\x0fpermit_rejectedH\x00R\x0epermitRejected\x1a\x94\x01\n" + - "\x19CreatePaymentMethodResult\x12\"\n" + - "\fclientSecret\x18\x01 \x01(\tR\fclientSecret\x12S\n" + - "\x0fpaymentProvider\x18\x02 \x01(\x0e2).org.signal.chat.purchase.PaymentProviderR\x0fpaymentProviderB\n" + - "\n" + - "\bresponse\"\x89\x01\n" + - " CreatePayPalPaymentMethodRequest\x12)\n" + - "\fsubscriberId\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\x12\x1c\n" + - "\treturnUrl\x18\x02 \x01(\tR\treturnUrl\x12\x1c\n" + - "\tcancelUrl\x18\x03 \x01(\tR\tcancelUrl\"\x9b\x05\n" + - "!CreatePayPalPaymentMethodResponse\x12u\n" + - "\x06result\x18\x01 \x01(\v2[.org.signal.chat.purchase.CreatePayPalPaymentMethodResponse.CreatePayPalPaymentMethodResultH\x00R\x06result\x12n\n" + - "\x14subscriber_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x12\x99\x01\n" + - "\x1fsubscription_processor_conflict\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB#\xc2\xd5\"\x1fsubscription_processor_conflictH\x00R\x1dsubscriptionProcessorConflict\x1aY\n" + - "\x1fCreatePayPalPaymentMethodResult\x12 \n" + - "\vapprovalUrl\x18\x01 \x01(\tR\vapprovalUrl\x12\x14\n" + - "\x05token\x18\x02 \x01(\tR\x05tokenB\n" + - "\n" + - "\bresponse\"\xef\x04\n" + - "\x1eSetDefaultPaymentMethodRequest\x12)\n" + - "\fsubscriberId\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\x12f\n" + - "\x06stripe\x18\x02 \x01(\v2L.org.signal.chat.purchase.SetDefaultPaymentMethodRequest.StripePaymentMethodH\x00R\x06stripe\x12o\n" + - "\tbraintree\x18\x03 \x01(\v2O.org.signal.chat.purchase.SetDefaultPaymentMethodRequest.BraintreePaymentMethodH\x00R\tbraintree\x12`\n" + - "\x04sepa\x18\x04 \x01(\v2J.org.signal.chat.purchase.SetDefaultPaymentMethodRequest.SepaPaymentMethodH\x00R\x04sepa\x1aK\n" + - "\x13StripePaymentMethod\x124\n" + - "\x12paymentMethodToken\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\x12paymentMethodToken\x1aN\n" + - "\x16BraintreePaymentMethod\x124\n" + - "\x12paymentMethodToken\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\x12paymentMethodToken\x1a?\n" + - "\x11SepaPaymentMethod\x12*\n" + - "\rsetupIntentId\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\rsetupIntentIdB\t\n" + - "\arequest\"\x83\x05\n" + - "\x1fSetDefaultPaymentMethodResponse\x122\n" + - "\asuccess\x18\x01 \x01(\v2\x16.google.protobuf.EmptyH\x00R\asuccess\x12n\n" + - "\x14subscriber_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x12\x85\x01\n" + - "\x19payment_method_not_set_up\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1d\xc2\xd5\"\x19payment_method_not_set_upH\x00R\x15paymentMethodNotSetUp\x12\x99\x01\n" + - "\x1fsubscription_processor_conflict\x18\x05 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB#\xc2\xd5\"\x1fsubscription_processor_conflictH\x00R\x1dsubscriptionProcessorConflictB\n" + - "\n" + - "\bresponse\"\xa2\x01\n" + - "\x1bSetSubscriptionLevelRequest\x12)\n" + - "\fsubscriberId\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\x12\x14\n" + - "\x05level\x18\x02 \x01(\x04R\x05level\x12\x1a\n" + - "\bcurrency\x18\x03 \x01(\tR\bcurrency\x12&\n" + - "\x0eidempotencyKey\x18\x04 \x01(\tR\x0eidempotencyKey\"\xd4\x02\n" + - "\rChargeFailure\x12G\n" + - "\tprocessor\x18\x01 \x01(\x0e2).org.signal.chat.purchase.PaymentProviderR\tprocessor\x12\x12\n" + - "\x04code\x18\x02 \x01(\tR\x04code\x12\x18\n" + - "\amessage\x18\x03 \x01(\tR\amessage\x129\n" + - "\x16outcome_network_status\x18\x04 \x01(\tH\x00R\x14outcomeNetworkStatus\x88\x01\x01\x12*\n" + - "\x0eoutcome_reason\x18\x05 \x01(\tH\x01R\routcomeReason\x88\x01\x01\x12&\n" + - "\foutcome_type\x18\x06 \x01(\tH\x02R\voutcomeType\x88\x01\x01B\x19\n" + - "\x17_outcome_network_statusB\x11\n" + - "\x0f_outcome_reasonB\x0f\n" + - "\r_outcome_type\"y\n" + - "\x0fPaymentRequired\x12S\n" + - "\x0echarge_failure\x18\x01 \x01(\v2'.org.signal.chat.purchase.ChargeFailureH\x00R\rchargeFailure\x88\x01\x01B\x11\n" + - "\x0f_charge_failure\"\xcf\f\n" + - "\x1cSetSubscriptionLevelResponse\x12m\n" + - "\asuccess\x18\x01 \x01(\v2Q.org.signal.chat.purchase.SetSubscriptionLevelResponse.SetSubscriptionLevelResultH\x00R\asuccess\x12n\n" + - "\x14subscriber_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x12\x99\x01\n" + - "\x1fsubscription_processor_conflict\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB#\xc2\xd5\"\x1fsubscription_processor_conflictH\x00R\x1dsubscriptionProcessorConflict\x12\x85\x01\n" + - "\x19payment_method_not_set_up\x18\x05 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1d\xc2\xd5\"\x19payment_method_not_set_upH\x00R\x15paymentMethodNotSetUp\x12|\n" + - "\x15unsupported_operation\x18\x06 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x19\xc2\xd5\"\x15unsupported_operationH\x00R\x14unsupportedOperation\x12p\n" + - "\x11unsupported_level\x18\a \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x15\xc2\xd5\"\x11unsupported_levelH\x00R\x10unsupportedLevel\x12y\n" + - "\x14unsupported_currency\x18\b \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x18\xc2\xd5\"\x14unsupported_currencyH\x00R\x13unsupportedCurrency\x12\x81\x01\n" + - "\x17payment_requires_action\x18\t \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1b\xc2\xd5\"\x17payment_requires_actionH\x00R\x15paymentRequiresAction\x12\x84\x01\n" + - "\x18invalid_level_transition\x18\n" + - " \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1c\xc2\xd5\"\x18invalid_level_transitionH\x00R\x16invalidLevelTransition\x12\x81\x01\n" + - "\x17invalid_idempotency_key\x18\v \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x1b\xc2\xd5\"\x17invalid_idempotency_keyH\x00R\x15invalidIdempotencyKey\x12d\n" + - "\x0echarge_failure\x18\f \x01(\v2'.org.signal.chat.purchase.ChargeFailureB\x12\xc2\xd5\"\x0echarge_failureH\x00R\rchargeFailure\x1a2\n" + - "\x1aSetSubscriptionLevelResult\x12\x14\n" + - "\x05level\x18\x01 \x01(\x04R\x05levelB\n" + - "\n" + - "\bresponse\"\xba\x03\n" + - "\x19SetIapSubscriptionRequest\x12)\n" + - "\fsubscriberId\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\x12c\n" + - "\tapp_store\x18\x02 \x01(\v2D.org.signal.chat.purchase.SetIapSubscriptionRequest.AppStorePurchaseH\x00R\bappStore\x12l\n" + - "\fplay_billing\x18\x03 \x01(\v2G.org.signal.chat.purchase.SetIapSubscriptionRequest.PlayBillingPurchaseH\x00R\vplayBilling\x1aP\n" + - "\x10AppStorePurchase\x12<\n" + - "\x17original_transaction_id\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\x15originalTransactionId\x1aB\n" + - "\x13PlayBillingPurchase\x12+\n" + - "\x0epurchase_token\x18\x01 \x01(\tB\x04\x88\x97\"\x01R\rpurchaseTokenB\t\n" + - "\arequest\"\xc6\x06\n" + - "\x1aSetIapSubscriptionResponse\x12i\n" + - "\asuccess\x18\x01 \x01(\v2M.org.signal.chat.purchase.SetIapSubscriptionResponse.SetIapSubscriptionResultH\x00R\asuccess\x12n\n" + - "\x14subscriber_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x12\x99\x01\n" + - "\x1fsubscription_processor_conflict\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB#\xc2\xd5\"\x1fsubscription_processor_conflictH\x00R\x1dsubscriptionProcessorConflict\x12m\n" + - "\x10payment_required\x18\x05 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x14\xc2\xd5\"\x10payment_requiredH\x00R\x0fpaymentRequired\x12v\n" + - "\x13invalid_transaction\x18\x06 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x17\xc2\xd5\"\x13invalid_transactionH\x00R\x12invalidTransaction\x1a0\n" + - "\x18SetIapSubscriptionResult\x12\x14\n" + - "\x05level\x18\x01 \x01(\x04R\x05levelB\n" + - "\n" + - "\bresponse\"\x8c\x01\n" + - "\x1cGetReceiptCredentialsRequest\x12)\n" + - "\fsubscriberId\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\x12A\n" + - "\x18receiptCredentialRequest\x18\x02 \x01(\fB\x05\xa2\x97\"\x01aR\x18receiptCredentialRequest\"\xbf\x06\n" + - "\x1dGetReceiptCredentialsResponse\x12o\n" + - "\asuccess\x18\x01 \x01(\v2S.org.signal.chat.purchase.GetReceiptCredentialsResponse.GetReceiptCredentialsResultH\x00R\asuccess\x12n\n" + - "\x14subscriber_not_found\x18\x02 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x03 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x12i\n" + - "\x0fno_paid_invoice\x18\x04 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x13\xc2\xd5\"\x0fno_paid_invoiceH\x00R\rnoPaidInvoice\x12l\n" + - "\x10payment_required\x18\x05 \x01(\v2).org.signal.chat.purchase.PaymentRequiredB\x14\xc2\xd5\"\x10payment_requiredH\x00R\x0fpaymentRequired\x12m\n" + - "\x10already_redeemed\x18\x06 \x01(\v2*.org.signal.chat.errors.FailedPreconditionB\x14\xc2\xd5\"\x10already_redeemedH\x00R\x0falreadyRedeemed\x1a[\n" + - "\x1bGetReceiptCredentialsResult\x12<\n" + - "\x19receiptCredentialResponse\x18\x01 \x01(\fR\x19receiptCredentialResponseB\n" + - "\n" + - "\bresponse\"N\n" + - "!GetSubscriptionInformationRequest\x12)\n" + - "\fsubscriberId\x18\x01 \x01(\fB\x05\xa2\x97\"\x01 R\fsubscriberId\"\xf5\b\n" + - "\"GetSubscriptionInformationResponse\x12e\n" + - "\asuccess\x18\x01 \x01(\v2I.org.signal.chat.purchase.GetSubscriptionInformationResponse.SubscriptionH\x00R\asuccess\x12A\n" + - "\x0fno_subscription\x18\x02 \x01(\v2\x16.google.protobuf.EmptyH\x00R\x0enoSubscription\x12n\n" + - "\x14subscriber_not_found\x18\x03 \x01(\v2 .org.signal.chat.errors.NotFoundB\x18\xc2\xd5\"\x14subscriber_not_foundH\x00R\x12subscriberNotFound\x12\x8b\x01\n" + - "\x16subscriber_id_mismatch\x18\x04 \x01(\v27.org.signal.chat.errors.FailedUnidentifiedAuthorizationB\x1a\xc2\xd5\"\x16subscriber_id_mismatchH\x00R\x14subscriberIdMismatch\x1a\x9a\x05\n" + - "\fSubscription\x12\x14\n" + - "\x05level\x18\x01 \x01(\x04R\x05level\x125\n" + - "\x14billing_cycle_anchor\x18\x02 \x01(\x04H\x00R\x12billingCycleAnchor\x88\x01\x01\x121\n" + - "\x15end_of_current_period\x18\x03 \x01(\x04R\x12endOfCurrentPeriod\x12\x16\n" + - "\x06active\x18\x04 \x01(\bR\x06active\x12/\n" + - "\x14cancel_at_period_end\x18\x05 \x01(\bR\x11cancelAtPeriodEnd\x12\x1a\n" + - "\bcurrency\x18\x06 \x01(\tR\bcurrency\x12\x16\n" + - "\x06amount\x18\a \x01(\x04R\x06amount\x12D\n" + - "\x06status\x18\b \x01(\x0e2,.org.signal.chat.purchase.SubscriptionStatusR\x06status\x12G\n" + - "\tprocessor\x18\t \x01(\x0e2).org.signal.chat.purchase.PaymentProviderR\tprocessor\x12N\n" + - "\x0epayment_method\x18\n" + - " \x01(\x0e2'.org.signal.chat.purchase.PaymentMethodR\rpaymentMethod\x12-\n" + - "\x12payment_processing\x18\v \x01(\bR\x11paymentProcessing\x12S\n" + - "\x0echarge_failure\x18\f \x01(\v2'.org.signal.chat.purchase.ChargeFailureH\x01R\rchargeFailure\x88\x01\x01B\x17\n" + - "\x15_billing_cycle_anchorB\x11\n" + - "\x0f_charge_failureB\n" + - "\n" + - "\bresponse\"w\n" + - "\x15GetBankMandateRequest\x12^\n" + - "\x12bank_transfer_type\x18\x01 \x01(\x0e2*.org.signal.chat.purchase.BankTransferTypeB\x04\x90\x97\"\x01R\x10bankTransferType\"2\n" + - "\x16GetBankMandateResponse\x12\x18\n" + - "\amandate\x18\x01 \x01(\tR\amandate*\xbc\x01\n" + - "\x0fPaymentProvider\x12\x1c\n" + - "\x18PAYMENT_PROVIDER_UNKNOWN\x10\x00\x12\x1b\n" + - "\x17PAYMENT_PROVIDER_STRIPE\x10\x01\x12\x1e\n" + - "\x1aPAYMENT_PROVIDER_BRAINTREE\x10\x02\x12(\n" + - "$PAYMENT_PROVIDER_GOOGLE_PLAY_BILLING\x10\x03\x12$\n" + - " PAYMENT_PROVIDER_APPLE_APP_STORE\x10\x04*\xe4\x01\n" + - "\rPaymentMethod\x12\x1a\n" + - "\x16PAYMENT_METHOD_UNKNOWN\x10\x00\x12\x17\n" + - "\x13PAYMENT_METHOD_CARD\x10\x01\x12\x1d\n" + - "\x19PAYMENT_METHOD_SEPA_DEBIT\x10\x02\x12\x18\n" + - "\x14PAYMENT_METHOD_IDEAL\x10\x03\x12\x19\n" + - "\x15PAYMENT_METHOD_PAYPAL\x10\x04\x12&\n" + - "\"PAYMENT_METHOD_GOOGLE_PLAY_BILLING\x10\x05\x12\"\n" + - "\x1ePAYMENT_METHOD_APPLE_APP_STORE\x10\x06*\xdd\x01\n" + - "\x12SubscriptionStatus\x12\x1f\n" + - "\x1bSUBSCRIPTION_STATUS_UNKNOWN\x10\x00\x12\x1e\n" + - "\x1aSUBSCRIPTION_STATUS_ACTIVE\x10\x01\x12\"\n" + - "\x1eSUBSCRIPTION_STATUS_INCOMPLETE\x10\x02\x12 \n" + - "\x1cSUBSCRIPTION_STATUS_PAST_DUE\x10\x03\x12 \n" + - "\x1cSUBSCRIPTION_STATUS_CANCELED\x10\x04\x12\x1e\n" + - "\x1aSUBSCRIPTION_STATUS_UNPAID\x10\x05*U\n" + - "\x10BankTransferType\x12\x1e\n" + - "\x1aBANK_TRANSFER_TYPE_UNKNOWN\x10\x00\x12!\n" + - "\x1dBANK_TRANSFER_TYPE_SEPA_DEBIT\x10\x012\xf0\n" + - "\n" + - "\rSubscriptions\x12{\n" + - "\x10UpdateSubscriber\x121.org.signal.chat.purchase.UpdateSubscriberRequest\x1a2.org.signal.chat.purchase.UpdateSubscriberResponse\"\x00\x12{\n" + - "\x10DeleteSubscriber\x121.org.signal.chat.purchase.DeleteSubscriberRequest\x1a2.org.signal.chat.purchase.DeleteSubscriberResponse\"\x00\x12\x84\x01\n" + - "\x13CreatePaymentMethod\x124.org.signal.chat.purchase.CreatePaymentMethodRequest\x1a5.org.signal.chat.purchase.CreatePaymentMethodResponse\"\x00\x12\x96\x01\n" + - "\x19CreatePayPalPaymentMethod\x12:.org.signal.chat.purchase.CreatePayPalPaymentMethodRequest\x1a;.org.signal.chat.purchase.CreatePayPalPaymentMethodResponse\"\x00\x12\x90\x01\n" + - "\x17SetDefaultPaymentMethod\x128.org.signal.chat.purchase.SetDefaultPaymentMethodRequest\x1a9.org.signal.chat.purchase.SetDefaultPaymentMethodResponse\"\x00\x12\x87\x01\n" + - "\x14SetSubscriptionLevel\x125.org.signal.chat.purchase.SetSubscriptionLevelRequest\x1a6.org.signal.chat.purchase.SetSubscriptionLevelResponse\"\x00\x12\x99\x01\n" + - "\x1aGetSubscriptionInformation\x12;.org.signal.chat.purchase.GetSubscriptionInformationRequest\x1a<.org.signal.chat.purchase.GetSubscriptionInformationResponse\"\x00\x12\x8a\x01\n" + - "\x15GetReceiptCredentials\x126.org.signal.chat.purchase.GetReceiptCredentialsRequest\x1a7.org.signal.chat.purchase.GetReceiptCredentialsResponse\"\x00\x12\x81\x01\n" + - "\x12SetIapSubscription\x123.org.signal.chat.purchase.SetIapSubscriptionRequest\x1a4.org.signal.chat.purchase.SetIapSubscriptionResponse\"\x00\x12u\n" + - "\x0eGetBankMandate\x12/.org.signal.chat.purchase.GetBankMandateRequest\x1a0.org.signal.chat.purchase.GetBankMandateResponse\"\x00\x1a\x04\xc8\xd5\"\x02B\x02P\x01b\x06proto3" - -var ( - file_org_signal_chat_subscriptions_proto_rawDescOnce sync.Once - file_org_signal_chat_subscriptions_proto_rawDescData []byte -) - -func file_org_signal_chat_subscriptions_proto_rawDescGZIP() []byte { - file_org_signal_chat_subscriptions_proto_rawDescOnce.Do(func() { - file_org_signal_chat_subscriptions_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_org_signal_chat_subscriptions_proto_rawDesc), len(file_org_signal_chat_subscriptions_proto_rawDesc))) - }) - return file_org_signal_chat_subscriptions_proto_rawDescData -} - -var file_org_signal_chat_subscriptions_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_org_signal_chat_subscriptions_proto_msgTypes = make([]protoimpl.MessageInfo, 33) -var file_org_signal_chat_subscriptions_proto_goTypes = []any{ - (PaymentProvider)(0), // 0: org.signal.chat.purchase.PaymentProvider - (PaymentMethod)(0), // 1: org.signal.chat.purchase.PaymentMethod - (SubscriptionStatus)(0), // 2: org.signal.chat.purchase.SubscriptionStatus - (BankTransferType)(0), // 3: org.signal.chat.purchase.BankTransferType - (*UpdateSubscriberRequest)(nil), // 4: org.signal.chat.purchase.UpdateSubscriberRequest - (*UpdateSubscriberResponse)(nil), // 5: org.signal.chat.purchase.UpdateSubscriberResponse - (*DeleteSubscriberRequest)(nil), // 6: org.signal.chat.purchase.DeleteSubscriberRequest - (*DeleteSubscriberResponse)(nil), // 7: org.signal.chat.purchase.DeleteSubscriberResponse - (*CreatePaymentMethodRequest)(nil), // 8: org.signal.chat.purchase.CreatePaymentMethodRequest - (*CreatePaymentMethodResponse)(nil), // 9: org.signal.chat.purchase.CreatePaymentMethodResponse - (*CreatePayPalPaymentMethodRequest)(nil), // 10: org.signal.chat.purchase.CreatePayPalPaymentMethodRequest - (*CreatePayPalPaymentMethodResponse)(nil), // 11: org.signal.chat.purchase.CreatePayPalPaymentMethodResponse - (*SetDefaultPaymentMethodRequest)(nil), // 12: org.signal.chat.purchase.SetDefaultPaymentMethodRequest - (*SetDefaultPaymentMethodResponse)(nil), // 13: org.signal.chat.purchase.SetDefaultPaymentMethodResponse - (*SetSubscriptionLevelRequest)(nil), // 14: org.signal.chat.purchase.SetSubscriptionLevelRequest - (*ChargeFailure)(nil), // 15: org.signal.chat.purchase.ChargeFailure - (*PaymentRequired)(nil), // 16: org.signal.chat.purchase.PaymentRequired - (*SetSubscriptionLevelResponse)(nil), // 17: org.signal.chat.purchase.SetSubscriptionLevelResponse - (*SetIapSubscriptionRequest)(nil), // 18: org.signal.chat.purchase.SetIapSubscriptionRequest - (*SetIapSubscriptionResponse)(nil), // 19: org.signal.chat.purchase.SetIapSubscriptionResponse - (*GetReceiptCredentialsRequest)(nil), // 20: org.signal.chat.purchase.GetReceiptCredentialsRequest - (*GetReceiptCredentialsResponse)(nil), // 21: org.signal.chat.purchase.GetReceiptCredentialsResponse - (*GetSubscriptionInformationRequest)(nil), // 22: org.signal.chat.purchase.GetSubscriptionInformationRequest - (*GetSubscriptionInformationResponse)(nil), // 23: org.signal.chat.purchase.GetSubscriptionInformationResponse - (*GetBankMandateRequest)(nil), // 24: org.signal.chat.purchase.GetBankMandateRequest - (*GetBankMandateResponse)(nil), // 25: org.signal.chat.purchase.GetBankMandateResponse - (*CreatePaymentMethodResponse_CreatePaymentMethodResult)(nil), // 26: org.signal.chat.purchase.CreatePaymentMethodResponse.CreatePaymentMethodResult - (*CreatePayPalPaymentMethodResponse_CreatePayPalPaymentMethodResult)(nil), // 27: org.signal.chat.purchase.CreatePayPalPaymentMethodResponse.CreatePayPalPaymentMethodResult - (*SetDefaultPaymentMethodRequest_StripePaymentMethod)(nil), // 28: org.signal.chat.purchase.SetDefaultPaymentMethodRequest.StripePaymentMethod - (*SetDefaultPaymentMethodRequest_BraintreePaymentMethod)(nil), // 29: org.signal.chat.purchase.SetDefaultPaymentMethodRequest.BraintreePaymentMethod - (*SetDefaultPaymentMethodRequest_SepaPaymentMethod)(nil), // 30: org.signal.chat.purchase.SetDefaultPaymentMethodRequest.SepaPaymentMethod - (*SetSubscriptionLevelResponse_SetSubscriptionLevelResult)(nil), // 31: org.signal.chat.purchase.SetSubscriptionLevelResponse.SetSubscriptionLevelResult - (*SetIapSubscriptionRequest_AppStorePurchase)(nil), // 32: org.signal.chat.purchase.SetIapSubscriptionRequest.AppStorePurchase - (*SetIapSubscriptionRequest_PlayBillingPurchase)(nil), // 33: org.signal.chat.purchase.SetIapSubscriptionRequest.PlayBillingPurchase - (*SetIapSubscriptionResponse_SetIapSubscriptionResult)(nil), // 34: org.signal.chat.purchase.SetIapSubscriptionResponse.SetIapSubscriptionResult - (*GetReceiptCredentialsResponse_GetReceiptCredentialsResult)(nil), // 35: org.signal.chat.purchase.GetReceiptCredentialsResponse.GetReceiptCredentialsResult - (*GetSubscriptionInformationResponse_Subscription)(nil), // 36: org.signal.chat.purchase.GetSubscriptionInformationResponse.Subscription - (*emptypb.Empty)(nil), // 37: google.protobuf.Empty - (*errors.FailedUnidentifiedAuthorization)(nil), // 38: org.signal.chat.errors.FailedUnidentifiedAuthorization - (*errors.FailedZkAuthentication)(nil), // 39: org.signal.chat.errors.FailedZkAuthentication - (*errors.NotFound)(nil), // 40: org.signal.chat.errors.NotFound - (*errors.FailedPrecondition)(nil), // 41: org.signal.chat.errors.FailedPrecondition -} -var file_org_signal_chat_subscriptions_proto_depIdxs = []int32{ - 37, // 0: org.signal.chat.purchase.UpdateSubscriberResponse.success:type_name -> google.protobuf.Empty - 38, // 1: org.signal.chat.purchase.UpdateSubscriberResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 39, // 2: org.signal.chat.purchase.UpdateSubscriberResponse.permit_rejected:type_name -> org.signal.chat.errors.FailedZkAuthentication - 37, // 3: org.signal.chat.purchase.DeleteSubscriberResponse.success:type_name -> google.protobuf.Empty - 40, // 4: org.signal.chat.purchase.DeleteSubscriberResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 41, // 5: org.signal.chat.purchase.DeleteSubscriberResponse.cannot_cancel_subscription:type_name -> org.signal.chat.errors.FailedPrecondition - 1, // 6: org.signal.chat.purchase.CreatePaymentMethodRequest.payment_method:type_name -> org.signal.chat.purchase.PaymentMethod - 26, // 7: org.signal.chat.purchase.CreatePaymentMethodResponse.result:type_name -> org.signal.chat.purchase.CreatePaymentMethodResponse.CreatePaymentMethodResult - 40, // 8: org.signal.chat.purchase.CreatePaymentMethodResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 38, // 9: org.signal.chat.purchase.CreatePaymentMethodResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 41, // 10: org.signal.chat.purchase.CreatePaymentMethodResponse.subscription_processor_conflict:type_name -> org.signal.chat.errors.FailedPrecondition - 39, // 11: org.signal.chat.purchase.CreatePaymentMethodResponse.permit_rejected:type_name -> org.signal.chat.errors.FailedZkAuthentication - 27, // 12: org.signal.chat.purchase.CreatePayPalPaymentMethodResponse.result:type_name -> org.signal.chat.purchase.CreatePayPalPaymentMethodResponse.CreatePayPalPaymentMethodResult - 40, // 13: org.signal.chat.purchase.CreatePayPalPaymentMethodResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 38, // 14: org.signal.chat.purchase.CreatePayPalPaymentMethodResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 41, // 15: org.signal.chat.purchase.CreatePayPalPaymentMethodResponse.subscription_processor_conflict:type_name -> org.signal.chat.errors.FailedPrecondition - 28, // 16: org.signal.chat.purchase.SetDefaultPaymentMethodRequest.stripe:type_name -> org.signal.chat.purchase.SetDefaultPaymentMethodRequest.StripePaymentMethod - 29, // 17: org.signal.chat.purchase.SetDefaultPaymentMethodRequest.braintree:type_name -> org.signal.chat.purchase.SetDefaultPaymentMethodRequest.BraintreePaymentMethod - 30, // 18: org.signal.chat.purchase.SetDefaultPaymentMethodRequest.sepa:type_name -> org.signal.chat.purchase.SetDefaultPaymentMethodRequest.SepaPaymentMethod - 37, // 19: org.signal.chat.purchase.SetDefaultPaymentMethodResponse.success:type_name -> google.protobuf.Empty - 40, // 20: org.signal.chat.purchase.SetDefaultPaymentMethodResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 38, // 21: org.signal.chat.purchase.SetDefaultPaymentMethodResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 41, // 22: org.signal.chat.purchase.SetDefaultPaymentMethodResponse.payment_method_not_set_up:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 23: org.signal.chat.purchase.SetDefaultPaymentMethodResponse.subscription_processor_conflict:type_name -> org.signal.chat.errors.FailedPrecondition - 0, // 24: org.signal.chat.purchase.ChargeFailure.processor:type_name -> org.signal.chat.purchase.PaymentProvider - 15, // 25: org.signal.chat.purchase.PaymentRequired.charge_failure:type_name -> org.signal.chat.purchase.ChargeFailure - 31, // 26: org.signal.chat.purchase.SetSubscriptionLevelResponse.success:type_name -> org.signal.chat.purchase.SetSubscriptionLevelResponse.SetSubscriptionLevelResult - 40, // 27: org.signal.chat.purchase.SetSubscriptionLevelResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 38, // 28: org.signal.chat.purchase.SetSubscriptionLevelResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 41, // 29: org.signal.chat.purchase.SetSubscriptionLevelResponse.subscription_processor_conflict:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 30: org.signal.chat.purchase.SetSubscriptionLevelResponse.payment_method_not_set_up:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 31: org.signal.chat.purchase.SetSubscriptionLevelResponse.unsupported_operation:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 32: org.signal.chat.purchase.SetSubscriptionLevelResponse.unsupported_level:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 33: org.signal.chat.purchase.SetSubscriptionLevelResponse.unsupported_currency:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 34: org.signal.chat.purchase.SetSubscriptionLevelResponse.payment_requires_action:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 35: org.signal.chat.purchase.SetSubscriptionLevelResponse.invalid_level_transition:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 36: org.signal.chat.purchase.SetSubscriptionLevelResponse.invalid_idempotency_key:type_name -> org.signal.chat.errors.FailedPrecondition - 15, // 37: org.signal.chat.purchase.SetSubscriptionLevelResponse.charge_failure:type_name -> org.signal.chat.purchase.ChargeFailure - 32, // 38: org.signal.chat.purchase.SetIapSubscriptionRequest.app_store:type_name -> org.signal.chat.purchase.SetIapSubscriptionRequest.AppStorePurchase - 33, // 39: org.signal.chat.purchase.SetIapSubscriptionRequest.play_billing:type_name -> org.signal.chat.purchase.SetIapSubscriptionRequest.PlayBillingPurchase - 34, // 40: org.signal.chat.purchase.SetIapSubscriptionResponse.success:type_name -> org.signal.chat.purchase.SetIapSubscriptionResponse.SetIapSubscriptionResult - 40, // 41: org.signal.chat.purchase.SetIapSubscriptionResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 38, // 42: org.signal.chat.purchase.SetIapSubscriptionResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 41, // 43: org.signal.chat.purchase.SetIapSubscriptionResponse.subscription_processor_conflict:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 44: org.signal.chat.purchase.SetIapSubscriptionResponse.payment_required:type_name -> org.signal.chat.errors.FailedPrecondition - 41, // 45: org.signal.chat.purchase.SetIapSubscriptionResponse.invalid_transaction:type_name -> org.signal.chat.errors.FailedPrecondition - 35, // 46: org.signal.chat.purchase.GetReceiptCredentialsResponse.success:type_name -> org.signal.chat.purchase.GetReceiptCredentialsResponse.GetReceiptCredentialsResult - 40, // 47: org.signal.chat.purchase.GetReceiptCredentialsResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 38, // 48: org.signal.chat.purchase.GetReceiptCredentialsResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 41, // 49: org.signal.chat.purchase.GetReceiptCredentialsResponse.no_paid_invoice:type_name -> org.signal.chat.errors.FailedPrecondition - 16, // 50: org.signal.chat.purchase.GetReceiptCredentialsResponse.payment_required:type_name -> org.signal.chat.purchase.PaymentRequired - 41, // 51: org.signal.chat.purchase.GetReceiptCredentialsResponse.already_redeemed:type_name -> org.signal.chat.errors.FailedPrecondition - 36, // 52: org.signal.chat.purchase.GetSubscriptionInformationResponse.success:type_name -> org.signal.chat.purchase.GetSubscriptionInformationResponse.Subscription - 37, // 53: org.signal.chat.purchase.GetSubscriptionInformationResponse.no_subscription:type_name -> google.protobuf.Empty - 40, // 54: org.signal.chat.purchase.GetSubscriptionInformationResponse.subscriber_not_found:type_name -> org.signal.chat.errors.NotFound - 38, // 55: org.signal.chat.purchase.GetSubscriptionInformationResponse.subscriber_id_mismatch:type_name -> org.signal.chat.errors.FailedUnidentifiedAuthorization - 3, // 56: org.signal.chat.purchase.GetBankMandateRequest.bank_transfer_type:type_name -> org.signal.chat.purchase.BankTransferType - 0, // 57: org.signal.chat.purchase.CreatePaymentMethodResponse.CreatePaymentMethodResult.paymentProvider:type_name -> org.signal.chat.purchase.PaymentProvider - 2, // 58: org.signal.chat.purchase.GetSubscriptionInformationResponse.Subscription.status:type_name -> org.signal.chat.purchase.SubscriptionStatus - 0, // 59: org.signal.chat.purchase.GetSubscriptionInformationResponse.Subscription.processor:type_name -> org.signal.chat.purchase.PaymentProvider - 1, // 60: org.signal.chat.purchase.GetSubscriptionInformationResponse.Subscription.payment_method:type_name -> org.signal.chat.purchase.PaymentMethod - 15, // 61: org.signal.chat.purchase.GetSubscriptionInformationResponse.Subscription.charge_failure:type_name -> org.signal.chat.purchase.ChargeFailure - 4, // 62: org.signal.chat.purchase.Subscriptions.UpdateSubscriber:input_type -> org.signal.chat.purchase.UpdateSubscriberRequest - 6, // 63: org.signal.chat.purchase.Subscriptions.DeleteSubscriber:input_type -> org.signal.chat.purchase.DeleteSubscriberRequest - 8, // 64: org.signal.chat.purchase.Subscriptions.CreatePaymentMethod:input_type -> org.signal.chat.purchase.CreatePaymentMethodRequest - 10, // 65: org.signal.chat.purchase.Subscriptions.CreatePayPalPaymentMethod:input_type -> org.signal.chat.purchase.CreatePayPalPaymentMethodRequest - 12, // 66: org.signal.chat.purchase.Subscriptions.SetDefaultPaymentMethod:input_type -> org.signal.chat.purchase.SetDefaultPaymentMethodRequest - 14, // 67: org.signal.chat.purchase.Subscriptions.SetSubscriptionLevel:input_type -> org.signal.chat.purchase.SetSubscriptionLevelRequest - 22, // 68: org.signal.chat.purchase.Subscriptions.GetSubscriptionInformation:input_type -> org.signal.chat.purchase.GetSubscriptionInformationRequest - 20, // 69: org.signal.chat.purchase.Subscriptions.GetReceiptCredentials:input_type -> org.signal.chat.purchase.GetReceiptCredentialsRequest - 18, // 70: org.signal.chat.purchase.Subscriptions.SetIapSubscription:input_type -> org.signal.chat.purchase.SetIapSubscriptionRequest - 24, // 71: org.signal.chat.purchase.Subscriptions.GetBankMandate:input_type -> org.signal.chat.purchase.GetBankMandateRequest - 5, // 72: org.signal.chat.purchase.Subscriptions.UpdateSubscriber:output_type -> org.signal.chat.purchase.UpdateSubscriberResponse - 7, // 73: org.signal.chat.purchase.Subscriptions.DeleteSubscriber:output_type -> org.signal.chat.purchase.DeleteSubscriberResponse - 9, // 74: org.signal.chat.purchase.Subscriptions.CreatePaymentMethod:output_type -> org.signal.chat.purchase.CreatePaymentMethodResponse - 11, // 75: org.signal.chat.purchase.Subscriptions.CreatePayPalPaymentMethod:output_type -> org.signal.chat.purchase.CreatePayPalPaymentMethodResponse - 13, // 76: org.signal.chat.purchase.Subscriptions.SetDefaultPaymentMethod:output_type -> org.signal.chat.purchase.SetDefaultPaymentMethodResponse - 17, // 77: org.signal.chat.purchase.Subscriptions.SetSubscriptionLevel:output_type -> org.signal.chat.purchase.SetSubscriptionLevelResponse - 23, // 78: org.signal.chat.purchase.Subscriptions.GetSubscriptionInformation:output_type -> org.signal.chat.purchase.GetSubscriptionInformationResponse - 21, // 79: org.signal.chat.purchase.Subscriptions.GetReceiptCredentials:output_type -> org.signal.chat.purchase.GetReceiptCredentialsResponse - 19, // 80: org.signal.chat.purchase.Subscriptions.SetIapSubscription:output_type -> org.signal.chat.purchase.SetIapSubscriptionResponse - 25, // 81: org.signal.chat.purchase.Subscriptions.GetBankMandate:output_type -> org.signal.chat.purchase.GetBankMandateResponse - 72, // [72:82] is the sub-list for method output_type - 62, // [62:72] is the sub-list for method input_type - 62, // [62:62] is the sub-list for extension type_name - 62, // [62:62] is the sub-list for extension extendee - 0, // [0:62] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_subscriptions_proto_init() } -func file_org_signal_chat_subscriptions_proto_init() { - if File_org_signal_chat_subscriptions_proto != nil { - return - } - file_org_signal_chat_subscriptions_proto_msgTypes[1].OneofWrappers = []any{ - (*UpdateSubscriberResponse_Success)(nil), - (*UpdateSubscriberResponse_SubscriberIdMismatch)(nil), - (*UpdateSubscriberResponse_PermitRejected)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[3].OneofWrappers = []any{ - (*DeleteSubscriberResponse_Success)(nil), - (*DeleteSubscriberResponse_SubscriberNotFound)(nil), - (*DeleteSubscriberResponse_CannotCancelSubscription)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[5].OneofWrappers = []any{ - (*CreatePaymentMethodResponse_Result)(nil), - (*CreatePaymentMethodResponse_SubscriberNotFound)(nil), - (*CreatePaymentMethodResponse_SubscriberIdMismatch)(nil), - (*CreatePaymentMethodResponse_SubscriptionProcessorConflict)(nil), - (*CreatePaymentMethodResponse_PermitRejected)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[7].OneofWrappers = []any{ - (*CreatePayPalPaymentMethodResponse_Result)(nil), - (*CreatePayPalPaymentMethodResponse_SubscriberNotFound)(nil), - (*CreatePayPalPaymentMethodResponse_SubscriberIdMismatch)(nil), - (*CreatePayPalPaymentMethodResponse_SubscriptionProcessorConflict)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[8].OneofWrappers = []any{ - (*SetDefaultPaymentMethodRequest_Stripe)(nil), - (*SetDefaultPaymentMethodRequest_Braintree)(nil), - (*SetDefaultPaymentMethodRequest_Sepa)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[9].OneofWrappers = []any{ - (*SetDefaultPaymentMethodResponse_Success)(nil), - (*SetDefaultPaymentMethodResponse_SubscriberNotFound)(nil), - (*SetDefaultPaymentMethodResponse_SubscriberIdMismatch)(nil), - (*SetDefaultPaymentMethodResponse_PaymentMethodNotSetUp)(nil), - (*SetDefaultPaymentMethodResponse_SubscriptionProcessorConflict)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[11].OneofWrappers = []any{} - file_org_signal_chat_subscriptions_proto_msgTypes[12].OneofWrappers = []any{} - file_org_signal_chat_subscriptions_proto_msgTypes[13].OneofWrappers = []any{ - (*SetSubscriptionLevelResponse_Success)(nil), - (*SetSubscriptionLevelResponse_SubscriberNotFound)(nil), - (*SetSubscriptionLevelResponse_SubscriberIdMismatch)(nil), - (*SetSubscriptionLevelResponse_SubscriptionProcessorConflict)(nil), - (*SetSubscriptionLevelResponse_PaymentMethodNotSetUp)(nil), - (*SetSubscriptionLevelResponse_UnsupportedOperation)(nil), - (*SetSubscriptionLevelResponse_UnsupportedLevel)(nil), - (*SetSubscriptionLevelResponse_UnsupportedCurrency)(nil), - (*SetSubscriptionLevelResponse_PaymentRequiresAction)(nil), - (*SetSubscriptionLevelResponse_InvalidLevelTransition)(nil), - (*SetSubscriptionLevelResponse_InvalidIdempotencyKey)(nil), - (*SetSubscriptionLevelResponse_ChargeFailure)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[14].OneofWrappers = []any{ - (*SetIapSubscriptionRequest_AppStore)(nil), - (*SetIapSubscriptionRequest_PlayBilling)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[15].OneofWrappers = []any{ - (*SetIapSubscriptionResponse_Success)(nil), - (*SetIapSubscriptionResponse_SubscriberNotFound)(nil), - (*SetIapSubscriptionResponse_SubscriberIdMismatch)(nil), - (*SetIapSubscriptionResponse_SubscriptionProcessorConflict)(nil), - (*SetIapSubscriptionResponse_PaymentRequired)(nil), - (*SetIapSubscriptionResponse_InvalidTransaction)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[17].OneofWrappers = []any{ - (*GetReceiptCredentialsResponse_Success)(nil), - (*GetReceiptCredentialsResponse_SubscriberNotFound)(nil), - (*GetReceiptCredentialsResponse_SubscriberIdMismatch)(nil), - (*GetReceiptCredentialsResponse_NoPaidInvoice)(nil), - (*GetReceiptCredentialsResponse_PaymentRequired)(nil), - (*GetReceiptCredentialsResponse_AlreadyRedeemed)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[19].OneofWrappers = []any{ - (*GetSubscriptionInformationResponse_Success)(nil), - (*GetSubscriptionInformationResponse_NoSubscription)(nil), - (*GetSubscriptionInformationResponse_SubscriberNotFound)(nil), - (*GetSubscriptionInformationResponse_SubscriberIdMismatch)(nil), - } - file_org_signal_chat_subscriptions_proto_msgTypes[32].OneofWrappers = []any{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_subscriptions_proto_rawDesc), len(file_org_signal_chat_subscriptions_proto_rawDesc)), - NumEnums: 4, - NumMessages: 33, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_org_signal_chat_subscriptions_proto_goTypes, - DependencyIndexes: file_org_signal_chat_subscriptions_proto_depIdxs, - EnumInfos: file_org_signal_chat_subscriptions_proto_enumTypes, - MessageInfos: file_org_signal_chat_subscriptions_proto_msgTypes, - }.Build() - File_org_signal_chat_subscriptions_proto = out.File - file_org_signal_chat_subscriptions_proto_goTypes = nil - file_org_signal_chat_subscriptions_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/rpc/subscriptions/subscriptions_grpc.pb.go b/pkg/signalmeow/protobuf/rpc/subscriptions/subscriptions_grpc.pb.go deleted file mode 100644 index 5153be8..0000000 --- a/pkg/signalmeow/protobuf/rpc/subscriptions/subscriptions_grpc.pb.go +++ /dev/null @@ -1,601 +0,0 @@ -// -// Copyright 2026 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v7.34.1 -// source: org/signal/chat/subscriptions.proto - -package subscriptions - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - Subscriptions_UpdateSubscriber_FullMethodName = "/org.signal.chat.purchase.Subscriptions/UpdateSubscriber" - Subscriptions_DeleteSubscriber_FullMethodName = "/org.signal.chat.purchase.Subscriptions/DeleteSubscriber" - Subscriptions_CreatePaymentMethod_FullMethodName = "/org.signal.chat.purchase.Subscriptions/CreatePaymentMethod" - Subscriptions_CreatePayPalPaymentMethod_FullMethodName = "/org.signal.chat.purchase.Subscriptions/CreatePayPalPaymentMethod" - Subscriptions_SetDefaultPaymentMethod_FullMethodName = "/org.signal.chat.purchase.Subscriptions/SetDefaultPaymentMethod" - Subscriptions_SetSubscriptionLevel_FullMethodName = "/org.signal.chat.purchase.Subscriptions/SetSubscriptionLevel" - Subscriptions_GetSubscriptionInformation_FullMethodName = "/org.signal.chat.purchase.Subscriptions/GetSubscriptionInformation" - Subscriptions_GetReceiptCredentials_FullMethodName = "/org.signal.chat.purchase.Subscriptions/GetReceiptCredentials" - Subscriptions_SetIapSubscription_FullMethodName = "/org.signal.chat.purchase.Subscriptions/SetIapSubscription" - Subscriptions_GetBankMandate_FullMethodName = "/org.signal.chat.purchase.Subscriptions/GetBankMandate" -) - -// SubscriptionsClient is the client API for Subscriptions service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// # Service for creating donation subscriptions -// -// Configuration for subscription levels can be found in ProductConfiguration. -type SubscriptionsClient interface { - // Subscribers MUST periodically hit this endpoint to update the access time on the subscription record. Subscribers - // SHOULD attempt to make an update call approximately every 3 days. Not accessing this endpoint for an extended - // period of time will result in the subscription being canceled. - UpdateSubscriber(ctx context.Context, in *UpdateSubscriberRequest, opts ...grpc.CallOption) (*UpdateSubscriberResponse, error) - // Cancels any current subscription at the end of the current subscription period. - // - // Note: Apple IAP subscriptions do not support server-side cancellation, so this method should only be called after - // cancelling a subscription from storekit to keep server data up to date. - DeleteSubscriber(ctx context.Context, in *DeleteSubscriberRequest, opts ...grpc.CallOption) (*DeleteSubscriberResponse, error) - // Returns a client secret that can be used to set up a new payment method with the payment processor. - CreatePaymentMethod(ctx context.Context, in *CreatePaymentMethodRequest, opts ...grpc.CallOption) (*CreatePaymentMethodResponse, error) - // Returns a PayPal billing agreement approval URL and token that can be used to set up PayPal as a payment method. - CreatePayPalPaymentMethod(ctx context.Context, in *CreatePayPalPaymentMethodRequest, opts ...grpc.CallOption) (*CreatePayPalPaymentMethodResponse, error) - // Sets the default payment method for a subscriber. - SetDefaultPaymentMethod(ctx context.Context, in *SetDefaultPaymentMethodRequest, opts ...grpc.CallOption) (*SetDefaultPaymentMethodResponse, error) - // Sets the subscription level and currency for a subscriber. - SetSubscriptionLevel(ctx context.Context, in *SetSubscriptionLevelRequest, opts ...grpc.CallOption) (*SetSubscriptionLevelResponse, error) - // Returns information about the current subscription associated with the provided subscriberId if one exists. - // - // Although it uses [Stripe's values](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses), - // the status field in the response is generic, with [Braintree-specific values](https://developer.paypal.com/braintree/docs/guides/recurring-billing/overview#subscription-statuses) mapped - // to Stripe's. Since we don't support trials or unpaid subscriptions, the associated statuses will never be returned - // by the API. - GetSubscriptionInformation(ctx context.Context, in *GetSubscriptionInformationRequest, opts ...grpc.CallOption) (*GetSubscriptionInformationResponse, error) - // Create a receipt from a valid payment invoice that can be used to obtain an entitlement - // - // This request is repeatable so long as the ReceiptCredentialRequest remains the same. Clients should use the same - // ReceiptCredentialRequest value until they attempt to redeem the resulting ReceiptCredentialPresentation. After - // this point, the ReceiptCredentialRequest MUST NOT be reused or you may not be able to redeem a valid payment - // invoice. Clients SHOULD retry requests at this endpoint with the same ReceiptCredentialRequest value until - // receiving a response. After receiving a response, clients should then compute the ReceiptCredentialPresentation - // and redeem it at the receipt redemption endpoint. Once the first attempt is made there, the same - // ReceiptCredentialRequest MUST NOT be used again to request receipt credentials. - // - // Note that you may in fact redeem TWO or more invoices for the same ReceiptCredentialRequest while retrying this - // operation if a later invoice gets paid while you are retrying. However, the returned receipt is always for the - // latest invoice, so it will have the latest expiration possible and no entitlement time will be lost. The important - // thing is not to reuse ReceiptCredentialRequest after you have started attempting to redeem the associated - // ReceiptCredentialPresentation. Then you may produce a ReceiptCredentialPresentation for a later invoice that - // cannot be redeemed. - // - // Clients MUST validate that the generated receipt credential's level and expiration matches their expectations. - GetReceiptCredentials(ctx context.Context, in *GetReceiptCredentialsRequest, opts ...grpc.CallOption) (*GetReceiptCredentialsResponse, error) - // Set a token that represents an IAP subscription made with App Store/Google Play Billing. - // - // To set up an App Store subscription: - // 1. Create a subscriber with UpdateSubscriber (you must regularly refresh this subscriber) - // 2. [Create a subscription](https://developer.apple.com/documentation/storekit/in-app_purchase/) with the App Store - // directly via StoreKit and obtain a originalTransactionId. - // 3. Call this RPC with the originalTransactionId - // 4. Obtain a receipt via GetReceiptCredentials which can then be used to obtain the - // entitlement - // - // Play Billing: Set a purchaseToken that represents an IAP subscription made with Google Play Billing. - // - // To set up a subscription with Google Play Billing: - // 1. Create a subscriber with UpdateSubscriber (you must regularly refresh this subscriber) - // 2. [Create a subscription](https://developer.android.com/google/play/billing/integrate) with Google Play Billing - // directly and obtain a purchaseToken. Do not [acknowledge](https://developer.android.com/google/play/billing/integrate#subscriptions) - // the purchaseToken. - // 3. Call this RPC with the purchaseToken - // 4. Obtain a receipt via GetReceiptCredentials which can then be used to obtain the - // entitlement - // - // After calling this method, the payment is confirmed. Callers must durably store their subscriberId before calling - // this method to ensure their payment is tracked. - // - // Once a purchaseToken to is posted to a subscriberId, the same subscriberId must not be used with another payment - // method. A different playbilling purchaseToken can be posted to the same subscriberId, in this case the subscription - // associated with the old purchaseToken will be cancelled. - SetIapSubscription(ctx context.Context, in *SetIapSubscriptionRequest, opts ...grpc.CallOption) (*SetIapSubscriptionResponse, error) - // Returns a localized bank mandate for the specified bank transfer type - GetBankMandate(ctx context.Context, in *GetBankMandateRequest, opts ...grpc.CallOption) (*GetBankMandateResponse, error) -} - -type subscriptionsClient struct { - cc grpc.ClientConnInterface -} - -func NewSubscriptionsClient(cc grpc.ClientConnInterface) SubscriptionsClient { - return &subscriptionsClient{cc} -} - -func (c *subscriptionsClient) UpdateSubscriber(ctx context.Context, in *UpdateSubscriberRequest, opts ...grpc.CallOption) (*UpdateSubscriberResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateSubscriberResponse) - err := c.cc.Invoke(ctx, Subscriptions_UpdateSubscriber_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) DeleteSubscriber(ctx context.Context, in *DeleteSubscriberRequest, opts ...grpc.CallOption) (*DeleteSubscriberResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteSubscriberResponse) - err := c.cc.Invoke(ctx, Subscriptions_DeleteSubscriber_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) CreatePaymentMethod(ctx context.Context, in *CreatePaymentMethodRequest, opts ...grpc.CallOption) (*CreatePaymentMethodResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreatePaymentMethodResponse) - err := c.cc.Invoke(ctx, Subscriptions_CreatePaymentMethod_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) CreatePayPalPaymentMethod(ctx context.Context, in *CreatePayPalPaymentMethodRequest, opts ...grpc.CallOption) (*CreatePayPalPaymentMethodResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreatePayPalPaymentMethodResponse) - err := c.cc.Invoke(ctx, Subscriptions_CreatePayPalPaymentMethod_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) SetDefaultPaymentMethod(ctx context.Context, in *SetDefaultPaymentMethodRequest, opts ...grpc.CallOption) (*SetDefaultPaymentMethodResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetDefaultPaymentMethodResponse) - err := c.cc.Invoke(ctx, Subscriptions_SetDefaultPaymentMethod_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) SetSubscriptionLevel(ctx context.Context, in *SetSubscriptionLevelRequest, opts ...grpc.CallOption) (*SetSubscriptionLevelResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetSubscriptionLevelResponse) - err := c.cc.Invoke(ctx, Subscriptions_SetSubscriptionLevel_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) GetSubscriptionInformation(ctx context.Context, in *GetSubscriptionInformationRequest, opts ...grpc.CallOption) (*GetSubscriptionInformationResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetSubscriptionInformationResponse) - err := c.cc.Invoke(ctx, Subscriptions_GetSubscriptionInformation_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) GetReceiptCredentials(ctx context.Context, in *GetReceiptCredentialsRequest, opts ...grpc.CallOption) (*GetReceiptCredentialsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetReceiptCredentialsResponse) - err := c.cc.Invoke(ctx, Subscriptions_GetReceiptCredentials_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) SetIapSubscription(ctx context.Context, in *SetIapSubscriptionRequest, opts ...grpc.CallOption) (*SetIapSubscriptionResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(SetIapSubscriptionResponse) - err := c.cc.Invoke(ctx, Subscriptions_SetIapSubscription_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *subscriptionsClient) GetBankMandate(ctx context.Context, in *GetBankMandateRequest, opts ...grpc.CallOption) (*GetBankMandateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBankMandateResponse) - err := c.cc.Invoke(ctx, Subscriptions_GetBankMandate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SubscriptionsServer is the server API for Subscriptions service. -// All implementations must embed UnimplementedSubscriptionsServer -// for forward compatibility. -// -// # Service for creating donation subscriptions -// -// Configuration for subscription levels can be found in ProductConfiguration. -type SubscriptionsServer interface { - // Subscribers MUST periodically hit this endpoint to update the access time on the subscription record. Subscribers - // SHOULD attempt to make an update call approximately every 3 days. Not accessing this endpoint for an extended - // period of time will result in the subscription being canceled. - UpdateSubscriber(context.Context, *UpdateSubscriberRequest) (*UpdateSubscriberResponse, error) - // Cancels any current subscription at the end of the current subscription period. - // - // Note: Apple IAP subscriptions do not support server-side cancellation, so this method should only be called after - // cancelling a subscription from storekit to keep server data up to date. - DeleteSubscriber(context.Context, *DeleteSubscriberRequest) (*DeleteSubscriberResponse, error) - // Returns a client secret that can be used to set up a new payment method with the payment processor. - CreatePaymentMethod(context.Context, *CreatePaymentMethodRequest) (*CreatePaymentMethodResponse, error) - // Returns a PayPal billing agreement approval URL and token that can be used to set up PayPal as a payment method. - CreatePayPalPaymentMethod(context.Context, *CreatePayPalPaymentMethodRequest) (*CreatePayPalPaymentMethodResponse, error) - // Sets the default payment method for a subscriber. - SetDefaultPaymentMethod(context.Context, *SetDefaultPaymentMethodRequest) (*SetDefaultPaymentMethodResponse, error) - // Sets the subscription level and currency for a subscriber. - SetSubscriptionLevel(context.Context, *SetSubscriptionLevelRequest) (*SetSubscriptionLevelResponse, error) - // Returns information about the current subscription associated with the provided subscriberId if one exists. - // - // Although it uses [Stripe's values](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses), - // the status field in the response is generic, with [Braintree-specific values](https://developer.paypal.com/braintree/docs/guides/recurring-billing/overview#subscription-statuses) mapped - // to Stripe's. Since we don't support trials or unpaid subscriptions, the associated statuses will never be returned - // by the API. - GetSubscriptionInformation(context.Context, *GetSubscriptionInformationRequest) (*GetSubscriptionInformationResponse, error) - // Create a receipt from a valid payment invoice that can be used to obtain an entitlement - // - // This request is repeatable so long as the ReceiptCredentialRequest remains the same. Clients should use the same - // ReceiptCredentialRequest value until they attempt to redeem the resulting ReceiptCredentialPresentation. After - // this point, the ReceiptCredentialRequest MUST NOT be reused or you may not be able to redeem a valid payment - // invoice. Clients SHOULD retry requests at this endpoint with the same ReceiptCredentialRequest value until - // receiving a response. After receiving a response, clients should then compute the ReceiptCredentialPresentation - // and redeem it at the receipt redemption endpoint. Once the first attempt is made there, the same - // ReceiptCredentialRequest MUST NOT be used again to request receipt credentials. - // - // Note that you may in fact redeem TWO or more invoices for the same ReceiptCredentialRequest while retrying this - // operation if a later invoice gets paid while you are retrying. However, the returned receipt is always for the - // latest invoice, so it will have the latest expiration possible and no entitlement time will be lost. The important - // thing is not to reuse ReceiptCredentialRequest after you have started attempting to redeem the associated - // ReceiptCredentialPresentation. Then you may produce a ReceiptCredentialPresentation for a later invoice that - // cannot be redeemed. - // - // Clients MUST validate that the generated receipt credential's level and expiration matches their expectations. - GetReceiptCredentials(context.Context, *GetReceiptCredentialsRequest) (*GetReceiptCredentialsResponse, error) - // Set a token that represents an IAP subscription made with App Store/Google Play Billing. - // - // To set up an App Store subscription: - // 1. Create a subscriber with UpdateSubscriber (you must regularly refresh this subscriber) - // 2. [Create a subscription](https://developer.apple.com/documentation/storekit/in-app_purchase/) with the App Store - // directly via StoreKit and obtain a originalTransactionId. - // 3. Call this RPC with the originalTransactionId - // 4. Obtain a receipt via GetReceiptCredentials which can then be used to obtain the - // entitlement - // - // Play Billing: Set a purchaseToken that represents an IAP subscription made with Google Play Billing. - // - // To set up a subscription with Google Play Billing: - // 1. Create a subscriber with UpdateSubscriber (you must regularly refresh this subscriber) - // 2. [Create a subscription](https://developer.android.com/google/play/billing/integrate) with Google Play Billing - // directly and obtain a purchaseToken. Do not [acknowledge](https://developer.android.com/google/play/billing/integrate#subscriptions) - // the purchaseToken. - // 3. Call this RPC with the purchaseToken - // 4. Obtain a receipt via GetReceiptCredentials which can then be used to obtain the - // entitlement - // - // After calling this method, the payment is confirmed. Callers must durably store their subscriberId before calling - // this method to ensure their payment is tracked. - // - // Once a purchaseToken to is posted to a subscriberId, the same subscriberId must not be used with another payment - // method. A different playbilling purchaseToken can be posted to the same subscriberId, in this case the subscription - // associated with the old purchaseToken will be cancelled. - SetIapSubscription(context.Context, *SetIapSubscriptionRequest) (*SetIapSubscriptionResponse, error) - // Returns a localized bank mandate for the specified bank transfer type - GetBankMandate(context.Context, *GetBankMandateRequest) (*GetBankMandateResponse, error) - mustEmbedUnimplementedSubscriptionsServer() -} - -// UnimplementedSubscriptionsServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedSubscriptionsServer struct{} - -func (UnimplementedSubscriptionsServer) UpdateSubscriber(context.Context, *UpdateSubscriberRequest) (*UpdateSubscriberResponse, error) { - return nil, status.Error(codes.Unimplemented, "method UpdateSubscriber not implemented") -} -func (UnimplementedSubscriptionsServer) DeleteSubscriber(context.Context, *DeleteSubscriberRequest) (*DeleteSubscriberResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DeleteSubscriber not implemented") -} -func (UnimplementedSubscriptionsServer) CreatePaymentMethod(context.Context, *CreatePaymentMethodRequest) (*CreatePaymentMethodResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreatePaymentMethod not implemented") -} -func (UnimplementedSubscriptionsServer) CreatePayPalPaymentMethod(context.Context, *CreatePayPalPaymentMethodRequest) (*CreatePayPalPaymentMethodResponse, error) { - return nil, status.Error(codes.Unimplemented, "method CreatePayPalPaymentMethod not implemented") -} -func (UnimplementedSubscriptionsServer) SetDefaultPaymentMethod(context.Context, *SetDefaultPaymentMethodRequest) (*SetDefaultPaymentMethodResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetDefaultPaymentMethod not implemented") -} -func (UnimplementedSubscriptionsServer) SetSubscriptionLevel(context.Context, *SetSubscriptionLevelRequest) (*SetSubscriptionLevelResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetSubscriptionLevel not implemented") -} -func (UnimplementedSubscriptionsServer) GetSubscriptionInformation(context.Context, *GetSubscriptionInformationRequest) (*GetSubscriptionInformationResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetSubscriptionInformation not implemented") -} -func (UnimplementedSubscriptionsServer) GetReceiptCredentials(context.Context, *GetReceiptCredentialsRequest) (*GetReceiptCredentialsResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetReceiptCredentials not implemented") -} -func (UnimplementedSubscriptionsServer) SetIapSubscription(context.Context, *SetIapSubscriptionRequest) (*SetIapSubscriptionResponse, error) { - return nil, status.Error(codes.Unimplemented, "method SetIapSubscription not implemented") -} -func (UnimplementedSubscriptionsServer) GetBankMandate(context.Context, *GetBankMandateRequest) (*GetBankMandateResponse, error) { - return nil, status.Error(codes.Unimplemented, "method GetBankMandate not implemented") -} -func (UnimplementedSubscriptionsServer) mustEmbedUnimplementedSubscriptionsServer() {} -func (UnimplementedSubscriptionsServer) testEmbeddedByValue() {} - -// UnsafeSubscriptionsServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SubscriptionsServer will -// result in compilation errors. -type UnsafeSubscriptionsServer interface { - mustEmbedUnimplementedSubscriptionsServer() -} - -func RegisterSubscriptionsServer(s grpc.ServiceRegistrar, srv SubscriptionsServer) { - // If the following call panics, it indicates UnimplementedSubscriptionsServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&Subscriptions_ServiceDesc, srv) -} - -func _Subscriptions_UpdateSubscriber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateSubscriberRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).UpdateSubscriber(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_UpdateSubscriber_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).UpdateSubscriber(ctx, req.(*UpdateSubscriberRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_DeleteSubscriber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteSubscriberRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).DeleteSubscriber(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_DeleteSubscriber_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).DeleteSubscriber(ctx, req.(*DeleteSubscriberRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_CreatePaymentMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreatePaymentMethodRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).CreatePaymentMethod(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_CreatePaymentMethod_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).CreatePaymentMethod(ctx, req.(*CreatePaymentMethodRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_CreatePayPalPaymentMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreatePayPalPaymentMethodRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).CreatePayPalPaymentMethod(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_CreatePayPalPaymentMethod_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).CreatePayPalPaymentMethod(ctx, req.(*CreatePayPalPaymentMethodRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_SetDefaultPaymentMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetDefaultPaymentMethodRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).SetDefaultPaymentMethod(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_SetDefaultPaymentMethod_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).SetDefaultPaymentMethod(ctx, req.(*SetDefaultPaymentMethodRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_SetSubscriptionLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetSubscriptionLevelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).SetSubscriptionLevel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_SetSubscriptionLevel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).SetSubscriptionLevel(ctx, req.(*SetSubscriptionLevelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_GetSubscriptionInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSubscriptionInformationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).GetSubscriptionInformation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_GetSubscriptionInformation_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).GetSubscriptionInformation(ctx, req.(*GetSubscriptionInformationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_GetReceiptCredentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetReceiptCredentialsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).GetReceiptCredentials(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_GetReceiptCredentials_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).GetReceiptCredentials(ctx, req.(*GetReceiptCredentialsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_SetIapSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SetIapSubscriptionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).SetIapSubscription(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_SetIapSubscription_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).SetIapSubscription(ctx, req.(*SetIapSubscriptionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Subscriptions_GetBankMandate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBankMandateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SubscriptionsServer).GetBankMandate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Subscriptions_GetBankMandate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SubscriptionsServer).GetBankMandate(ctx, req.(*GetBankMandateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Subscriptions_ServiceDesc is the grpc.ServiceDesc for Subscriptions service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Subscriptions_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "org.signal.chat.purchase.Subscriptions", - HandlerType: (*SubscriptionsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "UpdateSubscriber", - Handler: _Subscriptions_UpdateSubscriber_Handler, - }, - { - MethodName: "DeleteSubscriber", - Handler: _Subscriptions_DeleteSubscriber_Handler, - }, - { - MethodName: "CreatePaymentMethod", - Handler: _Subscriptions_CreatePaymentMethod_Handler, - }, - { - MethodName: "CreatePayPalPaymentMethod", - Handler: _Subscriptions_CreatePayPalPaymentMethod_Handler, - }, - { - MethodName: "SetDefaultPaymentMethod", - Handler: _Subscriptions_SetDefaultPaymentMethod_Handler, - }, - { - MethodName: "SetSubscriptionLevel", - Handler: _Subscriptions_SetSubscriptionLevel_Handler, - }, - { - MethodName: "GetSubscriptionInformation", - Handler: _Subscriptions_GetSubscriptionInformation_Handler, - }, - { - MethodName: "GetReceiptCredentials", - Handler: _Subscriptions_GetReceiptCredentials_Handler, - }, - { - MethodName: "SetIapSubscription", - Handler: _Subscriptions_SetIapSubscription_Handler, - }, - { - MethodName: "GetBankMandate", - Handler: _Subscriptions_GetBankMandate_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "org/signal/chat/subscriptions.proto", -} diff --git a/pkg/signalmeow/protobuf/rpc/tag/tag.pb.go b/pkg/signalmeow/protobuf/rpc/tag/tag.pb.go deleted file mode 100644 index bd79729..0000000 --- a/pkg/signalmeow/protobuf/rpc/tag/tag.pb.go +++ /dev/null @@ -1,110 +0,0 @@ -// -// Copyright 2025 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: org/signal/chat/tag.proto - -package tag - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var file_org_signal_chat_tag_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 71000, - Name: "org.signal.chat.tag.reason", - Tag: "bytes,71000,opt,name=reason", - Filename: "org/signal/chat/tag.proto", - }, -} - -// Extension fields to descriptorpb.FieldOptions. -var ( - // Indicate that a message which includes this field (directly or indirectly) - // was generated for a particular reason. - // - // ``` - // import "org/signal/chat/tag.proto" - // - // message LookupThingResponse { - // oneof response { - // string thing = 1; - // Error not_found = 2 [(tag.reason) = "not_found"]; - // Error forbidden = 3 [(tag.reason) = "forbidden"]; - // } - // } - // - // ``` - // - // Metrics middleware may then inspect `LookupThingResponse` and tag responses - // with the provided reason. This is useful when multiple outcomes are - // potentially represented with a status = "OK" RPC response. - // - // Valid messages should only have a single reason set. If a message has - // multiple fields present that have a reason option set, no guarantees are - // made about the reason that is selected. - // - // optional string reason = 71000; - E_Reason = &file_org_signal_chat_tag_proto_extTypes[0] -) - -var File_org_signal_chat_tag_proto protoreflect.FileDescriptor - -const file_org_signal_chat_tag_proto_rawDesc = "" + - "\n" + - "\x19org/signal/chat/tag.proto\x12\x13org.signal.chat.tag\x1a google/protobuf/descriptor.proto::\n" + - "\x06reason\x12\x1d.google.protobuf.FieldOptions\x18ت\x04 \x01(\tR\x06reason\x88\x01\x01B\x02P\x01b\x06proto3" - -var file_org_signal_chat_tag_proto_goTypes = []any{ - (*descriptorpb.FieldOptions)(nil), // 0: google.protobuf.FieldOptions -} -var file_org_signal_chat_tag_proto_depIdxs = []int32{ - 0, // 0: org.signal.chat.tag.reason:extendee -> google.protobuf.FieldOptions - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 0, // [0:1] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_org_signal_chat_tag_proto_init() } -func file_org_signal_chat_tag_proto_init() { - if File_org_signal_chat_tag_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_org_signal_chat_tag_proto_rawDesc), len(file_org_signal_chat_tag_proto_rawDesc)), - NumEnums: 0, - NumMessages: 0, - NumExtensions: 1, - NumServices: 0, - }, - GoTypes: file_org_signal_chat_tag_proto_goTypes, - DependencyIndexes: file_org_signal_chat_tag_proto_depIdxs, - ExtensionInfos: file_org_signal_chat_tag_proto_extTypes, - }.Build() - File_org_signal_chat_tag_proto = out.File - file_org_signal_chat_tag_proto_goTypes = nil - file_org_signal_chat_tag_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/DeviceName.pb.go b/pkg/signalmeow/protobuf/signalpb/DeviceName.pb.go deleted file mode 100644 index 3e88778..0000000 --- a/pkg/signalmeow/protobuf/signalpb/DeviceName.pb.go +++ /dev/null @@ -1,149 +0,0 @@ -//* -// Copyright (C) 2014-2016 Open Whisper Systems -// -// 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 -// source: signalpb/DeviceName.proto - -package signalpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type DeviceName struct { - state protoimpl.MessageState `protogen:"open.v1"` - EphemeralPublic []byte `protobuf:"bytes,1,opt,name=ephemeralPublic" json:"ephemeralPublic,omitempty"` - SyntheticIv []byte `protobuf:"bytes,2,opt,name=syntheticIv" json:"syntheticIv,omitempty"` - Ciphertext []byte `protobuf:"bytes,3,opt,name=ciphertext" json:"ciphertext,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeviceName) Reset() { - *x = DeviceName{} - mi := &file_signalpb_DeviceName_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeviceName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeviceName) ProtoMessage() {} - -func (x *DeviceName) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_DeviceName_proto_msgTypes[0] - 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 DeviceName.ProtoReflect.Descriptor instead. -func (*DeviceName) Descriptor() ([]byte, []int) { - return file_signalpb_DeviceName_proto_rawDescGZIP(), []int{0} -} - -func (x *DeviceName) GetEphemeralPublic() []byte { - if x != nil { - return x.EphemeralPublic - } - return nil -} - -func (x *DeviceName) GetSyntheticIv() []byte { - if x != nil { - return x.SyntheticIv - } - return nil -} - -func (x *DeviceName) GetCiphertext() []byte { - if x != nil { - return x.Ciphertext - } - return nil -} - -var File_signalpb_DeviceName_proto protoreflect.FileDescriptor - -const file_signalpb_DeviceName_proto_rawDesc = "" + - "\n" + - "\x19signalpb/DeviceName.proto\x12\rsignalservice\"x\n" + - "\n" + - "DeviceName\x12(\n" + - "\x0fephemeralPublic\x18\x01 \x01(\fR\x0fephemeralPublic\x12 \n" + - "\vsyntheticIv\x18\x02 \x01(\fR\vsyntheticIv\x12\x1e\n" + - "\n" + - "ciphertext\x18\x03 \x01(\fR\n" + - "ciphertextB\x1d\n" + - "\x1borg.signal.core.util.crypto" - -var ( - file_signalpb_DeviceName_proto_rawDescOnce sync.Once - file_signalpb_DeviceName_proto_rawDescData []byte -) - -func file_signalpb_DeviceName_proto_rawDescGZIP() []byte { - file_signalpb_DeviceName_proto_rawDescOnce.Do(func() { - file_signalpb_DeviceName_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_signalpb_DeviceName_proto_rawDesc), len(file_signalpb_DeviceName_proto_rawDesc))) - }) - return file_signalpb_DeviceName_proto_rawDescData -} - -var file_signalpb_DeviceName_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_signalpb_DeviceName_proto_goTypes = []any{ - (*DeviceName)(nil), // 0: signalservice.DeviceName -} -var file_signalpb_DeviceName_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_signalpb_DeviceName_proto_init() } -func file_signalpb_DeviceName_proto_init() { - if File_signalpb_DeviceName_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_signalpb_DeviceName_proto_rawDesc), len(file_signalpb_DeviceName_proto_rawDesc)), - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signalpb_DeviceName_proto_goTypes, - DependencyIndexes: file_signalpb_DeviceName_proto_depIdxs, - MessageInfos: file_signalpb_DeviceName_proto_msgTypes, - }.Build() - File_signalpb_DeviceName_proto = out.File - file_signalpb_DeviceName_proto_goTypes = nil - file_signalpb_DeviceName_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/DeviceName.proto b/pkg/signalmeow/protobuf/signalpb/DeviceName.proto deleted file mode 100644 index 7db04ed..0000000 --- a/pkg/signalmeow/protobuf/signalpb/DeviceName.proto +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (C) 2014-2016 Open Whisper Systems - * - * Licensed according to the LICENSE file in this repository. - */ - -syntax = "proto2"; - -package signalservice; - -option java_package = "org.signal.core.util.crypto"; - -message DeviceName { - optional bytes ephemeralPublic = 1; - optional bytes syntheticIv = 2; - optional bytes ciphertext = 3; -} diff --git a/pkg/signalmeow/protobuf/signalpb/Groups.pb.go b/pkg/signalmeow/protobuf/signalpb/Groups.pb.go deleted file mode 100644 index 4b37c4a..0000000 --- a/pkg/signalmeow/protobuf/signalpb/Groups.pb.go +++ /dev/null @@ -1,3183 +0,0 @@ -// -// Copyright 2020 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: signalpb/Groups.proto - -package signalpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Member_Role int32 - -const ( - Member_UNKNOWN Member_Role = 0 - Member_DEFAULT Member_Role = 1 - Member_ADMINISTRATOR Member_Role = 2 -) - -// Enum value maps for Member_Role. -var ( - Member_Role_name = map[int32]string{ - 0: "UNKNOWN", - 1: "DEFAULT", - 2: "ADMINISTRATOR", - } - Member_Role_value = map[string]int32{ - "UNKNOWN": 0, - "DEFAULT": 1, - "ADMINISTRATOR": 2, - } -) - -func (x Member_Role) Enum() *Member_Role { - p := new(Member_Role) - *p = x - return p -} - -func (x Member_Role) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Member_Role) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_Groups_proto_enumTypes[0].Descriptor() -} - -func (Member_Role) Type() protoreflect.EnumType { - return &file_signalpb_Groups_proto_enumTypes[0] -} - -func (x Member_Role) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Member_Role.Descriptor instead. -func (Member_Role) EnumDescriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{1, 0} -} - -type AccessControl_AccessRequired int32 - -const ( - AccessControl_UNKNOWN AccessControl_AccessRequired = 0 - AccessControl_ANY AccessControl_AccessRequired = 1 - AccessControl_MEMBER AccessControl_AccessRequired = 2 - AccessControl_ADMINISTRATOR AccessControl_AccessRequired = 3 - AccessControl_UNSATISFIABLE AccessControl_AccessRequired = 4 -) - -// Enum value maps for AccessControl_AccessRequired. -var ( - AccessControl_AccessRequired_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ANY", - 2: "MEMBER", - 3: "ADMINISTRATOR", - 4: "UNSATISFIABLE", - } - AccessControl_AccessRequired_value = map[string]int32{ - "UNKNOWN": 0, - "ANY": 1, - "MEMBER": 2, - "ADMINISTRATOR": 3, - "UNSATISFIABLE": 4, - } -) - -func (x AccessControl_AccessRequired) Enum() *AccessControl_AccessRequired { - p := new(AccessControl_AccessRequired) - *p = x - return p -} - -func (x AccessControl_AccessRequired) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccessControl_AccessRequired) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_Groups_proto_enumTypes[1].Descriptor() -} - -func (AccessControl_AccessRequired) Type() protoreflect.EnumType { - return &file_signalpb_Groups_proto_enumTypes[1] -} - -func (x AccessControl_AccessRequired) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccessControl_AccessRequired.Descriptor instead. -func (AccessControl_AccessRequired) EnumDescriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{5, 0} -} - -type AvatarUploadAttributes struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Credential string `protobuf:"bytes,2,opt,name=credential,proto3" json:"credential,omitempty"` - Acl string `protobuf:"bytes,3,opt,name=acl,proto3" json:"acl,omitempty"` - Algorithm string `protobuf:"bytes,4,opt,name=algorithm,proto3" json:"algorithm,omitempty"` - Date string `protobuf:"bytes,5,opt,name=date,proto3" json:"date,omitempty"` - Policy string `protobuf:"bytes,6,opt,name=policy,proto3" json:"policy,omitempty"` - Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AvatarUploadAttributes) Reset() { - *x = AvatarUploadAttributes{} - mi := &file_signalpb_Groups_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AvatarUploadAttributes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AvatarUploadAttributes) ProtoMessage() {} - -func (x *AvatarUploadAttributes) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[0] - 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 AvatarUploadAttributes.ProtoReflect.Descriptor instead. -func (*AvatarUploadAttributes) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{0} -} - -func (x *AvatarUploadAttributes) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *AvatarUploadAttributes) GetCredential() string { - if x != nil { - return x.Credential - } - return "" -} - -func (x *AvatarUploadAttributes) GetAcl() string { - if x != nil { - return x.Acl - } - return "" -} - -func (x *AvatarUploadAttributes) GetAlgorithm() string { - if x != nil { - return x.Algorithm - } - return "" -} - -func (x *AvatarUploadAttributes) GetDate() string { - if x != nil { - return x.Date - } - return "" -} - -func (x *AvatarUploadAttributes) GetPolicy() string { - if x != nil { - return x.Policy - } - return "" -} - -func (x *AvatarUploadAttributes) GetSignature() string { - if x != nil { - return x.Signature - } - return "" -} - -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 -} - -func (x *Member) Reset() { - *x = Member{} - mi := &file_signalpb_Groups_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Member) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Member) ProtoMessage() {} - -func (x *Member) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[1] - 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 Member.ProtoReflect.Descriptor instead. -func (*Member) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{1} -} - -func (x *Member) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *Member) GetRole() Member_Role { - if x != nil { - return x.Role - } - return Member_UNKNOWN -} - -func (x *Member) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *Member) GetPresentation() []byte { - if x != nil { - return x.Presentation - } - return nil -} - -func (x *Member) GetJoinedAtVersion() uint32 { - if x != nil { - return x.JoinedAtVersion - } - 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 { - 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 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MemberPendingProfileKey) Reset() { - *x = MemberPendingProfileKey{} - mi := &file_signalpb_Groups_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MemberPendingProfileKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MemberPendingProfileKey) ProtoMessage() {} - -func (x *MemberPendingProfileKey) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[2] - 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 MemberPendingProfileKey.ProtoReflect.Descriptor instead. -func (*MemberPendingProfileKey) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{2} -} - -func (x *MemberPendingProfileKey) GetMember() *Member { - if x != nil { - return x.Member - } - return nil -} - -func (x *MemberPendingProfileKey) GetAddedByUserId() []byte { - if x != nil { - return x.AddedByUserId - } - return nil -} - -func (x *MemberPendingProfileKey) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type MemberPendingAdminApproval 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 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MemberPendingAdminApproval) Reset() { - *x = MemberPendingAdminApproval{} - mi := &file_signalpb_Groups_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MemberPendingAdminApproval) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MemberPendingAdminApproval) ProtoMessage() {} - -func (x *MemberPendingAdminApproval) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[3] - 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 MemberPendingAdminApproval.ProtoReflect.Descriptor instead. -func (*MemberPendingAdminApproval) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{3} -} - -func (x *MemberPendingAdminApproval) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *MemberPendingAdminApproval) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *MemberPendingAdminApproval) GetPresentation() []byte { - if x != nil { - return x.Presentation - } - return nil -} - -func (x *MemberPendingAdminApproval) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type MemberBanned 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 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MemberBanned) Reset() { - *x = MemberBanned{} - mi := &file_signalpb_Groups_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MemberBanned) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MemberBanned) ProtoMessage() {} - -func (x *MemberBanned) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[4] - 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 MemberBanned.ProtoReflect.Descriptor instead. -func (*MemberBanned) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{4} -} - -func (x *MemberBanned) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *MemberBanned) GetTimestamp() uint64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccessControl) Reset() { - *x = AccessControl{} - mi := &file_signalpb_Groups_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccessControl) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccessControl) ProtoMessage() {} - -func (x *AccessControl) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[5] - 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 AccessControl.ProtoReflect.Descriptor instead. -func (*AccessControl) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{5} -} - -func (x *AccessControl) GetAttributes() AccessControl_AccessRequired { - if x != nil { - return x.Attributes - } - return AccessControl_UNKNOWN -} - -func (x *AccessControl) GetMembers() AccessControl_AccessRequired { - if x != nil { - return x.Members - } - return AccessControl_UNKNOWN -} - -func (x *AccessControl) GetAddFromInviteLink() AccessControl_AccessRequired { - if x != nil { - return x.AddFromInviteLink - } - 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 -} - -func (x *Group) Reset() { - *x = Group{} - mi := &file_signalpb_Groups_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Group) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Group) ProtoMessage() {} - -func (x *Group) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[6] - 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 Group.ProtoReflect.Descriptor instead. -func (*Group) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{6} -} - -func (x *Group) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *Group) GetTitle() []byte { - if x != nil { - return x.Title - } - return nil -} - -func (x *Group) GetDescription() []byte { - if x != nil { - return x.Description - } - return nil -} - -func (x *Group) GetAvatarUrl() string { - if x != nil { - return x.AvatarUrl - } - return "" -} - -func (x *Group) GetDisappearingMessagesTimer() []byte { - if x != nil { - return x.DisappearingMessagesTimer - } - return nil -} - -func (x *Group) GetAccessControl() *AccessControl { - if x != nil { - return x.AccessControl - } - return nil -} - -func (x *Group) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *Group) GetMembers() []*Member { - if x != nil { - return x.Members - } - return nil -} - -func (x *Group) GetMembersPendingProfileKey() []*MemberPendingProfileKey { - if x != nil { - return x.MembersPendingProfileKey - } - return nil -} - -func (x *Group) GetMembersPendingAdminApproval() []*MemberPendingAdminApproval { - if x != nil { - return x.MembersPendingAdminApproval - } - return nil -} - -func (x *Group) GetInviteLinkPassword() []byte { - if x != nil { - return x.InviteLinkPassword - } - return nil -} - -func (x *Group) GetAnnouncementsOnly() bool { - if x != nil { - return x.AnnouncementsOnly - } - return false -} - -func (x *Group) GetMembersBanned() []*MemberBanned { - if x != nil { - return x.MembersBanned - } - return nil -} - -func (x *Group) GetTerminated() bool { - if x != nil { - return x.Terminated - } - return false -} - -type GroupAttributeBlob struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Content: - // - // *GroupAttributeBlob_Title - // *GroupAttributeBlob_Avatar - // *GroupAttributeBlob_DisappearingMessagesDuration - // *GroupAttributeBlob_DescriptionText - Content isGroupAttributeBlob_Content `protobuf_oneof:"content"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupAttributeBlob) Reset() { - *x = GroupAttributeBlob{} - mi := &file_signalpb_Groups_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupAttributeBlob) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupAttributeBlob) ProtoMessage() {} - -func (x *GroupAttributeBlob) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[7] - 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 GroupAttributeBlob.ProtoReflect.Descriptor instead. -func (*GroupAttributeBlob) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{7} -} - -func (x *GroupAttributeBlob) GetContent() isGroupAttributeBlob_Content { - if x != nil { - return x.Content - } - return nil -} - -func (x *GroupAttributeBlob) GetTitle() string { - if x != nil { - if x, ok := x.Content.(*GroupAttributeBlob_Title); ok { - return x.Title - } - } - return "" -} - -func (x *GroupAttributeBlob) GetAvatar() []byte { - if x != nil { - if x, ok := x.Content.(*GroupAttributeBlob_Avatar); ok { - return x.Avatar - } - } - return nil -} - -func (x *GroupAttributeBlob) GetDisappearingMessagesDuration() uint32 { - if x != nil { - if x, ok := x.Content.(*GroupAttributeBlob_DisappearingMessagesDuration); ok { - return x.DisappearingMessagesDuration - } - } - return 0 -} - -func (x *GroupAttributeBlob) GetDescriptionText() string { - if x != nil { - if x, ok := x.Content.(*GroupAttributeBlob_DescriptionText); ok { - return x.DescriptionText - } - } - return "" -} - -type isGroupAttributeBlob_Content interface { - isGroupAttributeBlob_Content() -} - -type GroupAttributeBlob_Title struct { - Title string `protobuf:"bytes,1,opt,name=title,proto3,oneof"` -} - -type GroupAttributeBlob_Avatar struct { - Avatar []byte `protobuf:"bytes,2,opt,name=avatar,proto3,oneof"` -} - -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"` -} - -func (*GroupAttributeBlob_Title) isGroupAttributeBlob_Content() {} - -func (*GroupAttributeBlob_Avatar) isGroupAttributeBlob_Content() {} - -func (*GroupAttributeBlob_DisappearingMessagesDuration) isGroupAttributeBlob_Content() {} - -func (*GroupAttributeBlob_DescriptionText) isGroupAttributeBlob_Content() {} - -type GroupInviteLink struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Contents: - // - // *GroupInviteLink_ContentsV1 - Contents isGroupInviteLink_Contents `protobuf_oneof:"contents"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupInviteLink) Reset() { - *x = GroupInviteLink{} - mi := &file_signalpb_Groups_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupInviteLink) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupInviteLink) ProtoMessage() {} - -func (x *GroupInviteLink) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_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 GroupInviteLink.ProtoReflect.Descriptor instead. -func (*GroupInviteLink) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{8} -} - -func (x *GroupInviteLink) GetContents() isGroupInviteLink_Contents { - if x != nil { - return x.Contents - } - return nil -} - -func (x *GroupInviteLink) GetContentsV1() *GroupInviteLink_GroupInviteLinkContentsV1 { - if x != nil { - if x, ok := x.Contents.(*GroupInviteLink_ContentsV1); ok { - return x.ContentsV1 - } - } - return nil -} - -type isGroupInviteLink_Contents interface { - isGroupInviteLink_Contents() -} - -type GroupInviteLink_ContentsV1 struct { - ContentsV1 *GroupInviteLink_GroupInviteLinkContentsV1 `protobuf:"bytes,1,opt,name=contentsV1,proto3,oneof"` -} - -func (*GroupInviteLink_ContentsV1) 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"` - PendingAdminApproval bool `protobuf:"varint,7,opt,name=pendingAdminApproval,proto3" json:"pendingAdminApproval,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupJoinInfo) Reset() { - *x = GroupJoinInfo{} - mi := &file_signalpb_Groups_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupJoinInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupJoinInfo) ProtoMessage() {} - -func (x *GroupJoinInfo) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_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 GroupJoinInfo.ProtoReflect.Descriptor instead. -func (*GroupJoinInfo) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{9} -} - -func (x *GroupJoinInfo) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *GroupJoinInfo) GetTitle() []byte { - if x != nil { - return x.Title - } - 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 - } - return "" -} - -func (x *GroupJoinInfo) GetMemberCount() uint32 { - if x != nil { - return x.MemberCount - } - return 0 -} - -func (x *GroupJoinInfo) GetAddFromInviteLink() AccessControl_AccessRequired { - if x != nil { - return x.AddFromInviteLink - } - return AccessControl_UNKNOWN -} - -func (x *GroupJoinInfo) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *GroupJoinInfo) GetPendingAdminApproval() bool { - if x != nil { - return x.PendingAdminApproval - } - 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_signalpb_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_signalpb_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 GroupChange.ProtoReflect.Descriptor instead. -func (*GroupChange) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10} -} - -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 ExternalGroupCredential 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_signalpb_Groups_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExternalGroupCredential) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExternalGroupCredential) ProtoMessage() {} - -func (x *ExternalGroupCredential) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[11] - 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 ExternalGroupCredential.ProtoReflect.Descriptor instead. -func (*ExternalGroupCredential) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{11} -} - -func (x *ExternalGroupCredential) 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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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 -} - -func (x *GroupChange_Actions) Reset() { - *x = GroupChange_Actions{} - mi := &file_signalpb_Groups_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions) ProtoMessage() {} - -func (x *GroupChange_Actions) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[16] - 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.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0} -} - -func (x *GroupChange_Actions) GetSourceUserId() []byte { - if x != nil { - return x.SourceUserId - } - return nil -} - -func (x *GroupChange_Actions) GetGroupId() []byte { - if x != nil { - return x.GroupId - } - return nil -} - -func (x *GroupChange_Actions) GetVersion() uint32 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *GroupChange_Actions) GetAddMembers() []*GroupChange_Actions_AddMemberAction { - if x != nil { - return x.AddMembers - } - return nil -} - -func (x *GroupChange_Actions) GetDeleteMembers() []*GroupChange_Actions_DeleteMemberAction { - if x != nil { - return x.DeleteMembers - } - return nil -} - -func (x *GroupChange_Actions) GetModifyMemberRoles() []*GroupChange_Actions_ModifyMemberRoleAction { - if x != nil { - return x.ModifyMemberRoles - } - return nil -} - -func (x *GroupChange_Actions) GetModifyMemberProfileKeys() []*GroupChange_Actions_ModifyMemberProfileKeyAction { - if x != nil { - return x.ModifyMemberProfileKeys - } - return nil -} - -func (x *GroupChange_Actions) GetAddMembersPendingProfileKey() []*GroupChange_Actions_AddMemberPendingProfileKeyAction { - if x != nil { - return x.AddMembersPendingProfileKey - } - return nil -} - -func (x *GroupChange_Actions) GetDeleteMembersPendingProfileKey() []*GroupChange_Actions_DeleteMemberPendingProfileKeyAction { - if x != nil { - return x.DeleteMembersPendingProfileKey - } - return nil -} - -func (x *GroupChange_Actions) GetPromoteMembersPendingProfileKey() []*GroupChange_Actions_PromoteMemberPendingProfileKeyAction { - if x != nil { - return x.PromoteMembersPendingProfileKey - } - return nil -} - -func (x *GroupChange_Actions) GetModifyTitle() *GroupChange_Actions_ModifyTitleAction { - if x != nil { - return x.ModifyTitle - } - return nil -} - -func (x *GroupChange_Actions) GetModifyAvatar() *GroupChange_Actions_ModifyAvatarAction { - if x != nil { - return x.ModifyAvatar - } - return nil -} - -func (x *GroupChange_Actions) GetModifyDisappearingMessageTimer() *GroupChange_Actions_ModifyDisappearingMessageTimerAction { - if x != nil { - return x.ModifyDisappearingMessageTimer - } - return nil -} - -func (x *GroupChange_Actions) GetModifyAttributesAccess() *GroupChange_Actions_ModifyAttributesAccessControlAction { - if x != nil { - return x.ModifyAttributesAccess - } - return nil -} - -func (x *GroupChange_Actions) GetModifyMemberAccess() *GroupChange_Actions_ModifyMembersAccessControlAction { - if x != nil { - return x.ModifyMemberAccess - } - return nil -} - -func (x *GroupChange_Actions) GetModifyAddFromInviteLinkAccess() *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction { - if x != nil { - return x.ModifyAddFromInviteLinkAccess - } - return nil -} - -func (x *GroupChange_Actions) GetAddMembersPendingAdminApproval() []*GroupChange_Actions_AddMemberPendingAdminApprovalAction { - if x != nil { - return x.AddMembersPendingAdminApproval - } - return nil -} - -func (x *GroupChange_Actions) GetDeleteMembersPendingAdminApproval() []*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction { - if x != nil { - return x.DeleteMembersPendingAdminApproval - } - return nil -} - -func (x *GroupChange_Actions) GetPromoteMembersPendingAdminApproval() []*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction { - if x != nil { - return x.PromoteMembersPendingAdminApproval - } - return nil -} - -func (x *GroupChange_Actions) GetModifyInviteLinkPassword() *GroupChange_Actions_ModifyInviteLinkPasswordAction { - if x != nil { - return x.ModifyInviteLinkPassword - } - return nil -} - -func (x *GroupChange_Actions) GetModifyDescription() *GroupChange_Actions_ModifyDescriptionAction { - if x != nil { - return x.ModifyDescription - } - return nil -} - -func (x *GroupChange_Actions) GetModifyAnnouncementsOnly() *GroupChange_Actions_ModifyAnnouncementsOnlyAction { - if x != nil { - return x.ModifyAnnouncementsOnly - } - return nil -} - -func (x *GroupChange_Actions) GetAddMembersBanned() []*GroupChange_Actions_AddMemberBannedAction { - if x != nil { - return x.AddMembersBanned - } - return nil -} - -func (x *GroupChange_Actions) GetDeleteMembersBanned() []*GroupChange_Actions_DeleteMemberBannedAction { - if x != nil { - return x.DeleteMembersBanned - } - return nil -} - -func (x *GroupChange_Actions) GetPromoteMembersPendingPniAciProfileKey() []*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction { - 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 nil -} - -type GroupChange_Actions_AddMemberAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Added *Member `protobuf:"bytes,1,opt,name=added,proto3" json:"added,omitempty"` - JoinFromInviteLink bool `protobuf:"varint,2,opt,name=joinFromInviteLink,proto3" json:"joinFromInviteLink,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_AddMemberAction) Reset() { - *x = GroupChange_Actions_AddMemberAction{} - mi := &file_signalpb_Groups_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_AddMemberAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_AddMemberAction) ProtoMessage() {} - -func (x *GroupChange_Actions_AddMemberAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[17] - 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_AddMemberAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_AddMemberAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 0} -} - -func (x *GroupChange_Actions_AddMemberAction) GetAdded() *Member { - if x != nil { - return x.Added - } - return nil -} - -func (x *GroupChange_Actions_AddMemberAction) GetJoinFromInviteLink() bool { - if x != nil { - return x.JoinFromInviteLink - } - return false -} - -type GroupChange_Actions_DeleteMemberAction 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_DeleteMemberAction) Reset() { - *x = GroupChange_Actions_DeleteMemberAction{} - mi := &file_signalpb_Groups_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_DeleteMemberAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_DeleteMemberAction) ProtoMessage() {} - -func (x *GroupChange_Actions_DeleteMemberAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[18] - 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_DeleteMemberAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_DeleteMemberAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 1} -} - -func (x *GroupChange_Actions_DeleteMemberAction) GetDeletedUserId() []byte { - if x != nil { - return x.DeletedUserId - } - return nil -} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyMemberRoleAction) Reset() { - *x = GroupChange_Actions_ModifyMemberRoleAction{} - mi := &file_signalpb_Groups_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyMemberRoleAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyMemberRoleAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyMemberRoleAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[19] - 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_ModifyMemberRoleAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyMemberRoleAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 2} -} - -func (x *GroupChange_Actions_ModifyMemberRoleAction) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *GroupChange_Actions_ModifyMemberRoleAction) GetRole() Member_Role { - if x != nil { - return x.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_signalpb_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_signalpb_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_signalpb_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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) Reset() { - *x = GroupChange_Actions_ModifyMemberProfileKeyAction{} - mi := &file_signalpb_Groups_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyMemberProfileKeyAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[21] - 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_ModifyMemberProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyMemberProfileKeyAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 4} -} - -func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetPresentation() []byte { - if x != nil { - return x.Presentation - } - return nil -} - -func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *GroupChange_Actions_ModifyMemberProfileKeyAction) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) Reset() { - *x = GroupChange_Actions_AddMemberPendingProfileKeyAction{} - mi := &file_signalpb_Groups_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_AddMemberPendingProfileKeyAction) ProtoMessage() {} - -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[22] - 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_AddMemberPendingProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_AddMemberPendingProfileKeyAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 5} -} - -func (x *GroupChange_Actions_AddMemberPendingProfileKeyAction) GetAdded() *MemberPendingProfileKey { - if x != nil { - return x.Added - } - return nil -} - -type GroupChange_Actions_DeleteMemberPendingProfileKeyAction 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_signalpb_Groups_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_DeleteMemberPendingProfileKeyAction) ProtoMessage() {} - -func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[23] - 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_DeleteMemberPendingProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_DeleteMemberPendingProfileKeyAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 6} -} - -func (x *GroupChange_Actions_DeleteMemberPendingProfileKeyAction) GetDeletedUserId() []byte { - if x != nil { - return x.DeletedUserId - } - return nil -} - -type GroupChange_Actions_PromoteMemberPendingProfileKeyAction 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) Reset() { - *x = GroupChange_Actions_PromoteMemberPendingProfileKeyAction{} - mi := &file_signalpb_Groups_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_PromoteMemberPendingProfileKeyAction) ProtoMessage() {} - -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[24] - 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_PromoteMemberPendingProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_PromoteMemberPendingProfileKeyAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 7} -} - -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) GetPresentation() []byte { - if x != nil { - return x.Presentation - } - return nil -} - -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *GroupChange_Actions_PromoteMemberPendingProfileKeyAction) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -type GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) Reset() { - *x = GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction{} - mi := &file_signalpb_Groups_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) ProtoMessage() {} - -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[25] - 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_PromoteMemberPendingPniAciProfileKeyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 8} -} - -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) GetPresentation() []byte { - if x != nil { - return x.Presentation - } - return nil -} - -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) GetPni() []byte { - if x != nil { - return x.Pni - } - return nil -} - -func (x *GroupChange_Actions_PromoteMemberPendingPniAciProfileKeyAction) 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) Reset() { - *x = GroupChange_Actions_AddMemberPendingAdminApprovalAction{} - mi := &file_signalpb_Groups_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_AddMemberPendingAdminApprovalAction) ProtoMessage() {} - -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[26] - 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_AddMemberPendingAdminApprovalAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_AddMemberPendingAdminApprovalAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 9} -} - -func (x *GroupChange_Actions_AddMemberPendingAdminApprovalAction) GetAdded() *MemberPendingAdminApproval { - if x != nil { - return x.Added - } - return nil -} - -type GroupChange_Actions_DeleteMemberPendingAdminApprovalAction 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_signalpb_Groups_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) ProtoMessage() {} - -func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[27] - 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_DeleteMemberPendingAdminApprovalAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 10} -} - -func (x *GroupChange_Actions_DeleteMemberPendingAdminApprovalAction) GetDeletedUserId() []byte { - if x != nil { - return x.DeletedUserId - } - return nil -} - -type GroupChange_Actions_PromoteMemberPendingAdminApprovalAction 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) Reset() { - *x = GroupChange_Actions_PromoteMemberPendingAdminApprovalAction{} - mi := &file_signalpb_Groups_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) ProtoMessage() {} - -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[28] - 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_PromoteMemberPendingAdminApprovalAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 11} -} - -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) GetUserId() []byte { - if x != nil { - return x.UserId - } - return nil -} - -func (x *GroupChange_Actions_PromoteMemberPendingAdminApprovalAction) GetRole() Member_Role { - if x != nil { - return x.Role - } - return Member_UNKNOWN -} - -type GroupChange_Actions_AddMemberBannedAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Added *MemberBanned `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_signalpb_Groups_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_AddMemberBannedAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_AddMemberBannedAction) ProtoMessage() {} - -func (x *GroupChange_Actions_AddMemberBannedAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[29] - 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_AddMemberBannedAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_AddMemberBannedAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 12} -} - -func (x *GroupChange_Actions_AddMemberBannedAction) GetAdded() *MemberBanned { - if x != nil { - return x.Added - } - return nil -} - -type GroupChange_Actions_DeleteMemberBannedAction 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_signalpb_Groups_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_DeleteMemberBannedAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_DeleteMemberBannedAction) ProtoMessage() {} - -func (x *GroupChange_Actions_DeleteMemberBannedAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[30] - 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_DeleteMemberBannedAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_DeleteMemberBannedAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 13} -} - -func (x *GroupChange_Actions_DeleteMemberBannedAction) GetDeletedUserId() []byte { - if x != nil { - return x.DeletedUserId - } - return nil -} - -type GroupChange_Actions_ModifyTitleAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Title []byte `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyTitleAction) Reset() { - *x = GroupChange_Actions_ModifyTitleAction{} - mi := &file_signalpb_Groups_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyTitleAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyTitleAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyTitleAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[31] - 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_ModifyTitleAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyTitleAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 14} -} - -func (x *GroupChange_Actions_ModifyTitleAction) GetTitle() []byte { - if x != nil { - return x.Title - } - return nil -} - -type GroupChange_Actions_ModifyDescriptionAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Description []byte `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyDescriptionAction) Reset() { - *x = GroupChange_Actions_ModifyDescriptionAction{} - mi := &file_signalpb_Groups_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyDescriptionAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyDescriptionAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyDescriptionAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_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 GroupChange_Actions_ModifyDescriptionAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyDescriptionAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 15} -} - -func (x *GroupChange_Actions_ModifyDescriptionAction) GetDescription() []byte { - if x != nil { - return x.Description - } - return nil -} - -type GroupChange_Actions_ModifyAvatarAction struct { - state protoimpl.MessageState `protogen:"open.v1"` - Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyAvatarAction) Reset() { - *x = GroupChange_Actions_ModifyAvatarAction{} - mi := &file_signalpb_Groups_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyAvatarAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyAvatarAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyAvatarAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_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 GroupChange_Actions_ModifyAvatarAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyAvatarAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 16} -} - -func (x *GroupChange_Actions_ModifyAvatarAction) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -type GroupChange_Actions_ModifyDisappearingMessageTimerAction 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_signalpb_Groups_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyDisappearingMessageTimerAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[34] - 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_ModifyDisappearingMessageTimerAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyDisappearingMessageTimerAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 17} -} - -func (x *GroupChange_Actions_ModifyDisappearingMessageTimerAction) GetTimer() []byte { - if x != nil { - return x.Timer - } - return nil -} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) Reset() { - *x = GroupChange_Actions_ModifyAttributesAccessControlAction{} - mi := &file_signalpb_Groups_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyAttributesAccessControlAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[35] - 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_ModifyAttributesAccessControlAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyAttributesAccessControlAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 18} -} - -func (x *GroupChange_Actions_ModifyAttributesAccessControlAction) GetAttributesAccess() AccessControl_AccessRequired { - if x != nil { - return x.AttributesAccess - } - return AccessControl_UNKNOWN -} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyMembersAccessControlAction) Reset() { - *x = GroupChange_Actions_ModifyMembersAccessControlAction{} - mi := &file_signalpb_Groups_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyMembersAccessControlAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyMembersAccessControlAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyMembersAccessControlAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_proto_msgTypes[36] - 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_ModifyMembersAccessControlAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyMembersAccessControlAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 19} -} - -func (x *GroupChange_Actions_ModifyMembersAccessControlAction) GetMembersAccess() AccessControl_AccessRequired { - if x != nil { - return x.MembersAccess - } - return AccessControl_UNKNOWN -} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) Reset() { - *x = GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction{} - mi := &file_signalpb_Groups_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_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 GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 20} -} - -func (x *GroupChange_Actions_ModifyAddFromInviteLinkAccessControlAction) GetAddFromInviteLinkAccess() AccessControl_AccessRequired { - if x != nil { - return x.AddFromInviteLinkAccess - } - 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_signalpb_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_signalpb_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_signalpb_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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) Reset() { - *x = GroupChange_Actions_ModifyInviteLinkPasswordAction{} - mi := &file_signalpb_Groups_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyInviteLinkPasswordAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_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 GroupChange_Actions_ModifyInviteLinkPasswordAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyInviteLinkPasswordAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 22} -} - -func (x *GroupChange_Actions_ModifyInviteLinkPasswordAction) GetInviteLinkPassword() []byte { - if x != nil { - return x.InviteLinkPassword - } - return nil -} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) Reset() { - *x = GroupChange_Actions_ModifyAnnouncementsOnlyAction{} - mi := &file_signalpb_Groups_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChange_Actions_ModifyAnnouncementsOnlyAction) ProtoMessage() {} - -func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_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 GroupChange_Actions_ModifyAnnouncementsOnlyAction.ProtoReflect.Descriptor instead. -func (*GroupChange_Actions_ModifyAnnouncementsOnlyAction) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{10, 0, 23} -} - -func (x *GroupChange_Actions_ModifyAnnouncementsOnlyAction) GetAnnouncementsOnly() bool { - if x != nil { - return x.AnnouncementsOnly - } - 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_signalpb_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_signalpb_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_signalpb_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"` - GroupState *Group `protobuf:"bytes,2,opt,name=groupState,proto3" json:"groupState,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupChanges_GroupChangeState) Reset() { - *x = GroupChanges_GroupChangeState{} - mi := &file_signalpb_Groups_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupChanges_GroupChangeState) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupChanges_GroupChangeState) ProtoMessage() {} - -func (x *GroupChanges_GroupChangeState) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Groups_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 GroupChanges_GroupChangeState.ProtoReflect.Descriptor instead. -func (*GroupChanges_GroupChangeState) Descriptor() ([]byte, []int) { - return file_signalpb_Groups_proto_rawDescGZIP(), []int{13, 0} -} - -func (x *GroupChanges_GroupChangeState) GetGroupChange() *GroupChange { - if x != nil { - return x.GroupChange - } - return nil -} - -func (x *GroupChanges_GroupChangeState) GetGroupState() *Group { - if x != nil { - return x.GroupState - } - return nil -} - -var File_signalpb_Groups_proto protoreflect.FileDescriptor - -const file_signalpb_Groups_proto_rawDesc = "" + - "\n" + - "\x15signalpb/Groups.proto\x12\x06signal\"\xc4\x01\n" + - "\x16AvatarUploadAttributes\x12\x10\n" + - "\x03key\x18\x01 \x01(\tR\x03key\x12\x1e\n" + - "\n" + - "credential\x18\x02 \x01(\tR\n" + - "credential\x12\x10\n" + - "\x03acl\x18\x03 \x01(\tR\x03acl\x12\x1c\n" + - "\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" + - "\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" + - "\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" + - "\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" + - "\raddedByUserId\x18\x02 \x01(\fR\raddedByUserId\x12\x1c\n" + - "\ttimestamp\x18\x03 \x01(\x04R\ttimestamp\"\x96\x01\n" + - "\x1aMemberPendingAdminApproval\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" + - "\x06userId\x18\x01 \x01(\fR\x06userId\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\"\x8b\x03\n" + - "\rAccessControl\x12D\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" + - "\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" + - "\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" + - "\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" + - "\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" + - "\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" + - "\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" + - "\x12joinFromInviteLink\x18\x02 \x01(\bR\x12joinFromInviteLink\x1a:\n" + - "\x12DeleteMemberAction\x12$\n" + - "\rdeletedUserId\x18\x01 \x01(\fR\rdeletedUserId\x1aY\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" + - "\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" + - "\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" + - "\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" + - "\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" + - "\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" - -var ( - file_signalpb_Groups_proto_rawDescOnce sync.Once - file_signalpb_Groups_proto_rawDescData []byte -) - -func file_signalpb_Groups_proto_rawDescGZIP() []byte { - file_signalpb_Groups_proto_rawDescOnce.Do(func() { - file_signalpb_Groups_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_signalpb_Groups_proto_rawDesc), len(file_signalpb_Groups_proto_rawDesc))) - }) - return file_signalpb_Groups_proto_rawDescData -} - -var file_signalpb_Groups_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_signalpb_Groups_proto_msgTypes = make([]protoimpl.MessageInfo, 43) -var file_signalpb_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 -} -var file_signalpb_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 -} - -func init() { file_signalpb_Groups_proto_init() } -func file_signalpb_Groups_proto_init() { - if File_signalpb_Groups_proto != nil { - return - } - file_signalpb_Groups_proto_msgTypes[7].OneofWrappers = []any{ - (*GroupAttributeBlob_Title)(nil), - (*GroupAttributeBlob_Avatar)(nil), - (*GroupAttributeBlob_DisappearingMessagesDuration)(nil), - (*GroupAttributeBlob_DescriptionText)(nil), - } - file_signalpb_Groups_proto_msgTypes[8].OneofWrappers = []any{ - (*GroupInviteLink_ContentsV1)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_signalpb_Groups_proto_rawDesc), len(file_signalpb_Groups_proto_rawDesc)), - NumEnums: 2, - NumMessages: 43, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signalpb_Groups_proto_goTypes, - DependencyIndexes: file_signalpb_Groups_proto_depIdxs, - EnumInfos: file_signalpb_Groups_proto_enumTypes, - MessageInfos: file_signalpb_Groups_proto_msgTypes, - }.Build() - File_signalpb_Groups_proto = out.File - file_signalpb_Groups_proto_goTypes = nil - file_signalpb_Groups_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/Groups.proto b/pkg/signalmeow/protobuf/signalpb/Groups.proto deleted file mode 100644 index 9843d1c..0000000 --- a/pkg/signalmeow/protobuf/signalpb/Groups.proto +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright 2020 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto3"; - -package signal; - -option java_package = "org.signal.storageservice.storage.protos.groups"; -option java_outer_classname = "GroupProtos"; -option java_multiple_files = true; - -message AvatarUploadAttributes { - string key = 1; - string credential = 2; - 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; - 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 -} - -message MemberPendingProfileKey { - Member member = 1; - bytes addedByUserId = 2; - uint64 timestamp = 3; // ms since epoch -} - -message MemberPendingAdminApproval { - bytes userId = 1; - bytes profileKey = 2; - bytes presentation = 3; - uint64 timestamp = 4; // ms since epoch -} - -message MemberBanned { - bytes userId = 1; - uint64 timestamp = 2; // ms since epoch -} - -message AccessControl { - enum AccessRequired { - UNKNOWN = 0; - ANY = 1; - MEMBER = 2; - ADMINISTRATOR = 3; - UNSATISFIABLE = 4; - } - - 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 -} - -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; - } - - message DeleteMemberAction { - bytes deletedUserId = 1; - } - - 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 - } - - message ModifyMemberProfileKeyAction { - bytes presentation = 1; - bytes user_id = 2; - bytes profile_key = 3; - } - - message AddMemberPendingProfileKeyAction { - MemberPendingProfileKey added = 1; - } - - message DeleteMemberPendingProfileKeyAction { - bytes deletedUserId = 1; - } - - message PromoteMemberPendingProfileKeyAction { - bytes presentation = 1; - bytes user_id = 2; - bytes profile_key = 3; - } - - message PromoteMemberPendingPniAciProfileKeyAction { - bytes presentation = 1; - bytes user_id = 2; - bytes pni = 3; - bytes profile_key = 4; - } - - message AddMemberPendingAdminApprovalAction { - MemberPendingAdminApproval added = 1; - } - - message DeleteMemberPendingAdminApprovalAction { - bytes deletedUserId = 1; - } - - message PromoteMemberPendingAdminApprovalAction { - bytes userId = 1; - Member.Role role = 2; - } - - message AddMemberBannedAction { - MemberBanned added = 1; - } - - message DeleteMemberBannedAction { - bytes deletedUserId = 1; - } - - message ModifyTitleAction { - bytes title = 1; - } - - message ModifyDescriptionAction { - bytes description = 1; - } - - message ModifyAvatarAction { - string avatar = 1; - } - - message ModifyDisappearingMessageTimerAction { - bytes timer = 1; - } - - message ModifyAttributesAccessControlAction { - AccessControl.AccessRequired attributesAccess = 1; - } - - message ModifyMembersAccessControlAction { - AccessControl.AccessRequired membersAccess = 1; - } - - message ModifyAddFromInviteLinkAccessControlAction { - AccessControl.AccessRequired addFromInviteLinkAccess = 1; - } - - message ModifyMemberLabelAccessControlAction { - AccessControl.AccessRequired memberLabelAccess = 1; - } - - message ModifyInviteLinkPasswordAction { - bytes inviteLinkPassword = 1; - } - - message ModifyAnnouncementsOnlyAction { - bool announcements_only = 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 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; -} - -message GroupChanges { - message GroupChangeState { - GroupChange groupChange = 1; - Group groupState = 2; - } - - repeated GroupChangeState groupChanges = 1; - bytes group_send_endorsements_response = 2; -} - -message GroupChangeResponse { - GroupChange group_change = 1; - bytes group_send_endorsements_response = 2; -} diff --git a/pkg/signalmeow/protobuf/signalpb/Provisioning.pb.go b/pkg/signalmeow/protobuf/signalpb/Provisioning.pb.go deleted file mode 100644 index 2d8ee38..0000000 --- a/pkg/signalmeow/protobuf/signalpb/Provisioning.pb.go +++ /dev/null @@ -1,457 +0,0 @@ -// -// Copyright 2020 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: signalpb/Provisioning.proto - -package signalpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ProvisioningVersion int32 - -const ( - ProvisioningVersion_INITIAL ProvisioningVersion = 0 - ProvisioningVersion_TABLET_SUPPORT ProvisioningVersion = 1 - ProvisioningVersion_CURRENT ProvisioningVersion = 1 -) - -// Enum value maps for ProvisioningVersion. -var ( - ProvisioningVersion_name = map[int32]string{ - 0: "INITIAL", - 1: "TABLET_SUPPORT", - // Duplicate value: 1: "CURRENT", - } - ProvisioningVersion_value = map[string]int32{ - "INITIAL": 0, - "TABLET_SUPPORT": 1, - "CURRENT": 1, - } -) - -func (x ProvisioningVersion) Enum() *ProvisioningVersion { - p := new(ProvisioningVersion) - *p = x - return p -} - -func (x ProvisioningVersion) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ProvisioningVersion) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_Provisioning_proto_enumTypes[0].Descriptor() -} - -func (ProvisioningVersion) Type() protoreflect.EnumType { - return &file_signalpb_Provisioning_proto_enumTypes[0] -} - -func (x ProvisioningVersion) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *ProvisioningVersion) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = ProvisioningVersion(num) - return nil -} - -// Deprecated: Use ProvisioningVersion.Descriptor instead. -func (ProvisioningVersion) EnumDescriptor() ([]byte, []int) { - return file_signalpb_Provisioning_proto_rawDescGZIP(), []int{0} -} - -// An opaque address sent by the server when clients first open a provisioning -// WebSocket -type ProvisioningAddress struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The opaque provisioning address for the active provisioning WebSocket - // session; clients should not attempt to interpret or modify the contents - // of the address string - Address *string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProvisioningAddress) Reset() { - *x = ProvisioningAddress{} - mi := &file_signalpb_Provisioning_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProvisioningAddress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProvisioningAddress) ProtoMessage() {} - -func (x *ProvisioningAddress) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Provisioning_proto_msgTypes[0] - 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 ProvisioningAddress.ProtoReflect.Descriptor instead. -func (*ProvisioningAddress) Descriptor() ([]byte, []int) { - return file_signalpb_Provisioning_proto_rawDescGZIP(), []int{0} -} - -func (x *ProvisioningAddress) GetAddress() string { - if x != nil && x.Address != nil { - return *x.Address - } - return "" -} - -type ProvisionEnvelope struct { - state protoimpl.MessageState `protogen:"open.v1"` - PublicKey []byte `protobuf:"bytes,1,opt,name=publicKey" json:"publicKey,omitempty"` - Body []byte `protobuf:"bytes,2,opt,name=body" json:"body,omitempty"` // Encrypted ProvisionMessage - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProvisionEnvelope) Reset() { - *x = ProvisionEnvelope{} - mi := &file_signalpb_Provisioning_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProvisionEnvelope) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProvisionEnvelope) ProtoMessage() {} - -func (x *ProvisionEnvelope) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Provisioning_proto_msgTypes[1] - 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 ProvisionEnvelope.ProtoReflect.Descriptor instead. -func (*ProvisionEnvelope) Descriptor() ([]byte, []int) { - return file_signalpb_Provisioning_proto_rawDescGZIP(), []int{1} -} - -func (x *ProvisionEnvelope) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *ProvisionEnvelope) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -type ProvisionMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - AciIdentityKeyPublic []byte `protobuf:"bytes,1,opt,name=aciIdentityKeyPublic" json:"aciIdentityKeyPublic,omitempty"` - AciIdentityKeyPrivate []byte `protobuf:"bytes,2,opt,name=aciIdentityKeyPrivate" json:"aciIdentityKeyPrivate,omitempty"` - PniIdentityKeyPublic []byte `protobuf:"bytes,11,opt,name=pniIdentityKeyPublic" json:"pniIdentityKeyPublic,omitempty"` - PniIdentityKeyPrivate []byte `protobuf:"bytes,12,opt,name=pniIdentityKeyPrivate" json:"pniIdentityKeyPrivate,omitempty"` - Aci *string `protobuf:"bytes,8,opt,name=aci" json:"aci,omitempty"` - Pni *string `protobuf:"bytes,10,opt,name=pni" json:"pni,omitempty"` - Number *string `protobuf:"bytes,3,opt,name=number" json:"number,omitempty"` - ProvisioningCode *string `protobuf:"bytes,4,opt,name=provisioningCode" json:"provisioningCode,omitempty"` - UserAgent *string `protobuf:"bytes,5,opt,name=userAgent" json:"userAgent,omitempty"` - 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"` - 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 - AciBinary []byte `protobuf:"bytes,17,opt,name=aciBinary" json:"aciBinary,omitempty"` // 16-byte UUID - PniBinary []byte `protobuf:"bytes,18,opt,name=pniBinary" json:"pniBinary,omitempty"` // 16-byte UUID - AuthCredentialSalt []byte `protobuf:"bytes,19,opt,name=authCredentialSalt" json:"authCredentialSalt,omitempty"` // 16-bytes - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ProvisionMessage) Reset() { - *x = ProvisionMessage{} - mi := &file_signalpb_Provisioning_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ProvisionMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProvisionMessage) ProtoMessage() {} - -func (x *ProvisionMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_Provisioning_proto_msgTypes[2] - 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 ProvisionMessage.ProtoReflect.Descriptor instead. -func (*ProvisionMessage) Descriptor() ([]byte, []int) { - return file_signalpb_Provisioning_proto_rawDescGZIP(), []int{2} -} - -func (x *ProvisionMessage) GetAciIdentityKeyPublic() []byte { - if x != nil { - return x.AciIdentityKeyPublic - } - return nil -} - -func (x *ProvisionMessage) GetAciIdentityKeyPrivate() []byte { - if x != nil { - return x.AciIdentityKeyPrivate - } - return nil -} - -func (x *ProvisionMessage) GetPniIdentityKeyPublic() []byte { - if x != nil { - return x.PniIdentityKeyPublic - } - return nil -} - -func (x *ProvisionMessage) GetPniIdentityKeyPrivate() []byte { - if x != nil { - return x.PniIdentityKeyPrivate - } - return nil -} - -func (x *ProvisionMessage) GetAci() string { - if x != nil && x.Aci != nil { - return *x.Aci - } - return "" -} - -func (x *ProvisionMessage) GetPni() string { - if x != nil && x.Pni != nil { - return *x.Pni - } - return "" -} - -func (x *ProvisionMessage) GetNumber() string { - if x != nil && x.Number != nil { - return *x.Number - } - return "" -} - -func (x *ProvisionMessage) GetProvisioningCode() string { - if x != nil && x.ProvisioningCode != nil { - return *x.ProvisioningCode - } - return "" -} - -func (x *ProvisionMessage) GetUserAgent() string { - if x != nil && x.UserAgent != nil { - return *x.UserAgent - } - return "" -} - -func (x *ProvisionMessage) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *ProvisionMessage) GetReadReceipts() bool { - if x != nil && x.ReadReceipts != nil { - return *x.ReadReceipts - } - return false -} - -func (x *ProvisionMessage) GetProvisioningVersion() uint32 { - if x != nil && x.ProvisioningVersion != nil { - return *x.ProvisioningVersion - } - return 0 -} - -func (x *ProvisionMessage) GetEphemeralBackupKey() []byte { - if x != nil { - return x.EphemeralBackupKey - } - return nil -} - -func (x *ProvisionMessage) GetAccountEntropyPool() string { - if x != nil && x.AccountEntropyPool != nil { - return *x.AccountEntropyPool - } - return "" -} - -func (x *ProvisionMessage) GetMediaRootBackupKey() []byte { - if x != nil { - return x.MediaRootBackupKey - } - return nil -} - -func (x *ProvisionMessage) GetAciBinary() []byte { - if x != nil { - return x.AciBinary - } - return nil -} - -func (x *ProvisionMessage) GetPniBinary() []byte { - if x != nil { - return x.PniBinary - } - return nil -} - -func (x *ProvisionMessage) GetAuthCredentialSalt() []byte { - if x != nil { - return x.AuthCredentialSalt - } - return nil -} - -var File_signalpb_Provisioning_proto protoreflect.FileDescriptor - -const file_signalpb_Provisioning_proto_rawDesc = "" + - "\n" + - "\x1bsignalpb/Provisioning.proto\x12\rsignalservice\"/\n" + - "\x13ProvisioningAddress\x12\x18\n" + - "\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\"\xe4\x05\n" + - "\x10ProvisionMessage\x122\n" + - "\x14aciIdentityKeyPublic\x18\x01 \x01(\fR\x14aciIdentityKeyPublic\x124\n" + - "\x15aciIdentityKeyPrivate\x18\x02 \x01(\fR\x15aciIdentityKeyPrivate\x122\n" + - "\x14pniIdentityKeyPublic\x18\v \x01(\fR\x14pniIdentityKeyPublic\x124\n" + - "\x15pniIdentityKeyPrivate\x18\f \x01(\fR\x15pniIdentityKeyPrivate\x12\x10\n" + - "\x03aci\x18\b \x01(\tR\x03aci\x12\x10\n" + - "\x03pni\x18\n" + - " \x01(\tR\x03pni\x12\x16\n" + - "\x06number\x18\x03 \x01(\tR\x06number\x12*\n" + - "\x10provisioningCode\x18\x04 \x01(\tR\x10provisioningCode\x12\x1c\n" + - "\tuserAgent\x18\x05 \x01(\tR\tuserAgent\x12\x1e\n" + - "\n" + - "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" + - "\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\tpniBinary\x12.\n" + - "\x12authCredentialSalt\x18\x13 \x01(\fR\x12authCredentialSaltJ\x04\b\r\x10\x0e*G\n" + - "\x13ProvisioningVersion\x12\v\n" + - "\aINITIAL\x10\x00\x12\x12\n" + - "\x0eTABLET_SUPPORT\x10\x01\x12\v\n" + - "\aCURRENT\x10\x01\x1a\x02\x10\x01BD\n" + - ".org.whispersystems.signalservice.internal.pushB\x12ProvisioningProtos" - -var ( - file_signalpb_Provisioning_proto_rawDescOnce sync.Once - file_signalpb_Provisioning_proto_rawDescData []byte -) - -func file_signalpb_Provisioning_proto_rawDescGZIP() []byte { - file_signalpb_Provisioning_proto_rawDescOnce.Do(func() { - file_signalpb_Provisioning_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_signalpb_Provisioning_proto_rawDesc), len(file_signalpb_Provisioning_proto_rawDesc))) - }) - return file_signalpb_Provisioning_proto_rawDescData -} - -var file_signalpb_Provisioning_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_signalpb_Provisioning_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_signalpb_Provisioning_proto_goTypes = []any{ - (ProvisioningVersion)(0), // 0: signalservice.ProvisioningVersion - (*ProvisioningAddress)(nil), // 1: signalservice.ProvisioningAddress - (*ProvisionEnvelope)(nil), // 2: signalservice.ProvisionEnvelope - (*ProvisionMessage)(nil), // 3: signalservice.ProvisionMessage -} -var file_signalpb_Provisioning_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_signalpb_Provisioning_proto_init() } -func file_signalpb_Provisioning_proto_init() { - if File_signalpb_Provisioning_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_signalpb_Provisioning_proto_rawDesc), len(file_signalpb_Provisioning_proto_rawDesc)), - NumEnums: 1, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signalpb_Provisioning_proto_goTypes, - DependencyIndexes: file_signalpb_Provisioning_proto_depIdxs, - EnumInfos: file_signalpb_Provisioning_proto_enumTypes, - MessageInfos: file_signalpb_Provisioning_proto_msgTypes, - }.Build() - File_signalpb_Provisioning_proto = out.File - file_signalpb_Provisioning_proto_goTypes = nil - file_signalpb_Provisioning_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/Provisioning.proto b/pkg/signalmeow/protobuf/signalpb/Provisioning.proto deleted file mode 100644 index cd8daa0..0000000 --- a/pkg/signalmeow/protobuf/signalpb/Provisioning.proto +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2020 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto2"; - -package signalservice; - -option java_package = "org.whispersystems.signalservice.internal.push"; -option java_outer_classname = "ProvisioningProtos"; - -// An opaque address sent by the server when clients first open a provisioning -// WebSocket -message ProvisioningAddress { - - // The opaque provisioning address for the active provisioning WebSocket - // session; clients should not attempt to interpret or modify the contents - // of the address string - optional string address = 1; -} - -message ProvisionEnvelope { - optional bytes publicKey = 1; - optional bytes body = 2; // Encrypted ProvisionMessage -} - -message ProvisionMessage { - optional bytes aciIdentityKeyPublic = 1; - optional bytes aciIdentityKeyPrivate = 2; - optional bytes pniIdentityKeyPublic = 11; - optional bytes pniIdentityKeyPrivate = 12; - optional string aci = 8; - optional string pni = 10; - optional string number = 3; - optional string provisioningCode = 4; - optional string userAgent = 5; - optional bytes profileKey = 6; - optional bool readReceipts = 7; - optional uint32 provisioningVersion = 9; - reserved /*masterKey*/ 13; // Deprecated in favor of accountEntropyPool - optional bytes ephemeralBackupKey = 14; // 32 bytes - optional string accountEntropyPool = 15; - optional bytes mediaRootBackupKey = 16; // 32-bytes - optional bytes aciBinary = 17; // 16-byte UUID - optional bytes pniBinary = 18; // 16-byte UUID - optional bytes authCredentialSalt = 19; // 16-bytes - // NEXT ID: 20 -} - -enum ProvisioningVersion { - option allow_alias = true; - - INITIAL = 0; - TABLET_SUPPORT = 1; - CURRENT = 1; -} diff --git a/pkg/signalmeow/protobuf/signalpb/SignalService.pb.go b/pkg/signalmeow/protobuf/signalpb/SignalService.pb.go deleted file mode 100644 index b8ee02f..0000000 --- a/pkg/signalmeow/protobuf/signalpb/SignalService.pb.go +++ /dev/null @@ -1,9996 +0,0 @@ -// -// Copyright 2020-2022 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: signalpb/SignalService.proto - -package signalpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -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) -) - -// Enum value maps for Envelope_Type. -var ( - Envelope_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "DOUBLE_RATCHET", - 3: "PREKEY_MESSAGE", - 5: "SERVER_DELIVERY_RECEIPT", - 6: "UNIDENTIFIED_SENDER", - 8: "PLAINTEXT_CONTENT", - } - Envelope_Type_value = map[string]int32{ - "UNKNOWN": 0, - "DOUBLE_RATCHET": 1, - "PREKEY_MESSAGE": 3, - "SERVER_DELIVERY_RECEIPT": 5, - "UNIDENTIFIED_SENDER": 6, - "PLAINTEXT_CONTENT": 8, - } -) - -func (x Envelope_Type) Enum() *Envelope_Type { - p := new(Envelope_Type) - *p = x - return p -} - -func (x Envelope_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Envelope_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[0].Descriptor() -} - -func (Envelope_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[0] -} - -func (x Envelope_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *Envelope_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = Envelope_Type(num) - return nil -} - -// Deprecated: Use Envelope_Type.Descriptor instead. -func (Envelope_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{0, 0} -} - -type CallMessage_Offer_Type int32 - -const ( - CallMessage_Offer_OFFER_AUDIO_CALL CallMessage_Offer_Type = 0 - CallMessage_Offer_OFFER_VIDEO_CALL CallMessage_Offer_Type = 1 -) - -// Enum value maps for CallMessage_Offer_Type. -var ( - CallMessage_Offer_Type_name = map[int32]string{ - 0: "OFFER_AUDIO_CALL", - 1: "OFFER_VIDEO_CALL", - } - CallMessage_Offer_Type_value = map[string]int32{ - "OFFER_AUDIO_CALL": 0, - "OFFER_VIDEO_CALL": 1, - } -) - -func (x CallMessage_Offer_Type) Enum() *CallMessage_Offer_Type { - p := new(CallMessage_Offer_Type) - *p = x - return p -} - -func (x CallMessage_Offer_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CallMessage_Offer_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[1].Descriptor() -} - -func (CallMessage_Offer_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[1] -} - -func (x CallMessage_Offer_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *CallMessage_Offer_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = CallMessage_Offer_Type(num) - return nil -} - -// Deprecated: Use CallMessage_Offer_Type.Descriptor instead. -func (CallMessage_Offer_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 0, 0} -} - -type CallMessage_Hangup_Type int32 - -const ( - CallMessage_Hangup_HANGUP_NORMAL CallMessage_Hangup_Type = 0 - CallMessage_Hangup_HANGUP_ACCEPTED CallMessage_Hangup_Type = 1 - CallMessage_Hangup_HANGUP_DECLINED CallMessage_Hangup_Type = 2 - CallMessage_Hangup_HANGUP_BUSY CallMessage_Hangup_Type = 3 - CallMessage_Hangup_HANGUP_NEED_PERMISSION CallMessage_Hangup_Type = 4 -) - -// Enum value maps for CallMessage_Hangup_Type. -var ( - CallMessage_Hangup_Type_name = map[int32]string{ - 0: "HANGUP_NORMAL", - 1: "HANGUP_ACCEPTED", - 2: "HANGUP_DECLINED", - 3: "HANGUP_BUSY", - 4: "HANGUP_NEED_PERMISSION", - } - CallMessage_Hangup_Type_value = map[string]int32{ - "HANGUP_NORMAL": 0, - "HANGUP_ACCEPTED": 1, - "HANGUP_DECLINED": 2, - "HANGUP_BUSY": 3, - "HANGUP_NEED_PERMISSION": 4, - } -) - -func (x CallMessage_Hangup_Type) Enum() *CallMessage_Hangup_Type { - p := new(CallMessage_Hangup_Type) - *p = x - return p -} - -func (x CallMessage_Hangup_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CallMessage_Hangup_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[2].Descriptor() -} - -func (CallMessage_Hangup_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[2] -} - -func (x CallMessage_Hangup_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *CallMessage_Hangup_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = CallMessage_Hangup_Type(num) - return nil -} - -// Deprecated: Use CallMessage_Hangup_Type.Descriptor instead. -func (CallMessage_Hangup_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 4, 0} -} - -type CallMessage_Opaque_Urgency int32 - -const ( - CallMessage_Opaque_DROPPABLE CallMessage_Opaque_Urgency = 0 - CallMessage_Opaque_HANDLE_IMMEDIATELY CallMessage_Opaque_Urgency = 1 -) - -// Enum value maps for CallMessage_Opaque_Urgency. -var ( - CallMessage_Opaque_Urgency_name = map[int32]string{ - 0: "DROPPABLE", - 1: "HANDLE_IMMEDIATELY", - } - CallMessage_Opaque_Urgency_value = map[string]int32{ - "DROPPABLE": 0, - "HANDLE_IMMEDIATELY": 1, - } -) - -func (x CallMessage_Opaque_Urgency) Enum() *CallMessage_Opaque_Urgency { - p := new(CallMessage_Opaque_Urgency) - *p = x - return p -} - -func (x CallMessage_Opaque_Urgency) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CallMessage_Opaque_Urgency) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[3].Descriptor() -} - -func (CallMessage_Opaque_Urgency) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[3] -} - -func (x CallMessage_Opaque_Urgency) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *CallMessage_Opaque_Urgency) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = CallMessage_Opaque_Urgency(num) - return nil -} - -// Deprecated: Use CallMessage_Opaque_Urgency.Descriptor instead. -func (CallMessage_Opaque_Urgency) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 5, 0} -} - -type DataMessage_Flags int32 - -const ( - DataMessage_EXPIRATION_TIMER_UPDATE DataMessage_Flags = 2 - DataMessage_PROFILE_KEY_UPDATE DataMessage_Flags = 4 - DataMessage_FORWARD DataMessage_Flags = 8 -) - -// Enum value maps for DataMessage_Flags. -var ( - DataMessage_Flags_name = map[int32]string{ - 2: "EXPIRATION_TIMER_UPDATE", - 4: "PROFILE_KEY_UPDATE", - 8: "FORWARD", - } - DataMessage_Flags_value = map[string]int32{ - "EXPIRATION_TIMER_UPDATE": 2, - "PROFILE_KEY_UPDATE": 4, - "FORWARD": 8, - } -) - -func (x DataMessage_Flags) Enum() *DataMessage_Flags { - p := new(DataMessage_Flags) - *p = x - return p -} - -func (x DataMessage_Flags) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataMessage_Flags) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[4].Descriptor() -} - -func (DataMessage_Flags) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[4] -} - -func (x DataMessage_Flags) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *DataMessage_Flags) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = DataMessage_Flags(num) - return nil -} - -// Deprecated: Use DataMessage_Flags.Descriptor instead. -func (DataMessage_Flags) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0} -} - -type DataMessage_ProtocolVersion int32 - -const ( - DataMessage_INITIAL DataMessage_ProtocolVersion = 0 - DataMessage_MESSAGE_TIMERS DataMessage_ProtocolVersion = 1 - DataMessage_VIEW_ONCE DataMessage_ProtocolVersion = 2 - DataMessage_VIEW_ONCE_VIDEO DataMessage_ProtocolVersion = 3 - DataMessage_REACTIONS DataMessage_ProtocolVersion = 4 - 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 -) - -// Enum value maps for DataMessage_ProtocolVersion. -var ( - DataMessage_ProtocolVersion_name = map[int32]string{ - 0: "INITIAL", - 1: "MESSAGE_TIMERS", - 2: "VIEW_ONCE", - 3: "VIEW_ONCE_VIDEO", - 4: "REACTIONS", - 5: "CDN_SELECTOR_ATTACHMENTS", - 6: "MENTIONS", - 7: "PAYMENTS", - 8: "POLLS", - // Duplicate value: 8: "CURRENT", - } - DataMessage_ProtocolVersion_value = map[string]int32{ - "INITIAL": 0, - "MESSAGE_TIMERS": 1, - "VIEW_ONCE": 2, - "VIEW_ONCE_VIDEO": 3, - "REACTIONS": 4, - "CDN_SELECTOR_ATTACHMENTS": 5, - "MENTIONS": 6, - "PAYMENTS": 7, - "POLLS": 8, - "CURRENT": 8, - } -) - -func (x DataMessage_ProtocolVersion) Enum() *DataMessage_ProtocolVersion { - p := new(DataMessage_ProtocolVersion) - *p = x - return p -} - -func (x DataMessage_ProtocolVersion) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataMessage_ProtocolVersion) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[5].Descriptor() -} - -func (DataMessage_ProtocolVersion) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[5] -} - -func (x DataMessage_ProtocolVersion) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *DataMessage_ProtocolVersion) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = DataMessage_ProtocolVersion(num) - return nil -} - -// Deprecated: Use DataMessage_ProtocolVersion.Descriptor instead. -func (DataMessage_ProtocolVersion) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 1} -} - -type DataMessage_Payment_Activation_Type int32 - -const ( - DataMessage_Payment_Activation_REQUEST DataMessage_Payment_Activation_Type = 0 - DataMessage_Payment_Activation_ACTIVATED DataMessage_Payment_Activation_Type = 1 -) - -// Enum value maps for DataMessage_Payment_Activation_Type. -var ( - DataMessage_Payment_Activation_Type_name = map[int32]string{ - 0: "REQUEST", - 1: "ACTIVATED", - } - DataMessage_Payment_Activation_Type_value = map[string]int32{ - "REQUEST": 0, - "ACTIVATED": 1, - } -) - -func (x DataMessage_Payment_Activation_Type) Enum() *DataMessage_Payment_Activation_Type { - p := new(DataMessage_Payment_Activation_Type) - *p = x - return p -} - -func (x DataMessage_Payment_Activation_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataMessage_Payment_Activation_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[6].Descriptor() -} - -func (DataMessage_Payment_Activation_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[6] -} - -func (x DataMessage_Payment_Activation_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *DataMessage_Payment_Activation_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = DataMessage_Payment_Activation_Type(num) - return nil -} - -// Deprecated: Use DataMessage_Payment_Activation_Type.Descriptor instead. -func (DataMessage_Payment_Activation_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0, 2, 0} -} - -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. -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, - } -) - -func (x DataMessage_Quote_Type) Enum() *DataMessage_Quote_Type { - p := new(DataMessage_Quote_Type) - *p = x - return p -} - -func (x DataMessage_Quote_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataMessage_Quote_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[7].Descriptor() -} - -func (DataMessage_Quote_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[7] -} - -func (x DataMessage_Quote_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *DataMessage_Quote_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = DataMessage_Quote_Type(num) - return nil -} - -// Deprecated: Use DataMessage_Quote_Type.Descriptor instead. -func (DataMessage_Quote_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 1, 0} -} - -type DataMessage_Contact_Phone_Type int32 - -const ( - DataMessage_Contact_Phone_HOME DataMessage_Contact_Phone_Type = 1 - DataMessage_Contact_Phone_MOBILE DataMessage_Contact_Phone_Type = 2 - DataMessage_Contact_Phone_WORK DataMessage_Contact_Phone_Type = 3 - DataMessage_Contact_Phone_CUSTOM DataMessage_Contact_Phone_Type = 4 -) - -// Enum value maps for DataMessage_Contact_Phone_Type. -var ( - DataMessage_Contact_Phone_Type_name = map[int32]string{ - 1: "HOME", - 2: "MOBILE", - 3: "WORK", - 4: "CUSTOM", - } - DataMessage_Contact_Phone_Type_value = map[string]int32{ - "HOME": 1, - "MOBILE": 2, - "WORK": 3, - "CUSTOM": 4, - } -) - -func (x DataMessage_Contact_Phone_Type) Enum() *DataMessage_Contact_Phone_Type { - p := new(DataMessage_Contact_Phone_Type) - *p = x - return p -} - -func (x DataMessage_Contact_Phone_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataMessage_Contact_Phone_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[8].Descriptor() -} - -func (DataMessage_Contact_Phone_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[8] -} - -func (x DataMessage_Contact_Phone_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *DataMessage_Contact_Phone_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = DataMessage_Contact_Phone_Type(num) - return nil -} - -// Deprecated: Use DataMessage_Contact_Phone_Type.Descriptor instead. -func (DataMessage_Contact_Phone_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 1, 0} -} - -type DataMessage_Contact_Email_Type int32 - -const ( - DataMessage_Contact_Email_HOME DataMessage_Contact_Email_Type = 1 - DataMessage_Contact_Email_MOBILE DataMessage_Contact_Email_Type = 2 - DataMessage_Contact_Email_WORK DataMessage_Contact_Email_Type = 3 - DataMessage_Contact_Email_CUSTOM DataMessage_Contact_Email_Type = 4 -) - -// Enum value maps for DataMessage_Contact_Email_Type. -var ( - DataMessage_Contact_Email_Type_name = map[int32]string{ - 1: "HOME", - 2: "MOBILE", - 3: "WORK", - 4: "CUSTOM", - } - DataMessage_Contact_Email_Type_value = map[string]int32{ - "HOME": 1, - "MOBILE": 2, - "WORK": 3, - "CUSTOM": 4, - } -) - -func (x DataMessage_Contact_Email_Type) Enum() *DataMessage_Contact_Email_Type { - p := new(DataMessage_Contact_Email_Type) - *p = x - return p -} - -func (x DataMessage_Contact_Email_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataMessage_Contact_Email_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[9].Descriptor() -} - -func (DataMessage_Contact_Email_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[9] -} - -func (x DataMessage_Contact_Email_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *DataMessage_Contact_Email_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = DataMessage_Contact_Email_Type(num) - return nil -} - -// Deprecated: Use DataMessage_Contact_Email_Type.Descriptor instead. -func (DataMessage_Contact_Email_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 2, 0} -} - -type DataMessage_Contact_PostalAddress_Type int32 - -const ( - DataMessage_Contact_PostalAddress_HOME DataMessage_Contact_PostalAddress_Type = 1 - DataMessage_Contact_PostalAddress_WORK DataMessage_Contact_PostalAddress_Type = 2 - DataMessage_Contact_PostalAddress_CUSTOM DataMessage_Contact_PostalAddress_Type = 3 -) - -// Enum value maps for DataMessage_Contact_PostalAddress_Type. -var ( - DataMessage_Contact_PostalAddress_Type_name = map[int32]string{ - 1: "HOME", - 2: "WORK", - 3: "CUSTOM", - } - DataMessage_Contact_PostalAddress_Type_value = map[string]int32{ - "HOME": 1, - "WORK": 2, - "CUSTOM": 3, - } -) - -func (x DataMessage_Contact_PostalAddress_Type) Enum() *DataMessage_Contact_PostalAddress_Type { - p := new(DataMessage_Contact_PostalAddress_Type) - *p = x - return p -} - -func (x DataMessage_Contact_PostalAddress_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DataMessage_Contact_PostalAddress_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[10].Descriptor() -} - -func (DataMessage_Contact_PostalAddress_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[10] -} - -func (x DataMessage_Contact_PostalAddress_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *DataMessage_Contact_PostalAddress_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = DataMessage_Contact_PostalAddress_Type(num) - return nil -} - -// Deprecated: Use DataMessage_Contact_PostalAddress_Type.Descriptor instead. -func (DataMessage_Contact_PostalAddress_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 3, 0} -} - -type ReceiptMessage_Type int32 - -const ( - ReceiptMessage_DELIVERY ReceiptMessage_Type = 0 - ReceiptMessage_READ ReceiptMessage_Type = 1 - ReceiptMessage_VIEWED ReceiptMessage_Type = 2 -) - -// Enum value maps for ReceiptMessage_Type. -var ( - ReceiptMessage_Type_name = map[int32]string{ - 0: "DELIVERY", - 1: "READ", - 2: "VIEWED", - } - ReceiptMessage_Type_value = map[string]int32{ - "DELIVERY": 0, - "READ": 1, - "VIEWED": 2, - } -) - -func (x ReceiptMessage_Type) Enum() *ReceiptMessage_Type { - p := new(ReceiptMessage_Type) - *p = x - return p -} - -func (x ReceiptMessage_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ReceiptMessage_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[11].Descriptor() -} - -func (ReceiptMessage_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[11] -} - -func (x ReceiptMessage_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *ReceiptMessage_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = ReceiptMessage_Type(num) - return nil -} - -// Deprecated: Use ReceiptMessage_Type.Descriptor instead. -func (ReceiptMessage_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{5, 0} -} - -type TypingMessage_Action int32 - -const ( - TypingMessage_STARTED TypingMessage_Action = 0 - TypingMessage_STOPPED TypingMessage_Action = 1 -) - -// Enum value maps for TypingMessage_Action. -var ( - TypingMessage_Action_name = map[int32]string{ - 0: "STARTED", - 1: "STOPPED", - } - TypingMessage_Action_value = map[string]int32{ - "STARTED": 0, - "STOPPED": 1, - } -) - -func (x TypingMessage_Action) Enum() *TypingMessage_Action { - p := new(TypingMessage_Action) - *p = x - return p -} - -func (x TypingMessage_Action) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TypingMessage_Action) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[12].Descriptor() -} - -func (TypingMessage_Action) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[12] -} - -func (x TypingMessage_Action) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *TypingMessage_Action) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = TypingMessage_Action(num) - return nil -} - -// Deprecated: Use TypingMessage_Action.Descriptor instead. -func (TypingMessage_Action) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{6, 0} -} - -type TextAttachment_Style int32 - -const ( - TextAttachment_DEFAULT TextAttachment_Style = 0 - TextAttachment_REGULAR TextAttachment_Style = 1 - TextAttachment_BOLD TextAttachment_Style = 2 - TextAttachment_SERIF TextAttachment_Style = 3 - TextAttachment_SCRIPT TextAttachment_Style = 4 - TextAttachment_CONDENSED TextAttachment_Style = 5 -) - -// Enum value maps for TextAttachment_Style. -var ( - TextAttachment_Style_name = map[int32]string{ - 0: "DEFAULT", - 1: "REGULAR", - 2: "BOLD", - 3: "SERIF", - 4: "SCRIPT", - 5: "CONDENSED", - } - TextAttachment_Style_value = map[string]int32{ - "DEFAULT": 0, - "REGULAR": 1, - "BOLD": 2, - "SERIF": 3, - "SCRIPT": 4, - "CONDENSED": 5, - } -) - -func (x TextAttachment_Style) Enum() *TextAttachment_Style { - p := new(TextAttachment_Style) - *p = x - return p -} - -func (x TextAttachment_Style) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TextAttachment_Style) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[13].Descriptor() -} - -func (TextAttachment_Style) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[13] -} - -func (x TextAttachment_Style) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *TextAttachment_Style) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = TextAttachment_Style(num) - return nil -} - -// Deprecated: Use TextAttachment_Style.Descriptor instead. -func (TextAttachment_Style) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{9, 0} -} - -type Verified_State int32 - -const ( - Verified_DEFAULT Verified_State = 0 - Verified_VERIFIED Verified_State = 1 - Verified_UNVERIFIED Verified_State = 2 -) - -// Enum value maps for Verified_State. -var ( - Verified_State_name = map[int32]string{ - 0: "DEFAULT", - 1: "VERIFIED", - 2: "UNVERIFIED", - } - Verified_State_value = map[string]int32{ - "DEFAULT": 0, - "VERIFIED": 1, - "UNVERIFIED": 2, - } -) - -func (x Verified_State) Enum() *Verified_State { - p := new(Verified_State) - *p = x - return p -} - -func (x Verified_State) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Verified_State) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[14].Descriptor() -} - -func (Verified_State) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[14] -} - -func (x Verified_State) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *Verified_State) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = Verified_State(num) - return nil -} - -// Deprecated: Use Verified_State.Descriptor instead. -func (Verified_State) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{10, 0} -} - -type SyncMessage_Request_Type int32 - -const ( - SyncMessage_Request_UNKNOWN SyncMessage_Request_Type = 0 - SyncMessage_Request_CONTACTS SyncMessage_Request_Type = 1 - SyncMessage_Request_BLOCKED SyncMessage_Request_Type = 3 - SyncMessage_Request_CONFIGURATION SyncMessage_Request_Type = 4 - SyncMessage_Request_KEYS SyncMessage_Request_Type = 5 -) - -// Enum value maps for SyncMessage_Request_Type. -var ( - SyncMessage_Request_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "CONTACTS", - 3: "BLOCKED", - 4: "CONFIGURATION", - 5: "KEYS", - } - SyncMessage_Request_Type_value = map[string]int32{ - "UNKNOWN": 0, - "CONTACTS": 1, - "BLOCKED": 3, - "CONFIGURATION": 4, - "KEYS": 5, - } -) - -func (x SyncMessage_Request_Type) Enum() *SyncMessage_Request_Type { - p := new(SyncMessage_Request_Type) - *p = x - return p -} - -func (x SyncMessage_Request_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_Request_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[15].Descriptor() -} - -func (SyncMessage_Request_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[15] -} - -func (x SyncMessage_Request_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_Request_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_Request_Type(num) - return nil -} - -// Deprecated: Use SyncMessage_Request_Type.Descriptor instead. -func (SyncMessage_Request_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 3, 0} -} - -type SyncMessage_StickerPackOperation_Type int32 - -const ( - SyncMessage_StickerPackOperation_INSTALL SyncMessage_StickerPackOperation_Type = 0 - SyncMessage_StickerPackOperation_REMOVE SyncMessage_StickerPackOperation_Type = 1 -) - -// Enum value maps for SyncMessage_StickerPackOperation_Type. -var ( - SyncMessage_StickerPackOperation_Type_name = map[int32]string{ - 0: "INSTALL", - 1: "REMOVE", - } - SyncMessage_StickerPackOperation_Type_value = map[string]int32{ - "INSTALL": 0, - "REMOVE": 1, - } -) - -func (x SyncMessage_StickerPackOperation_Type) Enum() *SyncMessage_StickerPackOperation_Type { - p := new(SyncMessage_StickerPackOperation_Type) - *p = x - return p -} - -func (x SyncMessage_StickerPackOperation_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_StickerPackOperation_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[16].Descriptor() -} - -func (SyncMessage_StickerPackOperation_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[16] -} - -func (x SyncMessage_StickerPackOperation_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_StickerPackOperation_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_StickerPackOperation_Type(num) - return nil -} - -// Deprecated: Use SyncMessage_StickerPackOperation_Type.Descriptor instead. -func (SyncMessage_StickerPackOperation_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 7, 0} -} - -type SyncMessage_FetchLatest_Type int32 - -const ( - SyncMessage_FetchLatest_UNKNOWN SyncMessage_FetchLatest_Type = 0 - SyncMessage_FetchLatest_LOCAL_PROFILE SyncMessage_FetchLatest_Type = 1 - SyncMessage_FetchLatest_STORAGE_MANIFEST SyncMessage_FetchLatest_Type = 2 - SyncMessage_FetchLatest_SUBSCRIPTION_STATUS SyncMessage_FetchLatest_Type = 3 -) - -// Enum value maps for SyncMessage_FetchLatest_Type. -var ( - SyncMessage_FetchLatest_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "LOCAL_PROFILE", - 2: "STORAGE_MANIFEST", - 3: "SUBSCRIPTION_STATUS", - } - SyncMessage_FetchLatest_Type_value = map[string]int32{ - "UNKNOWN": 0, - "LOCAL_PROFILE": 1, - "STORAGE_MANIFEST": 2, - "SUBSCRIPTION_STATUS": 3, - } -) - -func (x SyncMessage_FetchLatest_Type) Enum() *SyncMessage_FetchLatest_Type { - p := new(SyncMessage_FetchLatest_Type) - *p = x - return p -} - -func (x SyncMessage_FetchLatest_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_FetchLatest_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[17].Descriptor() -} - -func (SyncMessage_FetchLatest_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[17] -} - -func (x SyncMessage_FetchLatest_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_FetchLatest_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_FetchLatest_Type(num) - return nil -} - -// Deprecated: Use SyncMessage_FetchLatest_Type.Descriptor instead. -func (SyncMessage_FetchLatest_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 9, 0} -} - -type SyncMessage_MessageRequestResponse_Type int32 - -const ( - SyncMessage_MessageRequestResponse_UNKNOWN SyncMessage_MessageRequestResponse_Type = 0 - SyncMessage_MessageRequestResponse_ACCEPT SyncMessage_MessageRequestResponse_Type = 1 - SyncMessage_MessageRequestResponse_DELETE SyncMessage_MessageRequestResponse_Type = 2 - SyncMessage_MessageRequestResponse_BLOCK SyncMessage_MessageRequestResponse_Type = 3 - SyncMessage_MessageRequestResponse_BLOCK_AND_DELETE SyncMessage_MessageRequestResponse_Type = 4 - SyncMessage_MessageRequestResponse_SPAM SyncMessage_MessageRequestResponse_Type = 5 - SyncMessage_MessageRequestResponse_BLOCK_AND_SPAM SyncMessage_MessageRequestResponse_Type = 6 -) - -// Enum value maps for SyncMessage_MessageRequestResponse_Type. -var ( - SyncMessage_MessageRequestResponse_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ACCEPT", - 2: "DELETE", - 3: "BLOCK", - 4: "BLOCK_AND_DELETE", - 5: "SPAM", - 6: "BLOCK_AND_SPAM", - } - SyncMessage_MessageRequestResponse_Type_value = map[string]int32{ - "UNKNOWN": 0, - "ACCEPT": 1, - "DELETE": 2, - "BLOCK": 3, - "BLOCK_AND_DELETE": 4, - "SPAM": 5, - "BLOCK_AND_SPAM": 6, - } -) - -func (x SyncMessage_MessageRequestResponse_Type) Enum() *SyncMessage_MessageRequestResponse_Type { - p := new(SyncMessage_MessageRequestResponse_Type) - *p = x - return p -} - -func (x SyncMessage_MessageRequestResponse_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_MessageRequestResponse_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[18].Descriptor() -} - -func (SyncMessage_MessageRequestResponse_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[18] -} - -func (x SyncMessage_MessageRequestResponse_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_MessageRequestResponse_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_MessageRequestResponse_Type(num) - return nil -} - -// Deprecated: Use SyncMessage_MessageRequestResponse_Type.Descriptor instead. -func (SyncMessage_MessageRequestResponse_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 12, 0} -} - -type SyncMessage_CallEvent_Type int32 - -const ( - SyncMessage_CallEvent_UNKNOWN_TYPE SyncMessage_CallEvent_Type = 0 - SyncMessage_CallEvent_AUDIO_CALL SyncMessage_CallEvent_Type = 1 - SyncMessage_CallEvent_VIDEO_CALL SyncMessage_CallEvent_Type = 2 - SyncMessage_CallEvent_GROUP_CALL SyncMessage_CallEvent_Type = 3 - SyncMessage_CallEvent_AD_HOC_CALL SyncMessage_CallEvent_Type = 4 -) - -// Enum value maps for SyncMessage_CallEvent_Type. -var ( - SyncMessage_CallEvent_Type_name = map[int32]string{ - 0: "UNKNOWN_TYPE", - 1: "AUDIO_CALL", - 2: "VIDEO_CALL", - 3: "GROUP_CALL", - 4: "AD_HOC_CALL", - } - SyncMessage_CallEvent_Type_value = map[string]int32{ - "UNKNOWN_TYPE": 0, - "AUDIO_CALL": 1, - "VIDEO_CALL": 2, - "GROUP_CALL": 3, - "AD_HOC_CALL": 4, - } -) - -func (x SyncMessage_CallEvent_Type) Enum() *SyncMessage_CallEvent_Type { - p := new(SyncMessage_CallEvent_Type) - *p = x - return p -} - -func (x SyncMessage_CallEvent_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_CallEvent_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[19].Descriptor() -} - -func (SyncMessage_CallEvent_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[19] -} - -func (x SyncMessage_CallEvent_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_CallEvent_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_CallEvent_Type(num) - return nil -} - -// Deprecated: Use SyncMessage_CallEvent_Type.Descriptor instead. -func (SyncMessage_CallEvent_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 15, 0} -} - -type SyncMessage_CallEvent_Direction int32 - -const ( - SyncMessage_CallEvent_UNKNOWN_DIRECTION SyncMessage_CallEvent_Direction = 0 - SyncMessage_CallEvent_INCOMING SyncMessage_CallEvent_Direction = 1 - SyncMessage_CallEvent_OUTGOING SyncMessage_CallEvent_Direction = 2 -) - -// Enum value maps for SyncMessage_CallEvent_Direction. -var ( - SyncMessage_CallEvent_Direction_name = map[int32]string{ - 0: "UNKNOWN_DIRECTION", - 1: "INCOMING", - 2: "OUTGOING", - } - SyncMessage_CallEvent_Direction_value = map[string]int32{ - "UNKNOWN_DIRECTION": 0, - "INCOMING": 1, - "OUTGOING": 2, - } -) - -func (x SyncMessage_CallEvent_Direction) Enum() *SyncMessage_CallEvent_Direction { - p := new(SyncMessage_CallEvent_Direction) - *p = x - return p -} - -func (x SyncMessage_CallEvent_Direction) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_CallEvent_Direction) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[20].Descriptor() -} - -func (SyncMessage_CallEvent_Direction) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[20] -} - -func (x SyncMessage_CallEvent_Direction) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_CallEvent_Direction) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_CallEvent_Direction(num) - return nil -} - -// Deprecated: Use SyncMessage_CallEvent_Direction.Descriptor instead. -func (SyncMessage_CallEvent_Direction) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 15, 1} -} - -type SyncMessage_CallEvent_Event int32 - -const ( - SyncMessage_CallEvent_UNKNOWN_EVENT SyncMessage_CallEvent_Event = 0 - SyncMessage_CallEvent_ACCEPTED SyncMessage_CallEvent_Event = 1 - SyncMessage_CallEvent_NOT_ACCEPTED SyncMessage_CallEvent_Event = 2 - SyncMessage_CallEvent_DELETE SyncMessage_CallEvent_Event = 3 - SyncMessage_CallEvent_OBSERVED SyncMessage_CallEvent_Event = 4 -) - -// Enum value maps for SyncMessage_CallEvent_Event. -var ( - SyncMessage_CallEvent_Event_name = map[int32]string{ - 0: "UNKNOWN_EVENT", - 1: "ACCEPTED", - 2: "NOT_ACCEPTED", - 3: "DELETE", - 4: "OBSERVED", - } - SyncMessage_CallEvent_Event_value = map[string]int32{ - "UNKNOWN_EVENT": 0, - "ACCEPTED": 1, - "NOT_ACCEPTED": 2, - "DELETE": 3, - "OBSERVED": 4, - } -) - -func (x SyncMessage_CallEvent_Event) Enum() *SyncMessage_CallEvent_Event { - p := new(SyncMessage_CallEvent_Event) - *p = x - return p -} - -func (x SyncMessage_CallEvent_Event) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_CallEvent_Event) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[21].Descriptor() -} - -func (SyncMessage_CallEvent_Event) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[21] -} - -func (x SyncMessage_CallEvent_Event) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_CallEvent_Event) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_CallEvent_Event(num) - return nil -} - -// Deprecated: Use SyncMessage_CallEvent_Event.Descriptor instead. -func (SyncMessage_CallEvent_Event) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 15, 2} -} - -type SyncMessage_CallLinkUpdate_Type int32 - -const ( - SyncMessage_CallLinkUpdate_UPDATE SyncMessage_CallLinkUpdate_Type = 0 -) - -// Enum value maps for SyncMessage_CallLinkUpdate_Type. -var ( - SyncMessage_CallLinkUpdate_Type_name = map[int32]string{ - 0: "UPDATE", - } - SyncMessage_CallLinkUpdate_Type_value = map[string]int32{ - "UPDATE": 0, - } -) - -func (x SyncMessage_CallLinkUpdate_Type) Enum() *SyncMessage_CallLinkUpdate_Type { - p := new(SyncMessage_CallLinkUpdate_Type) - *p = x - return p -} - -func (x SyncMessage_CallLinkUpdate_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_CallLinkUpdate_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[22].Descriptor() -} - -func (SyncMessage_CallLinkUpdate_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[22] -} - -func (x SyncMessage_CallLinkUpdate_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_CallLinkUpdate_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_CallLinkUpdate_Type(num) - return nil -} - -// Deprecated: Use SyncMessage_CallLinkUpdate_Type.Descriptor instead. -func (SyncMessage_CallLinkUpdate_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 16, 0} -} - -type SyncMessage_CallLogEvent_Type int32 - -const ( - SyncMessage_CallLogEvent_CLEAR SyncMessage_CallLogEvent_Type = 0 - SyncMessage_CallLogEvent_MARKED_AS_READ SyncMessage_CallLogEvent_Type = 1 - SyncMessage_CallLogEvent_MARKED_AS_READ_IN_CONVERSATION SyncMessage_CallLogEvent_Type = 2 - SyncMessage_CallLogEvent_CLEAR_IN_CONVERSATION SyncMessage_CallLogEvent_Type = 3 -) - -// Enum value maps for SyncMessage_CallLogEvent_Type. -var ( - SyncMessage_CallLogEvent_Type_name = map[int32]string{ - 0: "CLEAR", - 1: "MARKED_AS_READ", - 2: "MARKED_AS_READ_IN_CONVERSATION", - 3: "CLEAR_IN_CONVERSATION", - } - SyncMessage_CallLogEvent_Type_value = map[string]int32{ - "CLEAR": 0, - "MARKED_AS_READ": 1, - "MARKED_AS_READ_IN_CONVERSATION": 2, - "CLEAR_IN_CONVERSATION": 3, - } -) - -func (x SyncMessage_CallLogEvent_Type) Enum() *SyncMessage_CallLogEvent_Type { - p := new(SyncMessage_CallLogEvent_Type) - *p = x - return p -} - -func (x SyncMessage_CallLogEvent_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_CallLogEvent_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[23].Descriptor() -} - -func (SyncMessage_CallLogEvent_Type) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[23] -} - -func (x SyncMessage_CallLogEvent_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_CallLogEvent_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_CallLogEvent_Type(num) - return nil -} - -// Deprecated: Use SyncMessage_CallLogEvent_Type.Descriptor instead. -func (SyncMessage_CallLogEvent_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 17, 0} -} - -type SyncMessage_AttachmentBackfillResponse_Error int32 - -const ( - SyncMessage_AttachmentBackfillResponse_MESSAGE_NOT_FOUND SyncMessage_AttachmentBackfillResponse_Error = 0 -) - -// Enum value maps for SyncMessage_AttachmentBackfillResponse_Error. -var ( - SyncMessage_AttachmentBackfillResponse_Error_name = map[int32]string{ - 0: "MESSAGE_NOT_FOUND", - } - SyncMessage_AttachmentBackfillResponse_Error_value = map[string]int32{ - "MESSAGE_NOT_FOUND": 0, - } -) - -func (x SyncMessage_AttachmentBackfillResponse_Error) Enum() *SyncMessage_AttachmentBackfillResponse_Error { - p := new(SyncMessage_AttachmentBackfillResponse_Error) - *p = x - return p -} - -func (x SyncMessage_AttachmentBackfillResponse_Error) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_AttachmentBackfillResponse_Error) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[24].Descriptor() -} - -func (SyncMessage_AttachmentBackfillResponse_Error) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[24] -} - -func (x SyncMessage_AttachmentBackfillResponse_Error) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_AttachmentBackfillResponse_Error) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_AttachmentBackfillResponse_Error(num) - return nil -} - -// Deprecated: Use SyncMessage_AttachmentBackfillResponse_Error.Descriptor instead. -func (SyncMessage_AttachmentBackfillResponse_Error) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 21, 0} -} - -type SyncMessage_AttachmentBackfillResponse_AttachmentData_Status int32 - -const ( - SyncMessage_AttachmentBackfillResponse_AttachmentData_PENDING SyncMessage_AttachmentBackfillResponse_AttachmentData_Status = 0 - SyncMessage_AttachmentBackfillResponse_AttachmentData_TERMINAL_ERROR SyncMessage_AttachmentBackfillResponse_AttachmentData_Status = 1 -) - -// Enum value maps for SyncMessage_AttachmentBackfillResponse_AttachmentData_Status. -var ( - SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_name = map[int32]string{ - 0: "PENDING", - 1: "TERMINAL_ERROR", - } - SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_value = map[string]int32{ - "PENDING": 0, - "TERMINAL_ERROR": 1, - } -) - -func (x SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) Enum() *SyncMessage_AttachmentBackfillResponse_AttachmentData_Status { - p := new(SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) - *p = x - return p -} - -func (x SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[25].Descriptor() -} - -func (SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[25] -} - -func (x SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = SyncMessage_AttachmentBackfillResponse_AttachmentData_Status(num) - return nil -} - -// Deprecated: Use SyncMessage_AttachmentBackfillResponse_AttachmentData_Status.Descriptor instead. -func (SyncMessage_AttachmentBackfillResponse_AttachmentData_Status) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 21, 0, 0} -} - -type AttachmentPointer_Flags int32 - -const ( - AttachmentPointer_VOICE_MESSAGE AttachmentPointer_Flags = 1 - AttachmentPointer_BORDERLESS AttachmentPointer_Flags = 2 - AttachmentPointer_GIF AttachmentPointer_Flags = 8 -) - -// Enum value maps for AttachmentPointer_Flags. -var ( - AttachmentPointer_Flags_name = map[int32]string{ - 1: "VOICE_MESSAGE", - 2: "BORDERLESS", - 8: "GIF", - } - AttachmentPointer_Flags_value = map[string]int32{ - "VOICE_MESSAGE": 1, - "BORDERLESS": 2, - "GIF": 8, - } -) - -func (x AttachmentPointer_Flags) Enum() *AttachmentPointer_Flags { - p := new(AttachmentPointer_Flags) - *p = x - return p -} - -func (x AttachmentPointer_Flags) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AttachmentPointer_Flags) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[26].Descriptor() -} - -func (AttachmentPointer_Flags) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[26] -} - -func (x AttachmentPointer_Flags) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *AttachmentPointer_Flags) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = AttachmentPointer_Flags(num) - return nil -} - -// Deprecated: Use AttachmentPointer_Flags.Descriptor instead. -func (AttachmentPointer_Flags) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{12, 0} -} - -type BodyRange_Style int32 - -const ( - BodyRange_NONE BodyRange_Style = 0 - BodyRange_BOLD BodyRange_Style = 1 - BodyRange_ITALIC BodyRange_Style = 2 - BodyRange_SPOILER BodyRange_Style = 3 - BodyRange_STRIKETHROUGH BodyRange_Style = 4 - BodyRange_MONOSPACE BodyRange_Style = 5 -) - -// Enum value maps for BodyRange_Style. -var ( - BodyRange_Style_name = map[int32]string{ - 0: "NONE", - 1: "BOLD", - 2: "ITALIC", - 3: "SPOILER", - 4: "STRIKETHROUGH", - 5: "MONOSPACE", - } - BodyRange_Style_value = map[string]int32{ - "NONE": 0, - "BOLD": 1, - "ITALIC": 2, - "SPOILER": 3, - "STRIKETHROUGH": 4, - "MONOSPACE": 5, - } -) - -func (x BodyRange_Style) Enum() *BodyRange_Style { - p := new(BodyRange_Style) - *p = x - return p -} - -func (x BodyRange_Style) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BodyRange_Style) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_SignalService_proto_enumTypes[27].Descriptor() -} - -func (BodyRange_Style) Type() protoreflect.EnumType { - return &file_signalpb_SignalService_proto_enumTypes[27] -} - -func (x BodyRange_Style) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *BodyRange_Style) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = BodyRange_Style(num) - return nil -} - -// Deprecated: Use BodyRange_Style.Descriptor instead. -func (BodyRange_Style) EnumDescriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{19, 0} -} - -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 -} - -// Default values for Envelope fields. -const ( - Default_Envelope_Urgent = bool(true) -) - -func (x *Envelope) Reset() { - *x = Envelope{} - mi := &file_signalpb_SignalService_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Envelope) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Envelope) ProtoMessage() {} - -func (x *Envelope) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[0] - 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 Envelope.ProtoReflect.Descriptor instead. -func (*Envelope) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{0} -} - -func (x *Envelope) GetType() Envelope_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return Envelope_UNKNOWN -} - -func (x *Envelope) GetSourceServiceId() string { - if x != nil && x.SourceServiceId != nil { - return *x.SourceServiceId - } - return "" -} - -func (x *Envelope) GetSourceDeviceId() uint32 { - if x != nil && x.SourceDeviceId != nil { - return *x.SourceDeviceId - } - return 0 -} - -func (x *Envelope) GetDestinationServiceId() string { - if x != nil && x.DestinationServiceId != nil { - return *x.DestinationServiceId - } - return "" -} - -func (x *Envelope) GetClientTimestamp() uint64 { - if x != nil && x.ClientTimestamp != nil { - return *x.ClientTimestamp - } - return 0 -} - -func (x *Envelope) GetContent() []byte { - if x != nil { - return x.Content - } - return nil -} - -func (x *Envelope) GetServerGuid() string { - if x != nil && x.ServerGuid != nil { - return *x.ServerGuid - } - return "" -} - -func (x *Envelope) GetServerTimestamp() uint64 { - if x != nil && x.ServerTimestamp != nil { - return *x.ServerTimestamp - } - return 0 -} - -func (x *Envelope) GetEphemeral() bool { - if x != nil && x.Ephemeral != nil { - return *x.Ephemeral - } - return false -} - -func (x *Envelope) GetUrgent() bool { - if x != nil && x.Urgent != nil { - return *x.Urgent - } - return Default_Envelope_Urgent -} - -func (x *Envelope) GetUpdatedPni() string { - if x != nil && x.UpdatedPni != nil { - return *x.UpdatedPni - } - return "" -} - -func (x *Envelope) GetStory() bool { - if x != nil && x.Story != nil { - return *x.Story - } - return false -} - -func (x *Envelope) GetReportSpamToken() []byte { - if x != nil { - return x.ReportSpamToken - } - 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Content) Reset() { - *x = Content{} - mi := &file_signalpb_SignalService_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Content) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Content) ProtoMessage() {} - -func (x *Content) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[1] - 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 Content.ProtoReflect.Descriptor instead. -func (*Content) Descriptor() ([]byte, []int) { - return file_signalpb_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 nil -} - -func (x *Content) GetSyncMessage() *SyncMessage { - if x != nil { - if x, ok := x.Content.(*Content_SyncMessage); ok { - 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 nil -} - -func (x *Content) GetNullMessage() *NullMessage { - if x != nil { - if x, ok := x.Content.(*Content_NullMessage); ok { - 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 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 nil -} - -func (x *Content) GetSenderKeyDistributionMessage() []byte { - if x != nil { - return x.SenderKeyDistributionMessage - } - return nil -} - -func (x *Content) GetPniSignatureMessage() *PniSignatureMessage { - if x != nil { - return x.PniSignatureMessage - } - return nil -} - -type isContent_Content interface { - isContent_Content() -} - -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"` - Answer *CallMessage_Answer `protobuf:"bytes,2,opt,name=answer" json:"answer,omitempty"` - IceUpdate []*CallMessage_IceUpdate `protobuf:"bytes,3,rep,name=iceUpdate" json:"iceUpdate,omitempty"` - Busy *CallMessage_Busy `protobuf:"bytes,5,opt,name=busy" json:"busy,omitempty"` - Hangup *CallMessage_Hangup `protobuf:"bytes,7,opt,name=hangup" json:"hangup,omitempty"` - DestinationDeviceId *uint32 `protobuf:"varint,9,opt,name=destinationDeviceId" json:"destinationDeviceId,omitempty"` - Opaque *CallMessage_Opaque `protobuf:"bytes,10,opt,name=opaque" json:"opaque,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallMessage) Reset() { - *x = CallMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallMessage) ProtoMessage() {} - -func (x *CallMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[2] - 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 CallMessage.ProtoReflect.Descriptor instead. -func (*CallMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2} -} - -func (x *CallMessage) GetOffer() *CallMessage_Offer { - if x != nil { - return x.Offer - } - return nil -} - -func (x *CallMessage) GetAnswer() *CallMessage_Answer { - if x != nil { - return x.Answer - } - return nil -} - -func (x *CallMessage) GetIceUpdate() []*CallMessage_IceUpdate { - if x != nil { - return x.IceUpdate - } - return nil -} - -func (x *CallMessage) GetBusy() *CallMessage_Busy { - if x != nil { - return x.Busy - } - return nil -} - -func (x *CallMessage) GetHangup() *CallMessage_Hangup { - if x != nil { - return x.Hangup - } - return nil -} - -func (x *CallMessage) GetDestinationDeviceId() uint32 { - if x != nil && x.DestinationDeviceId != nil { - return *x.DestinationDeviceId - } - return 0 -} - -func (x *CallMessage) GetOpaque() *CallMessage_Opaque { - if x != nil { - return x.Opaque - } - return nil -} - -type DataMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Body *string `protobuf:"bytes,1,opt,name=body" json:"body,omitempty"` - Attachments []*AttachmentPointer `protobuf:"bytes,2,rep,name=attachments" json:"attachments,omitempty"` - GroupV2 *GroupContextV2 `protobuf:"bytes,15,opt,name=groupV2" json:"groupV2,omitempty"` - Flags *uint32 `protobuf:"varint,4,opt,name=flags" json:"flags,omitempty"` - ExpireTimer *uint32 `protobuf:"varint,5,opt,name=expireTimer" json:"expireTimer,omitempty"` - ExpireTimerVersion *uint32 `protobuf:"varint,23,opt,name=expireTimerVersion" json:"expireTimerVersion,omitempty"` - ProfileKey []byte `protobuf:"bytes,6,opt,name=profileKey" json:"profileKey,omitempty"` - Timestamp *uint64 `protobuf:"varint,7,opt,name=timestamp" json:"timestamp,omitempty"` - Quote *DataMessage_Quote `protobuf:"bytes,8,opt,name=quote" json:"quote,omitempty"` - Contact []*DataMessage_Contact `protobuf:"bytes,9,rep,name=contact" json:"contact,omitempty"` - Preview []*Preview `protobuf:"bytes,10,rep,name=preview" json:"preview,omitempty"` - Sticker *DataMessage_Sticker `protobuf:"bytes,11,opt,name=sticker" json:"sticker,omitempty"` - RequiredProtocolVersion *uint32 `protobuf:"varint,12,opt,name=requiredProtocolVersion" json:"requiredProtocolVersion,omitempty"` - IsViewOnce *bool `protobuf:"varint,14,opt,name=isViewOnce" json:"isViewOnce,omitempty"` - Reaction *DataMessage_Reaction `protobuf:"bytes,16,opt,name=reaction" json:"reaction,omitempty"` - Delete *DataMessage_Delete `protobuf:"bytes,17,opt,name=delete" json:"delete,omitempty"` - BodyRanges []*BodyRange `protobuf:"bytes,18,rep,name=bodyRanges" json:"bodyRanges,omitempty"` - 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 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage) Reset() { - *x = DataMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage) ProtoMessage() {} - -func (x *DataMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[3] - 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.ProtoReflect.Descriptor instead. -func (*DataMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3} -} - -func (x *DataMessage) GetBody() string { - if x != nil && x.Body != nil { - return *x.Body - } - return "" -} - -func (x *DataMessage) GetAttachments() []*AttachmentPointer { - if x != nil { - return x.Attachments - } - return nil -} - -func (x *DataMessage) GetGroupV2() *GroupContextV2 { - if x != nil { - return x.GroupV2 - } - return nil -} - -func (x *DataMessage) GetFlags() uint32 { - if x != nil && x.Flags != nil { - return *x.Flags - } - return 0 -} - -func (x *DataMessage) GetExpireTimer() uint32 { - if x != nil && x.ExpireTimer != nil { - return *x.ExpireTimer - } - return 0 -} - -func (x *DataMessage) GetExpireTimerVersion() uint32 { - if x != nil && x.ExpireTimerVersion != nil { - return *x.ExpireTimerVersion - } - return 0 -} - -func (x *DataMessage) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *DataMessage) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -func (x *DataMessage) GetQuote() *DataMessage_Quote { - if x != nil { - return x.Quote - } - return nil -} - -func (x *DataMessage) GetContact() []*DataMessage_Contact { - if x != nil { - return x.Contact - } - return nil -} - -func (x *DataMessage) GetPreview() []*Preview { - if x != nil { - return x.Preview - } - return nil -} - -func (x *DataMessage) GetSticker() *DataMessage_Sticker { - if x != nil { - return x.Sticker - } - return nil -} - -func (x *DataMessage) GetRequiredProtocolVersion() uint32 { - if x != nil && x.RequiredProtocolVersion != nil { - return *x.RequiredProtocolVersion - } - return 0 -} - -func (x *DataMessage) GetIsViewOnce() bool { - if x != nil && x.IsViewOnce != nil { - return *x.IsViewOnce - } - return false -} - -func (x *DataMessage) GetReaction() *DataMessage_Reaction { - if x != nil { - return x.Reaction - } - return nil -} - -func (x *DataMessage) GetDelete() *DataMessage_Delete { - if x != nil { - return x.Delete - } - return nil -} - -func (x *DataMessage) GetBodyRanges() []*BodyRange { - if x != nil { - return x.BodyRanges - } - return nil -} - -func (x *DataMessage) GetGroupCallUpdate() *DataMessage_GroupCallUpdate { - if x != nil { - return x.GroupCallUpdate - } - return nil -} - -func (x *DataMessage) GetPayment() *DataMessage_Payment { - if x != nil { - return x.Payment - } - return nil -} - -func (x *DataMessage) GetStoryContext() *DataMessage_StoryContext { - if x != nil { - return x.StoryContext - } - return nil -} - -func (x *DataMessage) GetGiftBadge() *DataMessage_GiftBadge { - if x != nil { - return x.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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NullMessage) Reset() { - *x = NullMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NullMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NullMessage) ProtoMessage() {} - -func (x *NullMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[4] - 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 NullMessage.ProtoReflect.Descriptor instead. -func (*NullMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{4} -} - -func (x *NullMessage) GetPadding() []byte { - if x != nil { - return x.Padding - } - return nil -} - -type ReceiptMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type *ReceiptMessage_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.ReceiptMessage_Type" json:"type,omitempty"` - Timestamp []uint64 `protobuf:"varint,2,rep,name=timestamp" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReceiptMessage) Reset() { - *x = ReceiptMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReceiptMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReceiptMessage) ProtoMessage() {} - -func (x *ReceiptMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[5] - 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 ReceiptMessage.ProtoReflect.Descriptor instead. -func (*ReceiptMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{5} -} - -func (x *ReceiptMessage) GetType() ReceiptMessage_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return ReceiptMessage_DELIVERY -} - -func (x *ReceiptMessage) GetTimestamp() []uint64 { - if x != nil { - return x.Timestamp - } - return nil -} - -type TypingMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` - Action *TypingMessage_Action `protobuf:"varint,2,opt,name=action,enum=signalservice.TypingMessage_Action" json:"action,omitempty"` - GroupId []byte `protobuf:"bytes,3,opt,name=groupId" json:"groupId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TypingMessage) Reset() { - *x = TypingMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TypingMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TypingMessage) ProtoMessage() {} - -func (x *TypingMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[6] - 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 TypingMessage.ProtoReflect.Descriptor instead. -func (*TypingMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{6} -} - -func (x *TypingMessage) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -func (x *TypingMessage) GetAction() TypingMessage_Action { - if x != nil && x.Action != nil { - return *x.Action - } - return TypingMessage_STARTED -} - -func (x *TypingMessage) GetGroupId() []byte { - if x != nil { - return x.GroupId - } - return nil -} - -type StoryMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProfileKey []byte `protobuf:"bytes,1,opt,name=profileKey" json:"profileKey,omitempty"` - Group *GroupContextV2 `protobuf:"bytes,2,opt,name=group" json:"group,omitempty"` - // Types that are valid to be assigned to Attachment: - // - // *StoryMessage_FileAttachment - // *StoryMessage_TextAttachment - Attachment isStoryMessage_Attachment `protobuf_oneof:"attachment"` - AllowsReplies *bool `protobuf:"varint,5,opt,name=allowsReplies" json:"allowsReplies,omitempty"` - BodyRanges []*BodyRange `protobuf:"bytes,6,rep,name=bodyRanges" json:"bodyRanges,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StoryMessage) Reset() { - *x = StoryMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StoryMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoryMessage) ProtoMessage() {} - -func (x *StoryMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[7] - 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 StoryMessage.ProtoReflect.Descriptor instead. -func (*StoryMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{7} -} - -func (x *StoryMessage) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *StoryMessage) GetGroup() *GroupContextV2 { - if x != nil { - return x.Group - } - return nil -} - -func (x *StoryMessage) GetAttachment() isStoryMessage_Attachment { - if x != nil { - return x.Attachment - } - return nil -} - -func (x *StoryMessage) GetFileAttachment() *AttachmentPointer { - if x != nil { - if x, ok := x.Attachment.(*StoryMessage_FileAttachment); ok { - return x.FileAttachment - } - } - return nil -} - -func (x *StoryMessage) GetTextAttachment() *TextAttachment { - if x != nil { - if x, ok := x.Attachment.(*StoryMessage_TextAttachment); ok { - return x.TextAttachment - } - } - return nil -} - -func (x *StoryMessage) GetAllowsReplies() bool { - if x != nil && x.AllowsReplies != nil { - return *x.AllowsReplies - } - return false -} - -func (x *StoryMessage) GetBodyRanges() []*BodyRange { - if x != nil { - return x.BodyRanges - } - return nil -} - -type isStoryMessage_Attachment interface { - isStoryMessage_Attachment() -} - -type StoryMessage_FileAttachment struct { - FileAttachment *AttachmentPointer `protobuf:"bytes,3,opt,name=fileAttachment,oneof"` -} - -type StoryMessage_TextAttachment struct { - TextAttachment *TextAttachment `protobuf:"bytes,4,opt,name=textAttachment,oneof"` -} - -func (*StoryMessage_FileAttachment) isStoryMessage_Attachment() {} - -func (*StoryMessage_TextAttachment) isStoryMessage_Attachment() {} - -type Preview struct { - state protoimpl.MessageState `protogen:"open.v1"` - Url *string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` - Title *string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` - Image *AttachmentPointer `protobuf:"bytes,3,opt,name=image" json:"image,omitempty"` - Description *string `protobuf:"bytes,4,opt,name=description" json:"description,omitempty"` - Date *uint64 `protobuf:"varint,5,opt,name=date" json:"date,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Preview) Reset() { - *x = Preview{} - mi := &file_signalpb_SignalService_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Preview) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Preview) ProtoMessage() {} - -func (x *Preview) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 Preview.ProtoReflect.Descriptor instead. -func (*Preview) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{8} -} - -func (x *Preview) GetUrl() string { - if x != nil && x.Url != nil { - return *x.Url - } - return "" -} - -func (x *Preview) GetTitle() string { - if x != nil && x.Title != nil { - return *x.Title - } - return "" -} - -func (x *Preview) GetImage() *AttachmentPointer { - if x != nil { - return x.Image - } - return nil -} - -func (x *Preview) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *Preview) GetDate() uint64 { - if x != nil && x.Date != nil { - return *x.Date - } - return 0 -} - -type TextAttachment struct { - state protoimpl.MessageState `protogen:"open.v1"` - Text *string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` - TextStyle *TextAttachment_Style `protobuf:"varint,2,opt,name=textStyle,enum=signalservice.TextAttachment_Style" json:"textStyle,omitempty"` - TextForegroundColor *uint32 `protobuf:"varint,3,opt,name=textForegroundColor" json:"textForegroundColor,omitempty"` // integer representation of hex color - TextBackgroundColor *uint32 `protobuf:"varint,4,opt,name=textBackgroundColor" json:"textBackgroundColor,omitempty"` - Preview *Preview `protobuf:"bytes,5,opt,name=preview" json:"preview,omitempty"` - // Types that are valid to be assigned to Background: - // - // *TextAttachment_Gradient_ - // *TextAttachment_Color - Background isTextAttachment_Background `protobuf_oneof:"background"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TextAttachment) Reset() { - *x = TextAttachment{} - mi := &file_signalpb_SignalService_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TextAttachment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TextAttachment) ProtoMessage() {} - -func (x *TextAttachment) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 TextAttachment.ProtoReflect.Descriptor instead. -func (*TextAttachment) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{9} -} - -func (x *TextAttachment) GetText() string { - if x != nil && x.Text != nil { - return *x.Text - } - return "" -} - -func (x *TextAttachment) GetTextStyle() TextAttachment_Style { - if x != nil && x.TextStyle != nil { - return *x.TextStyle - } - return TextAttachment_DEFAULT -} - -func (x *TextAttachment) GetTextForegroundColor() uint32 { - if x != nil && x.TextForegroundColor != nil { - return *x.TextForegroundColor - } - return 0 -} - -func (x *TextAttachment) GetTextBackgroundColor() uint32 { - if x != nil && x.TextBackgroundColor != nil { - return *x.TextBackgroundColor - } - return 0 -} - -func (x *TextAttachment) GetPreview() *Preview { - if x != nil { - return x.Preview - } - return nil -} - -func (x *TextAttachment) GetBackground() isTextAttachment_Background { - if x != nil { - return x.Background - } - return nil -} - -func (x *TextAttachment) GetGradient() *TextAttachment_Gradient { - if x != nil { - if x, ok := x.Background.(*TextAttachment_Gradient_); ok { - return x.Gradient - } - } - return nil -} - -func (x *TextAttachment) GetColor() uint32 { - if x != nil { - if x, ok := x.Background.(*TextAttachment_Color); ok { - return x.Color - } - } - return 0 -} - -type isTextAttachment_Background interface { - isTextAttachment_Background() -} - -type TextAttachment_Gradient_ struct { - Gradient *TextAttachment_Gradient `protobuf:"bytes,6,opt,name=gradient,oneof"` -} - -type TextAttachment_Color struct { - Color uint32 `protobuf:"varint,7,opt,name=color,oneof"` -} - -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 -} - -func (x *Verified) Reset() { - *x = Verified{} - mi := &file_signalpb_SignalService_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Verified) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Verified) ProtoMessage() {} - -func (x *Verified) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 Verified.ProtoReflect.Descriptor instead. -func (*Verified) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{10} -} - -func (x *Verified) GetDestinationAci() string { - if x != nil && x.DestinationAci != nil { - return *x.DestinationAci - } - return "" -} - -func (x *Verified) GetIdentityKey() []byte { - if x != nil { - return x.IdentityKey - } - return nil -} - -func (x *Verified) GetState() Verified_State { - if x != nil && x.State != nil { - return *x.State - } - return Verified_DEFAULT -} - -func (x *Verified) GetNullMessage() []byte { - if x != nil { - return x.NullMessage - } - 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_ - // *SyncMessage_UsernameChange_ - 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 -} - -func (x *SyncMessage) Reset() { - *x = SyncMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage) ProtoMessage() {} - -func (x *SyncMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[11] - 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 SyncMessage.ProtoReflect.Descriptor instead. -func (*SyncMessage) Descriptor() ([]byte, []int) { - return file_signalpb_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 nil -} - -func (x *SyncMessage) GetContacts() *SyncMessage_Contacts { - if x != nil { - if x, ok := x.Content.(*SyncMessage_Contacts_); ok { - 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 nil -} - -func (x *SyncMessage) GetUsernameChange() *SyncMessage_UsernameChange { - if x != nil { - if x, ok := x.Content.(*SyncMessage_UsernameChange_); ok { - return x.UsernameChange - } - } - return nil -} - -func (x *SyncMessage) GetRead() []*SyncMessage_Read { - if x != nil { - return x.Read - } - return nil -} - -func (x *SyncMessage) GetStickerPackOperation() []*SyncMessage_StickerPackOperation { - if x != nil { - return x.StickerPackOperation - } - return nil -} - -func (x *SyncMessage) GetViewed() []*SyncMessage_Viewed { - if x != nil { - return x.Viewed - } - return nil -} - -func (x *SyncMessage) GetPadding() []byte { - if x != nil { - return x.Padding - } - return nil -} - -type isSyncMessage_Content interface { - isSyncMessage_Content() -} - -type SyncMessage_Sent_ struct { - Sent *SyncMessage_Sent `protobuf:"bytes,1,opt,name=sent,oneof"` -} - -type SyncMessage_Contacts_ struct { - Contacts *SyncMessage_Contacts `protobuf:"bytes,2,opt,name=contacts,oneof"` -} - -type SyncMessage_Request_ struct { - Request *SyncMessage_Request `protobuf:"bytes,4,opt,name=request,oneof"` -} - -type SyncMessage_Blocked_ struct { - Blocked *SyncMessage_Blocked `protobuf:"bytes,6,opt,name=blocked,oneof"` -} - -type SyncMessage_Verified struct { - Verified *Verified `protobuf:"bytes,7,opt,name=verified,oneof"` -} - -type SyncMessage_Configuration_ struct { - Configuration *SyncMessage_Configuration `protobuf:"bytes,9,opt,name=configuration,oneof"` -} - -type SyncMessage_ViewOnceOpen_ struct { - ViewOnceOpen *SyncMessage_ViewOnceOpen `protobuf:"bytes,11,opt,name=viewOnceOpen,oneof"` -} - -type SyncMessage_FetchLatest_ struct { - FetchLatest *SyncMessage_FetchLatest `protobuf:"bytes,12,opt,name=fetchLatest,oneof"` -} - -type SyncMessage_Keys_ struct { - Keys *SyncMessage_Keys `protobuf:"bytes,13,opt,name=keys,oneof"` -} - -type SyncMessage_MessageRequestResponse_ struct { - MessageRequestResponse *SyncMessage_MessageRequestResponse `protobuf:"bytes,14,opt,name=messageRequestResponse,oneof"` -} - -type SyncMessage_OutgoingPayment_ struct { - OutgoingPayment *SyncMessage_OutgoingPayment `protobuf:"bytes,15,opt,name=outgoingPayment,oneof"` -} - -type SyncMessage_PniChangeNumber_ struct { - PniChangeNumber *SyncMessage_PniChangeNumber `protobuf:"bytes,18,opt,name=pniChangeNumber,oneof"` -} - -type SyncMessage_CallEvent_ struct { - CallEvent *SyncMessage_CallEvent `protobuf:"bytes,19,opt,name=callEvent,oneof"` -} - -type SyncMessage_CallLinkUpdate_ struct { - CallLinkUpdate *SyncMessage_CallLinkUpdate `protobuf:"bytes,20,opt,name=callLinkUpdate,oneof"` -} - -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"` -} - -type SyncMessage_UsernameChange_ struct { - UsernameChange *SyncMessage_UsernameChange `protobuf:"bytes,26,opt,name=usernameChange,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() {} - -func (*SyncMessage_UsernameChange_) isSyncMessage_Content() {} - -type AttachmentPointer struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to AttachmentIdentifier: - // - // *AttachmentPointer_CdnId - // *AttachmentPointer_CdnKey - AttachmentIdentifier isAttachmentPointer_AttachmentIdentifier `protobuf_oneof:"attachment_identifier"` - // Cross-client identifier for this attachment among all attachments on the - // owning message. - ClientUuid []byte `protobuf:"bytes,20,opt,name=clientUuid" json:"clientUuid,omitempty"` - ContentType *string `protobuf:"bytes,2,opt,name=contentType" json:"contentType,omitempty"` - Key []byte `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` - Size *uint32 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"` - Thumbnail []byte `protobuf:"bytes,5,opt,name=thumbnail" json:"thumbnail,omitempty"` - Digest []byte `protobuf:"bytes,6,opt,name=digest" json:"digest,omitempty"` - IncrementalMac []byte `protobuf:"bytes,19,opt,name=incrementalMac" json:"incrementalMac,omitempty"` - ChunkSize *uint32 `protobuf:"varint,17,opt,name=chunkSize" json:"chunkSize,omitempty"` - FileName *string `protobuf:"bytes,7,opt,name=fileName" json:"fileName,omitempty"` - Flags *uint32 `protobuf:"varint,8,opt,name=flags" json:"flags,omitempty"` - Width *uint32 `protobuf:"varint,9,opt,name=width" json:"width,omitempty"` - Height *uint32 `protobuf:"varint,10,opt,name=height" json:"height,omitempty"` - Caption *string `protobuf:"bytes,11,opt,name=caption" json:"caption,omitempty"` - BlurHash *string `protobuf:"bytes,12,opt,name=blurHash" json:"blurHash,omitempty"` - UploadTimestamp *uint64 `protobuf:"varint,13,opt,name=uploadTimestamp" json:"uploadTimestamp,omitempty"` - CdnNumber *uint32 `protobuf:"varint,14,opt,name=cdnNumber" json:"cdnNumber,omitempty"` // Next ID: 21 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AttachmentPointer) Reset() { - *x = AttachmentPointer{} - mi := &file_signalpb_SignalService_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AttachmentPointer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AttachmentPointer) ProtoMessage() {} - -func (x *AttachmentPointer) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 AttachmentPointer.ProtoReflect.Descriptor instead. -func (*AttachmentPointer) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{12} -} - -func (x *AttachmentPointer) GetAttachmentIdentifier() isAttachmentPointer_AttachmentIdentifier { - if x != nil { - return x.AttachmentIdentifier - } - return nil -} - -func (x *AttachmentPointer) GetCdnId() uint64 { - if x != nil { - if x, ok := x.AttachmentIdentifier.(*AttachmentPointer_CdnId); ok { - return x.CdnId - } - } - return 0 -} - -func (x *AttachmentPointer) GetCdnKey() string { - if x != nil { - if x, ok := x.AttachmentIdentifier.(*AttachmentPointer_CdnKey); ok { - return x.CdnKey - } - } - return "" -} - -func (x *AttachmentPointer) GetClientUuid() []byte { - if x != nil { - return x.ClientUuid - } - return nil -} - -func (x *AttachmentPointer) GetContentType() string { - if x != nil && x.ContentType != nil { - return *x.ContentType - } - return "" -} - -func (x *AttachmentPointer) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *AttachmentPointer) GetSize() uint32 { - if x != nil && x.Size != nil { - return *x.Size - } - return 0 -} - -func (x *AttachmentPointer) GetThumbnail() []byte { - if x != nil { - return x.Thumbnail - } - return nil -} - -func (x *AttachmentPointer) GetDigest() []byte { - if x != nil { - return x.Digest - } - return nil -} - -func (x *AttachmentPointer) GetIncrementalMac() []byte { - if x != nil { - return x.IncrementalMac - } - return nil -} - -func (x *AttachmentPointer) GetChunkSize() uint32 { - if x != nil && x.ChunkSize != nil { - return *x.ChunkSize - } - return 0 -} - -func (x *AttachmentPointer) GetFileName() string { - if x != nil && x.FileName != nil { - return *x.FileName - } - return "" -} - -func (x *AttachmentPointer) GetFlags() uint32 { - if x != nil && x.Flags != nil { - return *x.Flags - } - return 0 -} - -func (x *AttachmentPointer) GetWidth() uint32 { - if x != nil && x.Width != nil { - return *x.Width - } - return 0 -} - -func (x *AttachmentPointer) GetHeight() uint32 { - if x != nil && x.Height != nil { - return *x.Height - } - return 0 -} - -func (x *AttachmentPointer) GetCaption() string { - if x != nil && x.Caption != nil { - return *x.Caption - } - return "" -} - -func (x *AttachmentPointer) GetBlurHash() string { - if x != nil && x.BlurHash != nil { - return *x.BlurHash - } - return "" -} - -func (x *AttachmentPointer) GetUploadTimestamp() uint64 { - if x != nil && x.UploadTimestamp != nil { - return *x.UploadTimestamp - } - return 0 -} - -func (x *AttachmentPointer) GetCdnNumber() uint32 { - if x != nil && x.CdnNumber != nil { - return *x.CdnNumber - } - return 0 -} - -type isAttachmentPointer_AttachmentIdentifier interface { - isAttachmentPointer_AttachmentIdentifier() -} - -type AttachmentPointer_CdnId struct { - CdnId uint64 `protobuf:"fixed64,1,opt,name=cdnId,oneof"` -} - -type AttachmentPointer_CdnKey struct { - CdnKey string `protobuf:"bytes,15,opt,name=cdnKey,oneof"` -} - -func (*AttachmentPointer_CdnId) isAttachmentPointer_AttachmentIdentifier() {} - -func (*AttachmentPointer_CdnKey) isAttachmentPointer_AttachmentIdentifier() {} - -type GroupContextV2 struct { - state protoimpl.MessageState `protogen:"open.v1"` - MasterKey []byte `protobuf:"bytes,1,opt,name=masterKey" json:"masterKey,omitempty"` - Revision *uint32 `protobuf:"varint,2,opt,name=revision" json:"revision,omitempty"` - GroupChange []byte `protobuf:"bytes,3,opt,name=groupChange" json:"groupChange,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupContextV2) Reset() { - *x = GroupContextV2{} - mi := &file_signalpb_SignalService_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupContextV2) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupContextV2) ProtoMessage() {} - -func (x *GroupContextV2) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 GroupContextV2.ProtoReflect.Descriptor instead. -func (*GroupContextV2) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{13} -} - -func (x *GroupContextV2) GetMasterKey() []byte { - if x != nil { - return x.MasterKey - } - return nil -} - -func (x *GroupContextV2) GetRevision() uint32 { - if x != nil && x.Revision != nil { - return *x.Revision - } - return 0 -} - -func (x *GroupContextV2) GetGroupChange() []byte { - if x != nil { - return x.GroupChange - } - return nil -} - -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"` - ExpireTimerVersion *uint32 `protobuf:"varint,12,opt,name=expireTimerVersion" json:"expireTimerVersion,omitempty"` - InboxPosition *uint32 `protobuf:"varint,10,opt,name=inboxPosition" json:"inboxPosition,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactDetails) Reset() { - *x = ContactDetails{} - mi := &file_signalpb_SignalService_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactDetails) ProtoMessage() {} - -func (x *ContactDetails) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 ContactDetails.ProtoReflect.Descriptor instead. -func (*ContactDetails) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{14} -} - -func (x *ContactDetails) GetNumber() string { - if x != nil && x.Number != nil { - return *x.Number - } - return "" -} - -func (x *ContactDetails) GetAci() string { - if x != nil && x.Aci != nil { - return *x.Aci - } - 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 - } - return "" -} - -func (x *ContactDetails) GetAvatar() *ContactDetails_Avatar { - if x != nil { - return x.Avatar - } - return nil -} - -func (x *ContactDetails) GetExpireTimer() uint32 { - if x != nil && x.ExpireTimer != nil { - return *x.ExpireTimer - } - return 0 -} - -func (x *ContactDetails) GetExpireTimerVersion() uint32 { - if x != nil && x.ExpireTimerVersion != nil { - return *x.ExpireTimerVersion - } - return 0 -} - -func (x *ContactDetails) GetInboxPosition() uint32 { - if x != nil && x.InboxPosition != nil { - return *x.InboxPosition - } - return 0 -} - -type PaymentAddress struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Address: - // - // *PaymentAddress_MobileCoin_ - Address isPaymentAddress_Address `protobuf_oneof:"Address"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentAddress) Reset() { - *x = PaymentAddress{} - mi := &file_signalpb_SignalService_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentAddress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentAddress) ProtoMessage() {} - -func (x *PaymentAddress) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 PaymentAddress.ProtoReflect.Descriptor instead. -func (*PaymentAddress) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{15} -} - -func (x *PaymentAddress) GetAddress() isPaymentAddress_Address { - if x != nil { - return x.Address - } - return nil -} - -func (x *PaymentAddress) GetMobileCoin() *PaymentAddress_MobileCoin { - if x != nil { - if x, ok := x.Address.(*PaymentAddress_MobileCoin_); ok { - return x.MobileCoin - } - } - return nil -} - -type isPaymentAddress_Address interface { - isPaymentAddress_Address() -} - -type PaymentAddress_MobileCoin_ struct { - MobileCoin *PaymentAddress_MobileCoin `protobuf:"bytes,1,opt,name=mobileCoin,oneof"` -} - -func (*PaymentAddress_MobileCoin_) isPaymentAddress_Address() {} - -type DecryptionErrorMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - RatchetKey []byte `protobuf:"bytes,1,opt,name=ratchetKey" json:"ratchetKey,omitempty"` // set to the public ratchet key from the SignalMessage if a 1-1 payload fails to decrypt - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - DeviceId *uint32 `protobuf:"varint,3,opt,name=deviceId" json:"deviceId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DecryptionErrorMessage) Reset() { - *x = DecryptionErrorMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DecryptionErrorMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DecryptionErrorMessage) ProtoMessage() {} - -func (x *DecryptionErrorMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[16] - 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 DecryptionErrorMessage.ProtoReflect.Descriptor instead. -func (*DecryptionErrorMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{16} -} - -func (x *DecryptionErrorMessage) GetRatchetKey() []byte { - if x != nil { - return x.RatchetKey - } - return nil -} - -func (x *DecryptionErrorMessage) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -func (x *DecryptionErrorMessage) GetDeviceId() uint32 { - if x != nil && x.DeviceId != nil { - return *x.DeviceId - } - return 0 -} - -type PniSignatureMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Pni []byte `protobuf:"bytes,1,opt,name=pni" json:"pni,omitempty"` - // Signature *by* the PNI identity key *of* the ACI identity key - Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PniSignatureMessage) Reset() { - *x = PniSignatureMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PniSignatureMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PniSignatureMessage) ProtoMessage() {} - -func (x *PniSignatureMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[17] - 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 PniSignatureMessage.ProtoReflect.Descriptor instead. -func (*PniSignatureMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{17} -} - -func (x *PniSignatureMessage) GetPni() []byte { - if x != nil { - return x.Pni - } - return nil -} - -func (x *PniSignatureMessage) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -type EditMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetSentTimestamp *uint64 `protobuf:"varint,1,opt,name=targetSentTimestamp" json:"targetSentTimestamp,omitempty"` - DataMessage *DataMessage `protobuf:"bytes,2,opt,name=dataMessage" json:"dataMessage,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *EditMessage) Reset() { - *x = EditMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *EditMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EditMessage) ProtoMessage() {} - -func (x *EditMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[18] - 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 EditMessage.ProtoReflect.Descriptor instead. -func (*EditMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{18} -} - -func (x *EditMessage) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - -func (x *EditMessage) GetDataMessage() *DataMessage { - if x != nil { - return x.DataMessage - } - return nil -} - -type BodyRange struct { - state protoimpl.MessageState `protogen:"open.v1"` - Start *uint32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` // Starting index in UTF-16 code units/raw string representation - Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` // Length of range in UTF-16 code units/raw string representation - // Types that are valid to be assigned to AssociatedValue: - // - // *BodyRange_MentionAci - // *BodyRange_Style_ - // *BodyRange_MentionAciBinary - AssociatedValue isBodyRange_AssociatedValue `protobuf_oneof:"associatedValue"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *BodyRange) Reset() { - *x = BodyRange{} - mi := &file_signalpb_SignalService_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *BodyRange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BodyRange) ProtoMessage() {} - -func (x *BodyRange) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[19] - 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 BodyRange.ProtoReflect.Descriptor instead. -func (*BodyRange) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{19} -} - -func (x *BodyRange) GetStart() uint32 { - if x != nil && x.Start != nil { - return *x.Start - } - return 0 -} - -func (x *BodyRange) GetLength() uint32 { - if x != nil && x.Length != nil { - return *x.Length - } - return 0 -} - -func (x *BodyRange) GetAssociatedValue() isBodyRange_AssociatedValue { - if x != nil { - return x.AssociatedValue - } - return nil -} - -func (x *BodyRange) GetMentionAci() string { - if x != nil { - if x, ok := x.AssociatedValue.(*BodyRange_MentionAci); ok { - return x.MentionAci - } - } - return "" -} - -func (x *BodyRange) GetStyle() BodyRange_Style { - if x != nil { - if x, ok := x.AssociatedValue.(*BodyRange_Style_); ok { - return x.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() -} - -type BodyRange_MentionAci struct { - MentionAci string `protobuf:"bytes,3,opt,name=mentionAci,oneof"` -} - -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 - sizeCache protoimpl.SizeCache -} - -func (x *AddressableMessage) Reset() { - *x = AddressableMessage{} - mi := &file_signalpb_SignalService_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddressableMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddressableMessage) ProtoMessage() {} - -func (x *AddressableMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 AddressableMessage.ProtoReflect.Descriptor instead. -func (*AddressableMessage) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{20} -} - -func (x *AddressableMessage) GetAuthor() isAddressableMessage_Author { - if x != nil { - return x.Author - } - return nil -} - -func (x *AddressableMessage) GetAuthorServiceId() string { - if x != nil { - if x, ok := x.Author.(*AddressableMessage_AuthorServiceId); ok { - return x.AuthorServiceId - } - } - return "" -} - -func (x *AddressableMessage) GetAuthorE164() string { - if x != nil { - if x, ok := x.Author.(*AddressableMessage_AuthorE164); ok { - return x.AuthorE164 - } - } - 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 - } - return 0 -} - -type isAddressableMessage_Author interface { - isAddressableMessage_Author() -} - -type AddressableMessage_AuthorServiceId struct { - AuthorServiceId string `protobuf:"bytes,1,opt,name=authorServiceId,oneof"` -} - -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: - // - // *ConversationIdentifier_ThreadServiceId - // *ConversationIdentifier_ThreadGroupId - // *ConversationIdentifier_ThreadE164 - // *ConversationIdentifier_ThreadServiceIdBinary - Identifier isConversationIdentifier_Identifier `protobuf_oneof:"identifier"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ConversationIdentifier) Reset() { - *x = ConversationIdentifier{} - mi := &file_signalpb_SignalService_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ConversationIdentifier) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConversationIdentifier) ProtoMessage() {} - -func (x *ConversationIdentifier) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[21] - 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 ConversationIdentifier.ProtoReflect.Descriptor instead. -func (*ConversationIdentifier) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{21} -} - -func (x *ConversationIdentifier) GetIdentifier() isConversationIdentifier_Identifier { - if x != nil { - return x.Identifier - } - return nil -} - -func (x *ConversationIdentifier) GetThreadServiceId() string { - if x != nil { - if x, ok := x.Identifier.(*ConversationIdentifier_ThreadServiceId); ok { - return x.ThreadServiceId - } - } - return "" -} - -func (x *ConversationIdentifier) GetThreadGroupId() []byte { - if x != nil { - if x, ok := x.Identifier.(*ConversationIdentifier_ThreadGroupId); ok { - return x.ThreadGroupId - } - } - return nil -} - -func (x *ConversationIdentifier) GetThreadE164() string { - if x != nil { - if x, ok := x.Identifier.(*ConversationIdentifier_ThreadE164); ok { - return x.ThreadE164 - } - } - 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() -} - -type ConversationIdentifier_ThreadServiceId struct { - ThreadServiceId string `protobuf:"bytes,1,opt,name=threadServiceId,oneof"` -} - -type ConversationIdentifier_ThreadGroupId struct { - ThreadGroupId []byte `protobuf:"bytes,2,opt,name=threadGroupId,oneof"` -} - -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"` - Type *CallMessage_Offer_Type `protobuf:"varint,3,opt,name=type,enum=signalservice.CallMessage_Offer_Type" json:"type,omitempty"` - Opaque []byte `protobuf:"bytes,4,opt,name=opaque" json:"opaque,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallMessage_Offer) Reset() { - *x = CallMessage_Offer{} - mi := &file_signalpb_SignalService_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallMessage_Offer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallMessage_Offer) ProtoMessage() {} - -func (x *CallMessage_Offer) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[22] - 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 CallMessage_Offer.ProtoReflect.Descriptor instead. -func (*CallMessage_Offer) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *CallMessage_Offer) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *CallMessage_Offer) GetType() CallMessage_Offer_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return CallMessage_Offer_OFFER_AUDIO_CALL -} - -func (x *CallMessage_Offer) GetOpaque() []byte { - if x != nil { - return x.Opaque - } - return nil -} - -type CallMessage_Answer struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Opaque []byte `protobuf:"bytes,3,opt,name=opaque" json:"opaque,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallMessage_Answer) Reset() { - *x = CallMessage_Answer{} - mi := &file_signalpb_SignalService_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallMessage_Answer) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallMessage_Answer) ProtoMessage() {} - -func (x *CallMessage_Answer) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[23] - 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 CallMessage_Answer.ProtoReflect.Descriptor instead. -func (*CallMessage_Answer) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *CallMessage_Answer) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *CallMessage_Answer) GetOpaque() []byte { - if x != nil { - return x.Opaque - } - return nil -} - -type CallMessage_IceUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Opaque []byte `protobuf:"bytes,5,opt,name=opaque" json:"opaque,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallMessage_IceUpdate) Reset() { - *x = CallMessage_IceUpdate{} - mi := &file_signalpb_SignalService_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallMessage_IceUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallMessage_IceUpdate) ProtoMessage() {} - -func (x *CallMessage_IceUpdate) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[24] - 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 CallMessage_IceUpdate.ProtoReflect.Descriptor instead. -func (*CallMessage_IceUpdate) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 2} -} - -func (x *CallMessage_IceUpdate) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *CallMessage_IceUpdate) GetOpaque() []byte { - if x != nil { - return x.Opaque - } - return nil -} - -type CallMessage_Busy struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallMessage_Busy) Reset() { - *x = CallMessage_Busy{} - mi := &file_signalpb_SignalService_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallMessage_Busy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallMessage_Busy) ProtoMessage() {} - -func (x *CallMessage_Busy) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[25] - 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 CallMessage_Busy.ProtoReflect.Descriptor instead. -func (*CallMessage_Busy) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 3} -} - -func (x *CallMessage_Busy) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type CallMessage_Hangup struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Type *CallMessage_Hangup_Type `protobuf:"varint,2,opt,name=type,enum=signalservice.CallMessage_Hangup_Type" json:"type,omitempty"` - DeviceId *uint32 `protobuf:"varint,3,opt,name=deviceId" json:"deviceId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallMessage_Hangup) Reset() { - *x = CallMessage_Hangup{} - mi := &file_signalpb_SignalService_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallMessage_Hangup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallMessage_Hangup) ProtoMessage() {} - -func (x *CallMessage_Hangup) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[26] - 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 CallMessage_Hangup.ProtoReflect.Descriptor instead. -func (*CallMessage_Hangup) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 4} -} - -func (x *CallMessage_Hangup) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *CallMessage_Hangup) GetType() CallMessage_Hangup_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return CallMessage_Hangup_HANGUP_NORMAL -} - -func (x *CallMessage_Hangup) GetDeviceId() uint32 { - if x != nil && x.DeviceId != nil { - return *x.DeviceId - } - return 0 -} - -type CallMessage_Opaque struct { - state protoimpl.MessageState `protogen:"open.v1"` - Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` - Urgency *CallMessage_Opaque_Urgency `protobuf:"varint,2,opt,name=urgency,enum=signalservice.CallMessage_Opaque_Urgency" json:"urgency,omitempty"` // If missing, treat as DROPPABLE. - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallMessage_Opaque) Reset() { - *x = CallMessage_Opaque{} - mi := &file_signalpb_SignalService_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallMessage_Opaque) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallMessage_Opaque) ProtoMessage() {} - -func (x *CallMessage_Opaque) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[27] - 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 CallMessage_Opaque.ProtoReflect.Descriptor instead. -func (*CallMessage_Opaque) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{2, 5} -} - -func (x *CallMessage_Opaque) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -func (x *CallMessage_Opaque) GetUrgency() CallMessage_Opaque_Urgency { - if x != nil && x.Urgency != nil { - return *x.Urgency - } - return CallMessage_Opaque_DROPPABLE -} - -type DataMessage_Payment struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Item: - // - // *DataMessage_Payment_Notification_ - // *DataMessage_Payment_Activation_ - Item isDataMessage_Payment_Item `protobuf_oneof:"Item"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Payment) Reset() { - *x = DataMessage_Payment{} - mi := &file_signalpb_SignalService_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Payment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Payment) ProtoMessage() {} - -func (x *DataMessage_Payment) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[28] - 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_Payment.ProtoReflect.Descriptor instead. -func (*DataMessage_Payment) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *DataMessage_Payment) GetItem() isDataMessage_Payment_Item { - if x != nil { - return x.Item - } - return nil -} - -func (x *DataMessage_Payment) GetNotification() *DataMessage_Payment_Notification { - if x != nil { - if x, ok := x.Item.(*DataMessage_Payment_Notification_); ok { - return x.Notification - } - } - return nil -} - -func (x *DataMessage_Payment) GetActivation() *DataMessage_Payment_Activation { - if x != nil { - if x, ok := x.Item.(*DataMessage_Payment_Activation_); ok { - return x.Activation - } - } - return nil -} - -type isDataMessage_Payment_Item interface { - isDataMessage_Payment_Item() -} - -type DataMessage_Payment_Notification_ struct { - Notification *DataMessage_Payment_Notification `protobuf:"bytes,1,opt,name=notification,oneof"` -} - -type DataMessage_Payment_Activation_ struct { - Activation *DataMessage_Payment_Activation `protobuf:"bytes,2,opt,name=activation,oneof"` -} - -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 -} - -func (x *DataMessage_Quote) Reset() { - *x = DataMessage_Quote{} - mi := &file_signalpb_SignalService_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Quote) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Quote) ProtoMessage() {} - -func (x *DataMessage_Quote) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[29] - 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_Quote.ProtoReflect.Descriptor instead. -func (*DataMessage_Quote) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 1} -} - -func (x *DataMessage_Quote) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *DataMessage_Quote) GetAuthorAci() string { - if x != nil && x.AuthorAci != nil { - return *x.AuthorAci - } - return "" -} - -func (x *DataMessage_Quote) GetText() string { - if x != nil && x.Text != nil { - return *x.Text - } - return "" -} - -func (x *DataMessage_Quote) GetAttachments() []*DataMessage_Quote_QuotedAttachment { - if x != nil { - return x.Attachments - } - return nil -} - -func (x *DataMessage_Quote) GetBodyRanges() []*BodyRange { - if x != nil { - return x.BodyRanges - } - return nil -} - -func (x *DataMessage_Quote) GetType() DataMessage_Quote_Type { - if x != nil && x.Type != nil { - return *x.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"` - Number []*DataMessage_Contact_Phone `protobuf:"bytes,3,rep,name=number" json:"number,omitempty"` - Email []*DataMessage_Contact_Email `protobuf:"bytes,4,rep,name=email" json:"email,omitempty"` - Address []*DataMessage_Contact_PostalAddress `protobuf:"bytes,5,rep,name=address" json:"address,omitempty"` - Avatar *DataMessage_Contact_Avatar `protobuf:"bytes,6,opt,name=avatar" json:"avatar,omitempty"` - Organization *string `protobuf:"bytes,7,opt,name=organization" json:"organization,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Contact) Reset() { - *x = DataMessage_Contact{} - mi := &file_signalpb_SignalService_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Contact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Contact) ProtoMessage() {} - -func (x *DataMessage_Contact) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[30] - 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_Contact.ProtoReflect.Descriptor instead. -func (*DataMessage_Contact) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2} -} - -func (x *DataMessage_Contact) GetName() *DataMessage_Contact_Name { - if x != nil { - return x.Name - } - return nil -} - -func (x *DataMessage_Contact) GetNumber() []*DataMessage_Contact_Phone { - if x != nil { - return x.Number - } - return nil -} - -func (x *DataMessage_Contact) GetEmail() []*DataMessage_Contact_Email { - if x != nil { - return x.Email - } - return nil -} - -func (x *DataMessage_Contact) GetAddress() []*DataMessage_Contact_PostalAddress { - if x != nil { - return x.Address - } - return nil -} - -func (x *DataMessage_Contact) GetAvatar() *DataMessage_Contact_Avatar { - if x != nil { - return x.Avatar - } - return nil -} - -func (x *DataMessage_Contact) GetOrganization() string { - if x != nil && x.Organization != nil { - return *x.Organization - } - return "" -} - -type DataMessage_Sticker struct { - state protoimpl.MessageState `protogen:"open.v1"` - PackId []byte `protobuf:"bytes,1,opt,name=packId" json:"packId,omitempty"` - PackKey []byte `protobuf:"bytes,2,opt,name=packKey" json:"packKey,omitempty"` - StickerId *uint32 `protobuf:"varint,3,opt,name=stickerId" json:"stickerId,omitempty"` - Data *AttachmentPointer `protobuf:"bytes,4,opt,name=data" json:"data,omitempty"` - Emoji *string `protobuf:"bytes,5,opt,name=emoji" json:"emoji,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Sticker) Reset() { - *x = DataMessage_Sticker{} - mi := &file_signalpb_SignalService_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Sticker) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Sticker) ProtoMessage() {} - -func (x *DataMessage_Sticker) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[31] - 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_Sticker.ProtoReflect.Descriptor instead. -func (*DataMessage_Sticker) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 3} -} - -func (x *DataMessage_Sticker) GetPackId() []byte { - if x != nil { - return x.PackId - } - return nil -} - -func (x *DataMessage_Sticker) GetPackKey() []byte { - if x != nil { - return x.PackKey - } - return nil -} - -func (x *DataMessage_Sticker) GetStickerId() uint32 { - if x != nil && x.StickerId != nil { - return *x.StickerId - } - return 0 -} - -func (x *DataMessage_Sticker) GetData() *AttachmentPointer { - if x != nil { - return x.Data - } - return nil -} - -func (x *DataMessage_Sticker) GetEmoji() string { - if x != nil && x.Emoji != nil { - return *x.Emoji - } - return "" -} - -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 -} - -func (x *DataMessage_Reaction) Reset() { - *x = DataMessage_Reaction{} - mi := &file_signalpb_SignalService_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Reaction) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Reaction) ProtoMessage() {} - -func (x *DataMessage_Reaction) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 DataMessage_Reaction.ProtoReflect.Descriptor instead. -func (*DataMessage_Reaction) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 4} -} - -func (x *DataMessage_Reaction) GetEmoji() string { - if x != nil && x.Emoji != nil { - return *x.Emoji - } - return "" -} - -func (x *DataMessage_Reaction) GetRemove() bool { - if x != nil && x.Remove != nil { - return *x.Remove - } - return false -} - -func (x *DataMessage_Reaction) GetTargetAuthorAci() string { - if x != nil && x.TargetAuthorAci != nil { - return *x.TargetAuthorAci - } - return "" -} - -func (x *DataMessage_Reaction) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Delete) Reset() { - *x = DataMessage_Delete{} - mi := &file_signalpb_SignalService_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Delete) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Delete) ProtoMessage() {} - -func (x *DataMessage_Delete) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 DataMessage_Delete.ProtoReflect.Descriptor instead. -func (*DataMessage_Delete) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 5} -} - -func (x *DataMessage_Delete) GetTargetSentTimestamp() uint64 { - if x != nil && x.TargetSentTimestamp != nil { - return *x.TargetSentTimestamp - } - return 0 -} - -type DataMessage_GroupCallUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - EraId *string `protobuf:"bytes,1,opt,name=eraId" json:"eraId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_GroupCallUpdate) Reset() { - *x = DataMessage_GroupCallUpdate{} - mi := &file_signalpb_SignalService_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_GroupCallUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_GroupCallUpdate) ProtoMessage() {} - -func (x *DataMessage_GroupCallUpdate) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[34] - 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_GroupCallUpdate.ProtoReflect.Descriptor instead. -func (*DataMessage_GroupCallUpdate) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 6} -} - -func (x *DataMessage_GroupCallUpdate) GetEraId() string { - if x != nil && x.EraId != nil { - return *x.EraId - } - return "" -} - -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 -} - -func (x *DataMessage_StoryContext) Reset() { - *x = DataMessage_StoryContext{} - mi := &file_signalpb_SignalService_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_StoryContext) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_StoryContext) ProtoMessage() {} - -func (x *DataMessage_StoryContext) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[35] - 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_StoryContext.ProtoReflect.Descriptor instead. -func (*DataMessage_StoryContext) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 7} -} - -func (x *DataMessage_StoryContext) GetAuthorAci() string { - if x != nil && x.AuthorAci != nil { - return *x.AuthorAci - } - return "" -} - -func (x *DataMessage_StoryContext) GetSentTimestamp() uint64 { - if x != nil && x.SentTimestamp != nil { - return *x.SentTimestamp - } - 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_GiftBadge) Reset() { - *x = DataMessage_GiftBadge{} - mi := &file_signalpb_SignalService_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_GiftBadge) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_GiftBadge) ProtoMessage() {} - -func (x *DataMessage_GiftBadge) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[36] - 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_GiftBadge.ProtoReflect.Descriptor instead. -func (*DataMessage_GiftBadge) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 8} -} - -func (x *DataMessage_GiftBadge) GetReceiptCredentialPresentation() []byte { - if x != nil { - return x.ReceiptCredentialPresentation - } - 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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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_signalpb_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: - // - // *DataMessage_Payment_Amount_MobileCoin_ - Amount isDataMessage_Payment_Amount_Amount `protobuf_oneof:"Amount"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Payment_Amount) Reset() { - *x = DataMessage_Payment_Amount{} - mi := &file_signalpb_SignalService_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Payment_Amount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Payment_Amount) ProtoMessage() {} - -func (x *DataMessage_Payment_Amount) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[43] - 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_Payment_Amount.ProtoReflect.Descriptor instead. -func (*DataMessage_Payment_Amount) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0, 0} -} - -func (x *DataMessage_Payment_Amount) GetAmount() isDataMessage_Payment_Amount_Amount { - if x != nil { - return x.Amount - } - return nil -} - -func (x *DataMessage_Payment_Amount) GetMobileCoin() *DataMessage_Payment_Amount_MobileCoin { - if x != nil { - if x, ok := x.Amount.(*DataMessage_Payment_Amount_MobileCoin_); ok { - return x.MobileCoin - } - } - return nil -} - -type isDataMessage_Payment_Amount_Amount interface { - isDataMessage_Payment_Amount_Amount() -} - -type DataMessage_Payment_Amount_MobileCoin_ struct { - MobileCoin *DataMessage_Payment_Amount_MobileCoin `protobuf:"bytes,1,opt,name=mobileCoin,oneof"` -} - -func (*DataMessage_Payment_Amount_MobileCoin_) isDataMessage_Payment_Amount_Amount() {} - -type DataMessage_Payment_Notification struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Transaction: - // - // *DataMessage_Payment_Notification_MobileCoin_ - Transaction isDataMessage_Payment_Notification_Transaction `protobuf_oneof:"Transaction"` - // Optional, Refers to the PaymentRequest message, if any. - Note *string `protobuf:"bytes,2,opt,name=note" json:"note,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Payment_Notification) Reset() { - *x = DataMessage_Payment_Notification{} - mi := &file_signalpb_SignalService_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Payment_Notification) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Payment_Notification) ProtoMessage() {} - -func (x *DataMessage_Payment_Notification) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[44] - 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_Payment_Notification.ProtoReflect.Descriptor instead. -func (*DataMessage_Payment_Notification) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0, 1} -} - -func (x *DataMessage_Payment_Notification) GetTransaction() isDataMessage_Payment_Notification_Transaction { - if x != nil { - return x.Transaction - } - return nil -} - -func (x *DataMessage_Payment_Notification) GetMobileCoin() *DataMessage_Payment_Notification_MobileCoin { - if x != nil { - if x, ok := x.Transaction.(*DataMessage_Payment_Notification_MobileCoin_); ok { - return x.MobileCoin - } - } - return nil -} - -func (x *DataMessage_Payment_Notification) GetNote() string { - if x != nil && x.Note != nil { - return *x.Note - } - return "" -} - -type isDataMessage_Payment_Notification_Transaction interface { - isDataMessage_Payment_Notification_Transaction() -} - -type DataMessage_Payment_Notification_MobileCoin_ struct { - MobileCoin *DataMessage_Payment_Notification_MobileCoin `protobuf:"bytes,1,opt,name=mobileCoin,oneof"` -} - -func (*DataMessage_Payment_Notification_MobileCoin_) isDataMessage_Payment_Notification_Transaction() { -} - -type DataMessage_Payment_Activation struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type *DataMessage_Payment_Activation_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.DataMessage_Payment_Activation_Type" json:"type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Payment_Activation) Reset() { - *x = DataMessage_Payment_Activation{} - mi := &file_signalpb_SignalService_proto_msgTypes[45] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Payment_Activation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Payment_Activation) ProtoMessage() {} - -func (x *DataMessage_Payment_Activation) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[45] - 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_Payment_Activation.ProtoReflect.Descriptor instead. -func (*DataMessage_Payment_Activation) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0, 2} -} - -func (x *DataMessage_Payment_Activation) GetType() DataMessage_Payment_Activation_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return DataMessage_Payment_Activation_REQUEST -} - -type DataMessage_Payment_Amount_MobileCoin struct { - state protoimpl.MessageState `protogen:"open.v1"` - PicoMob *uint64 `protobuf:"varint,1,opt,name=picoMob" json:"picoMob,omitempty"` // 1,000,000,000,000 picoMob per Mob - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Payment_Amount_MobileCoin) Reset() { - *x = DataMessage_Payment_Amount_MobileCoin{} - mi := &file_signalpb_SignalService_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Payment_Amount_MobileCoin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Payment_Amount_MobileCoin) ProtoMessage() {} - -func (x *DataMessage_Payment_Amount_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[46] - 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_Payment_Amount_MobileCoin.ProtoReflect.Descriptor instead. -func (*DataMessage_Payment_Amount_MobileCoin) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0, 0, 0} -} - -func (x *DataMessage_Payment_Amount_MobileCoin) GetPicoMob() uint64 { - if x != nil && x.PicoMob != nil { - return *x.PicoMob - } - return 0 -} - -type DataMessage_Payment_Notification_MobileCoin struct { - state protoimpl.MessageState `protogen:"open.v1"` - Receipt []byte `protobuf:"bytes,1,opt,name=receipt" json:"receipt,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Payment_Notification_MobileCoin) Reset() { - *x = DataMessage_Payment_Notification_MobileCoin{} - mi := &file_signalpb_SignalService_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Payment_Notification_MobileCoin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Payment_Notification_MobileCoin) ProtoMessage() {} - -func (x *DataMessage_Payment_Notification_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[47] - 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_Payment_Notification_MobileCoin.ProtoReflect.Descriptor instead. -func (*DataMessage_Payment_Notification_MobileCoin) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 0, 1, 0} -} - -func (x *DataMessage_Payment_Notification_MobileCoin) GetReceipt() []byte { - if x != nil { - return x.Receipt - } - return nil -} - -type DataMessage_Quote_QuotedAttachment struct { - state protoimpl.MessageState `protogen:"open.v1"` - ContentType *string `protobuf:"bytes,1,opt,name=contentType" json:"contentType,omitempty"` - FileName *string `protobuf:"bytes,2,opt,name=fileName" json:"fileName,omitempty"` - Thumbnail *AttachmentPointer `protobuf:"bytes,3,opt,name=thumbnail" json:"thumbnail,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Quote_QuotedAttachment) Reset() { - *x = DataMessage_Quote_QuotedAttachment{} - mi := &file_signalpb_SignalService_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Quote_QuotedAttachment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Quote_QuotedAttachment) ProtoMessage() {} - -func (x *DataMessage_Quote_QuotedAttachment) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[48] - 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_Quote_QuotedAttachment.ProtoReflect.Descriptor instead. -func (*DataMessage_Quote_QuotedAttachment) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 1, 0} -} - -func (x *DataMessage_Quote_QuotedAttachment) GetContentType() string { - if x != nil && x.ContentType != nil { - return *x.ContentType - } - return "" -} - -func (x *DataMessage_Quote_QuotedAttachment) GetFileName() string { - if x != nil && x.FileName != nil { - return *x.FileName - } - return "" -} - -func (x *DataMessage_Quote_QuotedAttachment) GetThumbnail() *AttachmentPointer { - if x != nil { - return x.Thumbnail - } - return nil -} - -type DataMessage_Contact_Name struct { - state protoimpl.MessageState `protogen:"open.v1"` - GivenName *string `protobuf:"bytes,1,opt,name=givenName" json:"givenName,omitempty"` - FamilyName *string `protobuf:"bytes,2,opt,name=familyName" json:"familyName,omitempty"` - Prefix *string `protobuf:"bytes,3,opt,name=prefix" json:"prefix,omitempty"` - Suffix *string `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"` - MiddleName *string `protobuf:"bytes,5,opt,name=middleName" json:"middleName,omitempty"` - Nickname *string `protobuf:"bytes,7,opt,name=nickname" json:"nickname,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Contact_Name) Reset() { - *x = DataMessage_Contact_Name{} - mi := &file_signalpb_SignalService_proto_msgTypes[49] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Contact_Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Contact_Name) ProtoMessage() {} - -func (x *DataMessage_Contact_Name) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[49] - 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_Contact_Name.ProtoReflect.Descriptor instead. -func (*DataMessage_Contact_Name) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 0} -} - -func (x *DataMessage_Contact_Name) GetGivenName() string { - if x != nil && x.GivenName != nil { - return *x.GivenName - } - return "" -} - -func (x *DataMessage_Contact_Name) GetFamilyName() string { - if x != nil && x.FamilyName != nil { - return *x.FamilyName - } - return "" -} - -func (x *DataMessage_Contact_Name) GetPrefix() string { - if x != nil && x.Prefix != nil { - return *x.Prefix - } - return "" -} - -func (x *DataMessage_Contact_Name) GetSuffix() string { - if x != nil && x.Suffix != nil { - return *x.Suffix - } - return "" -} - -func (x *DataMessage_Contact_Name) GetMiddleName() string { - if x != nil && x.MiddleName != nil { - return *x.MiddleName - } - return "" -} - -func (x *DataMessage_Contact_Name) GetNickname() string { - if x != nil && x.Nickname != nil { - return *x.Nickname - } - return "" -} - -type DataMessage_Contact_Phone struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` - Type *DataMessage_Contact_Phone_Type `protobuf:"varint,2,opt,name=type,enum=signalservice.DataMessage_Contact_Phone_Type" json:"type,omitempty"` - Label *string `protobuf:"bytes,3,opt,name=label" json:"label,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Contact_Phone) Reset() { - *x = DataMessage_Contact_Phone{} - mi := &file_signalpb_SignalService_proto_msgTypes[50] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Contact_Phone) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Contact_Phone) ProtoMessage() {} - -func (x *DataMessage_Contact_Phone) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[50] - 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_Contact_Phone.ProtoReflect.Descriptor instead. -func (*DataMessage_Contact_Phone) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 1} -} - -func (x *DataMessage_Contact_Phone) GetValue() string { - if x != nil && x.Value != nil { - return *x.Value - } - return "" -} - -func (x *DataMessage_Contact_Phone) GetType() DataMessage_Contact_Phone_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return DataMessage_Contact_Phone_HOME -} - -func (x *DataMessage_Contact_Phone) GetLabel() string { - if x != nil && x.Label != nil { - return *x.Label - } - return "" -} - -type DataMessage_Contact_Email struct { - state protoimpl.MessageState `protogen:"open.v1"` - Value *string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` - Type *DataMessage_Contact_Email_Type `protobuf:"varint,2,opt,name=type,enum=signalservice.DataMessage_Contact_Email_Type" json:"type,omitempty"` - Label *string `protobuf:"bytes,3,opt,name=label" json:"label,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Contact_Email) Reset() { - *x = DataMessage_Contact_Email{} - mi := &file_signalpb_SignalService_proto_msgTypes[51] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Contact_Email) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Contact_Email) ProtoMessage() {} - -func (x *DataMessage_Contact_Email) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 DataMessage_Contact_Email.ProtoReflect.Descriptor instead. -func (*DataMessage_Contact_Email) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 2} -} - -func (x *DataMessage_Contact_Email) GetValue() string { - if x != nil && x.Value != nil { - return *x.Value - } - return "" -} - -func (x *DataMessage_Contact_Email) GetType() DataMessage_Contact_Email_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return DataMessage_Contact_Email_HOME -} - -func (x *DataMessage_Contact_Email) GetLabel() string { - if x != nil && x.Label != nil { - return *x.Label - } - return "" -} - -type DataMessage_Contact_PostalAddress struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type *DataMessage_Contact_PostalAddress_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.DataMessage_Contact_PostalAddress_Type" json:"type,omitempty"` - Label *string `protobuf:"bytes,2,opt,name=label" json:"label,omitempty"` - Street *string `protobuf:"bytes,3,opt,name=street" json:"street,omitempty"` - Pobox *string `protobuf:"bytes,4,opt,name=pobox" json:"pobox,omitempty"` - Neighborhood *string `protobuf:"bytes,5,opt,name=neighborhood" json:"neighborhood,omitempty"` - City *string `protobuf:"bytes,6,opt,name=city" json:"city,omitempty"` - Region *string `protobuf:"bytes,7,opt,name=region" json:"region,omitempty"` - Postcode *string `protobuf:"bytes,8,opt,name=postcode" json:"postcode,omitempty"` - Country *string `protobuf:"bytes,9,opt,name=country" json:"country,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Contact_PostalAddress) Reset() { - *x = DataMessage_Contact_PostalAddress{} - mi := &file_signalpb_SignalService_proto_msgTypes[52] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Contact_PostalAddress) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Contact_PostalAddress) ProtoMessage() {} - -func (x *DataMessage_Contact_PostalAddress) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 DataMessage_Contact_PostalAddress.ProtoReflect.Descriptor instead. -func (*DataMessage_Contact_PostalAddress) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 3} -} - -func (x *DataMessage_Contact_PostalAddress) GetType() DataMessage_Contact_PostalAddress_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return DataMessage_Contact_PostalAddress_HOME -} - -func (x *DataMessage_Contact_PostalAddress) GetLabel() string { - if x != nil && x.Label != nil { - return *x.Label - } - return "" -} - -func (x *DataMessage_Contact_PostalAddress) GetStreet() string { - if x != nil && x.Street != nil { - return *x.Street - } - return "" -} - -func (x *DataMessage_Contact_PostalAddress) GetPobox() string { - if x != nil && x.Pobox != nil { - return *x.Pobox - } - return "" -} - -func (x *DataMessage_Contact_PostalAddress) GetNeighborhood() string { - if x != nil && x.Neighborhood != nil { - return *x.Neighborhood - } - return "" -} - -func (x *DataMessage_Contact_PostalAddress) GetCity() string { - if x != nil && x.City != nil { - return *x.City - } - return "" -} - -func (x *DataMessage_Contact_PostalAddress) GetRegion() string { - if x != nil && x.Region != nil { - return *x.Region - } - return "" -} - -func (x *DataMessage_Contact_PostalAddress) GetPostcode() string { - if x != nil && x.Postcode != nil { - return *x.Postcode - } - return "" -} - -func (x *DataMessage_Contact_PostalAddress) GetCountry() string { - if x != nil && x.Country != nil { - return *x.Country - } - return "" -} - -type DataMessage_Contact_Avatar struct { - state protoimpl.MessageState `protogen:"open.v1"` - Avatar *AttachmentPointer `protobuf:"bytes,1,opt,name=avatar" json:"avatar,omitempty"` - IsProfile *bool `protobuf:"varint,2,opt,name=isProfile" json:"isProfile,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DataMessage_Contact_Avatar) Reset() { - *x = DataMessage_Contact_Avatar{} - mi := &file_signalpb_SignalService_proto_msgTypes[53] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DataMessage_Contact_Avatar) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DataMessage_Contact_Avatar) ProtoMessage() {} - -func (x *DataMessage_Contact_Avatar) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[53] - 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_Contact_Avatar.ProtoReflect.Descriptor instead. -func (*DataMessage_Contact_Avatar) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{3, 2, 4} -} - -func (x *DataMessage_Contact_Avatar) GetAvatar() *AttachmentPointer { - if x != nil { - return x.Avatar - } - return nil -} - -func (x *DataMessage_Contact_Avatar) GetIsProfile() bool { - if x != nil && x.IsProfile != nil { - return *x.IsProfile - } - return false -} - -type TextAttachment_Gradient struct { - state protoimpl.MessageState `protogen:"open.v1"` - StartColor *uint32 `protobuf:"varint,1,opt,name=startColor" json:"startColor,omitempty"` // deprecated: this field will be removed in a future release. - EndColor *uint32 `protobuf:"varint,2,opt,name=endColor" json:"endColor,omitempty"` // deprecated: this field will be removed in a future release. - Angle *uint32 `protobuf:"varint,3,opt,name=angle" json:"angle,omitempty"` // degrees - Colors []uint32 `protobuf:"varint,4,rep,name=colors" json:"colors,omitempty"` - Positions []float32 `protobuf:"fixed32,5,rep,name=positions" json:"positions,omitempty"` // percent from 0 to 1 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *TextAttachment_Gradient) Reset() { - *x = TextAttachment_Gradient{} - mi := &file_signalpb_SignalService_proto_msgTypes[54] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *TextAttachment_Gradient) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TextAttachment_Gradient) ProtoMessage() {} - -func (x *TextAttachment_Gradient) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[54] - 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 TextAttachment_Gradient.ProtoReflect.Descriptor instead. -func (*TextAttachment_Gradient) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{9, 0} -} - -func (x *TextAttachment_Gradient) GetStartColor() uint32 { - if x != nil && x.StartColor != nil { - return *x.StartColor - } - return 0 -} - -func (x *TextAttachment_Gradient) GetEndColor() uint32 { - if x != nil && x.EndColor != nil { - return *x.EndColor - } - return 0 -} - -func (x *TextAttachment_Gradient) GetAngle() uint32 { - if x != nil && x.Angle != nil { - return *x.Angle - } - return 0 -} - -func (x *TextAttachment_Gradient) GetColors() []uint32 { - if x != nil { - return x.Colors - } - return nil -} - -func (x *TextAttachment_Gradient) GetPositions() []float32 { - if x != nil { - return x.Positions - } - return nil -} - -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 -} - -// Default values for SyncMessage_Sent fields. -const ( - Default_SyncMessage_Sent_IsRecipientUpdate = bool(false) -) - -func (x *SyncMessage_Sent) Reset() { - *x = SyncMessage_Sent{} - mi := &file_signalpb_SignalService_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Sent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Sent) ProtoMessage() {} - -func (x *SyncMessage_Sent) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[55] - 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 SyncMessage_Sent.ProtoReflect.Descriptor instead. -func (*SyncMessage_Sent) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 0} -} - -func (x *SyncMessage_Sent) GetDestinationE164() string { - if x != nil && x.DestinationE164 != nil { - return *x.DestinationE164 - } - return "" -} - -func (x *SyncMessage_Sent) GetDestinationServiceId() string { - if x != nil && x.DestinationServiceId != nil { - return *x.DestinationServiceId - } - return "" -} - -func (x *SyncMessage_Sent) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -func (x *SyncMessage_Sent) GetMessage() *DataMessage { - if x != nil { - return x.Message - } - return nil -} - -func (x *SyncMessage_Sent) GetExpirationStartTimestamp() uint64 { - if x != nil && x.ExpirationStartTimestamp != nil { - return *x.ExpirationStartTimestamp - } - return 0 -} - -func (x *SyncMessage_Sent) GetUnidentifiedStatus() []*SyncMessage_Sent_UnidentifiedDeliveryStatus { - if x != nil { - return x.UnidentifiedStatus - } - return nil -} - -func (x *SyncMessage_Sent) GetIsRecipientUpdate() bool { - if x != nil && x.IsRecipientUpdate != nil { - return *x.IsRecipientUpdate - } - return Default_SyncMessage_Sent_IsRecipientUpdate -} - -func (x *SyncMessage_Sent) GetStoryMessage() *StoryMessage { - if x != nil { - return x.StoryMessage - } - return nil -} - -func (x *SyncMessage_Sent) GetStoryMessageRecipients() []*SyncMessage_Sent_StoryMessageRecipient { - if x != nil { - return x.StoryMessageRecipients - } - return nil -} - -func (x *SyncMessage_Sent) GetEditMessage() *EditMessage { - if x != nil { - return x.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"` - Complete *bool `protobuf:"varint,2,opt,name=complete,def=0" json:"complete,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -// Default values for SyncMessage_Contacts fields. -const ( - Default_SyncMessage_Contacts_Complete = bool(false) -) - -func (x *SyncMessage_Contacts) Reset() { - *x = SyncMessage_Contacts{} - mi := &file_signalpb_SignalService_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Contacts) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Contacts) ProtoMessage() {} - -func (x *SyncMessage_Contacts) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[56] - 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 SyncMessage_Contacts.ProtoReflect.Descriptor instead. -func (*SyncMessage_Contacts) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 1} -} - -func (x *SyncMessage_Contacts) GetBlob() *AttachmentPointer { - if x != nil { - return x.Blob - } - return nil -} - -func (x *SyncMessage_Contacts) GetComplete() bool { - if x != nil && x.Complete != nil { - return *x.Complete - } - return Default_SyncMessage_Contacts_Complete -} - -type SyncMessage_Blocked struct { - state protoimpl.MessageState `protogen:"open.v1"` - Numbers []string `protobuf:"bytes,1,rep,name=numbers" json:"numbers,omitempty"` // deprecated: this field will be removed in a future release. - Acis []string `protobuf:"bytes,3,rep,name=acis" json:"acis,omitempty"` - GroupIds [][]byte `protobuf:"bytes,2,rep,name=groupIds" json:"groupIds,omitempty"` // deprecated: this field will be removed in a future release. - AcisBinary [][]byte `protobuf:"bytes,4,rep,name=acisBinary" json:"acisBinary,omitempty"` // deprecated: this field will be removed in a future release. - BlockedE164S []*SyncMessage_Blocked_BlockedE164 `protobuf:"bytes,5,rep,name=blockedE164s" json:"blockedE164s,omitempty"` - BlockedAcis []*SyncMessage_Blocked_BlockedAci `protobuf:"bytes,6,rep,name=blockedAcis" json:"blockedAcis,omitempty"` - BlockedGroups []*SyncMessage_Blocked_BlockedGroup `protobuf:"bytes,7,rep,name=blockedGroups" json:"blockedGroups,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_Blocked) Reset() { - *x = SyncMessage_Blocked{} - mi := &file_signalpb_SignalService_proto_msgTypes[57] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Blocked) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Blocked) ProtoMessage() {} - -func (x *SyncMessage_Blocked) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[57] - 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 SyncMessage_Blocked.ProtoReflect.Descriptor instead. -func (*SyncMessage_Blocked) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 2} -} - -func (x *SyncMessage_Blocked) GetNumbers() []string { - if x != nil { - return x.Numbers - } - return nil -} - -func (x *SyncMessage_Blocked) GetAcis() []string { - if x != nil { - return x.Acis - } - return nil -} - -func (x *SyncMessage_Blocked) GetGroupIds() [][]byte { - if x != nil { - return x.GroupIds - } - return nil -} - -func (x *SyncMessage_Blocked) GetAcisBinary() [][]byte { - if x != nil { - return x.AcisBinary - } - return nil -} - -func (x *SyncMessage_Blocked) GetBlockedE164S() []*SyncMessage_Blocked_BlockedE164 { - if x != nil { - return x.BlockedE164S - } - return nil -} - -func (x *SyncMessage_Blocked) GetBlockedAcis() []*SyncMessage_Blocked_BlockedAci { - if x != nil { - return x.BlockedAcis - } - return nil -} - -func (x *SyncMessage_Blocked) GetBlockedGroups() []*SyncMessage_Blocked_BlockedGroup { - if x != nil { - return x.BlockedGroups - } - 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_Request) Reset() { - *x = SyncMessage_Request{} - mi := &file_signalpb_SignalService_proto_msgTypes[58] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Request) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Request) ProtoMessage() {} - -func (x *SyncMessage_Request) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[58] - 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 SyncMessage_Request.ProtoReflect.Descriptor instead. -func (*SyncMessage_Request) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 3} -} - -func (x *SyncMessage_Request) GetType() SyncMessage_Request_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return SyncMessage_Request_UNKNOWN -} - -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 -} - -func (x *SyncMessage_Read) Reset() { - *x = SyncMessage_Read{} - mi := &file_signalpb_SignalService_proto_msgTypes[59] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Read) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Read) ProtoMessage() {} - -func (x *SyncMessage_Read) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[59] - 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 SyncMessage_Read.ProtoReflect.Descriptor instead. -func (*SyncMessage_Read) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 4} -} - -func (x *SyncMessage_Read) GetSenderAci() string { - if x != nil && x.SenderAci != nil { - return *x.SenderAci - } - return "" -} - -func (x *SyncMessage_Read) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - 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 -} - -func (x *SyncMessage_Viewed) Reset() { - *x = SyncMessage_Viewed{} - mi := &file_signalpb_SignalService_proto_msgTypes[60] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Viewed) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Viewed) ProtoMessage() {} - -func (x *SyncMessage_Viewed) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[60] - 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 SyncMessage_Viewed.ProtoReflect.Descriptor instead. -func (*SyncMessage_Viewed) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 5} -} - -func (x *SyncMessage_Viewed) GetSenderAci() string { - if x != nil && x.SenderAci != nil { - return *x.SenderAci - } - return "" -} - -func (x *SyncMessage_Viewed) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - 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"` - LinkPreviews *bool `protobuf:"varint,6,opt,name=linkPreviews" json:"linkPreviews,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_Configuration) Reset() { - *x = SyncMessage_Configuration{} - mi := &file_signalpb_SignalService_proto_msgTypes[61] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Configuration) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Configuration) ProtoMessage() {} - -func (x *SyncMessage_Configuration) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[61] - 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 SyncMessage_Configuration.ProtoReflect.Descriptor instead. -func (*SyncMessage_Configuration) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 6} -} - -func (x *SyncMessage_Configuration) GetReadReceipts() bool { - if x != nil && x.ReadReceipts != nil { - return *x.ReadReceipts - } - return false -} - -func (x *SyncMessage_Configuration) GetUnidentifiedDeliveryIndicators() bool { - if x != nil && x.UnidentifiedDeliveryIndicators != nil { - return *x.UnidentifiedDeliveryIndicators - } - return false -} - -func (x *SyncMessage_Configuration) GetTypingIndicators() bool { - if x != nil && x.TypingIndicators != nil { - return *x.TypingIndicators - } - return false -} - -func (x *SyncMessage_Configuration) GetLinkPreviews() bool { - if x != nil && x.LinkPreviews != nil { - return *x.LinkPreviews - } - return false -} - -type SyncMessage_StickerPackOperation struct { - state protoimpl.MessageState `protogen:"open.v1"` - PackId []byte `protobuf:"bytes,1,opt,name=packId" json:"packId,omitempty"` - PackKey []byte `protobuf:"bytes,2,opt,name=packKey" json:"packKey,omitempty"` - Type *SyncMessage_StickerPackOperation_Type `protobuf:"varint,3,opt,name=type,enum=signalservice.SyncMessage_StickerPackOperation_Type" json:"type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_StickerPackOperation) Reset() { - *x = SyncMessage_StickerPackOperation{} - mi := &file_signalpb_SignalService_proto_msgTypes[62] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_StickerPackOperation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_StickerPackOperation) ProtoMessage() {} - -func (x *SyncMessage_StickerPackOperation) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[62] - 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 SyncMessage_StickerPackOperation.ProtoReflect.Descriptor instead. -func (*SyncMessage_StickerPackOperation) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 7} -} - -func (x *SyncMessage_StickerPackOperation) GetPackId() []byte { - if x != nil { - return x.PackId - } - return nil -} - -func (x *SyncMessage_StickerPackOperation) GetPackKey() []byte { - if x != nil { - return x.PackKey - } - return nil -} - -func (x *SyncMessage_StickerPackOperation) GetType() SyncMessage_StickerPackOperation_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return SyncMessage_StickerPackOperation_INSTALL -} - -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 -} - -func (x *SyncMessage_ViewOnceOpen) Reset() { - *x = SyncMessage_ViewOnceOpen{} - mi := &file_signalpb_SignalService_proto_msgTypes[63] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_ViewOnceOpen) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_ViewOnceOpen) ProtoMessage() {} - -func (x *SyncMessage_ViewOnceOpen) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[63] - 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 SyncMessage_ViewOnceOpen.ProtoReflect.Descriptor instead. -func (*SyncMessage_ViewOnceOpen) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 8} -} - -func (x *SyncMessage_ViewOnceOpen) GetSenderAci() string { - if x != nil && x.SenderAci != nil { - return *x.SenderAci - } - return "" -} - -func (x *SyncMessage_ViewOnceOpen) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - 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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_FetchLatest) Reset() { - *x = SyncMessage_FetchLatest{} - mi := &file_signalpb_SignalService_proto_msgTypes[64] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_FetchLatest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_FetchLatest) ProtoMessage() {} - -func (x *SyncMessage_FetchLatest) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[64] - 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 SyncMessage_FetchLatest.ProtoReflect.Descriptor instead. -func (*SyncMessage_FetchLatest) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 9} -} - -func (x *SyncMessage_FetchLatest) GetType() SyncMessage_FetchLatest_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return SyncMessage_FetchLatest_UNKNOWN -} - -type SyncMessage_Keys struct { - state protoimpl.MessageState `protogen:"open.v1"` - 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 - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_Keys) Reset() { - *x = SyncMessage_Keys{} - mi := &file_signalpb_SignalService_proto_msgTypes[65] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Keys) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Keys) ProtoMessage() {} - -func (x *SyncMessage_Keys) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[65] - 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 SyncMessage_Keys.ProtoReflect.Descriptor instead. -func (*SyncMessage_Keys) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 10} -} - -func (x *SyncMessage_Keys) GetAccountEntropyPool() string { - if x != nil && x.AccountEntropyPool != nil { - return *x.AccountEntropyPool - } - return "" -} - -func (x *SyncMessage_Keys) GetMediaRootBackupKey() []byte { - if x != nil { - return x.MediaRootBackupKey - } - return nil -} - -type SyncMessage_PniIdentity struct { - state protoimpl.MessageState `protogen:"open.v1"` - PublicKey []byte `protobuf:"bytes,1,opt,name=publicKey" json:"publicKey,omitempty"` - PrivateKey []byte `protobuf:"bytes,2,opt,name=privateKey" json:"privateKey,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_PniIdentity) Reset() { - *x = SyncMessage_PniIdentity{} - mi := &file_signalpb_SignalService_proto_msgTypes[66] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_PniIdentity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_PniIdentity) ProtoMessage() {} - -func (x *SyncMessage_PniIdentity) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[66] - 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 SyncMessage_PniIdentity.ProtoReflect.Descriptor instead. -func (*SyncMessage_PniIdentity) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 11} -} - -func (x *SyncMessage_PniIdentity) GetPublicKey() []byte { - if x != nil { - return x.PublicKey - } - return nil -} - -func (x *SyncMessage_PniIdentity) GetPrivateKey() []byte { - if x != nil { - return x.PrivateKey - } - return nil -} - -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 -} - -func (x *SyncMessage_MessageRequestResponse) Reset() { - *x = SyncMessage_MessageRequestResponse{} - mi := &file_signalpb_SignalService_proto_msgTypes[67] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_MessageRequestResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_MessageRequestResponse) ProtoMessage() {} - -func (x *SyncMessage_MessageRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[67] - 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 SyncMessage_MessageRequestResponse.ProtoReflect.Descriptor instead. -func (*SyncMessage_MessageRequestResponse) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 12} -} - -func (x *SyncMessage_MessageRequestResponse) GetThreadAci() string { - if x != nil && x.ThreadAci != nil { - return *x.ThreadAci - } - return "" -} - -func (x *SyncMessage_MessageRequestResponse) GetGroupId() []byte { - if x != nil { - return x.GroupId - } - return nil -} - -func (x *SyncMessage_MessageRequestResponse) GetType() SyncMessage_MessageRequestResponse_Type { - if x != nil && x.Type != nil { - return *x.Type - } - 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"` - Note *string `protobuf:"bytes,2,opt,name=note" json:"note,omitempty"` - // Types that are valid to be assigned to AttachmentIdentifier: - // - // *SyncMessage_OutgoingPayment_MobileCoin_ - AttachmentIdentifier isSyncMessage_OutgoingPayment_AttachmentIdentifier `protobuf_oneof:"attachment_identifier"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_OutgoingPayment) Reset() { - *x = SyncMessage_OutgoingPayment{} - mi := &file_signalpb_SignalService_proto_msgTypes[68] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_OutgoingPayment) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_OutgoingPayment) ProtoMessage() {} - -func (x *SyncMessage_OutgoingPayment) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[68] - 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 SyncMessage_OutgoingPayment.ProtoReflect.Descriptor instead. -func (*SyncMessage_OutgoingPayment) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 13} -} - -func (x *SyncMessage_OutgoingPayment) GetRecipientServiceId() string { - if x != nil && x.RecipientServiceId != nil { - return *x.RecipientServiceId - } - return "" -} - -func (x *SyncMessage_OutgoingPayment) GetNote() string { - if x != nil && x.Note != nil { - return *x.Note - } - return "" -} - -func (x *SyncMessage_OutgoingPayment) GetAttachmentIdentifier() isSyncMessage_OutgoingPayment_AttachmentIdentifier { - if x != nil { - return x.AttachmentIdentifier - } - return nil -} - -func (x *SyncMessage_OutgoingPayment) GetMobileCoin() *SyncMessage_OutgoingPayment_MobileCoin { - if x != nil { - if x, ok := x.AttachmentIdentifier.(*SyncMessage_OutgoingPayment_MobileCoin_); ok { - return x.MobileCoin - } - } - return nil -} - -type isSyncMessage_OutgoingPayment_AttachmentIdentifier interface { - isSyncMessage_OutgoingPayment_AttachmentIdentifier() -} - -type SyncMessage_OutgoingPayment_MobileCoin_ struct { - MobileCoin *SyncMessage_OutgoingPayment_MobileCoin `protobuf:"bytes,3,opt,name=mobileCoin,oneof"` -} - -func (*SyncMessage_OutgoingPayment_MobileCoin_) isSyncMessage_OutgoingPayment_AttachmentIdentifier() { -} - -type SyncMessage_PniChangeNumber struct { - state protoimpl.MessageState `protogen:"open.v1"` - IdentityKeyPair []byte `protobuf:"bytes,1,opt,name=identityKeyPair" json:"identityKeyPair,omitempty"` // Serialized libsignal-client IdentityKeyPair - SignedPreKey []byte `protobuf:"bytes,2,opt,name=signedPreKey" json:"signedPreKey,omitempty"` // Serialized libsignal-client SignedPreKeyRecord - LastResortKyberPreKey []byte `protobuf:"bytes,5,opt,name=lastResortKyberPreKey" json:"lastResortKyberPreKey,omitempty"` // Serialized libsignal-client KyberPreKeyRecord - RegistrationId *uint32 `protobuf:"varint,3,opt,name=registrationId" json:"registrationId,omitempty"` - NewE164 *string `protobuf:"bytes,4,opt,name=newE164" json:"newE164,omitempty"` // The e164 we have changed our number to - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_PniChangeNumber) Reset() { - *x = SyncMessage_PniChangeNumber{} - mi := &file_signalpb_SignalService_proto_msgTypes[69] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_PniChangeNumber) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_PniChangeNumber) ProtoMessage() {} - -func (x *SyncMessage_PniChangeNumber) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[69] - 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 SyncMessage_PniChangeNumber.ProtoReflect.Descriptor instead. -func (*SyncMessage_PniChangeNumber) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 14} -} - -func (x *SyncMessage_PniChangeNumber) GetIdentityKeyPair() []byte { - if x != nil { - return x.IdentityKeyPair - } - return nil -} - -func (x *SyncMessage_PniChangeNumber) GetSignedPreKey() []byte { - if x != nil { - return x.SignedPreKey - } - return nil -} - -func (x *SyncMessage_PniChangeNumber) GetLastResortKyberPreKey() []byte { - if x != nil { - return x.LastResortKyberPreKey - } - return nil -} - -func (x *SyncMessage_PniChangeNumber) GetRegistrationId() uint32 { - if x != nil && x.RegistrationId != nil { - return *x.RegistrationId - } - return 0 -} - -func (x *SyncMessage_PniChangeNumber) GetNewE164() string { - if x != nil && x.NewE164 != nil { - return *x.NewE164 - } - return "" -} - -type SyncMessage_CallEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Data identifying a conversation. The service ID for 1:1, the group ID for - // group, or the room ID for an ad-hoc call. See also - // `CallLogEvent/conversationId`. - ConversationId []byte `protobuf:"bytes,1,opt,name=conversationId" json:"conversationId,omitempty"` - // An identifier for a call. Generated directly for 1:1, or derived from - // the era ID for group and ad-hoc calls. See also `CallLogEvent/callId`. - CallId *uint64 `protobuf:"varint,2,opt,name=callId" json:"callId,omitempty"` - Timestamp *uint64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` - Type *SyncMessage_CallEvent_Type `protobuf:"varint,4,opt,name=type,enum=signalservice.SyncMessage_CallEvent_Type" json:"type,omitempty"` - Direction *SyncMessage_CallEvent_Direction `protobuf:"varint,5,opt,name=direction,enum=signalservice.SyncMessage_CallEvent_Direction" json:"direction,omitempty"` - Event *SyncMessage_CallEvent_Event `protobuf:"varint,6,opt,name=event,enum=signalservice.SyncMessage_CallEvent_Event" json:"event,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_CallEvent) Reset() { - *x = SyncMessage_CallEvent{} - mi := &file_signalpb_SignalService_proto_msgTypes[70] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_CallEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_CallEvent) ProtoMessage() {} - -func (x *SyncMessage_CallEvent) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[70] - 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 SyncMessage_CallEvent.ProtoReflect.Descriptor instead. -func (*SyncMessage_CallEvent) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 15} -} - -func (x *SyncMessage_CallEvent) GetConversationId() []byte { - if x != nil { - return x.ConversationId - } - return nil -} - -func (x *SyncMessage_CallEvent) GetCallId() uint64 { - if x != nil && x.CallId != nil { - return *x.CallId - } - return 0 -} - -func (x *SyncMessage_CallEvent) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -func (x *SyncMessage_CallEvent) GetType() SyncMessage_CallEvent_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return SyncMessage_CallEvent_UNKNOWN_TYPE -} - -func (x *SyncMessage_CallEvent) GetDirection() SyncMessage_CallEvent_Direction { - if x != nil && x.Direction != nil { - return *x.Direction - } - return SyncMessage_CallEvent_UNKNOWN_DIRECTION -} - -func (x *SyncMessage_CallEvent) GetEvent() SyncMessage_CallEvent_Event { - if x != nil && x.Event != nil { - return *x.Event - } - return SyncMessage_CallEvent_UNKNOWN_EVENT -} - -type SyncMessage_CallLinkUpdate struct { - state protoimpl.MessageState `protogen:"open.v1"` - 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 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_CallLinkUpdate) Reset() { - *x = SyncMessage_CallLinkUpdate{} - mi := &file_signalpb_SignalService_proto_msgTypes[71] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_CallLinkUpdate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_CallLinkUpdate) ProtoMessage() {} - -func (x *SyncMessage_CallLinkUpdate) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[71] - 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 SyncMessage_CallLinkUpdate.ProtoReflect.Descriptor instead. -func (*SyncMessage_CallLinkUpdate) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 16} -} - -func (x *SyncMessage_CallLinkUpdate) GetRootKey() []byte { - if x != nil { - return x.RootKey - } - return nil -} - -func (x *SyncMessage_CallLinkUpdate) GetAdminPasskey() []byte { - if x != nil { - return x.AdminPasskey - } - return nil -} - -func (x *SyncMessage_CallLinkUpdate) GetType() SyncMessage_CallLinkUpdate_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return SyncMessage_CallLinkUpdate_UPDATE -} - -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"` - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - // Data identifying a conversation. The service ID for 1:1, the group ID for - // group, or the room ID for an ad-hoc call. See also - // `CallEvent/conversationId`. - ConversationId []byte `protobuf:"bytes,3,opt,name=conversationId" json:"conversationId,omitempty"` - // An identifier for a call. Generated directly for 1:1, or derived from - // the era ID for group and ad-hoc calls. See also `CallEvent/callId`. - CallId *uint64 `protobuf:"varint,4,opt,name=callId" json:"callId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_CallLogEvent) Reset() { - *x = SyncMessage_CallLogEvent{} - mi := &file_signalpb_SignalService_proto_msgTypes[72] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_CallLogEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_CallLogEvent) ProtoMessage() {} - -func (x *SyncMessage_CallLogEvent) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[72] - 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 SyncMessage_CallLogEvent.ProtoReflect.Descriptor instead. -func (*SyncMessage_CallLogEvent) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 17} -} - -func (x *SyncMessage_CallLogEvent) GetType() SyncMessage_CallLogEvent_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return SyncMessage_CallLogEvent_CLEAR -} - -func (x *SyncMessage_CallLogEvent) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -func (x *SyncMessage_CallLogEvent) GetConversationId() []byte { - if x != nil { - return x.ConversationId - } - return nil -} - -func (x *SyncMessage_CallLogEvent) GetCallId() uint64 { - if x != nil && x.CallId != nil { - return *x.CallId - } - return 0 -} - -type SyncMessage_DeleteForMe struct { - state protoimpl.MessageState `protogen:"open.v1"` - MessageDeletes []*SyncMessage_DeleteForMe_MessageDeletes `protobuf:"bytes,1,rep,name=messageDeletes" json:"messageDeletes,omitempty"` - ConversationDeletes []*SyncMessage_DeleteForMe_ConversationDelete `protobuf:"bytes,2,rep,name=conversationDeletes" json:"conversationDeletes,omitempty"` - LocalOnlyConversationDeletes []*SyncMessage_DeleteForMe_LocalOnlyConversationDelete `protobuf:"bytes,3,rep,name=localOnlyConversationDeletes" json:"localOnlyConversationDeletes,omitempty"` - AttachmentDeletes []*SyncMessage_DeleteForMe_AttachmentDelete `protobuf:"bytes,4,rep,name=attachmentDeletes" json:"attachmentDeletes,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_DeleteForMe) Reset() { - *x = SyncMessage_DeleteForMe{} - mi := &file_signalpb_SignalService_proto_msgTypes[73] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_DeleteForMe) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_DeleteForMe) ProtoMessage() {} - -func (x *SyncMessage_DeleteForMe) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[73] - 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 SyncMessage_DeleteForMe.ProtoReflect.Descriptor instead. -func (*SyncMessage_DeleteForMe) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 18} -} - -func (x *SyncMessage_DeleteForMe) GetMessageDeletes() []*SyncMessage_DeleteForMe_MessageDeletes { - if x != nil { - return x.MessageDeletes - } - return nil -} - -func (x *SyncMessage_DeleteForMe) GetConversationDeletes() []*SyncMessage_DeleteForMe_ConversationDelete { - if x != nil { - return x.ConversationDeletes - } - return nil -} - -func (x *SyncMessage_DeleteForMe) GetLocalOnlyConversationDeletes() []*SyncMessage_DeleteForMe_LocalOnlyConversationDelete { - if x != nil { - return x.LocalOnlyConversationDeletes - } - return nil -} - -func (x *SyncMessage_DeleteForMe) GetAttachmentDeletes() []*SyncMessage_DeleteForMe_AttachmentDelete { - if x != nil { - return x.AttachmentDeletes - } - return nil -} - -type SyncMessage_DeviceNameChange struct { - state protoimpl.MessageState `protogen:"open.v1"` - DeviceId *uint32 `protobuf:"varint,2,opt,name=deviceId" json:"deviceId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_DeviceNameChange) Reset() { - *x = SyncMessage_DeviceNameChange{} - mi := &file_signalpb_SignalService_proto_msgTypes[74] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_DeviceNameChange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_DeviceNameChange) ProtoMessage() {} - -func (x *SyncMessage_DeviceNameChange) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[74] - 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 SyncMessage_DeviceNameChange.ProtoReflect.Descriptor instead. -func (*SyncMessage_DeviceNameChange) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 19} -} - -func (x *SyncMessage_DeviceNameChange) GetDeviceId() uint32 { - if x != nil && x.DeviceId != nil { - return *x.DeviceId - } - return 0 -} - -type SyncMessage_AttachmentBackfillRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetMessage *AddressableMessage `protobuf:"bytes,1,opt,name=targetMessage" json:"targetMessage,omitempty"` - TargetConversation *ConversationIdentifier `protobuf:"bytes,2,opt,name=targetConversation" json:"targetConversation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_AttachmentBackfillRequest) Reset() { - *x = SyncMessage_AttachmentBackfillRequest{} - mi := &file_signalpb_SignalService_proto_msgTypes[75] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_AttachmentBackfillRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_AttachmentBackfillRequest) ProtoMessage() {} - -func (x *SyncMessage_AttachmentBackfillRequest) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[75] - 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 SyncMessage_AttachmentBackfillRequest.ProtoReflect.Descriptor instead. -func (*SyncMessage_AttachmentBackfillRequest) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 20} -} - -func (x *SyncMessage_AttachmentBackfillRequest) GetTargetMessage() *AddressableMessage { - if x != nil { - return x.TargetMessage - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillRequest) GetTargetConversation() *ConversationIdentifier { - if x != nil { - return x.TargetConversation - } - return nil -} - -type SyncMessage_AttachmentBackfillResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - TargetMessage *AddressableMessage `protobuf:"bytes,1,opt,name=targetMessage" json:"targetMessage,omitempty"` - TargetConversation *ConversationIdentifier `protobuf:"bytes,2,opt,name=targetConversation" json:"targetConversation,omitempty"` - // Types that are valid to be assigned to Data: - // - // *SyncMessage_AttachmentBackfillResponse_Attachments - // *SyncMessage_AttachmentBackfillResponse_Error_ - Data isSyncMessage_AttachmentBackfillResponse_Data `protobuf_oneof:"data"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_AttachmentBackfillResponse) Reset() { - *x = SyncMessage_AttachmentBackfillResponse{} - mi := &file_signalpb_SignalService_proto_msgTypes[76] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_AttachmentBackfillResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_AttachmentBackfillResponse) ProtoMessage() {} - -func (x *SyncMessage_AttachmentBackfillResponse) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[76] - 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 SyncMessage_AttachmentBackfillResponse.ProtoReflect.Descriptor instead. -func (*SyncMessage_AttachmentBackfillResponse) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 21} -} - -func (x *SyncMessage_AttachmentBackfillResponse) GetTargetMessage() *AddressableMessage { - if x != nil { - return x.TargetMessage - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillResponse) GetTargetConversation() *ConversationIdentifier { - if x != nil { - return x.TargetConversation - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillResponse) GetData() isSyncMessage_AttachmentBackfillResponse_Data { - if x != nil { - return x.Data - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillResponse) GetAttachments() *SyncMessage_AttachmentBackfillResponse_AttachmentDataList { - if x != nil { - if x, ok := x.Data.(*SyncMessage_AttachmentBackfillResponse_Attachments); ok { - return x.Attachments - } - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillResponse) GetError() SyncMessage_AttachmentBackfillResponse_Error { - if x != nil { - if x, ok := x.Data.(*SyncMessage_AttachmentBackfillResponse_Error_); ok { - return x.Error - } - } - return SyncMessage_AttachmentBackfillResponse_MESSAGE_NOT_FOUND -} - -type isSyncMessage_AttachmentBackfillResponse_Data interface { - isSyncMessage_AttachmentBackfillResponse_Data() -} - -type SyncMessage_AttachmentBackfillResponse_Attachments struct { - Attachments *SyncMessage_AttachmentBackfillResponse_AttachmentDataList `protobuf:"bytes,3,opt,name=attachments,oneof"` -} - -type SyncMessage_AttachmentBackfillResponse_Error_ struct { - Error SyncMessage_AttachmentBackfillResponse_Error `protobuf:"varint,4,opt,name=error,enum=signalservice.SyncMessage_AttachmentBackfillResponse_Error,oneof"` -} - -func (*SyncMessage_AttachmentBackfillResponse_Attachments) isSyncMessage_AttachmentBackfillResponse_Data() { -} - -func (*SyncMessage_AttachmentBackfillResponse_Error_) isSyncMessage_AttachmentBackfillResponse_Data() { -} - -type SyncMessage_UsernameChange struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_UsernameChange) Reset() { - *x = SyncMessage_UsernameChange{} - mi := &file_signalpb_SignalService_proto_msgTypes[77] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_UsernameChange) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_UsernameChange) ProtoMessage() {} - -func (x *SyncMessage_UsernameChange) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[77] - 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 SyncMessage_UsernameChange.ProtoReflect.Descriptor instead. -func (*SyncMessage_UsernameChange) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 22} -} - -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 -} - -func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) Reset() { - *x = SyncMessage_Sent_UnidentifiedDeliveryStatus{} - mi := &file_signalpb_SignalService_proto_msgTypes[78] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Sent_UnidentifiedDeliveryStatus) ProtoMessage() {} - -func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[78] - 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 SyncMessage_Sent_UnidentifiedDeliveryStatus.ProtoReflect.Descriptor instead. -func (*SyncMessage_Sent_UnidentifiedDeliveryStatus) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 0, 0} -} - -func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) GetDestinationServiceId() string { - if x != nil && x.DestinationServiceId != nil { - return *x.DestinationServiceId - } - return "" -} - -func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) GetUnidentified() bool { - if x != nil && x.Unidentified != nil { - return *x.Unidentified - } - return false -} - -func (x *SyncMessage_Sent_UnidentifiedDeliveryStatus) GetDestinationPniIdentityKey() []byte { - if x != nil { - return x.DestinationPniIdentityKey - } - 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 -} - -func (x *SyncMessage_Sent_StoryMessageRecipient) Reset() { - *x = SyncMessage_Sent_StoryMessageRecipient{} - mi := &file_signalpb_SignalService_proto_msgTypes[79] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Sent_StoryMessageRecipient) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Sent_StoryMessageRecipient) ProtoMessage() {} - -func (x *SyncMessage_Sent_StoryMessageRecipient) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[79] - 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 SyncMessage_Sent_StoryMessageRecipient.ProtoReflect.Descriptor instead. -func (*SyncMessage_Sent_StoryMessageRecipient) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 0, 1} -} - -func (x *SyncMessage_Sent_StoryMessageRecipient) GetDestinationServiceId() string { - if x != nil && x.DestinationServiceId != nil { - return *x.DestinationServiceId - } - return "" -} - -func (x *SyncMessage_Sent_StoryMessageRecipient) GetDistributionListIds() []string { - if x != nil { - return x.DistributionListIds - } - return nil -} - -func (x *SyncMessage_Sent_StoryMessageRecipient) GetIsAllowedToReply() bool { - if x != nil && x.IsAllowedToReply != nil { - return *x.IsAllowedToReply - } - return false -} - -func (x *SyncMessage_Sent_StoryMessageRecipient) GetDestinationServiceIdBinary() []byte { - if x != nil { - return x.DestinationServiceIdBinary - } - return nil -} - -type SyncMessage_Blocked_BlockedE164 struct { - state protoimpl.MessageState `protogen:"open.v1"` - E164 *string `protobuf:"bytes,1,opt,name=e164" json:"e164,omitempty"` - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_Blocked_BlockedE164) Reset() { - *x = SyncMessage_Blocked_BlockedE164{} - mi := &file_signalpb_SignalService_proto_msgTypes[80] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Blocked_BlockedE164) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Blocked_BlockedE164) ProtoMessage() {} - -func (x *SyncMessage_Blocked_BlockedE164) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 SyncMessage_Blocked_BlockedE164.ProtoReflect.Descriptor instead. -func (*SyncMessage_Blocked_BlockedE164) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 2, 0} -} - -func (x *SyncMessage_Blocked_BlockedE164) GetE164() string { - if x != nil && x.E164 != nil { - return *x.E164 - } - return "" -} - -func (x *SyncMessage_Blocked_BlockedE164) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -type SyncMessage_Blocked_BlockedAci struct { - state protoimpl.MessageState `protogen:"open.v1"` - AciBinary []byte `protobuf:"bytes,1,opt,name=aciBinary" json:"aciBinary,omitempty"` // 16-byte UUID - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_Blocked_BlockedAci) Reset() { - *x = SyncMessage_Blocked_BlockedAci{} - mi := &file_signalpb_SignalService_proto_msgTypes[81] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Blocked_BlockedAci) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Blocked_BlockedAci) ProtoMessage() {} - -func (x *SyncMessage_Blocked_BlockedAci) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 SyncMessage_Blocked_BlockedAci.ProtoReflect.Descriptor instead. -func (*SyncMessage_Blocked_BlockedAci) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 2, 1} -} - -func (x *SyncMessage_Blocked_BlockedAci) GetAciBinary() []byte { - if x != nil { - return x.AciBinary - } - return nil -} - -func (x *SyncMessage_Blocked_BlockedAci) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -type SyncMessage_Blocked_BlockedGroup struct { - state protoimpl.MessageState `protogen:"open.v1"` - GroupId []byte `protobuf:"bytes,1,opt,name=groupId" json:"groupId,omitempty"` - Timestamp *uint64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_Blocked_BlockedGroup) Reset() { - *x = SyncMessage_Blocked_BlockedGroup{} - mi := &file_signalpb_SignalService_proto_msgTypes[82] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_Blocked_BlockedGroup) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_Blocked_BlockedGroup) ProtoMessage() {} - -func (x *SyncMessage_Blocked_BlockedGroup) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[82] - 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 SyncMessage_Blocked_BlockedGroup.ProtoReflect.Descriptor instead. -func (*SyncMessage_Blocked_BlockedGroup) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 2, 2} -} - -func (x *SyncMessage_Blocked_BlockedGroup) GetGroupId() []byte { - if x != nil { - return x.GroupId - } - return nil -} - -func (x *SyncMessage_Blocked_BlockedGroup) GetTimestamp() uint64 { - if x != nil && x.Timestamp != nil { - return *x.Timestamp - } - return 0 -} - -type SyncMessage_OutgoingPayment_MobileCoin struct { - state protoimpl.MessageState `protogen:"open.v1"` - RecipientAddress []byte `protobuf:"bytes,1,opt,name=recipientAddress" json:"recipientAddress,omitempty"` - AmountPicoMob *uint64 `protobuf:"varint,2,opt,name=amountPicoMob" json:"amountPicoMob,omitempty"` - FeePicoMob *uint64 `protobuf:"varint,3,opt,name=feePicoMob" json:"feePicoMob,omitempty"` - Receipt []byte `protobuf:"bytes,4,opt,name=receipt" json:"receipt,omitempty"` - LedgerBlockTimestamp *uint64 `protobuf:"varint,5,opt,name=ledgerBlockTimestamp" json:"ledgerBlockTimestamp,omitempty"` - LedgerBlockIndex *uint64 `protobuf:"varint,6,opt,name=ledgerBlockIndex" json:"ledgerBlockIndex,omitempty"` - SpentKeyImages [][]byte `protobuf:"bytes,7,rep,name=spentKeyImages" json:"spentKeyImages,omitempty"` - OutputPublicKeys [][]byte `protobuf:"bytes,8,rep,name=outputPublicKeys" json:"outputPublicKeys,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) Reset() { - *x = SyncMessage_OutgoingPayment_MobileCoin{} - mi := &file_signalpb_SignalService_proto_msgTypes[83] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_OutgoingPayment_MobileCoin) ProtoMessage() {} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[83] - 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 SyncMessage_OutgoingPayment_MobileCoin.ProtoReflect.Descriptor instead. -func (*SyncMessage_OutgoingPayment_MobileCoin) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 13, 0} -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetRecipientAddress() []byte { - if x != nil { - return x.RecipientAddress - } - return nil -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetAmountPicoMob() uint64 { - if x != nil && x.AmountPicoMob != nil { - return *x.AmountPicoMob - } - return 0 -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetFeePicoMob() uint64 { - if x != nil && x.FeePicoMob != nil { - return *x.FeePicoMob - } - return 0 -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetReceipt() []byte { - if x != nil { - return x.Receipt - } - return nil -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetLedgerBlockTimestamp() uint64 { - if x != nil && x.LedgerBlockTimestamp != nil { - return *x.LedgerBlockTimestamp - } - return 0 -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetLedgerBlockIndex() uint64 { - if x != nil && x.LedgerBlockIndex != nil { - return *x.LedgerBlockIndex - } - return 0 -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetSpentKeyImages() [][]byte { - if x != nil { - return x.SpentKeyImages - } - return nil -} - -func (x *SyncMessage_OutgoingPayment_MobileCoin) GetOutputPublicKeys() [][]byte { - if x != nil { - return x.OutputPublicKeys - } - return nil -} - -type SyncMessage_DeleteForMe_MessageDeletes struct { - state protoimpl.MessageState `protogen:"open.v1"` - Conversation *ConversationIdentifier `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"` - Messages []*AddressableMessage `protobuf:"bytes,2,rep,name=messages" json:"messages,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_DeleteForMe_MessageDeletes) Reset() { - *x = SyncMessage_DeleteForMe_MessageDeletes{} - mi := &file_signalpb_SignalService_proto_msgTypes[84] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_DeleteForMe_MessageDeletes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_DeleteForMe_MessageDeletes) ProtoMessage() {} - -func (x *SyncMessage_DeleteForMe_MessageDeletes) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[84] - 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 SyncMessage_DeleteForMe_MessageDeletes.ProtoReflect.Descriptor instead. -func (*SyncMessage_DeleteForMe_MessageDeletes) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 18, 0} -} - -func (x *SyncMessage_DeleteForMe_MessageDeletes) GetConversation() *ConversationIdentifier { - if x != nil { - return x.Conversation - } - return nil -} - -func (x *SyncMessage_DeleteForMe_MessageDeletes) GetMessages() []*AddressableMessage { - if x != nil { - return x.Messages - } - return nil -} - -type SyncMessage_DeleteForMe_AttachmentDelete struct { - state protoimpl.MessageState `protogen:"open.v1"` - Conversation *ConversationIdentifier `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"` - TargetMessage *AddressableMessage `protobuf:"bytes,2,opt,name=targetMessage" json:"targetMessage,omitempty"` - // The `clientUuid` from `AttachmentPointer`. - ClientUuid []byte `protobuf:"bytes,3,opt,name=clientUuid" json:"clientUuid,omitempty"` - // SHA256 hash of the (encrypted, padded, etc.) attachment blob on the CDN. - FallbackDigest []byte `protobuf:"bytes,4,opt,name=fallbackDigest" json:"fallbackDigest,omitempty"` - // SHA256 hash of the plaintext content of the attachment. - FallbackPlaintextHash []byte `protobuf:"bytes,5,opt,name=fallbackPlaintextHash" json:"fallbackPlaintextHash,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) Reset() { - *x = SyncMessage_DeleteForMe_AttachmentDelete{} - mi := &file_signalpb_SignalService_proto_msgTypes[85] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_DeleteForMe_AttachmentDelete) ProtoMessage() {} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[85] - 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 SyncMessage_DeleteForMe_AttachmentDelete.ProtoReflect.Descriptor instead. -func (*SyncMessage_DeleteForMe_AttachmentDelete) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 18, 1} -} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) GetConversation() *ConversationIdentifier { - if x != nil { - return x.Conversation - } - return nil -} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) GetTargetMessage() *AddressableMessage { - if x != nil { - return x.TargetMessage - } - return nil -} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) GetClientUuid() []byte { - if x != nil { - return x.ClientUuid - } - return nil -} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) GetFallbackDigest() []byte { - if x != nil { - return x.FallbackDigest - } - return nil -} - -func (x *SyncMessage_DeleteForMe_AttachmentDelete) GetFallbackPlaintextHash() []byte { - if x != nil { - return x.FallbackPlaintextHash - } - return nil -} - -type SyncMessage_DeleteForMe_ConversationDelete struct { - state protoimpl.MessageState `protogen:"open.v1"` - Conversation *ConversationIdentifier `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"` - MostRecentMessages []*AddressableMessage `protobuf:"bytes,2,rep,name=mostRecentMessages" json:"mostRecentMessages,omitempty"` - IsFullDelete *bool `protobuf:"varint,3,opt,name=isFullDelete" json:"isFullDelete,omitempty"` - MostRecentNonExpiringMessages []*AddressableMessage `protobuf:"bytes,4,rep,name=mostRecentNonExpiringMessages" json:"mostRecentNonExpiringMessages,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_DeleteForMe_ConversationDelete) Reset() { - *x = SyncMessage_DeleteForMe_ConversationDelete{} - mi := &file_signalpb_SignalService_proto_msgTypes[86] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_DeleteForMe_ConversationDelete) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_DeleteForMe_ConversationDelete) ProtoMessage() {} - -func (x *SyncMessage_DeleteForMe_ConversationDelete) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[86] - 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 SyncMessage_DeleteForMe_ConversationDelete.ProtoReflect.Descriptor instead. -func (*SyncMessage_DeleteForMe_ConversationDelete) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 18, 2} -} - -func (x *SyncMessage_DeleteForMe_ConversationDelete) GetConversation() *ConversationIdentifier { - if x != nil { - return x.Conversation - } - return nil -} - -func (x *SyncMessage_DeleteForMe_ConversationDelete) GetMostRecentMessages() []*AddressableMessage { - if x != nil { - return x.MostRecentMessages - } - return nil -} - -func (x *SyncMessage_DeleteForMe_ConversationDelete) GetIsFullDelete() bool { - if x != nil && x.IsFullDelete != nil { - return *x.IsFullDelete - } - return false -} - -func (x *SyncMessage_DeleteForMe_ConversationDelete) GetMostRecentNonExpiringMessages() []*AddressableMessage { - if x != nil { - return x.MostRecentNonExpiringMessages - } - return nil -} - -type SyncMessage_DeleteForMe_LocalOnlyConversationDelete struct { - state protoimpl.MessageState `protogen:"open.v1"` - Conversation *ConversationIdentifier `protobuf:"bytes,1,opt,name=conversation" json:"conversation,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_DeleteForMe_LocalOnlyConversationDelete) Reset() { - *x = SyncMessage_DeleteForMe_LocalOnlyConversationDelete{} - mi := &file_signalpb_SignalService_proto_msgTypes[87] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_DeleteForMe_LocalOnlyConversationDelete) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_DeleteForMe_LocalOnlyConversationDelete) ProtoMessage() {} - -func (x *SyncMessage_DeleteForMe_LocalOnlyConversationDelete) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 SyncMessage_DeleteForMe_LocalOnlyConversationDelete.ProtoReflect.Descriptor instead. -func (*SyncMessage_DeleteForMe_LocalOnlyConversationDelete) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 18, 3} -} - -func (x *SyncMessage_DeleteForMe_LocalOnlyConversationDelete) GetConversation() *ConversationIdentifier { - if x != nil { - return x.Conversation - } - return nil -} - -type SyncMessage_AttachmentBackfillResponse_AttachmentData struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Data: - // - // *SyncMessage_AttachmentBackfillResponse_AttachmentData_Attachment - // *SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_ - Data isSyncMessage_AttachmentBackfillResponse_AttachmentData_Data `protobuf_oneof:"data"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) Reset() { - *x = SyncMessage_AttachmentBackfillResponse_AttachmentData{} - mi := &file_signalpb_SignalService_proto_msgTypes[88] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_AttachmentBackfillResponse_AttachmentData) ProtoMessage() {} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[88] - 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 SyncMessage_AttachmentBackfillResponse_AttachmentData.ProtoReflect.Descriptor instead. -func (*SyncMessage_AttachmentBackfillResponse_AttachmentData) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 21, 0} -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) GetData() isSyncMessage_AttachmentBackfillResponse_AttachmentData_Data { - if x != nil { - return x.Data - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) GetAttachment() *AttachmentPointer { - if x != nil { - if x, ok := x.Data.(*SyncMessage_AttachmentBackfillResponse_AttachmentData_Attachment); ok { - return x.Attachment - } - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentData) GetStatus() SyncMessage_AttachmentBackfillResponse_AttachmentData_Status { - if x != nil { - if x, ok := x.Data.(*SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_); ok { - return x.Status - } - } - return SyncMessage_AttachmentBackfillResponse_AttachmentData_PENDING -} - -type isSyncMessage_AttachmentBackfillResponse_AttachmentData_Data interface { - isSyncMessage_AttachmentBackfillResponse_AttachmentData_Data() -} - -type SyncMessage_AttachmentBackfillResponse_AttachmentData_Attachment struct { - Attachment *AttachmentPointer `protobuf:"bytes,1,opt,name=attachment,oneof"` -} - -type SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_ struct { - Status SyncMessage_AttachmentBackfillResponse_AttachmentData_Status `protobuf:"varint,2,opt,name=status,enum=signalservice.SyncMessage_AttachmentBackfillResponse_AttachmentData_Status,oneof"` -} - -func (*SyncMessage_AttachmentBackfillResponse_AttachmentData_Attachment) isSyncMessage_AttachmentBackfillResponse_AttachmentData_Data() { -} - -func (*SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_) isSyncMessage_AttachmentBackfillResponse_AttachmentData_Data() { -} - -type SyncMessage_AttachmentBackfillResponse_AttachmentDataList struct { - state protoimpl.MessageState `protogen:"open.v1"` - Attachments []*SyncMessage_AttachmentBackfillResponse_AttachmentData `protobuf:"bytes,1,rep,name=attachments" json:"attachments,omitempty"` - LongText *SyncMessage_AttachmentBackfillResponse_AttachmentData `protobuf:"bytes,2,opt,name=longText" json:"longText,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) Reset() { - *x = SyncMessage_AttachmentBackfillResponse_AttachmentDataList{} - mi := &file_signalpb_SignalService_proto_msgTypes[89] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncMessage_AttachmentBackfillResponse_AttachmentDataList) ProtoMessage() {} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[89] - 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 SyncMessage_AttachmentBackfillResponse_AttachmentDataList.ProtoReflect.Descriptor instead. -func (*SyncMessage_AttachmentBackfillResponse_AttachmentDataList) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{11, 21, 1} -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) GetAttachments() []*SyncMessage_AttachmentBackfillResponse_AttachmentData { - if x != nil { - return x.Attachments - } - return nil -} - -func (x *SyncMessage_AttachmentBackfillResponse_AttachmentDataList) GetLongText() *SyncMessage_AttachmentBackfillResponse_AttachmentData { - if x != nil { - return x.LongText - } - return nil -} - -type ContactDetails_Avatar struct { - state protoimpl.MessageState `protogen:"open.v1"` - ContentType *string `protobuf:"bytes,1,opt,name=contentType" json:"contentType,omitempty"` - Length *uint32 `protobuf:"varint,2,opt,name=length" json:"length,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactDetails_Avatar) Reset() { - *x = ContactDetails_Avatar{} - mi := &file_signalpb_SignalService_proto_msgTypes[90] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactDetails_Avatar) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactDetails_Avatar) ProtoMessage() {} - -func (x *ContactDetails_Avatar) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_proto_msgTypes[90] - 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 ContactDetails_Avatar.ProtoReflect.Descriptor instead. -func (*ContactDetails_Avatar) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{14, 0} -} - -func (x *ContactDetails_Avatar) GetContentType() string { - if x != nil && x.ContentType != nil { - return *x.ContentType - } - return "" -} - -func (x *ContactDetails_Avatar) GetLength() uint32 { - if x != nil && x.Length != nil { - return *x.Length - } - return 0 -} - -type PaymentAddress_MobileCoin struct { - state protoimpl.MessageState `protogen:"open.v1"` - PublicAddress []byte `protobuf:"bytes,1,opt,name=publicAddress" json:"publicAddress,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *PaymentAddress_MobileCoin) Reset() { - *x = PaymentAddress_MobileCoin{} - mi := &file_signalpb_SignalService_proto_msgTypes[91] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *PaymentAddress_MobileCoin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PaymentAddress_MobileCoin) ProtoMessage() {} - -func (x *PaymentAddress_MobileCoin) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_SignalService_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 PaymentAddress_MobileCoin.ProtoReflect.Descriptor instead. -func (*PaymentAddress_MobileCoin) Descriptor() ([]byte, []int) { - return file_signalpb_SignalService_proto_rawDescGZIP(), []int{15, 0} -} - -func (x *PaymentAddress_MobileCoin) GetPublicAddress() []byte { - if x != nil { - return x.PublicAddress - } - return nil -} - -func (x *PaymentAddress_MobileCoin) GetSignature() []byte { - if x != nil { - return x.Signature - } - return nil -} - -var File_signalpb_SignalService_proto protoreflect.FileDescriptor - -const file_signalpb_SignalService_proto_rawDesc = "" + - "\n" + - "\x1csignalpb/SignalService.proto\x12\rsignalservice\"\x8c\a\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" + - "\acontent\x18\b \x01(\fR\acontent\x12\x1e\n" + - "\n" + - "serverGuid\x18\t \x01(\tR\n" + - "serverGuid\x12(\n" + - "\x0fserverTimestamp\x18\n" + - " \x01(\x04R\x0fserverTimestamp\x12\x1c\n" + - "\tephemeral\x18\f \x01(\bR\tephemeral\x12\x1c\n" + - "\x06urgent\x18\x0e \x01(\b:\x04trueR\x06urgent\x12\x1e\n" + - "\n" + - "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" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\x12\n" + - "\x0eDOUBLE_RATCHET\x10\x01\x12\x12\n" + - "\x0ePREKEY_MESSAGE\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" + - "\x13pniSignatureMessage\x18\n" + - " \x01(\v2\".signalservice.PniSignatureMessageR\x13pniSignatureMessageB\t\n" + - "\acontent\"\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" + - "\ticeUpdate\x18\x03 \x03(\v2$.signalservice.CallMessage.IceUpdateR\ticeUpdate\x123\n" + - "\x04busy\x18\x05 \x01(\v2\x1f.signalservice.CallMessage.BusyR\x04busy\x129\n" + - "\x06hangup\x18\a \x01(\v2!.signalservice.CallMessage.HangupR\x06hangup\x120\n" + - "\x13destinationDeviceId\x18\t \x01(\rR\x13destinationDeviceId\x129\n" + - "\x06opaque\x18\n" + - " \x01(\v2!.signalservice.CallMessage.OpaqueR\x06opaque\x1a\xaa\x01\n" + - "\x05Offer\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x129\n" + - "\x04type\x18\x03 \x01(\x0e2%.signalservice.CallMessage.Offer.TypeR\x04type\x12\x16\n" + - "\x06opaque\x18\x04 \x01(\fR\x06opaque\"8\n" + - "\x04Type\x12\x14\n" + - "\x10OFFER_AUDIO_CALL\x10\x00\x12\x14\n" + - "\x10OFFER_VIDEO_CALL\x10\x01\"\x04\b\x02\x10\x02J\x04\b\x02\x10\x03\x1a6\n" + - "\x06Answer\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x12\x16\n" + - "\x06opaque\x18\x03 \x01(\fR\x06opaqueJ\x04\b\x02\x10\x03\x1aE\n" + - "\tIceUpdate\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x12\x16\n" + - "\x06opaque\x18\x05 \x01(\fR\x06opaqueJ\x04\b\x02\x10\x03J\x04\b\x03\x10\x04J\x04\b\x04\x10\x05\x1a\x16\n" + - "\x04Busy\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x1a\xe2\x01\n" + - "\x06Hangup\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x12:\n" + - "\x04type\x18\x02 \x01(\x0e2&.signalservice.CallMessage.Hangup.TypeR\x04type\x12\x1a\n" + - "\bdeviceId\x18\x03 \x01(\rR\bdeviceId\"p\n" + - "\x04Type\x12\x11\n" + - "\rHANGUP_NORMAL\x10\x00\x12\x13\n" + - "\x0fHANGUP_ACCEPTED\x10\x01\x12\x13\n" + - "\x0fHANGUP_DECLINED\x10\x02\x12\x0f\n" + - "\vHANGUP_BUSY\x10\x03\x12\x1a\n" + - "\x16HANGUP_NEED_PERMISSION\x10\x04\x1a\x93\x01\n" + - "\x06Opaque\x12\x12\n" + - "\x04data\x18\x01 \x01(\fR\x04data\x12C\n" + - "\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\"\x80.\n" + - "\vDataMessage\x12\x12\n" + - "\x04body\x18\x01 \x01(\tR\x04body\x12B\n" + - "\vattachments\x18\x02 \x03(\v2 .signalservice.AttachmentPointerR\vattachments\x127\n" + - "\agroupV2\x18\x0f \x01(\v2\x1d.signalservice.GroupContextV2R\agroupV2\x12\x14\n" + - "\x05flags\x18\x04 \x01(\rR\x05flags\x12 \n" + - "\vexpireTimer\x18\x05 \x01(\rR\vexpireTimer\x12.\n" + - "\x12expireTimerVersion\x18\x17 \x01(\rR\x12expireTimerVersion\x12\x1e\n" + - "\n" + - "profileKey\x18\x06 \x01(\fR\n" + - "profileKey\x12\x1c\n" + - "\ttimestamp\x18\a \x01(\x04R\ttimestamp\x126\n" + - "\x05quote\x18\b \x01(\v2 .signalservice.DataMessage.QuoteR\x05quote\x12<\n" + - "\acontact\x18\t \x03(\v2\".signalservice.DataMessage.ContactR\acontact\x120\n" + - "\apreview\x18\n" + - " \x03(\v2\x16.signalservice.PreviewR\apreview\x12<\n" + - "\asticker\x18\v \x01(\v2\".signalservice.DataMessage.StickerR\asticker\x128\n" + - "\x17requiredProtocolVersion\x18\f \x01(\rR\x17requiredProtocolVersion\x12\x1e\n" + - "\n" + - "isViewOnce\x18\x0e \x01(\bR\n" + - "isViewOnce\x12?\n" + - "\breaction\x18\x10 \x01(\v2#.signalservice.DataMessage.ReactionR\breaction\x129\n" + - "\x06delete\x18\x11 \x01(\v2!.signalservice.DataMessage.DeleteR\x06delete\x128\n" + - "\n" + - "bodyRanges\x18\x12 \x03(\v2\x18.signalservice.BodyRangeR\n" + - "bodyRanges\x12T\n" + - "\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" + - "\aPayment\x12U\n" + - "\fnotification\x18\x01 \x01(\v2/.signalservice.DataMessage.Payment.NotificationH\x00R\fnotification\x12O\n" + - "\n" + - "activation\x18\x02 \x01(\v2-.signalservice.DataMessage.Payment.ActivationH\x00R\n" + - "activation\x1a\x92\x01\n" + - "\x06Amount\x12V\n" + - "\n" + - "mobileCoin\x18\x01 \x01(\v24.signalservice.DataMessage.Payment.Amount.MobileCoinH\x00R\n" + - "mobileCoin\x1a&\n" + - "\n" + - "MobileCoin\x12\x18\n" + - "\apicoMob\x18\x01 \x01(\x04R\apicoMobB\b\n" + - "\x06Amount\x1a\xbf\x01\n" + - "\fNotification\x12\\\n" + - "\n" + - "mobileCoin\x18\x01 \x01(\v2:.signalservice.DataMessage.Payment.Notification.MobileCoinH\x00R\n" + - "mobileCoin\x12\x12\n" + - "\x04note\x18\x02 \x01(\tR\x04note\x1a&\n" + - "\n" + - "MobileCoin\x12\x18\n" + - "\areceipt\x18\x01 \x01(\fR\areceiptB\r\n" + - "\vTransactionJ\x06\b\xeb\a\x10\xec\a\x1ax\n" + - "\n" + - "Activation\x12F\n" + - "\x04type\x18\x01 \x01(\x0e22.signalservice.DataMessage.Payment.Activation.TypeR\x04type\"\"\n" + - "\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" + - "\x05Quote\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x12\x1c\n" + - "\tauthorAci\x18\x05 \x01(\tR\tauthorAci\x12\x12\n" + - "\x04text\x18\x03 \x01(\tR\x04text\x12S\n" + - "\vattachments\x18\x04 \x03(\v21.signalservice.DataMessage.Quote.QuotedAttachmentR\vattachments\x128\n" + - "\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" + - "\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" + - "\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" + - "\n" + - "\aContact\x12;\n" + - "\x04name\x18\x01 \x01(\v2'.signalservice.DataMessage.Contact.NameR\x04name\x12@\n" + - "\x06number\x18\x03 \x03(\v2(.signalservice.DataMessage.Contact.PhoneR\x06number\x12>\n" + - "\x05email\x18\x04 \x03(\v2(.signalservice.DataMessage.Contact.EmailR\x05email\x12J\n" + - "\aaddress\x18\x05 \x03(\v20.signalservice.DataMessage.Contact.PostalAddressR\aaddress\x12A\n" + - "\x06avatar\x18\x06 \x01(\v2).signalservice.DataMessage.Contact.AvatarR\x06avatar\x12\"\n" + - "\forganization\x18\a \x01(\tR\forganization\x1a\xb6\x01\n" + - "\x04Name\x12\x1c\n" + - "\tgivenName\x18\x01 \x01(\tR\tgivenName\x12\x1e\n" + - "\n" + - "familyName\x18\x02 \x01(\tR\n" + - "familyName\x12\x16\n" + - "\x06prefix\x18\x03 \x01(\tR\x06prefix\x12\x16\n" + - "\x06suffix\x18\x04 \x01(\tR\x06suffix\x12\x1e\n" + - "\n" + - "middleName\x18\x05 \x01(\tR\n" + - "middleName\x12\x1a\n" + - "\bnickname\x18\a \x01(\tR\bnicknameJ\x04\b\x06\x10\a\x1a\xaa\x01\n" + - "\x05Phone\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12A\n" + - "\x04type\x18\x02 \x01(\x0e2-.signalservice.DataMessage.Contact.Phone.TypeR\x04type\x12\x14\n" + - "\x05label\x18\x03 \x01(\tR\x05label\"2\n" + - "\x04Type\x12\b\n" + - "\x04HOME\x10\x01\x12\n" + - "\n" + - "\x06MOBILE\x10\x02\x12\b\n" + - "\x04WORK\x10\x03\x12\n" + - "\n" + - "\x06CUSTOM\x10\x04\x1a\xaa\x01\n" + - "\x05Email\x12\x14\n" + - "\x05value\x18\x01 \x01(\tR\x05value\x12A\n" + - "\x04type\x18\x02 \x01(\x0e2-.signalservice.DataMessage.Contact.Email.TypeR\x04type\x12\x14\n" + - "\x05label\x18\x03 \x01(\tR\x05label\"2\n" + - "\x04Type\x12\b\n" + - "\x04HOME\x10\x01\x12\n" + - "\n" + - "\x06MOBILE\x10\x02\x12\b\n" + - "\x04WORK\x10\x03\x12\n" + - "\n" + - "\x06CUSTOM\x10\x04\x1a\xcc\x02\n" + - "\rPostalAddress\x12I\n" + - "\x04type\x18\x01 \x01(\x0e25.signalservice.DataMessage.Contact.PostalAddress.TypeR\x04type\x12\x14\n" + - "\x05label\x18\x02 \x01(\tR\x05label\x12\x16\n" + - "\x06street\x18\x03 \x01(\tR\x06street\x12\x14\n" + - "\x05pobox\x18\x04 \x01(\tR\x05pobox\x12\"\n" + - "\fneighborhood\x18\x05 \x01(\tR\fneighborhood\x12\x12\n" + - "\x04city\x18\x06 \x01(\tR\x04city\x12\x16\n" + - "\x06region\x18\a \x01(\tR\x06region\x12\x1a\n" + - "\bpostcode\x18\b \x01(\tR\bpostcode\x12\x18\n" + - "\acountry\x18\t \x01(\tR\acountry\"&\n" + - "\x04Type\x12\b\n" + - "\x04HOME\x10\x01\x12\b\n" + - "\x04WORK\x10\x02\x12\n" + - "\n" + - "\x06CUSTOM\x10\x03\x1a`\n" + - "\x06Avatar\x128\n" + - "\x06avatar\x18\x01 \x01(\v2 .signalservice.AttachmentPointerR\x06avatar\x12\x1c\n" + - "\tisProfile\x18\x02 \x01(\bR\tisProfile\x1a\xa5\x01\n" + - "\aSticker\x12\x16\n" + - "\x06packId\x18\x01 \x01(\fR\x06packId\x12\x18\n" + - "\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" + - "\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" + - "\x06Delete\x120\n" + - "\x13targetSentTimestamp\x18\x01 \x01(\x04R\x13targetSentTimestamp\x1a'\n" + - "\x0fGroupCallUpdate\x12\x14\n" + - "\x05eraId\x18\x01 \x01(\tR\x05eraId\x1a|\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" + - "\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\"O\n" + - "\x05Flags\x12\x1b\n" + - "\x17EXPIRATION_TIMER_UPDATE\x10\x02\x12\x16\n" + - "\x12PROFILE_KEY_UPDATE\x10\x04\x12\v\n" + - "\aFORWARD\x10\b\"\x04\b\x01\x10\x01\"\xbb\x01\n" + - "\x0fProtocolVersion\x12\v\n" + - "\aINITIAL\x10\x00\x12\x12\n" + - "\x0eMESSAGE_TIMERS\x10\x01\x12\r\n" + - "\tVIEW_ONCE\x10\x02\x12\x13\n" + - "\x0fVIEW_ONCE_VIDEO\x10\x03\x12\r\n" + - "\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" + - "\vNullMessage\x12\x18\n" + - "\apadding\x18\x01 \x01(\fR\apadding\"\x92\x01\n" + - "\x0eReceiptMessage\x126\n" + - "\x04type\x18\x01 \x01(\x0e2\".signalservice.ReceiptMessage.TypeR\x04type\x12\x1c\n" + - "\ttimestamp\x18\x02 \x03(\x04R\ttimestamp\"*\n" + - "\x04Type\x12\f\n" + - "\bDELIVERY\x10\x00\x12\b\n" + - "\x04READ\x10\x01\x12\n" + - "\n" + - "\x06VIEWED\x10\x02\"\xa8\x01\n" + - "\rTypingMessage\x12\x1c\n" + - "\ttimestamp\x18\x01 \x01(\x04R\ttimestamp\x12;\n" + - "\x06action\x18\x02 \x01(\x0e2#.signalservice.TypingMessage.ActionR\x06action\x12\x18\n" + - "\agroupId\x18\x03 \x01(\fR\agroupId\"\"\n" + - "\x06Action\x12\v\n" + - "\aSTARTED\x10\x00\x12\v\n" + - "\aSTOPPED\x10\x01\"\xe6\x02\n" + - "\fStoryMessage\x12\x1e\n" + - "\n" + - "profileKey\x18\x01 \x01(\fR\n" + - "profileKey\x123\n" + - "\x05group\x18\x02 \x01(\v2\x1d.signalservice.GroupContextV2R\x05group\x12J\n" + - "\x0efileAttachment\x18\x03 \x01(\v2 .signalservice.AttachmentPointerH\x00R\x0efileAttachment\x12G\n" + - "\x0etextAttachment\x18\x04 \x01(\v2\x1d.signalservice.TextAttachmentH\x00R\x0etextAttachment\x12$\n" + - "\rallowsReplies\x18\x05 \x01(\bR\rallowsReplies\x128\n" + - "\n" + - "bodyRanges\x18\x06 \x03(\v2\x18.signalservice.BodyRangeR\n" + - "bodyRangesB\f\n" + - "\n" + - "attachment\"\x9f\x01\n" + - "\aPreview\x12\x10\n" + - "\x03url\x18\x01 \x01(\tR\x03url\x12\x14\n" + - "\x05title\x18\x02 \x01(\tR\x05title\x126\n" + - "\x05image\x18\x03 \x01(\v2 .signalservice.AttachmentPointerR\x05image\x12 \n" + - "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x12\n" + - "\x04date\x18\x05 \x01(\x04R\x04date\"\xd1\x04\n" + - "\x0eTextAttachment\x12\x12\n" + - "\x04text\x18\x01 \x01(\tR\x04text\x12A\n" + - "\ttextStyle\x18\x02 \x01(\x0e2#.signalservice.TextAttachment.StyleR\ttextStyle\x120\n" + - "\x13textForegroundColor\x18\x03 \x01(\rR\x13textForegroundColor\x120\n" + - "\x13textBackgroundColor\x18\x04 \x01(\rR\x13textBackgroundColor\x120\n" + - "\apreview\x18\x05 \x01(\v2\x16.signalservice.PreviewR\apreview\x12D\n" + - "\bgradient\x18\x06 \x01(\v2&.signalservice.TextAttachment.GradientH\x00R\bgradient\x12\x16\n" + - "\x05color\x18\a \x01(\rH\x00R\x05color\x1a\x92\x01\n" + - "\bGradient\x12\x1e\n" + - "\n" + - "startColor\x18\x01 \x01(\rR\n" + - "startColor\x12\x1a\n" + - "\bendColor\x18\x02 \x01(\rR\bendColor\x12\x14\n" + - "\x05angle\x18\x03 \x01(\rR\x05angle\x12\x16\n" + - "\x06colors\x18\x04 \x03(\rR\x06colors\x12\x1c\n" + - "\tpositions\x18\x05 \x03(\x02R\tpositions\"Q\n" + - "\x05Style\x12\v\n" + - "\aDEFAULT\x10\x00\x12\v\n" + - "\aREGULAR\x10\x01\x12\b\n" + - "\x04BOLD\x10\x02\x12\t\n" + - "\x05SERIF\x10\x03\x12\n" + - "\n" + - "\x06SCRIPT\x10\x04\x12\r\n" + - "\tCONDENSED\x10\x05B\f\n" + - "\n" + - "background\"\x99\x02\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" + - "\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\"\xa8K\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\x12S\n" + - "\x0eusernameChange\x18\x1a \x01(\v2).signalservice.SyncMessage.UsernameChangeH\x00R\x0eusernameChange\x123\n" + - "\x04read\x18\x05 \x03(\v2\x1f.signalservice.SyncMessage.ReadR\x04read\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" + - "\x04Sent\x12(\n" + - "\x0fdestinationE164\x18\x01 \x01(\tR\x0fdestinationE164\x122\n" + - "\x14destinationServiceId\x18\a \x01(\tR\x14destinationServiceId\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x124\n" + - "\amessage\x18\x03 \x01(\v2\x1a.signalservice.DataMessageR\amessage\x12:\n" + - "\x18expirationStartTimestamp\x18\x04 \x01(\x04R\x18expirationStartTimestamp\x12j\n" + - "\x12unidentifiedStatus\x18\x05 \x03(\v2:.signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatusR\x12unidentifiedStatus\x123\n" + - "\x11isRecipientUpdate\x18\x06 \x01(\b:\x05falseR\x11isRecipientUpdate\x12?\n" + - "\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" + - "\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" + - "\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" + - "\bContacts\x124\n" + - "\x04blob\x18\x01 \x01(\v2 .signalservice.AttachmentPointerR\x04blob\x12!\n" + - "\bcomplete\x18\x02 \x01(\b:\x05falseR\bcomplete\x1a\xc2\x04\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\x12R\n" + - "\fblockedE164s\x18\x05 \x03(\v2..signalservice.SyncMessage.Blocked.BlockedE164R\fblockedE164s\x12O\n" + - "\vblockedAcis\x18\x06 \x03(\v2-.signalservice.SyncMessage.Blocked.BlockedAciR\vblockedAcis\x12U\n" + - "\rblockedGroups\x18\a \x03(\v2/.signalservice.SyncMessage.Blocked.BlockedGroupR\rblockedGroups\x1a?\n" + - "\vBlockedE164\x12\x12\n" + - "\x04e164\x18\x01 \x01(\tR\x04e164\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x1aH\n" + - "\n" + - "BlockedAci\x12\x1c\n" + - "\taciBinary\x18\x01 \x01(\fR\taciBinary\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x1aF\n" + - "\fBlockedGroup\x12\x18\n" + - "\agroupId\x18\x01 \x01(\fR\agroupId\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x1a\x9f\x01\n" + - "\aRequest\x12;\n" + - "\x04type\x18\x01 \x01(\x0e2'.signalservice.SyncMessage.Request.TypeR\x04type\"W\n" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\f\n" + - "\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" + - "\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" + - "\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" + - "\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" + - "\x14StickerPackOperation\x12\x16\n" + - "\x06packId\x18\x01 \x01(\fR\x06packId\x12\x18\n" + - "\apackKey\x18\x02 \x01(\fR\apackKey\x12H\n" + - "\x04type\x18\x03 \x01(\x0e24.signalservice.SyncMessage.StickerPackOperation.TypeR\x04type\"\x1f\n" + - "\x04Type\x12\v\n" + - "\aINSTALL\x10\x00\x12\n" + - "\n" + - "\x06REMOVE\x10\x01\x1az\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" + - "\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" + - "\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" + - "\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" + - "\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\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\n" + - "\n" + - "\x06ACCEPT\x10\x01\x12\n" + - "\n" + - "\x06DELETE\x10\x02\x12\t\n" + - "\x05BLOCK\x10\x03\x12\x14\n" + - "\x10BLOCK_AND_DELETE\x10\x04\x12\b\n" + - "\x04SPAM\x10\x05\x12\x12\n" + - "\x0eBLOCK_AND_SPAM\x10\x06J\x04\b\x01\x10\x02\x1a\x96\x04\n" + - "\x0fOutgoingPayment\x12.\n" + - "\x12recipientServiceId\x18\x01 \x01(\tR\x12recipientServiceId\x12\x12\n" + - "\x04note\x18\x02 \x01(\tR\x04note\x12W\n" + - "\n" + - "mobileCoin\x18\x03 \x01(\v25.signalservice.SyncMessage.OutgoingPayment.MobileCoinH\x00R\n" + - "mobileCoin\x1a\xcc\x02\n" + - "\n" + - "MobileCoin\x12*\n" + - "\x10recipientAddress\x18\x01 \x01(\fR\x10recipientAddress\x12$\n" + - "\ramountPicoMob\x18\x02 \x01(\x04R\ramountPicoMob\x12\x1e\n" + - "\n" + - "feePicoMob\x18\x03 \x01(\x04R\n" + - "feePicoMob\x12\x18\n" + - "\areceipt\x18\x04 \x01(\fR\areceipt\x122\n" + - "\x14ledgerBlockTimestamp\x18\x05 \x01(\x04R\x14ledgerBlockTimestamp\x12*\n" + - "\x10ledgerBlockIndex\x18\x06 \x01(\x04R\x10ledgerBlockIndex\x12&\n" + - "\x0espentKeyImages\x18\a \x03(\fR\x0espentKeyImages\x12*\n" + - "\x10outputPublicKeys\x18\b \x03(\fR\x10outputPublicKeysB\x17\n" + - "\x15attachment_identifier\x1a\xd7\x01\n" + - "\x0fPniChangeNumber\x12(\n" + - "\x0fidentityKeyPair\x18\x01 \x01(\fR\x0fidentityKeyPair\x12\"\n" + - "\fsignedPreKey\x18\x02 \x01(\fR\fsignedPreKey\x124\n" + - "\x15lastResortKyberPreKey\x18\x05 \x01(\fR\x15lastResortKyberPreKey\x12&\n" + - "\x0eregistrationId\x18\x03 \x01(\rR\x0eregistrationId\x12\x18\n" + - "\anewE164\x18\x04 \x01(\tR\anewE164\x1a\xa9\x04\n" + - "\tCallEvent\x12&\n" + - "\x0econversationId\x18\x01 \x01(\fR\x0econversationId\x12\x16\n" + - "\x06callId\x18\x02 \x01(\x04R\x06callId\x12\x1c\n" + - "\ttimestamp\x18\x03 \x01(\x04R\ttimestamp\x12=\n" + - "\x04type\x18\x04 \x01(\x0e2).signalservice.SyncMessage.CallEvent.TypeR\x04type\x12L\n" + - "\tdirection\x18\x05 \x01(\x0e2..signalservice.SyncMessage.CallEvent.DirectionR\tdirection\x12@\n" + - "\x05event\x18\x06 \x01(\x0e2*.signalservice.SyncMessage.CallEvent.EventR\x05event\"Y\n" + - "\x04Type\x12\x10\n" + - "\fUNKNOWN_TYPE\x10\x00\x12\x0e\n" + - "\n" + - "AUDIO_CALL\x10\x01\x12\x0e\n" + - "\n" + - "VIDEO_CALL\x10\x02\x12\x0e\n" + - "\n" + - "GROUP_CALL\x10\x03\x12\x0f\n" + - "\vAD_HOC_CALL\x10\x04\">\n" + - "\tDirection\x12\x15\n" + - "\x11UNKNOWN_DIRECTION\x10\x00\x12\f\n" + - "\bINCOMING\x10\x01\x12\f\n" + - "\bOUTGOING\x10\x02\"T\n" + - "\x05Event\x12\x11\n" + - "\rUNKNOWN_EVENT\x10\x00\x12\f\n" + - "\bACCEPTED\x10\x01\x12\x10\n" + - "\fNOT_ACCEPTED\x10\x02\x12\n" + - "\n" + - "\x06DELETE\x10\x03\x12\f\n" + - "\bOBSERVED\x10\x04\x1a\xb2\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\x12\n" + - "\n" + - "\x06UPDATE\x10\x00\"\x04\b\x01\x10\x01J\x04\b\x04\x10\x05\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" + - "\x0econversationId\x18\x03 \x01(\fR\x0econversationId\x12\x16\n" + - "\x06callId\x18\x04 \x01(\x04R\x06callId\"d\n" + - "\x04Type\x12\t\n" + - "\x05CLEAR\x10\x00\x12\x12\n" + - "\x0eMARKED_AS_READ\x10\x01\x12\"\n" + - "\x1eMARKED_AS_READ_IN_CONVERSATION\x10\x02\x12\x19\n" + - "\x15CLEAR_IN_CONVERSATION\x10\x03\x1a\xb9\n" + - "\n" + - "\vDeleteForMe\x12]\n" + - "\x0emessageDeletes\x18\x01 \x03(\v25.signalservice.SyncMessage.DeleteForMe.MessageDeletesR\x0emessageDeletes\x12k\n" + - "\x13conversationDeletes\x18\x02 \x03(\v29.signalservice.SyncMessage.DeleteForMe.ConversationDeleteR\x13conversationDeletes\x12\x86\x01\n" + - "\x1clocalOnlyConversationDeletes\x18\x03 \x03(\v2B.signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDeleteR\x1clocalOnlyConversationDeletes\x12e\n" + - "\x11attachmentDeletes\x18\x04 \x03(\v27.signalservice.SyncMessage.DeleteForMe.AttachmentDeleteR\x11attachmentDeletes\x1a\x9a\x01\n" + - "\x0eMessageDeletes\x12I\n" + - "\fconversation\x18\x01 \x01(\v2%.signalservice.ConversationIdentifierR\fconversation\x12=\n" + - "\bmessages\x18\x02 \x03(\v2!.signalservice.AddressableMessageR\bmessages\x1a\xa4\x02\n" + - "\x10AttachmentDelete\x12I\n" + - "\fconversation\x18\x01 \x01(\v2%.signalservice.ConversationIdentifierR\fconversation\x12G\n" + - "\rtargetMessage\x18\x02 \x01(\v2!.signalservice.AddressableMessageR\rtargetMessage\x12\x1e\n" + - "\n" + - "clientUuid\x18\x03 \x01(\fR\n" + - "clientUuid\x12&\n" + - "\x0efallbackDigest\x18\x04 \x01(\fR\x0efallbackDigest\x124\n" + - "\x15fallbackPlaintextHash\x18\x05 \x01(\fR\x15fallbackPlaintextHash\x1a\xbf\x02\n" + - "\x12ConversationDelete\x12I\n" + - "\fconversation\x18\x01 \x01(\v2%.signalservice.ConversationIdentifierR\fconversation\x12Q\n" + - "\x12mostRecentMessages\x18\x02 \x03(\v2!.signalservice.AddressableMessageR\x12mostRecentMessages\x12\"\n" + - "\fisFullDelete\x18\x03 \x01(\bR\fisFullDelete\x12g\n" + - "\x1dmostRecentNonExpiringMessages\x18\x04 \x03(\v2!.signalservice.AddressableMessageR\x1dmostRecentNonExpiringMessages\x1ah\n" + - "\x1bLocalOnlyConversationDelete\x12I\n" + - "\fconversation\x18\x01 \x01(\v2%.signalservice.ConversationIdentifierR\fconversation\x1a4\n" + - "\x10DeviceNameChange\x12\x1a\n" + - "\bdeviceId\x18\x02 \x01(\rR\bdeviceIdJ\x04\b\x01\x10\x02\x1a\xbb\x01\n" + - "\x19AttachmentBackfillRequest\x12G\n" + - "\rtargetMessage\x18\x01 \x01(\v2!.signalservice.AddressableMessageR\rtargetMessage\x12U\n" + - "\x12targetConversation\x18\x02 \x01(\v2%.signalservice.ConversationIdentifierR\x12targetConversation\x1a\xf9\x06\n" + - "\x1aAttachmentBackfillResponse\x12G\n" + - "\rtargetMessage\x18\x01 \x01(\v2!.signalservice.AddressableMessageR\rtargetMessage\x12U\n" + - "\x12targetConversation\x18\x02 \x01(\v2%.signalservice.ConversationIdentifierR\x12targetConversation\x12l\n" + - "\vattachments\x18\x03 \x01(\v2H.signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataListH\x00R\vattachments\x12S\n" + - "\x05error\x18\x04 \x01(\x0e2;.signalservice.SyncMessage.AttachmentBackfillResponse.ErrorH\x00R\x05error\x1a\xee\x01\n" + - "\x0eAttachmentData\x12B\n" + - "\n" + - "attachment\x18\x01 \x01(\v2 .signalservice.AttachmentPointerH\x00R\n" + - "attachment\x12e\n" + - "\x06status\x18\x02 \x01(\x0e2K.signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.StatusH\x00R\x06status\")\n" + - "\x06Status\x12\v\n" + - "\aPENDING\x10\x00\x12\x12\n" + - "\x0eTERMINAL_ERROR\x10\x01B\x06\n" + - "\x04data\x1a\xde\x01\n" + - "\x12AttachmentDataList\x12f\n" + - "\vattachments\x18\x01 \x03(\v2D.signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataR\vattachments\x12`\n" + - "\blongText\x18\x02 \x01(\v2D.signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataR\blongText\"\x1e\n" + - "\x05Error\x12\x15\n" + - "\x11MESSAGE_NOT_FOUND\x10\x00B\x06\n" + - "\x04data\x1a\x10\n" + - "\x0eUsernameChangeB\t\n" + - "\acontentJ\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" + - "\n" + - "clientUuid\x18\x14 \x01(\fR\n" + - "clientUuid\x12 \n" + - "\vcontentType\x18\x02 \x01(\tR\vcontentType\x12\x10\n" + - "\x03key\x18\x03 \x01(\fR\x03key\x12\x12\n" + - "\x04size\x18\x04 \x01(\rR\x04size\x12\x1c\n" + - "\tthumbnail\x18\x05 \x01(\fR\tthumbnail\x12\x16\n" + - "\x06digest\x18\x06 \x01(\fR\x06digest\x12&\n" + - "\x0eincrementalMac\x18\x13 \x01(\fR\x0eincrementalMac\x12\x1c\n" + - "\tchunkSize\x18\x11 \x01(\rR\tchunkSize\x12\x1a\n" + - "\bfileName\x18\a \x01(\tR\bfileName\x12\x14\n" + - "\x05flags\x18\b \x01(\rR\x05flags\x12\x14\n" + - "\x05width\x18\t \x01(\rR\x05width\x12\x16\n" + - "\x06height\x18\n" + - " \x01(\rR\x06height\x12\x18\n" + - "\acaption\x18\v \x01(\tR\acaption\x12\x1a\n" + - "\bblurHash\x18\f \x01(\tR\bblurHash\x12(\n" + - "\x0fuploadTimestamp\x18\r \x01(\x04R\x0fuploadTimestamp\x12\x1c\n" + - "\tcdnNumber\x18\x0e \x01(\rR\tcdnNumber\"9\n" + - "\x05Flags\x12\x11\n" + - "\rVOICE_MESSAGE\x10\x01\x12\x0e\n" + - "\n" + - "BORDERLESS\x10\x02\x12\a\n" + - "\x03GIF\x10\b\"\x04\b\x04\x10\x04B\x17\n" + - "\x15attachment_identifierJ\x04\b\x10\x10\x11J\x04\b\x12\x10\x13\"l\n" + - "\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" + - "\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" + - "\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" + - "\x12expireTimerVersion\x18\f \x01(\rR\x12expireTimerVersion\x12$\n" + - "\rinboxPosition\x18\n" + - " \x01(\rR\rinboxPosition\x1aB\n" + - "\x06Avatar\x12 \n" + - "\vcontentType\x18\x01 \x01(\tR\vcontentType\x12\x16\n" + - "\x06length\x18\x02 \x01(\rR\x06lengthJ\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\a\x10\bJ\x04\b\v\x10\f\"\xb9\x01\n" + - "\x0ePaymentAddress\x12J\n" + - "\n" + - "mobileCoin\x18\x01 \x01(\v2(.signalservice.PaymentAddress.MobileCoinH\x00R\n" + - "mobileCoin\x1aP\n" + - "\n" + - "MobileCoin\x12$\n" + - "\rpublicAddress\x18\x01 \x01(\fR\rpublicAddress\x12\x1c\n" + - "\tsignature\x18\x02 \x01(\fR\tsignatureB\t\n" + - "\aAddress\"r\n" + - "\x16DecryptionErrorMessage\x12\x1e\n" + - "\n" + - "ratchetKey\x18\x01 \x01(\fR\n" + - "ratchetKey\x12\x1c\n" + - "\ttimestamp\x18\x02 \x01(\x04R\ttimestamp\x12\x1a\n" + - "\bdeviceId\x18\x03 \x01(\rR\bdeviceId\"E\n" + - "\x13PniSignatureMessage\x12\x10\n" + - "\x03pni\x18\x01 \x01(\fR\x03pni\x12\x1c\n" + - "\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" + - "\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\x12\b\n" + - "\x04NONE\x10\x00\x12\b\n" + - "\x04BOLD\x10\x01\x12\n" + - "\n" + - "\x06ITALIC\x10\x02\x12\v\n" + - "\aSPOILER\x10\x03\x12\x11\n" + - "\rSTRIKETHROUGH\x10\x04\x12\r\n" + - "\tMONOSPACE\x10\x05B\x11\n" + - "\x0fassociatedValue\"\xca\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" + - "\rsentTimestamp\x18\x03 \x01(\x04R\rsentTimestampB\b\n" + - "\x06author\"\xd4\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" + - "\n" + - "identifierBE\n" + - ".org.whispersystems.signalservice.internal.pushB\x13SignalServiceProtos" - -var ( - file_signalpb_SignalService_proto_rawDescOnce sync.Once - file_signalpb_SignalService_proto_rawDescData []byte -) - -func file_signalpb_SignalService_proto_rawDescGZIP() []byte { - file_signalpb_SignalService_proto_rawDescOnce.Do(func() { - file_signalpb_SignalService_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_signalpb_SignalService_proto_rawDesc), len(file_signalpb_SignalService_proto_rawDesc))) - }) - return file_signalpb_SignalService_proto_rawDescData -} - -var file_signalpb_SignalService_proto_enumTypes = make([]protoimpl.EnumInfo, 28) -var file_signalpb_SignalService_proto_msgTypes = make([]protoimpl.MessageInfo, 92) -var file_signalpb_SignalService_proto_goTypes = []any{ - (Envelope_Type)(0), // 0: signalservice.Envelope.Type - (CallMessage_Offer_Type)(0), // 1: signalservice.CallMessage.Offer.Type - (CallMessage_Hangup_Type)(0), // 2: signalservice.CallMessage.Hangup.Type - (CallMessage_Opaque_Urgency)(0), // 3: signalservice.CallMessage.Opaque.Urgency - (DataMessage_Flags)(0), // 4: signalservice.DataMessage.Flags - (DataMessage_ProtocolVersion)(0), // 5: signalservice.DataMessage.ProtocolVersion - (DataMessage_Payment_Activation_Type)(0), // 6: signalservice.DataMessage.Payment.Activation.Type - (DataMessage_Quote_Type)(0), // 7: signalservice.DataMessage.Quote.Type - (DataMessage_Contact_Phone_Type)(0), // 8: signalservice.DataMessage.Contact.Phone.Type - (DataMessage_Contact_Email_Type)(0), // 9: signalservice.DataMessage.Contact.Email.Type - (DataMessage_Contact_PostalAddress_Type)(0), // 10: signalservice.DataMessage.Contact.PostalAddress.Type - (ReceiptMessage_Type)(0), // 11: signalservice.ReceiptMessage.Type - (TypingMessage_Action)(0), // 12: signalservice.TypingMessage.Action - (TextAttachment_Style)(0), // 13: signalservice.TextAttachment.Style - (Verified_State)(0), // 14: signalservice.Verified.State - (SyncMessage_Request_Type)(0), // 15: signalservice.SyncMessage.Request.Type - (SyncMessage_StickerPackOperation_Type)(0), // 16: signalservice.SyncMessage.StickerPackOperation.Type - (SyncMessage_FetchLatest_Type)(0), // 17: signalservice.SyncMessage.FetchLatest.Type - (SyncMessage_MessageRequestResponse_Type)(0), // 18: signalservice.SyncMessage.MessageRequestResponse.Type - (SyncMessage_CallEvent_Type)(0), // 19: signalservice.SyncMessage.CallEvent.Type - (SyncMessage_CallEvent_Direction)(0), // 20: signalservice.SyncMessage.CallEvent.Direction - (SyncMessage_CallEvent_Event)(0), // 21: signalservice.SyncMessage.CallEvent.Event - (SyncMessage_CallLinkUpdate_Type)(0), // 22: signalservice.SyncMessage.CallLinkUpdate.Type - (SyncMessage_CallLogEvent_Type)(0), // 23: signalservice.SyncMessage.CallLogEvent.Type - (SyncMessage_AttachmentBackfillResponse_Error)(0), // 24: signalservice.SyncMessage.AttachmentBackfillResponse.Error - (SyncMessage_AttachmentBackfillResponse_AttachmentData_Status)(0), // 25: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.Status - (AttachmentPointer_Flags)(0), // 26: signalservice.AttachmentPointer.Flags - (BodyRange_Style)(0), // 27: signalservice.BodyRange.Style - (*Envelope)(nil), // 28: signalservice.Envelope - (*Content)(nil), // 29: signalservice.Content - (*CallMessage)(nil), // 30: signalservice.CallMessage - (*DataMessage)(nil), // 31: signalservice.DataMessage - (*NullMessage)(nil), // 32: signalservice.NullMessage - (*ReceiptMessage)(nil), // 33: signalservice.ReceiptMessage - (*TypingMessage)(nil), // 34: signalservice.TypingMessage - (*StoryMessage)(nil), // 35: signalservice.StoryMessage - (*Preview)(nil), // 36: signalservice.Preview - (*TextAttachment)(nil), // 37: signalservice.TextAttachment - (*Verified)(nil), // 38: signalservice.Verified - (*SyncMessage)(nil), // 39: signalservice.SyncMessage - (*AttachmentPointer)(nil), // 40: signalservice.AttachmentPointer - (*GroupContextV2)(nil), // 41: signalservice.GroupContextV2 - (*ContactDetails)(nil), // 42: signalservice.ContactDetails - (*PaymentAddress)(nil), // 43: signalservice.PaymentAddress - (*DecryptionErrorMessage)(nil), // 44: signalservice.DecryptionErrorMessage - (*PniSignatureMessage)(nil), // 45: signalservice.PniSignatureMessage - (*EditMessage)(nil), // 46: signalservice.EditMessage - (*BodyRange)(nil), // 47: signalservice.BodyRange - (*AddressableMessage)(nil), // 48: signalservice.AddressableMessage - (*ConversationIdentifier)(nil), // 49: signalservice.ConversationIdentifier - (*CallMessage_Offer)(nil), // 50: signalservice.CallMessage.Offer - (*CallMessage_Answer)(nil), // 51: signalservice.CallMessage.Answer - (*CallMessage_IceUpdate)(nil), // 52: signalservice.CallMessage.IceUpdate - (*CallMessage_Busy)(nil), // 53: signalservice.CallMessage.Busy - (*CallMessage_Hangup)(nil), // 54: signalservice.CallMessage.Hangup - (*CallMessage_Opaque)(nil), // 55: signalservice.CallMessage.Opaque - (*DataMessage_Payment)(nil), // 56: signalservice.DataMessage.Payment - (*DataMessage_Quote)(nil), // 57: signalservice.DataMessage.Quote - (*DataMessage_Contact)(nil), // 58: signalservice.DataMessage.Contact - (*DataMessage_Sticker)(nil), // 59: signalservice.DataMessage.Sticker - (*DataMessage_Reaction)(nil), // 60: signalservice.DataMessage.Reaction - (*DataMessage_Delete)(nil), // 61: signalservice.DataMessage.Delete - (*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_UsernameChange)(nil), // 105: signalservice.SyncMessage.UsernameChange - (*SyncMessage_Sent_UnidentifiedDeliveryStatus)(nil), // 106: signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus - (*SyncMessage_Sent_StoryMessageRecipient)(nil), // 107: signalservice.SyncMessage.Sent.StoryMessageRecipient - (*SyncMessage_Blocked_BlockedE164)(nil), // 108: signalservice.SyncMessage.Blocked.BlockedE164 - (*SyncMessage_Blocked_BlockedAci)(nil), // 109: signalservice.SyncMessage.Blocked.BlockedAci - (*SyncMessage_Blocked_BlockedGroup)(nil), // 110: signalservice.SyncMessage.Blocked.BlockedGroup - (*SyncMessage_OutgoingPayment_MobileCoin)(nil), // 111: signalservice.SyncMessage.OutgoingPayment.MobileCoin - (*SyncMessage_DeleteForMe_MessageDeletes)(nil), // 112: signalservice.SyncMessage.DeleteForMe.MessageDeletes - (*SyncMessage_DeleteForMe_AttachmentDelete)(nil), // 113: signalservice.SyncMessage.DeleteForMe.AttachmentDelete - (*SyncMessage_DeleteForMe_ConversationDelete)(nil), // 114: signalservice.SyncMessage.DeleteForMe.ConversationDelete - (*SyncMessage_DeleteForMe_LocalOnlyConversationDelete)(nil), // 115: signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete - (*SyncMessage_AttachmentBackfillResponse_AttachmentData)(nil), // 116: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData - (*SyncMessage_AttachmentBackfillResponse_AttachmentDataList)(nil), // 117: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList - (*ContactDetails_Avatar)(nil), // 118: signalservice.ContactDetails.Avatar - (*PaymentAddress_MobileCoin)(nil), // 119: signalservice.PaymentAddress.MobileCoin -} -var file_signalpb_SignalService_proto_depIdxs = []int32{ - 0, // 0: signalservice.Envelope.type:type_name -> signalservice.Envelope.Type - 31, // 1: signalservice.Content.dataMessage:type_name -> signalservice.DataMessage - 39, // 2: signalservice.Content.syncMessage:type_name -> signalservice.SyncMessage - 30, // 3: signalservice.Content.callMessage:type_name -> signalservice.CallMessage - 32, // 4: signalservice.Content.nullMessage:type_name -> signalservice.NullMessage - 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 - 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 - 53, // 13: signalservice.CallMessage.busy:type_name -> signalservice.CallMessage.Busy - 54, // 14: signalservice.CallMessage.hangup:type_name -> signalservice.CallMessage.Hangup - 55, // 15: signalservice.CallMessage.opaque:type_name -> signalservice.CallMessage.Opaque - 40, // 16: signalservice.DataMessage.attachments:type_name -> signalservice.AttachmentPointer - 41, // 17: signalservice.DataMessage.groupV2:type_name -> signalservice.GroupContextV2 - 57, // 18: signalservice.DataMessage.quote:type_name -> signalservice.DataMessage.Quote - 58, // 19: signalservice.DataMessage.contact:type_name -> signalservice.DataMessage.Contact - 36, // 20: signalservice.DataMessage.preview:type_name -> signalservice.Preview - 59, // 21: signalservice.DataMessage.sticker:type_name -> signalservice.DataMessage.Sticker - 60, // 22: signalservice.DataMessage.reaction:type_name -> signalservice.DataMessage.Reaction - 61, // 23: signalservice.DataMessage.delete:type_name -> signalservice.DataMessage.Delete - 47, // 24: signalservice.DataMessage.bodyRanges:type_name -> signalservice.BodyRange - 62, // 25: signalservice.DataMessage.groupCallUpdate:type_name -> signalservice.DataMessage.GroupCallUpdate - 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 - 105, // 65: signalservice.SyncMessage.usernameChange:type_name -> signalservice.SyncMessage.UsernameChange - 87, // 66: signalservice.SyncMessage.read:type_name -> signalservice.SyncMessage.Read - 90, // 67: signalservice.SyncMessage.stickerPackOperation:type_name -> signalservice.SyncMessage.StickerPackOperation - 88, // 68: signalservice.SyncMessage.viewed:type_name -> signalservice.SyncMessage.Viewed - 118, // 69: signalservice.ContactDetails.avatar:type_name -> signalservice.ContactDetails.Avatar - 119, // 70: signalservice.PaymentAddress.mobileCoin:type_name -> signalservice.PaymentAddress.MobileCoin - 31, // 71: signalservice.EditMessage.dataMessage:type_name -> signalservice.DataMessage - 27, // 72: signalservice.BodyRange.style:type_name -> signalservice.BodyRange.Style - 1, // 73: signalservice.CallMessage.Offer.type:type_name -> signalservice.CallMessage.Offer.Type - 2, // 74: signalservice.CallMessage.Hangup.type:type_name -> signalservice.CallMessage.Hangup.Type - 3, // 75: signalservice.CallMessage.Opaque.urgency:type_name -> signalservice.CallMessage.Opaque.Urgency - 72, // 76: signalservice.DataMessage.Payment.notification:type_name -> signalservice.DataMessage.Payment.Notification - 73, // 77: signalservice.DataMessage.Payment.activation:type_name -> signalservice.DataMessage.Payment.Activation - 76, // 78: signalservice.DataMessage.Quote.attachments:type_name -> signalservice.DataMessage.Quote.QuotedAttachment - 47, // 79: signalservice.DataMessage.Quote.bodyRanges:type_name -> signalservice.BodyRange - 7, // 80: signalservice.DataMessage.Quote.type:type_name -> signalservice.DataMessage.Quote.Type - 77, // 81: signalservice.DataMessage.Contact.name:type_name -> signalservice.DataMessage.Contact.Name - 78, // 82: signalservice.DataMessage.Contact.number:type_name -> signalservice.DataMessage.Contact.Phone - 79, // 83: signalservice.DataMessage.Contact.email:type_name -> signalservice.DataMessage.Contact.Email - 80, // 84: signalservice.DataMessage.Contact.address:type_name -> signalservice.DataMessage.Contact.PostalAddress - 81, // 85: signalservice.DataMessage.Contact.avatar:type_name -> signalservice.DataMessage.Contact.Avatar - 40, // 86: signalservice.DataMessage.Sticker.data:type_name -> signalservice.AttachmentPointer - 74, // 87: signalservice.DataMessage.Payment.Amount.mobileCoin:type_name -> signalservice.DataMessage.Payment.Amount.MobileCoin - 75, // 88: signalservice.DataMessage.Payment.Notification.mobileCoin:type_name -> signalservice.DataMessage.Payment.Notification.MobileCoin - 6, // 89: signalservice.DataMessage.Payment.Activation.type:type_name -> signalservice.DataMessage.Payment.Activation.Type - 40, // 90: signalservice.DataMessage.Quote.QuotedAttachment.thumbnail:type_name -> signalservice.AttachmentPointer - 8, // 91: signalservice.DataMessage.Contact.Phone.type:type_name -> signalservice.DataMessage.Contact.Phone.Type - 9, // 92: signalservice.DataMessage.Contact.Email.type:type_name -> signalservice.DataMessage.Contact.Email.Type - 10, // 93: signalservice.DataMessage.Contact.PostalAddress.type:type_name -> signalservice.DataMessage.Contact.PostalAddress.Type - 40, // 94: signalservice.DataMessage.Contact.Avatar.avatar:type_name -> signalservice.AttachmentPointer - 31, // 95: signalservice.SyncMessage.Sent.message:type_name -> signalservice.DataMessage - 106, // 96: signalservice.SyncMessage.Sent.unidentifiedStatus:type_name -> signalservice.SyncMessage.Sent.UnidentifiedDeliveryStatus - 35, // 97: signalservice.SyncMessage.Sent.storyMessage:type_name -> signalservice.StoryMessage - 107, // 98: signalservice.SyncMessage.Sent.storyMessageRecipients:type_name -> signalservice.SyncMessage.Sent.StoryMessageRecipient - 46, // 99: signalservice.SyncMessage.Sent.editMessage:type_name -> signalservice.EditMessage - 40, // 100: signalservice.SyncMessage.Contacts.blob:type_name -> signalservice.AttachmentPointer - 108, // 101: signalservice.SyncMessage.Blocked.blockedE164s:type_name -> signalservice.SyncMessage.Blocked.BlockedE164 - 109, // 102: signalservice.SyncMessage.Blocked.blockedAcis:type_name -> signalservice.SyncMessage.Blocked.BlockedAci - 110, // 103: signalservice.SyncMessage.Blocked.blockedGroups:type_name -> signalservice.SyncMessage.Blocked.BlockedGroup - 15, // 104: signalservice.SyncMessage.Request.type:type_name -> signalservice.SyncMessage.Request.Type - 16, // 105: signalservice.SyncMessage.StickerPackOperation.type:type_name -> signalservice.SyncMessage.StickerPackOperation.Type - 17, // 106: signalservice.SyncMessage.FetchLatest.type:type_name -> signalservice.SyncMessage.FetchLatest.Type - 18, // 107: signalservice.SyncMessage.MessageRequestResponse.type:type_name -> signalservice.SyncMessage.MessageRequestResponse.Type - 111, // 108: signalservice.SyncMessage.OutgoingPayment.mobileCoin:type_name -> signalservice.SyncMessage.OutgoingPayment.MobileCoin - 19, // 109: signalservice.SyncMessage.CallEvent.type:type_name -> signalservice.SyncMessage.CallEvent.Type - 20, // 110: signalservice.SyncMessage.CallEvent.direction:type_name -> signalservice.SyncMessage.CallEvent.Direction - 21, // 111: signalservice.SyncMessage.CallEvent.event:type_name -> signalservice.SyncMessage.CallEvent.Event - 22, // 112: signalservice.SyncMessage.CallLinkUpdate.type:type_name -> signalservice.SyncMessage.CallLinkUpdate.Type - 23, // 113: signalservice.SyncMessage.CallLogEvent.type:type_name -> signalservice.SyncMessage.CallLogEvent.Type - 112, // 114: signalservice.SyncMessage.DeleteForMe.messageDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.MessageDeletes - 114, // 115: signalservice.SyncMessage.DeleteForMe.conversationDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.ConversationDelete - 115, // 116: signalservice.SyncMessage.DeleteForMe.localOnlyConversationDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete - 113, // 117: signalservice.SyncMessage.DeleteForMe.attachmentDeletes:type_name -> signalservice.SyncMessage.DeleteForMe.AttachmentDelete - 48, // 118: signalservice.SyncMessage.AttachmentBackfillRequest.targetMessage:type_name -> signalservice.AddressableMessage - 49, // 119: signalservice.SyncMessage.AttachmentBackfillRequest.targetConversation:type_name -> signalservice.ConversationIdentifier - 48, // 120: signalservice.SyncMessage.AttachmentBackfillResponse.targetMessage:type_name -> signalservice.AddressableMessage - 49, // 121: signalservice.SyncMessage.AttachmentBackfillResponse.targetConversation:type_name -> signalservice.ConversationIdentifier - 117, // 122: signalservice.SyncMessage.AttachmentBackfillResponse.attachments:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList - 24, // 123: signalservice.SyncMessage.AttachmentBackfillResponse.error:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.Error - 49, // 124: signalservice.SyncMessage.DeleteForMe.MessageDeletes.conversation:type_name -> signalservice.ConversationIdentifier - 48, // 125: signalservice.SyncMessage.DeleteForMe.MessageDeletes.messages:type_name -> signalservice.AddressableMessage - 49, // 126: signalservice.SyncMessage.DeleteForMe.AttachmentDelete.conversation:type_name -> signalservice.ConversationIdentifier - 48, // 127: signalservice.SyncMessage.DeleteForMe.AttachmentDelete.targetMessage:type_name -> signalservice.AddressableMessage - 49, // 128: signalservice.SyncMessage.DeleteForMe.ConversationDelete.conversation:type_name -> signalservice.ConversationIdentifier - 48, // 129: signalservice.SyncMessage.DeleteForMe.ConversationDelete.mostRecentMessages:type_name -> signalservice.AddressableMessage - 48, // 130: signalservice.SyncMessage.DeleteForMe.ConversationDelete.mostRecentNonExpiringMessages:type_name -> signalservice.AddressableMessage - 49, // 131: signalservice.SyncMessage.DeleteForMe.LocalOnlyConversationDelete.conversation:type_name -> signalservice.ConversationIdentifier - 40, // 132: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.attachment:type_name -> signalservice.AttachmentPointer - 25, // 133: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.status:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData.Status - 116, // 134: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList.attachments:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData - 116, // 135: signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentDataList.longText:type_name -> signalservice.SyncMessage.AttachmentBackfillResponse.AttachmentData - 136, // [136:136] is the sub-list for method output_type - 136, // [136:136] is the sub-list for method input_type - 136, // [136:136] is the sub-list for extension type_name - 136, // [136:136] is the sub-list for extension extendee - 0, // [0:136] is the sub-list for field type_name -} - -func init() { file_signalpb_SignalService_proto_init() } -func file_signalpb_SignalService_proto_init() { - if File_signalpb_SignalService_proto != nil { - return - } - file_signalpb_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_signalpb_SignalService_proto_msgTypes[7].OneofWrappers = []any{ - (*StoryMessage_FileAttachment)(nil), - (*StoryMessage_TextAttachment)(nil), - } - file_signalpb_SignalService_proto_msgTypes[9].OneofWrappers = []any{ - (*TextAttachment_Gradient_)(nil), - (*TextAttachment_Color)(nil), - } - file_signalpb_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), - (*SyncMessage_UsernameChange_)(nil), - } - file_signalpb_SignalService_proto_msgTypes[12].OneofWrappers = []any{ - (*AttachmentPointer_CdnId)(nil), - (*AttachmentPointer_CdnKey)(nil), - } - file_signalpb_SignalService_proto_msgTypes[15].OneofWrappers = []any{ - (*PaymentAddress_MobileCoin_)(nil), - } - file_signalpb_SignalService_proto_msgTypes[19].OneofWrappers = []any{ - (*BodyRange_MentionAci)(nil), - (*BodyRange_Style_)(nil), - (*BodyRange_MentionAciBinary)(nil), - } - file_signalpb_SignalService_proto_msgTypes[20].OneofWrappers = []any{ - (*AddressableMessage_AuthorServiceId)(nil), - (*AddressableMessage_AuthorE164)(nil), - (*AddressableMessage_AuthorServiceIdBinary)(nil), - } - file_signalpb_SignalService_proto_msgTypes[21].OneofWrappers = []any{ - (*ConversationIdentifier_ThreadServiceId)(nil), - (*ConversationIdentifier_ThreadGroupId)(nil), - (*ConversationIdentifier_ThreadE164)(nil), - (*ConversationIdentifier_ThreadServiceIdBinary)(nil), - } - file_signalpb_SignalService_proto_msgTypes[28].OneofWrappers = []any{ - (*DataMessage_Payment_Notification_)(nil), - (*DataMessage_Payment_Activation_)(nil), - } - file_signalpb_SignalService_proto_msgTypes[40].OneofWrappers = []any{ - (*DataMessage_PinMessage_PinDurationSeconds)(nil), - (*DataMessage_PinMessage_PinDurationForever)(nil), - } - file_signalpb_SignalService_proto_msgTypes[43].OneofWrappers = []any{ - (*DataMessage_Payment_Amount_MobileCoin_)(nil), - } - file_signalpb_SignalService_proto_msgTypes[44].OneofWrappers = []any{ - (*DataMessage_Payment_Notification_MobileCoin_)(nil), - } - file_signalpb_SignalService_proto_msgTypes[68].OneofWrappers = []any{ - (*SyncMessage_OutgoingPayment_MobileCoin_)(nil), - } - file_signalpb_SignalService_proto_msgTypes[76].OneofWrappers = []any{ - (*SyncMessage_AttachmentBackfillResponse_Attachments)(nil), - (*SyncMessage_AttachmentBackfillResponse_Error_)(nil), - } - file_signalpb_SignalService_proto_msgTypes[88].OneofWrappers = []any{ - (*SyncMessage_AttachmentBackfillResponse_AttachmentData_Attachment)(nil), - (*SyncMessage_AttachmentBackfillResponse_AttachmentData_Status_)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_signalpb_SignalService_proto_rawDesc), len(file_signalpb_SignalService_proto_rawDesc)), - NumEnums: 28, - NumMessages: 92, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signalpb_SignalService_proto_goTypes, - DependencyIndexes: file_signalpb_SignalService_proto_depIdxs, - EnumInfos: file_signalpb_SignalService_proto_enumTypes, - MessageInfos: file_signalpb_SignalService_proto_msgTypes, - }.Build() - File_signalpb_SignalService_proto = out.File - file_signalpb_SignalService_proto_goTypes = nil - file_signalpb_SignalService_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/SignalService.proto b/pkg/signalmeow/protobuf/signalpb/SignalService.proto deleted file mode 100644 index 562f47f..0000000 --- a/pkg/signalmeow/protobuf/signalpb/SignalService.proto +++ /dev/null @@ -1,1038 +0,0 @@ -/* - * Copyright 2020-2022 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ - -syntax = "proto2"; - -package signalservice; - -option java_package = "org.whispersystems.signalservice.internal.push"; -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}) - - 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 - } - - optional Type type = 1; - reserved 2; // formerly optional string sourceE164 = 2; - optional string sourceServiceId = 11; - optional uint32 sourceDeviceId = 7; - optional string destinationServiceId = 13; - reserved 3; // formerly optional string relay = 3; - optional uint64 clientTimestamp = 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; - optional uint64 serverTimestamp = 10; - optional bool ephemeral = 12; // indicates that the message should not be persisted if the recipient is offline - optional bool urgent = 14 [default = true]; // 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 - optional string updatedPni = 15; // for number-change synchronization messages, provides the new server-assigned phone number identifier associated with the changed number - 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 -} - -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 bytes /* SenderKeyDistributionMessage */ senderKeyDistributionMessage = 7; - optional PniSignatureMessage pniSignatureMessage = 10; -} - -message CallMessage { - message Offer { - enum Type { - OFFER_AUDIO_CALL = 0; - OFFER_VIDEO_CALL = 1; - reserved /* OFFER_NEED_PERMISSION */ 2; // removed - } - optional uint64 id = 1; - reserved /* sdp */ 2; - optional Type type = 3; - optional bytes opaque = 4; - } - - message Answer { - optional uint64 id = 1; - reserved /* sdp */ 2; - optional bytes opaque = 3; - } - - message IceUpdate { - optional uint64 id = 1; - reserved /* mid */ 2; - reserved /* line */ 3; - reserved /* sdp */ 4; - optional bytes opaque = 5; - } - - message Busy { - optional uint64 id = 1; - } - - message Hangup { - enum Type { - HANGUP_NORMAL = 0; - HANGUP_ACCEPTED = 1; - HANGUP_DECLINED = 2; - HANGUP_BUSY = 3; - HANGUP_NEED_PERMISSION = 4; - } - optional uint64 id = 1; - optional Type type = 2; - optional uint32 deviceId = 3; - } - - message Opaque { - enum Urgency { - DROPPABLE = 0; - HANDLE_IMMEDIATELY = 1; - } - optional bytes data = 1; - optional Urgency urgency = 2; // If missing, treat as DROPPABLE. - } - - optional Offer offer = 1; - optional Answer answer = 2; - repeated IceUpdate iceUpdate = 3; - reserved /* legacyHangup */ 4; - optional Busy busy = 5; - reserved /* profileKey */ 6; - optional Hangup hangup = 7; - reserved /* multiRing */ 8; - optional uint32 destinationDeviceId = 9; - optional Opaque opaque = 10; -} - -message DataMessage { - enum Flags { - reserved /*END_SESSION*/ 1; - EXPIRATION_TIMER_UPDATE = 2; - PROFILE_KEY_UPDATE = 4; - FORWARD = 8; - } - - message Payment { - message Amount { - message MobileCoin { - optional uint64 picoMob = 1; // 1,000,000,000,000 picoMob per Mob - } - - oneof Amount { - MobileCoin mobileCoin = 1; - } - } - - message Notification { - message MobileCoin { - optional bytes receipt = 1; - } - - oneof Transaction { - MobileCoin mobileCoin = 1; - } - - // Optional, Refers to the PaymentRequest message, if any. - optional string note = 2; - reserved /*requestId*/ 1003; - } - - message Activation { - enum Type { - REQUEST = 0; - ACTIVATED = 1; - } - - optional Type type = 1; - } - - oneof Item { - Notification notification = 1; - Activation activation = 2; - } - - reserved /*request*/ 1002; - reserved /*cancellation*/ 1003; - } - - message Quote { - enum Type { - NORMAL = 0; - GIFT_BADGE = 1; - POLL = 2; - } - - message QuotedAttachment { - optional string contentType = 1; - optional string fileName = 2; - optional AttachmentPointer thumbnail = 3; - } - - optional uint64 id = 1; - reserved /*authorE164*/ 2; - optional string authorAci = 5; - optional string text = 3; - repeated QuotedAttachment attachments = 4; - repeated BodyRange bodyRanges = 6; - optional Type type = 7; - optional bytes authorAciBinary = 8; // 16-byte UUID - } - - message Contact { - message Name { - optional string givenName = 1; - optional string familyName = 2; - optional string prefix = 3; - optional string suffix = 4; - optional string middleName = 5; - reserved /*displayName*/ 6; - optional string nickname = 7; - } - - message Phone { - enum Type { - HOME = 1; - MOBILE = 2; - WORK = 3; - CUSTOM = 4; - } - - optional string value = 1; - optional Type type = 2; - optional string label = 3; - } - - message Email { - enum Type { - HOME = 1; - MOBILE = 2; - WORK = 3; - CUSTOM = 4; - } - - optional string value = 1; - optional Type type = 2; - optional string label = 3; - } - - message PostalAddress { - enum Type { - HOME = 1; - WORK = 2; - CUSTOM = 3; - } - - optional Type type = 1; - optional string label = 2; - optional string street = 3; - optional string pobox = 4; - optional string neighborhood = 5; - optional string city = 6; - optional string region = 7; - optional string postcode = 8; - optional string country = 9; - } - - message Avatar { - optional AttachmentPointer avatar = 1; - optional bool isProfile = 2; - } - - optional Name name = 1; - repeated Phone number = 3; - repeated Email email = 4; - repeated PostalAddress address = 5; - optional Avatar avatar = 6; - optional string organization = 7; - } - - message Sticker { - optional bytes packId = 1; - optional bytes packKey = 2; - optional uint32 stickerId = 3; - optional AttachmentPointer data = 4; - optional string emoji = 5; - } - - message Reaction { - optional string emoji = 1; - optional bool remove = 2; - reserved /* targetAuthorE164 */ 3; - optional string targetAuthorAci = 4; - optional uint64 targetSentTimestamp = 5; - optional bytes targetAuthorAciBinary = 6; // 16-byte UUID - } - - message Delete { - optional uint64 targetSentTimestamp = 1; - } - - message GroupCallUpdate { - optional string eraId = 1; - } - - message StoryContext { - optional string authorAci = 1; - optional uint64 sentTimestamp = 2; - optional bytes authorAciBinary = 3; // 16-byte UUID - } - - enum ProtocolVersion { - option allow_alias = true; - - INITIAL = 0; - MESSAGE_TIMERS = 1; - VIEW_ONCE = 2; - VIEW_ONCE_VIDEO = 3; - REACTIONS = 4; - CDN_SELECTOR_ATTACHMENTS = 5; - MENTIONS = 6; - PAYMENTS = 7; - POLLS = 8; - CURRENT = 8; - } - - 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; - optional GroupContextV2 groupV2 = 15; - optional uint32 flags = 4; - optional uint32 expireTimer = 5; - optional uint32 expireTimerVersion = 23; - optional bytes profileKey = 6; - optional uint64 timestamp = 7; - optional Quote quote = 8; - repeated Contact contact = 9; - repeated Preview preview = 10; - optional Sticker sticker = 11; - optional uint32 requiredProtocolVersion = 12; - optional bool isViewOnce = 14; - optional Reaction reaction = 16; - optional Delete delete = 17; - repeated BodyRange bodyRanges = 18; - optional GroupCallUpdate groupCallUpdate = 19; - 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 -} - -message NullMessage { - optional bytes padding = 1; -} - -message ReceiptMessage { - enum Type { - DELIVERY = 0; - READ = 1; - VIEWED = 2; - } - - optional Type type = 1; - repeated uint64 timestamp = 2; -} - -message TypingMessage { - enum Action { - STARTED = 0; - STOPPED = 1; - } - - optional uint64 timestamp = 1; - optional Action action = 2; - optional bytes groupId = 3; -} - -message StoryMessage { - optional bytes profileKey = 1; - optional GroupContextV2 group = 2; - oneof attachment { - AttachmentPointer fileAttachment = 3; - TextAttachment textAttachment = 4; - } - optional bool allowsReplies = 5; - repeated BodyRange bodyRanges = 6; -} - -message Preview { - optional string url = 1; - optional string title = 2; - optional AttachmentPointer image = 3; - optional string description = 4; - optional uint64 date = 5; -} - -message TextAttachment { - enum Style { - DEFAULT = 0; - REGULAR = 1; - BOLD = 2; - SERIF = 3; - SCRIPT = 4; - CONDENSED = 5; - } - - 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 - repeated uint32 colors = 4; - repeated float positions = 5; // percent from 0 to 1 - } - - optional string text = 1; - optional Style textStyle = 2; - optional uint32 textForegroundColor = 3; // integer representation of hex color - optional uint32 textBackgroundColor = 4; - optional Preview preview = 5; - oneof background { - Gradient gradient = 6; - uint32 color = 7; - } -} - -message Verified { - enum State { - DEFAULT = 0; - VERIFIED = 1; - UNVERIFIED = 2; - } - - reserved /*destinationE164*/ 1; - optional string destinationAci = 5; - optional bytes identityKey = 2; - optional State state = 3; - optional bytes nullMessage = 4; - optional bytes destinationAciBinary = 6; // 16-byte UUID -} - -message SyncMessage { - message Sent { - message UnidentifiedDeliveryStatus { - reserved /*destinationE164*/ 1; - optional string destinationServiceId = 3; - 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 { - optional string destinationServiceId = 1; - 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; - optional string destinationServiceId = 7; - optional uint64 timestamp = 2; - optional DataMessage message = 3; - optional uint64 expirationStartTimestamp = 4; - repeated UnidentifiedDeliveryStatus unidentifiedStatus = 5; - optional bool isRecipientUpdate = 6 [default = false]; - optional StoryMessage storyMessage = 8; - 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 - } - - message Contacts { - optional AttachmentPointer blob = 1; - optional bool complete = 2 [default = false]; - } - - message Blocked { - repeated string numbers = 1; // deprecated: this field will be removed in a future release. - repeated string acis = 3; - repeated bytes groupIds = 2; // deprecated: this field will be removed in a future release. - repeated bytes acisBinary = 4; // deprecated: this field will be removed in a future release. - - message BlockedE164 { - optional string e164 = 1; - optional uint64 timestamp = 2; - } - - message BlockedAci { - optional bytes aciBinary = 1; // 16-byte UUID - optional uint64 timestamp = 2; - } - - message BlockedGroup { - optional bytes groupId = 1; - optional uint64 timestamp = 2; - } - - repeated BlockedE164 blockedE164s = 5; - repeated BlockedAci blockedAcis = 6; - repeated BlockedGroup blockedGroups = 7; - } - - message Request { - enum Type { - UNKNOWN = 0; - CONTACTS = 1; - reserved /*GROUPS*/ 2; - BLOCKED = 3; - CONFIGURATION = 4; - KEYS = 5; - reserved /*PNI_IDENTITY*/ 6; - } - - optional Type type = 1; - } - - message Read { - 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 { - optional bool readReceipts = 1; - optional bool unidentifiedDeliveryIndicators = 2; - optional bool typingIndicators = 3; - reserved /* linkPreviews */ 4; - reserved /* provisioningVersion */ 5; - optional bool linkPreviews = 6; - } - - message StickerPackOperation { - enum Type { - INSTALL = 0; - REMOVE = 1; - } - - optional bytes packId = 1; - optional bytes packKey = 2; - optional Type type = 3; - } - - message ViewOnceOpen { - reserved /*senderE164*/ 1; - optional string senderAci = 3; - optional uint64 timestamp = 2; - optional bytes senderAciBinary = 4; // 16-byte UUID - } - - message FetchLatest { - enum Type { - UNKNOWN = 0; - LOCAL_PROFILE = 1; - STORAGE_MANIFEST = 2; - SUBSCRIPTION_STATUS = 3; - } - - optional Type type = 1; - } - - message Keys { - reserved /* storageService */ 1; - reserved /* master */ 2; - optional string accountEntropyPool = 3; - optional bytes mediaRootBackupKey = 4; - } - - message PniIdentity { - optional bytes publicKey = 1; - optional bytes privateKey = 2; - } - - message MessageRequestResponse { - enum Type { - UNKNOWN = 0; - ACCEPT = 1; - DELETE = 2; - BLOCK = 3; - BLOCK_AND_DELETE = 4; - SPAM = 5; - BLOCK_AND_SPAM = 6; - } - - reserved /*threadE164*/ 1; - optional string threadAci = 2; - optional bytes groupId = 3; - optional Type type = 4; - optional bytes threadAciBinary = 5; // 16-byte UUID - } - - message OutgoingPayment { - message MobileCoin { - optional bytes recipientAddress = 1; - optional uint64 amountPicoMob = 2; - optional uint64 feePicoMob = 3; - optional bytes receipt = 4; - optional uint64 ledgerBlockTimestamp = 5; - optional uint64 ledgerBlockIndex = 6; - repeated bytes spentKeyImages = 7; - repeated bytes outputPublicKeys = 8; - } - optional string recipientServiceId = 1; - optional string note = 2; - oneof attachment_identifier { - MobileCoin mobileCoin = 3; - } - } - - message PniChangeNumber { - optional bytes identityKeyPair = 1; // Serialized libsignal-client IdentityKeyPair - optional bytes signedPreKey = 2; // Serialized libsignal-client SignedPreKeyRecord - optional bytes lastResortKyberPreKey = 5; // Serialized libsignal-client KyberPreKeyRecord - optional uint32 registrationId = 3; - optional string newE164 = 4; // The e164 we have changed our number to - // Next ID: 6 - } - - message CallEvent { - enum Type { - UNKNOWN_TYPE = 0; - AUDIO_CALL = 1; - VIDEO_CALL = 2; - GROUP_CALL = 3; - AD_HOC_CALL = 4; - } - - enum Direction { - UNKNOWN_DIRECTION = 0; - INCOMING = 1; - OUTGOING = 2; - } - - enum Event { - UNKNOWN_EVENT = 0; - ACCEPTED = 1; - NOT_ACCEPTED = 2; - DELETE = 3; - OBSERVED = 4; - } - - /* Data identifying a conversation. The service ID for 1:1, the group ID for - * group, or the room ID for an ad-hoc call. See also - * `CallLogEvent/conversationId`. */ - optional bytes conversationId = 1; - /* An identifier for a call. Generated directly for 1:1, or derived from - * the era ID for group and ad-hoc calls. See also `CallLogEvent/callId`. */ - optional uint64 callId = 2; - optional uint64 timestamp = 3; - optional Type type = 4; - optional Direction direction = 5; - optional Event event = 6; - } - - message CallLinkUpdate { - enum Type { - UPDATE = 0; - reserved 1; // was DELETE, superseded by storage service - } - - optional bytes rootKey = 1; - optional bytes adminPasskey = 2; - optional Type type = 3; // defaults to UPDATE - reserved /*epoch*/ 4; - } - - message CallLogEvent { - enum Type { - CLEAR = 0; - MARKED_AS_READ = 1; - MARKED_AS_READ_IN_CONVERSATION = 2; - CLEAR_IN_CONVERSATION = 3; - } - - optional Type type = 1; - optional uint64 timestamp = 2; - /* Data identifying a conversation. The service ID for 1:1, the group ID for - * group, or the room ID for an ad-hoc call. See also - * `CallEvent/conversationId`. */ - optional bytes conversationId = 3; - /* An identifier for a call. Generated directly for 1:1, or derived from - * the era ID for group and ad-hoc calls. See also `CallEvent/callId`. */ - optional uint64 callId = 4; - } - - message DeleteForMe { - message MessageDeletes { - optional ConversationIdentifier conversation = 1; - repeated AddressableMessage messages = 2; - } - - message AttachmentDelete { - optional ConversationIdentifier conversation = 1; - optional AddressableMessage targetMessage = 2; - // The `clientUuid` from `AttachmentPointer`. - optional bytes clientUuid = 3; - // SHA256 hash of the (encrypted, padded, etc.) attachment blob on the CDN. - optional bytes fallbackDigest = 4; - // SHA256 hash of the plaintext content of the attachment. - optional bytes fallbackPlaintextHash = 5; - } - - message ConversationDelete { - optional ConversationIdentifier conversation = 1; - repeated AddressableMessage mostRecentMessages = 2; - optional bool isFullDelete = 3; - repeated AddressableMessage mostRecentNonExpiringMessages = 4; - } - - message LocalOnlyConversationDelete { - optional ConversationIdentifier conversation = 1; - } - - repeated MessageDeletes messageDeletes = 1; - repeated ConversationDelete conversationDeletes = 2; - repeated LocalOnlyConversationDelete localOnlyConversationDeletes = 3; - repeated AttachmentDelete attachmentDeletes = 4; - } - - message DeviceNameChange { - reserved /*name*/ 1; - optional uint32 deviceId = 2; - } - - message AttachmentBackfillRequest { - optional AddressableMessage targetMessage = 1; - optional ConversationIdentifier targetConversation = 2; - } - - message AttachmentBackfillResponse { - message AttachmentData { - enum Status { - PENDING = 0; - TERMINAL_ERROR = 1; - } - - oneof data { - AttachmentPointer attachment = 1; - Status status = 2; - } - } - - enum Error { - MESSAGE_NOT_FOUND = 0; - } - - message AttachmentDataList { - repeated AttachmentData attachments = 1; - optional AttachmentData longText = 2; - } - - optional AddressableMessage targetMessage = 1; - optional ConversationIdentifier targetConversation = 2; - - oneof data { - AttachmentDataList attachments = 3; - Error error = 4; - } - } - - message UsernameChange {} - - 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; - UsernameChange usernameChange = 26; - } - - 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`. - repeated Read read = 5; - repeated StickerPackOperation stickerPackOperation = 10; - repeated Viewed viewed = 16; - - reserved /*pniIdentity*/ 17; - - optional bytes padding = 8; -} - -message AttachmentPointer { - enum Flags { - VOICE_MESSAGE = 1; - BORDERLESS = 2; - reserved 4; - GIF = 8; - } - - oneof attachment_identifier { - fixed64 cdnId = 1; - string cdnKey = 15; - } - // Cross-client identifier for this attachment among all attachments on the - // owning message. - optional bytes clientUuid = 20; - optional string contentType = 2; - optional bytes key = 3; - optional uint32 size = 4; - optional bytes thumbnail = 5; - optional bytes digest = 6; - reserved /* incrementalMac with implicit chunk sizing */ 16; - reserved /* incrementalMac for all attachment types */ 18; - optional bytes incrementalMac = 19; - optional uint32 chunkSize = 17; - optional string fileName = 7; - optional uint32 flags = 8; - optional uint32 width = 9; - optional uint32 height = 10; - optional string caption = 11; - optional string blurHash = 12; - optional uint64 uploadTimestamp = 13; - optional uint32 cdnNumber = 14; - // Next ID: 21 -} - -message GroupContextV2 { - optional bytes masterKey = 1; - optional uint32 revision = 2; - optional bytes groupChange = 3; -} - -message ContactDetails { - message Avatar { - optional string contentType = 1; - optional uint32 length = 2; - } - - 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; - reserved /* verified */ 5; - reserved /* profileKey */ 6; - reserved /* blocked */ 7; - optional uint32 expireTimer = 8; - optional uint32 expireTimerVersion = 12; - optional uint32 inboxPosition = 10; - reserved /* archived */ 11; - // NEXT ID: 14 -} - -message PaymentAddress { - message MobileCoin { - optional bytes publicAddress = 1; - optional bytes signature = 2; - } - - oneof Address { - MobileCoin mobileCoin = 1; - } -} - -message DecryptionErrorMessage { - optional bytes ratchetKey = 1; // set to the public ratchet key from the SignalMessage if a 1-1 payload fails to decrypt - optional uint64 timestamp = 2; - optional uint32 deviceId = 3; -} - -message PniSignatureMessage { - optional bytes pni = 1; - // Signature *by* the PNI identity key *of* the ACI identity key - optional bytes signature = 2; -} - -message EditMessage { - optional uint64 targetSentTimestamp = 1; - optional DataMessage dataMessage = 2; -} - -message BodyRange { - enum Style { - NONE = 0; - BOLD = 1; - ITALIC = 2; - SPOILER = 3; - STRIKETHROUGH = 4; - MONOSPACE = 5; - } - - optional uint32 start = 1; // Starting index in UTF-16 code units/raw string representation - optional uint32 length = 2; // Length of range in UTF-16 code units/raw string representation - - oneof associatedValue { - string mentionAci = 3; - Style style = 4; - bytes mentionAciBinary = 5; // 16-byte UUID - } -} - -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; -} - -message ConversationIdentifier { - oneof identifier { - 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/signalpb/StickerResources.pb.go b/pkg/signalmeow/protobuf/signalpb/StickerResources.pb.go deleted file mode 100644 index 2d32653..0000000 --- a/pkg/signalmeow/protobuf/signalpb/StickerResources.pb.go +++ /dev/null @@ -1,222 +0,0 @@ -//* -// Copyright (C) 2019 Open Whisper Systems -// -// 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 -// source: signalpb/StickerResources.proto - -package signalpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Pack struct { - state protoimpl.MessageState `protogen:"open.v1"` - Title *string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` - Author *string `protobuf:"bytes,2,opt,name=author" json:"author,omitempty"` - Cover *Pack_Sticker `protobuf:"bytes,3,opt,name=cover" json:"cover,omitempty"` - Stickers []*Pack_Sticker `protobuf:"bytes,4,rep,name=stickers" json:"stickers,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Pack) Reset() { - *x = Pack{} - mi := &file_signalpb_StickerResources_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Pack) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Pack) ProtoMessage() {} - -func (x *Pack) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StickerResources_proto_msgTypes[0] - 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 Pack.ProtoReflect.Descriptor instead. -func (*Pack) Descriptor() ([]byte, []int) { - return file_signalpb_StickerResources_proto_rawDescGZIP(), []int{0} -} - -func (x *Pack) GetTitle() string { - if x != nil && x.Title != nil { - return *x.Title - } - return "" -} - -func (x *Pack) GetAuthor() string { - if x != nil && x.Author != nil { - return *x.Author - } - return "" -} - -func (x *Pack) GetCover() *Pack_Sticker { - if x != nil { - return x.Cover - } - return nil -} - -func (x *Pack) GetStickers() []*Pack_Sticker { - if x != nil { - return x.Stickers - } - return nil -} - -type Pack_Sticker struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Emoji *string `protobuf:"bytes,2,opt,name=emoji" json:"emoji,omitempty"` - ContentType *string `protobuf:"bytes,3,opt,name=contentType" json:"contentType,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Pack_Sticker) Reset() { - *x = Pack_Sticker{} - mi := &file_signalpb_StickerResources_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Pack_Sticker) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Pack_Sticker) ProtoMessage() {} - -func (x *Pack_Sticker) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StickerResources_proto_msgTypes[1] - 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 Pack_Sticker.ProtoReflect.Descriptor instead. -func (*Pack_Sticker) Descriptor() ([]byte, []int) { - return file_signalpb_StickerResources_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *Pack_Sticker) GetId() uint32 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *Pack_Sticker) GetEmoji() string { - if x != nil && x.Emoji != nil { - return *x.Emoji - } - return "" -} - -func (x *Pack_Sticker) GetContentType() string { - if x != nil && x.ContentType != nil { - return *x.ContentType - } - return "" -} - -var File_signalpb_StickerResources_proto protoreflect.FileDescriptor - -const file_signalpb_StickerResources_proto_rawDesc = "" + - "\n" + - "\x1fsignalpb/StickerResources.proto\x12\rsignalservice\"\xf3\x01\n" + - "\x04Pack\x12\x14\n" + - "\x05title\x18\x01 \x01(\tR\x05title\x12\x16\n" + - "\x06author\x18\x02 \x01(\tR\x06author\x121\n" + - "\x05cover\x18\x03 \x01(\v2\x1b.signalservice.Pack.StickerR\x05cover\x127\n" + - "\bstickers\x18\x04 \x03(\v2\x1b.signalservice.Pack.StickerR\bstickers\x1aQ\n" + - "\aSticker\x12\x0e\n" + - "\x02id\x18\x01 \x01(\rR\x02id\x12\x14\n" + - "\x05emoji\x18\x02 \x01(\tR\x05emoji\x12 \n" + - "\vcontentType\x18\x03 \x01(\tR\vcontentTypeBB\n" + - "1org.whispersystems.signalservice.internal.stickerB\rStickerProtos" - -var ( - file_signalpb_StickerResources_proto_rawDescOnce sync.Once - file_signalpb_StickerResources_proto_rawDescData []byte -) - -func file_signalpb_StickerResources_proto_rawDescGZIP() []byte { - file_signalpb_StickerResources_proto_rawDescOnce.Do(func() { - file_signalpb_StickerResources_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_signalpb_StickerResources_proto_rawDesc), len(file_signalpb_StickerResources_proto_rawDesc))) - }) - return file_signalpb_StickerResources_proto_rawDescData -} - -var file_signalpb_StickerResources_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_signalpb_StickerResources_proto_goTypes = []any{ - (*Pack)(nil), // 0: signalservice.Pack - (*Pack_Sticker)(nil), // 1: signalservice.Pack.Sticker -} -var file_signalpb_StickerResources_proto_depIdxs = []int32{ - 1, // 0: signalservice.Pack.cover:type_name -> signalservice.Pack.Sticker - 1, // 1: signalservice.Pack.stickers:type_name -> signalservice.Pack.Sticker - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_signalpb_StickerResources_proto_init() } -func file_signalpb_StickerResources_proto_init() { - if File_signalpb_StickerResources_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_signalpb_StickerResources_proto_rawDesc), len(file_signalpb_StickerResources_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signalpb_StickerResources_proto_goTypes, - DependencyIndexes: file_signalpb_StickerResources_proto_depIdxs, - MessageInfos: file_signalpb_StickerResources_proto_msgTypes, - }.Build() - File_signalpb_StickerResources_proto = out.File - file_signalpb_StickerResources_proto_goTypes = nil - file_signalpb_StickerResources_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/StorageService.pb.go b/pkg/signalmeow/protobuf/signalpb/StorageService.pb.go deleted file mode 100644 index 6c8e24b..0000000 --- a/pkg/signalmeow/protobuf/signalpb/StorageService.pb.go +++ /dev/null @@ -1,3928 +0,0 @@ -// -// Copyright 2020-2021 Signal Messenger, LLC -// SPDX-License-Identifier: AGPL-3.0-only - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.11 -// protoc v7.34.1 -// source: signalpb/StorageService.proto - -package signalpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type OptionalBool int32 - -const ( - OptionalBool_UNSET OptionalBool = 0 - OptionalBool_ENABLED OptionalBool = 1 - OptionalBool_DISABLED OptionalBool = 2 -) - -// Enum value maps for OptionalBool. -var ( - OptionalBool_name = map[int32]string{ - 0: "UNSET", - 1: "ENABLED", - 2: "DISABLED", - } - OptionalBool_value = map[string]int32{ - "UNSET": 0, - "ENABLED": 1, - "DISABLED": 2, - } -) - -func (x OptionalBool) Enum() *OptionalBool { - p := new(OptionalBool) - *p = x - return p -} - -func (x OptionalBool) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OptionalBool) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[0].Descriptor() -} - -func (OptionalBool) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[0] -} - -func (x OptionalBool) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OptionalBool.Descriptor instead. -func (OptionalBool) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{0} -} - -// If unset - computed as the value of the first byte of SHA-256(msg=CONTACT_ID) -// modulo the count of colors. Once set the avatar color for a recipient is -// never recomputed or changed. -// -// `CONTACT_ID` is the first available identifier from the list: -// - ServiceIdToBinary(ACI) -// - E164 -// - ServiceIdToBinary(PNI) -// - Group Id -type AvatarColor int32 - -const ( - AvatarColor_A100 AvatarColor = 0 - AvatarColor_A110 AvatarColor = 1 - AvatarColor_A120 AvatarColor = 2 - AvatarColor_A130 AvatarColor = 3 - AvatarColor_A140 AvatarColor = 4 - AvatarColor_A150 AvatarColor = 5 - AvatarColor_A160 AvatarColor = 6 - AvatarColor_A170 AvatarColor = 7 - AvatarColor_A180 AvatarColor = 8 - AvatarColor_A190 AvatarColor = 9 - AvatarColor_A200 AvatarColor = 10 - AvatarColor_A210 AvatarColor = 11 -) - -// Enum value maps for AvatarColor. -var ( - AvatarColor_name = map[int32]string{ - 0: "A100", - 1: "A110", - 2: "A120", - 3: "A130", - 4: "A140", - 5: "A150", - 6: "A160", - 7: "A170", - 8: "A180", - 9: "A190", - 10: "A200", - 11: "A210", - } - AvatarColor_value = map[string]int32{ - "A100": 0, - "A110": 1, - "A120": 2, - "A130": 3, - "A140": 4, - "A150": 5, - "A160": 6, - "A170": 7, - "A180": 8, - "A190": 9, - "A200": 10, - "A210": 11, - } -) - -func (x AvatarColor) Enum() *AvatarColor { - p := new(AvatarColor) - *p = x - return p -} - -func (x AvatarColor) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AvatarColor) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[1].Descriptor() -} - -func (AvatarColor) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[1] -} - -func (x AvatarColor) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AvatarColor.Descriptor instead. -func (AvatarColor) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{1} -} - -type ManifestRecord_Identifier_Type int32 - -const ( - ManifestRecord_Identifier_UNKNOWN ManifestRecord_Identifier_Type = 0 - ManifestRecord_Identifier_CONTACT ManifestRecord_Identifier_Type = 1 - ManifestRecord_Identifier_GROUPV1 ManifestRecord_Identifier_Type = 2 - ManifestRecord_Identifier_GROUPV2 ManifestRecord_Identifier_Type = 3 - ManifestRecord_Identifier_ACCOUNT ManifestRecord_Identifier_Type = 4 - ManifestRecord_Identifier_STORY_DISTRIBUTION_LIST ManifestRecord_Identifier_Type = 5 - ManifestRecord_Identifier_STICKER_PACK ManifestRecord_Identifier_Type = 6 - ManifestRecord_Identifier_CALL_LINK ManifestRecord_Identifier_Type = 7 - ManifestRecord_Identifier_CHAT_FOLDER ManifestRecord_Identifier_Type = 8 - ManifestRecord_Identifier_NOTIFICATION_PROFILE ManifestRecord_Identifier_Type = 9 -) - -// Enum value maps for ManifestRecord_Identifier_Type. -var ( - ManifestRecord_Identifier_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "CONTACT", - 2: "GROUPV1", - 3: "GROUPV2", - 4: "ACCOUNT", - 5: "STORY_DISTRIBUTION_LIST", - 6: "STICKER_PACK", - 7: "CALL_LINK", - 8: "CHAT_FOLDER", - 9: "NOTIFICATION_PROFILE", - } - ManifestRecord_Identifier_Type_value = map[string]int32{ - "UNKNOWN": 0, - "CONTACT": 1, - "GROUPV1": 2, - "GROUPV2": 3, - "ACCOUNT": 4, - "STORY_DISTRIBUTION_LIST": 5, - "STICKER_PACK": 6, - "CALL_LINK": 7, - "CHAT_FOLDER": 8, - "NOTIFICATION_PROFILE": 9, - } -) - -func (x ManifestRecord_Identifier_Type) Enum() *ManifestRecord_Identifier_Type { - p := new(ManifestRecord_Identifier_Type) - *p = x - return p -} - -func (x ManifestRecord_Identifier_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ManifestRecord_Identifier_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[2].Descriptor() -} - -func (ManifestRecord_Identifier_Type) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[2] -} - -func (x ManifestRecord_Identifier_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ManifestRecord_Identifier_Type.Descriptor instead. -func (ManifestRecord_Identifier_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{5, 0, 0} -} - -type ContactRecord_IdentityState int32 - -const ( - ContactRecord_DEFAULT ContactRecord_IdentityState = 0 - ContactRecord_VERIFIED ContactRecord_IdentityState = 1 - ContactRecord_UNVERIFIED ContactRecord_IdentityState = 2 -) - -// Enum value maps for ContactRecord_IdentityState. -var ( - ContactRecord_IdentityState_name = map[int32]string{ - 0: "DEFAULT", - 1: "VERIFIED", - 2: "UNVERIFIED", - } - ContactRecord_IdentityState_value = map[string]int32{ - "DEFAULT": 0, - "VERIFIED": 1, - "UNVERIFIED": 2, - } -) - -func (x ContactRecord_IdentityState) Enum() *ContactRecord_IdentityState { - p := new(ContactRecord_IdentityState) - *p = x - return p -} - -func (x ContactRecord_IdentityState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ContactRecord_IdentityState) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[3].Descriptor() -} - -func (ContactRecord_IdentityState) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[3] -} - -func (x ContactRecord_IdentityState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ContactRecord_IdentityState.Descriptor instead. -func (ContactRecord_IdentityState) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{7, 0} -} - -type GroupV2Record_StorySendMode int32 - -const ( - GroupV2Record_DEFAULT GroupV2Record_StorySendMode = 0 - GroupV2Record_DISABLED GroupV2Record_StorySendMode = 1 - GroupV2Record_ENABLED GroupV2Record_StorySendMode = 2 -) - -// Enum value maps for GroupV2Record_StorySendMode. -var ( - GroupV2Record_StorySendMode_name = map[int32]string{ - 0: "DEFAULT", - 1: "DISABLED", - 2: "ENABLED", - } - GroupV2Record_StorySendMode_value = map[string]int32{ - "DEFAULT": 0, - "DISABLED": 1, - "ENABLED": 2, - } -) - -func (x GroupV2Record_StorySendMode) Enum() *GroupV2Record_StorySendMode { - p := new(GroupV2Record_StorySendMode) - *p = x - return p -} - -func (x GroupV2Record_StorySendMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (GroupV2Record_StorySendMode) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[4].Descriptor() -} - -func (GroupV2Record_StorySendMode) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[4] -} - -func (x GroupV2Record_StorySendMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use GroupV2Record_StorySendMode.Descriptor instead. -func (GroupV2Record_StorySendMode) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{9, 0} -} - -type AccountRecord_UnreadBadgeType int32 - -const ( - AccountRecord_UNKNOWN_BADGE_TYPE AccountRecord_UnreadBadgeType = 0 // Interpret as "Unread messages" - AccountRecord_UNREAD_MESSAGES AccountRecord_UnreadBadgeType = 1 - AccountRecord_UNREAD_CHATS AccountRecord_UnreadBadgeType = 2 -) - -// Enum value maps for AccountRecord_UnreadBadgeType. -var ( - AccountRecord_UnreadBadgeType_name = map[int32]string{ - 0: "UNKNOWN_BADGE_TYPE", - 1: "UNREAD_MESSAGES", - 2: "UNREAD_CHATS", - } - AccountRecord_UnreadBadgeType_value = map[string]int32{ - "UNKNOWN_BADGE_TYPE": 0, - "UNREAD_MESSAGES": 1, - "UNREAD_CHATS": 2, - } -) - -func (x AccountRecord_UnreadBadgeType) Enum() *AccountRecord_UnreadBadgeType { - p := new(AccountRecord_UnreadBadgeType) - *p = x - return p -} - -func (x AccountRecord_UnreadBadgeType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountRecord_UnreadBadgeType) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[5].Descriptor() -} - -func (AccountRecord_UnreadBadgeType) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[5] -} - -func (x AccountRecord_UnreadBadgeType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountRecord_UnreadBadgeType.Descriptor instead. -func (AccountRecord_UnreadBadgeType) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 0} -} - -type AccountRecord_PhoneNumberSharingMode int32 - -const ( - AccountRecord_UNKNOWN AccountRecord_PhoneNumberSharingMode = 0 - AccountRecord_EVERYBODY AccountRecord_PhoneNumberSharingMode = 1 - AccountRecord_NOBODY AccountRecord_PhoneNumberSharingMode = 2 -) - -// Enum value maps for AccountRecord_PhoneNumberSharingMode. -var ( - AccountRecord_PhoneNumberSharingMode_name = map[int32]string{ - 0: "UNKNOWN", - 1: "EVERYBODY", - 2: "NOBODY", - } - AccountRecord_PhoneNumberSharingMode_value = map[string]int32{ - "UNKNOWN": 0, - "EVERYBODY": 1, - "NOBODY": 2, - } -) - -func (x AccountRecord_PhoneNumberSharingMode) Enum() *AccountRecord_PhoneNumberSharingMode { - p := new(AccountRecord_PhoneNumberSharingMode) - *p = x - return p -} - -func (x AccountRecord_PhoneNumberSharingMode) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountRecord_PhoneNumberSharingMode) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[6].Descriptor() -} - -func (AccountRecord_PhoneNumberSharingMode) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[6] -} - -func (x AccountRecord_PhoneNumberSharingMode) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountRecord_PhoneNumberSharingMode.Descriptor instead. -func (AccountRecord_PhoneNumberSharingMode) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 1} -} - -type AccountRecord_UsernameLink_Color int32 - -const ( - AccountRecord_UsernameLink_UNKNOWN AccountRecord_UsernameLink_Color = 0 - AccountRecord_UsernameLink_BLUE AccountRecord_UsernameLink_Color = 1 - AccountRecord_UsernameLink_WHITE AccountRecord_UsernameLink_Color = 2 - AccountRecord_UsernameLink_GREY AccountRecord_UsernameLink_Color = 3 - AccountRecord_UsernameLink_OLIVE AccountRecord_UsernameLink_Color = 4 - AccountRecord_UsernameLink_GREEN AccountRecord_UsernameLink_Color = 5 - AccountRecord_UsernameLink_ORANGE AccountRecord_UsernameLink_Color = 6 - AccountRecord_UsernameLink_PINK AccountRecord_UsernameLink_Color = 7 - AccountRecord_UsernameLink_PURPLE AccountRecord_UsernameLink_Color = 8 -) - -// Enum value maps for AccountRecord_UsernameLink_Color. -var ( - AccountRecord_UsernameLink_Color_name = map[int32]string{ - 0: "UNKNOWN", - 1: "BLUE", - 2: "WHITE", - 3: "GREY", - 4: "OLIVE", - 5: "GREEN", - 6: "ORANGE", - 7: "PINK", - 8: "PURPLE", - } - AccountRecord_UsernameLink_Color_value = map[string]int32{ - "UNKNOWN": 0, - "BLUE": 1, - "WHITE": 2, - "GREY": 3, - "OLIVE": 4, - "GREEN": 5, - "ORANGE": 6, - "PINK": 7, - "PURPLE": 8, - } -) - -func (x AccountRecord_UsernameLink_Color) Enum() *AccountRecord_UsernameLink_Color { - p := new(AccountRecord_UsernameLink_Color) - *p = x - return p -} - -func (x AccountRecord_UsernameLink_Color) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (AccountRecord_UsernameLink_Color) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[7].Descriptor() -} - -func (AccountRecord_UsernameLink_Color) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[7] -} - -func (x AccountRecord_UsernameLink_Color) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use AccountRecord_UsernameLink_Color.Descriptor instead. -func (AccountRecord_UsernameLink_Color) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 1, 0} -} - -// Represents the default "All chats" folder record vs all other custom folders -type ChatFolderRecord_FolderType int32 - -const ( - ChatFolderRecord_UNKNOWN ChatFolderRecord_FolderType = 0 - ChatFolderRecord_ALL ChatFolderRecord_FolderType = 1 - ChatFolderRecord_CUSTOM ChatFolderRecord_FolderType = 2 -) - -// Enum value maps for ChatFolderRecord_FolderType. -var ( - ChatFolderRecord_FolderType_name = map[int32]string{ - 0: "UNKNOWN", - 1: "ALL", - 2: "CUSTOM", - } - ChatFolderRecord_FolderType_value = map[string]int32{ - "UNKNOWN": 0, - "ALL": 1, - "CUSTOM": 2, - } -) - -func (x ChatFolderRecord_FolderType) Enum() *ChatFolderRecord_FolderType { - p := new(ChatFolderRecord_FolderType) - *p = x - return p -} - -func (x ChatFolderRecord_FolderType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ChatFolderRecord_FolderType) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[8].Descriptor() -} - -func (ChatFolderRecord_FolderType) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[8] -} - -func (x ChatFolderRecord_FolderType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ChatFolderRecord_FolderType.Descriptor instead. -func (ChatFolderRecord_FolderType) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{16, 0} -} - -type NotificationProfile_DayOfWeek int32 - -const ( - NotificationProfile_UNKNOWN NotificationProfile_DayOfWeek = 0 // Interpret as "Monday" - NotificationProfile_MONDAY NotificationProfile_DayOfWeek = 1 - NotificationProfile_TUESDAY NotificationProfile_DayOfWeek = 2 - NotificationProfile_WEDNESDAY NotificationProfile_DayOfWeek = 3 - NotificationProfile_THURSDAY NotificationProfile_DayOfWeek = 4 - NotificationProfile_FRIDAY NotificationProfile_DayOfWeek = 5 - NotificationProfile_SATURDAY NotificationProfile_DayOfWeek = 6 - NotificationProfile_SUNDAY NotificationProfile_DayOfWeek = 7 -) - -// Enum value maps for NotificationProfile_DayOfWeek. -var ( - NotificationProfile_DayOfWeek_name = map[int32]string{ - 0: "UNKNOWN", - 1: "MONDAY", - 2: "TUESDAY", - 3: "WEDNESDAY", - 4: "THURSDAY", - 5: "FRIDAY", - 6: "SATURDAY", - 7: "SUNDAY", - } - NotificationProfile_DayOfWeek_value = map[string]int32{ - "UNKNOWN": 0, - "MONDAY": 1, - "TUESDAY": 2, - "WEDNESDAY": 3, - "THURSDAY": 4, - "FRIDAY": 5, - "SATURDAY": 6, - "SUNDAY": 7, - } -) - -func (x NotificationProfile_DayOfWeek) Enum() *NotificationProfile_DayOfWeek { - p := new(NotificationProfile_DayOfWeek) - *p = x - return p -} - -func (x NotificationProfile_DayOfWeek) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NotificationProfile_DayOfWeek) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_StorageService_proto_enumTypes[9].Descriptor() -} - -func (NotificationProfile_DayOfWeek) Type() protoreflect.EnumType { - return &file_signalpb_StorageService_proto_enumTypes[9] -} - -func (x NotificationProfile_DayOfWeek) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NotificationProfile_DayOfWeek.Descriptor instead. -func (NotificationProfile_DayOfWeek) EnumDescriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{17, 0} -} - -type StorageManifest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StorageManifest) Reset() { - *x = StorageManifest{} - mi := &file_signalpb_StorageService_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StorageManifest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StorageManifest) ProtoMessage() {} - -func (x *StorageManifest) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[0] - 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 StorageManifest.ProtoReflect.Descriptor instead. -func (*StorageManifest) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{0} -} - -func (x *StorageManifest) GetVersion() uint64 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *StorageManifest) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -type StorageItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StorageItem) Reset() { - *x = StorageItem{} - mi := &file_signalpb_StorageService_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StorageItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StorageItem) ProtoMessage() {} - -func (x *StorageItem) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[1] - 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 StorageItem.ProtoReflect.Descriptor instead. -func (*StorageItem) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{1} -} - -func (x *StorageItem) GetKey() []byte { - if x != nil { - return x.Key - } - return nil -} - -func (x *StorageItem) GetValue() []byte { - if x != nil { - return x.Value - } - return nil -} - -type StorageItems struct { - state protoimpl.MessageState `protogen:"open.v1"` - Items []*StorageItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StorageItems) Reset() { - *x = StorageItems{} - mi := &file_signalpb_StorageService_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StorageItems) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StorageItems) ProtoMessage() {} - -func (x *StorageItems) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[2] - 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 StorageItems.ProtoReflect.Descriptor instead. -func (*StorageItems) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{2} -} - -func (x *StorageItems) GetItems() []*StorageItem { - if x != nil { - return x.Items - } - return nil -} - -type ReadOperation struct { - state protoimpl.MessageState `protogen:"open.v1"` - ReadKey [][]byte `protobuf:"bytes,1,rep,name=readKey,proto3" json:"readKey,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ReadOperation) Reset() { - *x = ReadOperation{} - mi := &file_signalpb_StorageService_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ReadOperation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ReadOperation) ProtoMessage() {} - -func (x *ReadOperation) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[3] - 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 ReadOperation.ProtoReflect.Descriptor instead. -func (*ReadOperation) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{3} -} - -func (x *ReadOperation) GetReadKey() [][]byte { - if x != nil { - return x.ReadKey - } - return nil -} - -type WriteOperation struct { - state protoimpl.MessageState `protogen:"open.v1"` - Manifest *StorageManifest `protobuf:"bytes,1,opt,name=manifest,proto3" json:"manifest,omitempty"` - InsertItem []*StorageItem `protobuf:"bytes,2,rep,name=insertItem,proto3" json:"insertItem,omitempty"` - DeleteKey [][]byte `protobuf:"bytes,3,rep,name=deleteKey,proto3" json:"deleteKey,omitempty"` - ClearAll bool `protobuf:"varint,4,opt,name=clearAll,proto3" json:"clearAll,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WriteOperation) Reset() { - *x = WriteOperation{} - mi := &file_signalpb_StorageService_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WriteOperation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteOperation) ProtoMessage() {} - -func (x *WriteOperation) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[4] - 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 WriteOperation.ProtoReflect.Descriptor instead. -func (*WriteOperation) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{4} -} - -func (x *WriteOperation) GetManifest() *StorageManifest { - if x != nil { - return x.Manifest - } - return nil -} - -func (x *WriteOperation) GetInsertItem() []*StorageItem { - if x != nil { - return x.InsertItem - } - return nil -} - -func (x *WriteOperation) GetDeleteKey() [][]byte { - if x != nil { - return x.DeleteKey - } - return nil -} - -func (x *WriteOperation) GetClearAll() bool { - if x != nil { - return x.ClearAll - } - return false -} - -type ManifestRecord struct { - state protoimpl.MessageState `protogen:"open.v1"` - Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` - SourceDevice uint32 `protobuf:"varint,3,opt,name=sourceDevice,proto3" json:"sourceDevice,omitempty"` - Identifiers []*ManifestRecord_Identifier `protobuf:"bytes,2,rep,name=identifiers,proto3" json:"identifiers,omitempty"` - RecordIkm []byte `protobuf:"bytes,4,opt,name=recordIkm,proto3" json:"recordIkm,omitempty"` // Next ID: 5 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ManifestRecord) Reset() { - *x = ManifestRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ManifestRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ManifestRecord) ProtoMessage() {} - -func (x *ManifestRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[5] - 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 ManifestRecord.ProtoReflect.Descriptor instead. -func (*ManifestRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{5} -} - -func (x *ManifestRecord) GetVersion() uint64 { - if x != nil { - return x.Version - } - return 0 -} - -func (x *ManifestRecord) GetSourceDevice() uint32 { - if x != nil { - return x.SourceDevice - } - return 0 -} - -func (x *ManifestRecord) GetIdentifiers() []*ManifestRecord_Identifier { - if x != nil { - return x.Identifiers - } - return nil -} - -func (x *ManifestRecord) GetRecordIkm() []byte { - if x != nil { - return x.RecordIkm - } - return nil -} - -type StorageRecord struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Record: - // - // *StorageRecord_Contact - // *StorageRecord_GroupV1 - // *StorageRecord_GroupV2 - // *StorageRecord_Account - // *StorageRecord_StoryDistributionList - // *StorageRecord_StickerPack - // *StorageRecord_CallLink - // *StorageRecord_ChatFolder - // *StorageRecord_NotificationProfile - Record isStorageRecord_Record `protobuf_oneof:"record"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StorageRecord) Reset() { - *x = StorageRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StorageRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StorageRecord) ProtoMessage() {} - -func (x *StorageRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[6] - 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 StorageRecord.ProtoReflect.Descriptor instead. -func (*StorageRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{6} -} - -func (x *StorageRecord) GetRecord() isStorageRecord_Record { - if x != nil { - return x.Record - } - return nil -} - -func (x *StorageRecord) GetContact() *ContactRecord { - if x != nil { - if x, ok := x.Record.(*StorageRecord_Contact); ok { - return x.Contact - } - } - return nil -} - -func (x *StorageRecord) GetGroupV1() *GroupV1Record { - if x != nil { - if x, ok := x.Record.(*StorageRecord_GroupV1); ok { - return x.GroupV1 - } - } - return nil -} - -func (x *StorageRecord) GetGroupV2() *GroupV2Record { - if x != nil { - if x, ok := x.Record.(*StorageRecord_GroupV2); ok { - return x.GroupV2 - } - } - return nil -} - -func (x *StorageRecord) GetAccount() *AccountRecord { - if x != nil { - if x, ok := x.Record.(*StorageRecord_Account); ok { - return x.Account - } - } - return nil -} - -func (x *StorageRecord) GetStoryDistributionList() *StoryDistributionListRecord { - if x != nil { - if x, ok := x.Record.(*StorageRecord_StoryDistributionList); ok { - return x.StoryDistributionList - } - } - return nil -} - -func (x *StorageRecord) GetStickerPack() *StickerPackRecord { - if x != nil { - if x, ok := x.Record.(*StorageRecord_StickerPack); ok { - return x.StickerPack - } - } - return nil -} - -func (x *StorageRecord) GetCallLink() *CallLinkRecord { - if x != nil { - if x, ok := x.Record.(*StorageRecord_CallLink); ok { - return x.CallLink - } - } - return nil -} - -func (x *StorageRecord) GetChatFolder() *ChatFolderRecord { - if x != nil { - if x, ok := x.Record.(*StorageRecord_ChatFolder); ok { - return x.ChatFolder - } - } - return nil -} - -func (x *StorageRecord) GetNotificationProfile() *NotificationProfile { - if x != nil { - if x, ok := x.Record.(*StorageRecord_NotificationProfile); ok { - return x.NotificationProfile - } - } - return nil -} - -type isStorageRecord_Record interface { - isStorageRecord_Record() -} - -type StorageRecord_Contact struct { - Contact *ContactRecord `protobuf:"bytes,1,opt,name=contact,proto3,oneof"` -} - -type StorageRecord_GroupV1 struct { - GroupV1 *GroupV1Record `protobuf:"bytes,2,opt,name=groupV1,proto3,oneof"` -} - -type StorageRecord_GroupV2 struct { - GroupV2 *GroupV2Record `protobuf:"bytes,3,opt,name=groupV2,proto3,oneof"` -} - -type StorageRecord_Account struct { - Account *AccountRecord `protobuf:"bytes,4,opt,name=account,proto3,oneof"` -} - -type StorageRecord_StoryDistributionList struct { - StoryDistributionList *StoryDistributionListRecord `protobuf:"bytes,5,opt,name=storyDistributionList,proto3,oneof"` -} - -type StorageRecord_StickerPack struct { - StickerPack *StickerPackRecord `protobuf:"bytes,6,opt,name=stickerPack,proto3,oneof"` -} - -type StorageRecord_CallLink struct { - CallLink *CallLinkRecord `protobuf:"bytes,7,opt,name=callLink,proto3,oneof"` -} - -type StorageRecord_ChatFolder struct { - ChatFolder *ChatFolderRecord `protobuf:"bytes,8,opt,name=chatFolder,proto3,oneof"` -} - -type StorageRecord_NotificationProfile struct { - NotificationProfile *NotificationProfile `protobuf:"bytes,9,opt,name=notificationProfile,proto3,oneof"` -} - -func (*StorageRecord_Contact) isStorageRecord_Record() {} - -func (*StorageRecord_GroupV1) isStorageRecord_Record() {} - -func (*StorageRecord_GroupV2) isStorageRecord_Record() {} - -func (*StorageRecord_Account) isStorageRecord_Record() {} - -func (*StorageRecord_StoryDistributionList) isStorageRecord_Record() {} - -func (*StorageRecord_StickerPack) isStorageRecord_Record() {} - -func (*StorageRecord_CallLink) isStorageRecord_Record() {} - -func (*StorageRecord_ChatFolder) isStorageRecord_Record() {} - -func (*StorageRecord_NotificationProfile) isStorageRecord_Record() {} - -type ContactRecord struct { - state protoimpl.MessageState `protogen:"open.v1"` - Aci string `protobuf:"bytes,1,opt,name=aci,proto3" json:"aci,omitempty"` - E164 string `protobuf:"bytes,2,opt,name=e164,proto3" json:"e164,omitempty"` - Pni string `protobuf:"bytes,15,opt,name=pni,proto3" json:"pni,omitempty"` - ProfileKey []byte `protobuf:"bytes,3,opt,name=profileKey,proto3" json:"profileKey,omitempty"` - IdentityKey []byte `protobuf:"bytes,4,opt,name=identityKey,proto3" json:"identityKey,omitempty"` - IdentityState ContactRecord_IdentityState `protobuf:"varint,5,opt,name=identityState,proto3,enum=signalservice.ContactRecord_IdentityState" json:"identityState,omitempty"` - GivenName string `protobuf:"bytes,6,opt,name=givenName,proto3" json:"givenName,omitempty"` - FamilyName string `protobuf:"bytes,7,opt,name=familyName,proto3" json:"familyName,omitempty"` - Username string `protobuf:"bytes,8,opt,name=username,proto3" json:"username,omitempty"` - Blocked bool `protobuf:"varint,9,opt,name=blocked,proto3" json:"blocked,omitempty"` - Whitelisted bool `protobuf:"varint,10,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"` - Archived bool `protobuf:"varint,11,opt,name=archived,proto3" json:"archived,omitempty"` - MarkedUnread bool `protobuf:"varint,12,opt,name=markedUnread,proto3" json:"markedUnread,omitempty"` - MutedUntilTimestamp uint64 `protobuf:"varint,13,opt,name=mutedUntilTimestamp,proto3" json:"mutedUntilTimestamp,omitempty"` - HideStory bool `protobuf:"varint,14,opt,name=hideStory,proto3" json:"hideStory,omitempty"` - UnregisteredAtTimestamp uint64 `protobuf:"varint,16,opt,name=unregisteredAtTimestamp,proto3" json:"unregisteredAtTimestamp,omitempty"` - SystemGivenName string `protobuf:"bytes,17,opt,name=systemGivenName,proto3" json:"systemGivenName,omitempty"` - SystemFamilyName string `protobuf:"bytes,18,opt,name=systemFamilyName,proto3" json:"systemFamilyName,omitempty"` - SystemNickname string `protobuf:"bytes,19,opt,name=systemNickname,proto3" json:"systemNickname,omitempty"` - Hidden bool `protobuf:"varint,20,opt,name=hidden,proto3" json:"hidden,omitempty"` - 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 - BlockedAtTimestamp uint64 `protobuf:"varint,27,opt,name=blockedAtTimestamp,proto3" json:"blockedAtTimestamp,omitempty"` // 0 means the blocked time is unknown - NotifyForCallsIfMuted OptionalBool `protobuf:"varint,28,opt,name=notifyForCallsIfMuted,proto3,enum=signalservice.OptionalBool" json:"notifyForCallsIfMuted,omitempty"` // If unset, use the default settings - ShowUnreadReminders OptionalBool `protobuf:"varint,29,opt,name=showUnreadReminders,proto3,enum=signalservice.OptionalBool" json:"showUnreadReminders,omitempty"` // If unset, use the default settings - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactRecord) Reset() { - *x = ContactRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactRecord) ProtoMessage() {} - -func (x *ContactRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[7] - 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 ContactRecord.ProtoReflect.Descriptor instead. -func (*ContactRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{7} -} - -func (x *ContactRecord) GetAci() string { - if x != nil { - return x.Aci - } - return "" -} - -func (x *ContactRecord) GetE164() string { - if x != nil { - return x.E164 - } - return "" -} - -func (x *ContactRecord) GetPni() string { - if x != nil { - return x.Pni - } - return "" -} - -func (x *ContactRecord) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *ContactRecord) GetIdentityKey() []byte { - if x != nil { - return x.IdentityKey - } - return nil -} - -func (x *ContactRecord) GetIdentityState() ContactRecord_IdentityState { - if x != nil { - return x.IdentityState - } - return ContactRecord_DEFAULT -} - -func (x *ContactRecord) GetGivenName() string { - if x != nil { - return x.GivenName - } - return "" -} - -func (x *ContactRecord) GetFamilyName() string { - if x != nil { - return x.FamilyName - } - return "" -} - -func (x *ContactRecord) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *ContactRecord) GetBlocked() bool { - if x != nil { - return x.Blocked - } - return false -} - -func (x *ContactRecord) GetWhitelisted() bool { - if x != nil { - return x.Whitelisted - } - return false -} - -func (x *ContactRecord) GetArchived() bool { - if x != nil { - return x.Archived - } - return false -} - -func (x *ContactRecord) GetMarkedUnread() bool { - if x != nil { - return x.MarkedUnread - } - return false -} - -func (x *ContactRecord) GetMutedUntilTimestamp() uint64 { - if x != nil { - return x.MutedUntilTimestamp - } - return 0 -} - -func (x *ContactRecord) GetHideStory() bool { - if x != nil { - return x.HideStory - } - return false -} - -func (x *ContactRecord) GetUnregisteredAtTimestamp() uint64 { - if x != nil { - return x.UnregisteredAtTimestamp - } - return 0 -} - -func (x *ContactRecord) GetSystemGivenName() string { - if x != nil { - return x.SystemGivenName - } - return "" -} - -func (x *ContactRecord) GetSystemFamilyName() string { - if x != nil { - return x.SystemFamilyName - } - return "" -} - -func (x *ContactRecord) GetSystemNickname() string { - if x != nil { - return x.SystemNickname - } - return "" -} - -func (x *ContactRecord) GetHidden() bool { - if x != nil { - return x.Hidden - } - return false -} - -func (x *ContactRecord) GetPniSignatureVerified() bool { - if x != nil { - return x.PniSignatureVerified - } - return false -} - -func (x *ContactRecord) GetNickname() *ContactRecord_Name { - if x != nil { - return x.Nickname - } - return nil -} - -func (x *ContactRecord) GetNote() string { - if x != nil { - return x.Note - } - return "" -} - -func (x *ContactRecord) GetAvatarColor() AvatarColor { - if x != nil && x.AvatarColor != nil { - return *x.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 -} - -func (x *ContactRecord) GetBlockedAtTimestamp() uint64 { - if x != nil { - return x.BlockedAtTimestamp - } - return 0 -} - -func (x *ContactRecord) GetNotifyForCallsIfMuted() OptionalBool { - if x != nil { - return x.NotifyForCallsIfMuted - } - return OptionalBool_UNSET -} - -func (x *ContactRecord) GetShowUnreadReminders() OptionalBool { - if x != nil { - return x.ShowUnreadReminders - } - return OptionalBool_UNSET -} - -type GroupV1Record struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Blocked bool `protobuf:"varint,2,opt,name=blocked,proto3" json:"blocked,omitempty"` - Whitelisted bool `protobuf:"varint,3,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"` - Archived bool `protobuf:"varint,4,opt,name=archived,proto3" json:"archived,omitempty"` - MarkedUnread bool `protobuf:"varint,5,opt,name=markedUnread,proto3" json:"markedUnread,omitempty"` - MutedUntilTimestamp uint64 `protobuf:"varint,6,opt,name=mutedUntilTimestamp,proto3" json:"mutedUntilTimestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupV1Record) Reset() { - *x = GroupV1Record{} - mi := &file_signalpb_StorageService_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupV1Record) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupV1Record) ProtoMessage() {} - -func (x *GroupV1Record) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 GroupV1Record.ProtoReflect.Descriptor instead. -func (*GroupV1Record) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{8} -} - -func (x *GroupV1Record) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} - -func (x *GroupV1Record) GetBlocked() bool { - if x != nil { - return x.Blocked - } - return false -} - -func (x *GroupV1Record) GetWhitelisted() bool { - if x != nil { - return x.Whitelisted - } - return false -} - -func (x *GroupV1Record) GetArchived() bool { - if x != nil { - return x.Archived - } - return false -} - -func (x *GroupV1Record) GetMarkedUnread() bool { - if x != nil { - return x.MarkedUnread - } - return false -} - -func (x *GroupV1Record) GetMutedUntilTimestamp() uint64 { - if x != nil { - return x.MutedUntilTimestamp - } - return 0 -} - -type GroupV2Record struct { - state protoimpl.MessageState `protogen:"open.v1"` - MasterKey []byte `protobuf:"bytes,1,opt,name=masterKey,proto3" json:"masterKey,omitempty"` - Blocked bool `protobuf:"varint,2,opt,name=blocked,proto3" json:"blocked,omitempty"` - Whitelisted bool `protobuf:"varint,3,opt,name=whitelisted,proto3" json:"whitelisted,omitempty"` - Archived bool `protobuf:"varint,4,opt,name=archived,proto3" json:"archived,omitempty"` - MarkedUnread bool `protobuf:"varint,5,opt,name=markedUnread,proto3" json:"markedUnread,omitempty"` - MutedUntilTimestamp uint64 `protobuf:"varint,6,opt,name=mutedUntilTimestamp,proto3" json:"mutedUntilTimestamp,omitempty"` - DontNotifyForMentionsIfMuted bool `protobuf:"varint,7,opt,name=dontNotifyForMentionsIfMuted,proto3" json:"dontNotifyForMentionsIfMuted,omitempty"` // will be deprecated in favor of [notifyForMentionsIfMuted] - 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 - BlockedAtTimestamp uint64 `protobuf:"varint,13,opt,name=blockedAtTimestamp,proto3" json:"blockedAtTimestamp,omitempty"` // 0 means the blocked time is unknown - NotifyForCallsIfMuted OptionalBool `protobuf:"varint,14,opt,name=notifyForCallsIfMuted,proto3,enum=signalservice.OptionalBool" json:"notifyForCallsIfMuted,omitempty"` // If unset, use the default settings - NotifyForMentionsIfMuted OptionalBool `protobuf:"varint,15,opt,name=notifyForMentionsIfMuted,proto3,enum=signalservice.OptionalBool" json:"notifyForMentionsIfMuted,omitempty"` // If unset, use the default settings. If [dontNotifyForMentionsIfMuted] is true, this should be initialized to false. - NotifyForRepliesIfMuted OptionalBool `protobuf:"varint,16,opt,name=notifyForRepliesIfMuted,proto3,enum=signalservice.OptionalBool" json:"notifyForRepliesIfMuted,omitempty"` // If unset, use the default settings - ShowUnreadReminders OptionalBool `protobuf:"varint,17,opt,name=showUnreadReminders,proto3,enum=signalservice.OptionalBool" json:"showUnreadReminders,omitempty"` // If unset, use the default settings - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GroupV2Record) Reset() { - *x = GroupV2Record{} - mi := &file_signalpb_StorageService_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GroupV2Record) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GroupV2Record) ProtoMessage() {} - -func (x *GroupV2Record) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 GroupV2Record.ProtoReflect.Descriptor instead. -func (*GroupV2Record) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{9} -} - -func (x *GroupV2Record) GetMasterKey() []byte { - if x != nil { - return x.MasterKey - } - return nil -} - -func (x *GroupV2Record) GetBlocked() bool { - if x != nil { - return x.Blocked - } - return false -} - -func (x *GroupV2Record) GetWhitelisted() bool { - if x != nil { - return x.Whitelisted - } - return false -} - -func (x *GroupV2Record) GetArchived() bool { - if x != nil { - return x.Archived - } - return false -} - -func (x *GroupV2Record) GetMarkedUnread() bool { - if x != nil { - return x.MarkedUnread - } - return false -} - -func (x *GroupV2Record) GetMutedUntilTimestamp() uint64 { - if x != nil { - return x.MutedUntilTimestamp - } - return 0 -} - -func (x *GroupV2Record) GetDontNotifyForMentionsIfMuted() bool { - if x != nil { - return x.DontNotifyForMentionsIfMuted - } - return false -} - -func (x *GroupV2Record) GetHideStory() bool { - if x != nil { - return x.HideStory - } - return false -} - -func (x *GroupV2Record) GetStorySendMode() GroupV2Record_StorySendMode { - if x != nil { - return x.StorySendMode - } - return GroupV2Record_DEFAULT -} - -func (x *GroupV2Record) GetAvatarColor() AvatarColor { - if x != nil && x.AvatarColor != nil { - return *x.AvatarColor - } - return AvatarColor_A100 -} - -func (x *GroupV2Record) GetVerifiedNameHash() []byte { - if x != nil { - return x.VerifiedNameHash - } - return nil -} - -func (x *GroupV2Record) GetBlockedAtTimestamp() uint64 { - if x != nil { - return x.BlockedAtTimestamp - } - return 0 -} - -func (x *GroupV2Record) GetNotifyForCallsIfMuted() OptionalBool { - if x != nil { - return x.NotifyForCallsIfMuted - } - return OptionalBool_UNSET -} - -func (x *GroupV2Record) GetNotifyForMentionsIfMuted() OptionalBool { - if x != nil { - return x.NotifyForMentionsIfMuted - } - return OptionalBool_UNSET -} - -func (x *GroupV2Record) GetNotifyForRepliesIfMuted() OptionalBool { - if x != nil { - return x.NotifyForRepliesIfMuted - } - return OptionalBool_UNSET -} - -func (x *GroupV2Record) GetShowUnreadReminders() OptionalBool { - if x != nil { - return x.ShowUnreadReminders - } - return OptionalBool_UNSET -} - -type Payments struct { - state protoimpl.MessageState `protogen:"open.v1"` - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - Entropy []byte `protobuf:"bytes,2,opt,name=entropy,proto3" json:"entropy,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Payments) Reset() { - *x = Payments{} - mi := &file_signalpb_StorageService_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Payments) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Payments) ProtoMessage() {} - -func (x *Payments) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 Payments.ProtoReflect.Descriptor instead. -func (*Payments) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{10} -} - -func (x *Payments) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -func (x *Payments) GetEntropy() []byte { - if x != nil { - return x.Entropy - } - return nil -} - -type AccountRecord struct { - state protoimpl.MessageState `protogen:"open.v1"` - ProfileKey []byte `protobuf:"bytes,1,opt,name=profileKey,proto3" json:"profileKey,omitempty"` - GivenName string `protobuf:"bytes,2,opt,name=givenName,proto3" json:"givenName,omitempty"` - FamilyName string `protobuf:"bytes,3,opt,name=familyName,proto3" json:"familyName,omitempty"` - AvatarUrlPath string `protobuf:"bytes,4,opt,name=avatarUrlPath,proto3" json:"avatarUrlPath,omitempty"` - NoteToSelfArchived bool `protobuf:"varint,5,opt,name=noteToSelfArchived,proto3" json:"noteToSelfArchived,omitempty"` - ReadReceipts bool `protobuf:"varint,6,opt,name=readReceipts,proto3" json:"readReceipts,omitempty"` - SealedSenderIndicators bool `protobuf:"varint,7,opt,name=sealedSenderIndicators,proto3" json:"sealedSenderIndicators,omitempty"` - TypingIndicators bool `protobuf:"varint,8,opt,name=typingIndicators,proto3" json:"typingIndicators,omitempty"` - NoteToSelfMarkedUnread bool `protobuf:"varint,10,opt,name=noteToSelfMarkedUnread,proto3" json:"noteToSelfMarkedUnread,omitempty"` - LinkPreviews bool `protobuf:"varint,11,opt,name=linkPreviews,proto3" json:"linkPreviews,omitempty"` - PhoneNumberSharingMode AccountRecord_PhoneNumberSharingMode `protobuf:"varint,12,opt,name=phoneNumberSharingMode,proto3,enum=signalservice.AccountRecord_PhoneNumberSharingMode" json:"phoneNumberSharingMode,omitempty"` - UnlistedPhoneNumber bool `protobuf:"varint,13,opt,name=unlistedPhoneNumber,proto3" json:"unlistedPhoneNumber,omitempty"` - PinnedConversations []*AccountRecord_PinnedConversation `protobuf:"bytes,14,rep,name=pinnedConversations,proto3" json:"pinnedConversations,omitempty"` - PreferContactAvatars bool `protobuf:"varint,15,opt,name=preferContactAvatars,proto3" json:"preferContactAvatars,omitempty"` - Payments *Payments `protobuf:"bytes,16,opt,name=payments,proto3" json:"payments,omitempty"` - UniversalExpireTimer uint32 `protobuf:"varint,17,opt,name=universalExpireTimer,proto3" json:"universalExpireTimer,omitempty"` - PrimarySendsSms bool `protobuf:"varint,18,opt,name=primarySendsSms,proto3" json:"primarySendsSms,omitempty"` - PreferredReactionEmoji []string `protobuf:"bytes,20,rep,name=preferredReactionEmoji,proto3" json:"preferredReactionEmoji,omitempty"` - SubscriberId []byte `protobuf:"bytes,21,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - SubscriberCurrencyCode string `protobuf:"bytes,22,opt,name=subscriberCurrencyCode,proto3" json:"subscriberCurrencyCode,omitempty"` - DisplayBadgesOnProfile bool `protobuf:"varint,23,opt,name=displayBadgesOnProfile,proto3" json:"displayBadgesOnProfile,omitempty"` - SubscriptionManuallyCancelled bool `protobuf:"varint,24,opt,name=subscriptionManuallyCancelled,proto3" json:"subscriptionManuallyCancelled,omitempty"` - KeepMutedChatsArchived bool `protobuf:"varint,25,opt,name=keepMutedChatsArchived,proto3" json:"keepMutedChatsArchived,omitempty"` - HasSetMyStoriesPrivacy bool `protobuf:"varint,26,opt,name=hasSetMyStoriesPrivacy,proto3" json:"hasSetMyStoriesPrivacy,omitempty"` - HasViewedOnboardingStory bool `protobuf:"varint,27,opt,name=hasViewedOnboardingStory,proto3" json:"hasViewedOnboardingStory,omitempty"` - StoriesDisabled bool `protobuf:"varint,29,opt,name=storiesDisabled,proto3" json:"storiesDisabled,omitempty"` - StoryViewReceiptsEnabled OptionalBool `protobuf:"varint,30,opt,name=storyViewReceiptsEnabled,proto3,enum=signalservice.OptionalBool" json:"storyViewReceiptsEnabled,omitempty"` - HasSeenGroupStoryEducationSheet bool `protobuf:"varint,32,opt,name=hasSeenGroupStoryEducationSheet,proto3" json:"hasSeenGroupStoryEducationSheet,omitempty"` - Username string `protobuf:"bytes,33,opt,name=username,proto3" json:"username,omitempty"` - HasCompletedUsernameOnboarding bool `protobuf:"varint,34,opt,name=hasCompletedUsernameOnboarding,proto3" json:"hasCompletedUsernameOnboarding,omitempty"` - UsernameLink *AccountRecord_UsernameLink `protobuf:"bytes,35,opt,name=usernameLink,proto3" json:"usernameLink,omitempty"` - BackupTier *uint64 `protobuf:"varint,40,opt,name=backupTier,proto3,oneof" json:"backupTier,omitempty"` // See zkgroup for integer particular values. Unset if backups are not enabled. - BackupSubscriberData *AccountRecord_IAPSubscriberData `protobuf:"bytes,41,opt,name=backupSubscriberData,proto3" json:"backupSubscriberData,omitempty"` - AvatarColor *AvatarColor `protobuf:"varint,42,opt,name=avatarColor,proto3,enum=signalservice.AvatarColor,oneof" json:"avatarColor,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"` - ReleaseNotesChatArchived *bool `protobuf:"varint,48,opt,name=releaseNotesChatArchived,proto3,oneof" json:"releaseNotesChatArchived,omitempty"` - ReleaseNotesChatMutedUntilTimestamp *uint64 `protobuf:"varint,49,opt,name=releaseNotesChatMutedUntilTimestamp,proto3,oneof" json:"releaseNotesChatMutedUntilTimestamp,omitempty"` - ReleaseNotesChatBlocked *bool `protobuf:"varint,50,opt,name=releaseNotesChatBlocked,proto3,oneof" json:"releaseNotesChatBlocked,omitempty"` - ReleaseNotesChatMarkedUnread *bool `protobuf:"varint,51,opt,name=releaseNotesChatMarkedUnread,proto3,oneof" json:"releaseNotesChatMarkedUnread,omitempty"` - ReleaseNotesChatBlockedAt *uint64 `protobuf:"varint,52,opt,name=releaseNotesChatBlockedAt,proto3,oneof" json:"releaseNotesChatBlockedAt,omitempty"` // only set if known (>0) - UnreadBadgeType AccountRecord_UnreadBadgeType `protobuf:"varint,53,opt,name=unreadBadgeType,proto3,enum=signalservice.AccountRecord_UnreadBadgeType" json:"unreadBadgeType,omitempty"` // Only used in desktop/ios - IncludeMutedChatsInBadge OptionalBool `protobuf:"varint,54,opt,name=includeMutedChatsInBadge,proto3,enum=signalservice.OptionalBool" json:"includeMutedChatsInBadge,omitempty"` // Only used in desktop/ios. If unset, consider this off. Only used in desktop/ios - ReactionNotifications OptionalBool `protobuf:"varint,55,opt,name=reactionNotifications,proto3,enum=signalservice.OptionalBool" json:"reactionNotifications,omitempty"` // If unset, consider this on - NotifyForCallsIfMuted OptionalBool `protobuf:"varint,56,opt,name=notifyForCallsIfMuted,proto3,enum=signalservice.OptionalBool" json:"notifyForCallsIfMuted,omitempty"` // If unset, consider this off - NotifyForMentionsIfMuted OptionalBool `protobuf:"varint,57,opt,name=notifyForMentionsIfMuted,proto3,enum=signalservice.OptionalBool" json:"notifyForMentionsIfMuted,omitempty"` // If unset, consider this on - NotifyForRepliesIfMuted OptionalBool `protobuf:"varint,58,opt,name=notifyForRepliesIfMuted,proto3,enum=signalservice.OptionalBool" json:"notifyForRepliesIfMuted,omitempty"` // If unset, consider this on - ShowUnreadReminders OptionalBool `protobuf:"varint,59,opt,name=showUnreadReminders,proto3,enum=signalservice.OptionalBool" json:"showUnreadReminders,omitempty"` // If unset, consider this on - NotifyWhenContactJoins OptionalBool `protobuf:"varint,60,opt,name=notifyWhenContactJoins,proto3,enum=signalservice.OptionalBool" json:"notifyWhenContactJoins,omitempty"` // If unset, consider this off - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountRecord) Reset() { - *x = AccountRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord) ProtoMessage() {} - -func (x *AccountRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[11] - 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 AccountRecord.ProtoReflect.Descriptor instead. -func (*AccountRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11} -} - -func (x *AccountRecord) GetProfileKey() []byte { - if x != nil { - return x.ProfileKey - } - return nil -} - -func (x *AccountRecord) GetGivenName() string { - if x != nil { - return x.GivenName - } - return "" -} - -func (x *AccountRecord) GetFamilyName() string { - if x != nil { - return x.FamilyName - } - return "" -} - -func (x *AccountRecord) GetAvatarUrlPath() string { - if x != nil { - return x.AvatarUrlPath - } - return "" -} - -func (x *AccountRecord) GetNoteToSelfArchived() bool { - if x != nil { - return x.NoteToSelfArchived - } - return false -} - -func (x *AccountRecord) GetReadReceipts() bool { - if x != nil { - return x.ReadReceipts - } - return false -} - -func (x *AccountRecord) GetSealedSenderIndicators() bool { - if x != nil { - return x.SealedSenderIndicators - } - return false -} - -func (x *AccountRecord) GetTypingIndicators() bool { - if x != nil { - return x.TypingIndicators - } - return false -} - -func (x *AccountRecord) GetNoteToSelfMarkedUnread() bool { - if x != nil { - return x.NoteToSelfMarkedUnread - } - return false -} - -func (x *AccountRecord) GetLinkPreviews() bool { - if x != nil { - return x.LinkPreviews - } - return false -} - -func (x *AccountRecord) GetPhoneNumberSharingMode() AccountRecord_PhoneNumberSharingMode { - if x != nil { - return x.PhoneNumberSharingMode - } - return AccountRecord_UNKNOWN -} - -func (x *AccountRecord) GetUnlistedPhoneNumber() bool { - if x != nil { - return x.UnlistedPhoneNumber - } - return false -} - -func (x *AccountRecord) GetPinnedConversations() []*AccountRecord_PinnedConversation { - if x != nil { - return x.PinnedConversations - } - return nil -} - -func (x *AccountRecord) GetPreferContactAvatars() bool { - if x != nil { - return x.PreferContactAvatars - } - return false -} - -func (x *AccountRecord) GetPayments() *Payments { - if x != nil { - return x.Payments - } - return nil -} - -func (x *AccountRecord) GetUniversalExpireTimer() uint32 { - if x != nil { - return x.UniversalExpireTimer - } - return 0 -} - -func (x *AccountRecord) GetPrimarySendsSms() bool { - if x != nil { - return x.PrimarySendsSms - } - return false -} - -func (x *AccountRecord) GetPreferredReactionEmoji() []string { - if x != nil { - return x.PreferredReactionEmoji - } - return nil -} - -func (x *AccountRecord) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *AccountRecord) GetSubscriberCurrencyCode() string { - if x != nil { - return x.SubscriberCurrencyCode - } - return "" -} - -func (x *AccountRecord) GetDisplayBadgesOnProfile() bool { - if x != nil { - return x.DisplayBadgesOnProfile - } - return false -} - -func (x *AccountRecord) GetSubscriptionManuallyCancelled() bool { - if x != nil { - return x.SubscriptionManuallyCancelled - } - return false -} - -func (x *AccountRecord) GetKeepMutedChatsArchived() bool { - if x != nil { - return x.KeepMutedChatsArchived - } - return false -} - -func (x *AccountRecord) GetHasSetMyStoriesPrivacy() bool { - if x != nil { - return x.HasSetMyStoriesPrivacy - } - return false -} - -func (x *AccountRecord) GetHasViewedOnboardingStory() bool { - if x != nil { - return x.HasViewedOnboardingStory - } - return false -} - -func (x *AccountRecord) GetStoriesDisabled() bool { - if x != nil { - return x.StoriesDisabled - } - return false -} - -func (x *AccountRecord) GetStoryViewReceiptsEnabled() OptionalBool { - if x != nil { - return x.StoryViewReceiptsEnabled - } - return OptionalBool_UNSET -} - -func (x *AccountRecord) GetHasSeenGroupStoryEducationSheet() bool { - if x != nil { - return x.HasSeenGroupStoryEducationSheet - } - return false -} - -func (x *AccountRecord) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *AccountRecord) GetHasCompletedUsernameOnboarding() bool { - if x != nil { - return x.HasCompletedUsernameOnboarding - } - return false -} - -func (x *AccountRecord) GetUsernameLink() *AccountRecord_UsernameLink { - if x != nil { - return x.UsernameLink - } - return nil -} - -func (x *AccountRecord) GetBackupTier() uint64 { - if x != nil && x.BackupTier != nil { - return *x.BackupTier - } - return 0 -} - -func (x *AccountRecord) GetBackupSubscriberData() *AccountRecord_IAPSubscriberData { - if x != nil { - return x.BackupSubscriberData - } - return nil -} - -func (x *AccountRecord) GetAvatarColor() AvatarColor { - if x != nil && x.AvatarColor != nil { - return *x.AvatarColor - } - return AvatarColor_A100 -} - -func (x *AccountRecord) GetNotificationProfileManualOverride() *AccountRecord_NotificationProfileManualOverride { - if x != nil { - return x.NotificationProfileManualOverride - } - 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 -} - -func (x *AccountRecord) GetReleaseNotesChatArchived() bool { - if x != nil && x.ReleaseNotesChatArchived != nil { - return *x.ReleaseNotesChatArchived - } - return false -} - -func (x *AccountRecord) GetReleaseNotesChatMutedUntilTimestamp() uint64 { - if x != nil && x.ReleaseNotesChatMutedUntilTimestamp != nil { - return *x.ReleaseNotesChatMutedUntilTimestamp - } - return 0 -} - -func (x *AccountRecord) GetReleaseNotesChatBlocked() bool { - if x != nil && x.ReleaseNotesChatBlocked != nil { - return *x.ReleaseNotesChatBlocked - } - return false -} - -func (x *AccountRecord) GetReleaseNotesChatMarkedUnread() bool { - if x != nil && x.ReleaseNotesChatMarkedUnread != nil { - return *x.ReleaseNotesChatMarkedUnread - } - return false -} - -func (x *AccountRecord) GetReleaseNotesChatBlockedAt() uint64 { - if x != nil && x.ReleaseNotesChatBlockedAt != nil { - return *x.ReleaseNotesChatBlockedAt - } - return 0 -} - -func (x *AccountRecord) GetUnreadBadgeType() AccountRecord_UnreadBadgeType { - if x != nil { - return x.UnreadBadgeType - } - return AccountRecord_UNKNOWN_BADGE_TYPE -} - -func (x *AccountRecord) GetIncludeMutedChatsInBadge() OptionalBool { - if x != nil { - return x.IncludeMutedChatsInBadge - } - return OptionalBool_UNSET -} - -func (x *AccountRecord) GetReactionNotifications() OptionalBool { - if x != nil { - return x.ReactionNotifications - } - return OptionalBool_UNSET -} - -func (x *AccountRecord) GetNotifyForCallsIfMuted() OptionalBool { - if x != nil { - return x.NotifyForCallsIfMuted - } - return OptionalBool_UNSET -} - -func (x *AccountRecord) GetNotifyForMentionsIfMuted() OptionalBool { - if x != nil { - return x.NotifyForMentionsIfMuted - } - return OptionalBool_UNSET -} - -func (x *AccountRecord) GetNotifyForRepliesIfMuted() OptionalBool { - if x != nil { - return x.NotifyForRepliesIfMuted - } - return OptionalBool_UNSET -} - -func (x *AccountRecord) GetShowUnreadReminders() OptionalBool { - if x != nil { - return x.ShowUnreadReminders - } - return OptionalBool_UNSET -} - -func (x *AccountRecord) GetNotifyWhenContactJoins() OptionalBool { - if x != nil { - return x.NotifyWhenContactJoins - } - return OptionalBool_UNSET -} - -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 -} - -func (x *StoryDistributionListRecord) Reset() { - *x = StoryDistributionListRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StoryDistributionListRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StoryDistributionListRecord) ProtoMessage() {} - -func (x *StoryDistributionListRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 StoryDistributionListRecord.ProtoReflect.Descriptor instead. -func (*StoryDistributionListRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{12} -} - -func (x *StoryDistributionListRecord) GetIdentifier() []byte { - if x != nil { - return x.Identifier - } - return nil -} - -func (x *StoryDistributionListRecord) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *StoryDistributionListRecord) GetRecipientServiceIds() []string { - if x != nil { - return x.RecipientServiceIds - } - return nil -} - -func (x *StoryDistributionListRecord) GetDeletedAtTimestamp() uint64 { - if x != nil { - return x.DeletedAtTimestamp - } - return 0 -} - -func (x *StoryDistributionListRecord) GetAllowsReplies() bool { - if x != nil { - return x.AllowsReplies - } - return false -} - -func (x *StoryDistributionListRecord) GetIsBlockList() bool { - if x != nil { - return x.IsBlockList - } - return false -} - -func (x *StoryDistributionListRecord) GetRecipientServiceIdsBinary() [][]byte { - if x != nil { - return x.RecipientServiceIdsBinary - } - return nil -} - -type StickerPackRecord struct { - state protoimpl.MessageState `protogen:"open.v1"` - PackId []byte `protobuf:"bytes,1,opt,name=packId,proto3" json:"packId,omitempty"` // 16 bytes - PackKey []byte `protobuf:"bytes,2,opt,name=packKey,proto3" json:"packKey,omitempty"` // 32 bytes, used to derive the AES-256 key - // aesKey = HKDF( - // - // input = packKey, - // salt = 32 zero bytes, - // info = "Sticker Pack" - // - // ) - Position uint32 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` // When displayed sticker packs should be first sorted - // in ascending order by zero-based `position` and - // then by ascending `packId` (lexicographically, - // packId can be treated as a hex string). - // When installing a sticker pack the client should find - // the maximum `position` among currently known stickers - // and use `max_position + 1` as the value for the new - // `position`. - DeletedAtTimestamp uint64 `protobuf:"varint,4,opt,name=deletedAtTimestamp,proto3" json:"deletedAtTimestamp,omitempty"` // Timestamp in milliseconds. When present and - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *StickerPackRecord) Reset() { - *x = StickerPackRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *StickerPackRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StickerPackRecord) ProtoMessage() {} - -func (x *StickerPackRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 StickerPackRecord.ProtoReflect.Descriptor instead. -func (*StickerPackRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{13} -} - -func (x *StickerPackRecord) GetPackId() []byte { - if x != nil { - return x.PackId - } - return nil -} - -func (x *StickerPackRecord) GetPackKey() []byte { - if x != nil { - return x.PackKey - } - return nil -} - -func (x *StickerPackRecord) GetPosition() uint32 { - if x != nil { - return x.Position - } - return 0 -} - -func (x *StickerPackRecord) GetDeletedAtTimestamp() uint64 { - if x != nil { - return x.DeletedAtTimestamp - } - return 0 -} - -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"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CallLinkRecord) Reset() { - *x = CallLinkRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CallLinkRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CallLinkRecord) ProtoMessage() {} - -func (x *CallLinkRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 CallLinkRecord.ProtoReflect.Descriptor instead. -func (*CallLinkRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{14} -} - -func (x *CallLinkRecord) GetRootKey() []byte { - if x != nil { - return x.RootKey - } - return nil -} - -func (x *CallLinkRecord) GetAdminPasskey() []byte { - if x != nil { - return x.AdminPasskey - } - return nil -} - -func (x *CallLinkRecord) GetDeletedAtTimestampMs() uint64 { - if x != nil { - return x.DeletedAtTimestampMs - } - return 0 -} - -type Recipient struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Identifier: - // - // *Recipient_Contact_ - // *Recipient_LegacyGroupId - // *Recipient_GroupMasterKey - Identifier isRecipient_Identifier `protobuf_oneof:"identifier"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Recipient) Reset() { - *x = Recipient{} - mi := &file_signalpb_StorageService_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Recipient) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Recipient) ProtoMessage() {} - -func (x *Recipient) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 Recipient.ProtoReflect.Descriptor instead. -func (*Recipient) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{15} -} - -func (x *Recipient) GetIdentifier() isRecipient_Identifier { - if x != nil { - return x.Identifier - } - return nil -} - -func (x *Recipient) GetContact() *Recipient_Contact { - if x != nil { - if x, ok := x.Identifier.(*Recipient_Contact_); ok { - return x.Contact - } - } - return nil -} - -func (x *Recipient) GetLegacyGroupId() []byte { - if x != nil { - if x, ok := x.Identifier.(*Recipient_LegacyGroupId); ok { - return x.LegacyGroupId - } - } - return nil -} - -func (x *Recipient) GetGroupMasterKey() []byte { - if x != nil { - if x, ok := x.Identifier.(*Recipient_GroupMasterKey); ok { - return x.GroupMasterKey - } - } - return nil -} - -type isRecipient_Identifier interface { - isRecipient_Identifier() -} - -type Recipient_Contact_ struct { - Contact *Recipient_Contact `protobuf:"bytes,1,opt,name=contact,proto3,oneof"` -} - -type Recipient_LegacyGroupId struct { - LegacyGroupId []byte `protobuf:"bytes,2,opt,name=legacyGroupId,proto3,oneof"` -} - -type Recipient_GroupMasterKey struct { - GroupMasterKey []byte `protobuf:"bytes,3,opt,name=groupMasterKey,proto3,oneof"` -} - -func (*Recipient_Contact_) isRecipient_Identifier() {} - -func (*Recipient_LegacyGroupId) isRecipient_Identifier() {} - -func (*Recipient_GroupMasterKey) isRecipient_Identifier() {} - -type ChatFolderRecord 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"` - Position uint32 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` - ShowOnlyUnread bool `protobuf:"varint,4,opt,name=showOnlyUnread,proto3" json:"showOnlyUnread,omitempty"` - ShowMutedChats bool `protobuf:"varint,5,opt,name=showMutedChats,proto3" json:"showMutedChats,omitempty"` - IncludeAllIndividualChats bool `protobuf:"varint,6,opt,name=includeAllIndividualChats,proto3" json:"includeAllIndividualChats,omitempty"` // Folder includes all 1:1 chats, unless excluded - IncludeAllGroupChats bool `protobuf:"varint,7,opt,name=includeAllGroupChats,proto3" json:"includeAllGroupChats,omitempty"` // Folder includes all group chats, unless excluded - FolderType ChatFolderRecord_FolderType `protobuf:"varint,8,opt,name=folderType,proto3,enum=signalservice.ChatFolderRecord_FolderType" json:"folderType,omitempty"` - IncludedRecipients []*Recipient `protobuf:"bytes,9,rep,name=includedRecipients,proto3" json:"includedRecipients,omitempty"` - ExcludedRecipients []*Recipient `protobuf:"bytes,10,rep,name=excludedRecipients,proto3" json:"excludedRecipients,omitempty"` - DeletedAtTimestampMs uint64 `protobuf:"varint,11,opt,name=deletedAtTimestampMs,proto3" json:"deletedAtTimestampMs,omitempty"` // When non-zero, `position` should be set to -1 and includedRecipients should be empty - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ChatFolderRecord) Reset() { - *x = ChatFolderRecord{} - mi := &file_signalpb_StorageService_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ChatFolderRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChatFolderRecord) ProtoMessage() {} - -func (x *ChatFolderRecord) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[16] - 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 ChatFolderRecord.ProtoReflect.Descriptor instead. -func (*ChatFolderRecord) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{16} -} - -func (x *ChatFolderRecord) GetIdentifier() []byte { - if x != nil { - return x.Identifier - } - return nil -} - -func (x *ChatFolderRecord) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ChatFolderRecord) GetPosition() uint32 { - if x != nil { - return x.Position - } - return 0 -} - -func (x *ChatFolderRecord) GetShowOnlyUnread() bool { - if x != nil { - return x.ShowOnlyUnread - } - return false -} - -func (x *ChatFolderRecord) GetShowMutedChats() bool { - if x != nil { - return x.ShowMutedChats - } - return false -} - -func (x *ChatFolderRecord) GetIncludeAllIndividualChats() bool { - if x != nil { - return x.IncludeAllIndividualChats - } - return false -} - -func (x *ChatFolderRecord) GetIncludeAllGroupChats() bool { - if x != nil { - return x.IncludeAllGroupChats - } - return false -} - -func (x *ChatFolderRecord) GetFolderType() ChatFolderRecord_FolderType { - if x != nil { - return x.FolderType - } - return ChatFolderRecord_UNKNOWN -} - -func (x *ChatFolderRecord) GetIncludedRecipients() []*Recipient { - if x != nil { - return x.IncludedRecipients - } - return nil -} - -func (x *ChatFolderRecord) GetExcludedRecipients() []*Recipient { - if x != nil { - return x.ExcludedRecipients - } - return nil -} - -func (x *ChatFolderRecord) GetDeletedAtTimestampMs() uint64 { - if x != nil { - return x.DeletedAtTimestampMs - } - return 0 -} - -type NotificationProfile struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Emoji *string `protobuf:"bytes,3,opt,name=emoji,proto3,oneof" json:"emoji,omitempty"` - Color uint32 `protobuf:"fixed32,4,opt,name=color,proto3" json:"color,omitempty"` // 0xAARRGGBB - CreatedAtMs uint64 `protobuf:"varint,5,opt,name=createdAtMs,proto3" json:"createdAtMs,omitempty"` - AllowAllCalls bool `protobuf:"varint,6,opt,name=allowAllCalls,proto3" json:"allowAllCalls,omitempty"` - AllowAllMentions bool `protobuf:"varint,7,opt,name=allowAllMentions,proto3" json:"allowAllMentions,omitempty"` - AllowedMembers []*Recipient `protobuf:"bytes,8,rep,name=allowedMembers,proto3" json:"allowedMembers,omitempty"` - ScheduleEnabled bool `protobuf:"varint,9,opt,name=scheduleEnabled,proto3" json:"scheduleEnabled,omitempty"` - ScheduleStartTime uint32 `protobuf:"varint,10,opt,name=scheduleStartTime,proto3" json:"scheduleStartTime,omitempty"` // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - ScheduleEndTime uint32 `protobuf:"varint,11,opt,name=scheduleEndTime,proto3" json:"scheduleEndTime,omitempty"` // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - ScheduleDaysEnabled []NotificationProfile_DayOfWeek `protobuf:"varint,12,rep,packed,name=scheduleDaysEnabled,proto3,enum=signalservice.NotificationProfile_DayOfWeek" json:"scheduleDaysEnabled,omitempty"` - DeletedAtTimestampMs uint64 `protobuf:"varint,13,opt,name=deletedAtTimestampMs,proto3" json:"deletedAtTimestampMs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *NotificationProfile) Reset() { - *x = NotificationProfile{} - mi := &file_signalpb_StorageService_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *NotificationProfile) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NotificationProfile) ProtoMessage() {} - -func (x *NotificationProfile) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[17] - 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 NotificationProfile.ProtoReflect.Descriptor instead. -func (*NotificationProfile) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{17} -} - -func (x *NotificationProfile) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} - -func (x *NotificationProfile) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *NotificationProfile) GetEmoji() string { - if x != nil && x.Emoji != nil { - return *x.Emoji - } - return "" -} - -func (x *NotificationProfile) GetColor() uint32 { - if x != nil { - return x.Color - } - return 0 -} - -func (x *NotificationProfile) GetCreatedAtMs() uint64 { - if x != nil { - return x.CreatedAtMs - } - return 0 -} - -func (x *NotificationProfile) GetAllowAllCalls() bool { - if x != nil { - return x.AllowAllCalls - } - return false -} - -func (x *NotificationProfile) GetAllowAllMentions() bool { - if x != nil { - return x.AllowAllMentions - } - return false -} - -func (x *NotificationProfile) GetAllowedMembers() []*Recipient { - if x != nil { - return x.AllowedMembers - } - return nil -} - -func (x *NotificationProfile) GetScheduleEnabled() bool { - if x != nil { - return x.ScheduleEnabled - } - return false -} - -func (x *NotificationProfile) GetScheduleStartTime() uint32 { - if x != nil { - return x.ScheduleStartTime - } - return 0 -} - -func (x *NotificationProfile) GetScheduleEndTime() uint32 { - if x != nil { - return x.ScheduleEndTime - } - return 0 -} - -func (x *NotificationProfile) GetScheduleDaysEnabled() []NotificationProfile_DayOfWeek { - if x != nil { - return x.ScheduleDaysEnabled - } - return nil -} - -func (x *NotificationProfile) GetDeletedAtTimestampMs() uint64 { - if x != nil { - return x.DeletedAtTimestampMs - } - return 0 -} - -type ManifestRecord_Identifier struct { - state protoimpl.MessageState `protogen:"open.v1"` - Raw []byte `protobuf:"bytes,1,opt,name=raw,proto3" json:"raw,omitempty"` - Type ManifestRecord_Identifier_Type `protobuf:"varint,2,opt,name=type,proto3,enum=signalservice.ManifestRecord_Identifier_Type" json:"type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ManifestRecord_Identifier) Reset() { - *x = ManifestRecord_Identifier{} - mi := &file_signalpb_StorageService_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ManifestRecord_Identifier) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ManifestRecord_Identifier) ProtoMessage() {} - -func (x *ManifestRecord_Identifier) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[18] - 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 ManifestRecord_Identifier.ProtoReflect.Descriptor instead. -func (*ManifestRecord_Identifier) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{5, 0} -} - -func (x *ManifestRecord_Identifier) GetRaw() []byte { - if x != nil { - return x.Raw - } - return nil -} - -func (x *ManifestRecord_Identifier) GetType() ManifestRecord_Identifier_Type { - if x != nil { - return x.Type - } - return ManifestRecord_Identifier_UNKNOWN -} - -type ContactRecord_Name struct { - state protoimpl.MessageState `protogen:"open.v1"` - Given string `protobuf:"bytes,1,opt,name=given,proto3" json:"given,omitempty"` - Family string `protobuf:"bytes,2,opt,name=family,proto3" json:"family,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ContactRecord_Name) Reset() { - *x = ContactRecord_Name{} - mi := &file_signalpb_StorageService_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ContactRecord_Name) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ContactRecord_Name) ProtoMessage() {} - -func (x *ContactRecord_Name) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[19] - 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 ContactRecord_Name.ProtoReflect.Descriptor instead. -func (*ContactRecord_Name) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{7, 0} -} - -func (x *ContactRecord_Name) GetGiven() string { - if x != nil { - return x.Given - } - return "" -} - -func (x *ContactRecord_Name) GetFamily() string { - if x != nil { - return x.Family - } - return "" -} - -type AccountRecord_PinnedConversation struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Identifier: - // - // *AccountRecord_PinnedConversation_Contact_ - // *AccountRecord_PinnedConversation_LegacyGroupId - // *AccountRecord_PinnedConversation_GroupMasterKey - // *AccountRecord_PinnedConversation_ReleaseNotes_ - Identifier isAccountRecord_PinnedConversation_Identifier `protobuf_oneof:"identifier"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountRecord_PinnedConversation) Reset() { - *x = AccountRecord_PinnedConversation{} - mi := &file_signalpb_StorageService_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord_PinnedConversation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord_PinnedConversation) ProtoMessage() {} - -func (x *AccountRecord_PinnedConversation) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_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 AccountRecord_PinnedConversation.ProtoReflect.Descriptor instead. -func (*AccountRecord_PinnedConversation) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 0} -} - -func (x *AccountRecord_PinnedConversation) GetIdentifier() isAccountRecord_PinnedConversation_Identifier { - if x != nil { - return x.Identifier - } - return nil -} - -func (x *AccountRecord_PinnedConversation) GetContact() *AccountRecord_PinnedConversation_Contact { - if x != nil { - if x, ok := x.Identifier.(*AccountRecord_PinnedConversation_Contact_); ok { - return x.Contact - } - } - return nil -} - -func (x *AccountRecord_PinnedConversation) GetLegacyGroupId() []byte { - if x != nil { - if x, ok := x.Identifier.(*AccountRecord_PinnedConversation_LegacyGroupId); ok { - return x.LegacyGroupId - } - } - return nil -} - -func (x *AccountRecord_PinnedConversation) GetGroupMasterKey() []byte { - if x != nil { - if x, ok := x.Identifier.(*AccountRecord_PinnedConversation_GroupMasterKey); ok { - return x.GroupMasterKey - } - } - return nil -} - -func (x *AccountRecord_PinnedConversation) GetReleaseNotes() *AccountRecord_PinnedConversation_ReleaseNotes { - if x != nil { - if x, ok := x.Identifier.(*AccountRecord_PinnedConversation_ReleaseNotes_); ok { - return x.ReleaseNotes - } - } - return nil -} - -type isAccountRecord_PinnedConversation_Identifier interface { - isAccountRecord_PinnedConversation_Identifier() -} - -type AccountRecord_PinnedConversation_Contact_ struct { - Contact *AccountRecord_PinnedConversation_Contact `protobuf:"bytes,1,opt,name=contact,proto3,oneof"` -} - -type AccountRecord_PinnedConversation_LegacyGroupId struct { - LegacyGroupId []byte `protobuf:"bytes,3,opt,name=legacyGroupId,proto3,oneof"` -} - -type AccountRecord_PinnedConversation_GroupMasterKey struct { - GroupMasterKey []byte `protobuf:"bytes,4,opt,name=groupMasterKey,proto3,oneof"` -} - -type AccountRecord_PinnedConversation_ReleaseNotes_ struct { - ReleaseNotes *AccountRecord_PinnedConversation_ReleaseNotes `protobuf:"bytes,5,opt,name=releaseNotes,proto3,oneof"` -} - -func (*AccountRecord_PinnedConversation_Contact_) isAccountRecord_PinnedConversation_Identifier() {} - -func (*AccountRecord_PinnedConversation_LegacyGroupId) isAccountRecord_PinnedConversation_Identifier() { -} - -func (*AccountRecord_PinnedConversation_GroupMasterKey) isAccountRecord_PinnedConversation_Identifier() { -} - -func (*AccountRecord_PinnedConversation_ReleaseNotes_) isAccountRecord_PinnedConversation_Identifier() { -} - -type AccountRecord_UsernameLink struct { - state protoimpl.MessageState `protogen:"open.v1"` - Entropy []byte `protobuf:"bytes,1,opt,name=entropy,proto3" json:"entropy,omitempty"` // 32 bytes of entropy used for encryption - ServerId []byte `protobuf:"bytes,2,opt,name=serverId,proto3" json:"serverId,omitempty"` // 16 bytes of encoded UUID provided by the server - Color AccountRecord_UsernameLink_Color `protobuf:"varint,3,opt,name=color,proto3,enum=signalservice.AccountRecord_UsernameLink_Color" json:"color,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountRecord_UsernameLink) Reset() { - *x = AccountRecord_UsernameLink{} - mi := &file_signalpb_StorageService_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord_UsernameLink) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord_UsernameLink) ProtoMessage() {} - -func (x *AccountRecord_UsernameLink) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[21] - 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 AccountRecord_UsernameLink.ProtoReflect.Descriptor instead. -func (*AccountRecord_UsernameLink) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 1} -} - -func (x *AccountRecord_UsernameLink) GetEntropy() []byte { - if x != nil { - return x.Entropy - } - return nil -} - -func (x *AccountRecord_UsernameLink) GetServerId() []byte { - if x != nil { - return x.ServerId - } - return nil -} - -func (x *AccountRecord_UsernameLink) GetColor() AccountRecord_UsernameLink_Color { - if x != nil { - return x.Color - } - return AccountRecord_UsernameLink_UNKNOWN -} - -type AccountRecord_IAPSubscriberData struct { - state protoimpl.MessageState `protogen:"open.v1"` - SubscriberId []byte `protobuf:"bytes,1,opt,name=subscriberId,proto3" json:"subscriberId,omitempty"` - // Types that are valid to be assigned to IapSubscriptionId: - // - // *AccountRecord_IAPSubscriberData_PurchaseToken - // *AccountRecord_IAPSubscriberData_OriginalTransactionId - IapSubscriptionId isAccountRecord_IAPSubscriberData_IapSubscriptionId `protobuf_oneof:"iapSubscriptionId"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountRecord_IAPSubscriberData) Reset() { - *x = AccountRecord_IAPSubscriberData{} - mi := &file_signalpb_StorageService_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord_IAPSubscriberData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord_IAPSubscriberData) ProtoMessage() {} - -func (x *AccountRecord_IAPSubscriberData) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[22] - 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 AccountRecord_IAPSubscriberData.ProtoReflect.Descriptor instead. -func (*AccountRecord_IAPSubscriberData) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 2} -} - -func (x *AccountRecord_IAPSubscriberData) GetSubscriberId() []byte { - if x != nil { - return x.SubscriberId - } - return nil -} - -func (x *AccountRecord_IAPSubscriberData) GetIapSubscriptionId() isAccountRecord_IAPSubscriberData_IapSubscriptionId { - if x != nil { - return x.IapSubscriptionId - } - return nil -} - -func (x *AccountRecord_IAPSubscriberData) GetPurchaseToken() string { - if x != nil { - if x, ok := x.IapSubscriptionId.(*AccountRecord_IAPSubscriberData_PurchaseToken); ok { - return x.PurchaseToken - } - } - return "" -} - -func (x *AccountRecord_IAPSubscriberData) GetOriginalTransactionId() uint64 { - if x != nil { - if x, ok := x.IapSubscriptionId.(*AccountRecord_IAPSubscriberData_OriginalTransactionId); ok { - return x.OriginalTransactionId - } - } - return 0 -} - -type isAccountRecord_IAPSubscriberData_IapSubscriptionId interface { - isAccountRecord_IAPSubscriberData_IapSubscriptionId() -} - -type AccountRecord_IAPSubscriberData_PurchaseToken struct { - // Identifies an Android Play Store IAP subscription. - PurchaseToken string `protobuf:"bytes,2,opt,name=purchaseToken,proto3,oneof"` -} - -type AccountRecord_IAPSubscriberData_OriginalTransactionId struct { - // Identifies an iOS App Store IAP subscription. - OriginalTransactionId uint64 `protobuf:"varint,3,opt,name=originalTransactionId,proto3,oneof"` -} - -func (*AccountRecord_IAPSubscriberData_PurchaseToken) isAccountRecord_IAPSubscriberData_IapSubscriptionId() { -} - -func (*AccountRecord_IAPSubscriberData_OriginalTransactionId) isAccountRecord_IAPSubscriberData_IapSubscriptionId() { -} - -type AccountRecord_NotificationProfileManualOverride struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Types that are valid to be assigned to Override: - // - // *AccountRecord_NotificationProfileManualOverride_DisabledAtTimestampMs - // *AccountRecord_NotificationProfileManualOverride_Enabled - Override isAccountRecord_NotificationProfileManualOverride_Override `protobuf_oneof:"override"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountRecord_NotificationProfileManualOverride) Reset() { - *x = AccountRecord_NotificationProfileManualOverride{} - mi := &file_signalpb_StorageService_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord_NotificationProfileManualOverride) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord_NotificationProfileManualOverride) ProtoMessage() {} - -func (x *AccountRecord_NotificationProfileManualOverride) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[23] - 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 AccountRecord_NotificationProfileManualOverride.ProtoReflect.Descriptor instead. -func (*AccountRecord_NotificationProfileManualOverride) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 3} -} - -func (x *AccountRecord_NotificationProfileManualOverride) GetOverride() isAccountRecord_NotificationProfileManualOverride_Override { - if x != nil { - return x.Override - } - return nil -} - -func (x *AccountRecord_NotificationProfileManualOverride) GetDisabledAtTimestampMs() uint64 { - if x != nil { - if x, ok := x.Override.(*AccountRecord_NotificationProfileManualOverride_DisabledAtTimestampMs); ok { - return x.DisabledAtTimestampMs - } - } - return 0 -} - -func (x *AccountRecord_NotificationProfileManualOverride) GetEnabled() *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled { - if x != nil { - if x, ok := x.Override.(*AccountRecord_NotificationProfileManualOverride_Enabled); ok { - return x.Enabled - } - } - return nil -} - -type isAccountRecord_NotificationProfileManualOverride_Override interface { - isAccountRecord_NotificationProfileManualOverride_Override() -} - -type AccountRecord_NotificationProfileManualOverride_DisabledAtTimestampMs struct { - DisabledAtTimestampMs uint64 `protobuf:"varint,1,opt,name=disabledAtTimestampMs,proto3,oneof"` -} - -type AccountRecord_NotificationProfileManualOverride_Enabled struct { - Enabled *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled `protobuf:"bytes,2,opt,name=enabled,proto3,oneof"` -} - -func (*AccountRecord_NotificationProfileManualOverride_DisabledAtTimestampMs) isAccountRecord_NotificationProfileManualOverride_Override() { -} - -func (*AccountRecord_NotificationProfileManualOverride_Enabled) isAccountRecord_NotificationProfileManualOverride_Override() { -} - -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 -} - -func (x *AccountRecord_PinnedConversation_Contact) Reset() { - *x = AccountRecord_PinnedConversation_Contact{} - mi := &file_signalpb_StorageService_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord_PinnedConversation_Contact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord_PinnedConversation_Contact) ProtoMessage() {} - -func (x *AccountRecord_PinnedConversation_Contact) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[24] - 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 AccountRecord_PinnedConversation_Contact.ProtoReflect.Descriptor instead. -func (*AccountRecord_PinnedConversation_Contact) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 0, 0} -} - -func (x *AccountRecord_PinnedConversation_Contact) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *AccountRecord_PinnedConversation_Contact) GetE164() string { - if x != nil { - return x.E164 - } - return "" -} - -func (x *AccountRecord_PinnedConversation_Contact) GetServiceIdBinary() []byte { - if x != nil { - return x.ServiceIdBinary - } - return nil -} - -type AccountRecord_PinnedConversation_ReleaseNotes struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountRecord_PinnedConversation_ReleaseNotes) Reset() { - *x = AccountRecord_PinnedConversation_ReleaseNotes{} - mi := &file_signalpb_StorageService_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord_PinnedConversation_ReleaseNotes) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord_PinnedConversation_ReleaseNotes) ProtoMessage() {} - -func (x *AccountRecord_PinnedConversation_ReleaseNotes) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[25] - 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 AccountRecord_PinnedConversation_ReleaseNotes.ProtoReflect.Descriptor instead. -func (*AccountRecord_PinnedConversation_ReleaseNotes) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 0, 1} -} - -type AccountRecord_NotificationProfileManualOverride_ManuallyEnabled struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // This will be unset if no timespan was chosen in the UI. - EndAtTimestampMs uint64 `protobuf:"varint,3,opt,name=endAtTimestampMs,proto3" json:"endAtTimestampMs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) Reset() { - *x = AccountRecord_NotificationProfileManualOverride_ManuallyEnabled{} - mi := &file_signalpb_StorageService_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) ProtoMessage() {} - -func (x *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[26] - 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 AccountRecord_NotificationProfileManualOverride_ManuallyEnabled.ProtoReflect.Descriptor instead. -func (*AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{11, 3, 0} -} - -func (x *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) GetId() []byte { - if x != nil { - return x.Id - } - return nil -} - -func (x *AccountRecord_NotificationProfileManualOverride_ManuallyEnabled) GetEndAtTimestampMs() uint64 { - if x != nil { - return x.EndAtTimestampMs - } - return 0 -} - -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 -} - -func (x *Recipient_Contact) Reset() { - *x = Recipient_Contact{} - mi := &file_signalpb_StorageService_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Recipient_Contact) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Recipient_Contact) ProtoMessage() {} - -func (x *Recipient_Contact) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_StorageService_proto_msgTypes[27] - 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 Recipient_Contact.ProtoReflect.Descriptor instead. -func (*Recipient_Contact) Descriptor() ([]byte, []int) { - return file_signalpb_StorageService_proto_rawDescGZIP(), []int{15, 0} -} - -func (x *Recipient_Contact) GetServiceId() string { - if x != nil { - return x.ServiceId - } - return "" -} - -func (x *Recipient_Contact) GetE164() string { - if x != nil { - return x.E164 - } - return "" -} - -func (x *Recipient_Contact) GetServiceIdBinary() []byte { - if x != nil { - return x.ServiceIdBinary - } - return nil -} - -var File_signalpb_StorageService_proto protoreflect.FileDescriptor - -const file_signalpb_StorageService_proto_rawDesc = "" + - "\n" + - "\x1dsignalpb/StorageService.proto\x12\rsignalservice\"A\n" + - "\x0fStorageManifest\x12\x18\n" + - "\aversion\x18\x01 \x01(\x04R\aversion\x12\x14\n" + - "\x05value\x18\x02 \x01(\fR\x05value\"5\n" + - "\vStorageItem\x12\x10\n" + - "\x03key\x18\x01 \x01(\fR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\fR\x05value\"@\n" + - "\fStorageItems\x120\n" + - "\x05items\x18\x01 \x03(\v2\x1a.signalservice.StorageItemR\x05items\")\n" + - "\rReadOperation\x12\x18\n" + - "\areadKey\x18\x01 \x03(\fR\areadKey\"\xc2\x01\n" + - "\x0eWriteOperation\x12:\n" + - "\bmanifest\x18\x01 \x01(\v2\x1e.signalservice.StorageManifestR\bmanifest\x12:\n" + - "\n" + - "insertItem\x18\x02 \x03(\v2\x1a.signalservice.StorageItemR\n" + - "insertItem\x12\x1c\n" + - "\tdeleteKey\x18\x03 \x03(\fR\tdeleteKey\x12\x1a\n" + - "\bclearAll\x18\x04 \x01(\bR\bclearAll\"\xcf\x03\n" + - "\x0eManifestRecord\x12\x18\n" + - "\aversion\x18\x01 \x01(\x04R\aversion\x12\"\n" + - "\fsourceDevice\x18\x03 \x01(\rR\fsourceDevice\x12J\n" + - "\videntifiers\x18\x02 \x03(\v2(.signalservice.ManifestRecord.IdentifierR\videntifiers\x12\x1c\n" + - "\trecordIkm\x18\x04 \x01(\fR\trecordIkm\x1a\x94\x02\n" + - "\n" + - "Identifier\x12\x10\n" + - "\x03raw\x18\x01 \x01(\fR\x03raw\x12A\n" + - "\x04type\x18\x02 \x01(\x0e2-.signalservice.ManifestRecord.Identifier.TypeR\x04type\"\xb0\x01\n" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\v\n" + - "\aCONTACT\x10\x01\x12\v\n" + - "\aGROUPV1\x10\x02\x12\v\n" + - "\aGROUPV2\x10\x03\x12\v\n" + - "\aACCOUNT\x10\x04\x12\x1b\n" + - "\x17STORY_DISTRIBUTION_LIST\x10\x05\x12\x10\n" + - "\fSTICKER_PACK\x10\x06\x12\r\n" + - "\tCALL_LINK\x10\a\x12\x0f\n" + - "\vCHAT_FOLDER\x10\b\x12\x18\n" + - "\x14NOTIFICATION_PROFILE\x10\t\"\x83\x05\n" + - "\rStorageRecord\x128\n" + - "\acontact\x18\x01 \x01(\v2\x1c.signalservice.ContactRecordH\x00R\acontact\x128\n" + - "\agroupV1\x18\x02 \x01(\v2\x1c.signalservice.GroupV1RecordH\x00R\agroupV1\x128\n" + - "\agroupV2\x18\x03 \x01(\v2\x1c.signalservice.GroupV2RecordH\x00R\agroupV2\x128\n" + - "\aaccount\x18\x04 \x01(\v2\x1c.signalservice.AccountRecordH\x00R\aaccount\x12b\n" + - "\x15storyDistributionList\x18\x05 \x01(\v2*.signalservice.StoryDistributionListRecordH\x00R\x15storyDistributionList\x12D\n" + - "\vstickerPack\x18\x06 \x01(\v2 .signalservice.StickerPackRecordH\x00R\vstickerPack\x12;\n" + - "\bcallLink\x18\a \x01(\v2\x1d.signalservice.CallLinkRecordH\x00R\bcallLink\x12A\n" + - "\n" + - "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\"\xab\n" + - "\n" + - "\rContactRecord\x12\x10\n" + - "\x03aci\x18\x01 \x01(\tR\x03aci\x12\x12\n" + - "\x04e164\x18\x02 \x01(\tR\x04e164\x12\x10\n" + - "\x03pni\x18\x0f \x01(\tR\x03pni\x12\x1e\n" + - "\n" + - "profileKey\x18\x03 \x01(\fR\n" + - "profileKey\x12 \n" + - "\videntityKey\x18\x04 \x01(\fR\videntityKey\x12P\n" + - "\ridentityState\x18\x05 \x01(\x0e2*.signalservice.ContactRecord.IdentityStateR\ridentityState\x12\x1c\n" + - "\tgivenName\x18\x06 \x01(\tR\tgivenName\x12\x1e\n" + - "\n" + - "familyName\x18\a \x01(\tR\n" + - "familyName\x12\x1a\n" + - "\busername\x18\b \x01(\tR\busername\x12\x18\n" + - "\ablocked\x18\t \x01(\bR\ablocked\x12 \n" + - "\vwhitelisted\x18\n" + - " \x01(\bR\vwhitelisted\x12\x1a\n" + - "\barchived\x18\v \x01(\bR\barchived\x12\"\n" + - "\fmarkedUnread\x18\f \x01(\bR\fmarkedUnread\x120\n" + - "\x13mutedUntilTimestamp\x18\r \x01(\x04R\x13mutedUntilTimestamp\x12\x1c\n" + - "\thideStory\x18\x0e \x01(\bR\thideStory\x128\n" + - "\x17unregisteredAtTimestamp\x18\x10 \x01(\x04R\x17unregisteredAtTimestamp\x12(\n" + - "\x0fsystemGivenName\x18\x11 \x01(\tR\x0fsystemGivenName\x12*\n" + - "\x10systemFamilyName\x18\x12 \x01(\tR\x10systemFamilyName\x12&\n" + - "\x0esystemNickname\x18\x13 \x01(\tR\x0esystemNickname\x12\x16\n" + - "\x06hidden\x18\x14 \x01(\bR\x06hidden\x122\n" + - "\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\x12.\n" + - "\x12blockedAtTimestamp\x18\x1b \x01(\x04R\x12blockedAtTimestamp\x12Q\n" + - "\x15notifyForCallsIfMuted\x18\x1c \x01(\x0e2\x1b.signalservice.OptionalBoolR\x15notifyForCallsIfMuted\x12M\n" + - "\x13showUnreadReminders\x18\x1d \x01(\x0e2\x1b.signalservice.OptionalBoolR\x13showUnreadReminders\x1a4\n" + - "\x04Name\x12\x14\n" + - "\x05given\x18\x01 \x01(\tR\x05given\x12\x16\n" + - "\x06family\x18\x02 \x01(\tR\x06family\":\n" + - "\rIdentityState\x12\v\n" + - "\aDEFAULT\x10\x00\x12\f\n" + - "\bVERIFIED\x10\x01\x12\x0e\n" + - "\n" + - "UNVERIFIED\x10\x02B\x0e\n" + - "\f_avatarColor\"\xcd\x01\n" + - "\rGroupV1Record\x12\x0e\n" + - "\x02id\x18\x01 \x01(\fR\x02id\x12\x18\n" + - "\ablocked\x18\x02 \x01(\bR\ablocked\x12 \n" + - "\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\"\xcf\a\n" + - "\rGroupV2Record\x12\x1c\n" + - "\tmasterKey\x18\x01 \x01(\fR\tmasterKey\x12\x18\n" + - "\ablocked\x18\x02 \x01(\bR\ablocked\x12 \n" + - "\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\x12B\n" + - "\x1cdontNotifyForMentionsIfMuted\x18\a \x01(\bR\x1cdontNotifyForMentionsIfMuted\x12\x1c\n" + - "\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\x12.\n" + - "\x12blockedAtTimestamp\x18\r \x01(\x04R\x12blockedAtTimestamp\x12Q\n" + - "\x15notifyForCallsIfMuted\x18\x0e \x01(\x0e2\x1b.signalservice.OptionalBoolR\x15notifyForCallsIfMuted\x12W\n" + - "\x18notifyForMentionsIfMuted\x18\x0f \x01(\x0e2\x1b.signalservice.OptionalBoolR\x18notifyForMentionsIfMuted\x12U\n" + - "\x17notifyForRepliesIfMuted\x18\x10 \x01(\x0e2\x1b.signalservice.OptionalBoolR\x17notifyForRepliesIfMuted\x12M\n" + - "\x13showUnreadReminders\x18\x11 \x01(\x0e2\x1b.signalservice.OptionalBoolR\x13showUnreadReminders\"7\n" + - "\rStorySendMode\x12\v\n" + - "\aDEFAULT\x10\x00\x12\f\n" + - "\bDISABLED\x10\x01\x12\v\n" + - "\aENABLED\x10\x02B\x0e\n" + - "\f_avatarColorJ\x04\b\t\x10\n" + - "\">\n" + - "\bPayments\x12\x18\n" + - "\aenabled\x18\x01 \x01(\bR\aenabled\x12\x18\n" + - "\aentropy\x18\x02 \x01(\fR\aentropy\"\xfa%\n" + - "\rAccountRecord\x12\x1e\n" + - "\n" + - "profileKey\x18\x01 \x01(\fR\n" + - "profileKey\x12\x1c\n" + - "\tgivenName\x18\x02 \x01(\tR\tgivenName\x12\x1e\n" + - "\n" + - "familyName\x18\x03 \x01(\tR\n" + - "familyName\x12$\n" + - "\ravatarUrlPath\x18\x04 \x01(\tR\ravatarUrlPath\x12.\n" + - "\x12noteToSelfArchived\x18\x05 \x01(\bR\x12noteToSelfArchived\x12\"\n" + - "\freadReceipts\x18\x06 \x01(\bR\freadReceipts\x126\n" + - "\x16sealedSenderIndicators\x18\a \x01(\bR\x16sealedSenderIndicators\x12*\n" + - "\x10typingIndicators\x18\b \x01(\bR\x10typingIndicators\x126\n" + - "\x16noteToSelfMarkedUnread\x18\n" + - " \x01(\bR\x16noteToSelfMarkedUnread\x12\"\n" + - "\flinkPreviews\x18\v \x01(\bR\flinkPreviews\x12k\n" + - "\x16phoneNumberSharingMode\x18\f \x01(\x0e23.signalservice.AccountRecord.PhoneNumberSharingModeR\x16phoneNumberSharingMode\x120\n" + - "\x13unlistedPhoneNumber\x18\r \x01(\bR\x13unlistedPhoneNumber\x12a\n" + - "\x13pinnedConversations\x18\x0e \x03(\v2/.signalservice.AccountRecord.PinnedConversationR\x13pinnedConversations\x122\n" + - "\x14preferContactAvatars\x18\x0f \x01(\bR\x14preferContactAvatars\x123\n" + - "\bpayments\x18\x10 \x01(\v2\x17.signalservice.PaymentsR\bpayments\x122\n" + - "\x14universalExpireTimer\x18\x11 \x01(\rR\x14universalExpireTimer\x12(\n" + - "\x0fprimarySendsSms\x18\x12 \x01(\bR\x0fprimarySendsSms\x126\n" + - "\x16preferredReactionEmoji\x18\x14 \x03(\tR\x16preferredReactionEmoji\x12\"\n" + - "\fsubscriberId\x18\x15 \x01(\fR\fsubscriberId\x126\n" + - "\x16subscriberCurrencyCode\x18\x16 \x01(\tR\x16subscriberCurrencyCode\x126\n" + - "\x16displayBadgesOnProfile\x18\x17 \x01(\bR\x16displayBadgesOnProfile\x12D\n" + - "\x1dsubscriptionManuallyCancelled\x18\x18 \x01(\bR\x1dsubscriptionManuallyCancelled\x126\n" + - "\x16keepMutedChatsArchived\x18\x19 \x01(\bR\x16keepMutedChatsArchived\x126\n" + - "\x16hasSetMyStoriesPrivacy\x18\x1a \x01(\bR\x16hasSetMyStoriesPrivacy\x12:\n" + - "\x18hasViewedOnboardingStory\x18\x1b \x01(\bR\x18hasViewedOnboardingStory\x12(\n" + - "\x0fstoriesDisabled\x18\x1d \x01(\bR\x0fstoriesDisabled\x12W\n" + - "\x18storyViewReceiptsEnabled\x18\x1e \x01(\x0e2\x1b.signalservice.OptionalBoolR\x18storyViewReceiptsEnabled\x12H\n" + - "\x1fhasSeenGroupStoryEducationSheet\x18 \x01(\bR\x1fhasSeenGroupStoryEducationSheet\x12\x1a\n" + - "\busername\x18! \x01(\tR\busername\x12F\n" + - "\x1ehasCompletedUsernameOnboarding\x18\" \x01(\bR\x1ehasCompletedUsernameOnboarding\x12M\n" + - "\fusernameLink\x18# \x01(\v2).signalservice.AccountRecord.UsernameLinkR\fusernameLink\x12#\n" + - "\n" + - "backupTier\x18( \x01(\x04H\x00R\n" + - "backupTier\x88\x01\x01\x12b\n" + - "\x14backupSubscriberData\x18) \x01(\v2..signalservice.AccountRecord.IAPSubscriberDataR\x14backupSubscriberData\x12A\n" + - "\vavatarColor\x18* \x01(\x0e2\x1a.signalservice.AvatarColorH\x01R\vavatarColor\x88\x01\x01\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\x12?\n" + - "\x18releaseNotesChatArchived\x180 \x01(\bH\x02R\x18releaseNotesChatArchived\x88\x01\x01\x12U\n" + - "#releaseNotesChatMutedUntilTimestamp\x181 \x01(\x04H\x03R#releaseNotesChatMutedUntilTimestamp\x88\x01\x01\x12=\n" + - "\x17releaseNotesChatBlocked\x182 \x01(\bH\x04R\x17releaseNotesChatBlocked\x88\x01\x01\x12G\n" + - "\x1creleaseNotesChatMarkedUnread\x183 \x01(\bH\x05R\x1creleaseNotesChatMarkedUnread\x88\x01\x01\x12A\n" + - "\x19releaseNotesChatBlockedAt\x184 \x01(\x04H\x06R\x19releaseNotesChatBlockedAt\x88\x01\x01\x12V\n" + - "\x0funreadBadgeType\x185 \x01(\x0e2,.signalservice.AccountRecord.UnreadBadgeTypeR\x0funreadBadgeType\x12W\n" + - "\x18includeMutedChatsInBadge\x186 \x01(\x0e2\x1b.signalservice.OptionalBoolR\x18includeMutedChatsInBadge\x12Q\n" + - "\x15reactionNotifications\x187 \x01(\x0e2\x1b.signalservice.OptionalBoolR\x15reactionNotifications\x12Q\n" + - "\x15notifyForCallsIfMuted\x188 \x01(\x0e2\x1b.signalservice.OptionalBoolR\x15notifyForCallsIfMuted\x12W\n" + - "\x18notifyForMentionsIfMuted\x189 \x01(\x0e2\x1b.signalservice.OptionalBoolR\x18notifyForMentionsIfMuted\x12U\n" + - "\x17notifyForRepliesIfMuted\x18: \x01(\x0e2\x1b.signalservice.OptionalBoolR\x17notifyForRepliesIfMuted\x12M\n" + - "\x13showUnreadReminders\x18; \x01(\x0e2\x1b.signalservice.OptionalBoolR\x13showUnreadReminders\x12S\n" + - "\x16notifyWhenContactJoins\x18< \x01(\x0e2\x1b.signalservice.OptionalBoolR\x16notifyWhenContactJoins\x1a\xa4\x03\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\x12b\n" + - "\freleaseNotes\x18\x05 \x01(\v2<.signalservice.AccountRecord.PinnedConversation.ReleaseNotesH\x00R\freleaseNotes\x1ae\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\x0fserviceIdBinary\x1a\x0e\n" + - "\fReleaseNotesB\f\n" + - "\n" + - "identifier\x1a\xf8\x01\n" + - "\fUsernameLink\x12\x18\n" + - "\aentropy\x18\x01 \x01(\fR\aentropy\x12\x1a\n" + - "\bserverId\x18\x02 \x01(\fR\bserverId\x12E\n" + - "\x05color\x18\x03 \x01(\x0e2/.signalservice.AccountRecord.UsernameLink.ColorR\x05color\"k\n" + - "\x05Color\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\b\n" + - "\x04BLUE\x10\x01\x12\t\n" + - "\x05WHITE\x10\x02\x12\b\n" + - "\x04GREY\x10\x03\x12\t\n" + - "\x05OLIVE\x10\x04\x12\t\n" + - "\x05GREEN\x10\x05\x12\n" + - "\n" + - "\x06ORANGE\x10\x06\x12\b\n" + - "\x04PINK\x10\a\x12\n" + - "\n" + - "\x06PURPLE\x10\b\x1a\xac\x01\n" + - "\x11IAPSubscriberData\x12\"\n" + - "\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\xa2\x02\n" + - "!NotificationProfileManualOverride\x126\n" + - "\x15disabledAtTimestampMs\x18\x01 \x01(\x04H\x00R\x15disabledAtTimestampMs\x12j\n" + - "\aenabled\x18\x02 \x01(\v2N.signalservice.AccountRecord.NotificationProfileManualOverride.ManuallyEnabledH\x00R\aenabled\x1aM\n" + - "\x0fManuallyEnabled\x12\x0e\n" + - "\x02id\x18\x01 \x01(\fR\x02id\x12*\n" + - "\x10endAtTimestampMs\x18\x03 \x01(\x04R\x10endAtTimestampMsB\n" + - "\n" + - "\boverride\"P\n" + - "\x0fUnreadBadgeType\x12\x16\n" + - "\x12UNKNOWN_BADGE_TYPE\x10\x00\x12\x13\n" + - "\x0fUNREAD_MESSAGES\x10\x01\x12\x10\n" + - "\fUNREAD_CHATS\x10\x02\"@\n" + - "\x16PhoneNumberSharingMode\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\r\n" + - "\tEVERYBODY\x10\x01\x12\n" + - "\n" + - "\x06NOBODY\x10\x02B\r\n" + - "\v_backupTierB\x0e\n" + - "\f_avatarColorB\x1b\n" + - "\x19_releaseNotesChatArchivedB&\n" + - "$_releaseNotesChatMutedUntilTimestampB\x1a\n" + - "\x18_releaseNotesChatBlockedB\x1f\n" + - "\x1d_releaseNotesChatMarkedUnreadB\x1c\n" + - "\x1a_releaseNotesChatBlockedAtJ\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'J\x04\b'\x10(J\x04\b+\x10,\"\xb9\x02\n" + - "\x1bStoryDistributionListRecord\x12\x1e\n" + - "\n" + - "identifier\x18\x01 \x01(\fR\n" + - "identifier\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x120\n" + - "\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\"\x91\x01\n" + - "\x11StickerPackRecord\x12\x16\n" + - "\x06packId\x18\x01 \x01(\fR\x06packId\x12\x18\n" + - "\apackKey\x18\x02 \x01(\fR\apackKey\x12\x1a\n" + - "\bposition\x18\x03 \x01(\rR\bposition\x12.\n" + - "\x12deletedAtTimestamp\x18\x04 \x01(\x04R\x12deletedAtTimestamp\"\x88\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" + - "\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" + - "\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" + - "\n" + - "identifier\"\xe8\x04\n" + - "\x10ChatFolderRecord\x12\x1e\n" + - "\n" + - "identifier\x18\x01 \x01(\fR\n" + - "identifier\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" + - "\bposition\x18\x03 \x01(\rR\bposition\x12&\n" + - "\x0eshowOnlyUnread\x18\x04 \x01(\bR\x0eshowOnlyUnread\x12&\n" + - "\x0eshowMutedChats\x18\x05 \x01(\bR\x0eshowMutedChats\x12<\n" + - "\x19includeAllIndividualChats\x18\x06 \x01(\bR\x19includeAllIndividualChats\x122\n" + - "\x14includeAllGroupChats\x18\a \x01(\bR\x14includeAllGroupChats\x12J\n" + - "\n" + - "folderType\x18\b \x01(\x0e2*.signalservice.ChatFolderRecord.FolderTypeR\n" + - "folderType\x12H\n" + - "\x12includedRecipients\x18\t \x03(\v2\x18.signalservice.RecipientR\x12includedRecipients\x12H\n" + - "\x12excludedRecipients\x18\n" + - " \x03(\v2\x18.signalservice.RecipientR\x12excludedRecipients\x122\n" + - "\x14deletedAtTimestampMs\x18\v \x01(\x04R\x14deletedAtTimestampMs\".\n" + - "\n" + - "FolderType\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\a\n" + - "\x03ALL\x10\x01\x12\n" + - "\n" + - "\x06CUSTOM\x10\x02\"\xb6\x05\n" + - "\x13NotificationProfile\x12\x0e\n" + - "\x02id\x18\x01 \x01(\fR\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x19\n" + - "\x05emoji\x18\x03 \x01(\tH\x00R\x05emoji\x88\x01\x01\x12\x14\n" + - "\x05color\x18\x04 \x01(\aR\x05color\x12 \n" + - "\vcreatedAtMs\x18\x05 \x01(\x04R\vcreatedAtMs\x12$\n" + - "\rallowAllCalls\x18\x06 \x01(\bR\rallowAllCalls\x12*\n" + - "\x10allowAllMentions\x18\a \x01(\bR\x10allowAllMentions\x12@\n" + - "\x0eallowedMembers\x18\b \x03(\v2\x18.signalservice.RecipientR\x0eallowedMembers\x12(\n" + - "\x0fscheduleEnabled\x18\t \x01(\bR\x0fscheduleEnabled\x12,\n" + - "\x11scheduleStartTime\x18\n" + - " \x01(\rR\x11scheduleStartTime\x12(\n" + - "\x0fscheduleEndTime\x18\v \x01(\rR\x0fscheduleEndTime\x12^\n" + - "\x13scheduleDaysEnabled\x18\f \x03(\x0e2,.signalservice.NotificationProfile.DayOfWeekR\x13scheduleDaysEnabled\x122\n" + - "\x14deletedAtTimestampMs\x18\r \x01(\x04R\x14deletedAtTimestampMs\"t\n" + - "\tDayOfWeek\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\n" + - "\n" + - "\x06MONDAY\x10\x01\x12\v\n" + - "\aTUESDAY\x10\x02\x12\r\n" + - "\tWEDNESDAY\x10\x03\x12\f\n" + - "\bTHURSDAY\x10\x04\x12\n" + - "\n" + - "\x06FRIDAY\x10\x05\x12\f\n" + - "\bSATURDAY\x10\x06\x12\n" + - "\n" + - "\x06SUNDAY\x10\aB\b\n" + - "\x06_emoji*4\n" + - "\fOptionalBool\x12\t\n" + - "\x05UNSET\x10\x00\x12\v\n" + - "\aENABLED\x10\x01\x12\f\n" + - "\bDISABLED\x10\x02*\x85\x01\n" + - "\vAvatarColor\x12\b\n" + - "\x04A100\x10\x00\x12\b\n" + - "\x04A110\x10\x01\x12\b\n" + - "\x04A120\x10\x02\x12\b\n" + - "\x04A130\x10\x03\x12\b\n" + - "\x04A140\x10\x04\x12\b\n" + - "\x04A150\x10\x05\x12\b\n" + - "\x04A160\x10\x06\x12\b\n" + - "\x04A170\x10\a\x12\b\n" + - "\x04A180\x10\b\x12\b\n" + - "\x04A190\x10\t\x12\b\n" + - "\x04A200\x10\n" + - "\x12\b\n" + - "\x04A210\x10\vB<\n" + - "8org.whispersystems.signalservice.internal.storage.protosP\x01b\x06proto3" - -var ( - file_signalpb_StorageService_proto_rawDescOnce sync.Once - file_signalpb_StorageService_proto_rawDescData []byte -) - -func file_signalpb_StorageService_proto_rawDescGZIP() []byte { - file_signalpb_StorageService_proto_rawDescOnce.Do(func() { - file_signalpb_StorageService_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_signalpb_StorageService_proto_rawDesc), len(file_signalpb_StorageService_proto_rawDesc))) - }) - return file_signalpb_StorageService_proto_rawDescData -} - -var file_signalpb_StorageService_proto_enumTypes = make([]protoimpl.EnumInfo, 10) -var file_signalpb_StorageService_proto_msgTypes = make([]protoimpl.MessageInfo, 28) -var file_signalpb_StorageService_proto_goTypes = []any{ - (OptionalBool)(0), // 0: signalservice.OptionalBool - (AvatarColor)(0), // 1: signalservice.AvatarColor - (ManifestRecord_Identifier_Type)(0), // 2: signalservice.ManifestRecord.Identifier.Type - (ContactRecord_IdentityState)(0), // 3: signalservice.ContactRecord.IdentityState - (GroupV2Record_StorySendMode)(0), // 4: signalservice.GroupV2Record.StorySendMode - (AccountRecord_UnreadBadgeType)(0), // 5: signalservice.AccountRecord.UnreadBadgeType - (AccountRecord_PhoneNumberSharingMode)(0), // 6: signalservice.AccountRecord.PhoneNumberSharingMode - (AccountRecord_UsernameLink_Color)(0), // 7: signalservice.AccountRecord.UsernameLink.Color - (ChatFolderRecord_FolderType)(0), // 8: signalservice.ChatFolderRecord.FolderType - (NotificationProfile_DayOfWeek)(0), // 9: signalservice.NotificationProfile.DayOfWeek - (*StorageManifest)(nil), // 10: signalservice.StorageManifest - (*StorageItem)(nil), // 11: signalservice.StorageItem - (*StorageItems)(nil), // 12: signalservice.StorageItems - (*ReadOperation)(nil), // 13: signalservice.ReadOperation - (*WriteOperation)(nil), // 14: signalservice.WriteOperation - (*ManifestRecord)(nil), // 15: signalservice.ManifestRecord - (*StorageRecord)(nil), // 16: signalservice.StorageRecord - (*ContactRecord)(nil), // 17: signalservice.ContactRecord - (*GroupV1Record)(nil), // 18: signalservice.GroupV1Record - (*GroupV2Record)(nil), // 19: signalservice.GroupV2Record - (*Payments)(nil), // 20: signalservice.Payments - (*AccountRecord)(nil), // 21: signalservice.AccountRecord - (*StoryDistributionListRecord)(nil), // 22: signalservice.StoryDistributionListRecord - (*StickerPackRecord)(nil), // 23: signalservice.StickerPackRecord - (*CallLinkRecord)(nil), // 24: signalservice.CallLinkRecord - (*Recipient)(nil), // 25: signalservice.Recipient - (*ChatFolderRecord)(nil), // 26: signalservice.ChatFolderRecord - (*NotificationProfile)(nil), // 27: signalservice.NotificationProfile - (*ManifestRecord_Identifier)(nil), // 28: signalservice.ManifestRecord.Identifier - (*ContactRecord_Name)(nil), // 29: signalservice.ContactRecord.Name - (*AccountRecord_PinnedConversation)(nil), // 30: signalservice.AccountRecord.PinnedConversation - (*AccountRecord_UsernameLink)(nil), // 31: signalservice.AccountRecord.UsernameLink - (*AccountRecord_IAPSubscriberData)(nil), // 32: signalservice.AccountRecord.IAPSubscriberData - (*AccountRecord_NotificationProfileManualOverride)(nil), // 33: signalservice.AccountRecord.NotificationProfileManualOverride - (*AccountRecord_PinnedConversation_Contact)(nil), // 34: signalservice.AccountRecord.PinnedConversation.Contact - (*AccountRecord_PinnedConversation_ReleaseNotes)(nil), // 35: signalservice.AccountRecord.PinnedConversation.ReleaseNotes - (*AccountRecord_NotificationProfileManualOverride_ManuallyEnabled)(nil), // 36: signalservice.AccountRecord.NotificationProfileManualOverride.ManuallyEnabled - (*Recipient_Contact)(nil), // 37: signalservice.Recipient.Contact -} -var file_signalpb_StorageService_proto_depIdxs = []int32{ - 11, // 0: signalservice.StorageItems.items:type_name -> signalservice.StorageItem - 10, // 1: signalservice.WriteOperation.manifest:type_name -> signalservice.StorageManifest - 11, // 2: signalservice.WriteOperation.insertItem:type_name -> signalservice.StorageItem - 28, // 3: signalservice.ManifestRecord.identifiers:type_name -> signalservice.ManifestRecord.Identifier - 17, // 4: signalservice.StorageRecord.contact:type_name -> signalservice.ContactRecord - 18, // 5: signalservice.StorageRecord.groupV1:type_name -> signalservice.GroupV1Record - 19, // 6: signalservice.StorageRecord.groupV2:type_name -> signalservice.GroupV2Record - 21, // 7: signalservice.StorageRecord.account:type_name -> signalservice.AccountRecord - 22, // 8: signalservice.StorageRecord.storyDistributionList:type_name -> signalservice.StoryDistributionListRecord - 23, // 9: signalservice.StorageRecord.stickerPack:type_name -> signalservice.StickerPackRecord - 24, // 10: signalservice.StorageRecord.callLink:type_name -> signalservice.CallLinkRecord - 26, // 11: signalservice.StorageRecord.chatFolder:type_name -> signalservice.ChatFolderRecord - 27, // 12: signalservice.StorageRecord.notificationProfile:type_name -> signalservice.NotificationProfile - 3, // 13: signalservice.ContactRecord.identityState:type_name -> signalservice.ContactRecord.IdentityState - 29, // 14: signalservice.ContactRecord.nickname:type_name -> signalservice.ContactRecord.Name - 1, // 15: signalservice.ContactRecord.avatarColor:type_name -> signalservice.AvatarColor - 0, // 16: signalservice.ContactRecord.notifyForCallsIfMuted:type_name -> signalservice.OptionalBool - 0, // 17: signalservice.ContactRecord.showUnreadReminders:type_name -> signalservice.OptionalBool - 4, // 18: signalservice.GroupV2Record.storySendMode:type_name -> signalservice.GroupV2Record.StorySendMode - 1, // 19: signalservice.GroupV2Record.avatarColor:type_name -> signalservice.AvatarColor - 0, // 20: signalservice.GroupV2Record.notifyForCallsIfMuted:type_name -> signalservice.OptionalBool - 0, // 21: signalservice.GroupV2Record.notifyForMentionsIfMuted:type_name -> signalservice.OptionalBool - 0, // 22: signalservice.GroupV2Record.notifyForRepliesIfMuted:type_name -> signalservice.OptionalBool - 0, // 23: signalservice.GroupV2Record.showUnreadReminders:type_name -> signalservice.OptionalBool - 6, // 24: signalservice.AccountRecord.phoneNumberSharingMode:type_name -> signalservice.AccountRecord.PhoneNumberSharingMode - 30, // 25: signalservice.AccountRecord.pinnedConversations:type_name -> signalservice.AccountRecord.PinnedConversation - 20, // 26: signalservice.AccountRecord.payments:type_name -> signalservice.Payments - 0, // 27: signalservice.AccountRecord.storyViewReceiptsEnabled:type_name -> signalservice.OptionalBool - 31, // 28: signalservice.AccountRecord.usernameLink:type_name -> signalservice.AccountRecord.UsernameLink - 32, // 29: signalservice.AccountRecord.backupSubscriberData:type_name -> signalservice.AccountRecord.IAPSubscriberData - 1, // 30: signalservice.AccountRecord.avatarColor:type_name -> signalservice.AvatarColor - 33, // 31: signalservice.AccountRecord.notificationProfileManualOverride:type_name -> signalservice.AccountRecord.NotificationProfileManualOverride - 5, // 32: signalservice.AccountRecord.unreadBadgeType:type_name -> signalservice.AccountRecord.UnreadBadgeType - 0, // 33: signalservice.AccountRecord.includeMutedChatsInBadge:type_name -> signalservice.OptionalBool - 0, // 34: signalservice.AccountRecord.reactionNotifications:type_name -> signalservice.OptionalBool - 0, // 35: signalservice.AccountRecord.notifyForCallsIfMuted:type_name -> signalservice.OptionalBool - 0, // 36: signalservice.AccountRecord.notifyForMentionsIfMuted:type_name -> signalservice.OptionalBool - 0, // 37: signalservice.AccountRecord.notifyForRepliesIfMuted:type_name -> signalservice.OptionalBool - 0, // 38: signalservice.AccountRecord.showUnreadReminders:type_name -> signalservice.OptionalBool - 0, // 39: signalservice.AccountRecord.notifyWhenContactJoins:type_name -> signalservice.OptionalBool - 37, // 40: signalservice.Recipient.contact:type_name -> signalservice.Recipient.Contact - 8, // 41: signalservice.ChatFolderRecord.folderType:type_name -> signalservice.ChatFolderRecord.FolderType - 25, // 42: signalservice.ChatFolderRecord.includedRecipients:type_name -> signalservice.Recipient - 25, // 43: signalservice.ChatFolderRecord.excludedRecipients:type_name -> signalservice.Recipient - 25, // 44: signalservice.NotificationProfile.allowedMembers:type_name -> signalservice.Recipient - 9, // 45: signalservice.NotificationProfile.scheduleDaysEnabled:type_name -> signalservice.NotificationProfile.DayOfWeek - 2, // 46: signalservice.ManifestRecord.Identifier.type:type_name -> signalservice.ManifestRecord.Identifier.Type - 34, // 47: signalservice.AccountRecord.PinnedConversation.contact:type_name -> signalservice.AccountRecord.PinnedConversation.Contact - 35, // 48: signalservice.AccountRecord.PinnedConversation.releaseNotes:type_name -> signalservice.AccountRecord.PinnedConversation.ReleaseNotes - 7, // 49: signalservice.AccountRecord.UsernameLink.color:type_name -> signalservice.AccountRecord.UsernameLink.Color - 36, // 50: signalservice.AccountRecord.NotificationProfileManualOverride.enabled:type_name -> signalservice.AccountRecord.NotificationProfileManualOverride.ManuallyEnabled - 51, // [51:51] is the sub-list for method output_type - 51, // [51:51] is the sub-list for method input_type - 51, // [51:51] is the sub-list for extension type_name - 51, // [51:51] is the sub-list for extension extendee - 0, // [0:51] is the sub-list for field type_name -} - -func init() { file_signalpb_StorageService_proto_init() } -func file_signalpb_StorageService_proto_init() { - if File_signalpb_StorageService_proto != nil { - return - } - file_signalpb_StorageService_proto_msgTypes[6].OneofWrappers = []any{ - (*StorageRecord_Contact)(nil), - (*StorageRecord_GroupV1)(nil), - (*StorageRecord_GroupV2)(nil), - (*StorageRecord_Account)(nil), - (*StorageRecord_StoryDistributionList)(nil), - (*StorageRecord_StickerPack)(nil), - (*StorageRecord_CallLink)(nil), - (*StorageRecord_ChatFolder)(nil), - (*StorageRecord_NotificationProfile)(nil), - } - file_signalpb_StorageService_proto_msgTypes[7].OneofWrappers = []any{} - file_signalpb_StorageService_proto_msgTypes[9].OneofWrappers = []any{} - file_signalpb_StorageService_proto_msgTypes[11].OneofWrappers = []any{} - file_signalpb_StorageService_proto_msgTypes[15].OneofWrappers = []any{ - (*Recipient_Contact_)(nil), - (*Recipient_LegacyGroupId)(nil), - (*Recipient_GroupMasterKey)(nil), - } - file_signalpb_StorageService_proto_msgTypes[17].OneofWrappers = []any{} - file_signalpb_StorageService_proto_msgTypes[20].OneofWrappers = []any{ - (*AccountRecord_PinnedConversation_Contact_)(nil), - (*AccountRecord_PinnedConversation_LegacyGroupId)(nil), - (*AccountRecord_PinnedConversation_GroupMasterKey)(nil), - (*AccountRecord_PinnedConversation_ReleaseNotes_)(nil), - } - file_signalpb_StorageService_proto_msgTypes[22].OneofWrappers = []any{ - (*AccountRecord_IAPSubscriberData_PurchaseToken)(nil), - (*AccountRecord_IAPSubscriberData_OriginalTransactionId)(nil), - } - file_signalpb_StorageService_proto_msgTypes[23].OneofWrappers = []any{ - (*AccountRecord_NotificationProfileManualOverride_DisabledAtTimestampMs)(nil), - (*AccountRecord_NotificationProfileManualOverride_Enabled)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_signalpb_StorageService_proto_rawDesc), len(file_signalpb_StorageService_proto_rawDesc)), - NumEnums: 10, - NumMessages: 28, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signalpb_StorageService_proto_goTypes, - DependencyIndexes: file_signalpb_StorageService_proto_depIdxs, - EnumInfos: file_signalpb_StorageService_proto_enumTypes, - MessageInfos: file_signalpb_StorageService_proto_msgTypes, - }.Build() - File_signalpb_StorageService_proto = out.File - file_signalpb_StorageService_proto_goTypes = nil - file_signalpb_StorageService_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/signalpb/StorageService.proto b/pkg/signalmeow/protobuf/signalpb/StorageService.proto deleted file mode 100644 index 4109826..0000000 --- a/pkg/signalmeow/protobuf/signalpb/StorageService.proto +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright 2020-2021 Signal Messenger, LLC - * SPDX-License-Identifier: AGPL-3.0-only - */ -syntax = "proto3"; - -package signalservice; - -option java_package = "org.whispersystems.signalservice.internal.storage.protos"; -option java_multiple_files = true; - -enum OptionalBool { - UNSET = 0; - ENABLED = 1; - DISABLED = 2; -} - -message StorageManifest { - uint64 version = 1; - bytes value = 2; -} - -message StorageItem { - bytes key = 1; - bytes value = 2; -} - -message StorageItems { - repeated StorageItem items = 1; -} - -message ReadOperation { - repeated bytes readKey = 1; -} - -message WriteOperation { - StorageManifest manifest = 1; - repeated StorageItem insertItem = 2; - repeated bytes deleteKey = 3; - bool clearAll = 4; -} - -message ManifestRecord { - message Identifier { - enum Type { - UNKNOWN = 0; - CONTACT = 1; - GROUPV1 = 2; - GROUPV2 = 3; - ACCOUNT = 4; - STORY_DISTRIBUTION_LIST = 5; - STICKER_PACK = 6; - CALL_LINK = 7; - CHAT_FOLDER = 8; - NOTIFICATION_PROFILE = 9; - } - - bytes raw = 1; - Type type = 2; - } - - uint64 version = 1; - uint32 sourceDevice = 3; - repeated Identifier identifiers = 2; - bytes recordIkm = 4; - // Next ID: 5 -} - -message StorageRecord { - oneof record { - ContactRecord contact = 1; - GroupV1Record groupV1 = 2; - GroupV2Record groupV2 = 3; - AccountRecord account = 4; - StoryDistributionListRecord storyDistributionList = 5; - StickerPackRecord stickerPack = 6; - CallLinkRecord callLink = 7; - ChatFolderRecord chatFolder = 8; - NotificationProfile notificationProfile = 9; - } -} - - -// If unset - computed as the value of the first byte of SHA-256(msg=CONTACT_ID) -// modulo the count of colors. Once set the avatar color for a recipient is -// never recomputed or changed. -// -// `CONTACT_ID` is the first available identifier from the list: -// - ServiceIdToBinary(ACI) -// - E164 -// - ServiceIdToBinary(PNI) -// - Group Id -enum AvatarColor { - A100 = 0; - A110 = 1; - A120 = 2; - A130 = 3; - A140 = 4; - A150 = 5; - A160 = 6; - A170 = 7; - A180 = 8; - A190 = 9; - A200 = 10; - A210 = 11; -} - -message ContactRecord { - enum IdentityState { - DEFAULT = 0; - VERIFIED = 1; - UNVERIFIED = 2; - } - - message Name { - string given = 1; - string family = 2; - } - - string aci = 1; - string e164 = 2; - string pni = 15; - bytes profileKey = 3; - bytes identityKey = 4; - IdentityState identityState = 5; - string givenName = 6; - string familyName = 7; - string username = 8; - bool blocked = 9; - bool whitelisted = 10; - bool archived = 11; - bool markedUnread = 12; - uint64 mutedUntilTimestamp = 13; - bool hideStory = 14; - uint64 unregisteredAtTimestamp = 16; - string systemGivenName = 17; - string systemFamilyName = 18; - string systemNickname = 19; - bool hidden = 20; - bool pniSignatureVerified = 21; - Name nickname = 22; - string note = 23; - optional AvatarColor avatarColor = 24; - bytes aciBinary = 25; // 16-byte UUID - bytes pniBinary = 26; // 16-byte UUID - uint64 blockedAtTimestamp = 27; // 0 means the blocked time is unknown - OptionalBool notifyForCallsIfMuted = 28; // If unset, use the default settings - OptionalBool showUnreadReminders = 29; // If unset, use the default settings - // Next ID: 30 -} - -message GroupV1Record { - bytes id = 1; - bool blocked = 2; - bool whitelisted = 3; - bool archived = 4; - bool markedUnread = 5; - uint64 mutedUntilTimestamp = 6; -} - -message GroupV2Record { - enum StorySendMode { - DEFAULT = 0; - DISABLED = 1; - ENABLED = 2; - } - - bytes masterKey = 1; - bool blocked = 2; - bool whitelisted = 3; - bool archived = 4; - bool markedUnread = 5; - uint64 mutedUntilTimestamp = 6; - bool dontNotifyForMentionsIfMuted = 7; // will be deprecated in favor of [notifyForMentionsIfMuted] - bool hideStory = 8; - 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 - uint64 blockedAtTimestamp = 13; // 0 means the blocked time is unknown - OptionalBool notifyForCallsIfMuted = 14; // If unset, use the default settings - OptionalBool notifyForMentionsIfMuted = 15; // If unset, use the default settings. If [dontNotifyForMentionsIfMuted] is true, this should be initialized to false. - OptionalBool notifyForRepliesIfMuted = 16; // If unset, use the default settings - OptionalBool showUnreadReminders = 17; // If unset, use the default settings -} - -message Payments { - bool enabled = 1; - bytes entropy = 2; -} - -message AccountRecord { - - enum UnreadBadgeType { - UNKNOWN_BADGE_TYPE = 0; // Interpret as "Unread messages" - UNREAD_MESSAGES = 1; - UNREAD_CHATS = 2; - } - - enum PhoneNumberSharingMode { - UNKNOWN = 0; - EVERYBODY = 1; - NOBODY = 2; - } - - 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) - } - - message ReleaseNotes {} - - oneof identifier { - Contact contact = 1; - bytes legacyGroupId = 3; - bytes groupMasterKey = 4; - ReleaseNotes releaseNotes = 5; - } - } - - message UsernameLink { - enum Color { - UNKNOWN = 0; - BLUE = 1; - WHITE = 2; - GREY = 3; - OLIVE = 4; - GREEN = 5; - ORANGE = 6; - PINK = 7; - PURPLE = 8; - } - - bytes entropy = 1; // 32 bytes of entropy used for encryption - bytes serverId = 2; // 16 bytes of encoded UUID provided by the server - Color color = 3; - } - - message IAPSubscriberData { - bytes subscriberId = 1; - - oneof iapSubscriptionId { - // Identifies an Android Play Store IAP subscription. - string purchaseToken = 2; - // Identifies an iOS App Store IAP subscription. - uint64 originalTransactionId = 3; - } - } - - message NotificationProfileManualOverride { - message ManuallyEnabled { - bytes id = 1; - - // This will be unset if no timespan was chosen in the UI. - uint64 endAtTimestampMs = 3; - } - - oneof override { - uint64 disabledAtTimestampMs = 1; - ManuallyEnabled enabled = 2; - } - } - - bytes profileKey = 1; - string givenName = 2; - string familyName = 3; - string avatarUrlPath = 4; - bool noteToSelfArchived = 5; - bool readReceipts = 6; - bool sealedSenderIndicators = 7; - bool typingIndicators = 8; - reserved /* proxiedLinkPreviews */ 9; - bool noteToSelfMarkedUnread = 10; - bool linkPreviews = 11; - PhoneNumberSharingMode phoneNumberSharingMode = 12; - bool unlistedPhoneNumber = 13; - repeated PinnedConversation pinnedConversations = 14; - bool preferContactAvatars = 15; - Payments payments = 16; - uint32 universalExpireTimer = 17; - bool primarySendsSms = 18; - reserved /* e164 */ 19; - repeated string preferredReactionEmoji = 20; - bytes subscriberId = 21; - string subscriberCurrencyCode = 22; - bool displayBadgesOnProfile = 23; - bool subscriptionManuallyCancelled = 24; - bool keepMutedChatsArchived = 25; - bool hasSetMyStoriesPrivacy = 26; - bool hasViewedOnboardingStory = 27; - reserved /* storiesDisabled */ 28; - bool storiesDisabled = 29; - OptionalBool storyViewReceiptsEnabled = 30; - reserved /* hasReadOnboardingStory */ 31; - bool hasSeenGroupStoryEducationSheet = 32; - string username = 33; - bool hasCompletedUsernameOnboarding = 34; - UsernameLink usernameLink = 35; - reserved /* backupsSubscriberId */ 36; - reserved /* backupsSubscriberCurrencyCode */ 37; - reserved /* backupsSubscriptionManuallyCancelled */ 38; - reserved /* hasBackup */ 39; - optional uint64 backupTier = 40; // See zkgroup for integer particular values. Unset if backups are not enabled. - IAPSubscriberData backupSubscriberData = 41; - optional AvatarColor avatarColor = 42; - reserved /* backupTierHistory */ 43; - NotificationProfileManualOverride notificationProfileManualOverride = 44; - bool notificationProfileSyncDisabled = 45; - bool automaticKeyVerificationDisabled = 46; - bool hasSeenAdminDeleteEducationDialog = 47; - optional bool releaseNotesChatArchived = 48; - optional uint64 releaseNotesChatMutedUntilTimestamp = 49; - optional bool releaseNotesChatBlocked = 50; - optional bool releaseNotesChatMarkedUnread = 51; - optional uint64 releaseNotesChatBlockedAt = 52; // only set if known (>0) - UnreadBadgeType unreadBadgeType = 53; // Only used in desktop/ios - OptionalBool includeMutedChatsInBadge = 54; // Only used in desktop/ios. If unset, consider this off. Only used in desktop/ios - OptionalBool reactionNotifications = 55; // If unset, consider this on - OptionalBool notifyForCallsIfMuted = 56; // If unset, consider this off - OptionalBool notifyForMentionsIfMuted = 57; // If unset, consider this on - OptionalBool notifyForRepliesIfMuted = 58; // If unset, consider this on - OptionalBool showUnreadReminders = 59; // If unset, consider this on - OptionalBool notifyWhenContactJoins = 60; // If unset, consider this off -} - -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) -} - -message StickerPackRecord { - bytes packId = 1; // 16 bytes - bytes packKey = 2; // 32 bytes, used to derive the AES-256 key - // aesKey = HKDF( - // input = packKey, - // salt = 32 zero bytes, - // info = "Sticker Pack" - // ) - uint32 position = 3; // When displayed sticker packs should be first sorted - // in ascending order by zero-based `position` and - // then by ascending `packId` (lexicographically, - // packId can be treated as a hex string). - // When installing a sticker pack the client should find - // the maximum `position` among currently known stickers - // and use `max_position + 1` as the value for the new - // `position`. - uint64 deletedAtTimestamp = 4; // Timestamp in milliseconds. When present and - // non-zero - `packKey` and `position` should - // be unset -} - -message CallLinkRecord { - bytes rootKey = 1; - bytes adminPasskey = 2; - uint64 deletedAtTimestampMs = 3; - reserved 4; // was epoch field, never used -} - -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) - } - - oneof identifier { - Contact contact = 1; - bytes legacyGroupId = 2; - bytes groupMasterKey = 3; - } -} - -message ChatFolderRecord { - // Represents the default "All chats" folder record vs all other custom folders - enum FolderType { - UNKNOWN = 0; - ALL = 1; - CUSTOM = 2; - } - - bytes identifier = 1; - string name = 2; - uint32 position = 3; - bool showOnlyUnread = 4; - bool showMutedChats = 5; - bool includeAllIndividualChats = 6; // Folder includes all 1:1 chats, unless excluded - bool includeAllGroupChats = 7; // Folder includes all group chats, unless excluded - FolderType folderType = 8; - repeated Recipient includedRecipients = 9; - repeated Recipient excludedRecipients = 10; - uint64 deletedAtTimestampMs = 11; // When non-zero, `position` should be set to -1 and includedRecipients should be empty -} - -message NotificationProfile { - enum DayOfWeek { - UNKNOWN = 0; // Interpret as "Monday" - MONDAY = 1; - TUESDAY = 2; - WEDNESDAY = 3; - THURSDAY = 4; - FRIDAY = 5; - SATURDAY = 6; - SUNDAY = 7; - } - - bytes id = 1; - string name = 2; - optional string emoji = 3; - fixed32 color = 4; // 0xAARRGGBB - uint64 createdAtMs = 5; - bool allowAllCalls = 6; - bool allowAllMentions = 7; - repeated Recipient allowedMembers = 8; - bool scheduleEnabled = 9; - uint32 scheduleStartTime = 10; // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - uint32 scheduleEndTime = 11; // 24-hour clock int, 0000-2359 (e.g., 15, 900, 1130, 2345) - repeated DayOfWeek scheduleDaysEnabled = 12; - uint64 deletedAtTimestampMs = 13; -} diff --git a/pkg/signalmeow/protobuf/signalpb/WebSocketResources.pb.go b/pkg/signalmeow/protobuf/signalpb/WebSocketResources.pb.go deleted file mode 100644 index 28efd72..0000000 --- a/pkg/signalmeow/protobuf/signalpb/WebSocketResources.pb.go +++ /dev/null @@ -1,381 +0,0 @@ -//* -// Copyright (C) 2014-2016 Open Whisper Systems -// -// 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 -// source: signalpb/WebSocketResources.proto - -package signalpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" - unsafe "unsafe" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type WebSocketMessage_Type int32 - -const ( - WebSocketMessage_UNKNOWN WebSocketMessage_Type = 0 - WebSocketMessage_REQUEST WebSocketMessage_Type = 1 - WebSocketMessage_RESPONSE WebSocketMessage_Type = 2 -) - -// Enum value maps for WebSocketMessage_Type. -var ( - WebSocketMessage_Type_name = map[int32]string{ - 0: "UNKNOWN", - 1: "REQUEST", - 2: "RESPONSE", - } - WebSocketMessage_Type_value = map[string]int32{ - "UNKNOWN": 0, - "REQUEST": 1, - "RESPONSE": 2, - } -) - -func (x WebSocketMessage_Type) Enum() *WebSocketMessage_Type { - p := new(WebSocketMessage_Type) - *p = x - return p -} - -func (x WebSocketMessage_Type) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (WebSocketMessage_Type) Descriptor() protoreflect.EnumDescriptor { - return file_signalpb_WebSocketResources_proto_enumTypes[0].Descriptor() -} - -func (WebSocketMessage_Type) Type() protoreflect.EnumType { - return &file_signalpb_WebSocketResources_proto_enumTypes[0] -} - -func (x WebSocketMessage_Type) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Do not use. -func (x *WebSocketMessage_Type) UnmarshalJSON(b []byte) error { - num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) - if err != nil { - return err - } - *x = WebSocketMessage_Type(num) - return nil -} - -// Deprecated: Use WebSocketMessage_Type.Descriptor instead. -func (WebSocketMessage_Type) EnumDescriptor() ([]byte, []int) { - return file_signalpb_WebSocketResources_proto_rawDescGZIP(), []int{2, 0} -} - -type WebSocketRequestMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Verb *string `protobuf:"bytes,1,opt,name=verb" json:"verb,omitempty"` - Path *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"` - Body []byte `protobuf:"bytes,3,opt,name=body" json:"body,omitempty"` - Headers []string `protobuf:"bytes,5,rep,name=headers" json:"headers,omitempty"` - Id *uint64 `protobuf:"varint,4,opt,name=id" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WebSocketRequestMessage) Reset() { - *x = WebSocketRequestMessage{} - mi := &file_signalpb_WebSocketResources_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WebSocketRequestMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WebSocketRequestMessage) ProtoMessage() {} - -func (x *WebSocketRequestMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_WebSocketResources_proto_msgTypes[0] - 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 WebSocketRequestMessage.ProtoReflect.Descriptor instead. -func (*WebSocketRequestMessage) Descriptor() ([]byte, []int) { - return file_signalpb_WebSocketResources_proto_rawDescGZIP(), []int{0} -} - -func (x *WebSocketRequestMessage) GetVerb() string { - if x != nil && x.Verb != nil { - return *x.Verb - } - return "" -} - -func (x *WebSocketRequestMessage) GetPath() string { - if x != nil && x.Path != nil { - return *x.Path - } - return "" -} - -func (x *WebSocketRequestMessage) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -func (x *WebSocketRequestMessage) GetHeaders() []string { - if x != nil { - return x.Headers - } - return nil -} - -func (x *WebSocketRequestMessage) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -type WebSocketResponseMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Status *uint32 `protobuf:"varint,2,opt,name=status" json:"status,omitempty"` - Message *string `protobuf:"bytes,3,opt,name=message" json:"message,omitempty"` - Headers []string `protobuf:"bytes,5,rep,name=headers" json:"headers,omitempty"` - Body []byte `protobuf:"bytes,4,opt,name=body" json:"body,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WebSocketResponseMessage) Reset() { - *x = WebSocketResponseMessage{} - mi := &file_signalpb_WebSocketResources_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WebSocketResponseMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WebSocketResponseMessage) ProtoMessage() {} - -func (x *WebSocketResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_WebSocketResources_proto_msgTypes[1] - 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 WebSocketResponseMessage.ProtoReflect.Descriptor instead. -func (*WebSocketResponseMessage) Descriptor() ([]byte, []int) { - return file_signalpb_WebSocketResources_proto_rawDescGZIP(), []int{1} -} - -func (x *WebSocketResponseMessage) GetId() uint64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *WebSocketResponseMessage) GetStatus() uint32 { - if x != nil && x.Status != nil { - return *x.Status - } - return 0 -} - -func (x *WebSocketResponseMessage) GetMessage() string { - if x != nil && x.Message != nil { - return *x.Message - } - return "" -} - -func (x *WebSocketResponseMessage) GetHeaders() []string { - if x != nil { - return x.Headers - } - return nil -} - -func (x *WebSocketResponseMessage) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -type WebSocketMessage struct { - state protoimpl.MessageState `protogen:"open.v1"` - Type *WebSocketMessage_Type `protobuf:"varint,1,opt,name=type,enum=signalservice.WebSocketMessage_Type" json:"type,omitempty"` - Request *WebSocketRequestMessage `protobuf:"bytes,2,opt,name=request" json:"request,omitempty"` - Response *WebSocketResponseMessage `protobuf:"bytes,3,opt,name=response" json:"response,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WebSocketMessage) Reset() { - *x = WebSocketMessage{} - mi := &file_signalpb_WebSocketResources_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WebSocketMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WebSocketMessage) ProtoMessage() {} - -func (x *WebSocketMessage) ProtoReflect() protoreflect.Message { - mi := &file_signalpb_WebSocketResources_proto_msgTypes[2] - 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 WebSocketMessage.ProtoReflect.Descriptor instead. -func (*WebSocketMessage) Descriptor() ([]byte, []int) { - return file_signalpb_WebSocketResources_proto_rawDescGZIP(), []int{2} -} - -func (x *WebSocketMessage) GetType() WebSocketMessage_Type { - if x != nil && x.Type != nil { - return *x.Type - } - return WebSocketMessage_UNKNOWN -} - -func (x *WebSocketMessage) GetRequest() *WebSocketRequestMessage { - if x != nil { - return x.Request - } - return nil -} - -func (x *WebSocketMessage) GetResponse() *WebSocketResponseMessage { - if x != nil { - return x.Response - } - return nil -} - -var File_signalpb_WebSocketResources_proto protoreflect.FileDescriptor - -const file_signalpb_WebSocketResources_proto_rawDesc = "" + - "\n" + - "!signalpb/WebSocketResources.proto\x12\rsignalservice\"\x7f\n" + - "\x17WebSocketRequestMessage\x12\x12\n" + - "\x04verb\x18\x01 \x01(\tR\x04verb\x12\x12\n" + - "\x04path\x18\x02 \x01(\tR\x04path\x12\x12\n" + - "\x04body\x18\x03 \x01(\fR\x04body\x12\x18\n" + - "\aheaders\x18\x05 \x03(\tR\aheaders\x12\x0e\n" + - "\x02id\x18\x04 \x01(\x04R\x02id\"\x8a\x01\n" + - "\x18WebSocketResponseMessage\x12\x0e\n" + - "\x02id\x18\x01 \x01(\x04R\x02id\x12\x16\n" + - "\x06status\x18\x02 \x01(\rR\x06status\x12\x18\n" + - "\amessage\x18\x03 \x01(\tR\amessage\x12\x18\n" + - "\aheaders\x18\x05 \x03(\tR\aheaders\x12\x12\n" + - "\x04body\x18\x04 \x01(\fR\x04body\"\x83\x02\n" + - "\x10WebSocketMessage\x128\n" + - "\x04type\x18\x01 \x01(\x0e2$.signalservice.WebSocketMessage.TypeR\x04type\x12@\n" + - "\arequest\x18\x02 \x01(\v2&.signalservice.WebSocketRequestMessageR\arequest\x12C\n" + - "\bresponse\x18\x03 \x01(\v2'.signalservice.WebSocketResponseMessageR\bresponse\".\n" + - "\x04Type\x12\v\n" + - "\aUNKNOWN\x10\x00\x12\v\n" + - "\aREQUEST\x10\x01\x12\f\n" + - "\bRESPONSE\x10\x02B/\n" + - "\x1corg.signal.network.websocketB\x0fWebSocketProtos" - -var ( - file_signalpb_WebSocketResources_proto_rawDescOnce sync.Once - file_signalpb_WebSocketResources_proto_rawDescData []byte -) - -func file_signalpb_WebSocketResources_proto_rawDescGZIP() []byte { - file_signalpb_WebSocketResources_proto_rawDescOnce.Do(func() { - file_signalpb_WebSocketResources_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_signalpb_WebSocketResources_proto_rawDesc), len(file_signalpb_WebSocketResources_proto_rawDesc))) - }) - return file_signalpb_WebSocketResources_proto_rawDescData -} - -var file_signalpb_WebSocketResources_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_signalpb_WebSocketResources_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_signalpb_WebSocketResources_proto_goTypes = []any{ - (WebSocketMessage_Type)(0), // 0: signalservice.WebSocketMessage.Type - (*WebSocketRequestMessage)(nil), // 1: signalservice.WebSocketRequestMessage - (*WebSocketResponseMessage)(nil), // 2: signalservice.WebSocketResponseMessage - (*WebSocketMessage)(nil), // 3: signalservice.WebSocketMessage -} -var file_signalpb_WebSocketResources_proto_depIdxs = []int32{ - 0, // 0: signalservice.WebSocketMessage.type:type_name -> signalservice.WebSocketMessage.Type - 1, // 1: signalservice.WebSocketMessage.request:type_name -> signalservice.WebSocketRequestMessage - 2, // 2: signalservice.WebSocketMessage.response:type_name -> signalservice.WebSocketResponseMessage - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_signalpb_WebSocketResources_proto_init() } -func file_signalpb_WebSocketResources_proto_init() { - if File_signalpb_WebSocketResources_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_signalpb_WebSocketResources_proto_rawDesc), len(file_signalpb_WebSocketResources_proto_rawDesc)), - NumEnums: 1, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_signalpb_WebSocketResources_proto_goTypes, - DependencyIndexes: file_signalpb_WebSocketResources_proto_depIdxs, - EnumInfos: file_signalpb_WebSocketResources_proto_enumTypes, - MessageInfos: file_signalpb_WebSocketResources_proto_msgTypes, - }.Build() - File_signalpb_WebSocketResources_proto = out.File - file_signalpb_WebSocketResources_proto_goTypes = nil - file_signalpb_WebSocketResources_proto_depIdxs = nil -} diff --git a/pkg/signalmeow/protobuf/update-protos.sh b/pkg/signalmeow/protobuf/update-protos.sh index c1e3c71..76bb6ae 100755 --- a/pkg/signalmeow/protobuf/update-protos.sh +++ b/pkg/signalmeow/protobuf/update-protos.sh @@ -1,35 +1,22 @@ #!/bin/bash -cd $(dirname "$0") set -euo pipefail -ANDROID_GIT_REVISION=${1:-46d6eeb2f3d3e12e6938151a8dbd2a33b5604b1f} +ANDROID_GIT_REVISION=${1:-c725a2fabb76f88d555c9f8b3c4f1cbdde4d4593} +DESKTOP_GIT_REVISION=${1:-060c58be527396918fa3753ace4f9f38d7c67876} 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) - REPO="Signal-Android" - prefix="lib/archive/src/main/protowire/" - GIT_REVISION=$ANDROID_GIT_REVISION - ;; - Signal-Android-Network) - REPO="Signal-Android" - prefix="core/network/src/main/protowire/" - GIT_REVISION=$ANDROID_GIT_REVISION - ;; - Signal-Android-Util) - REPO="Signal-Android" - prefix="core/util-jvm/src/main/protowire/" - GIT_REVISION=$ANDROID_GIT_REVISION + Signal-Desktop) + prefix="protos/" + GIT_REVISION=$DESKTOP_GIT_REVISION ;; esac - DIRNAME=${3:-signalpb} - echo https://raw.githubusercontent.com/signalapp/${REPO}/${GIT_REVISION}/${prefix}${2} - curl -Lf https://raw.githubusercontent.com/signalapp/${REPO}/${GIT_REVISION}/${prefix}${2} -o ${DIRNAME}/${2} + echo https://raw.githubusercontent.com/signalapp/${1}/${GIT_REVISION}/${prefix}${2} + curl -LOf https://raw.githubusercontent.com/signalapp/${1}/${GIT_REVISION}/${prefix}${2} } @@ -37,12 +24,10 @@ update_proto Signal-Android Groups.proto update_proto Signal-Android Provisioning.proto update_proto Signal-Android SignalService.proto update_proto Signal-Android StickerResources.proto -update_proto Signal-Android-Network WebSocketResources.proto +update_proto Signal-Android WebSocketResources.proto update_proto Signal-Android StorageService.proto -update_proto Signal-Android-Util DeviceName.proto -update_proto Signal-Android-Archive Backup.proto backuppb -cp -f ../../libsignalgo/libsignal/rust/net/src/proto/cds2.proto cds2pb/cds2.proto -cp -rf ../../libsignalgo/libsignal/rust/net/grpc/proto/org . -sed 's#TextSecure.proto#signalpb/SignalService.proto#' -i org/signal/chat/messages.proto -sed 's/textsecure.Envelope/signalservice.Envelope/' -i org/signal/chat/messages.proto +update_proto Signal-Desktop DeviceName.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 bba1411..5f959d6 100644 --- a/pkg/signalmeow/provisioning.go +++ b/pkg/signalmeow/provisioning.go @@ -21,20 +21,20 @@ import ( "encoding/base64" "encoding/json" "fmt" - mrand "math/rand/v2" + mrand "math/rand" "net/http" "net/url" "time" - "github.com/coder/websocket" "github.com/google/uuid" "github.com/rs/zerolog" "go.mau.fi/util/exerrors" "go.mau.fi/util/random" "google.golang.org/protobuf/proto" + "nhooyr.io/websocket" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + 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" @@ -53,6 +53,7 @@ const ( StateProvisioningError ProvisioningState = iota StateProvisioningURLReceived StateProvisioningDataReceived + StateProvisioningPreKeysRegistered ) func (s ProvisioningState) String() string { @@ -63,6 +64,8 @@ func (s ProvisioningState) String() string { return "StateProvisioningURLReceived" case StateProvisioningDataReceived: return "StateProvisioningDataReceived" + case StateProvisioningPreKeysRegistered: + return "StateProvisioningPreKeysRegistered" default: return fmt.Sprintf("ProvisioningState(%d)", s) } @@ -76,28 +79,15 @@ type ProvisioningResponse struct { Err error } -type DeviceLinkError struct { - StatusCode int - Message string -} - -func (dle DeviceLinkError) Error() string { - return fmt.Sprintf("non-200 status code (%d) from devices response: %s", dle.StatusCode, dle.Message) -} - -func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, deviceName string, allowBackup bool) chan ProvisioningResponse { +func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, deviceName string) chan ProvisioningResponse { log := zerolog.Ctx(ctx).With().Str("action", "perform provisioning").Logger() - c := make(chan ProvisioningResponse, 4) + c := make(chan ProvisioningResponse) go func() { defer close(c) - timeoutCtx, cancel := context.WithTimeout(ctx, 2*time.Minute) + ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) defer cancel() - ws, resp, err := web.OpenWebsocket(timeoutCtx, (&url.URL{ - Scheme: "wss", - Host: web.APIHostname, - Path: web.WebsocketProvisioningPath, - }).String()) + ws, resp, err := web.OpenWebsocket(ctx, web.WebsocketProvisioningPath) if err != nil { log.Err(err).Any("resp", resp).Msg("error opening provisioning websocket") c <- ProvisioningResponse{State: StateProvisioningError, Err: err} @@ -106,7 +96,7 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev defer ws.Close(websocket.StatusInternalError, "Websocket StatusInternalError") provisioningCipher := NewProvisioningCipher() - provisioningURL, err := startProvisioning(timeoutCtx, ws, provisioningCipher, allowBackup) + provisioningURL, err := startProvisioning(ctx, ws, provisioningCipher) if err != nil { log.Err(err).Msg("startProvisioning error") c <- ProvisioningResponse{State: StateProvisioningError, Err: err} @@ -114,7 +104,7 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev } c <- ProvisioningResponse{State: StateProvisioningURLReceived, ProvisioningURL: provisioningURL, Err: err} - provisioningMessage, err := continueProvisioning(timeoutCtx, ws, provisioningCipher) + provisioningMessage, err := continueProvisioning(ctx, ws, provisioningCipher) if err != nil { log.Err(err).Msg("continueProvisioning error") c <- ProvisioningResponse{State: StateProvisioningError, Err: err} @@ -133,19 +123,21 @@ 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 - aciSignedPreKey := GenerateSignedPreKey(1, aciIdentityKeyPair) - pniSignedPreKey := GenerateSignedPreKey(1, pniIdentityKeyPair) - aciPQLastResortPreKey := GenerateKyberPreKeys(1, 1, aciIdentityKeyPair)[0] - pniPQLastResortPreKey := GenerateKyberPreKeys(1, 1, pniIdentityKeyPair)[0] + registrationId := mrand.Intn(16383) + 1 + pniRegistrationId := mrand.Intn(16383) + 1 + aciSignedPreKey := GenerateSignedPreKey(1, types.UUIDKindACI, aciIdentityKeyPair) + pniSignedPreKey := GenerateSignedPreKey(2, types.UUIDKindPNI, pniIdentityKeyPair) + aciPQLastResortPreKeys := GenerateKyberPreKeys(1, 1, types.UUIDKindACI, aciIdentityKeyPair) + pniPQLastResortPreKeys := GenerateKyberPreKeys(1, 1, types.UUIDKindPNI, pniIdentityKeyPair) + aciPQLastResortPreKey := aciPQLastResortPreKeys[0] + pniPQLastResortPreKey := pniPQLastResortPreKeys[0] deviceResponse, err := confirmDevice( ctx, username, password, *code, - aciRegistrationID, - pniRegistrationID, + registrationId, + pniRegistrationId, aciSignedPreKey, pniSignedPreKey, aciPQLastResortPreKey, @@ -167,26 +159,13 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev data := &store.DeviceData{ ACIIdentityKeyPair: aciIdentityKeyPair, PNIIdentityKeyPair: pniIdentityKeyPair, - ACIRegistrationID: aciRegistrationID, - PNIRegistrationID: pniRegistrationID, + RegistrationID: registrationId, + PNIRegistrationID: pniRegistrationId, ACI: deviceResponse.ACI, PNI: deviceResponse.PNI, DeviceID: deviceId, Number: *provisioningMessage.Number, Password: password, - 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() - 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") } // Store the provisioning data @@ -208,15 +187,15 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev device.ClearDeviceKeys(ctx) // Store identity keys? - _, err = device.IdentityKeyStore.SaveIdentityKey(ctx, device.ACIServiceID(), device.ACIIdentityKeyPair.GetIdentityKey()) + address, err := libsignalgo.NewUUIDAddress(device.ACI, uint(device.DeviceID)) if err != nil { c <- ProvisioningResponse{ State: StateProvisioningError, - Err: fmt.Errorf("error saving identity key: %w", err), + Err: fmt.Errorf("error creating new address: %w", err), } return } - _, err = device.IdentityKeyStore.SaveIdentityKey(ctx, device.PNIServiceID(), device.PNIIdentityKeyPair.GetIdentityKey()) + _, err = device.IdentityStore.SaveIdentityKey(ctx, address, device.ACIIdentityKeyPair.GetIdentityKey()) if err != nil { c <- ProvisioningResponse{ State: StateProvisioningError, @@ -226,20 +205,13 @@ func PerformProvisioning(ctx context.Context, deviceStore store.DeviceStore, dev } // Store signed prekeys (now that we have a device) - device.ACIPreKeyStore.StoreSignedPreKey(ctx, 1, aciSignedPreKey) - device.PNIPreKeyStore.StoreSignedPreKey(ctx, 1, pniSignedPreKey) - device.ACIPreKeyStore.StoreLastResortKyberPreKey(ctx, 1, aciPQLastResortPreKey) - device.PNIPreKeyStore.StoreLastResortKyberPreKey(ctx, 1, pniPQLastResortPreKey) + device.PreKeyStoreExtras.SaveSignedPreKey(ctx, types.UUIDKindACI, aciSignedPreKey, true) + device.PreKeyStoreExtras.SaveSignedPreKey(ctx, types.UUIDKindPNI, pniSignedPreKey, true) + device.PreKeyStoreExtras.SaveKyberPreKey(ctx, types.UUIDKindACI, aciPQLastResortPreKey, true) + device.PreKeyStoreExtras.SaveKyberPreKey(ctx, types.UUIDKindPNI, pniPQLastResortPreKey, true) // Store our profile key - err = device.RecipientStore.StoreRecipient(ctx, &types.Recipient{ - ACI: data.ACI, - PNI: data.PNI, - E164: data.Number, - Profile: types.Profile{ - Key: profileKey, - }, - }) + err = device.ProfileKeyStore.StoreProfileKey(ctx, data.ACI, profileKey) if err != nil { c <- ProvisioningResponse{ State: StateProvisioningError, @@ -250,12 +222,34 @@ 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, types.UUIDKindACI) + if err != nil { + c <- ProvisioningResponse{ + State: StateProvisioningError, + Err: fmt.Errorf("error generating and registering ACI prekeys: %w", err), + } + return + } + err = cli.GenerateAndRegisterPreKeys(ctx, types.UUIDKindPNI) + 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 } // Returns the provisioningUrl and an error -func startProvisioning(ctx context.Context, ws *websocket.Conn, provisioningCipher *ProvisioningCipher, allowBackup bool) (string, error) { +func startProvisioning(ctx context.Context, ws *websocket.Conn, provisioningCipher *ProvisioningCipher) (string, error) { log := zerolog.Ctx(ctx).With().Str("action", "start provisioning").Logger() pubKey := provisioningCipher.GetPublicKey() @@ -271,23 +265,18 @@ func startProvisioning(ctx context.Context, ws *websocket.Conn, provisioningCiph return "", fmt.Errorf("unexpected websocket message: %v", msg) } - var provisioningBody signalpb.ProvisioningAddress + var provisioningBody signalpb.ProvisioningUuid err = proto.Unmarshal(msg.GetRequest().GetBody(), &provisioningBody) if err != nil { return "", fmt.Errorf("failed to unmarshal provisioning UUID: %w", err) } - linkCapabilities := []string{"backup5"} - if !allowBackup { - linkCapabilities = []string{} - } provisioningURL := (&url.URL{ Scheme: "sgnl", Host: "linkdevice", RawQuery: url.Values{ - "uuid": []string{provisioningBody.GetAddress()}, - "pub_key": []string{base64.StdEncoding.EncodeToString(exerrors.Must(pubKey.Serialize()))}, - "capabilities": linkCapabilities, + "uuid": []string{provisioningBody.GetUuid()}, + "pub_key": []string{base64.StdEncoding.EncodeToString(exerrors.Must(pubKey.Serialize()))}, }.Encode(), }).String() @@ -336,37 +325,13 @@ func continueProvisioning(ctx context.Context, ws *websocket.Conn, provisioningC return provisioningMessage, err } -var signalCapabilities = map[string]any{ - "attachmentBackfill": true, - "spqr": true, - "usernameChangeSyncMessage": true, -} - -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) - if err != nil { - return err - } - return web.DecodeWSResponseBody(ctx, nil, resp) -} - -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) - if err != nil { - return err - } - return web.DecodeWSResponseBody(ctx, nil, resp) -} - func confirmDevice( ctx context.Context, username string, password string, code string, - aciRegistrationID int, - pniRegistrationID int, + registrationId int, + pniRegistrationId int, aciSignedPreKey *libsignalgo.SignedPreKeyRecord, pniSignedPreKey *libsignalgo.SignedPreKeyRecord, aciPQLastResortPreKey *libsignalgo.KyberPreKeyRecord, @@ -381,43 +346,29 @@ func confirmDevice( return nil, fmt.Errorf("failed to encrypt device name: %w", err) } - ws, resp, err := web.OpenWebsocket(ctx, (&url.URL{ - Scheme: "wss", - Host: web.APIHostname, - Path: web.WebsocketPath, - }).String()) + ws, resp, err := web.OpenWebsocket(ctx, web.WebsocketPath) if err != nil { log.Err(err).Any("resp", resp).Msg("error opening websocket") return nil, err } defer ws.Close(websocket.StatusInternalError, "Websocket StatusInternalError") - aciSignedPreKeyJson, err := SignedPreKeyToJSON(aciSignedPreKey) - if err != nil { - return nil, fmt.Errorf("failed to convert signed ACI prekey to JSON: %w", err) - } - pniSignedPreKeyJson, err := SignedPreKeyToJSON(pniSignedPreKey) - if err != nil { - return nil, fmt.Errorf("failed to convert signed PNI prekey to JSON: %w", err) - } + aciSignedPreKeyJson := SignedPreKeyToJSON(aciSignedPreKey) + pniSignedPreKeyJson := SignedPreKeyToJSON(pniSignedPreKey) - aciPQLastResortPreKeyJson, err := KyberPreKeyToJSON(aciPQLastResortPreKey) - if err != nil { - return nil, fmt.Errorf("failed to convert ACI kyber last resort prekey to JSON: %w", err) - } - pniPQLastResortPreKeyJson, err := KyberPreKeyToJSON(pniPQLastResortPreKey) - if err != nil { - return nil, fmt.Errorf("failed to convert PNI kyber last resort prekey to JSON: %w", err) - } + aciPQLastResortPreKeyJson := KyberPreKeyToJSON(aciPQLastResortPreKey) + pniPQLastResortPreKeyJson := KyberPreKeyToJSON(pniPQLastResortPreKey) data := map[string]any{ "verificationCode": code, "accountAttributes": map[string]any{ "fetchesMessages": true, "name": encryptedDeviceName, - "registrationId": aciRegistrationID, - "pniRegistrationId": pniRegistrationID, - "capabilities": signalCapabilities, + "registrationId": registrationId, + "pniRegistrationId": pniRegistrationId, + "capabilities": map[string]any{ + "pni": true, + }, }, "aciSignedPreKey": aciSignedPreKeyJson, "pniSignedPreKey": pniSignedPreKeyJson, @@ -450,9 +401,9 @@ func confirmDevice( return nil, fmt.Errorf("failed to read from websocket after devices call: %w", err) } - status := int(receivedMsg.GetResponse().GetStatus()) + status := int(*receivedMsg.Response.Status) if status < 200 || status >= 300 { - return nil, DeviceLinkError{StatusCode: status, Message: receivedMsg.GetResponse().GetMessage()} + return nil, fmt.Errorf("non-200 status code (%d) from devices response: %s", status, *receivedMsg.Response.Message) } // unmarshal JSON response into ConfirmDeviceResponse diff --git a/pkg/signalmeow/provisioning_cipher.go b/pkg/signalmeow/provisioning_cipher.go index b20beb0..8670274 100644 --- a/pkg/signalmeow/provisioning_cipher.go +++ b/pkg/signalmeow/provisioning_cipher.go @@ -29,7 +29,7 @@ import ( "google.golang.org/protobuf/proto" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" ) type ProvisioningCipher struct { diff --git a/pkg/signalmeow/pushreg.go b/pkg/signalmeow/pushreg.go deleted file mode 100644 index b912f0c..0000000 --- a/pkg/signalmeow/pushreg.go +++ /dev/null @@ -1,73 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2024 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" - "net/http" - - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/web" -) - -type ReqRegisterFCM struct { - GCMRegistrationID string `json:"gcmRegistrationId,omitempty"` - WebSocketChannel bool `json:"webSocketChannel"` -} - -type ReqRegisterAPNs struct { - APNRegistrationID string `json:"apnRegistrationId,omitempty"` - VoIPRegistrationID string `json:"voipRegistrationId,omitempty"` -} - -func (cli *Client) registerPush(ctx context.Context, pushType string, data any) error { - var resp *signalpb.WebSocketResponseMessage - var err error - if data != nil { - 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) - } - if err != nil { - return err - } - return web.DecodeWSResponseBody(ctx, nil, resp) -} - -func (cli *Client) RegisterFCM(ctx context.Context, token string) error { - if token == "" { - return cli.registerPush(ctx, "gcm", nil) - } - return cli.registerPush(ctx, "gcm", &ReqRegisterFCM{ - GCMRegistrationID: token, - WebSocketChannel: true, - }) -} - -func (cli *Client) RegisterAPNs(ctx context.Context, token string) error { - if token == "" { - return cli.registerPush(ctx, "apn", nil) - } - return cli.registerPush(ctx, "apn", &ReqRegisterAPNs{ - APNRegistrationID: token, - }) -} diff --git a/pkg/signalmeow/receiving.go b/pkg/signalmeow/receiving.go index 0254a21..2ee008b 100644 --- a/pkg/signalmeow/receiving.go +++ b/pkg/signalmeow/receiving.go @@ -1,6 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. // Copyright (C) 2023 Scott Weber -// 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 @@ -18,10 +17,8 @@ package signalmeow import ( - "bytes" "context" "encoding/base64" - "errors" "fmt" "net/http" "strings" @@ -29,12 +26,13 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/util/ptr" + "go.mau.fi/util/exerrors" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/reflect/protoreflect" "go.mau.fi/mautrix-signal/pkg/libsignalgo" "go.mau.fi/mautrix-signal/pkg/signalmeow/events" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/types" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) @@ -47,7 +45,6 @@ const ( SignalConnectionEventDisconnected SignalConnectionEventLoggedOut SignalConnectionEventError - SignalConnectionEventFatalError SignalConnectionCleanShutdown ) @@ -58,7 +55,6 @@ var signalConnectionEventNames = map[SignalConnectionEvent]string{ SignalConnectionEventDisconnected: "SignalConnectionEventDisconnected", SignalConnectionEventLoggedOut: "SignalConnectionEventLoggedOut", SignalConnectionEventError: "SignalConnectionEventError", - SignalConnectionEventFatalError: "SignalConnectionEventFatalError", SignalConnectionCleanShutdown: "SignalConnectionCleanShutdown", } @@ -72,86 +68,35 @@ type SignalConnectionStatus struct { Err error } -func (cli *Client) StartWebsockets(ctx context.Context) (authChan, unauthChan chan web.SignalWebsocketConnectionStatus, err error) { - authChan, unauthChan, _, _, err = cli.startWebsocketsInternal(ctx) - return -} - -func (cli *Client) startWebsocketsInternal( - ctx context.Context, -) ( - authChan, unauthChan chan web.SignalWebsocketConnectionStatus, - loopCtx context.Context, loopCancel context.CancelFunc, - err error, -) { - cli.GRPC, err = web.NewGRPCClient(cli.Store.BasicAuthCreds()) - if err != nil { - return - } - loopCtx, loopCancel = context.WithCancel(ctx) - unauthChan, err = cli.connectUnauthedWS(loopCtx) - if err != nil { - loopCancel() - return - } - zerolog.Ctx(ctx).Info().Msg("Unauthed websocket connecting") - authChan, err = cli.connectAuthedWS(loopCtx, cli.incomingRequestHandler) - if err != nil { - loopCancel() - return - } - zerolog.Ctx(ctx).Info().Msg("Authed websocket connecting") - cli.loopCancel = loopCancel - return -} - func (cli *Client) StartReceiveLoops(ctx context.Context) (chan SignalConnectionStatus, error) { log := zerolog.Ctx(ctx).With().Str("action", "start receive loops").Logger() - cbc := make(chan time.Time, 1) - cli.writeCallbackCounter = cbc - - authChan, unauthChan, loopCtx, loopCancel, err := cli.startWebsocketsInternal(log.WithContext(ctx)) + ctx, cancel := context.WithCancel(log.WithContext(ctx)) + cli.WSCancel = cancel + authChan, err := cli.ConnectAuthedWS(ctx, cli.incomingRequestHandler) if err != nil { + cancel() return nil, err } - statusChan := make(chan SignalConnectionStatus, 128) + log.Info().Msg("Authed websocket connecting") + unauthChan, err := cli.ConnectUnauthedWS(ctx) + if err != nil { + cancel() + return nil, err + } + log.Info().Msg("Unauthed websocket connecting") + statusChan := make(chan SignalConnectionStatus, 10000) initialConnectChan := make(chan struct{}) - resetWriteCount := make(chan struct{}, 1) // Combine both websocket status channels into a single, more generic "Signal" connection status channel - cli.loopWg.Add(2) go func() { - defer cli.loopWg.Done() - writeCallbackTimer := time.Now() - callbackCount := 0 - for { - select { - case <-loopCtx.Done(): - return - case <-resetWriteCount: - callbackCount = 0 - case nextTS := <-cbc: - if callbackCount >= 4 && time.Since(writeCallbackTimer) > 1*time.Minute { - err := cli.Store.EventBuffer.DeleteBufferedEventsOlderThan(ctx, writeCallbackTimer) - if err != nil { - log.Err(err).Msg("Failed to delete old buffered event hashes") - } - writeCallbackTimer = nextTS - } else { - callbackCount++ - } - } - } - }() - go func() { - defer cli.loopWg.Done() defer close(statusChan) - defer loopCancel() + defer cancel() var currentStatus, lastAuthStatus, lastUnauthStatus web.SignalWebsocketConnectionStatus + var lastSentStatus SignalConnectionStatus for { select { - case <-loopCtx.Done(): + case <-ctx.Done(): log.Info().Msg("Context done, exiting websocket status loop") return case status := <-authChan: @@ -171,17 +116,9 @@ func (cli *Client) StartReceiveLoops(ctx context.Context) (chan SignalConnection //StopReceiveLoops(d) case web.SignalWebsocketConnectionEventError: log.Err(status.Err).Msg("Authed websocket error") - case web.SignalWebsocketConnectionEventFatalError: - log.Err(status.Err).Msg("Authed websocket fatal error") case web.SignalWebsocketConnectionEventCleanShutdown: log.Info().Msg("Authed websocket clean shutdown") } - if status.Event != web.SignalWebsocketConnectionEventConnected { - select { - case resetWriteCount <- struct{}{}: - default: - } - } case status := <-unauthChan: lastUnauthStatus = status currentStatus = status @@ -201,8 +138,6 @@ func (cli *Client) StartReceiveLoops(ctx context.Context) (chan SignalConnection log.Err(status.Err).Msg("Unauthed websocket logged out ** THIS SHOULD BE IMPOSSIBLE **") case web.SignalWebsocketConnectionEventError: log.Err(status.Err).Msg("Unauthed websocket error") - case web.SignalWebsocketConnectionEventFatalError: - log.Err(status.Err).Msg("Unauthed websocket fatal error") case web.SignalWebsocketConnectionEventCleanShutdown: log.Info().Msg("Unauthed websocket clean shutdown") } @@ -232,82 +167,57 @@ func (cli *Client) StartReceiveLoops(ctx context.Context) (chan SignalConnection Event: SignalConnectionEventError, Err: currentStatus.Err, } - } else if currentStatus.Event == web.SignalWebsocketConnectionEventFatalError { - statusToSend = SignalConnectionStatus{ - Event: SignalConnectionEventFatalError, - Err: currentStatus.Err, - } } else if currentStatus.Event == web.SignalWebsocketConnectionEventCleanShutdown { statusToSend = SignalConnectionStatus{ Event: SignalConnectionCleanShutdown, } } - if statusToSend.Event != 0 && statusToSend.Event != cli.lastConnectionStatus.Event { + if statusToSend.Event != 0 && statusToSend.Event != lastSentStatus.Event { log.Info().Any("status_to_send", statusToSend).Msg("Sending connection status") statusChan <- statusToSend - cli.lastConnectionStatus = statusToSend + lastSentStatus = statusToSend } } }() // Send sync message once both websockets are connected - 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 <-ctx.Done(): + return + case <-initialConnectChan: + log.Info().Msg("Both websockets connected, sending contacts sync request") + // TODO hacky + cli.SendContactSyncRequest(ctx) + return } } }() - return statusChan, nil -} + // Start loop to check for and upload more prekeys + cli.StartKeyCheckLoop(ctx, types.UUIDKindACI) -func (cli *Client) ForceReconnect() { - cli.AuthedWS.ForceReconnect() - cli.UnauthedWS.ForceReconnect() - cli.GRPC.ResetConnectBackoff() + return statusChan, nil } func (cli *Client) StopReceiveLoops() error { defer func() { cli.AuthedWS = nil cli.UnauthedWS = nil - cli.GRPC = nil }() authErr := cli.AuthedWS.Close() unauthErr := cli.UnauthedWS.Close() - grpcErr := cli.GRPC.Close() - if cli.loopCancel != nil { - cli.loopCancel() - cli.loopWg.Wait() + if cli.WSCancel != nil { + cli.WSCancel() } - return errors.Join(authErr, unauthErr, grpcErr) -} - -func (cli *Client) LastConnectionStatus() SignalConnectionStatus { - return cli.lastConnectionStatus + if authErr != nil { + return authErr + } + if unauthErr != nil { + return unauthErr + } + return nil } func (cli *Client) ClearKeysAndDisconnect(ctx context.Context) error { @@ -319,7 +229,29 @@ func (cli *Client) ClearKeysAndDisconnect(ctx context.Context) error { clearErr2 := cli.Store.ClearPassword(ctx) stopLoopErr := cli.StopReceiveLoops() - return errors.Join(clearErr, clearErr2, stopLoopErr) + if clearErr != nil { + return clearErr + } + if clearErr2 != nil { + return clearErr2 + } + return stopLoopErr +} + +// If a bridge can't decrypt prekeys, it's probably because the prekeys are broken so force re-registration +func (cli *Client) checkDecryptionErrorAndDisconnect(ctx context.Context, err error) { + if err == nil { + return + } + log := zerolog.Ctx(ctx).With().Str("action", "check decryption error and disconnect").Logger() + if strings.Contains(err.Error(), "30: invalid PreKey message: decryption failed") || + strings.Contains(err.Error(), "70: invalid signed prekey identifier") { + log.Warn().Msg("Failed decrypting a PreKey message, probably our prekeys are broken, force re-registration") + disconnectErr := cli.ClearKeysAndDisconnect(ctx) + if disconnectErr != nil { + log.Err(disconnectErr).Msg("ClearKeysAndDisconnect error") + } + } } func (cli *Client) incomingRequestHandler(ctx context.Context, req *signalpb.WebSocketRequestMessage) (*web.SimpleResponse, error) { @@ -327,14 +259,12 @@ func (cli *Client) incomingRequestHandler(ctx context.Context, req *signalpb.Web Str("handler", "incoming request handler"). Str("verb", *req.Verb). Str("path", *req.Path). - Uint64("incoming_request_id", *req.Id). Logger() ctx = log.WithContext(ctx) if *req.Verb == http.MethodPut && *req.Path == "/api/v1/message" { return cli.incomingAPIMessageHandler(ctx, req) } else if *req.Verb == http.MethodPut && *req.Path == "/api/v1/queue/empty" { - log.Debug().Msg("Received queue empty notice") - cli.handleEvent(&events.QueueEmpty{}) + log.Trace().Msg("Received queue empty") } else { log.Warn().Any("req", req).Msg("Unknown websocket request message") } @@ -343,589 +273,503 @@ func (cli *Client) incomingRequestHandler(ctx context.Context, req *signalpb.Web }, nil } +// TODO: we should split this up into multiple functions func (cli *Client) incomingAPIMessageHandler(ctx context.Context, req *signalpb.WebSocketRequestMessage) (*web.SimpleResponse, error) { - log := *zerolog.Ctx(ctx) + log := zerolog.Ctx(ctx).With().Str("handler_type", "incoming API message handler").Logger() + responseCode := 200 envelope := &signalpb.Envelope{} err := proto.Unmarshal(req.Body, envelope) if err != nil { log.Err(err).Msg("Unmarshal error") return nil, err } - log = log.With(). - Uint64("envelope_timestamp", envelope.GetClientTimestamp()). - Uint64("server_timestamp", envelope.GetServerTimestamp()). - Logger() - ctx = log.WithContext(ctx) - destinationServiceID, _ := ParseStringOrBinaryServiceID(envelope.GetDestinationServiceId(), envelope.GetDestinationServiceIdBinary()) - sourceServiceID, _ := ParseStringOrBinaryServiceID(envelope.GetSourceServiceId(), envelope.GetSourceServiceIdBinary()) - 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()). - 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") + var result *DecryptionResult - result := cli.decryptEnvelope(ctx, envelope, sourceServiceID, destinationServiceID) - - err = cli.handleDecryptedResult(ctx, result, envelope, destinationServiceID) - if err != nil { - log.Err(err).Msg("Error handling decrypted result") - return nil, err - } - - return &web.SimpleResponse{ - Status: 200, - WriteCallback: cli.writeCallback, - }, nil -} - -func (cli *Client) writeCallback(preWriteTime time.Time) { - ch := cli.writeCallbackCounter - if ch != nil { - select { - case ch <- preWriteTime: - default: - } - } -} - -var ErrHandlerFailed = errors.New("event handler returned non-success status") - -// TODO: we should split this up into multiple functions -func (cli *Client) handleDecryptedResult( - ctx context.Context, - result DecryptionResult, - envelope *signalpb.Envelope, - destinationServiceID libsignalgo.ServiceID, -) (retErr error) { - if errors.Is(result.Err, context.Canceled) { - return result.Err - } else if ctx.Err() != nil { - return ctx.Err() - } - log := zerolog.Ctx(ctx) - handlerSuccess := true - defer func() { - if retErr == nil && !handlerSuccess { - retErr = ErrHandlerFailed - } - if result.CiphertextHash != nil && handlerSuccess { - err := cli.Store.EventBuffer.ClearBufferedEventPlaintext(ctx, *result.CiphertextHash) - if err != nil { - log.Err(err). - Hex("ciphertext_hash", result.CiphertextHash[:]). - Msg("Failed to clear buffered event plaintext") - } else { - log.Debug(). - Hex("ciphertext_hash", result.CiphertextHash[:]). - Msg("Deleted event plaintext from buffer") - } - } else if result.CiphertextHash != nil { - log.Warn().Msg("Not clearing buffered event plaintext due to handler failure") - } - }() - - 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) - - // 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 { - if errors.Is(result.Err, EventAlreadyProcessed) { - log.Debug().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("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") - // Only send decryption error event if the message was urgent, - // to prevent spamming errors for typing notifications and whatnot - if envelope.GetUrgent() && - result.ContentHint != libsignalgo.UnidentifiedSenderMessageContentHintImplicit && - !strings.Contains(result.Err.Error(), "message with old counter") { - handlerSuccess = cli.handleEvent(&events.DecryptionError{ - Sender: theirServiceID.UUID, - Err: result.Err, - Timestamp: envelope.GetClientTimestamp(), - }) - } - 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 { - 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") - newLog := log.With(). - Stringer("sender_name", theirServiceID). - Uint("sender_device_id", deviceID). - Str("destination_service_id", destinationServiceID.String()). - Logger() - log = &newLog - ctx = log.WithContext(ctx) - logEvt := log.Debug() - 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 - } - - // If there's a sender key distribution message, process it - if rawContent.SenderKeyDistributionMessage != nil { - log.Debug().Msg("content includes sender key distribution message") - skdm, err := libsignalgo.DeserializeSenderKeyDistributionMessage(rawContent.SenderKeyDistributionMessage) - if err != nil { - log.Err(err).Msg("DeserializeSenderKeyDistributionMessage error") - return err - } - err = libsignalgo.ProcessSenderKeyDistributionMessage( + switch *envelope.Type { + case signalpb.Envelope_UNIDENTIFIED_SENDER: + log.Trace().Msg("Received envelope type UNIDENTIFIED_SENDER") + usmc, err := libsignalgo.SealedSenderDecryptToUSMC( ctx, - skdm, - result.SenderAddress, - cli.Store.SenderKeyStore, + envelope.GetContent(), + cli.Store.IdentityStore, ) - if err != nil { - log.Err(err).Msg("ProcessSenderKeyDistributionMessage error") - return err - } - } - - // If we're getting a message to our PNI, mark it as needing a PNI signature message on the next send - 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 err != nil || usmc == nil { + if err == nil { + err = fmt.Errorf("usmc is nil") } - if !recipient.NeedsPNISignature { - log.Debug().Msg("Marking recipient as needing PNI signature") - recipient.NeedsPNISignature = true - changed = true + log.Err(err).Msg("SealedSenderDecryptToUSMC error") + return nil, err + } + + messageType, err := usmc.GetMessageType() + if err != nil { + log.Err(err).Msg("GetMessageType error") + } + senderCertificate, err := usmc.GetSenderCertificate() + if err != nil { + log.Err(err).Msg("GetSenderCertificate error") + } + senderUUID, err := senderCertificate.GetSenderUUID() + if err != nil { + log.Err(err).Msg("GetSenderUUID error") + } + senderDeviceID, err := senderCertificate.GetDeviceID() + if err != nil { + log.Err(err).Msg("GetDeviceID error") + } + senderAddress, err := libsignalgo.NewUUIDAddress(senderUUID, uint(senderDeviceID)) + if err != nil { + log.Err(err).Msg("NewAddress error") + } + senderE164, err := senderCertificate.GetSenderE164() + if err != nil { + log.Err(err).Msg("GetSenderE164 error") + } + usmcContents, err := usmc.GetContents() + if err != nil { + log.Err(err).Msg("GetContents error") + } + log = log.With(). + Str("sender_uuid", senderUUID.String()). + Uint32("sender_device_id", senderDeviceID). + Str("sender_e164", senderE164). + Logger() + ctx = log.WithContext(ctx) + log.Trace().Msg("Received SealedSender message") + + err = cli.UpdateContactE164(ctx, senderUUID, senderE164) + if err != nil { + log.Err(err).Msg("UpdateContactE164 error") + } + + switch messageType { + case libsignalgo.CiphertextMessageTypeSenderKey: + log.Trace().Msg("SealedSender messageType is CiphertextMessageTypeSenderKey") + decryptedText, err := libsignalgo.GroupDecrypt( + ctx, + usmcContents, + senderAddress, + cli.Store.SenderKeyStore, + ) + if err != nil { + if strings.Contains(err.Error(), "message with old counter") { + log.Warn().Msg("Duplicate message, ignoring") + } else { + log.Err(err).Msg("GroupDecrypt error") + } + } else { + err = stripPadding(&decryptedText) + if err != nil { + return nil, fmt.Errorf("stripPadding error: %v", err) + } + content := signalpb.Content{} + err = proto.Unmarshal(decryptedText, &content) + if err != nil { + log.Err(err).Msg("Unmarshal error") + } + result = &DecryptionResult{ + SenderAddress: senderAddress, + Content: &content, + SealedSender: true, + } } - return - }) - 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 { - log.Debug().Msg("Content includes PNI signature message") - err = cli.handlePNISignatureMessage(ctx, theirServiceID, rawContent.PniSignatureMessage) - if err != nil { - log.Err(err). - Hex("pni_raw", rawContent.PniSignatureMessage.GetPni()). - Stringer("aci", theirServiceID.UUID). - Msg("Failed to verify ACI-PNI mapping") - } - } + case libsignalgo.CiphertextMessageTypePreKey: + log.Trace().Msg("SealedSender messageType is CiphertextMessageTypePreKey") + result, err = cli.prekeyDecrypt(ctx, senderAddress, usmcContents) + if err != nil { + log.Err(err).Msg("prekeyDecrypt error") + } - 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") - } + case libsignalgo.CiphertextMessageTypeWhisper: + log.Trace().Msg("SealedSender messageType is CiphertextMessageTypeWhisper") + message, err := libsignalgo.DeserializeMessage(usmcContents) + if err != nil { + log.Err(err).Msg("DeserializeMessage error") + } + decryptedText, err := libsignalgo.Decrypt( + ctx, + message, + senderAddress, + cli.Store.SessionStore, + cli.Store.IdentityStore, + ) + if err != nil { + log.Err(err).Msg("Sealed sender Whisper Decryption error") + } else { + err = stripPadding(&decryptedText) + if err != nil { + return nil, fmt.Errorf("stripPadding error: %v", err) + } + content := signalpb.Content{} + err = proto.Unmarshal(decryptedText, &content) + if err != nil { + log.Err(err).Msg("Unmarshal error") + } + result = &DecryptionResult{ + SenderAddress: senderAddress, + Content: &content, + SealedSender: true, + } + } - 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) + case libsignalgo.CiphertextMessageTypePlaintext: + log.Debug().Msg("SealedSender messageType is CiphertextMessageTypePlaintext") + // TODO: handle plaintext (usually DecryptionErrorMessage) and retries + // when implementing SenderKey groups + + //plaintextContent, err := libsignalgo.DeserializePlaintextContent(usmcContents) + //if err != nil { + // log.Err(err).Msg("DeserializePlaintextContent error") + //} + //body, err := plaintextContent.GetBody() + //if err != nil { + // log.Err(err).Msg("PlaintextContent GetBody error") + //} + //content := signalpb.Content{} + //err = proto.Unmarshal(body, &content) + //if err != nil { + // log.Err(err).Msg("PlaintextContent Unmarshal error") + //} + //result = &DecryptionResult{ + // SenderAddress: *senderAddress, + // Content: &content, + // SealedSender: true, + //} + + return &web.SimpleResponse{ + Status: responseCode, + }, nil + + default: + log.Warn().Msg("SealedSender messageType is unknown") } - return nil - case *signalpb.Content_DataMessage: - handlerSuccess, sendDeliveryReceipt = cli.incomingDataMessage( - ctx, content.DataMessage, theirServiceID.UUID, theirServiceID, envelope.GetServerTimestamp(), isBlocked, + + // If we couldn't decrypt with specific decryption methods, try sealedSenderDecrypt + if result == nil || responseCode != 200 { + log.Debug().Msg("Didn't decrypt with specific methods, trying sealedSenderDecrypt") + var err error + result, err = cli.sealedSenderDecrypt(ctx, envelope) + if err != nil { + if strings.Contains(err.Error(), "self send of a sealed sender message") { + log.Debug().Msg("Message sent by us, ignoring") + } else { + log.Err(err).Msg("sealedSenderDecrypt error") + cli.checkDecryptionErrorAndDisconnect(ctx, err) + } + } else { + log.Trace(). + Any("sender_address", result.SenderAddress). + Any("content", result.Content). + Msg("SealedSender decrypt result") + } + } + + case signalpb.Envelope_PREKEY_BUNDLE: + log.Debug().Msg("Received envelope type PREKEY_BUNDLE") + sender, err := libsignalgo.NewUUIDAddressFromString( + *envelope.SourceServiceId, + uint(*envelope.SourceDevice), ) - deliveryReceiptTS = content.DataMessage.GetTimestamp() - case *signalpb.Content_EditMessage: - handlerSuccess, sendDeliveryReceipt = cli.incomingEditMessage( - ctx, content.EditMessage, theirServiceID.UUID, theirServiceID, envelope.GetServerTimestamp(), isBlocked, + if err != nil { + return nil, fmt.Errorf("NewAddress error: %v", err) + } + result, err = cli.prekeyDecrypt(ctx, sender, envelope.Content) + if err != nil { + log.Err(err).Msg("prekeyDecrypt error") + cli.checkDecryptionErrorAndDisconnect(ctx, err) + } else { + log.Trace(). + Any("sender_address", result.SenderAddress). + Any("content", result.Content). + Msg("prekey decrypt result") + } + + case signalpb.Envelope_PLAINTEXT_CONTENT: + log.Debug().Msg("Received envelope type PLAINTEXT_CONTENT") + + case signalpb.Envelope_CIPHERTEXT: + log.Debug().Msg("Received envelope type CIPHERTEXT") + message, err := libsignalgo.DeserializeMessage(envelope.Content) + if err != nil { + log.Err(err).Msg("DeserializeMessage error") + } + senderAddress, err := libsignalgo.NewUUIDAddressFromString( + *envelope.SourceServiceId, + uint(*envelope.SourceDevice), ) - deliveryReceiptTS = content.EditMessage.GetDataMessage().GetTimestamp() - case *signalpb.Content_ReceiptMessage: - if content.ReceiptMessage.GetType() == signalpb.ReceiptMessage_DELIVERY && theirServiceID == cli.Store.ACIServiceID() { - // Ignore delivery receipts from other own devices - return nil + if err != nil { + return nil, fmt.Errorf("NewAddress error: %w", err) } - 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)) + decryptedText, err := libsignalgo.Decrypt( + ctx, + message, + senderAddress, + cli.Store.SessionStore, + cli.Store.IdentityStore, + ) + if err != nil { + if strings.Contains(err.Error(), "message with old counter") { + log.Info().Msg("Duplicate message, ignoring") + } else { + log.Err(err).Msg("Whisper Decryption error") + } + } else { + err = stripPadding(&decryptedText) + if err != nil { + return nil, fmt.Errorf("stripPadding error: %v", err) + } + content := signalpb.Content{} + err = proto.Unmarshal(decryptedText, &content) + if err != nil { + log.Err(err).Msg("Unmarshal error") + } + result = &DecryptionResult{ + SenderAddress: senderAddress, + Content: &content, + } } - if !isBlocked || groupID != "" { - // No handler success check here, nobody cares if typing notifications are dropped + + case signalpb.Envelope_RECEIPT: + log.Debug().Msg("Received envelope type RECEIPT") + // TODO: handle receipt + + case signalpb.Envelope_KEY_EXCHANGE: + log.Debug().Msg("Received envelope type KEY_EXCHANGE") + responseCode = 400 + + case signalpb.Envelope_UNKNOWN: + log.Warn().Msg("Received envelope type UNKNOWN") + responseCode = 400 + + default: + log.Warn().Msg("Received actual unknown envelope type") + responseCode = 400 + } + + // Handle content that is now decrypted + if result != nil && result.Content != nil { + content := result.Content + log.Trace().Any("raw_data", content).Msg("Raw event data") + + name, _ := result.SenderAddress.Name() + deviceId, _ := result.SenderAddress.DeviceID() + log = log.With(). + Str("sender_name", name). + Uint("sender_device_id", deviceId). + Logger() + ctx = log.WithContext(ctx) + log.Debug().Msg("Decrypted message") + printContentFieldString(ctx, content, "Decrypted content fields") + + // If there's a sender key distribution message, process it + if content.GetSenderKeyDistributionMessage() != nil { + log.Debug().Msg("content includes sender key distribution message") + skdm, err := libsignalgo.DeserializeSenderKeyDistributionMessage(content.GetSenderKeyDistributionMessage()) + if err != nil { + log.Err(err).Msg("DeserializeSenderKeyDistributionMessage error") + return nil, err + } + err = libsignalgo.ProcessSenderKeyDistributionMessage( + ctx, + skdm, + result.SenderAddress, + cli.Store.SenderKeyStore, + ) + if err != nil { + log.Err(err).Msg("ProcessSenderKeyDistributionMessage error") + return nil, err + } + } + + theirUUID, err := result.SenderAddress.NameUUID() + if err != nil { + log.Err(err).Msg("Name error") + return nil, err + } + + // TODO: handle more sync messages + if content.SyncMessage != nil { + syncSent := content.SyncMessage.GetSent() + if syncSent.GetMessage() != nil || syncSent.GetEditMessage() != nil { + destination := syncSent.DestinationServiceId + var destinationUUID uuid.UUID + if destination != nil { + destinationUUID, err = uuid.Parse(*destination) + if err != nil { + log.Err(err).Msg("Sync message destination parse error") + return nil, err + } + } + 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, destinationUUID) + } else if content.SyncMessage.Sent.EditMessage != nil { + cli.incomingEditMessage(ctx, content.SyncMessage.Sent.EditMessage, cli.Store.ACI, destinationUUID) + } + } + if content.SyncMessage.Contacts != nil { + log.Debug().Msg("Recieved sync message contacts") + blob := content.SyncMessage.Contacts.Blob + if blob != nil { + contactsBytes, err := DownloadAttachment(ctx, blob) + 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.Contact, 0, len(contacts)) + for i, signalContact := range contacts { + if signalContact.Aci == nil || *signalContact.Aci == "" { + log.Info(). + Any("contact", signalContact). + Msg("Signal Contact UUID is nil, skipping") + continue + } + contact, err := cli.StoreContactDetailsAsContact(ctx, signalContact, &avatars[i]) + if err != nil { + log.Err(err).Msg("StoreContactDetailsAsContact error") + continue + } + convertedContacts = append(convertedContacts, contact) + } + cli.handleEvent(&events.ContactList{ + Contacts: convertedContacts, + }) + } + } + if content.SyncMessage.Read != nil { + cli.handleEvent(&events.ReadSelf{ + Messages: content.SyncMessage.GetRead(), + }) + } + + } + + var sendDeliveryReceipt bool + if content.DataMessage != nil { + sendDeliveryReceipt = cli.incomingDataMessage(ctx, content.DataMessage, theirUUID, theirUUID) + } else if content.EditMessage != nil { + sendDeliveryReceipt = cli.incomingEditMessage(ctx, content.EditMessage, theirUUID, theirUUID) + } + if sendDeliveryReceipt { + // TODO send delivery receipts after actually bridging instead of here + err = cli.sendDeliveryReceipts(ctx, []uint64{content.DataMessage.GetTimestamp()}, theirUUID) + if err != nil { + log.Err(err).Msg("sendDeliveryReceipts error") + } + } + + if content.TypingMessage != nil { + var groupID types.GroupIdentifier + if content.TypingMessage.GetGroupId() != nil { + gidBytes := content.TypingMessage.GetGroupId() + groupID = types.GroupIdentifier(base64.StdEncoding.EncodeToString(gidBytes)) + } cli.handleEvent(&events.ChatEvent{ Info: events.MessageInfo{ - Sender: theirServiceID.UUID, - ChatID: groupOrUserID(groupID, theirServiceID), - ServerTimestamp: envelope.GetServerTimestamp(), + Sender: theirUUID, + ChatID: groupOrUserID(groupID, theirUUID), }, Event: content.TypingMessage, }) } - case *signalpb.Content_CallMessage: - if !isBlocked && (content.CallMessage.Offer != nil || content.CallMessage.Hangup != nil) { - handlerSuccess = cli.handleEvent(&events.Call{ + + // 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) { + cli.handleEvent(&events.Call{ Info: events.MessageInfo{ - Sender: theirServiceID.UUID, - ChatID: theirServiceID.String(), - ServerTimestamp: envelope.GetServerTimestamp(), + Sender: theirUUID, + ChatID: theirUUID.String(), }, - // 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") + + // Read and delivery receipts + if content.ReceiptMessage != nil { + if content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_DELIVERY && theirUUID == cli.Store.ACI { + // Ignore delivery receipts from other own devices + return &web.SimpleResponse{ + Status: responseCode, + }, nil + } + cli.handleEvent(&events.Receipt{ + Sender: theirUUID, + Content: content.ReceiptMessage, + }) } } - - if sendDeliveryReceipt && handlerSuccess { - err = cli.sendDeliveryReceipts(ctx, []uint64{deliveryReceiptTS}, theirServiceID.UUID) - if err != nil { - log.Err(err).Msg("sendDeliveryReceipts error") - } - } - - return nil + return &web.SimpleResponse{ + Status: responseCode, + }, nil } -func groupOrUserID(groupID types.GroupIdentifier, userID libsignalgo.ServiceID) string { +func printStructFields(message protoreflect.Message, parent string, builder *strings.Builder) { + message.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool { + fieldName := string(fd.Name()) + currentField := parent + fieldName + fmt.Fprintf(builder, "%s (%s), ", currentField, fd.Kind().String()) + //builder.WriteString(fmt.Sprintf("%s (%s): %s, ", currentField, fd.Kind().String(), v.String())) // DEBUG: printing value, don't commit + if fd.Kind() == protoreflect.MessageKind && !fd.IsList() && v.Message().IsValid() { + builder.WriteString("{ ") + printStructFields(v.Message(), "", builder) + builder.WriteString("} ") + } else if fd.Kind() == protoreflect.MessageKind && fd.IsList() { + builder.WriteString("[ ") + for i := 0; i < v.List().Len(); i++ { + v := v.List().Get(i) + builder.WriteString("{ ") + printStructFields(v.Message(), "", builder) + builder.WriteString("} ") + } + builder.WriteString("] ") + } else if fd.IsList() { + builder.WriteString("[ ") + for i := 0; i < v.List().Len(); i++ { + //v := v.List().Get(i) + //builder.WriteString(fmt.Sprintf("%s, ", v.String())) // DEBUG: printing value, don't commit + builder.WriteString("<>, ") + } + builder.WriteString("] ") + } + return true + }) +} + +func printContentFieldString(ctx context.Context, c *signalpb.Content, message string) { + log := zerolog.Ctx(ctx) + go func() { + // catch panic + defer func() { + if r := recover(); r != nil { + log.Warn().Any("recover", r).Msg("Panic in contentFieldsString") + } + }() + log.Debug().Str("content_fields", contentFieldsString(c)).Msg(message) + }() +} + +func contentFieldsString(c *signalpb.Content) string { + var builder strings.Builder + printStructFields(c.ProtoReflect(), "", &builder) + return builder.String() +} + +func groupOrUserID(groupID types.GroupIdentifier, userID uuid.UUID) string { if groupID == "" { return userID.String() } 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") - } - pniBytes := msg.GetPni() - if len(pniBytes) != 16 { - return fmt.Errorf("unexpected PNI length %d (expected 16)", len(pniBytes)) - } - pni := uuid.UUID(pniBytes) - pniServiceID := libsignalgo.NewPNIServiceID(pni) - pniIdentity, err := cli.Store.IdentityKeyStore.GetIdentityKey(ctx, pniServiceID) - if err != nil { - return fmt.Errorf("failed to get identity for PNI %s: %w", pni, err) - } else if pniIdentity == nil { - zerolog.Ctx(ctx).Debug(). - Stringer("aci", sender.UUID). - Stringer("pni", pni). - Msg("Fetching PNI identity for signature verification as it wasn't found in store") - err = cli.FetchAndProcessPreKey(ctx, pniServiceID, 0) - if err != nil { - return fmt.Errorf("failed to fetch prekey for PNI %s after identity wasn't found in store: %w", pni, err) - } else if pniIdentity, err = cli.Store.IdentityKeyStore.GetIdentityKey(ctx, pniServiceID); err != nil { - return fmt.Errorf("failed to get identity for PNI %s after fetching: %w", pni, err) - } else if pniIdentity == nil { - return fmt.Errorf("identity not found for PNI %s even after fetching", pni) - } - } - aciIdentity, err := cli.Store.IdentityKeyStore.GetIdentityKey(ctx, sender) - if err != nil { - return fmt.Errorf("failed to get identity for ACI %s: %w", sender, err) - } else if aciIdentity == nil { - return fmt.Errorf("identity not found for ACI %s", sender) - } - if ok, err := pniIdentity.VerifyAlternateIdentity(aciIdentity, msg.GetSignature()); err != nil { - return fmt.Errorf("signature validation failed: %w", err) - } else if !ok { - return fmt.Errorf("signature is invalid") - } - zerolog.Ctx(ctx).Debug(). - Stringer("aci", sender.UUID). - Stringer("pni", pni). - Msg("Verified ACI-PNI mapping") - _, err = cli.Store.RecipientStore.LoadAndUpdateRecipient(ctx, sender.UUID, pni, nil) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to update aci/pni mapping in store") - } - cli.handleEvent(&events.ACIFound{ACI: sender, PNI: pniServiceID}) - 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, messageSender, chatRecipient uuid.UUID) bool { // If it's a group message, get the ID and invalidate cache if necessary var groupID types.GroupIdentifier var groupRevision uint32 @@ -937,39 +781,29 @@ 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{ + cli.handleEvent(&events.ChatEvent{ Info: events.MessageInfo{ - Sender: messageSenderACI, - ChatID: groupOrUserID(groupID, chatRecipient), - GroupRevision: groupRevision, - ServerTimestamp: serverTimestamp, + Sender: messageSender, + ChatID: groupOrUserID(groupID, chatRecipient), + GroupRevision: groupRevision, }, Event: editMessage, - }), true + }) + return 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, messageSender, chatRecipient uuid.UUID) 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) + err := cli.Store.ProfileKeyStore.StoreProfileKey(ctx, messageSender, profileKey) if err != nil { zerolog.Ctx(ctx).Err(err).Msg("StoreProfileKey error") - return + return false } } @@ -984,44 +818,159 @@ 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{ - Sender: messageSenderACI, - ChatID: groupOrUserID(groupID, chatRecipient), - GroupRevision: groupRevision, - ServerTimestamp: serverTimestamp, + Sender: messageSender, + ChatID: groupOrUserID(groupID, chatRecipient), + GroupRevision: groupRevision, } // Hacky special case for group calls to cache the state if dataMessage.GroupCallUpdate != nil { - isRinging := cli.GroupCache.UpdateActiveCall(groupID, dataMessage.GroupCallUpdate.GetEraId()) - return cli.handleEvent(&events.Call{ + isRinging := cli.UpdateActiveCalls(groupID, *dataMessage.GroupCallUpdate.EraId) + cli.handleEvent(&events.Call{ Info: evtInfo, Timestamp: dataMessage.GetTimestamp(), IsRinging: isRinging, - }), true + }) } else { - return cli.handleEvent(&events.ChatEvent{ + cli.handleEvent(&events.ChatEvent{ Info: evtInfo, Event: dataMessage, - }), true + }) } + + return true } func (cli *Client) sendDeliveryReceipts(ctx context.Context, deliveredTimestamps []uint64, senderUUID uuid.UUID) error { // Send delivery receipts if len(deliveredTimestamps) > 0 { receipt := DeliveredReceiptMessageForTimestamps(deliveredTimestamps) - result := cli.SendMessage(ctx, libsignalgo.NewACIServiceID(senderUUID), receipt) + result := cli.SendMessage(ctx, senderUUID, receipt) if !result.WasSuccessful { return fmt.Errorf("failed to send delivery receipts: %v", result) } } return nil } + +type DecryptionResult struct { + SenderAddress *libsignalgo.Address + Content *signalpb.Content + SealedSender bool +} + +const prodServerTrustRootStr = "BXu6QIKVz5MA8gstzfOgRQGqyLqOwNKHL6INkv3IHWMF" + +var prodServerTrustRootBytes = exerrors.Must(base64.StdEncoding.DecodeString(prodServerTrustRootStr)) +var prodServerTrustRootKey = exerrors.Must(libsignalgo.DeserializePublicKey(prodServerTrustRootBytes)) + +func init() { + // It's never going to be freed anyway + prodServerTrustRootKey.CancelFinalizer() +} + +func (cli *Client) sealedSenderDecrypt(ctx context.Context, envelope *signalpb.Envelope) (*DecryptionResult, error) { + localAddress := libsignalgo.NewSealedSenderAddress( + cli.Store.Number, + cli.Store.ACI, + uint32(cli.Store.DeviceID), + ) + timestamp := time.Unix(0, int64(*envelope.Timestamp)) + result, err := libsignalgo.SealedSenderDecrypt( + ctx, + envelope.Content, + localAddress, + prodServerTrustRootKey, + timestamp, + cli.Store.SessionStore, + cli.Store.IdentityStore, + cli.Store.PreKeyStore, + cli.Store.SignedPreKeyStore, + ) + if err != nil { + return nil, fmt.Errorf("SealedSenderDecrypt error: %w", err) + } + + msg := result.Message + err = stripPadding(&msg) + if err != nil { + return nil, fmt.Errorf("stripPadding error: %w", err) + } + address, err := libsignalgo.NewUUIDAddress( + result.Sender.UUID, + uint(result.Sender.DeviceID), + ) + if err != nil { + return nil, fmt.Errorf("NewAddress error: %w", err) + } + content := &signalpb.Content{} + err = proto.Unmarshal(msg, content) + if err != nil { + return nil, fmt.Errorf("Unmarshal error: %w", err) + } + DecryptionResult := &DecryptionResult{ + SenderAddress: address, + Content: content, + } + return DecryptionResult, nil +} + +func (cli *Client) prekeyDecrypt(ctx context.Context, sender *libsignalgo.Address, encryptedContent []byte) (*DecryptionResult, error) { + preKeyMessage, err := libsignalgo.DeserializePreKeyMessage(encryptedContent) + if err != nil { + err = fmt.Errorf("DeserializePreKeyMessage error: %v", err) + return nil, err + } + if preKeyMessage == nil { + err = fmt.Errorf("preKeyMessage is nil") + return nil, err + } + + data, err := libsignalgo.DecryptPreKey( + ctx, + preKeyMessage, + sender, + cli.Store.SessionStore, + cli.Store.IdentityStore, + cli.Store.PreKeyStore, + cli.Store.SignedPreKeyStore, + cli.Store.KyberPreKeyStore, + ) + if err != nil { + err = fmt.Errorf("DecryptPreKey error: %v", err) + return nil, err + } + err = stripPadding(&data) + if err != nil { + err = fmt.Errorf("stripPadding error: %v", err) + return nil, err + } + content := &signalpb.Content{} + err = proto.Unmarshal(data, content) + if err != nil { + err = fmt.Errorf("Unmarshal error: %v", err) + return nil, err + } + DecryptionResult := &DecryptionResult{ + SenderAddress: sender, + Content: content, + } + return DecryptionResult, nil +} + +func stripPadding(contents *[]byte) error { + for i := len(*contents) - 1; i >= 0; i-- { + if (*contents)[i] == 0x80 { + *contents = (*contents)[:i] + return nil + } else if (*contents)[i] != 0x00 { + return fmt.Errorf("Invalid ISO7816 padding") + } + } + return fmt.Errorf("Invalid ISO7816 padding, len(contents): %v", len(*contents)) +} diff --git a/pkg/signalmeow/receiving_decrypt.go b/pkg/signalmeow/receiving_decrypt.go deleted file mode 100644 index 7d3c1a3..0000000 --- a/pkg/signalmeow/receiving_decrypt.go +++ /dev/null @@ -1,430 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2023 Scott Weber -// 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" - "crypto/sha256" - "errors" - "fmt" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "google.golang.org/protobuf/proto" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/store" -) - -type DecryptionResult struct { - SenderAddress *libsignalgo.Address - CiphertextHash *[32]byte - Content *signalpb.Content - ContentHint libsignalgo.UnidentifiedSenderMessageContentHint - 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")} - } - - switch *envelope.Type { - case signalpb.Envelope_UNIDENTIFIED_SENDER: - result, err := cli.decryptUnidentifiedSenderEnvelope(ctx, destinationServiceID, envelope) - if err != nil { - result.Err = fmt.Errorf("failed to decrypt unidentified sender envelope: %w", err) - } - return result - - case signalpb.Envelope_PREKEY_MESSAGE, signalpb.Envelope_DOUBLE_RATCHET: - sender, err := sourceServiceID.Address(uint(envelope.GetSourceDeviceId())) - 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 { - result, err = cli.prekeyDecrypt(ctx, destinationServiceID, sender, envelope.Content, envelope.GetServerTimestamp()) - bundleType = "prekey bundle" - } else { - result, err = cli.decryptCiphertextEnvelope(ctx, destinationServiceID, sender, envelope.Content, envelope.GetServerTimestamp()) - 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 *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, - } - - case signalpb.Envelope_SERVER_DELIVERY_RECEIPT: - return DecryptionResult{Err: fmt.Errorf("server delivery receipt envelopes are not yet supported")} - - case signalpb.Envelope_UNKNOWN: - return DecryptionResult{Err: fmt.Errorf("unknown envelope type")} - - default: - return DecryptionResult{Err: fmt.Errorf("unrecognized envelope type %d", envelope.GetType())} - } -} - -var EventAlreadyProcessed = errors.New("event was already processed") - -func (cli *Client) bufferedDecryptTxn(ctx context.Context, ciphertext []byte, serverTimestamp uint64, decrypt func(context.Context) ([]byte, error)) (plaintext []byte, ciphertextHash [32]byte, err error) { - ciphertextHash = sha256.Sum256(ciphertext) - - var buf *store.BufferedEvent - buf, err = cli.Store.EventBuffer.GetBufferedEvent(ctx, ciphertextHash) - if err != nil { - err = fmt.Errorf("failed to get buffered event: %w", err) - return - } else if buf != nil { - plaintext = buf.Plaintext - insertTime := time.UnixMilli(buf.InsertTimestamp) - if plaintext == nil { - zerolog.Ctx(ctx).Debug(). - Hex("ciphertext_hash", ciphertextHash[:]). - Time("insertion_time", insertTime). - Msg("Returning event already processed error") - err = fmt.Errorf("%w at %s", EventAlreadyProcessed, insertTime.String()) - } else { - zerolog.Ctx(ctx).Debug(). - Hex("ciphertext_hash", ciphertextHash[:]). - Time("insertion_time", insertTime). - Msg("Returning previously decrypted plaintext") - } - return - } - - err = cli.Store.DoDecryptionTxn(ctx, func(ctx context.Context) (innerErr error) { - plaintext, innerErr = decrypt(ctx) - if innerErr != nil { - return - } - innerErr = cli.Store.EventBuffer.PutBufferedEvent(ctx, ciphertextHash, plaintext, serverTimestamp) - if innerErr != nil { - innerErr = fmt.Errorf("failed to save decrypted event to buffer: %w", innerErr) - } - zerolog.Ctx(ctx).Trace(). - Hex("ciphertext_hash", ciphertextHash[:]). - Msg("Successfully decrypted and saved event") - return - }) - return -} - -func (cli *Client) prekeyDecrypt( - ctx context.Context, - destination libsignalgo.ServiceID, - sender *libsignalgo.Address, - encryptedContent []byte, - serverTimestamp uint64, -) (*DecryptionResult, error) { - preKeyMessage, err := libsignalgo.DeserializePreKeyMessage(encryptedContent) - if err != nil { - return nil, fmt.Errorf("failed to deserialize prekey message: %w", err) - } else if preKeyMessage == nil { - return nil, fmt.Errorf("deserializing prekey message returned nil") - } - pks := cli.Store.PreKeyStore(destination) - if pks == nil { - return nil, fmt.Errorf("no prekey store found for %s", destination) - } - ss := cli.Store.SessionStore(destination) - if ss == nil { - return nil, fmt.Errorf("no session store found for %s", destination) - } - is := cli.Store.IdentityStore(destination) - 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, - pks, - pks, - ) - }) - if err != nil { - return nil, fmt.Errorf("failed to decrypt prekey message: %w", err) - } - plaintext, err = stripPadding(plaintext) - if err != nil { - return nil, fmt.Errorf("failed to strip padding: %w", err) - } - content := &signalpb.Content{} - err = proto.Unmarshal(plaintext, content) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal decrypted prekey message: %w", err) - } - return &DecryptionResult{ - SenderAddress: sender, - Content: content, - CiphertextHash: &ciphertextHash, - }, nil -} - -func (cli *Client) decryptCiphertextEnvelope( - ctx context.Context, - destinationServiceID libsignalgo.ServiceID, - senderAddress *libsignalgo.Address, - ciphertext []byte, - serverTimestamp uint64, -) (*DecryptionResult, error) { - log := zerolog.Ctx(ctx) - message, err := libsignalgo.DeserializeMessage(ciphertext) - if err != nil { - log.Err(err).Msg("Failed to deserialize ciphertext message") - return nil, fmt.Errorf("failed to deserialize message: %w", err) - } - sessionStore := cli.Store.SessionStore(destinationServiceID) - if sessionStore == nil { - return nil, fmt.Errorf("no session store for destination service ID %s", destinationServiceID) - } - identityStore := cli.Store.IdentityStore(destinationServiceID) - 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, - ) - }) - if err != nil { - return nil, fmt.Errorf("failed to decrypt ciphertext message: %w", err) - } - plaintext, err = stripPadding(plaintext) - if err != nil { - return nil, fmt.Errorf("failed to strip padding: %w", err) - } - content := signalpb.Content{} - err = proto.Unmarshal(plaintext, &content) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal decrypted message: %w", err) - } - return &DecryptionResult{ - SenderAddress: senderAddress, - Content: &content, - CiphertextHash: &ciphertextHash, - }, nil -} - -func (cli *Client) decryptSenderKeyMessage( - ctx context.Context, - senderAddress *libsignalgo.Address, - ciphertext []byte, - serverTimestamp uint64, -) (*DecryptionResult, error) { - plaintext, ciphertextHash, err := cli.bufferedDecryptTxn(ctx, ciphertext, serverTimestamp, func(ctx context.Context) ([]byte, error) { - return libsignalgo.GroupDecrypt( - ctx, - ciphertext, - senderAddress, - cli.Store.SenderKeyStore, - ) - }) - if err != nil { - return nil, fmt.Errorf("failed to decrypt sender key message: %w", err) - } - plaintext, err = stripPadding(plaintext) - if err != nil { - return nil, fmt.Errorf("failed to strip padding: %w", err) - } - content := signalpb.Content{} - err = proto.Unmarshal(plaintext, &content) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal decrypted sender key message: %w", err) - } - return &DecryptionResult{ - SenderAddress: senderAddress, - Content: &content, - CiphertextHash: &ciphertextHash, - }, nil -} - -func (cli *Client) decryptUnidentifiedSenderEnvelope(ctx context.Context, destinationServiceID libsignalgo.ServiceID, envelope *signalpb.Envelope) (result DecryptionResult, err error) { - log := zerolog.Ctx(ctx) - - if destinationServiceID != cli.Store.ACIServiceID() { - log.Warn().Stringer("destination_service_id", destinationServiceID). - Msg("Received UNIDENTIFIED_SENDER envelope for non-ACI destination") - return result, fmt.Errorf("received unidentified sender envelope for non-ACI destination") - } - usmc, err := libsignalgo.SealedSenderDecryptToUSMC( - ctx, - envelope.GetContent(), - cli.Store.ACIIdentityStore, - ) - if err != nil { - return result, fmt.Errorf("failed to decrypt to USMC: %w", err) - } else if usmc == nil { - return result, fmt.Errorf("decrypting to USMC returned nil") - } - - messageType, err := usmc.GetMessageType() - if err != nil { - return result, fmt.Errorf("failed to get message type: %w", err) - } - senderCertificate, err := usmc.GetSenderCertificate() - if err != nil { - return result, fmt.Errorf("failed to get sender certificate: %w", err) - } - contentHint, err := usmc.GetContentHint() - 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 = contentHint - senderUUID, err := senderCertificate.GetSenderUUID() - if err != nil { - return result, fmt.Errorf("failed to get sender UUID: %w", err) - } - senderDeviceID, err := senderCertificate.GetDeviceID() - if err != nil { - return result, fmt.Errorf("failed to get sender device ID: %w", err) - } - senderAddress, err := libsignalgo.NewACIServiceID(senderUUID).Address(uint(senderDeviceID)) - if err != nil { - return result, fmt.Errorf("failed to create sender address: %w", err) - } - result.SenderAddress = senderAddress - senderE164, err := senderCertificate.GetSenderE164() - if err != nil { - return result, fmt.Errorf("failed to get sender E164: %w", err) - } - usmcContents, err := usmc.GetContents() - 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)). - Logger() - log = &newLog - ctx = log.WithContext(ctx) - log.Trace().Msg("Received SealedSender message") - - if senderE164 != "" { - _, err = cli.Store.RecipientStore.UpdateRecipientE164(ctx, senderUUID, uuid.Nil, senderE164) - if err != nil { - log.Warn().Err(err).Msg("Failed to update sender E164 in recipient store") - } - } - - var resultPtr *DecryptionResult - switch messageType { - case libsignalgo.CiphertextMessageTypeSenderKey: - resultPtr, err = cli.decryptSenderKeyMessage(ctx, senderAddress, usmcContents, envelope.GetServerTimestamp()) - case libsignalgo.CiphertextMessageTypePreKey: - resultPtr, err = cli.prekeyDecrypt(ctx, destinationServiceID, senderAddress, usmcContents, envelope.GetServerTimestamp()) - 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 - default: - return result, fmt.Errorf("unsupported sealed sender message type %d", messageType) - } - if err != nil { - result.Retriable = result.ContentHint == libsignalgo.UnidentifiedSenderMessageContentHintResendable - return result, err - } - resultPtr.GroupID = result.GroupID - return *resultPtr, nil -} - -func stripPadding(contents []byte) ([]byte, error) { - for i := len(contents) - 1; i >= 0; i-- { - if contents[i] == 0x80 { - contents = contents[:i] - return contents, nil - } else if contents[i] != 0x00 { - return nil, fmt.Errorf("invalid ISO7816 padding") - } - } - return nil, fmt.Errorf("invalid ISO7816 padding (length %d)", len(contents)) -} diff --git a/pkg/signalmeow/retry.go b/pkg/signalmeow/retry.go deleted file mode 100644 index 0faf04a..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" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "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 6e2c2da..0000000 --- a/pkg/signalmeow/senderkey.go +++ /dev/null @@ -1,439 +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" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "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 { - if errors.Is(err, libsignalgo.ErrorCodeSessionNotFound) { - log.Warn().Err(err).Msg("Got session not found error for group send from libsignal, resetting session and retrying") - if err = cli.Store.SenderKeyStore.DeleteSenderKeyInfo(ctx, groupIDStr); err != nil { - return nil, fmt.Errorf("failed to delete sender key info: %w", err) - } - doUnlock() - return cli.sendToGroupWithSenderKey(ctx, groupID, allRecipients, sec, content, messageTimestamp, retries+1) - } - 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 8852197..33cd93f 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" @@ -31,41 +30,26 @@ import ( "github.com/google/uuid" "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" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/types" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) // Sending -func (cli *Client) senderCertificate(ctx context.Context, e164 bool) (*libsignalgo.SenderCertificate, error) { - cli.senderCertificateCache.Lock() - defer cli.senderCertificateCache.Unlock() - cached := cli.senderCertificateNoE164 - if e164 { - cached = cli.senderCertificateWithE164 - } - setCache := func(val *libsignalgo.SenderCertificate) { - if e164 { - cli.senderCertificateWithE164 = val - } else { - cli.senderCertificateNoE164 = val - } - } - if cached != nil { - expiry, err := cached.GetExpiration() +func (cli *Client) senderCertificate(ctx context.Context) (*libsignalgo.SenderCertificate, error) { + if cli.SenderCertificate != nil { + expiry, err := cli.SenderCertificate.GetExpiration() if err != nil { zerolog.Ctx(ctx).Err(err).Msg("Failed to check sender certificate expiry") } else if time.Until(expiry) < 1*exfmt.Day { zerolog.Ctx(ctx).Debug().Msg("Sender certificate expired, fetching new one") - setCache(nil) + cli.SenderCertificate = nil } else { - return cached, nil + return cli.SenderCertificate, nil } } @@ -74,21 +58,19 @@ func (cli *Client) senderCertificate(ctx context.Context, e164 bool) (*libsignal } var r response - var query string - if !e164 { - query = "?includeE164=false" - } - resp, err := cli.AuthedWS.SendRequest(ctx, http.MethodGet, "/v1/certificate/delivery"+query, nil, nil) + username, password := cli.Store.BasicAuthCreds() + opts := &web.HTTPReqOpt{Username: &username, Password: &password} + resp, err := web.SendHTTPRequest(ctx, http.MethodGet, "/v1/certificate/delivery", 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 } cert, err := libsignalgo.DeserializeSenderCertificate(r.Certificate) - setCache(cert) + cli.SenderCertificate = cert return cert, err } @@ -100,7 +82,7 @@ type MyMessage struct { } type MyMessages struct { - Timestamp uint64 `json:"timestamp"` + Timestamp int64 `json:"timestamp"` Online bool `json:"online"` Urgent bool `json:"urgent"` Messages []MyMessage `json:"messages"` @@ -145,73 +127,106 @@ 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.SessionStoreExtras.AllSessionsForUUID(ctx, cli.Store.ACI) + 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, recipientUUID uuid.UUID, content *signalpb.Content, unauthenticated 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() + + messages := []MyMessage{} + + addresses, sessionRecords, err := cli.Store.SessionStoreExtras.AllSessionsForUUID(ctx, recipientUUID) + if err == nil && (len(addresses) == 0 || len(sessionRecords) == 0) { // No sessions, make one with prekey - err = cli.FetchAndProcessPreKey(ctx, recipient, -1) + err = cli.FetchAndProcessPreKey(ctx, recipientUUID, -1) if err != nil { return nil, err } - sessions, err = cli.Store.ACISessionStore.AllSessionsForServiceID(ctx, recipient) + addresses, sessionRecords, err = cli.Store.SessionStoreExtras.AllSessionsForUUID(ctx, recipientUUID) } + 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 { + 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 recipientUUID == cli.Store.ACI && 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, []byte(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 { + envelopeType, encryptedPayload, err = cli.buildSSMessageToSend(ctx, recipientAddress, paddedMessage) + } 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,230 +236,207 @@ 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, + []byte(paddedMessage), + recipientAddress, + cli.Store.SessionStore, + cli.Store.IdentityStore, + ) + 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 - } - cert, err := cli.senderCertificate(ctx, includeE164) +func (cli *Client) buildSSMessageToSend(ctx context.Context, recipientAddress *libsignalgo.Address, paddedMessage []byte) (envelopeType int, encryptedPayload []byte, err error) { + cert, err := cli.senderCertificate(ctx) if err != nil { return 0, nil, err } - usmc, err := libsignalgo.NewUnidentifiedSenderMessageContent(ciphertextMessage, cert, contentHint, groupID) + encryptedPayload, err = libsignalgo.SealedSenderEncryptPlaintext( + ctx, + []byte(paddedMessage), + recipientAddress, + cert, + cli.Store.SessionStore, + cli.Store.IdentityStore, + ) 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 { - Recipient libsignalgo.ServiceID - RecipientE164 *string - Unidentified bool - DestinationPNIIdentityKey *libsignalgo.IdentityKey + RecipientUUID uuid.UUID + Unidentified bool } type FailedSendResult struct { - Recipient libsignalgo.ServiceID - Error error + RecipientUUID uuid.UUID + Error error } type SendMessageResult struct { WasSuccessful bool - SuccessfulSendResult - FailedSendResult + *SuccessfulSendResult + *FailedSendResult } type GroupMessageSendResult struct { SuccessfullySentTo []SuccessfulSendResult FailedToSendTo []FailedSendResult } -type SendResult interface { - isSendResult() -} - -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.RecipientUUID.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, + }, + }, + } } - 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.RecipientUUID.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, + }, + }, + } } 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, + DestinationServiceId: proto.String(result.RecipientUUID.String()), + Timestamp: dataMessage.Timestamp, + UnidentifiedStatus: []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ + { + DestinationServiceId: proto.String(result.RecipientUUID.String()), + Unidentified: &result.Unidentified, + }, + }, }, }, - }) + } } 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, + DestinationServiceId: proto.String(result.RecipientUUID.String()), + Timestamp: editMessage.DataMessage.Timestamp, + UnidentifiedStatus: []*signalpb.SyncMessage_Sent_UnidentifiedDeliveryStatus{ + { + DestinationServiceId: proto.String(result.RecipientUUID.String()), + Unidentified: &result.Unidentified, + }, + }, }, }, - }) + } } -func syncMessageFromReadReceiptMessage(ctx context.Context, receiptMessage *signalpb.ReceiptMessage, messageSender libsignalgo.ServiceID) *signalpb.Content { - if *receiptMessage.Type != signalpb.ReceiptMessage_READ || messageSender.Type != libsignalgo.ServiceIDTypeACI { +func syncMessageForContactRequest() *signalpb.Content { + return &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ + Request: &signalpb.SyncMessage_Request{ + Type: signalpb.SyncMessage_Request_CONTACTS.Enum(), + }, + }, + } +} + +func syncMessageFromReadReceiptMessage(ctx context.Context, receiptMessage *signalpb.ReceiptMessage, messageSender uuid.UUID) *signalpb.Content { + 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 } read := []*signalpb.SyncMessage_Read{} for _, timestamp := range receiptMessage.Timestamp { read = append(read, &signalpb.SyncMessage_Read{ Timestamp: proto.Uint64(timestamp), - SenderAci: proto.String(messageSender.UUID.String()), + SenderAci: proto.String(messageSender.String()), }) } - return WrapSyncMessage(&signalpb.SyncMessage{ - Read: read, - }) + return &signalpb.Content{ + SyncMessage: &signalpb.SyncMessage{ + Read: read, + }, + } } func (cli *Client) SendContactSyncRequest(ctx context.Context) error { + if cli.LastContactRequestTime == nil { + cli.LastContactRequestTime = new(int64) + } + currentUnixTime := time.Now().Unix() log := zerolog.Ctx(ctx).With(). Str("action", "send contact sync request"). - Time("last_request_time", cli.LastContactRequestTime). + Int64("current_unix_time", currentUnixTime). + Int64("last_request_time", *cli.LastContactRequestTime). + Int64("seconds_since_last_request", currentUnixTime-*cli.LastContactRequestTime). Logger() ctx = log.WithContext(ctx) // If we've requested in the last minute, don't request again - if time.Since(cli.LastContactRequestTime) < 60*time.Second { + if cli.LastContactRequestTime != nil && currentUnixTime-*cli.LastContactRequestTime < 60 { log.Warn().Msg("Not sending contact sync request because we already requested it in the past minute") return nil } - cli.LastContactRequestTime = time.Now() - _, err := cli.sendContent(ctx, cli.Store.ACIServiceID(), uint64(time.Now().UnixMilli()), WrapSyncMessage(&signalpb.SyncMessage{ - Content: &signalpb.SyncMessage_Request_{ - Request: &signalpb.SyncMessage_Request{ - Type: signalpb.SyncMessage_Request_CONTACTS.Enum(), - }, - }, - }), 0, false, nil, nil) + groupRequest := syncMessageForContactRequest() + _, err := cli.sendContent(ctx, cli.Store.ACI, uint64(currentUnixTime), groupRequest, 0, true) if err != nil { log.Err(err).Msg("Failed to send contact sync request message to myself") return err } - return nil -} - -func (cli *Client) SendStorageMasterKeyRequest(ctx context.Context) error { - log := zerolog.Ctx(ctx).With(). - Str("action", "send key sync request"). - Logger() - ctx = log.WithContext(ctx) - - _, err := cli.sendContent(ctx, cli.Store.ACIServiceID(), uint64(time.Now().UnixMilli()), WrapSyncMessage(&signalpb.SyncMessage{ - Content: &signalpb.SyncMessage_Request_{ - Request: &signalpb.SyncMessage_Request{ - Type: signalpb.SyncMessage_Request_KEYS.Enum(), - }, - }, - }), 0, false, nil, nil) - if err != nil { - log.Err(err).Msg("Failed to send key sync request message to myself") - return err - } else { - log.Info().Msg("Sent key sync request to self") - } + cli.LastContactRequestTime = ¤tUnixTime return nil } @@ -458,99 +450,66 @@ 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 DataMessageForReaction(reaction string, targetMessageSender uuid.UUID, targetMessageTimestamp uint64, removing bool) *signalpb.Content { + timestamp := currentMessageTimestamp() + dm := &signalpb.DataMessage{ + Timestamp: ×tamp, + RequiredProtocolVersion: proto.Uint32(uint32(signalpb.DataMessage_REACTIONS)), + Reaction: &signalpb.DataMessage_Reaction{ + Emoji: proto.String(reaction), + Remove: proto.Bool(removing), + TargetAuthorAci: proto.String(targetMessageSender.String()), + TargetSentTimestamp: proto.Uint64(targetMessageTimestamp), }, } + return wrapDataMessageInContent(dm) } -func WrapDataMessage(dm *signalpb.DataMessage) *signalpb.Content { - return &signalpb.Content{ - Content: &signalpb.Content_DataMessage{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) +func DataMessageForDelete(targetMessageTimestamp uint64) *signalpb.Content { timestamp := currentMessageTimestamp() dm := &signalpb.DataMessage{ Timestamp: ×tamp, - GroupV2: groupContext, + Delete: &signalpb.DataMessage_Delete{ + TargetSentTimestamp: proto.Uint64(targetMessageTimestamp), + }, } - content := WrapDataMessage(dm) - var recipients []libsignalgo.ServiceID - for _, member := range group.Members { - serviceID := member.UserServiceID() - recipients = append(recipients, serviceID) - cli.addSendCache(serviceID, group.GroupIdentifier, timestamp, content) - } - for _, member := range group.PendingMembers { - recipients = append(recipients, member.ServiceID) - cli.addSendCache(member.ServiceID, group.GroupIdentifier, timestamp, content) - } - if groupChange != nil { - for _, member := range groupChange.AddPendingMembers { - recipients = append(recipients, member.ServiceID) - cli.addSendCache(member.ServiceID, group.GroupIdentifier, timestamp, content) - } - for _, member := range groupChange.AddMembers { - serviceID := member.UserServiceID() - recipients = append(recipients, serviceID) - cli.addSendCache(serviceID, group.GroupIdentifier, timestamp, content) - } - } - return cli.sendToGroup(ctx, recipients, content, timestamp, nil, &gidBytes) + return wrapDataMessageInContent(dm) } -const enableSenderKeySend = true +func wrapDataMessageInContent(dm *signalpb.DataMessage) *signalpb.Content { + return &signalpb.Content{ + DataMessage: dm, + } +} func (cli *Client) SendGroupMessage(ctx context.Context, gid types.GroupIdentifier, content *signalpb.Content) (*GroupMessageSendResult, error) { log := zerolog.Ctx(ctx).With(). @@ -558,82 +517,61 @@ func (cli *Client) SendGroupMessage(ctx context.Context, gid types.GroupIdentifi 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 - for _, member := range group.Members { - recipients = append(recipients, member.UserServiceID()) - } - 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) -} -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{}, - } + // Send to each member of the group + result := &GroupMessageSendResult{ + SuccessfullySentTo: []SuccessfulSendResult{}, + FailedToSendTo: []FailedSendResult{}, } - if content.GetTypingMessage() != nil { - // Never send typing messages via fallback path - return result, nil - } - for _, recipient := range recipients { - if recipient.Type == libsignalgo.ServiceIDTypeACI && recipient.UUID == cli.Store.ACI { + for _, member := range group.Members { + if member.UserID == cli.Store.ACI { // Don't send normal DataMessages to ourselves continue } - log := zerolog.Ctx(ctx).With().Stringer("member", recipient).Logger() + log := log.With().Stringer("member", member.UserID).Logger() ctx := log.WithContext(ctx) - sentUnidentified, err := cli.sendContent(ctx, recipient, messageTimestamp, content, 0, true, groupID, nil) + sentUnidentified, err := cli.sendContent(ctx, member.UserID, messageTimestamp, content, 0, true) if err != nil { result.FailedToSendTo = append(result.FailedToSendTo, FailedSendResult{ - Recipient: recipient, - Error: err, + RecipientUUID: member.UserID, + Error: err, }) log.Err(err).Msg("Failed to send to user") } else { result.SuccessfullySentTo = append(result.SuccessfullySentTo, SuccessfulSendResult{ - Recipient: recipient, - Unidentified: sentUnidentified, + RecipientUUID: member.UserID, + 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.ACI, messageTimestamp, syncContent, 0, true) + if selfSendErr != nil { + log.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,175 +584,73 @@ 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.RecipientUUID) } - } -} - -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.ACI, messageTS, syncContent, 0, true) + if selfSendErr != nil { + zerolog.Ctx(ctx).Err(selfSendErr).Msg("Failed to send sync message to myself") + } else { + return true + } } } return false } -func (cli *Client) SendMessage(ctx context.Context, recipientID libsignalgo.ServiceID, content *signalpb.Content) SendMessageResult { +func (cli *Client) SendMessage(ctx context.Context, recipientID uuid.UUID, 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: + if content.GetDataMessage() != nil { + messageTimestamp = *content.DataMessage.Timestamp + } else if content.GetEditMessage().GetDataMessage() != nil { + messageTimestamp = *content.EditMessage.DataMessage.Timestamp + } else { messageTimestamp = currentMessageTimestamp() - case *signalpb.Content_StoryMessage: - // not yet supported - default: - if content.SenderKeyDistributionMessage == nil && content.PniSignatureMessage == nil { - panic(fmt.Errorf("unsupported payload in SendMessage")) - } - messageTimestamp = currentMessageTimestamp() - } - 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 - 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 { - zerolog.Ctx(ctx).Debug(). - Stringer("recipient", recipientID). - Msg("Including PNI identity in message") - sig, err := cli.Store.PNIIdentityKeyPair.SignAlternateIdentity(cli.Store.ACIIdentityKeyPair.GetIdentityKey()) - if err != nil { - return false, err - } - recipientData.NeedsPNISignature = false - content.PniSignatureMessage = &signalpb.PniSignatureMessage{ - Pni: cli.Store.PNI[:], - Signature: sig, - } - return true, nil - } else if needsPNISignature && content.PniSignatureMessage != nil { - recipientData.NeedsPNISignature = false - return true, nil - } - return false, nil - }) - if err != nil { - 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 { - 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 { - // Still send sync messages for read receipts - 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() { - zerolog.Ctx(ctx).Debug().Msg("Not sending typing message as typing indicators are disabled") - res := SuccessfulSendResult{Recipient: recipientID} - return SendMessageResult{WasSuccessful: true, SuccessfulSendResult: res} - } else if content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_READ && cli.Store.DeviceData.AccountRecord != nil && !cli.Store.DeviceData.AccountRecord.GetReadReceipts() { - zerolog.Ctx(ctx).Debug().Msg("Not sending receipt message as read receipts are disabled") - res := SuccessfulSendResult{Recipient: recipientID} - // Still send sync messages for read receipts - cli.sendSyncCopy(ctx, content, messageTimestamp, &res) - return SendMessageResult{WasSuccessful: true, SuccessfulSendResult: res} } - isDeliveryReceipt := content.GetReceiptMessage() != nil && content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_DELIVERY - if recipientID == cli.Store.ACIServiceID() && !isDeliveryReceipt { - res := SuccessfulSendResult{ - Recipient: recipientID, - Unidentified: false, + isDeliveryReceipt := content.ReceiptMessage != nil && content.GetReceiptMessage().GetType() == signalpb.ReceiptMessage_DELIVERY + if recipientID == cli.Store.ACI && !isDeliveryReceipt { + res := &SuccessfulSendResult{ + RecipientUUID: recipientID, + Unidentified: false, } - ok := cli.sendSyncCopy(ctx, content, messageTimestamp, &res) + ok := cli.sendSyncCopy(ctx, content, messageTimestamp, res) return SendMessageResult{ WasSuccessful: ok, SuccessfulSendResult: res, } } - 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) if err != nil { return SendMessageResult{ WasSuccessful: false, - FailedSendResult: FailedSendResult{ - Recipient: recipientID, - Error: err, + FailedSendResult: &FailedSendResult{ + RecipientUUID: recipientID, + Error: err, }, } } result := SendMessageResult{ WasSuccessful: true, - SuccessfulSendResult: SuccessfulSendResult{ - Recipient: recipientID, - Unidentified: sentUnidentified, + SuccessfulSendResult: &SuccessfulSendResult{ + RecipientUUID: recipientID, + Unidentified: sentUnidentified, }, } - if recipientID.Type == libsignalgo.ServiceIDTypePNI { - result.DestinationPNIIdentityKey, err = cli.Store.IdentityKeyStore.GetIdentityKey(ctx, recipientID) - if err != nil { - zerolog.Ctx(ctx).Err(err).Msg("Failed to add PNI destination identity key to sync message") - } - if recipientData != nil && recipientData.E164 != "" { - result.RecipientE164 = &recipientData.E164 - } else { - zerolog.Ctx(ctx).Warn().Msg("No E164 number found for PNI sync message") - } - } - cli.sendSyncCopy(ctx, content, messageTimestamp, &result.SuccessfulSendResult) + cli.sendSyncCopy(ctx, content, messageTimestamp, result.SuccessfulSendResult) return result } @@ -823,87 +659,45 @@ func currentMessageTimestamp() uint64 { return uint64(time.Now().UnixMilli()) } -func isSyncMessageUrgent(content *signalpb.SyncMessage) bool { - switch content.Content.(type) { - case *signalpb.SyncMessage_Request_, - *signalpb.SyncMessage_Sent_: - return true - default: - return false - } -} - -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 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: - return libsignalgo.UnidentifiedSenderMessageContentHintImplicit - default: - return libsignalgo.UnidentifiedSenderMessageContentHintDefault - } -} - func (cli *Client) sendContent( ctx context.Context, - recipient libsignalgo.ServiceID, + recipientUUID uuid.UUID, messageTimestamp uint64, content *signalpb.Content, retryCount int, useUnidentifiedSender bool, - groupID *libsignalgo.GroupIdentifier, - ctmOverride *libsignalgo.CiphertextMessage, ) (sentUnidentified bool, err error) { log := zerolog.Ctx(ctx).With(). Str("action", "send content"). - Stringer("recipient", recipient). + Stringer("recipient", recipientUUID). Uint64("timestamp", messageTimestamp). Logger() ctx = log.WithContext(ctx) + printContentFieldString(ctx, content, "Outgoing message") + log.Trace().Any("raw_content", content).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") } - if recipient.Type == libsignalgo.ServiceIDTypePNI && recipient.UUID == cli.Store.PNI { - return false, fmt.Errorf("can't send to own PNI") - } else if recipient.Type == libsignalgo.ServiceIDTypeACI && recipient.UUID == cli.Store.ACI { - // Don't use unauthed websocket to send a payload to my own other devices - useUnidentifiedSender = false - } else if recipient.Type == libsignalgo.ServiceIDTypePNI { - // Can't use unidentified sender for PNIs because only ACIs have profile keys + // Don't use unauthed websocket to send a payload to my own other devices + if recipientUUID == cli.Store.ACI { useUnidentifiedSender = false } var accessKey *libsignalgo.AccessKey if useUnidentifiedSender { - profileKey, err := cli.ProfileKeyForSignalID(ctx, recipient.UUID) + profileKey, err := cli.ProfileKeyForSignalID(ctx, recipientUUID) if err != nil { return false, fmt.Errorf("failed to get profile key: %w", err) } else if profileKey == nil { @@ -914,43 +708,36 @@ 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, recipientUUID, content, useUnidentifiedSender) if err != nil { log.Err(err).Msg("Error building messages to send") return false, err } outgoingMessages := MyMessages{ - Timestamp: messageTimestamp, + Timestamp: int64(messageTimestamp), Online: false, - Urgent: isUrgent(content), + Urgent: true, Messages: messages, } jsonBytes, err := json.Marshal(outgoingMessages) if err != nil { return false, err } - path := fmt.Sprintf("/v1/messages/%s", recipient) + path := fmt.Sprintf("/v1/messages/%v", recipientUUID) + 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 { @@ -960,6 +747,7 @@ func (cli *Client) sendContent( Uint64("response_id", *response.Id). Uint32("response_status", *response.Status). Logger() + ctx = log.WithContext(ctx) if json.Valid(response.GetBody()) { log.Debug().RawJSON("response_body", response.GetBody()).Msg("DEBUG: message send response data") } else { @@ -979,44 +767,31 @@ 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, recipientUUID, response) + } else if *response.Status == 410 { + err = cli.handle410(ctx, recipientUUID, response) } else if *response.Status == 428 { - err = cli.handle428(ctx, recipient, response) + err = cli.handle428(ctx, recipientUUID, response) } if err != nil { 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, recipientUUID, messageTimestamp, content, retryCount+1, sentUnidentified) 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, recipientUUID, messageTimestamp, content, retryCount+1, false) 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) } @@ -1024,94 +799,94 @@ 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, recipientUUID uuid.UUID, 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, recipientUUID, int(missingDevice.(float64))) if err != nil { - return fmt.Errorf("failed to get address for stale device %s:%d: %w", recipient, staleDevice, 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) + return nil } } } - 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 body["extraDevices"] != nil { + extraDevices := body["extraDevices"].([]any) + log.Debug().Any("extra_devices", extraDevices).Msg("extra devices found in 409 response") + for _, extraDevice := range extraDevices { + // Remove extra device from the sessionstore + recipient, err := libsignalgo.NewUUIDAddress( + recipientUUID, + uint(extraDevice.(float64)), + ) if err != nil { - return fmt.Errorf("failed to fetch and process prekey for missing device %s:%d: %w", recipient, missingDevice, err) + log.Err(err).Msg("NewAddress error") + return err + } + err = cli.Store.SessionStoreExtras.RemoveSession(ctx, recipient) + if err != nil { + log.Err(err).Msg("RemoveSession 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) + return err +} + +// A 410 means we have a stale device, so get rid of it +func (cli *Client) handle410(ctx context.Context, recipientUUID uuid.UUID, 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 + } + // 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 { + recipient, err := libsignalgo.NewUUIDAddress( + recipientUUID, + 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) + err = cli.Store.SessionStoreExtras.RemoveSession(ctx, recipient) 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, recipientUUID, int(staleDevice.(float64))) + if err != nil { + return err } } } - return nil + return err } // We got rate limited. // We ~~will~~ could try sending a "pushChallenge" response, but if that doesn't work we just gotta wait. // TODO: explore captcha response -func (cli *Client) handle428(ctx context.Context, recipient libsignalgo.ServiceID, response *signalpb.WebSocketResponseMessage) error { +func (cli *Client) handle428(ctx context.Context, recipientUUID uuid.UUID, response *signalpb.WebSocketResponseMessage) error { log := zerolog.Ctx(ctx) // Decode json body // TODO use an actual struct @@ -1169,5 +944,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 e1364b1..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" - - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "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 df26a8d..9e2e93c 100644 --- a/pkg/signalmeow/storageservice.go +++ b/pkg/signalmeow/storageservice.go @@ -24,145 +24,16 @@ import ( "fmt" "io" "net/http" - "slices" - "strings" - "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" + "golang.org/x/exp/slices" "google.golang.org/protobuf/proto" - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/events" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "go.mau.fi/mautrix-signal/pkg/signalmeow/web" ) -func (cli *Client) SyncStorage(ctx context.Context) { - log := cli.Log.With().Str("action", "sync storage").Logger() - ctx = log.WithContext(ctx) - // TODO only fetch changed entries - update, err := cli.FetchStorage(ctx, cli.Store.MasterKey, 0, nil) - if err != nil { - log.Err(err).Msg("Failed to fetch storage") - return - } - err = cli.Store.DoContactTxn(ctx, func(ctx context.Context) error { - return cli.processStorageInTxn(ctx, update) - }) - if err != nil { - log.Err(err).Msg("Failed to process storage update") - } -} - -func (cli *Client) processStorageInTxn(ctx context.Context, update *StorageUpdate) error { - log := zerolog.Ctx(ctx) - var changedContacts []*types.Recipient - for _, record := range update.NewRecords { - 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) - 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 - } - contact := data.Contact - topLevelChanged := false - recipient, err := cli.Store.RecipientStore.LoadAndUpdateRecipient(ctx, aci, pni, func(recipient *types.Recipient) (changed bool, err error) { - if len(contact.ProfileKey) == libsignalgo.ProfileKeyLength { - newProfileKey := libsignalgo.ProfileKey(contact.ProfileKey) - changed = changed || recipient.Profile.Key != newProfileKey - recipient.Profile.Key = newProfileKey - } - if recipient.Profile.Name == "" && (contact.GivenName != "" || contact.FamilyName != "") { - changed = true - recipient.Profile.Name = strings.TrimSpace(fmt.Sprintf("%s %s", contact.GivenName, contact.FamilyName)) - } - if contact.SystemGivenName != "" || contact.SystemFamilyName != "" { - 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 - } - 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 - }) - if err != nil { - return fmt.Errorf("failed to update contact %s/%s: %w", aci, pni, err) - } - if topLevelChanged { - changedContacts = append(changedContacts, recipient) - } - case *signalpb.StorageRecord_GroupV2: - if len(data.GroupV2.MasterKey) != libsignalgo.GroupMasterKeyLength { - log.Warn().Msg("Invalid group master key length") - continue - } - masterKey := libsignalgo.GroupMasterKey(data.GroupV2.MasterKey) - groupID, err := cli.StoreMasterKey(ctx, masterKeyFromBytes(masterKey)) - if err != nil { - return fmt.Errorf("failed to store group master key for %s: %w", groupID, err) - } - log.Debug().Stringer("group_id", groupID).Msg("Stored group master key from storage service") - case *signalpb.StorageRecord_Account: - log.Trace().Any("account_record", data.Account).Msg("Found account record") - cli.Store.AccountRecord = data.Account - if len(data.Account.ProfileKey) == libsignalgo.ProfileKeyLength { - err := cli.Store.RecipientStore.StoreProfileKey(ctx, cli.Store.ACI, libsignalgo.ProfileKey(data.Account.ProfileKey)) - if err != nil { - return fmt.Errorf("failed to store own profile key: %w", err) - } - } - err := cli.Store.DeviceStore.PutDevice(ctx, &cli.Store.DeviceData) - if err != nil { - return fmt.Errorf("failed to save device after receiving account record: %w", err) - } - log.Debug().Msg("Saved device after receiving account record") - case *signalpb.StorageRecord_GroupV1, *signalpb.StorageRecord_StoryDistributionList: - // irrelevant data - default: - log.Warn().Type("type", data).Str("item_id", record.StorageID).Msg("Unknown storage record type") - } - } - if len(changedContacts) > 0 { - go cli.handleEvent(&events.ContactList{ - Contacts: changedContacts, - IsFromDB: true, - }) - } - return nil -} - type StorageUpdate struct { Version uint64 NewRecords []*DecryptedStorageRecord @@ -191,7 +62,7 @@ func (cli *Client) FetchStorage(ctx context.Context, masterKey []byte, currentVe } delete(newKeys, key) } - newRecords, missingKeys, err := cli.fetchStorageRecords(ctx, storageKey, manifest.GetRecordIkm(), newKeys) + newRecords, missingKeys, err := cli.fetchStorageRecords(ctx, storageKey, newKeys) if err != nil { return nil, err } @@ -223,20 +94,10 @@ func deriveStorageManifestKey(storageKey []byte, version uint64) []byte { return h.Sum(nil) } -const storageServiceItemKeyInfoPrefix = "20240801_SIGNAL_STORAGE_SERVICE_ITEM_" -const storageServiceItemKeyLen = 32 - -func deriveStorageItemKey(storageKey, recordIKM, rawItemID []byte, b64ItemID string) []byte { - if recordIKM == nil { - h := hmac.New(sha256.New, storageKey) - exerrors.Must(fmt.Fprintf(h, "Item_%s", b64ItemID)) - return h.Sum(nil) - } else { - h := hkdf.New(sha256.New, recordIKM, []byte{}, append([]byte(storageServiceItemKeyInfoPrefix), rawItemID...)) - out := make([]byte, storageServiceItemKeyLen) - exerrors.Must(io.ReadFull(h, out)) - return out - } +func deriveStorageItemKey(storageKey []byte, itemID string) []byte { + h := hmac.New(sha256.New, storageKey) + exerrors.Must(fmt.Fprintf(h, "Item_%s", itemID)) + return h.Sum(nil) } // MaxReadStorageRecords is the maximum number of storage records to fetch at once @@ -260,12 +121,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 { @@ -286,12 +147,7 @@ func (cli *Client) fetchStorageManifest(ctx context.Context, storageKey []byte, } } -func (cli *Client) fetchStorageRecords( - ctx context.Context, - storageKey []byte, - recordIKM []byte, - inputRecords map[string]signalpb.ManifestRecord_Identifier_Type, -) ([]*DecryptedStorageRecord, []string, error) { +func (cli *Client) fetchStorageRecords(ctx context.Context, storageKey []byte, inputRecords map[string]signalpb.ManifestRecord_Identifier_Type) ([]*DecryptedStorageRecord, []string, error) { recordKeys := make([][]byte, 0, len(inputRecords)) for key := range inputRecords { decoded, err := base64.StdEncoding.DecodeString(key) @@ -313,44 +169,29 @@ func (cli *Client) fetchStorageRecords( } items = append(items, itemChunk...) } - records := make([]*DecryptedStorageRecord, 0, len(items)) - log := zerolog.Ctx(ctx) + records := make([]*DecryptedStorageRecord, len(items)) for i, encryptedItem := range items { base64Key := base64.StdEncoding.EncodeToString(encryptedItem.GetKey()) - itemType, ok := inputRecords[base64Key] - if !ok { - log.Warn().Int("item_index", i).Str("item_key", base64Key).Msg("Received unexpected storage item") - continue - } - itemKey := deriveStorageItemKey(storageKey, recordIKM, encryptedItem.GetKey(), base64Key) + itemKey := deriveStorageItemKey(storageKey, base64Key) decryptedItemBytes, err := decryptBytes(itemKey, encryptedItem.GetValue()) if err != nil { - log.Warn().Err(err). - Stringer("item_type", itemType). - Int("item_index", i). - Str("item_key", base64Key). - Msg("Failed to decrypt storage item") - continue + return nil, nil, fmt.Errorf("failed to decrypt storage item #%d (%s): %w", i+1, base64Key, err) } var decryptedItem signalpb.StorageRecord err = proto.Unmarshal(decryptedItemBytes, &decryptedItem) if err != nil { - logEvt := log.Warn().Err(err). - Stringer("item_type", itemType). - Int("item_index", i). - Str("item_key", base64Key) - if log.GetLevel() == zerolog.TraceLevel { - logEvt.Str("item_data", base64.StdEncoding.EncodeToString(decryptedItemBytes)) - } - logEvt.Msg("Failed to unmarshal storage item") - continue + return nil, nil, fmt.Errorf("failed to unmarshal decrypted storage item #%d (%s): %w", i+1, base64Key, err) + } + itemType, ok := inputRecords[base64Key] + if !ok { + return nil, nil, fmt.Errorf("received unexpected storage item at index #%d: %s", i+1, base64Key) } delete(inputRecords, base64Key) - records = append(records, &DecryptedStorageRecord{ + records[i] = &DecryptedStorageRecord{ ItemType: itemType, StorageID: base64Key, StorageRecord: &decryptedItem, - }) + } } missingKeys := maps.Keys(inputRecords) return records, missingKeys, nil @@ -366,18 +207,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 deleted file mode 100644 index e99b110..0000000 --- a/pkg/signalmeow/store/backup_store.go +++ /dev/null @@ -1,341 +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 store - -import ( - "context" - "database/sql" - "encoding/base64" - "errors" - "fmt" - "strings" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "go.mau.fi/util/dbutil" - "go.mau.fi/util/ptr" - "google.golang.org/protobuf/proto" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/backuppb" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -type BackupChat struct { - *backuppb.Chat - TotalMessages int - LatestMessageID uint64 -} - -type BackupStore interface { - AddBackupRecipient(ctx context.Context, recipient *backuppb.Recipient) error - AddBackupChat(ctx context.Context, chat *backuppb.Chat) error - AddBackupChatItem(ctx context.Context, item *backuppb.ChatItem) error - RecalculateChatCounts(ctx context.Context) error - ClearBackup(ctx context.Context) error - - GetBackupRecipient(ctx context.Context, recipientID uint64) (*backuppb.Recipient, error) - GetBackupChatByUserID(ctx context.Context, userID libsignalgo.ServiceID) (*BackupChat, error) - GetBackupChatByGroupID(ctx context.Context, groupID types.GroupIdentifier) (*BackupChat, error) - GetBackupChats(ctx context.Context) ([]*BackupChat, error) - GetBackupChatItems(ctx context.Context, chatID uint64, anchor time.Time, forward bool, limit int) ([]*backuppb.ChatItem, error) - DeleteBackupChat(ctx context.Context, chatID uint64) error - DeleteBackupChatItems(ctx context.Context, chatID uint64, minTime time.Time) error -} - -var _ BackupStore = (*sqlStore)(nil) - -const ( - addBackupRecipientQuery = ` - INSERT INTO signalmeow_backup_recipient (account_id, recipient_id, aci_uuid, pni_uuid, group_master_key, data) - VALUES ($1, $2, $3, $4, $5, $6) - ` - addBackupChatQuery = ` - INSERT INTO signalmeow_backup_chat (account_id, chat_id, recipient_id, data) - VALUES ($1, $2, $3, $4) - ` - addBackupChatItemQuery = ` - INSERT INTO signalmeow_backup_message (account_id, chat_id, sender_id, message_id, data) - VALUES ($1, $2, $3, $4, $5) - ON CONFLICT DO NOTHING - ` - - getBackupRecipientQuery = ` - SELECT data FROM signalmeow_backup_recipient WHERE account_id=$1 AND recipient_id=$2 - ` - getBackupChatByACIQuery = ` - SELECT chat.data, chat.latest_message_id, chat.total_message_count FROM signalmeow_backup_recipient rcp - INNER JOIN signalmeow_backup_chat chat ON rcp.account_id=chat.account_id AND rcp.recipient_id=chat.recipient_id - WHERE rcp.account_id=$1 AND rcp.aci_uuid=$2 - ` - getBackupChatByPNIQuery = ` - SELECT chat.data, chat.latest_message_id, chat.total_message_count FROM signalmeow_backup_recipient rcp - INNER JOIN signalmeow_backup_chat chat ON rcp.account_id=chat.account_id AND rcp.recipient_id=chat.recipient_id - WHERE rcp.account_id=$1 AND rcp.pni_uuid=$2 - ` - getBackupChatByGroupIDQuery = ` - SELECT chat.data, chat.latest_message_id, chat.total_message_count FROM signalmeow_groups g - INNER JOIN signalmeow_backup_recipient rcp ON g.account_id=rcp.account_id AND g.master_key=rcp.group_master_key - INNER JOIN signalmeow_backup_chat chat ON rcp.account_id=chat.account_id AND rcp.recipient_id=chat.recipient_id - WHERE g.account_id=$1 AND g.group_identifier=$2 - ` - getAllBackupChatsQuery = ` - SELECT data, latest_message_id, total_message_count - FROM signalmeow_backup_chat - WHERE account_id=$1 - ` - getBackupChatItemsQuery = ` - SELECT data - FROM signalmeow_backup_message - WHERE account_id=$1 AND chat_id=$2 AND message_id > $3 AND message_id < $4 - ORDER BY message_id DESC - LIMIT $5 - ` - deleteBackupChatQuery = ` - DELETE FROM signalmeow_backup_chat WHERE account_id=$1 AND chat_id=$2 - ` - deleteBackupChatItemsQuery = ` - DELETE FROM signalmeow_backup_message WHERE account_id=$1 AND chat_id=$2 AND message_id >= $3 - ` - recalculateChatCountsQuery = ` - UPDATE signalmeow_backup_chat - SET latest_message_id = ( - SELECT message_id - FROM signalmeow_backup_message - WHERE account_id=signalmeow_backup_chat.account_id AND chat_id=signalmeow_backup_chat.chat_id - ORDER BY message_id DESC - LIMIT 1 - ), - total_message_count = ( - SELECT COUNT(*) - FROM signalmeow_backup_message - WHERE account_id=signalmeow_backup_chat.account_id AND chat_id=signalmeow_backup_chat.chat_id - ) - WHERE account_id=$1 - ` -) - -func tryCastUUID(b []byte) uuid.UUID { - if len(b) == 16 { - return uuid.UUID(b) - } - return uuid.Nil -} - -func (s *sqlStore) AddBackupRecipient(ctx context.Context, recipient *backuppb.Recipient) error { - recipientData, err := proto.Marshal(recipient) - if err != nil { - return fmt.Errorf("failed to marshal recipient %d: %w", recipient.Id, err) - } - var aci, pni uuid.UUID - var groupMasterKey types.SerializedGroupMasterKey - switch dest := recipient.Destination.(type) { - case *backuppb.Recipient_Contact: - aci = tryCastUUID(dest.Contact.Aci) - pni = tryCastUUID(dest.Contact.Pni) - // TODO save identity key + trust level - if aci != uuid.Nil || pni != uuid.Nil { - _, err := s.LoadAndUpdateRecipient(ctx, aci, pni, func(recipient *types.Recipient) (changed bool, err error) { - oldRecipient := ptr.Clone(recipient) - if dest.Contact.E164 != nil { - recipient.E164 = fmt.Sprintf("+%d", *dest.Contact.E164) - } - if len(dest.Contact.ProfileKey) == libsignalgo.ProfileKeyLength { - recipient.Profile.Key = libsignalgo.ProfileKey(dest.Contact.ProfileKey) - } - 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 || - oldRecipient.Profile.Key != recipient.Profile.Key || - oldRecipient.Profile.Name != recipient.Profile.Name || - oldRecipient.Blocked != recipient.Blocked - return - }) - if err != nil { - return fmt.Errorf("failed to save info for recipient %d: %w", recipient.Id, err) - } - } else if dest.Contact.GetRegistered() != nil { - zerolog.Ctx(ctx).Warn(). - Uint64("recipient_id", recipient.Id). - 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 { - gid, err := libsignalgo.GroupMasterKey(dest.Group.MasterKey).GroupIdentifier() - if err != nil { - zerolog.Ctx(ctx).Err(err). - Uint64("recipient_id", recipient.Id). - Msg("Failed to get group identifier from master key") - } else if err = s.StoreMasterKey(ctx, types.BytesToGroupIdentifier(gid), groupMasterKey); err != nil { - return fmt.Errorf("failed to save group master key for recipient %d: %w", recipient.Id, err) - } - } else { - zerolog.Ctx(ctx).Warn(). - Uint64("recipient_id", recipient.Id). - Msg("Invalid group master key length") - } - case *backuppb.Recipient_Self: - aci = s.AccountID - default: - } - _, err = s.db.Exec(ctx, addBackupRecipientQuery, s.AccountID, recipient.Id, ptr.NonZero(aci), ptr.NonZero(pni), ptr.NonZero(groupMasterKey), recipientData) - if err != nil { - return fmt.Errorf("failed to add backup recipient %d: %w", recipient.Id, err) - } - return nil -} - -func (s *sqlStore) AddBackupChat(ctx context.Context, chat *backuppb.Chat) error { - chatData, err := proto.Marshal(chat) - if err != nil { - return fmt.Errorf("failed to marshal chat %d: %w", chat.Id, err) - } - _, err = s.db.Exec(ctx, addBackupChatQuery, s.AccountID, chat.Id, chat.RecipientId, chatData) - if err != nil { - return fmt.Errorf("failed to add backup chat %d: %w", chat.Id, err) - } - return nil -} - -func (s *sqlStore) AddBackupChatItem(ctx context.Context, item *backuppb.ChatItem) error { - itemData, err := proto.Marshal(item) - if err != nil { - return fmt.Errorf("failed to marshal chat item %d: %w", item.DateSent, err) - } - _, err = s.db.Exec(ctx, addBackupChatItemQuery, s.AccountID, item.ChatId, item.AuthorId, item.DateSent, itemData) - if err != nil { - return fmt.Errorf("failed to add backup chat item %d: %w", item.DateSent, err) - } - return nil -} - -func (s *sqlStore) ClearBackup(ctx context.Context) error { - _, err := s.db.Exec(ctx, "DELETE FROM signalmeow_backup_message WHERE account_id=$1", s.AccountID) - if err != nil { - return err - } - _, err = s.db.Exec(ctx, "DELETE FROM signalmeow_backup_chat WHERE account_id=$1", s.AccountID) - if err != nil { - return err - } - _, err = s.db.Exec(ctx, "DELETE FROM signalmeow_backup_recipient WHERE account_id=$1", s.AccountID) - return err -} - -func scanProto[T proto.Message](row dbutil.Scannable) (val T, err error) { - var data []byte - err = row.Scan(&data) - if err != nil { - if errors.Is(err, sql.ErrNoRows) { - err = nil - } - return - } - val = val.ProtoReflect().New().Interface().(T) - err = proto.Unmarshal(data, val) - return -} - -func scanChat(row dbutil.Scannable) (*BackupChat, error) { - var data []byte - var latestMessageID, totalMessageCount sql.NullInt64 - err := row.Scan(&data, &latestMessageID, &totalMessageCount) - if err != nil { - if errors.Is(err, sql.ErrNoRows) { - return nil, nil - } - return nil, err - } - var chat backuppb.Chat - err = proto.Unmarshal(data, &chat) - if err != nil { - return nil, err - } - return &BackupChat{ - Chat: &chat, - TotalMessages: int(totalMessageCount.Int64), - LatestMessageID: uint64(latestMessageID.Int64), - }, nil -} - -var chatScanner = dbutil.ConvertRowFn[*BackupChat](scanChat) -var messageScanner = dbutil.ConvertRowFn[*backuppb.ChatItem](scanProto[*backuppb.ChatItem]) - -func (s *sqlStore) GetBackupRecipient(ctx context.Context, recipientID uint64) (*backuppb.Recipient, error) { - return scanProto[*backuppb.Recipient](s.db.QueryRow(ctx, getBackupRecipientQuery, s.AccountID, recipientID)) -} - -func (s *sqlStore) GetBackupChatByUserID(ctx context.Context, userID libsignalgo.ServiceID) (*BackupChat, error) { - query := getBackupChatByACIQuery - if userID.Type == libsignalgo.ServiceIDTypePNI { - query = getBackupChatByPNIQuery - } - return scanChat(s.db.QueryRow(ctx, query, s.AccountID, userID.UUID)) -} - -func (s *sqlStore) GetBackupChatByGroupID(ctx context.Context, groupID types.GroupIdentifier) (*BackupChat, error) { - return scanChat(s.db.QueryRow(ctx, getBackupChatByGroupIDQuery, s.AccountID, groupID)) -} - -func (s *sqlStore) GetBackupChats(ctx context.Context) ([]*BackupChat, error) { - return chatScanner.NewRowIter(s.db.Query(ctx, getAllBackupChatsQuery, s.AccountID)).AsList() -} - -func (s *sqlStore) GetBackupChatItems(ctx context.Context, chatID uint64, anchor time.Time, forward bool, limit int) ([]*backuppb.ChatItem, error) { - var minTS, maxTS int64 - if anchor.IsZero() { - maxTS = time.Now().Add(24 * time.Hour).UnixMilli() - } else if forward { - minTS = anchor.UnixMilli() - maxTS = time.Now().Add(24 * time.Hour).UnixMilli() - } else { - maxTS = anchor.UnixMilli() - } - return messageScanner.NewRowIter(s.db.Query(ctx, getBackupChatItemsQuery, s.AccountID, chatID, minTS, maxTS, limit)).AsList() -} - -func (s *sqlStore) DeleteBackupChatItems(ctx context.Context, chatID uint64, minTime time.Time) error { - anchorTS := minTime.UnixMilli() - if minTime.IsZero() { - anchorTS = 0 - } - _, err := s.db.Exec(ctx, deleteBackupChatItemsQuery, s.AccountID, chatID, anchorTS) - return err -} - -func (s *sqlStore) DeleteBackupChat(ctx context.Context, chatID uint64) error { - _, err := s.db.Exec(ctx, deleteBackupChatQuery, s.AccountID, chatID) - return err -} - -func (s *sqlStore) RecalculateChatCounts(ctx context.Context) error { - _, err := s.db.Exec(ctx, recalculateChatCountsQuery, s.AccountID) - return err -} diff --git a/pkg/signalmeow/store/contact_store.go b/pkg/signalmeow/store/contact_store.go new file mode 100644 index 0000000..2d7247f --- /dev/null +++ b/pkg/signalmeow/store/contact_store.go @@ -0,0 +1,172 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber +// +// 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 store + +import ( + "context" + "database/sql" + "errors" + + "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 ContactStore interface { + LoadContact(ctx context.Context, theirUUID uuid.UUID) (*types.Contact, error) + LoadContactByE164(ctx context.Context, e164 string) (*types.Contact, error) + StoreContact(ctx context.Context, contact types.Contact) error + AllContacts(ctx context.Context) ([]*types.Contact, error) + UpdatePhone(ctx context.Context, theirUUID uuid.UUID, newE164 string) error +} + +var _ ContactStore = (*SQLStore)(nil) + +const ( + getAllContactsQuery = ` + SELECT + aci_uuid, + e164_number, + contact_name, + contact_avatar_hash, + profile_key, + profile_name, + profile_about, + profile_about_emoji, + profile_avatar_path, + profile_avatar_hash + FROM signalmeow_contacts + ` + getAllContactsOfUserQuery = getAllContactsQuery + `WHERE our_aci_uuid = $1` + getContactByUUIDQuery = getAllContactsQuery + `WHERE our_aci_uuid = $1 AND aci_uuid = $2` + getContactByPhoneQuery = getAllContactsQuery + `WHERE our_aci_uuid = $1 AND e164_number = $2` + upsertContactQuery = ` + INSERT INTO signalmeow_contacts ( + our_aci_uuid, + aci_uuid, + e164_number, + contact_name, + contact_avatar_hash, + profile_key, + profile_name, + profile_about, + profile_about_emoji, + profile_avatar_path, + profile_avatar_hash + ) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) + ON CONFLICT (our_aci_uuid, aci_uuid) DO UPDATE SET + e164_number = excluded.e164_number, + contact_name = excluded.contact_name, + contact_avatar_hash = excluded.contact_avatar_hash, + profile_key = excluded.profile_key, + profile_name = excluded.profile_name, + profile_about = excluded.profile_about, + profile_about_emoji = excluded.profile_about_emoji, + profile_avatar_path = excluded.profile_avatar_path, + profile_avatar_hash = excluded.profile_avatar_hash + ` + upsertContactPhoneQuery = ` + INSERT INTO signalmeow_contacts ( + our_aci_uuid, + aci_uuid, + e164_number, + contact_name, + contact_avatar_hash, + profile_key, + profile_name, + profile_about, + profile_about_emoji, + profile_avatar_path, + profile_avatar_hash + ) + VALUES ($1, $2, $3, '', '', NULL, '', '', '', '', '') + ON CONFLICT (our_aci_uuid, aci_uuid) DO UPDATE + SET e164_number = excluded.e164_number + ` +) + +func scanContact(row dbutil.Scannable) (*types.Contact, error) { + var contact types.Contact + var profileKey []byte + err := row.Scan( + &contact.UUID, + &contact.E164, + &contact.ContactName, + &contact.ContactAvatar.Hash, + &profileKey, + &contact.ProfileName, + &contact.ProfileAbout, + &contact.ProfileAboutEmoji, + &contact.ProfileAvatarPath, + &contact.ProfileAvatarHash, + ) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } else if err != nil { + return nil, err + } + if len(profileKey) != 0 { + profileKeyConverted := libsignalgo.ProfileKey(profileKey) + contact.ProfileKey = &profileKeyConverted + } + return &contact, err +} + +func (s *SQLStore) LoadContact(ctx context.Context, theirUUID uuid.UUID) (*types.Contact, error) { + return scanContact(s.db.QueryRow(ctx, getContactByUUIDQuery, s.ACI, theirUUID)) +} + +func (s *SQLStore) LoadContactByE164(ctx context.Context, e164 string) (*types.Contact, error) { + return scanContact(s.db.QueryRow(ctx, getContactByPhoneQuery, s.ACI, e164)) +} + +func (s *SQLStore) AllContacts(ctx context.Context) ([]*types.Contact, error) { + rows, err := s.db.Query(ctx, getAllContactsOfUserQuery, s.ACI) + if err != nil { + return nil, err + } + return dbutil.NewRowIter(rows, scanContact).AsList() +} + +func (s *SQLStore) StoreContact(ctx context.Context, contact types.Contact) error { + _, err := s.db.Exec( + ctx, + upsertContactQuery, + s.ACI, + contact.UUID, + contact.E164, + contact.ContactName, + contact.ContactAvatar.Hash, + contact.ProfileKey.Slice(), + contact.ProfileName, + contact.ProfileAbout, + contact.ProfileAboutEmoji, + contact.ProfileAvatarPath, + contact.ProfileAvatarHash, + ) + return err +} + +func (s *SQLStore) UpdatePhone(ctx context.Context, theirUUID uuid.UUID, newE164 string) error { + _, err := s.db.Exec( + ctx, upsertContactPhoneQuery, s.ACI, theirUUID, newE164, + ) + return err +} diff --git a/pkg/signalmeow/store/container.go b/pkg/signalmeow/store/container.go index d1c670a..a173597 100644 --- a/pkg/signalmeow/store/container.go +++ b/pkg/signalmeow/store/container.go @@ -9,56 +9,49 @@ import ( "github.com/google/uuid" "github.com/rs/zerolog" "go.mau.fi/util/dbutil" - "google.golang.org/protobuf/proto" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" "go.mau.fi/mautrix-signal/pkg/signalmeow/store/upgrades" ) -var _ DeviceStore = (*Container)(nil) +var _ DeviceStore = (*StoreContainer)(nil) type DeviceStore interface { PutDevice(ctx context.Context, dd *DeviceData) error DeviceByACI(ctx context.Context, aci uuid.UUID) (*Device, error) - DeviceByPNI(ctx context.Context, pni uuid.UUID) (*Device, error) } -// Container is a wrapper for a SQL database that can contain multiple signalmeow sessions. -type Container struct { +// StoreContainer is a wrapper for a SQL database that can contain multiple signalmeow sessions. +type StoreContainer struct { db *dbutil.Database } -func NewStore(db *dbutil.Database, log dbutil.DatabaseLogger) *Container { - return &Container{db: db.Child("signalmeow_version", upgrades.Table, log)} +func NewStore(db *dbutil.Database, log dbutil.DatabaseLogger) *StoreContainer { + return &StoreContainer{db: db.Child("signalmeow_version", upgrades.Table, log)} } const getAllDevicesQuery = ` SELECT aci_uuid, aci_identity_key_pair, registration_id, pni_uuid, pni_identity_key_pair, pni_registration_id, - device_id, number, password, master_key, account_record, - account_entropy_pool, ephemeral_backup_key, media_root_backup_key + device_id, number, password FROM signalmeow_device ` const getDeviceQuery = getAllDevicesQuery + " WHERE aci_uuid=$1" -const deviceByPNIQuery = getAllDevicesQuery + "WHERE pni_uuid=$1" -func (c *Container) Upgrade(ctx context.Context) error { +func (c *StoreContainer) Upgrade(ctx context.Context) error { return c.db.Upgrade(ctx) } -func (c *Container) scanDevice(row dbutil.Scannable) (*Device, error) { +func (c *StoreContainer) scanDevice(row dbutil.Scannable) (*Device, error) { var device Device - var accountEntropyPool sql.NullString - var aciIdentityKeyPair, pniIdentityKeyPair, accountRecordBytes, ephemeralBackupKey, mediaRootBackupKey []byte + var aciIdentityKeyPair, pniIdentityKeyPair []byte err := row.Scan( - &device.ACI, &aciIdentityKeyPair, &device.ACIRegistrationID, + &device.ACI, &aciIdentityKeyPair, &device.RegistrationID, &device.PNI, &pniIdentityKeyPair, &device.PNIRegistrationID, - &device.DeviceID, &device.Number, &device.Password, &device.MasterKey, &accountRecordBytes, - &accountEntropyPool, &ephemeralBackupKey, &mediaRootBackupKey, + &device.DeviceID, &device.Number, &device.Password, ) if err != nil { return nil, fmt.Errorf("failed to scan session: %w", err) @@ -72,50 +65,26 @@ func (c *Container) scanDevice(row dbutil.Scannable) (*Device, error) { return nil, fmt.Errorf("failed to deserialize PNI identity key pair: %w", err) } - if len(device.MasterKey) == 0 { - device.MasterKey = nil - } - if len(accountRecordBytes) > 0 { - device.AccountRecord = &signalpb.AccountRecord{} - err = proto.Unmarshal(accountRecordBytes, device.AccountRecord) - if err != nil { - return nil, fmt.Errorf("failed to unmarshal account record: %w", err) - } - } - 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)} - aciStore := &scopedSQLStore{Container: c, AccountID: device.ACI, ServiceID: device.ACIServiceID()} - pniStore := &scopedSQLStore{Container: c, AccountID: device.ACI, ServiceID: device.PNIServiceID()} - device.ACIPreKeyStore = aciStore - device.PNIPreKeyStore = pniStore - device.ACISessionStore = aciStore - device.PNISessionStore = pniStore - device.ACIIdentityStore = &sqlIdentityStore{ - sqlStore: baseStore, - OwnKeyPair: device.ACIIdentityKeyPair, - LocalRegistrationID: uint32(device.ACIRegistrationID), - } - device.PNIIdentityStore = &sqlIdentityStore{ - sqlStore: baseStore, - OwnKeyPair: device.PNIIdentityKeyPair, - LocalRegistrationID: uint32(device.PNIRegistrationID), - } - device.IdentityKeyStore = baseStore - device.SenderKeyStore = baseStore - device.GroupStore = baseStore - device.RecipientStore = baseStore - device.DeviceStore = baseStore - device.BackupStore = baseStore - device.EventBuffer = baseStore - device.sqlStore = baseStore - device.db = c.db + innerStore := newSQLStore(c, device.ACI) + // Assign innerStore to all the interfaces + device.PreKeyStore = innerStore + device.PreKeyStoreExtras = innerStore + device.SignedPreKeyStore = innerStore + device.KyberPreKeyStore = innerStore + device.IdentityStore = innerStore + device.SessionStore = innerStore + device.SessionStoreExtras = innerStore + device.ProfileKeyStore = innerStore + device.SenderKeyStore = innerStore + device.GroupStore = innerStore + device.ContactStore = innerStore + device.DeviceStore = innerStore + return &device, nil } // GetAllDevices finds all the devices in the database. -func (c *Container) GetAllDevices(ctx context.Context) ([]*Device, error) { +func (c *StoreContainer) GetAllDevices(ctx context.Context) ([]*Device, error) { rows, err := c.db.Query(ctx, getAllDevicesQuery) if err != nil { return nil, fmt.Errorf("failed to query sessions: %w", err) @@ -134,7 +103,7 @@ func (c *Container) GetAllDevices(ctx context.Context) ([]*Device, error) { // GetDevice finds the device with the specified ACI UUID in the database. // If the device is not found, nil is returned instead. -func (c *Container) DeviceByACI(ctx context.Context, aci uuid.UUID) (*Device, error) { +func (c *StoreContainer) DeviceByACI(ctx context.Context, aci uuid.UUID) (*Device, error) { sess, err := c.scanDevice(c.db.QueryRow(ctx, getDeviceQuery, aci)) if errors.Is(err, sql.ErrNoRows) { return nil, nil @@ -142,23 +111,14 @@ func (c *Container) DeviceByACI(ctx context.Context, aci uuid.UUID) (*Device, er return sess, err } -func (c *Container) DeviceByPNI(ctx context.Context, pni uuid.UUID) (*Device, error) { - sess, err := c.scanDevice(c.db.QueryRow(ctx, deviceByPNIQuery, pni)) - if errors.Is(err, sql.ErrNoRows) { - return nil, nil - } - return sess, err -} - const ( insertDeviceQuery = ` INSERT INTO signalmeow_device ( aci_uuid, aci_identity_key_pair, registration_id, pni_uuid, pni_identity_key_pair, pni_registration_id, - device_id, number, password, master_key, account_record, - account_entropy_pool, ephemeral_backup_key, media_root_backup_key + device_id, number, password ) - VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) ON CONFLICT (aci_uuid) DO UPDATE SET aci_identity_key_pair=excluded.aci_identity_key_pair, registration_id=excluded.registration_id, @@ -167,12 +127,7 @@ const ( pni_registration_id=excluded.pni_registration_id, device_id=excluded.device_id, number=excluded.number, - password=excluded.password, - master_key=excluded.master_key, - account_record=excluded.account_record, - account_entropy_pool=excluded.account_entropy_pool, - ephemeral_backup_key=excluded.ephemeral_backup_key, - media_root_backup_key=excluded.media_root_backup_key + password=excluded.password ` deleteDeviceQuery = `DELETE FROM signalmeow_device WHERE aci_uuid=$1` ) @@ -181,7 +136,7 @@ const ( var ErrDeviceIDMustBeSet = errors.New("device aci_uuid must be known before accessing database") // PutDevice stores the given device in this database. -func (c *Container) PutDevice(ctx context.Context, device *DeviceData) error { +func (c *StoreContainer) PutDevice(ctx context.Context, device *DeviceData) error { if device.ACI == uuid.Nil { return ErrDeviceIDMustBeSet } @@ -195,19 +150,10 @@ func (c *Container) PutDevice(ctx context.Context, device *DeviceData) error { zerolog.Ctx(ctx).Err(err).Msg("failed to serialize pni identity key pair") return err } - var accountRecordBytes []byte - if device.AccountRecord != nil { - accountRecordBytes, err = proto.Marshal(device.AccountRecord) - if err != nil { - return fmt.Errorf("failed to marshal account record: %w", err) - } - } _, err = c.db.Exec(ctx, insertDeviceQuery, - device.ACI, aciIdentityKeyPair, device.ACIRegistrationID, + device.ACI, aciIdentityKeyPair, device.RegistrationID, device.PNI, pniIdentityKeyPair, device.PNIRegistrationID, - device.DeviceID, device.Number, device.Password, device.MasterKey, - accountRecordBytes, device.AccountEntropyPool, - device.EphemeralBackupKey.Slice(), device.MediaRootBackupKey.Slice(), + device.DeviceID, device.Number, device.Password, ) if err != nil { zerolog.Ctx(ctx).Err(err).Msg("failed to insert device") @@ -216,7 +162,7 @@ func (c *Container) PutDevice(ctx context.Context, device *DeviceData) error { } // DeleteDevice deletes the given device from this database -func (c *Container) DeleteDevice(ctx context.Context, device *DeviceData) error { +func (c *StoreContainer) DeleteDevice(ctx context.Context, device *DeviceData) error { if device.ACI == uuid.Nil { return ErrDeviceIDMustBeSet } diff --git a/pkg/signalmeow/store/device.go b/pkg/signalmeow/store/device.go index 3b6ebe5..16d3c1e 100644 --- a/pkg/signalmeow/store/device.go +++ b/pkg/signalmeow/store/device.go @@ -3,55 +3,37 @@ package store import ( "context" "fmt" - "sync" "github.com/google/uuid" "github.com/rs/zerolog" - "go.mau.fi/util/dbutil" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" ) -type sqlStore struct { - *Container - AccountID uuid.UUID - - contactLock sync.Mutex - - blockCacheLock sync.RWMutex - blockCache map[uuid.UUID]bool +// SQLStore is basically a StoreContainer with an ACI UUID attached to it, +// reperesenting a store for a single user +type SQLStore struct { + *StoreContainer + ACI uuid.UUID } -type scopedSQLStore struct { - *Container - AccountID uuid.UUID - ServiceID libsignalgo.ServiceID +func newSQLStore(container *StoreContainer, aci uuid.UUID) *SQLStore { + return &SQLStore{ + StoreContainer: container, + ACI: aci, + } } type DeviceData struct { ACIIdentityKeyPair *libsignalgo.IdentityKeyPair PNIIdentityKeyPair *libsignalgo.IdentityKeyPair - ACIRegistrationID int + RegistrationID int PNIRegistrationID int ACI uuid.UUID PNI uuid.UUID DeviceID int Number string Password string - MasterKey []byte - AccountRecord *signalpb.AccountRecord - AccountEntropyPool libsignalgo.AccountEntropyPool - EphemeralBackupKey *libsignalgo.BackupKey - MediaRootBackupKey *libsignalgo.BackupKey -} - -func (d *DeviceData) ACIServiceID() libsignalgo.ServiceID { - return libsignalgo.NewACIServiceID(d.ACI) -} - -func (d *DeviceData) PNIServiceID() libsignalgo.ServiceID { - return libsignalgo.NewPNIServiceID(d.PNI) } func (d *DeviceData) BasicAuthCreds() (string, string) { @@ -69,42 +51,20 @@ type Device struct { // (search for "innerStore" further down in this file) // libsignalgo store interfaces - ACIPreKeyStore PreKeyStore - PNIPreKeyStore PreKeyStore - ACISessionStore SessionStore - PNISessionStore SessionStore - ACIIdentityStore libsignalgo.IdentityKeyStore - PNIIdentityStore libsignalgo.IdentityKeyStore - IdentityKeyStore IdentityKeyStore - SenderKeyStore SenderKeyStore + PreKeyStore libsignalgo.PreKeyStore + SignedPreKeyStore libsignalgo.SignedPreKeyStore + KyberPreKeyStore libsignalgo.KyberPreKeyStore + IdentityStore libsignalgo.IdentityKeyStore + SessionStore libsignalgo.SessionStore + SenderKeyStore libsignalgo.SenderKeyStore - GroupStore GroupStore - RecipientStore RecipientStore - DeviceStore DeviceStore - BackupStore BackupStore - EventBuffer EventBuffer - - sqlStore *sqlStore - db *dbutil.Database -} - -type contextKey int64 - -const ( - contextKeyContactLock contextKey = 1 -) - -func (d *Device) DoContactTxn(ctx context.Context, fn func(context.Context) error) error { - d.sqlStore.contactLock.Lock() - defer d.sqlStore.contactLock.Unlock() - ctx = context.WithValue(ctx, dbutil.ContextKeyDoTxnCallerSkip, 1) - ctx = context.WithValue(ctx, contextKeyContactLock, true) - return d.db.DoTxn(ctx, nil, fn) -} - -func (d *Device) DoDecryptionTxn(ctx context.Context, fn func(context.Context) error) error { - ctx = context.WithValue(ctx, dbutil.ContextKeyDoTxnCallerSkip, 2) - return d.db.DoTxn(ctx, nil, fn) + // internal store interfaces + PreKeyStoreExtras PreKeyStoreExtras + SessionStoreExtras SessionStoreExtras + ProfileKeyStore ProfileKeyStore + GroupStore GroupStore + ContactStore ContactStore + DeviceStore DeviceStore } func (d *Device) ClearDeviceKeys(ctx context.Context) error { @@ -113,11 +73,11 @@ func (d *Device) ClearDeviceKeys(ctx context.Context) error { zerolog.Ctx(ctx).Warn().Msg("ClearDeviceKeys called with nil device") return nil } - err := d.ACIPreKeyStore.DeleteAllPreKeys(ctx) + err := d.PreKeyStoreExtras.DeleteAllPreKeys(ctx) if err != nil { return err } - err = d.ACISessionStore.RemoveAllSessions(ctx) + err = d.SessionStoreExtras.RemoveAllSessions(ctx) return err } @@ -132,30 +92,3 @@ func (d *Device) ClearPassword(ctx context.Context) error { d.Password = "" return d.DeviceStore.PutDevice(ctx, &d.DeviceData) } - -func (d *Device) PreKeyStore(serviceID libsignalgo.ServiceID) PreKeyStore { - if serviceID == d.ACIServiceID() { - return d.ACIPreKeyStore - } else if serviceID == d.PNIServiceID() { - return d.PNIPreKeyStore - } - return nil -} - -func (d *Device) SessionStore(serviceID libsignalgo.ServiceID) SessionStore { - if serviceID == d.ACIServiceID() { - return d.ACISessionStore - } else if serviceID == d.PNIServiceID() { - return d.PNISessionStore - } - return nil -} - -func (d *Device) IdentityStore(serviceID libsignalgo.ServiceID) libsignalgo.IdentityKeyStore { - if serviceID == d.ACIServiceID() { - return d.ACIIdentityStore - } else if serviceID == d.PNIServiceID() { - return d.PNIIdentityStore - } - return nil -} diff --git a/pkg/signalmeow/store/event_buffer.go b/pkg/signalmeow/store/event_buffer.go deleted file mode 100644 index 6b8d6cf..0000000 --- a/pkg/signalmeow/store/event_buffer.go +++ /dev/null @@ -1,79 +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 store - -import ( - "context" - "database/sql" - "errors" - "time" -) - -type BufferedEvent struct { - Plaintext []byte - ServerTimestamp uint64 - InsertTimestamp int64 -} - -type EventBuffer interface { - GetBufferedEvent(ctx context.Context, ciphertextHash [32]byte) (*BufferedEvent, error) - PutBufferedEvent(ctx context.Context, ciphertextHash [32]byte, plaintext []byte, serverTimestamp uint64) error - ClearBufferedEventPlaintext(ctx context.Context, ciphertextHash [32]byte) error - DeleteBufferedEventsOlderThan(ctx context.Context, maxTS time.Time) error -} - -var _ EventBuffer = (*sqlStore)(nil) - -const ( - getBufferedEventQuery = ` - SELECT plaintext, server_timestamp, insert_timestamp - FROM signalmeow_event_buffer - WHERE account_id=$1 AND ciphertext_hash=$2 - ` - putBufferedEventQuery = ` - INSERT INTO signalmeow_event_buffer (account_id, ciphertext_hash, plaintext, server_timestamp, insert_timestamp) - VALUES ($1, $2, $3, $4, $5) - ` - clearBufferedEventPlaintextQuery = `UPDATE signalmeow_event_buffer SET plaintext=NULL WHERE account_id=$1 AND ciphertext_hash=$2` - deleteOldBufferedEventsQuery = `DELETE FROM signalmeow_event_buffer WHERE account_id=$1 AND insert_timestamp<$2 AND plaintext IS NULL` -) - -func (s *sqlStore) GetBufferedEvent(ctx context.Context, ciphertextHash [32]byte) (*BufferedEvent, error) { - var evt BufferedEvent - err := s.db.QueryRow(ctx, getBufferedEventQuery, s.AccountID, ciphertextHash[:]).Scan(&evt.Plaintext, &evt.ServerTimestamp, &evt.InsertTimestamp) - if errors.Is(err, sql.ErrNoRows) { - return nil, nil - } else if err != nil { - return nil, err - } - return &evt, nil -} - -func (s *sqlStore) PutBufferedEvent(ctx context.Context, ciphertextHash [32]byte, plaintext []byte, serverTimestamp uint64) error { - _, err := s.db.Exec(ctx, putBufferedEventQuery, s.AccountID, ciphertextHash[:], plaintext, serverTimestamp, time.Now().UnixMilli()) - return err -} - -func (s *sqlStore) ClearBufferedEventPlaintext(ctx context.Context, ciphertextHash [32]byte) error { - _, err := s.db.Exec(ctx, clearBufferedEventPlaintextQuery, s.AccountID, ciphertextHash[:]) - return err -} - -func (s *sqlStore) DeleteBufferedEventsOlderThan(ctx context.Context, maxTS time.Time) error { - _, err := s.db.Exec(ctx, deleteOldBufferedEventsQuery, s.AccountID, maxTS.UnixMilli()) - return err -} diff --git a/pkg/signalmeow/store/group_store.go b/pkg/signalmeow/store/group_store.go index 39b4684..5ee356e 100644 --- a/pkg/signalmeow/store/group_store.go +++ b/pkg/signalmeow/store/group_store.go @@ -26,7 +26,7 @@ import ( "go.mau.fi/mautrix-signal/pkg/signalmeow/types" ) -var _ GroupStore = (*sqlStore)(nil) +var _ GroupStore = (*SQLStore)(nil) type dbGroup struct { OurAciUuid string @@ -40,11 +40,11 @@ type GroupStore interface { } const ( - getGroupByIDQuery = `SELECT account_id, group_identifier, master_key FROM signalmeow_groups WHERE account_id=$1 AND group_identifier=$2` + getGroupByIDQuery = `SELECT our_aci_uuid, group_identifier, master_key FROM signalmeow_groups WHERE our_aci_uuid=$1 AND group_identifier=$2` upsertGroupMasterKeyQuery = ` - INSERT INTO signalmeow_groups (account_id, group_identifier, master_key) + INSERT INTO signalmeow_groups (our_aci_uuid, group_identifier, master_key) VALUES ($1, $2, $3) - ON CONFLICT (account_id, group_identifier) DO UPDATE + ON CONFLICT (our_aci_uuid, group_identifier) DO UPDATE SET master_key = excluded.master_key; ` ) @@ -60,8 +60,8 @@ func scanGroup(row dbutil.Scannable) (*dbGroup, error) { return &g, nil } -func (s *sqlStore) MasterKeyFromGroupIdentifier(ctx context.Context, groupID types.GroupIdentifier) (types.SerializedGroupMasterKey, error) { - g, err := scanGroup(s.db.QueryRow(ctx, getGroupByIDQuery, s.AccountID, groupID)) +func (s *SQLStore) MasterKeyFromGroupIdentifier(ctx context.Context, groupID types.GroupIdentifier) (types.SerializedGroupMasterKey, error) { + g, err := scanGroup(s.db.QueryRow(ctx, getGroupByIDQuery, s.ACI, groupID)) if g == nil { return "", err } else { @@ -69,7 +69,7 @@ func (s *sqlStore) MasterKeyFromGroupIdentifier(ctx context.Context, groupID typ } } -func (s *sqlStore) StoreMasterKey(ctx context.Context, groupID types.GroupIdentifier, key types.SerializedGroupMasterKey) error { - _, err := s.db.Exec(ctx, upsertGroupMasterKeyQuery, s.AccountID, groupID, key) +func (s *SQLStore) StoreMasterKey(ctx context.Context, groupID types.GroupIdentifier, key types.SerializedGroupMasterKey) error { + _, err := s.db.Exec(ctx, upsertGroupMasterKeyQuery, s.ACI, groupID, key) return err } diff --git a/pkg/signalmeow/store/identity_store.go b/pkg/signalmeow/store/identity_store.go index 3b2435d..14276a1 100644 --- a/pkg/signalmeow/store/identity_store.go +++ b/pkg/signalmeow/store/identity_store.go @@ -27,58 +27,77 @@ import ( "go.mau.fi/mautrix-signal/pkg/libsignalgo" ) -type sqlIdentityStore struct { - *sqlStore - - OwnKeyPair *libsignalgo.IdentityKeyPair - LocalRegistrationID uint32 -} - -type IdentityKeyStore interface { - SaveIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey) (bool, error) - GetIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID) (*libsignalgo.IdentityKey, error) - IsTrustedIdentity(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey, direction libsignalgo.SignalDirection) (bool, error) -} - -var _ libsignalgo.IdentityKeyStore = (*sqlIdentityStore)(nil) -var _ IdentityKeyStore = (*sqlStore)(nil) +var _ libsignalgo.IdentityKeyStore = (*SQLStore)(nil) const ( - insertIdentityKeyQuery = ` - INSERT INTO signalmeow_identity_keys (account_id, their_service_id, key, trust_level) - VALUES ($1, $2, $3, $4) - ON CONFLICT (account_id, their_service_id) DO UPDATE + getIdentityKeyPairQuery = `SELECT aci_identity_key_pair FROM signalmeow_device WHERE aci_uuid=$1` + getRegistrationLocalIDQuery = `SELECT registration_id FROM signalmeow_device WHERE aci_uuid=$1` + insertIdentityKeyQuery = ` + INSERT INTO signalmeow_identity_keys (our_aci_uuid, their_aci_uuid, their_device_id, key, trust_level) + VALUES ($1, $2, $3, $4, $5) + ON CONFLICT (our_aci_uuid, their_aci_uuid, their_device_id) DO UPDATE SET key=excluded.key, trust_level=excluded.trust_level ` getIdentityKeyTrustLevelQuery = ` SELECT trust_level FROM signalmeow_identity_keys - WHERE account_id=$1 AND their_service_id=$2 + WHERE our_aci_uuid=$1 AND their_aci_uuid=$2 AND their_device_id=$3 ` getIdentityKeyQuery = ` SELECT key FROM signalmeow_identity_keys - WHERE account_id=$1 AND their_service_id=$2 + WHERE our_aci_uuid=$1 AND their_aci_uuid=$2 AND their_device_id=$3 ` ) -func (s *sqlIdentityStore) GetIdentityKeyPair(ctx context.Context) (*libsignalgo.IdentityKeyPair, error) { - return s.OwnKeyPair, nil -} - -func (s *sqlIdentityStore) GetLocalRegistrationID(ctx context.Context) (uint32, error) { - return s.LocalRegistrationID, nil +func scanIdentityKeyPair(row dbutil.Scannable) (*libsignalgo.IdentityKeyPair, error) { + var keyPair []byte + err := row.Scan(&keyPair) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } else if err != nil { + return nil, err + } + return libsignalgo.DeserializeIdentityKeyPair(keyPair) } func scanIdentityKey(row dbutil.Scannable) (*libsignalgo.IdentityKey, error) { - return scanRecord(row, libsignalgo.DeserializeIdentityKey) + var key []byte + err := row.Scan(&key) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } else if err != nil { + return nil, err + } + return libsignalgo.DeserializeIdentityKey(key) } -func (s *sqlStore) SaveIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey) (bool, error) { +func (s *SQLStore) GetIdentityKeyPair(ctx context.Context) (*libsignalgo.IdentityKeyPair, error) { + return scanIdentityKeyPair(s.db.QueryRow(ctx, getIdentityKeyPairQuery, s.ACI)) +} + +func (s *SQLStore) GetLocalRegistrationID(ctx context.Context) (uint32, error) { + var regID sql.NullInt64 + err := s.db.QueryRow(ctx, getRegistrationLocalIDQuery, s.ACI).Scan(®ID) + if err != nil { + return 0, fmt.Errorf("failed to get local registration ID: %w", err) + } + return uint32(regID.Int64), nil +} + +func (s *SQLStore) SaveIdentityKey(ctx context.Context, address *libsignalgo.Address, identityKey *libsignalgo.IdentityKey) (bool, error) { trustLevel := "TRUSTED_UNVERIFIED" // TODO: this should be hard coded here serialized, err := identityKey.Serialize() if err != nil { return false, fmt.Errorf("failed to serialize identity key: %w", err) } - oldKey, err := scanIdentityKey(s.db.QueryRow(ctx, getIdentityKeyQuery, s.AccountID, theirServiceID)) + theirUUID, err := address.Name() + if err != nil { + return false, fmt.Errorf("failed to get their uuid: %w", err) + } + deviceID, err := address.DeviceID() + if err != nil { + return false, fmt.Errorf("failed to get device ID: %w", err) + } + oldKey, err := scanIdentityKey(s.db.QueryRow(ctx, getIdentityKeyQuery, s.ACI, theirUUID, deviceID)) if err != nil { return false, fmt.Errorf("failed to get old identity key: %w", err) } @@ -91,17 +110,25 @@ func (s *sqlStore) SaveIdentityKey(ctx context.Context, theirServiceID libsignal // We are replacing the old key if the old key exists, and it is not equal to the new key replacing = !equal } - _, err = s.db.Exec(ctx, insertIdentityKeyQuery, s.AccountID, theirServiceID, serialized, trustLevel) + _, err = s.db.Exec(ctx, insertIdentityKeyQuery, s.ACI, theirUUID, deviceID, serialized, trustLevel) if err != nil { return replacing, fmt.Errorf("failed to insert new identity key: %w", err) } return replacing, err } -func (s *sqlStore) IsTrustedIdentity(ctx context.Context, theirServiceID libsignalgo.ServiceID, identityKey *libsignalgo.IdentityKey, direction libsignalgo.SignalDirection) (bool, error) { +func (s *SQLStore) IsTrustedIdentity(ctx context.Context, address *libsignalgo.Address, identityKey *libsignalgo.IdentityKey, direction libsignalgo.SignalDirection) (bool, error) { // TODO: this should check direction, and probably some other stuff (though whisperfish is pretty basic) + theirUUID, err := address.Name() + if err != nil { + return false, fmt.Errorf("failed to get their uuid: %w", err) + } + deviceID, err := address.DeviceID() + if err != nil { + return false, fmt.Errorf("failed to get device ID: %w", err) + } var trustLevel string - err := s.db.QueryRow(ctx, getIdentityKeyTrustLevelQuery, s.AccountID, theirServiceID).Scan(&trustLevel) + err = s.db.QueryRow(ctx, getIdentityKeyTrustLevelQuery, s.ACI, theirUUID, deviceID).Scan(&trustLevel) if errors.Is(err, sql.ErrNoRows) { // If no rows, they are a new identity, so trust by default return true, nil @@ -112,8 +139,16 @@ func (s *sqlStore) IsTrustedIdentity(ctx context.Context, theirServiceID libsign return trusted, nil } -func (s *sqlStore) GetIdentityKey(ctx context.Context, theirServiceID libsignalgo.ServiceID) (*libsignalgo.IdentityKey, error) { - key, err := scanIdentityKey(s.db.QueryRow(ctx, getIdentityKeyQuery, s.AccountID, theirServiceID)) +func (s *SQLStore) GetIdentityKey(ctx context.Context, address *libsignalgo.Address) (*libsignalgo.IdentityKey, error) { + theirUUID, err := address.Name() + if err != nil { + return nil, fmt.Errorf("failed to get their uuid: %w", err) + } + deviceID, err := address.DeviceID() + if err != nil { + return nil, fmt.Errorf("failed to get device ID: %w", err) + } + key, err := scanIdentityKey(s.db.QueryRow(ctx, getIdentityKeyQuery, s.ACI, theirUUID, deviceID)) if err != nil { return nil, fmt.Errorf("failed to get identity key from database: %w", err) } diff --git a/pkg/signalmeow/store/prekey_store.go b/pkg/signalmeow/store/prekey_store.go index 37bca7e..4963491 100644 --- a/pkg/signalmeow/store/prekey_store.go +++ b/pkg/signalmeow/store/prekey_store.go @@ -25,209 +25,281 @@ import ( "go.mau.fi/util/dbutil" "go.mau.fi/mautrix-signal/pkg/libsignalgo" + "go.mau.fi/mautrix-signal/pkg/signalmeow/types" ) -var _ PreKeyStore = (*scopedSQLStore)(nil) +var _ libsignalgo.PreKeyStore = (*SQLStore)(nil) +var _ libsignalgo.SignedPreKeyStore = (*SQLStore)(nil) +var _ libsignalgo.KyberPreKeyStore = (*SQLStore)(nil) +var _ PreKeyStoreExtras = (*SQLStore)(nil) -type ServiceScopedStore interface { - GetServiceID() libsignalgo.ServiceID -} +// TODO: figure out how best to handle ACI vs PNI UUIDs -type PreKeyStore interface { - libsignalgo.PreKeyStore - libsignalgo.SignedPreKeyStore - libsignalgo.KyberPreKeyStore - ServiceScopedStore - - StoreLastResortKyberPreKey(ctx context.Context, preKeyID uint32, record *libsignalgo.KyberPreKeyRecord) error - RemoveSignedPreKey(ctx context.Context, preKeyID uint32) error - RemoveKyberPreKey(ctx context.Context, preKeyID uint32) error - GetNextPreKeyID(ctx context.Context) (count, max uint32, err error) - GetNextKyberPreKeyID(ctx context.Context) (count, max uint32, err error) - IsKyberPreKeyLastResort(ctx context.Context, preKeyID uint32) (bool, error) - AllPreKeys(ctx context.Context) ([]*libsignalgo.PreKeyRecord, error) - AllNormalKyberPreKeys(ctx context.Context) ([]*libsignalgo.KyberPreKeyRecord, error) +type PreKeyStoreExtras interface { + PreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (*libsignalgo.PreKeyRecord, error) + SignedPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (*libsignalgo.SignedPreKeyRecord, error) + KyberPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (*libsignalgo.KyberPreKeyRecord, error) + SavePreKey(ctx context.Context, uuidKind types.UUIDKind, preKey *libsignalgo.PreKeyRecord, markUploaded bool) error + SaveSignedPreKey(ctx context.Context, uuidKind types.UUIDKind, preKey *libsignalgo.SignedPreKeyRecord, markUploaded bool) error + SaveKyberPreKey(ctx context.Context, uuidKind types.UUIDKind, preKey *libsignalgo.KyberPreKeyRecord, lastResort bool) error + DeletePreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) error + DeleteSignedPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) error + DeleteKyberPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) error + GetNextPreKeyID(ctx context.Context, uuidKind types.UUIDKind) (uint, error) + GetSignedNextPreKeyID(ctx context.Context, uuidKind types.UUIDKind) (uint, error) + GetNextKyberPreKeyID(ctx context.Context, uuidKind types.UUIDKind) (uint, error) + MarkPreKeysAsUploaded(ctx context.Context, uuidKind types.UUIDKind, upToID uint) error + MarkSignedPreKeysAsUploaded(ctx context.Context, uuidKind types.UUIDKind, upToID uint) error + IsKyberPreKeyLastResort(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (bool, error) + AllPreKeys(ctx context.Context, uuidKind types.UUIDKind) ([]*libsignalgo.PreKeyRecord, error) + AllNormalKyberPreKeys(ctx context.Context, uuidKind types.UUIDKind) ([]*libsignalgo.KyberPreKeyRecord, error) DeleteAllPreKeys(ctx context.Context) error } -const ( - getAllPreKeysQuery = `SELECT key_pair FROM signalmeow_pre_keys WHERE account_id=$1 AND service_id=$2 AND is_signed=$3` - getPreKeyQuery = `SELECT key_pair FROM signalmeow_pre_keys WHERE account_id=$1 AND service_id=$2 AND key_id=$3 AND is_signed=$4` - insertPreKeyQuery = `INSERT INTO signalmeow_pre_keys (account_id, service_id, key_id, is_signed, key_pair) VALUES ($1, $2, $3, $4, $5)` - deletePreKeyQuery = `DELETE FROM signalmeow_pre_keys WHERE account_id=$1 AND service_id=$2 AND key_id=$3 AND is_signed=$4` - getLastPreKeyIDQuery = `SELECT COUNT(*), COALESCE(MAX(key_id), 0) FROM signalmeow_pre_keys WHERE account_id=$1 AND service_id=$2 AND is_signed=$3` +// libsignalgo.PreKeyStore implementation - getAllKyberPreKeysQuery = `SELECT key_pair FROM signalmeow_kyber_pre_keys WHERE account_id=$1 AND service_id=$2 AND is_last_resort=false` - getKyberPreKeyQuery = `SELECT key_pair FROM signalmeow_kyber_pre_keys WHERE account_id=$1 AND service_id=$2 AND key_id=$3` - insertKyberPreKeyQuery = `INSERT INTO signalmeow_kyber_pre_keys (account_id, service_id, key_id, key_pair, is_last_resort) VALUES ($1, $2, $3, $4, $5)` - deleteKyberPreKeyQuery = `DELETE FROM signalmeow_kyber_pre_keys WHERE account_id=$1 AND service_id=$2 AND key_id=$3` - getLastKyberPreKeyIDQuery = `SELECT COUNT(*), COALESCE(MAX(key_id), 0) FROM signalmeow_kyber_pre_keys WHERE account_id=$1 AND service_id=$2` - isLastResortQuery = `SELECT is_last_resort FROM signalmeow_kyber_pre_keys WHERE account_id=$1 AND service_id=$2 AND key_id=$3` +func (s *SQLStore) LoadPreKey(ctx context.Context, id uint32) (*libsignalgo.PreKeyRecord, error) { + return s.PreKey(ctx, types.UUIDKindACI, int(id)) +} +func (s *SQLStore) StorePreKey(ctx context.Context, id uint32, preKeyRecord *libsignalgo.PreKeyRecord) error { + return s.SavePreKey(ctx, types.UUIDKindACI, preKeyRecord, false) +} +func (s *SQLStore) RemovePreKey(ctx context.Context, id uint32) error { + return s.DeletePreKey(ctx, types.UUIDKindACI, int(id)) +} + +// libsignalgo.SignedPreKeyStore implementation + +func (s *SQLStore) LoadSignedPreKey(ctx context.Context, id uint32) (*libsignalgo.SignedPreKeyRecord, error) { + return s.SignedPreKey(ctx, types.UUIDKindACI, int(id)) +} +func (s *SQLStore) StoreSignedPreKey(ctx context.Context, id uint32, signedPreKeyRecord *libsignalgo.SignedPreKeyRecord) error { + return s.SaveSignedPreKey(ctx, types.UUIDKindACI, signedPreKeyRecord, false) +} +func (s *SQLStore) RemoveSignedPreKey(ctx context.Context, id uint32) error { + return s.DeleteSignedPreKey(ctx, types.UUIDKindACI, int(id)) +} + +// libsignalgo.KyberPreKeyStore implementation + +func (s *SQLStore) LoadKyberPreKey(ctx context.Context, id uint32) (*libsignalgo.KyberPreKeyRecord, error) { + return s.KyberPreKey(ctx, types.UUIDKindACI, int(id)) +} +func (s *SQLStore) StoreKyberPreKey(ctx context.Context, id uint32, kyberPreKeyRecord *libsignalgo.KyberPreKeyRecord) error { + return s.SaveKyberPreKey(ctx, types.UUIDKindACI, kyberPreKeyRecord, false) +} +func (s *SQLStore) MarkKyberPreKeyUsed(ctx context.Context, id uint32) error { + isLastResort, err := s.IsKyberPreKeyLastResort(ctx, types.UUIDKindACI, int(id)) + if err != nil { + return err + } + if !isLastResort { + return s.DeleteKyberPreKey(ctx, types.UUIDKindACI, int(id)) + } + return nil +} + +const ( + getKyberPreKeyQuery = `SELECT key_pair, is_last_resort FROM signalmeow_kyber_pre_keys WHERE aci_uuid=$1 AND key_id=$2 AND uuid_kind=$3` + insertKyberPreKeyQuery = `INSERT INTO signalmeow_kyber_pre_keys (aci_uuid, key_id, uuid_kind, key_pair, is_last_resort) VALUES ($1, $2, $3, $4, $5)` + deleteKyberPreKeyQuery = `DELETE FROM signalmeow_kyber_pre_keys WHERE aci_uuid=$1 AND key_id=$2 AND uuid_kind=$3` + getLastKyberPreKeyIDQuery = `SELECT MAX(key_id) FROM signalmeow_kyber_pre_keys WHERE aci_uuid=$1 AND uuid_kind=$2` + isLastResortQuery = `SELECT is_last_resort FROM signalmeow_kyber_pre_keys WHERE aci_uuid=$1 AND key_id=$2 AND uuid_kind=$3` ) -func scanRecord[T any](row dbutil.Scannable, deserializer func([]byte) (*T, error)) (*T, error) { - record, err := dbutil.ScanSingleColumn[[]byte](row) +func (s *SQLStore) KyberPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (*libsignalgo.KyberPreKeyRecord, error) { + var record []byte + var isLastResort bool + err := s.db.QueryRow(ctx, getKyberPreKeyQuery, s.ACI, preKeyID, uuidKind).Scan(&record, &isLastResort) if errors.Is(err, sql.ErrNoRows) { return nil, nil - } else if err != nil { + } + if err != nil { return nil, err } - return deserializer(record) + return libsignalgo.DeserializeKyberPreKeyRecord(record) } -func scanPreKey(row dbutil.Scannable) (*libsignalgo.PreKeyRecord, error) { - return scanRecord(row, libsignalgo.DeserializePreKeyRecord) -} - -func scanSignedPreKey(row dbutil.Scannable) (*libsignalgo.SignedPreKeyRecord, error) { - return scanRecord(row, libsignalgo.DeserializeSignedPreKeyRecord) -} - -func scanKyberPreKey(row dbutil.Scannable) (*libsignalgo.KyberPreKeyRecord, error) { - return scanRecord(row, libsignalgo.DeserializeKyberPreKeyRecord) -} - -func (s *scopedSQLStore) GetServiceID() libsignalgo.ServiceID { - return s.ServiceID -} - -func (s *scopedSQLStore) LoadPreKey(ctx context.Context, preKeyID uint32) (*libsignalgo.PreKeyRecord, error) { - return scanPreKey(s.db.QueryRow(ctx, getPreKeyQuery, s.AccountID, s.ServiceID, preKeyID, false)) -} - -func (s *scopedSQLStore) LoadSignedPreKey(ctx context.Context, preKeyID uint32) (*libsignalgo.SignedPreKeyRecord, error) { - return scanSignedPreKey(s.db.QueryRow(ctx, getPreKeyQuery, s.AccountID, s.ServiceID, preKeyID, true)) -} - -func (s *scopedSQLStore) LoadKyberPreKey(ctx context.Context, preKeyID uint32) (*libsignalgo.KyberPreKeyRecord, error) { - return scanKyberPreKey(s.db.QueryRow(ctx, getKyberPreKeyQuery, s.AccountID, s.ServiceID, preKeyID)) -} - -func (s *scopedSQLStore) StorePreKey(ctx context.Context, preKeyID uint32, preKey *libsignalgo.PreKeyRecord) error { - id, err := preKey.GetID() - if err != nil { - return fmt.Errorf("failed to get prekey ID: %w", err) - } else if preKeyID > 0 && id != preKeyID { - return fmt.Errorf("prekey ID mismatch: expected %d, got %d", preKeyID, id) - } - serialized, err := preKey.Serialize() - if err != nil { - return fmt.Errorf("failed to serialize prekey: %w", err) - } - _, err = s.db.Exec(ctx, insertPreKeyQuery, s.AccountID, s.ServiceID, id, false, serialized) - return err -} - -func (s *scopedSQLStore) StoreSignedPreKey(ctx context.Context, preKeyID uint32, preKey *libsignalgo.SignedPreKeyRecord) error { - id, err := preKey.GetID() - if err != nil { - return fmt.Errorf("failed to get signed prekey ID: %w", err) - } else if preKeyID > 0 && id != preKeyID { - return fmt.Errorf("prekey ID mismatch: expected %d, got %d", preKeyID, id) - } - serialized, err := preKey.Serialize() - if err != nil { - return fmt.Errorf("failed to serialize signed prekey: %w", err) - } - _, err = s.db.Exec(ctx, insertPreKeyQuery, s.AccountID, s.ServiceID, id, true, serialized) - return err -} - -func (s *scopedSQLStore) StoreKyberPreKey(ctx context.Context, preKeyID uint32, kyberPreKeyRecord *libsignalgo.KyberPreKeyRecord) error { - return s.storeKyberPreKey(ctx, preKeyID, kyberPreKeyRecord, false) -} - -func (s *scopedSQLStore) StoreLastResortKyberPreKey(ctx context.Context, preKeyID uint32, kyberPreKeyRecord *libsignalgo.KyberPreKeyRecord) error { - return s.storeKyberPreKey(ctx, preKeyID, kyberPreKeyRecord, true) -} - -func (s *scopedSQLStore) storeKyberPreKey(ctx context.Context, preKeyID uint32, kyberPreKeyRecord *libsignalgo.KyberPreKeyRecord, lastResort bool) error { +func (s *SQLStore) SaveKyberPreKey(ctx context.Context, uuidKind types.UUIDKind, kyberPreKeyRecord *libsignalgo.KyberPreKeyRecord, lastResort bool) error { id, err := kyberPreKeyRecord.GetID() if err != nil { return fmt.Errorf("failed to get kyber prekey record ID: %w", err) - } else if preKeyID > 0 && id != preKeyID { - return fmt.Errorf("prekey ID mismatch: expected %d, got %d", preKeyID, id) } serialized, err := kyberPreKeyRecord.Serialize() if err != nil { return fmt.Errorf("failed to serialize kyber prekey record: %w", err) } - _, err = s.db.Exec(ctx, insertKyberPreKeyQuery, s.AccountID, s.ServiceID, id, serialized, lastResort) + _, err = s.db.Exec(ctx, insertKyberPreKeyQuery, s.ACI, id, uuidKind, serialized, lastResort) return err } -func (s *scopedSQLStore) RemovePreKey(ctx context.Context, preKeyID uint32) error { - _, err := s.db.Exec(ctx, deletePreKeyQuery, s.AccountID, s.ServiceID, preKeyID, false) +func (s *SQLStore) DeleteKyberPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) error { + _, err := s.db.Exec(ctx, deleteKyberPreKeyQuery, s.ACI, preKeyID, uuidKind) return err } -func (s *scopedSQLStore) RemoveSignedPreKey(ctx context.Context, preKeyID uint32) error { - _, err := s.db.Exec(ctx, deletePreKeyQuery, s.AccountID, s.ServiceID, preKeyID, true) - return err -} - -func (s *scopedSQLStore) RemoveKyberPreKey(ctx context.Context, preKeyID uint32) error { - _, err := s.db.Exec(ctx, deleteKyberPreKeyQuery, s.AccountID, s.ServiceID, preKeyID) - return err -} - -func (s *scopedSQLStore) MarkKyberPreKeyUsed(ctx context.Context, id uint32) error { - isLastResort, err := s.IsKyberPreKeyLastResort(ctx, id) +func (s *SQLStore) GetNextKyberPreKeyID(ctx context.Context, uuidKind types.UUIDKind) (uint, error) { + var lastKeyID sql.NullInt64 + err := s.db.QueryRow(ctx, getLastKyberPreKeyIDQuery, s.ACI, uuidKind).Scan(&lastKeyID) if err != nil { - return err + return 0, fmt.Errorf("failed to query next kyber prekey ID: %w", err) } - if !isLastResort { - return s.RemoveKyberPreKey(ctx, id) - } - return nil + return uint(lastKeyID.Int64) + 1, nil } -func (s *scopedSQLStore) GetNextPreKeyID(ctx context.Context) (count, next uint32, err error) { - err = s.db.QueryRow(ctx, getLastPreKeyIDQuery, s.AccountID, s.ServiceID, false).Scan(&count, &next) - if err != nil { - err = fmt.Errorf("failed to query next prekey ID: %w", err) - } - next++ - return -} - -func (s *scopedSQLStore) GetNextKyberPreKeyID(ctx context.Context) (count, next uint32, err error) { - err = s.db.QueryRow(ctx, getLastKyberPreKeyIDQuery, s.AccountID, s.ServiceID).Scan(&count, &next) - if err != nil { - err = fmt.Errorf("failed to query next kyber prekey ID: %w", err) - } - next++ - return -} - -func (s *scopedSQLStore) IsKyberPreKeyLastResort(ctx context.Context, preKeyID uint32) (bool, error) { +func (s *SQLStore) IsKyberPreKeyLastResort(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (bool, error) { var isLastResort bool - err := s.db.QueryRow(ctx, isLastResortQuery, s.AccountID, s.ServiceID, preKeyID).Scan(&isLastResort) + err := s.db.QueryRow(ctx, isLastResortQuery, s.ACI, preKeyID, uuidKind).Scan(&isLastResort) if err != nil { return false, err } return isLastResort, nil } -func (s *scopedSQLStore) DeleteAllPreKeys(ctx context.Context) error { +const ( + getPreKeyQuery = `SELECT key_id, key_pair FROM signalmeow_pre_keys WHERE aci_uuid=$1 AND key_id=$2 AND uuid_kind=$3 and is_signed=$4` + insertPreKeyQuery = `INSERT INTO signalmeow_pre_keys (aci_uuid, key_id, uuid_kind, is_signed, key_pair, uploaded) VALUES ($1, $2, $3, $4, $5, $6)` + deletePreKeyQuery = `DELETE FROM signalmeow_pre_keys WHERE aci_uuid=$1 AND key_id=$2 AND uuid_kind=$3 AND is_signed=$4` + getLastPreKeyIDQuery = `SELECT MAX(key_id) FROM signalmeow_pre_keys WHERE aci_uuid=$1 AND uuid_kind=$2 AND is_signed=$3` + markPreKeysAsUploadedQuery = `UPDATE signalmeow_pre_keys SET uploaded=true WHERE aci_uuid=$1 AND uuid_kind=$2 AND is_signed=$3 AND key_id<=$4` + getUnuploadedPreKeysQuery = `SELECT key_id, key_pair FROM signalmeow_pre_keys WHERE aci_uuid=$1 AND uuid_kind=$2 AND is_signed=$3 AND uploaded=false ORDER BY key_id` + getUploadedPreKeyCountQuery = `SELECT COUNT(*) FROM signalmeow_pre_keys WHERE aci_uuid=$1 AND uuid_kind=$2 AND is_signed=$3 AND uploaded=true` +) + +func scanPreKey(row dbutil.Scannable) (*libsignalgo.PreKeyRecord, error) { + var id uint + var record []byte + err := row.Scan(&id, &record) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } else if err != nil { + return nil, err + } + return libsignalgo.DeserializePreKeyRecord(record) +} + +func scanSignedPreKey(row dbutil.Scannable) (*libsignalgo.SignedPreKeyRecord, error) { + var id uint + var record []byte + err := row.Scan(&id, &record) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } else if err != nil { + return nil, err + } + return libsignalgo.DeserializeSignedPreKeyRecord(record) +} + +func (s *SQLStore) PreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (*libsignalgo.PreKeyRecord, error) { + return scanPreKey(s.db.QueryRow(ctx, getPreKeyQuery, s.ACI, preKeyID, uuidKind, false)) +} + +func (s *SQLStore) SignedPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) (*libsignalgo.SignedPreKeyRecord, error) { + return scanSignedPreKey(s.db.QueryRow(ctx, getPreKeyQuery, s.ACI, preKeyID, uuidKind, true)) +} + +func (s *SQLStore) SavePreKey(ctx context.Context, uuidKind types.UUIDKind, preKey *libsignalgo.PreKeyRecord, markUploaded bool) error { + id, err := preKey.GetID() + if err != nil { + return fmt.Errorf("failed to get prekey ID: %w", err) + } + serialized, err := preKey.Serialize() + if err != nil { + return fmt.Errorf("failed to serialize prekey: %w", err) + } + _, err = s.db.Exec(ctx, insertPreKeyQuery, s.ACI, id, uuidKind, false, serialized, markUploaded) + return err +} + +func (s *SQLStore) SaveSignedPreKey(ctx context.Context, uuidKind types.UUIDKind, preKey *libsignalgo.SignedPreKeyRecord, markUploaded bool) error { + id, err := preKey.GetID() + if err != nil { + return fmt.Errorf("failed to get signed prekey ID: %w", err) + } + serialized, err := preKey.Serialize() + if err != nil { + return fmt.Errorf("failed to serialize signed prekey: %w", err) + } + _, err = s.db.Exec(ctx, insertPreKeyQuery, s.ACI, id, uuidKind, true, serialized, markUploaded) + return err +} + +func (s *SQLStore) DeletePreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) error { + _, err := s.db.Exec(ctx, deletePreKeyQuery, s.ACI, preKeyID, uuidKind, false) + return err +} + +func (s *SQLStore) DeleteSignedPreKey(ctx context.Context, uuidKind types.UUIDKind, preKeyID int) error { + _, err := s.db.Exec(ctx, deletePreKeyQuery, s.ACI, preKeyID, uuidKind, true) + return err +} + +func (s *SQLStore) GetNextPreKeyID(ctx context.Context, uuidKind types.UUIDKind) (uint, error) { + var lastKeyID sql.NullInt64 + err := s.db.QueryRow(ctx, getLastPreKeyIDQuery, s.ACI, uuidKind, false).Scan(&lastKeyID) + if err != nil { + return 0, fmt.Errorf("failed to query next prekey ID: %w", err) + } + return uint(lastKeyID.Int64) + 1, nil +} + +func (s *SQLStore) GetSignedNextPreKeyID(ctx context.Context, uuidKind types.UUIDKind) (uint, error) { + var lastKeyID sql.NullInt64 + err := s.db.QueryRow(ctx, getLastPreKeyIDQuery, s.ACI, uuidKind, true).Scan(&lastKeyID) + if err != nil { + return 0, fmt.Errorf("failed to query next signed prekey ID: %w", err) + } + return uint(lastKeyID.Int64) + 1, nil +} + +func (s *SQLStore) MarkPreKeysAsUploaded(ctx context.Context, uuidKind types.UUIDKind, upToID uint) error { + _, err := s.db.Exec(ctx, markPreKeysAsUploadedQuery, s.ACI, uuidKind, false, upToID) + return err +} + +func (s *SQLStore) MarkSignedPreKeysAsUploaded(ctx context.Context, uuidKind types.UUIDKind, upToID uint) error { + _, err := s.db.Exec(ctx, markPreKeysAsUploadedQuery, s.ACI, uuidKind, true, upToID) + return err +} + +func (s *SQLStore) DeleteAllPreKeys(ctx context.Context) error { return s.db.DoTxn(ctx, nil, func(ctx context.Context) error { - _, err := s.db.Exec(ctx, "DELETE FROM signalmeow_pre_keys WHERE account_id=$1", s.AccountID) + _, err := s.db.Exec(ctx, "DELETE FROM signalmeow_pre_keys WHERE aci_uuid=$1", s.ACI) if err != nil { return err } - _, err = s.db.Exec(ctx, "DELETE FROM signalmeow_kyber_pre_keys WHERE account_id=$1", s.AccountID) + _, err = s.db.Exec(ctx, "DELETE FROM signalmeow_kyber_pre_keys WHERE aci_uuid=$1", s.ACI) return err }) } -func (s *scopedSQLStore) AllPreKeys(ctx context.Context) ([]*libsignalgo.PreKeyRecord, error) { - return dbutil.ConvertRowFn[*libsignalgo.PreKeyRecord](scanPreKey). - NewRowIter(s.db.Query(ctx, getAllPreKeysQuery, s.AccountID, s.ServiceID, false)). - AsList() +func (s *SQLStore) AllPreKeys(ctx context.Context, uuidKind types.UUIDKind) ([]*libsignalgo.PreKeyRecord, error) { + queryString := "SELECT key_id, key_pair FROM signalmeow_pre_keys WHERE aci_uuid=$1 AND uuid_kind=$2 AND is_signed=$3" + rows, err := s.db.Query(ctx, queryString, s.ACI, uuidKind, false) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } + if err != nil { + return nil, err + } + return dbutil.NewRowIter(rows, scanPreKey).AsList() } -func (s *scopedSQLStore) AllNormalKyberPreKeys(ctx context.Context) ([]*libsignalgo.KyberPreKeyRecord, error) { - return dbutil.ConvertRowFn[*libsignalgo.KyberPreKeyRecord](scanKyberPreKey). - NewRowIter(s.db.Query(ctx, getAllKyberPreKeysQuery, s.AccountID, s.ServiceID)). - AsList() +func (s *SQLStore) AllNormalKyberPreKeys(ctx context.Context, uuidKind types.UUIDKind) ([]*libsignalgo.KyberPreKeyRecord, error) { + queryString := "SELECT key_id, key_pair FROM signalmeow_kyber_pre_keys WHERE aci_uuid=$1 AND uuid_kind=$2 AND is_last_resort=false" + rows, err := s.db.Query(ctx, queryString, s.ACI, uuidKind) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } else if err != nil { + return nil, err + } + return dbutil.NewRowIter(rows, func(row dbutil.Scannable) (*libsignalgo.KyberPreKeyRecord, error) { + var id uint + var record []byte + err := row.Scan(&id, &record) + if err != nil { + return nil, err + } + return libsignalgo.DeserializeKyberPreKeyRecord(record) + }).AsList() } diff --git a/pkg/signalmeow/store/profile_key_store.go b/pkg/signalmeow/store/profile_key_store.go index 02fd3e6..c384f4f 100644 --- a/pkg/signalmeow/store/profile_key_store.go +++ b/pkg/signalmeow/store/profile_key_store.go @@ -1,5 +1,5 @@ // mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2024 Tulir Asokan +// Copyright (C) 2023 Scott Weber // // 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 @@ -18,6 +18,8 @@ package store import ( "context" + "database/sql" + "errors" "github.com/google/uuid" "go.mau.fi/util/dbutil" @@ -25,28 +27,42 @@ import ( "go.mau.fi/mautrix-signal/pkg/libsignalgo" ) +var _ ProfileKeyStore = (*SQLStore)(nil) + +type ProfileKeyStore interface { + // LoadProfileKey loads the profile key for the given address. + // If the address is not found, nil is returned. + LoadProfileKey(ctx context.Context, theirACI uuid.UUID) (*libsignalgo.ProfileKey, error) + StoreProfileKey(ctx context.Context, theirACI uuid.UUID, key libsignalgo.ProfileKey) error + MyProfileKey(ctx context.Context) (*libsignalgo.ProfileKey, error) +} + const ( - loadProfileKeyQuery = `SELECT profile_key FROM signalmeow_recipients WHERE account_id=$1 AND aci_uuid=$2` - storeProfileKeyQuery = ` - INSERT INTO signalmeow_recipients (account_id, aci_uuid, profile_key) - VALUES ($1, $2, $3) - ON CONFLICT (account_id, aci_uuid) DO UPDATE SET profile_key=excluded.profile_key - ` + loadProfileKeyQuery = `SELECT key FROM signalmeow_profile_keys WHERE our_aci_uuid=$1 AND their_aci_uuid=$2` + storeProfileKeyQuery = `INSERT INTO signalmeow_profile_keys (our_aci_uuid, their_aci_uuid, key) VALUES ($1, $2, $3) ON CONFLICT (our_aci_uuid, their_aci_uuid) DO UPDATE SET key=excluded.key` ) func scanProfileKey(row dbutil.Scannable) (*libsignalgo.ProfileKey, error) { - return scanRecord(row, libsignalgo.DeserializeProfileKey) + var record []byte + err := row.Scan(&record) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } else if err != nil { + return nil, err + } + profileKey := libsignalgo.ProfileKey(record) + return &profileKey, err } -func (s *sqlStore) LoadProfileKey(ctx context.Context, theirACI uuid.UUID) (*libsignalgo.ProfileKey, error) { - return scanProfileKey(s.db.QueryRow(ctx, loadProfileKeyQuery, s.AccountID, theirACI)) +func (s *SQLStore) LoadProfileKey(ctx context.Context, theirACI uuid.UUID) (*libsignalgo.ProfileKey, error) { + return scanProfileKey(s.db.QueryRow(ctx, loadProfileKeyQuery, s.ACI, theirACI)) } -func (s *sqlStore) MyProfileKey(ctx context.Context) (*libsignalgo.ProfileKey, error) { - return scanProfileKey(s.db.QueryRow(ctx, loadProfileKeyQuery, s.AccountID, s.AccountID)) +func (s *SQLStore) MyProfileKey(ctx context.Context) (*libsignalgo.ProfileKey, error) { + return scanProfileKey(s.db.QueryRow(ctx, loadProfileKeyQuery, s.ACI, s.ACI)) } -func (s *sqlStore) StoreProfileKey(ctx context.Context, theirACI uuid.UUID, key libsignalgo.ProfileKey) error { - _, err := s.db.Exec(ctx, storeProfileKeyQuery, s.AccountID, theirACI, key.Slice()) +func (s *SQLStore) StoreProfileKey(ctx context.Context, theirACI uuid.UUID, key libsignalgo.ProfileKey) error { + _, err := s.db.Exec(ctx, storeProfileKeyQuery, s.ACI, theirACI, key.Slice()) return err } diff --git a/pkg/signalmeow/store/recipient_store.go b/pkg/signalmeow/store/recipient_store.go deleted file mode 100644 index 5f328be..0000000 --- a/pkg/signalmeow/store/recipient_store.go +++ /dev/null @@ -1,429 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2023 Scott Weber -// Copyright (C) 2024 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 store - -import ( - "context" - "database/sql" - "errors" - "fmt" - "time" - - "github.com/google/uuid" - "github.com/rs/zerolog" - "go.mau.fi/util/dbutil" - - "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/types" -) - -type RecipientStore interface { - LoadProfileKey(ctx context.Context, theirACI uuid.UUID) (*libsignalgo.ProfileKey, error) - StoreProfileKey(ctx context.Context, theirACI uuid.UUID, key libsignalgo.ProfileKey) error - 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) -} - -var _ RecipientStore = (*sqlStore)(nil) - -const ( - getAllRecipientsQuery = ` - SELECT - aci_uuid, - pni_uuid, - e164_number, - contact_name, - contact_avatar_hash, - nickname, - profile_key, - profile_name, - profile_about, - profile_about_emoji, - profile_avatar_path, - profile_fetched_at, - needs_pni_signature, - blocked, - whitelisted - FROM signalmeow_recipients - WHERE account_id = $1 - ` - getAllRecipientsWithNameOrPhoneQuery = getAllRecipientsQuery + `AND (contact_name <> '' OR profile_name <> '' OR e164_number <> '')` - getRecipientByACIQuery = getAllRecipientsQuery + `AND aci_uuid = $2` - getRecipientByPNIQuery = getAllRecipientsQuery + `AND pni_uuid = $2` - getRecipientByACIOrPNIQuery = getAllRecipientsQuery + `AND (($2<>'00000000-0000-0000-0000-000000000000' AND aci_uuid = $2) OR ($3<>'00000000-0000-0000-0000-000000000000' AND pni_uuid = $3))` - getRecipientByPhoneQuery = getAllRecipientsQuery + `AND e164_number = $2` - deleteRecipientByPNIQuery = `DELETE FROM signalmeow_recipients WHERE account_id = $1 AND pni_uuid = $2` - upsertACIRecipientQuery = ` - INSERT INTO signalmeow_recipients ( - account_id, - aci_uuid, - pni_uuid, - e164_number, - contact_name, - contact_avatar_hash, - nickname, - profile_key, - profile_name, - profile_about, - profile_about_emoji, - profile_avatar_path, - profile_fetched_at, - needs_pni_signature, - blocked, - whitelisted - ) - VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16) - ON CONFLICT (account_id, aci_uuid) DO UPDATE SET - pni_uuid = excluded.pni_uuid, - e164_number = excluded.e164_number, - contact_name = excluded.contact_name, - contact_avatar_hash = excluded.contact_avatar_hash, - nickname = excluded.nickname, - profile_key = excluded.profile_key, - profile_name = excluded.profile_name, - profile_about = excluded.profile_about, - 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 - ` - upsertPNIRecipientQuery = ` - INSERT INTO signalmeow_recipients ( - account_id, - pni_uuid, - e164_number, - contact_name, - contact_avatar_hash - ) - VALUES ($1, $2, $3, $4, $5) - ON CONFLICT (account_id, pni_uuid) DO UPDATE SET - e164_number = excluded.e164_number, - contact_name = excluded.contact_name, - contact_avatar_hash = excluded.contact_avatar_hash - ` -) - -func scanRecipient(row dbutil.Scannable) (*types.Recipient, error) { - var recipient types.Recipient - var aci, pni uuid.NullUUID - var profileKey []byte - var profileFetchedAt sql.NullInt64 - err := row.Scan( - &aci, - &pni, - &recipient.E164, - &recipient.ContactName, - &recipient.ContactAvatar.Hash, - &recipient.Nickname, - &profileKey, - &recipient.Profile.Name, - &recipient.Profile.About, - &recipient.Profile.AboutEmoji, - &recipient.Profile.AvatarPath, - &profileFetchedAt, - &recipient.NeedsPNISignature, - &recipient.Blocked, - &recipient.Whitelisted, - ) - if errors.Is(err, sql.ErrNoRows) { - return nil, nil - } else if err != nil { - return nil, err - } - recipient.ACI = aci.UUID - recipient.PNI = pni.UUID - if profileFetchedAt.Valid { - recipient.Profile.FetchedAt = time.UnixMilli(profileFetchedAt.Int64) - } - if len(profileKey) == libsignalgo.ProfileKeyLength { - recipient.Profile.Key = libsignalgo.ProfileKey(profileKey) - } - return &recipient, err -} - -func (s *sqlStore) LoadRecipientByACI(ctx context.Context, theirUUID uuid.UUID) (*types.Recipient, error) { - return scanRecipient(s.db.QueryRow(ctx, getRecipientByACIQuery, s.AccountID, theirUUID)) -} - -func (s *sqlStore) LoadRecipientByPNI(ctx context.Context, theirUUID uuid.UUID) (*types.Recipient, error) { - return scanRecipient(s.db.QueryRow(ctx, getRecipientByPNIQuery, s.AccountID, theirUUID)) -} - -type RecipientUpdaterFunc func(recipient *types.Recipient) (changed bool, err error) - -func (s *sqlStore) mergeRecipients(ctx context.Context, first, second *types.Recipient, updater RecipientUpdaterFunc) (*types.Recipient, error) { - if first.ACI == uuid.Nil { - first, second = second, first - } - first.PNI = second.PNI - zerolog.Ctx(ctx).Debug(). - Stringer("aci", first.ACI). - Stringer("pni", first.PNI). - Msg("Merging recipient entries in database") - if second.E164 != "" { - first.E164 = second.E164 - } - if first.ContactName == "" { - first.ContactName = second.ContactName - } - if first.ContactAvatar.Hash == "" { - first.ContactAvatar = second.ContactAvatar - } - _, err := updater(first) - if err != nil { - return first, fmt.Errorf("failed to run updater function: %w", err) - } - err = s.DeleteRecipientByPNI(ctx, first.PNI) - if err != nil { - return first, fmt.Errorf("failed to delete duplicate PNI row: %w", err) - } - err = s.StoreRecipient(ctx, first) - if err != nil { - return first, fmt.Errorf("failed to store merged row: %w", err) - } - return first, nil -} - -func (s *sqlStore) LoadAndUpdateRecipient(ctx context.Context, aci, pni uuid.UUID, updater RecipientUpdaterFunc) (outRecipient *types.Recipient, outErr error) { - if aci == uuid.Nil && pni == uuid.Nil { - return nil, fmt.Errorf("no ACI or PNI provided in LoadAndUpdateRecipient call") - } - if updater == nil { - updater = func(recipient *types.Recipient) (bool, error) { - 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() - } - outErr = s.db.DoTxn(ctx, nil, func(ctx context.Context) error { - var entries []*types.Recipient - var err error - if aci != uuid.Nil && pni != uuid.Nil { - query := getRecipientByACIOrPNIQuery - if s.db.Dialect == dbutil.Postgres { - query += " FOR UPDATE" - } - entries, err = dbutil.ConvertRowFn[*types.Recipient](scanRecipient). - NewRowIter(s.db.Query(ctx, query, s.AccountID, aci, pni)). - AsList() - } else if aci != uuid.Nil { - var entry *types.Recipient - entry, err = s.LoadRecipientByACI(ctx, aci) - if entry != nil { - entries = []*types.Recipient{entry} - } - } else if pni != uuid.Nil { - var entry *types.Recipient - entry, err = s.LoadRecipientByPNI(ctx, pni) - if entry != nil { - entries = []*types.Recipient{entry} - } - } else { - panic("impossible case") - } - if err != nil { - return err - } else if len(entries) > 2 { - return fmt.Errorf("got more than two recipient rows for ACI %s and PNI %s", aci, pni) - } else if len(entries) < 2 { - if len(entries) == 0 { - outRecipient = &types.Recipient{ - ACI: aci, - PNI: pni, - } - } else { - outRecipient = entries[0] - } - changed, err := updater(outRecipient) - if err != nil { - return fmt.Errorf("failed to run updater function: %w", err) - } - // SQL only supports one ON CONFLICT clause, which means StoreRecipient will key on the ACI if it's present. - // If we're adding an ACI to a PNI row, just delete the PNI row first to avoid conflicts on the PNI key. - if outRecipient.PNI != uuid.Nil && outRecipient.ACI == uuid.Nil && aci != uuid.Nil { - zerolog.Ctx(ctx).Debug(). - Stringer("aci", outRecipient.ACI). - Stringer("pni", outRecipient.PNI). - Msg("Deleting old PNI-only row before inserting row with both IDs") - err = s.DeleteRecipientByPNI(ctx, outRecipient.PNI) - if err != nil { - return fmt.Errorf("failed to delete old PNI row: %w", err) - } - } - if outRecipient.PNI == uuid.Nil && pni != uuid.Nil { - outRecipient.PNI = pni - changed = true - } - if outRecipient.ACI == uuid.Nil && aci != uuid.Nil { - outRecipient.ACI = aci - changed = true - } - if changed || len(entries) == 0 { - zerolog.Ctx(ctx).Trace(). - Stringer("aci", outRecipient.ACI). - Stringer("pni", outRecipient.PNI). - Msg("Saving recipient row") - err = s.StoreRecipient(ctx, outRecipient) - if err != nil { - return fmt.Errorf("failed to store updated recipient row: %w", err) - } - } - return nil - } else if outRecipient, err = s.mergeRecipients(ctx, entries[0], entries[1], updater); err != nil { - return fmt.Errorf("failed to merge recipient rows for ACI %s and PNI %s: %w", aci, pni, err) - } else { - return nil - } - }) - 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 { - recipient.E164 = e164 - return true, nil - } - return false, nil - }) -} -func (s *sqlStore) LoadRecipientByE164(ctx context.Context, e164 string) (*types.Recipient, error) { - return scanRecipient(s.db.QueryRow(ctx, getRecipientByPhoneQuery, s.AccountID, e164)) -} - -func (s *sqlStore) LoadAllContacts(ctx context.Context) ([]*types.Recipient, error) { - rows, err := s.db.Query(ctx, getAllRecipientsWithNameOrPhoneQuery, s.AccountID) - return dbutil.NewRowIterWithError(rows, scanRecipient, err).AsList() -} - -func (s *sqlStore) DeleteRecipientByPNI(ctx context.Context, pni uuid.UUID) error { - _, err := s.db.Exec(ctx, deleteRecipientByPNIQuery, s.AccountID, pni) - return err -} - -func nullableUUID(u uuid.UUID) uuid.NullUUID { - return uuid.NullUUID{UUID: u, Valid: u != uuid.Nil} -} - -func (s *sqlStore) StoreRecipient(ctx context.Context, recipient *types.Recipient) (err error) { - if recipient.ACI != uuid.Nil { - _, err = s.db.Exec( - ctx, - upsertACIRecipientQuery, - s.AccountID, - recipient.ACI, - nullableUUID(recipient.PNI), - recipient.E164, - recipient.ContactName, - recipient.ContactAvatar.Hash, - recipient.Nickname, - recipient.Profile.Key.Slice(), - recipient.Profile.Name, - recipient.Profile.About, - recipient.Profile.AboutEmoji, - 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, - upsertPNIRecipientQuery, - s.AccountID, - recipient.PNI, - recipient.E164, - recipient.ContactName, - recipient.ContactAvatar.Hash, - ) - } else { - err = fmt.Errorf("no ACI or PNI provided in StoreRecipient call") - } - 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..e9ffea2 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 our_aci_uuid=$1 AND sender_uuid=$2 AND sender_device_id=$3 AND distribution_id=$4` + storeSenderKeyQuery = `INSERT INTO signalmeow_sender_keys (our_aci_uuid, sender_uuid, sender_device_id, distribution_id, key_record) VALUES ($1, $2, $3, $4, $5) ON CONFLICT (our_aci_uuid, sender_uuid, sender_device_id, distribution_id) DO UPDATE SET key_record=excluded.key_record` ) func scanSenderKey(row dbutil.Scannable) (*libsignalgo.SenderKeyRecord, error) { @@ -73,7 +46,7 @@ func scanSenderKey(row dbutil.Scannable) (*libsignalgo.SenderKeyRecord, error) { return libsignalgo.DeserializeSenderKeyRecord(key) } -func (s *sqlStore) LoadSenderKey(ctx context.Context, sender *libsignalgo.Address, distributionID uuid.UUID) (*libsignalgo.SenderKeyRecord, error) { +func (s *SQLStore) LoadSenderKey(ctx context.Context, sender *libsignalgo.Address, distributionID uuid.UUID) (*libsignalgo.SenderKeyRecord, error) { senderUUID, err := sender.Name() if err != nil { return nil, fmt.Errorf("failed to get sender UUID: %w", err) @@ -82,10 +55,10 @@ func (s *sqlStore) LoadSenderKey(ctx context.Context, sender *libsignalgo.Addres if err != nil { return nil, fmt.Errorf("failed to get sender device ID: %w", err) } - return scanSenderKey(s.db.QueryRow(ctx, loadSenderKeyQuery, s.AccountID, senderUUID, deviceID, distributionID)) + return scanSenderKey(s.db.QueryRow(ctx, loadSenderKeyQuery, s.ACI, senderUUID, deviceID, distributionID)) } -func (s *sqlStore) StoreSenderKey(ctx context.Context, sender *libsignalgo.Address, distributionID uuid.UUID, record *libsignalgo.SenderKeyRecord) error { +func (s *SQLStore) StoreSenderKey(ctx context.Context, sender *libsignalgo.Address, distributionID uuid.UUID, record *libsignalgo.SenderKeyRecord) error { senderUUID, err := sender.Name() if err != nil { return fmt.Errorf("failed to get sender UUID: %w", err) @@ -98,50 +71,6 @@ func (s *sqlStore) StoreSenderKey(ctx context.Context, sender *libsignalgo.Addre if err != nil { return fmt.Errorf("failed to serialize sender key: %w", err) } - _, 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) + _, err = s.db.Exec(ctx, storeSenderKeyQuery, s.ACI, senderUUID, deviceID, distributionID, serialized) return err } diff --git a/pkg/signalmeow/store/session_store.go b/pkg/signalmeow/store/session_store.go index 3956714..5c190da 100644 --- a/pkg/signalmeow/store/session_store.go +++ b/pkg/signalmeow/store/session_store.go @@ -22,102 +22,97 @@ import ( "errors" "fmt" + "github.com/google/uuid" "go.mau.fi/util/dbutil" "go.mau.fi/mautrix-signal/pkg/libsignalgo" ) -var _ SessionStore = (*scopedSQLStore)(nil) +var _ libsignalgo.SessionStore = (*SQLStore)(nil) +var _ SessionStoreExtras = (*SQLStore)(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` - 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" + loadSessionQuery = `SELECT their_device_id, record FROM signalmeow_sessions WHERE our_aci_uuid=$1 AND their_aci_uuid=$2 AND their_device_id=$3` + storeSessionQuery = `INSERT INTO signalmeow_sessions (our_aci_uuid, their_aci_uuid, their_device_id, record) VALUES ($1, $2, $3, $4) ON CONFLICT (our_aci_uuid, their_aci_uuid, their_device_id) DO UPDATE SET record=excluded.record` + allSessionsQuery = `SELECT their_device_id, record FROM signalmeow_sessions WHERE our_aci_uuid=$1 AND their_aci_uuid=$2` + removeSessionQuery = `DELETE FROM signalmeow_sessions WHERE our_aci_uuid=$1 AND their_aci_uuid=$2 AND their_device_id=$3` ) -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) +type SessionStoreExtras interface { + // AllSessionsForUUID returns all sessions for the given UUID. + AllSessionsForUUID(ctx context.Context, theirUUID uuid.UUID) ([]*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 scanRecord(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 { - theirServiceID, err := address.Name() +func (s *SQLStore) RemoveSession(ctx context.Context, address *libsignalgo.Address) error { + theirUUID, err := address.Name() if err != nil { - return fmt.Errorf("failed to get their service ID: %w", err) + return fmt.Errorf("failed to get their UUID: %w", err) } deviceID, err := address.DeviceID() if err != nil { return fmt.Errorf("failed to get their device ID: %w", err) } - _, err = s.db.Exec(ctx, removeSessionQuery, s.AccountID, s.ServiceID, theirServiceID, deviceID) + _, err = s.db.Exec(ctx, removeSessionQuery, s.ACI, theirUUID, deviceID) return err } -func (s *scopedSQLStore) AllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) ([]SessionAddressTuple, error) { - rows, err := s.db.Query(ctx, allSessionsQuery, s.AccountID, s.ServiceID, theirID) +func (s *SQLStore) AllSessionsForUUID(ctx context.Context, theirUUID uuid.UUID) ([]*libsignalgo.Address, []*libsignalgo.SessionRecord, error) { + rows, err := s.db.Query(ctx, allSessionsQuery, s.ACI, theirUUID) if err != nil { - return nil, err + return nil, nil, err } - return dbutil.NewRowIterWithError(rows, scanSessionRecord, err).AsList() + defer rows.Close() + var records []*libsignalgo.SessionRecord + var addresses []*libsignalgo.Address + for rows.Next() { + deviceId, record, err := scanRecord(rows) + if err != nil { + return nil, nil, err + } + records = append(records, record) + address, err := libsignalgo.NewUUIDAddress(theirUUID, uint(deviceId)) + if err != nil { + return nil, nil, err + } + addresses = append(addresses, address) + } + return addresses, records, rows.Err() } -func (s *scopedSQLStore) RemoveAllSessionsForServiceID(ctx context.Context, theirID libsignalgo.ServiceID) error { - _, err := s.db.Exec(ctx, removeSessionsForRecipientQuery, s.AccountID, theirID) - return err -} - -func (s *scopedSQLStore) LoadSession(ctx context.Context, address *libsignalgo.Address) (*libsignalgo.SessionRecord, error) { - theirServiceID, err := address.Name() +func (s *SQLStore) LoadSession(ctx context.Context, address *libsignalgo.Address) (*libsignalgo.SessionRecord, error) { + theirUUID, err := address.Name() if err != nil { - return nil, fmt.Errorf("failed to get their service ID: %w", err) + return nil, fmt.Errorf("failed to get their UUID: %w", err) } deviceID, err := address.DeviceID() 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 := scanRecord(s.db.QueryRow(ctx, loadSessionQuery, s.ACI, theirUUID, deviceID)) + return record, err } -func (s *scopedSQLStore) StoreSession(ctx context.Context, address *libsignalgo.Address, record *libsignalgo.SessionRecord) error { - theirServiceID, err := address.Name() +func (s *SQLStore) StoreSession(ctx context.Context, address *libsignalgo.Address, record *libsignalgo.SessionRecord) error { + theirUUID, err := address.Name() if err != nil { - return fmt.Errorf("failed to get their service ID: %w", err) + return fmt.Errorf("failed to get their UUID: %w", err) } deviceID, err := address.DeviceID() if err != nil { @@ -127,11 +122,11 @@ func (s *scopedSQLStore) StoreSession(ctx context.Context, address *libsignalgo. if err != nil { return fmt.Errorf("failed to serialize session record: %w", err) } - _, err = s.db.Exec(ctx, storeSessionQuery, s.AccountID, s.ServiceID, theirServiceID, deviceID, serialized) + _, err = s.db.Exec(ctx, storeSessionQuery, s.ACI, theirUUID, deviceID, serialized) return err } -func (s *scopedSQLStore) RemoveAllSessions(ctx context.Context) error { - _, err := s.db.Exec(ctx, deleteAllSessionsQuery, s.AccountID) +func (s *SQLStore) RemoveAllSessions(ctx context.Context) error { + _, err := s.db.Exec(ctx, "DELETE FROM signalmeow_sessions WHERE our_aci_uuid=$1", s.ACI) return err } diff --git a/pkg/signalmeow/store/upgrades/00-latest.sql b/pkg/signalmeow/store/upgrades/00-latest.sql index fbb44ad..73d0270 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 -> v6: Latest revision CREATE TABLE signalmeow_device ( aci_uuid TEXT PRIMARY KEY, @@ -11,186 +11,95 @@ CREATE TABLE signalmeow_device ( device_id INTEGER NOT NULL, number TEXT NOT NULL DEFAULT '', - password TEXT NOT NULL DEFAULT '', - - master_key bytea, - account_record bytea, - account_entropy_pool TEXT, - ephemeral_backup_key bytea, - media_root_backup_key bytea + password TEXT NOT NULL DEFAULT '' ); CREATE TABLE signalmeow_pre_keys ( - account_id TEXT NOT NULL, - service_id TEXT NOT NULL, - key_id INTEGER NOT NULL, - is_signed BOOLEAN NOT NULL, - key_pair bytea NOT NULL, + aci_uuid TEXT NOT NULL, + key_id INTEGER NOT NULL, + uuid_kind TEXT NOT NULL, + is_signed BOOLEAN NOT NULL, + key_pair bytea NOT NULL, + uploaded BOOLEAN NOT NULL, - PRIMARY KEY (account_id, service_id, key_id, is_signed), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); - -CREATE TABLE signalmeow_kyber_pre_keys ( - account_id TEXT NOT NULL, - service_id TEXT NOT NULL, - key_id INTEGER NOT NULL, - key_pair bytea NOT NULL, - is_last_resort BOOLEAN NOT NULL, - - PRIMARY KEY (account_id, service_id, key_id), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE + PRIMARY KEY (aci_uuid, uuid_kind, is_signed, key_id), + FOREIGN KEY (aci_uuid) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE signalmeow_identity_keys ( - account_id TEXT NOT NULL, - their_service_id TEXT NOT NULL, - key bytea NOT NULL, - trust_level TEXT NOT NULL, + our_aci_uuid TEXT NOT NULL, + their_aci_uuid TEXT NOT NULL, + their_device_id INTEGER NOT NULL, + key bytea NOT NULL, + trust_level TEXT NOT NULL, - PRIMARY KEY (account_id, their_service_id), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE + PRIMARY KEY (our_aci_uuid, their_aci_uuid, their_device_id), + FOREIGN KEY (our_aci_uuid) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE signalmeow_sessions ( - account_id TEXT NOT NULL, - service_id TEXT NOT NULL, - their_service_id TEXT NOT NULL, - their_device_id INTEGER NOT NULL, - record bytea NOT NULL, + our_aci_uuid TEXT NOT NULL, + their_aci_uuid TEXT NOT NULL, + their_device_id INTEGER NOT NULL, + record bytea NOT NULL, - PRIMARY KEY (account_id, service_id, their_service_id, their_device_id), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); - -CREATE TABLE signalmeow_event_buffer ( - account_id TEXT NOT NULL, - ciphertext_hash bytea NOT NULL, - plaintext bytea, - server_timestamp BIGINT NOT NULL, - insert_timestamp BIGINT NOT NULL, - - PRIMARY KEY (account_id, ciphertext_hash), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE + PRIMARY KEY (our_aci_uuid, their_aci_uuid, their_device_id), + FOREIGN KEY (our_aci_uuid) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE signalmeow_profile_keys ( - account_id TEXT NOT NULL, + our_aci_uuid TEXT NOT NULL, their_aci_uuid TEXT NOT NULL, key bytea NOT NULL, - PRIMARY KEY (account_id, their_aci_uuid), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE + PRIMARY KEY (our_aci_uuid, their_aci_uuid), + FOREIGN KEY (our_aci_uuid) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE signalmeow_sender_keys ( - account_id TEXT NOT NULL, - sender_uuid TEXT NOT NULL, -- note: this may actually be a service id + our_aci_uuid TEXT NOT NULL, + sender_uuid TEXT NOT NULL, sender_device_id INTEGER NOT NULL, distribution_id TEXT NOT NULL, key_record bytea NOT NULL, - PRIMARY KEY (account_id, sender_uuid, sender_device_id, distribution_id), - 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 + PRIMARY KEY (our_aci_uuid, sender_uuid, sender_device_id, distribution_id), + FOREIGN KEY (our_aci_uuid) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); CREATE TABLE signalmeow_groups ( - account_id TEXT NOT NULL, + our_aci_uuid 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 (our_aci_uuid, group_identifier) ); -CREATE TABLE signalmeow_recipients ( - account_id TEXT NOT NULL, - aci_uuid TEXT, - pni_uuid TEXT, - e164_number TEXT NOT NULL DEFAULT '', - contact_name TEXT NOT NULL DEFAULT '', - contact_avatar_hash TEXT NOT NULL DEFAULT '', - nickname TEXT NOT NULL DEFAULT '', +CREATE TABLE signalmeow_contacts ( + our_aci_uuid TEXT NOT NULL, + aci_uuid TEXT NOT NULL, + -- TODO make all fields not null + e164_number TEXT, + contact_name TEXT, + contact_avatar_hash TEXT, profile_key bytea, - profile_name TEXT NOT NULL DEFAULT '', - profile_about TEXT NOT NULL DEFAULT '', - profile_about_emoji TEXT NOT NULL DEFAULT '', - 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, + profile_name TEXT, + profile_about TEXT, + profile_about_emoji TEXT, + profile_avatar_path TEXT NOT NULL DEFAULT '', + profile_avatar_hash TEXT, - CONSTRAINT signalmeow_contacts_account_id_fkey FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) - ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_contacts_aci_unique UNIQUE (account_id, aci_uuid), - CONSTRAINT signalmeow_contacts_pni_unique UNIQUE (account_id, pni_uuid) + PRIMARY KEY (our_aci_uuid, aci_uuid), + FOREIGN KEY (our_aci_uuid) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); -CREATE TABLE signalmeow_unregistered_users ( - aci_uuid uuid PRIMARY KEY +CREATE TABLE signalmeow_kyber_pre_keys ( + aci_uuid TEXT NOT NULL, + key_id INTEGER NOT NULL, + uuid_kind TEXT NOT NULL, + key_pair bytea NOT NULL, + is_last_resort BOOLEAN NOT NULL, + + PRIMARY KEY (aci_uuid, uuid_kind, key_id), + FOREIGN KEY (aci_uuid) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE ); - -CREATE TABLE signalmeow_backup_recipient ( - account_id TEXT NOT NULL, - recipient_id BIGINT NOT NULL, - - aci_uuid TEXT, - pni_uuid TEXT, - - group_master_key TEXT, - - data bytea NOT NULL, - - PRIMARY KEY (account_id, recipient_id), - CONSTRAINT signalmeow_backup_recipient_device_fkey FOREIGN KEY (account_id) - REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE INDEX signalmeow_backup_recipient_group_idx ON signalmeow_backup_recipient (account_id, group_master_key); -CREATE INDEX signalmeow_backup_recipient_aci_idx ON signalmeow_backup_recipient (account_id, aci_uuid); - -CREATE TABLE signalmeow_backup_chat ( - account_id TEXT NOT NULL, - chat_id BIGINT NOT NULL, - recipient_id BIGINT NOT NULL, - data bytea NOT NULL, - - latest_message_id BIGINT, - total_message_count INTEGER, - - PRIMARY KEY (account_id, chat_id), - CONSTRAINT signalmeow_backup_chat_device_fkey FOREIGN KEY (account_id) - REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_backup_chat_recipient_fkey FOREIGN KEY (account_id, recipient_id) - REFERENCES signalmeow_backup_recipient (account_id, recipient_id) ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE INDEX signalmeow_backup_chat_recipient_id_idx ON signalmeow_backup_chat (account_id, recipient_id); - -CREATE TABLE signalmeow_backup_message ( - account_id TEXT NOT NULL, - chat_id BIGINT NOT NULL, - sender_id BIGINT NOT NULL, - message_id BIGINT NOT NULL, - data bytea NOT NULL, - - PRIMARY KEY (account_id, sender_id, message_id), - CONSTRAINT signalmeow_backup_message_chat_fkey FOREIGN KEY (account_id, chat_id) - REFERENCES signalmeow_backup_chat (account_id, chat_id) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_backup_message_sender_fkey FOREIGN KEY (account_id, sender_id) - REFERENCES signalmeow_backup_recipient (account_id, recipient_id) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_backup_message_device_fkey FOREIGN KEY (account_id) - REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE INDEX signalmeow_backup_message_chat_id_idx ON signalmeow_backup_message (account_id, chat_id); diff --git a/pkg/signalmeow/store/upgrades/08-profile-fetch-time.sql b/pkg/signalmeow/store/upgrades/08-profile-fetch-time.sql deleted file mode 100644 index 414245c..0000000 --- a/pkg/signalmeow/store/upgrades/08-profile-fetch-time.sql +++ /dev/null @@ -1,11 +0,0 @@ --- v6 -> v8: Add profile_fetched_at and make other columns not null -ALTER TABLE signalmeow_contacts DROP COLUMN profile_avatar_hash; -ALTER TABLE signalmeow_contacts ADD COLUMN profile_fetched_at BIGINT; --- only: postgres until "end only" -ALTER TABLE signalmeow_contacts ALTER COLUMN e164_number SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN contact_name SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN contact_avatar_hash SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_name SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_about SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_about_emoji SET NOT NULL; --- end only postgres diff --git a/pkg/signalmeow/store/upgrades/08-resync-schema-449.sql b/pkg/signalmeow/store/upgrades/08-resync-schema-449.sql deleted file mode 100644 index 95af775..0000000 --- a/pkg/signalmeow/store/upgrades/08-resync-schema-449.sql +++ /dev/null @@ -1,12 +0,0 @@ --- v7 -> v8: Migration from https://github.com/mautrix/signal/pull/449 to match the new v8 upgrade -ALTER TABLE signalmeow_contacts DROP COLUMN profile_avatar_hash; -ALTER TABLE signalmeow_contacts RENAME COLUMN profile_fetch_ts TO profile_fetched_at; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_fetched_at DROP DEFAULT; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_fetched_at DROP NOT NULL; -UPDATE signalmeow_contacts SET profile_fetched_at = NULL WHERE profile_fetched_at <= 0; -ALTER TABLE signalmeow_contacts ALTER COLUMN e164_number SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN contact_name SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN contact_avatar_hash SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_name SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_about SET NOT NULL; -ALTER TABLE signalmeow_contacts ALTER COLUMN profile_about_emoji SET NOT NULL; diff --git a/pkg/signalmeow/store/upgrades/09-pni-sending.sql b/pkg/signalmeow/store/upgrades/09-pni-sending.sql deleted file mode 100644 index d3c1cb4..0000000 --- a/pkg/signalmeow/store/upgrades/09-pni-sending.sql +++ /dev/null @@ -1,3 +0,0 @@ --- v9: Add support for sending to PNIs -ALTER TABLE signalmeow_sessions RENAME COLUMN their_aci_uuid TO their_service_id; -ALTER TABLE signalmeow_identity_keys RENAME COLUMN their_aci_uuid TO their_service_id; diff --git a/pkg/signalmeow/store/upgrades/10-prekey-store-service-id.postgres.sql b/pkg/signalmeow/store/upgrades/10-prekey-store-service-id.postgres.sql deleted file mode 100644 index c4d913d..0000000 --- a/pkg/signalmeow/store/upgrades/10-prekey-store-service-id.postgres.sql +++ /dev/null @@ -1,31 +0,0 @@ --- v10: Change prekey store to use service IDs instead of UUID kind column -ALTER TABLE signalmeow_pre_keys ADD COLUMN service_id TEXT; -UPDATE signalmeow_pre_keys SET service_id=aci_uuid WHERE uuid_kind='aci'; -UPDATE signalmeow_pre_keys SET service_id='PNI:' || ( - SELECT pni_uuid FROM signalmeow_device WHERE signalmeow_device.aci_uuid=signalmeow_pre_keys.aci_uuid -) WHERE uuid_kind='pni'; -ALTER TABLE signalmeow_pre_keys ALTER COLUMN service_id SET NOT NULL; -ALTER TABLE signalmeow_pre_keys DROP CONSTRAINT signalmeow_pre_keys_pkey; -ALTER TABLE signalmeow_pre_keys DROP COLUMN uuid_kind; -ALTER TABLE signalmeow_pre_keys RENAME COLUMN aci_uuid TO account_id; -ALTER TABLE signalmeow_pre_keys ADD PRIMARY KEY (account_id, service_id, is_signed, key_id); - -ALTER TABLE signalmeow_pre_keys DROP COLUMN uploaded; - -ALTER TABLE signalmeow_kyber_pre_keys ADD COLUMN service_id TEXT; -UPDATE signalmeow_kyber_pre_keys SET service_id=aci_uuid WHERE uuid_kind='aci'; -UPDATE signalmeow_kyber_pre_keys SET service_id='PNI:' || ( - SELECT pni_uuid FROM signalmeow_device WHERE signalmeow_device.aci_uuid=signalmeow_kyber_pre_keys.aci_uuid -) WHERE uuid_kind='pni'; -ALTER TABLE signalmeow_kyber_pre_keys ALTER COLUMN service_id SET NOT NULL; -ALTER TABLE signalmeow_kyber_pre_keys DROP CONSTRAINT signalmeow_kyber_pre_keys_pkey; -ALTER TABLE signalmeow_kyber_pre_keys DROP COLUMN uuid_kind; -ALTER TABLE signalmeow_kyber_pre_keys RENAME COLUMN aci_uuid TO account_id; -ALTER TABLE signalmeow_kyber_pre_keys ADD PRIMARY KEY (account_id, service_id, key_id); - -ALTER TABLE signalmeow_sessions ADD COLUMN service_id TEXT; -UPDATE signalmeow_sessions SET service_id=our_aci_uuid; -- there are no PNI sessions yet -ALTER TABLE signalmeow_sessions ALTER COLUMN service_id SET NOT NULL; -ALTER TABLE signalmeow_sessions DROP CONSTRAINT signalmeow_sessions_pkey; -ALTER TABLE signalmeow_sessions RENAME COLUMN our_aci_uuid TO account_id; -ALTER TABLE signalmeow_sessions ADD PRIMARY KEY (account_id, service_id, their_service_id, their_device_id); diff --git a/pkg/signalmeow/store/upgrades/10-prekey-store-service-id.sqlite.sql b/pkg/signalmeow/store/upgrades/10-prekey-store-service-id.sqlite.sql deleted file mode 100644 index 25b2824..0000000 --- a/pkg/signalmeow/store/upgrades/10-prekey-store-service-id.sqlite.sql +++ /dev/null @@ -1,59 +0,0 @@ --- v10: Change prekey store to use service IDs instead of UUID kind column -CREATE TABLE new_signalmeow_pre_keys ( - account_id TEXT NOT NULL, - service_id TEXT NOT NULL, - key_id INTEGER NOT NULL, - is_signed BOOLEAN NOT NULL, - key_pair bytea NOT NULL, - - PRIMARY KEY (account_id, service_id, is_signed, key_id), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); - -INSERT INTO new_signalmeow_pre_keys (account_id, service_id, key_id, is_signed, key_pair) -SELECT aci_uuid, CASE WHEN uuid_kind='pni' THEN 'PNI:'||( - SELECT pni_uuid FROM signalmeow_device WHERE signalmeow_device.aci_uuid=signalmeow_pre_keys.aci_uuid -) ELSE aci_uuid END, key_id, is_signed, key_pair -FROM signalmeow_pre_keys; - -DROP TABLE signalmeow_pre_keys; -ALTER TABLE new_signalmeow_pre_keys RENAME TO signalmeow_pre_keys; - - -CREATE TABLE new_signalmeow_kyber_pre_keys ( - account_id TEXT NOT NULL, - service_id TEXT NOT NULL, - key_id INTEGER NOT NULL, - key_pair bytea NOT NULL, - is_last_resort BOOLEAN NOT NULL, - - PRIMARY KEY (account_id, service_id, key_id), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); - -INSERT INTO new_signalmeow_kyber_pre_keys (account_id, service_id, key_id, key_pair, is_last_resort) -SELECT aci_uuid, CASE WHEN uuid_kind='pni' THEN 'PNI:'||( - SELECT pni_uuid FROM signalmeow_device WHERE signalmeow_device.aci_uuid=signalmeow_kyber_pre_keys.aci_uuid -) ELSE aci_uuid END, key_id, key_pair, is_last_resort -FROM signalmeow_kyber_pre_keys; - -DROP TABLE signalmeow_kyber_pre_keys; -ALTER TABLE new_signalmeow_kyber_pre_keys RENAME TO signalmeow_kyber_pre_keys; - - -CREATE TABLE new_signalmeow_sessions ( - account_id TEXT NOT NULL, - service_id TEXT NOT NULL, - their_service_id TEXT NOT NULL, - their_device_id INTEGER NOT NULL, - record bytea NOT NULL, - - PRIMARY KEY (account_id, service_id, their_service_id, their_device_id), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); -INSERT INTO new_signalmeow_sessions (account_id, service_id, their_service_id, their_device_id, record) -SELECT our_aci_uuid, our_aci_uuid, their_service_id, their_device_id, record -FROM signalmeow_sessions; - -DROP TABLE signalmeow_sessions; -ALTER TABLE new_signalmeow_sessions RENAME TO signalmeow_sessions; diff --git a/pkg/signalmeow/store/upgrades/11-aci-to-account-id.sql b/pkg/signalmeow/store/upgrades/11-aci-to-account-id.sql deleted file mode 100644 index 88974a6..0000000 --- a/pkg/signalmeow/store/upgrades/11-aci-to-account-id.sql +++ /dev/null @@ -1,6 +0,0 @@ --- v11: Rename our_aci_uuid columns to account_id -ALTER TABLE signalmeow_identity_keys RENAME COLUMN our_aci_uuid TO account_id; -ALTER TABLE signalmeow_profile_keys RENAME COLUMN our_aci_uuid TO account_id; -ALTER TABLE signalmeow_sender_keys RENAME COLUMN our_aci_uuid TO account_id; -ALTER TABLE signalmeow_groups RENAME COLUMN our_aci_uuid TO account_id; -ALTER TABLE signalmeow_contacts RENAME COLUMN our_aci_uuid TO account_id; diff --git a/pkg/signalmeow/store/upgrades/12-drop-identity-key-device-id.postgres.sql b/pkg/signalmeow/store/upgrades/12-drop-identity-key-device-id.postgres.sql deleted file mode 100644 index 8625f12..0000000 --- a/pkg/signalmeow/store/upgrades/12-drop-identity-key-device-id.postgres.sql +++ /dev/null @@ -1,5 +0,0 @@ --- v12: Drop their_device_id column in signalmeow_identity_keys table -DELETE FROM signalmeow_identity_keys WHERE their_device_id<>1; -ALTER TABLE signalmeow_identity_keys DROP CONSTRAINT signalmeow_identity_keys_pkey; -ALTER TABLE signalmeow_identity_keys DROP COLUMN their_device_id; -ALTER TABLE signalmeow_identity_keys ADD PRIMARY KEY (account_id, their_service_id); diff --git a/pkg/signalmeow/store/upgrades/12-drop-identity-key-device-id.sqlite.sql b/pkg/signalmeow/store/upgrades/12-drop-identity-key-device-id.sqlite.sql deleted file mode 100644 index 396862f..0000000 --- a/pkg/signalmeow/store/upgrades/12-drop-identity-key-device-id.sqlite.sql +++ /dev/null @@ -1,19 +0,0 @@ --- v12: Drop their_device_id column in signalmeow_identity_keys table -CREATE TABLE new_signalmeow_identity_keys ( - account_id TEXT NOT NULL, - their_service_id TEXT NOT NULL, - key bytea NOT NULL, - trust_level TEXT NOT NULL, - - PRIMARY KEY (account_id, their_service_id), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); - -INSERT INTO new_signalmeow_identity_keys (account_id, their_service_id, key, trust_level) -SELECT account_id, their_service_id, key, trust_level -FROM signalmeow_identity_keys -WHERE their_device_id=1; - -DROP TABLE signalmeow_identity_keys; - -ALTER TABLE new_signalmeow_identity_keys RENAME TO signalmeow_identity_keys; diff --git a/pkg/signalmeow/store/upgrades/13-recipients-table.postgres.sql b/pkg/signalmeow/store/upgrades/13-recipients-table.postgres.sql deleted file mode 100644 index 181807c..0000000 --- a/pkg/signalmeow/store/upgrades/13-recipients-table.postgres.sql +++ /dev/null @@ -1,22 +0,0 @@ --- v13: Add PNIs to recipient table and merge profile keys -ALTER TABLE signalmeow_contacts DROP CONSTRAINT signalmeow_contacts_pkey; -ALTER TABLE signalmeow_contacts RENAME TO signalmeow_recipients; -ALTER TABLE signalmeow_recipients ADD COLUMN pni_uuid TEXT; -ALTER TABLE signalmeow_recipients ALTER COLUMN aci_uuid DROP NOT NULL; -ALTER TABLE signalmeow_recipients ADD CONSTRAINT signalmeow_contacts_aci_unique UNIQUE (account_id, aci_uuid); -ALTER TABLE signalmeow_recipients ADD CONSTRAINT signalmeow_contacts_pni_unique UNIQUE (account_id, pni_uuid); - -ALTER TABLE signalmeow_recipients ALTER COLUMN e164_number SET DEFAULT ''; -ALTER TABLE signalmeow_recipients ALTER COLUMN contact_name SET DEFAULT ''; -ALTER TABLE signalmeow_recipients ALTER COLUMN contact_avatar_hash SET DEFAULT ''; -ALTER TABLE signalmeow_recipients ALTER COLUMN profile_name SET DEFAULT ''; -ALTER TABLE signalmeow_recipients ALTER COLUMN profile_about SET DEFAULT ''; -ALTER TABLE signalmeow_recipients ALTER COLUMN profile_about_emoji SET DEFAULT ''; -ALTER TABLE signalmeow_recipients ALTER COLUMN profile_avatar_path SET DEFAULT ''; - -INSERT INTO signalmeow_recipients (account_id, aci_uuid, profile_key) -SELECT account_id, their_aci_uuid, key -FROM signalmeow_profile_keys -ON CONFLICT (account_id, aci_uuid) DO UPDATE SET profile_key=excluded.profile_key; - -DROP TABLE signalmeow_profile_keys; diff --git a/pkg/signalmeow/store/upgrades/13-recipients-table.sqlite.sql b/pkg/signalmeow/store/upgrades/13-recipients-table.sqlite.sql deleted file mode 100644 index 4060685..0000000 --- a/pkg/signalmeow/store/upgrades/13-recipients-table.sqlite.sql +++ /dev/null @@ -1,37 +0,0 @@ --- v13: Add PNIs to recipient table and merge profile keys -CREATE TABLE signalmeow_recipients ( - account_id TEXT NOT NULL, - aci_uuid TEXT, - pni_uuid TEXT, - e164_number TEXT NOT NULL DEFAULT '', - contact_name TEXT NOT NULL DEFAULT '', - contact_avatar_hash TEXT NOT NULL DEFAULT '', - profile_key bytea, - profile_name TEXT NOT NULL DEFAULT '', - profile_about TEXT NOT NULL DEFAULT '', - profile_about_emoji TEXT NOT NULL DEFAULT '', - profile_avatar_path TEXT NOT NULL DEFAULT '', - profile_fetched_at BIGINT, - - CONSTRAINT signalmeow_contacts_account_id_fkey FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) - ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_contacts_aci_unique UNIQUE (account_id, aci_uuid), - CONSTRAINT signalmeow_contacts_pni_unique UNIQUE (account_id, pni_uuid) -); - -INSERT INTO signalmeow_recipients ( - account_id, aci_uuid, e164_number, contact_name, contact_avatar_hash, profile_key, profile_name, - profile_about, profile_about_emoji, profile_avatar_path, profile_fetched_at -) -SELECT account_id, aci_uuid, e164_number, contact_name, contact_avatar_hash, profile_key, profile_name, - profile_about, profile_about_emoji, profile_avatar_path, profile_fetched_at -FROM signalmeow_contacts; - -INSERT INTO signalmeow_recipients (account_id, aci_uuid, profile_key) -SELECT account_id, their_aci_uuid, key -FROM signalmeow_profile_keys -WHERE true -- https://sqlite.org/lang_upsert.html#parsing_ambiguity -ON CONFLICT (account_id, aci_uuid) DO UPDATE SET profile_key=excluded.profile_key; - -DROP TABLE signalmeow_contacts; -DROP TABLE signalmeow_profile_keys; diff --git a/pkg/signalmeow/store/upgrades/14-save-storage-master-key.sql b/pkg/signalmeow/store/upgrades/14-save-storage-master-key.sql deleted file mode 100644 index 6c75ed1..0000000 --- a/pkg/signalmeow/store/upgrades/14-save-storage-master-key.sql +++ /dev/null @@ -1,2 +0,0 @@ --- v14 (compatible with v13+): Save storage master key for devices -ALTER TABLE signalmeow_device ADD COLUMN master_key bytea; diff --git a/pkg/signalmeow/store/upgrades/15-needs-pni-signature.sql b/pkg/signalmeow/store/upgrades/15-needs-pni-signature.sql deleted file mode 100644 index 26d854a..0000000 --- a/pkg/signalmeow/store/upgrades/15-needs-pni-signature.sql +++ /dev/null @@ -1,2 +0,0 @@ --- v15 (compatible with v13+): Store flag for recipients who need a PNI signature -ALTER TABLE signalmeow_recipients ADD COLUMN needs_pni_signature boolean DEFAULT false; diff --git a/pkg/signalmeow/store/upgrades/16-remove-extra-prekeys.go b/pkg/signalmeow/store/upgrades/16-remove-extra-prekeys.go deleted file mode 100644 index 44c70c2..0000000 --- a/pkg/signalmeow/store/upgrades/16-remove-extra-prekeys.go +++ /dev/null @@ -1,79 +0,0 @@ -// mautrix-signal - A Matrix-signal puppeting bridge. -// Copyright (C) 2024 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 upgrades - -import ( - "context" - "fmt" - - "github.com/rs/zerolog" - "go.mau.fi/util/dbutil" -) - -type PreKeyCounts struct { - AccountID string - ServiceID string - Count int - MaxID int -} - -func scanPreKeyCounts(row dbutil.Scannable) (*PreKeyCounts, error) { - var pkc PreKeyCounts - return dbutil.ValueOrErr(&pkc, row.Scan(&pkc.AccountID, &pkc.ServiceID, &pkc.Count, &pkc.MaxID)) -} - -func deleteExtraPrekeys(ctx context.Context, db *dbutil.Database, selectQuery, deleteQuery string) error { - preKeys, err := dbutil.ConvertRowFn[*PreKeyCounts](scanPreKeyCounts).NewRowIter(db.Query(ctx, selectQuery)).AsList() - if err != nil { - return fmt.Errorf("failed to query prekey counts: %w", err) - } - for _, pkc := range preKeys { - if pkc.Count > 250 { - zerolog.Ctx(ctx).Debug(). - Str("account_id", pkc.AccountID). - Str("service_id", pkc.ServiceID). - Int("max_id", pkc.MaxID). - Int("count", pkc.Count). - Msg("Too many prekeys, deleting all") - _, err = db.Exec(ctx, deleteQuery, pkc.AccountID, pkc.ServiceID, pkc.MaxID-95) - if err != nil { - return fmt.Errorf("failed to delete extra prekeys for %s/%s: %w", pkc.AccountID, pkc.ServiceID, err) - } - } - } - return nil -} - -var upgradeV16 = dbutil.WrapUpgrade(-1, 16, 13, "Remove extra prekeys", dbutil.TxnModeOn, func(ctx context.Context, db *dbutil.Database) error { - err := deleteExtraPrekeys(ctx, db, ` - SELECT account_id, service_id, COUNT(*), MAX(key_id) FROM signalmeow_pre_keys WHERE is_signed=false GROUP BY 1, 2 - `, ` - DELETE FROM signalmeow_pre_keys WHERE account_id=$1 AND service_id=$2 AND is_signed=false AND key_id<$3 - `) - if err != nil { - return fmt.Errorf("failed to process EC: %w", err) - } - err = deleteExtraPrekeys(ctx, db, ` - SELECT account_id, service_id, COUNT(*), MAX(key_id) FROM signalmeow_kyber_pre_keys WHERE is_last_resort=false GROUP BY 1, 2 - `, ` - DELETE FROM signalmeow_kyber_pre_keys WHERE account_id=$1 AND service_id=$2 AND is_last_resort=false AND key_id<$3 - `) - if err != nil { - return fmt.Errorf("failed to process kyber: %w", err) - } - return nil -}) diff --git a/pkg/signalmeow/store/upgrades/17-store-account-record.sql b/pkg/signalmeow/store/upgrades/17-store-account-record.sql deleted file mode 100644 index 6d8b0db..0000000 --- a/pkg/signalmeow/store/upgrades/17-store-account-record.sql +++ /dev/null @@ -1,2 +0,0 @@ --- v17 (compatible with v13+): Store account config -ALTER TABLE signalmeow_device ADD COLUMN account_record bytea; diff --git a/pkg/signalmeow/store/upgrades/18-store-backup-keys.sql b/pkg/signalmeow/store/upgrades/18-store-backup-keys.sql deleted file mode 100644 index e478324..0000000 --- a/pkg/signalmeow/store/upgrades/18-store-backup-keys.sql +++ /dev/null @@ -1,4 +0,0 @@ --- v18 (compatible with v13+): Store account entropy pool and ephemeral backup keys -ALTER TABLE signalmeow_device ADD COLUMN account_entropy_pool TEXT; -ALTER TABLE signalmeow_device ADD COLUMN ephemeral_backup_key bytea; -ALTER TABLE signalmeow_device ADD COLUMN media_root_backup_key bytea; diff --git a/pkg/signalmeow/store/upgrades/19-store-backup-data.sql b/pkg/signalmeow/store/upgrades/19-store-backup-data.sql deleted file mode 100644 index 6354ef8..0000000 --- a/pkg/signalmeow/store/upgrades/19-store-backup-data.sql +++ /dev/null @@ -1,52 +0,0 @@ --- v19 (compatible with v13+): Add tables for caching parsed backup data -CREATE TABLE signalmeow_backup_recipient ( - account_id TEXT NOT NULL, - recipient_id BIGINT NOT NULL, - - aci_uuid TEXT, - pni_uuid TEXT, - - group_master_key TEXT, - - data bytea NOT NULL, - - PRIMARY KEY (account_id, recipient_id), - CONSTRAINT signalmeow_backup_recipient_device_fkey FOREIGN KEY (account_id) - REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE INDEX signalmeow_backup_recipient_group_idx ON signalmeow_backup_recipient (account_id, group_master_key); -CREATE INDEX signalmeow_backup_recipient_aci_idx ON signalmeow_backup_recipient (account_id, aci_uuid); - -CREATE TABLE signalmeow_backup_chat ( - account_id TEXT NOT NULL, - chat_id BIGINT NOT NULL, - recipient_id BIGINT NOT NULL, - data bytea NOT NULL, - - latest_message_id BIGINT, - total_message_count INTEGER, - - PRIMARY KEY (account_id, chat_id), - CONSTRAINT signalmeow_backup_chat_device_fkey FOREIGN KEY (account_id) - REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_backup_chat_recipient_fkey FOREIGN KEY (account_id, recipient_id) - REFERENCES signalmeow_backup_recipient (account_id, recipient_id) ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE INDEX signalmeow_backup_chat_recipient_id_idx ON signalmeow_backup_chat (account_id, recipient_id); - -CREATE TABLE signalmeow_backup_message ( - account_id TEXT NOT NULL, - chat_id BIGINT NOT NULL, - sender_id BIGINT NOT NULL, - message_id BIGINT NOT NULL, - data bytea NOT NULL, - - PRIMARY KEY (account_id, sender_id, message_id), - CONSTRAINT signalmeow_backup_message_chat_fkey FOREIGN KEY (account_id, chat_id) - REFERENCES signalmeow_backup_chat (account_id, chat_id) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_backup_message_sender_fkey FOREIGN KEY (account_id, sender_id) - REFERENCES signalmeow_backup_recipient (account_id, recipient_id) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT signalmeow_backup_message_device_fkey FOREIGN KEY (account_id) - REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); -CREATE INDEX signalmeow_backup_message_chat_id_idx ON signalmeow_backup_message (account_id, chat_id); diff --git a/pkg/signalmeow/store/upgrades/21-event-buffer.sql b/pkg/signalmeow/store/upgrades/21-event-buffer.sql deleted file mode 100644 index bfc289a..0000000 --- a/pkg/signalmeow/store/upgrades/21-event-buffer.sql +++ /dev/null @@ -1,11 +0,0 @@ --- v21 (compatible with v13+): Add event buffer -CREATE TABLE signalmeow_event_buffer ( - account_id TEXT NOT NULL, - ciphertext_hash bytea NOT NULL, - plaintext bytea, - server_timestamp BIGINT NOT NULL, - insert_timestamp BIGINT NOT NULL, - - PRIMARY KEY (account_id, ciphertext_hash), - FOREIGN KEY (account_id) REFERENCES signalmeow_device (aci_uuid) ON DELETE CASCADE ON UPDATE CASCADE -); diff --git a/pkg/signalmeow/store/upgrades/22-recipient-nickname.sql b/pkg/signalmeow/store/upgrades/22-recipient-nickname.sql deleted file mode 100644 index 437cb33..0000000 --- a/pkg/signalmeow/store/upgrades/22-recipient-nickname.sql +++ /dev/null @@ -1,2 +0,0 @@ --- v22 (compatible with v13+): Store Signal-specific nickname of contacts -ALTER TABLE signalmeow_recipients ADD COLUMN nickname TEXT NOT NULL DEFAULT ''; 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/store/upgrades/upgrades.go b/pkg/signalmeow/store/upgrades/upgrades.go index f9e6350..19a6414 100644 --- a/pkg/signalmeow/store/upgrades/upgrades.go +++ b/pkg/signalmeow/store/upgrades/upgrades.go @@ -22,11 +22,11 @@ import ( "go.mau.fi/util/dbutil" ) +var Table dbutil.UpgradeTable + //go:embed *.sql var rawUpgrades embed.FS -var Table = dbutil.BuildUpgradeTable(). - WithFS(rawUpgrades). - With(upgradeV16). - With(upgradeV20). - Finish() +func init() { + Table.RegisterFS(rawUpgrades) +} diff --git a/pkg/signalmeow/types/contact.go b/pkg/signalmeow/types/contact.go index 889dd3e..11a73fb 100644 --- a/pkg/signalmeow/types/contact.go +++ b/pkg/signalmeow/types/contact.go @@ -17,50 +17,27 @@ package types import ( - "time" - "github.com/google/uuid" "go.mau.fi/mautrix-signal/pkg/libsignalgo" ) -type Profile struct { - Name string - About string - AboutEmoji string - AvatarPath string - Key libsignalgo.ProfileKey - FetchedAt time.Time - Credential []byte -} - -func (p *Profile) Equals(other *Profile) bool { - return p.Name == other.Name && - p.About == other.About && - p.AboutEmoji == other.AboutEmoji && - p.AvatarPath == other.AvatarPath && - p.Key == other.Key -} - -// The Recipient struct combines information from two sources: +// The Contact struct combines information from two sources: // - A Signal "contact": contact info harvested from our user's phone's contact list // - A Signal "profile": contact info entered by the target user when registering for Signal -type Recipient struct { - ACI uuid.UUID - PNI uuid.UUID - E164 string - ContactName string - ContactAvatar ContactAvatar - Nickname string - Profile Profile - - NeedsPNISignature bool - Blocked bool - Whitelisted *bool -} - -func (r *Recipient) ProbablyMessageRequest() bool { - return r != nil && (r.NeedsPNISignature || (r.Whitelisted != nil && !*r.Whitelisted)) +// Users of this Contact struct should prioritize "contact" information, but fall back +// to "profile" information if the contact information is not available. +type Contact struct { + UUID uuid.UUID + E164 string + ContactName string + ContactAvatar ContactAvatar + ProfileKey *libsignalgo.ProfileKey + ProfileName string + ProfileAbout string + ProfileAboutEmoji string + ProfileAvatarPath string + ProfileAvatarHash string } type ContactAvatar struct { diff --git a/pkg/signalmeow/types/identifer.go b/pkg/signalmeow/types/identifer.go index f1c02dc..334e9bb 100644 --- a/pkg/signalmeow/types/identifer.go +++ b/pkg/signalmeow/types/identifer.go @@ -25,17 +25,13 @@ import ( type GroupIdentifier string -func BytesToGroupIdentifier(raw *libsignalgo.GroupIdentifier) GroupIdentifier { - return GroupIdentifier(raw.String()) -} - func (gid GroupIdentifier) String() string { return string(gid) } func (gid GroupIdentifier) Bytes() (raw libsignalgo.GroupIdentifier, err error) { var decoded []byte - decoded, err = base64.StdEncoding.DecodeString(string(gid)) + decoded, err = base64.RawStdEncoding.DecodeString(string(gid)) if err == nil { if len(decoded) != 32 { err = fmt.Errorf("invalid group identifier length") @@ -48,4 +44,3 @@ func (gid GroupIdentifier) Bytes() (raw libsignalgo.GroupIdentifier, err error) // This is just base64 encoded group master key type SerializedGroupMasterKey string -type SerializedInviteLinkPassword string diff --git a/pkg/signalmeow/types/uuid.go b/pkg/signalmeow/types/uuid.go new file mode 100644 index 0000000..86271dd --- /dev/null +++ b/pkg/signalmeow/types/uuid.go @@ -0,0 +1,10 @@ +package types + +const ( + // UUIDKindACI is the UUID kind for account identifiers. + UUIDKindACI UUIDKind = "aci" + // UUIDKindPNI is the UUID kind for phone number identifiers. + UUIDKindPNI UUIDKind = "pni" +) + +type UUIDKind string diff --git a/pkg/signalmeow/web/grpc.go b/pkg/signalmeow/web/grpc.go deleted file mode 100644 index fb7cf7c..0000000 --- a/pkg/signalmeow/web/grpc.go +++ /dev/null @@ -1,169 +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 web - -import ( - "context" - "encoding/base64" - "errors" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/account" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/attachments" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/backups" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/call_quality" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/calling" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/challenge" - scredentials "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/credentials" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/device" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/donations" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/keys" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/login_purchase" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/messages" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/one_time_donations" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/payments" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/product_configuration" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/profile" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/remote_configuration" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/rpc/subscriptions" -) - -type GRPCAuthHeader struct { - value string -} - -var _ credentials.PerRPCCredentials = (*GRPCAuthHeader)(nil) - -func basicAuth(username, password string) string { - auth := username + ":" + password - return base64.StdEncoding.EncodeToString([]byte(auth)) -} - -func (a *GRPCAuthHeader) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { - return map[string]string{ - "authorization": a.value, - }, nil -} - -func (a *GRPCAuthHeader) RequireTransportSecurity() bool { - return true -} - -type GRPCClient struct { - AuthConn *grpc.ClientConn - UnauthConn *grpc.ClientConn - - Accounts account.AccountsClient - Attachments attachments.AttachmentsClient - Backups backups.BackupsClient - Calling calling.CallingClient - Challenge challenge.ChallengeClient - Credentials scredentials.CredentialsClient - Devices device.DevicesClient - Donations donations.DonationsClient - Keys keys.KeysClient - Messages messages.MessagesClient - Payments payments.PaymentsClient - Profile profile.ProfileClient - RemoteConfiguration remote_configuration.RemoteConfigurationClient - - AccountsAnonymous account.AccountsAnonymousClient - BackupsAnonymous backups.BackupsAnonymousClient - CredentialsAnonymous scredentials.CredentialsAnonymousClient - KeysAnonymous keys.KeysAnonymousClient - MessagesAnonymous messages.MessagesAnonymousClient - ProfileAnonymous profile.ProfileAnonymousClient - CallQuality call_quality.CallQualityClient - LoginPurchase login_purchase.LoginPurchaseClient - OneTimeDonations one_time_donations.OneTimeDonationsClient - ProductConfiguration product_configuration.ProductConfigurationClient - Subscriptions subscriptions.SubscriptionsClient -} - -func (gc *GRPCClient) Close() error { - if gc == nil { - return nil - } - return errors.Join( - gc.AuthConn.Close(), - gc.UnauthConn.Close(), - ) -} - -func (gc *GRPCClient) ResetConnectBackoff() { - if gc == nil { - return - } - gc.AuthConn.ResetConnectBackoff() - gc.UnauthConn.ResetConnectBackoff() -} - -const GRPCTarget = "dns://grpc.chat.signal.org:443" - -func NewGRPCClient(username, password string) (*GRPCClient, error) { - grpcTLSConfig := credentials.NewTLS(SignalTLSConfig) - authConn, err := grpc.NewClient( - GRPCTarget, - grpc.WithUserAgent(UserAgent), - grpc.WithTransportCredentials(grpcTLSConfig), - grpc.WithPerRPCCredentials(&GRPCAuthHeader{value: "Basic " + basicAuth(username, password)}), - ) - if err != nil { - return nil, err - } - unauthConn, err := grpc.NewClient( - GRPCTarget, - grpc.WithUserAgent(UserAgent), - grpc.WithTransportCredentials(grpcTLSConfig), - ) - if err != nil { - _ = authConn.Close() - return nil, err - } - return &GRPCClient{ - AuthConn: authConn, - UnauthConn: unauthConn, - - Accounts: account.NewAccountsClient(authConn), - Attachments: attachments.NewAttachmentsClient(authConn), - Backups: backups.NewBackupsClient(authConn), - Calling: calling.NewCallingClient(authConn), - Challenge: challenge.NewChallengeClient(authConn), - Credentials: scredentials.NewCredentialsClient(authConn), - Devices: device.NewDevicesClient(authConn), - Donations: donations.NewDonationsClient(authConn), - Keys: keys.NewKeysClient(authConn), - Messages: messages.NewMessagesClient(authConn), - Payments: payments.NewPaymentsClient(authConn), - Profile: profile.NewProfileClient(authConn), - RemoteConfiguration: remote_configuration.NewRemoteConfigurationClient(authConn), - - AccountsAnonymous: account.NewAccountsAnonymousClient(unauthConn), - BackupsAnonymous: backups.NewBackupsAnonymousClient(unauthConn), - CredentialsAnonymous: scredentials.NewCredentialsAnonymousClient(unauthConn), - KeysAnonymous: keys.NewKeysAnonymousClient(unauthConn), - MessagesAnonymous: messages.NewMessagesAnonymousClient(unauthConn), - ProfileAnonymous: profile.NewProfileAnonymousClient(unauthConn), - CallQuality: call_quality.NewCallQualityClient(unauthConn), - LoginPurchase: login_purchase.NewLoginPurchaseClient(unauthConn), - OneTimeDonations: one_time_donations.NewOneTimeDonationsClient(unauthConn), - ProductConfiguration: product_configuration.NewProductConfigurationClient(unauthConn), - Subscriptions: subscriptions.NewSubscriptionsClient(unauthConn), - }, nil -} diff --git a/pkg/signalmeow/web/signal-root-ed25519.crt.der b/pkg/signalmeow/web/signal-root-ed25519.crt.der deleted file mode 100644 index 131e23d..0000000 Binary files a/pkg/signalmeow/web/signal-root-ed25519.crt.der and /dev/null differ diff --git a/pkg/signalmeow/web/signalwebsocket.go b/pkg/signalmeow/web/signalwebsocket.go index 3231322..c827657 100644 --- a/pkg/signalmeow/web/signalwebsocket.go +++ b/pkg/signalmeow/web/signalwebsocket.go @@ -19,55 +19,46 @@ package web import ( "context" "encoding/base64" - "encoding/json" "errors" "fmt" "net/http" - "net/url" "strings" - "sync" - "sync/atomic" "time" - "github.com/coder/websocket" "github.com/rs/zerolog" - "go.mau.fi/util/exsync" + "nhooyr.io/websocket" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" "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/" type SimpleResponse struct { - Status int - WriteCallback func(time.Time) + Status int } type RequestHandlerFunc func(context.Context, *signalpb.WebSocketRequestMessage) (*SimpleResponse, error) type SignalWebsocket struct { - ws atomic.Pointer[websocket.Conn] - basicAuth *url.Userinfo + ws *websocket.Conn + path string + basicAuth *string sendChannel chan SignalWebsocketSendMessage statusChannel chan SignalWebsocketConnectionStatus - closeLock sync.RWMutex - closeEvt *exsync.Event - closeCalled atomic.Bool - cancel atomic.Pointer[context.CancelFunc] - cancelConn atomic.Pointer[context.CancelCauseFunc] } -func NewSignalWebsocket(basicAuth *url.Userinfo) *SignalWebsocket { +func NewSignalWebsocket(path string, username *string, password *string) *SignalWebsocket { + var basicAuth *string + if username != nil && password != nil { + b := base64.StdEncoding.EncodeToString([]byte(*username + ":" + *password)) + basicAuth = &b + } return &SignalWebsocket{ + path: path, basicAuth: basicAuth, sendChannel: make(chan SignalWebsocketSendMessage), statusChannel: make(chan SignalWebsocketConnectionStatus), - closeEvt: exsync.NewEvent(), } } @@ -79,7 +70,6 @@ const ( SignalWebsocketConnectionEventDisconnected SignalWebsocketConnectionEventLoggedOut SignalWebsocketConnectionEventError - SignalWebsocketConnectionEventFatalError SignalWebsocketConnectionEventCleanShutdown ) @@ -90,7 +80,6 @@ var signalWebsocketConnectionEventNames = map[SignalWebsocketConnectionEvent]str SignalWebsocketConnectionEventDisconnected: "SignalWebsocketConnectionEventDisconnected", SignalWebsocketConnectionEventLoggedOut: "SignalWebsocketConnectionEventLoggedOut", SignalWebsocketConnectionEventError: "SignalWebsocketConnectionEventError", - SignalWebsocketConnectionEventFatalError: "SignalWebsocketConnectionEventFatalError", SignalWebsocketConnectionEventCleanShutdown: "SignalWebsocketConnectionEventCleanShutdown", } @@ -105,105 +94,50 @@ type SignalWebsocketConnectionStatus struct { } func (s *SignalWebsocket) IsConnected() bool { - return s.ws.Load() != nil + return s.ws != nil } -func (s *SignalWebsocket) Close() (err error) { - if s == nil { - return nil +func (s *SignalWebsocket) Close() error { + defer func() { + if s != nil { + s.ws = nil + } + }() + if s != nil && s.ws != nil { + return s.ws.Close(websocket.StatusNormalClosure, "") } - - s.closeCalled.Store(true) - if ws := s.ws.Swap(nil); ws != nil { - err = ws.Close(websocket.StatusNormalClosure, "") - } - if cancelLoop := s.cancel.Swap(nil); cancelLoop != nil { - (*cancelLoop)() - } - <-s.closeEvt.GetChan() - return err + return nil } -func (s *SignalWebsocket) Connect(ctx context.Context, requestHandler RequestHandlerFunc) chan SignalWebsocketConnectionStatus { +func (s *SignalWebsocket) Connect(ctx context.Context, requestHandler *RequestHandlerFunc) chan SignalWebsocketConnectionStatus { go s.connectLoop(ctx, requestHandler) return s.statusChannel } -func (s *SignalWebsocket) pushStatus(ctx context.Context, status SignalWebsocketConnectionEvent, err error) { - select { - case s.statusChannel <- SignalWebsocketConnectionStatus{ - Event: status, - Err: err, - }: - case <-ctx.Done(): - return - case <-time.After(5 * time.Second): - zerolog.Ctx(ctx).Error().Msg("Status channel didn't accept status") - } -} - -func (s *SignalWebsocket) pushOutgoing(ctx context.Context, send SignalWebsocketSendMessage) error { - if ctx.Err() != nil { - return ctx.Err() - } - s.closeLock.RLock() - defer s.closeLock.RUnlock() - if s.sendChannel == nil { - return errors.New("connection is not open") - } - select { - case s.sendChannel <- send: - return nil - case <-ctx.Done(): - return ctx.Err() - case <-s.closeEvt.GetChan(): - return errors.New("connection closed before send could be queued") - } -} - -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, + requestHandler *RequestHandlerFunc, ) { log := zerolog.Ctx(ctx).With(). Str("loop", "signal_websocket_connect_loop"). Logger() ctx, cancel := context.WithCancel(ctx) - s.cancel.Store(&cancel) - incomingRequestChan := make(chan *signalpb.WebSocketRequestMessage, 256) + incomingRequestChan := make(chan *signalpb.WebSocketRequestMessage, 10000) defer func() { - s.closeEvt.Set() - cancel() - - s.closeLock.Lock() - defer s.closeLock.Unlock() close(incomingRequestChan) close(s.statusChannel) close(s.sendChannel) incomingRequestChan = nil s.statusChannel = nil s.sendChannel = nil + cancel() }() - const initialBackoff = 10 * time.Second const backoffIncrement = 5 * time.Second const maxBackoff = 60 * time.Second - if s.ws.Load() != nil { + if s.ws != nil { panic("Already connected") } @@ -229,20 +163,17 @@ func (s *SignalWebsocket) connectLoop( } // Handle the request with the request handler function - response, err := requestHandler(ctx, request) + response, err := (*requestHandler)(ctx, request) if err != nil { - log.Err(err).Uint64("request_id", request.GetId()).Msg("Error handling request") - } else if response != nil { - err = s.pushOutgoing(ctx, SignalWebsocketSendMessage{ + log.Err(err).Msg("Error handling request") + continue + } + if response != nil && s.sendChannel != nil { + s.sendChannel <- SignalWebsocketSendMessage{ RequestMessage: request, ResponseMessage: response, - }) - if err != nil { - log.Err(err).Uint64("request_id", request.GetId()).Msg("Error queuing response message") } - } else { - log.Warn().Uint64("request_id", request.GetId()).Msg("Request handler didn't return a response nor an error") } } } @@ -250,57 +181,53 @@ func (s *SignalWebsocket) connectLoop( // Main connection loop - if there's a problem with anything just // kill everything (including the websocket) and build it all up again - backoff := initialBackoff + backoff := backoffIncrement retrying := false errorCount := 0 - isFirstConnect := true - wsURL := (&url.URL{ - Scheme: "wss", - Host: APIHostname, - Path: WebsocketPath, - User: s.basicAuth, - }).String() for { if retrying { if backoff > maxBackoff { backoff = maxBackoff } log.Warn().Dur("backoff", backoff).Msg("Failed to connect, waiting to retry...") - select { - case <-time.After(backoff): - case <-ctx.Done(): - } + time.Sleep(backoff) backoff += backoffIncrement - } else if !isFirstConnect && s.basicAuth != nil { - select { - case <-time.After(initialBackoff): - case <-ctx.Done(): - } } if ctx.Err() != nil { log.Info().Msg("ctx done, stopping connection loop") return } - isFirstConnect = false - ws, resp, err := OpenWebsocket(ctx, wsURL) + ws, resp, err := OpenWebsocket(ctx, s.path) if resp != nil { if resp.StatusCode != 101 { // Server didn't want to open websocket if resp.StatusCode >= 500 { // We can try again if it's a 5xx - s.pushStatus(ctx, SignalWebsocketConnectionEventDisconnected, fmt.Errorf("5xx opening websocket: %v", resp.Status)) + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventDisconnected, + Err: fmt.Errorf("5xx opening websocket: %v", resp.Status), + } } else if resp.StatusCode == 403 { // We are logged out, so we should stop trying to reconnect - s.pushStatus(ctx, SignalWebsocketConnectionEventLoggedOut, fmt.Errorf("403 opening websocket, we are logged out")) + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventLoggedOut, + Err: fmt.Errorf("403 opening websocket, we are logged out"), + } return // NOT RETRYING, KILLING THE CONNECTION LOOP } else if resp.StatusCode > 0 && resp.StatusCode < 500 { // Unexpected status code - s.pushStatus(ctx, SignalWebsocketConnectionEventFatalError, fmt.Errorf("unexpected status opening websocket: %v", resp.Status)) + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventError, + Err: fmt.Errorf("bad status opening websocket: %v", resp.Status), + } return // NOT RETRYING, KILLING THE CONNECTION LOOP } else { // Something is very wrong - s.pushStatus(ctx, SignalWebsocketConnectionEventError, fmt.Errorf("unexpected error opening websocket: %v", resp.Status)) + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventError, + Err: fmt.Errorf("unexpected error opening websocket: %v", resp.Status), + } } // Retry the connection retrying = true @@ -310,46 +237,45 @@ func (s *SignalWebsocket) connectLoop( if err != nil { // Unexpected error opening websocket if backoff < maxBackoff { - s.pushStatus(ctx, SignalWebsocketConnectionEventDisconnected, fmt.Errorf("transient error opening websocket: %w", err)) + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventDisconnected, + Err: fmt.Errorf("hopefully transient error opening websocket: %w", err), + } } else { - s.pushStatus(ctx, SignalWebsocketConnectionEventError, fmt.Errorf("continuing error opening websocket: %w", err)) + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventError, + Err: fmt.Errorf("continuing error opening websocket: %w", err), + } } retrying = true continue } // Succssfully connected - s.pushStatus(ctx, SignalWebsocketConnectionEventConnected, nil) - s.ws.Store(ws) + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventConnected, + } + s.ws = ws retrying = false - backoff = initialBackoff + backoff = backoffIncrement - 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) // Read loop (for reading incoming reqeusts and responses to outgoing requests) go func() { - defer wg.Done() - err := readLoop(loopCtx, ws, incomingRequestChan, responseChannels) + err := readLoop(loopCtx, ws, incomingRequestChan, &responseChannels) // Don't want to put an err into loopCancel if we don't have one if err != nil { err = fmt.Errorf("error in readLoop: %w", err) } - if s.closeCalled.Load() { - // Exit during Close() so cancel the reconnect loop as well - cancel() - } loopCancel(err) log.Info().Msg("readLoop exited") }() // Write loop (for sending outgoing requests and responses to incoming requests) go func() { - defer wg.Done() - err := writeLoop(loopCtx, ws, s.sendChannel, responseChannels) + err := writeLoop(loopCtx, ws, s.sendChannel, &responseChannels) // Don't want to put an err into loopCancel if we don't have one if err != nil { err = fmt.Errorf("error in writeLoop: %w", err) @@ -360,34 +286,18 @@ 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) - err := ws.Ping(pingCtx) - cancel() + err := ws.Ping(loopCtx) if err != nil { - pingTimeoutCount++ - log.Err(err).Msg("Failed to send ping") - if pingTimeoutCount >= WebsocketPingTimeoutLimit { - log.Warn().Msg("Ping timeout count exceeded, closing websocket") - err = ws.Close(websocket.StatusNormalClosure, "Ping timeout") - if err != nil { - log.Err(err).Msg("Error closing websocket after ping timeout") - } - return - } - } else if pingTimeoutCount > 0 { - pingTimeoutCount = 0 - log.Debug().Msg("Recovered from ping error") - } else { - log.Trace().Msg("Sent keepalive") + loopCancel(fmt.Errorf("error sending keepalive: %w", err)) + return } + log.Info().Msg("Sent keepalive") case <-loopCtx.Done(): return } @@ -395,29 +305,49 @@ func (s *SignalWebsocket) connectLoop( }() // Wait for read or write or ping loop to exit (which means there was an error) - log.Debug().Msg("Finished preparing connection, waiting for loop context to finish") - <-loopCtx.Done() - ctxCauseErr := context.Cause(loopCtx) - log.Debug().AnErr("ctx_cause_err", ctxCauseErr).Msg("Read or write loop exited") - if ctxCauseErr == nil || errors.Is(ctxCauseErr, context.Canceled) { - s.pushStatus(ctx, SignalWebsocketConnectionEventCleanShutdown, nil) - } 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 + log.Info().Msg("Waiting for read or write loop to exit") + select { + case <-loopCtx.Done(): + log.Info().Msg("received loopCtx done") + if context.Cause(loopCtx) != nil { + err := context.Cause(loopCtx) + if err != nil && err != context.Canceled { + log.Err(err).Msg("loopCtx error") + errorCount++ + } + } + if context.Cause(loopCtx) != nil && context.Cause(loopCtx) == context.Canceled { + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventCleanShutdown, + } + } else { + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventDisconnected, + Err: err, + } + } + case <-ctx.Done(): + log.Info().AnErr("ctx_err", ctx.Err()).AnErr("ctx_cause", context.Cause(ctx)).Msg("received ctx done") + if context.Cause(ctx) != nil && context.Cause(ctx) == context.Canceled { + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventCleanShutdown, + } + return + } else { + s.statusChannel <- SignalWebsocketConnectionStatus{ + Event: SignalWebsocketConnectionEventDisconnected, + Err: err, + } } } + log.Info().Msg("Read or write loop exited") // Clean up - ws.Close(websocket.StatusGoingAway, "Going away") - for _, responseChannel := range responseChannels.SwapData(nil) { + ws.Close(200, "Done") + for _, responseChannel := range responseChannels { close(responseChannel) } loopCancel(nil) - wg.Wait() log.Debug().Msg("Finished websocket cleanup") if errorCount > 500 { // Something is really wrong, we better panic. @@ -432,7 +362,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"). @@ -447,7 +377,8 @@ func readLoop( if err != nil { if err == context.Canceled { log.Info().Msg("readLoop context canceled") - } else if websocket.CloseStatus(err) == websocket.StatusNormalClosure { + } + if strings.Contains(err.Error(), "StatusNormalClosure") { log.Info().Msg("readLoop received StatusNormalClosure") return nil } @@ -459,7 +390,7 @@ func readLoop( if msg.Request == nil { return errors.New("received request message with no request") } - log.Trace(). + log.Debug(). Uint64("request_id", *msg.Request.Id). Str("request_verb", *msg.Request.Verb). Str("request_path", *msg.Request.Path). @@ -472,27 +403,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 +442,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"). @@ -530,7 +456,7 @@ func writeLoop( return nil case request, ok := <-sendChannel: if !ok { - return errors.New("send channel closed") + return errors.New("Send channel closed") } if request.RequestMessage != nil && request.ResponseChannel != nil { msgType := signalpb.WebSocketMessage_REQUEST @@ -539,23 +465,27 @@ func writeLoop( Request: request.RequestMessage, } request.RequestMessage.Id = &i - responseChannels.Set(i, request.ResponseChannel) - if !request.RequestTime.IsZero() { + (*responseChannels)[i] = request.ResponseChannel + path := *request.RequestMessage.Path + if len(path) > 30 { + path = path[:40] + } + if request.RequestTime != (time.Time{}) { elapsed := time.Since(request.RequestTime) if elapsed > 1*time.Minute { - return fmt.Errorf("request too old (%v), not sending", elapsed) + return fmt.Errorf("Took too long, not sending (elapsed: %v)", elapsed) } else if elapsed > 10*time.Second { 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") } @@ -573,14 +503,10 @@ func writeLoop( Uint64("request_id", *request.RequestMessage.Id). Int("response_status", request.ResponseMessage.Status). Msg("Sending WS response") - writeStartTime := time.Now() err := wspb.Write(ctx, ws, message) if err != nil { return fmt.Errorf("error writing response message: %w", err) } - if request.ResponseMessage.WriteCallback != nil { - request.ResponseMessage.WriteCallback(writeStartTime) - } } else { return fmt.Errorf("invalid request: %+v", request) } @@ -590,63 +516,40 @@ 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, - }, 0) + startTime := time.Now() + return s.sendRequestInternal(ctx, request, startTime, 0) } func (s *SignalWebsocket) sendRequestInternal( ctx context.Context, request *signalpb.WebSocketRequestMessage, + startTime time.Time, retryCount int, ) (*signalpb.WebSocketResponseMessage, error) { if s.basicAuth != nil { - request.Headers = append(request.Headers, "authorization:Basic "+s.basicAuth.String()) + request.Headers = append(request.Headers, "authorization:Basic "+*s.basicAuth) } responseChannel := make(chan *signalpb.WebSocketResponseMessage, 1) - err := s.pushOutgoing(ctx, SignalWebsocketSendMessage{ + if s.sendChannel == nil { + return nil, errors.New("Send channel not initialized") + } + s.sendChannel <- SignalWebsocketSendMessage{ RequestMessage: request, ResponseChannel: responseChannel, - RequestTime: time.Now(), - }) - if err != nil { - return nil, err + RequestTime: startTime, } 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) if ctx.Err() != nil { return nil, fmt.Errorf("retried 3 times, giving up: %w", ctx.Err()) } else { - return nil, errors.New("retried 3 times, giving up") + return nil, errors.New("Retried 3 times, giving up") } } if ctx.Err() != nil { @@ -656,12 +559,16 @@ func (s *SignalWebsocket) sendRequestInternal( } } zerolog.Ctx(ctx).Warn().Int("retry_count", retryCount).Msg("Received nil response, retrying recursively") - return s.sendRequestInternal(ctx, request, retryCount+1) + return s.sendRequestInternal(ctx, request, startTime, retryCount+1) } return response, nil } -func OpenWebsocket(ctx context.Context, url string) (*websocket.Conn, *http.Response, error) { +func OpenWebsocket(ctx context.Context, path string) (*websocket.Conn, *http.Response, error) { + return OpenWebsocketURL(ctx, "wss://"+APIHostname+path) +} + +func OpenWebsocketURL(ctx context.Context, url string) (*websocket.Conn, *http.Response, error) { opt := &websocket.DialOptions{ HTTPClient: SignalHTTPClient, HTTPHeader: make(http.Header, 2), diff --git a/pkg/signalmeow/web/web.go b/pkg/signalmeow/web/web.go index c5a0e12..e72570a 100644 --- a/pkg/signalmeow/web/web.go +++ b/pkg/signalmeow/web/web.go @@ -26,19 +26,20 @@ import ( "fmt" "io" "net/http" + "net/url" + "os" "runtime" "strings" - "time" "github.com/rs/zerolog" - "go.mau.fi/util/exerrors" "go.mau.fi/mautrix-signal/pkg/libsignalgo" - "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf/signalpb" ) -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 ( @@ -58,36 +59,45 @@ var CDNHosts = []string{ //go:embed signal-root.crt.der var signalRootCertBytes []byte - -//go:embed signal-root-ed25519.crt.der -var signalEd25519CertBytes []byte - -var SignalCertPool = x509.NewCertPool() -var SignalTLSConfig = &tls.Config{ - RootCAs: SignalCertPool, - MinVersion: tls.VersionTLS13, -} var signalTransport = &http.Transport{ ForceAttemptHTTP2: true, - TLSClientConfig: SignalTLSConfig, + TLSClientConfig: &tls.Config{ + RootCAs: x509.NewCertPool(), + }, } var SignalHTTPClient = &http.Client{ Transport: signalTransport, } func init() { - SignalCertPool.AddCert(exerrors.Must(x509.ParseCertificate(signalRootCertBytes))) - SignalCertPool.AddCert(exerrors.Must(x509.ParseCertificate(signalEd25519CertBytes))) + cert, err := x509.ParseCertificate(signalRootCertBytes) + if err != nil { + panic(err) + } + 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" ) type HTTPReqOpt struct { @@ -95,21 +105,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 } @@ -120,7 +134,7 @@ func SendHTTPRequest(ctx context.Context, host, method, path string, opt *HTTPRe Logger() ctx = log.WithContext(ctx) - req, err := http.NewRequestWithContext(ctx, method, urlStr, bytes.NewReader(opt.Body)) + req, err := http.NewRequestWithContext(ctx, method, urlStr, bytes.NewBuffer(opt.Body)) if err != nil { log.Err(err).Msg("Error creating request") return nil, err @@ -135,7 +149,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) @@ -146,45 +159,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 { @@ -205,33 +191,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 @@ -253,10 +243,7 @@ func GetAttachment(ctx context.Context, path string, cdnNumber uint32) (*http.Re if err != nil { return nil, err } - log.Debug(). - Int("status_code", resp.StatusCode). - Int64("content_length", resp.ContentLength). - Msg("Received Attachment HTTP response") + log.Debug().Msg("Received Attachment HTTP response") return resp, err } diff --git a/pkg/signalmeow/wspb/wspb.go b/pkg/signalmeow/wspb/wspb.go index 2c2ccd8..c58628f 100644 --- a/pkg/signalmeow/wspb/wspb.go +++ b/pkg/signalmeow/wspb/wspb.go @@ -8,8 +8,8 @@ import ( "fmt" "sync" - "github.com/coder/websocket" "google.golang.org/protobuf/proto" + "nhooyr.io/websocket" ) // Read reads a protobuf message from c into v. diff --git a/portal.go b/portal.go new file mode 100644 index 0000000..b2d46f0 --- /dev/null +++ b/portal.go @@ -0,0 +1,1928 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber, 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 main + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "errors" + "fmt" + "net/http" + "reflect" + "strings" + "sync" + "time" + + "github.com/google/uuid" + "github.com/rs/zerolog" + "go.mau.fi/util/jsontime" + "go.mau.fi/util/variationselector" + "google.golang.org/protobuf/proto" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/appservice" + "maunium.net/go/mautrix/bridge" + "maunium.net/go/mautrix/bridge/bridgeconfig" + "maunium.net/go/mautrix/bridge/status" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/database" + "go.mau.fi/mautrix-signal/msgconv" + "go.mau.fi/mautrix-signal/msgconv/matrixfmt" + "go.mau.fi/mautrix-signal/msgconv/signalfmt" + "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" +) + +func (br *SignalBridge) GetPortalByMXID(mxid id.RoomID) *Portal { + br.portalsLock.Lock() + defer br.portalsLock.Unlock() + + portal, ok := br.portalsByMXID[mxid] + if !ok { + dbPortal, err := br.DB.Portal.GetByMXID(context.TODO(), mxid) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get portal from database") + return nil + } + return br.loadPortal(context.TODO(), dbPortal, nil) + } + + return portal +} + +func (br *SignalBridge) GetPortalByChatID(key database.PortalKey) *Portal { + br.portalsLock.Lock() + defer br.portalsLock.Unlock() + // If this PortalKey is for a group, Receiver should be empty + if key.UserID() == uuid.Nil { + key.Receiver = uuid.Nil + } + portal, ok := br.portalsByID[key] + if !ok { + dbPortal, err := br.DB.Portal.GetByChatID(context.TODO(), key) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get portal from database") + return nil + } + return br.loadPortal(context.TODO(), dbPortal, &key) + } + return portal +} + +func (br *SignalBridge) GetAllPortalsWithMXID() []*Portal { + portals, err := br.dbPortalsToPortals(br.DB.Portal.GetAllWithMXID(context.TODO())) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get all portals with mxid") + return nil + } + return portals +} + +func (br *SignalBridge) FindPrivateChatPortalsWith(userID uuid.UUID) []*Portal { + portals, err := br.dbPortalsToPortals(br.DB.Portal.FindPrivateChatsWith(context.TODO(), userID)) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get all DM portals with user") + return nil + } + return portals +} + +func (br *SignalBridge) GetAllIPortals() (iportals []bridge.Portal) { + portals, err := br.dbPortalsToPortals(br.DB.Portal.GetAllWithMXID(context.TODO())) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get all portals with mxid") + return nil + } + iportals = make([]bridge.Portal, len(portals)) + for i, portal := range portals { + iportals[i] = portal + } + return iportals +} + +func (br *SignalBridge) loadPortal(ctx context.Context, dbPortal *database.Portal, key *database.PortalKey) *Portal { + if dbPortal == nil { + if key == nil { + return nil + } + + dbPortal = br.DB.Portal.New() + dbPortal.PortalKey = *key + err := dbPortal.Insert(ctx) + if err != nil { + br.ZLog.Err(err).Msg("Failed to insert new portal") + return nil + } + } + + portal := br.NewPortal(dbPortal) + + br.portalsByID[portal.PortalKey] = portal + if portal.MXID != "" { + br.portalsByMXID[portal.MXID] = portal + } + + return portal +} + +func (br *SignalBridge) dbPortalsToPortals(dbPortals []*database.Portal, err error) ([]*Portal, error) { + if err != nil { + return nil, err + } + br.portalsLock.Lock() + defer br.portalsLock.Unlock() + + output := make([]*Portal, len(dbPortals)) + for index, dbPortal := range dbPortals { + if dbPortal == nil { + continue + } + + portal, ok := br.portalsByID[dbPortal.PortalKey] + if !ok { + portal = br.loadPortal(context.TODO(), dbPortal, nil) + } + + output[index] = portal + } + + return output, nil +} + +type portalSignalMessage struct { + evt *events.ChatEvent + user *User +} + +type portalMatrixMessage struct { + evt *event.Event + user *User +} + +type Portal struct { + *database.Portal + + MsgConv *msgconv.MessageConverter + + bridge *SignalBridge + log zerolog.Logger + + roomCreateLock sync.Mutex + encryptLock sync.Mutex + + signalMessages chan portalSignalMessage + matrixMessages chan portalMatrixMessage + + currentlyTyping []id.UserID + currentlyTypingLock sync.Mutex + + relayUser *User +} + +var signalFormatParams *signalfmt.FormatParams +var matrixFormatParams *matrixfmt.HTMLParser + +func (br *SignalBridge) NewPortal(dbPortal *database.Portal) *Portal { + log := br.ZLog.With().Str("chat_id", dbPortal.ChatID).Logger() + if dbPortal.MXID != "" { + log = log.With().Stringer("room_id", dbPortal.MXID).Logger() + } + + portal := &Portal{ + Portal: dbPortal, + bridge: br, + log: log, + + signalMessages: make(chan portalSignalMessage, br.Config.Bridge.PortalMessageBuffer), + matrixMessages: make(chan portalMatrixMessage, br.Config.Bridge.PortalMessageBuffer), + } + portal.MsgConv = &msgconv.MessageConverter{ + PortalMethods: portal, + SignalFmtParams: signalFormatParams, + MatrixFmtParams: matrixFormatParams, + ConvertVoiceMessages: true, + MaxFileSize: br.MediaConfig.UploadSize, + } + go portal.messageLoop() + + return portal +} + +func init() { + event.TypeMap[event.StateBridge] = reflect.TypeOf(CustomBridgeInfoContent{}) + event.TypeMap[event.StateHalfShotBridge] = reflect.TypeOf(CustomBridgeInfoContent{}) +} + +var ( + _ bridge.Portal = (*Portal)(nil) + _ bridge.ReadReceiptHandlingPortal = (*Portal)(nil) + _ bridge.TypingPortal = (*Portal)(nil) + _ bridge.DisappearingPortal = (*Portal)(nil) + //_ bridge.MembershipHandlingPortal = (*Portal)(nil) + //_ bridge.MetaHandlingPortal = (*Portal)(nil) +) + +func (portal *Portal) IsEncrypted() bool { + return portal.Encrypted +} + +func (portal *Portal) MarkEncrypted() { + portal.Encrypted = true + err := portal.Update(context.TODO()) + if err != nil { + portal.log.Err(err).Msg("Failed to update portal in database after marking as encrypted") + } +} + +func (portal *Portal) ReceiveMatrixEvent(user bridge.User, evt *event.Event) { + if user.GetPermissionLevel() >= bridgeconfig.PermissionLevelUser || portal.HasRelaybot() { + portal.matrixMessages <- portalMatrixMessage{user: user.(*User), evt: evt} + } +} + +func (portal *Portal) GetRelayUser() *User { + if !portal.HasRelaybot() { + return nil + } else if portal.relayUser == nil { + portal.relayUser = portal.bridge.GetUserByMXID(portal.RelayUserID) + } + return portal.relayUser +} + +func (portal *Portal) IsPrivateChat() bool { + return portal.UserID() != uuid.Nil +} + +func (portal *Portal) IsNoteToSelf() bool { + userID := portal.UserID() + return userID != uuid.Nil && userID == portal.Receiver +} + +func (portal *Portal) MainIntent() *appservice.IntentAPI { + if portal.IsPrivateChat() { + return portal.bridge.GetPuppetBySignalID(portal.UserID()).DefaultIntent() + } + + return portal.bridge.Bot +} + +type CustomBridgeInfoContent struct { + event.BridgeEventContent + RoomType string `json:"com.beeper.room_type,omitempty"` +} + +func (portal *Portal) getBridgeInfo() (string, CustomBridgeInfoContent) { + bridgeInfo := event.BridgeEventContent{ + BridgeBot: portal.bridge.Bot.UserID, + Creator: portal.MainIntent().UserID, + Protocol: event.BridgeInfoSection{ + ID: "signal", + DisplayName: "Signal", + AvatarURL: portal.bridge.Config.AppService.Bot.ParsedAvatar.CUString(), + ExternalURL: "https://signal.org/", + }, + Channel: event.BridgeInfoSection{ + ID: portal.ChatID, + DisplayName: portal.Name, + AvatarURL: portal.AvatarURL.CUString(), + }, + } + bridgeInfoStateKey := fmt.Sprintf("fi.mau.signal://signal/%s", portal.ChatID) + bridgeInfo.Channel.ExternalURL = fmt.Sprintf("https://signal.me/#p/%s", portal.ChatID) + var roomType string + if portal.IsPrivateChat() { + roomType = "dm" + } + return bridgeInfoStateKey, CustomBridgeInfoContent{bridgeInfo, roomType} +} + +func (portal *Portal) UpdateBridgeInfo(ctx context.Context) { + if len(portal.MXID) == 0 { + portal.log.Debug().Msg("Not updating bridge info: no Matrix room created") + return + } + portal.log.Debug().Msg("Updating bridge info...") + stateKey, content := portal.getBridgeInfo() + _, err := portal.MainIntent().SendStateEvent(ctx, portal.MXID, event.StateBridge, stateKey, content) + if err != nil { + portal.log.Warn().Err(err).Msg("Failed to update m.bridge") + } + // TODO remove this once https://github.com/matrix-org/matrix-doc/pull/2346 is in spec + _, err = portal.MainIntent().SendStateEvent(ctx, portal.MXID, event.StateHalfShotBridge, stateKey, content) + if err != nil { + portal.log.Warn().Err(err).Msg("Failed to update uk.half-shot.bridge") + } +} + +func (portal *Portal) messageLoop() { + for { + select { + case msg := <-portal.matrixMessages: + portal.handleMatrixMessages(msg) + case msg := <-portal.signalMessages: + portal.handleSignalMessage(msg) + } + } +} + +func (portal *Portal) handleMatrixMessages(msg portalMatrixMessage) { + log := portal.log.With(). + Str("action", "handle matrix event"). + Str("event_id", msg.evt.ID.String()). + Str("event_type", msg.evt.Type.String()). + Logger() + ctx := log.WithContext(context.TODO()) + + switch msg.evt.Type { + case event.EventMessage, event.EventSticker: + portal.handleMatrixMessage(ctx, msg.user, msg.evt) + case event.EventRedaction: + portal.handleMatrixRedaction(ctx, msg.user, msg.evt) + case event.EventReaction: + portal.handleMatrixReaction(ctx, msg.user, msg.evt) + default: + log.Warn().Str("type", msg.evt.Type.Type).Msg("Unhandled matrix message type") + } +} + +func (portal *Portal) handleMatrixMessage(ctx context.Context, sender *User, evt *event.Event) { + log := zerolog.Ctx(ctx) + evtTS := time.UnixMilli(evt.Timestamp) + timings := messageTimings{ + initReceive: evt.Mautrix.ReceivedAt.Sub(evtTS), + decrypt: evt.Mautrix.DecryptionDuration, + totalReceive: time.Since(evtTS), + } + implicitRRStart := time.Now() + portal.handleMatrixReadReceipt(sender, "", uint64(evt.Timestamp), false) + timings.implicitRR = time.Since(implicitRRStart) + start := time.Now() + + messageAge := timings.totalReceive + ms := metricSender{portal: portal, timings: &timings, ctx: ctx} + log.Debug(). + Str("sender", evt.Sender.String()). + Dur("age", messageAge). + Msg("Received message") + + errorAfter := portal.bridge.Config.Bridge.MessageHandlingTimeout.ErrorAfter + deadline := portal.bridge.Config.Bridge.MessageHandlingTimeout.Deadline + isScheduled, _ := evt.Content.Raw["com.beeper.scheduled"].(bool) + if isScheduled { + log.Debug().Msg("Message is a scheduled message, extending handling timeouts") + errorAfter *= 10 + deadline *= 10 + } + + if errorAfter > 0 { + remainingTime := errorAfter - messageAge + if remainingTime < 0 { + go ms.sendMessageMetrics(evt, errTimeoutBeforeHandling, "Timeout handling", true) + return + } else if remainingTime < 1*time.Second { + log.Warn(). + Dur("remaining_time", remainingTime). + Dur("max_timeout", errorAfter). + Msg("Message was delayed before reaching the bridge") + } + go func() { + time.Sleep(remainingTime) + ms.sendMessageMetrics(evt, errMessageTakingLong, "Timeout handling", false) + }() + } + + if deadline > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, deadline) + defer cancel() + } + + timings.preproc = time.Since(start) + start = time.Now() + + content, ok := evt.Content.Parsed.(*event.MessageEventContent) + if !ok { + log.Error().Type("content_type", content).Msg("Unexpected parsed content type") + go ms.sendMessageMetrics(evt, fmt.Errorf("%w %T", errUnexpectedParsedContentType, evt.Content.Parsed), "Error converting", true) + return + } + + realSenderMXID := sender.MXID + isRelay := false + if !sender.IsLoggedIn() { + sender = portal.GetRelayUser() + if sender == nil { + go ms.sendMessageMetrics(evt, errUserNotLoggedIn, "Ignoring", true) + return + } else if !sender.IsLoggedIn() { + go ms.sendMessageMetrics(evt, errRelaybotNotLoggedIn, "Ignoring", true) + return + } + isRelay = true + } + + var editTargetMsg *database.Message + if editTarget := content.RelatesTo.GetReplaceID(); editTarget != "" { + var err error + editTargetMsg, err = portal.bridge.DB.Message.GetByMXID(ctx, editTarget) + if err != nil { + log.Err(err).Stringer("edit_target_mxid", editTarget).Msg("Failed to get edit target message") + go ms.sendMessageMetrics(evt, errFailedToGetEditTarget, "Error converting", true) + return + } else if editTargetMsg == nil { + log.Err(err).Stringer("edit_target_mxid", editTarget).Msg("Edit target message not found") + go ms.sendMessageMetrics(evt, errEditUnknownTarget, "Error converting", true) + return + } else if editTargetMsg.Sender != sender.SignalID { + go ms.sendMessageMetrics(evt, errEditDifferentSender, "Error converting", true) + return + } + if content.NewContent != nil { + content = content.NewContent + evt.Content.Parsed = content + } + } + + relaybotFormatted := isRelay && portal.addRelaybotFormat(ctx, realSenderMXID, evt, content) + if content.MsgType == event.MsgNotice && !portal.bridge.Config.Bridge.BridgeNotices { + go ms.sendMessageMetrics(evt, errMNoticeDisabled, "Error converting", true) + return + } + ctx = context.WithValue(ctx, msgconvContextKeyClient, sender.Client) + msg, err := portal.MsgConv.ToSignal(ctx, evt, content, relaybotFormatted) + if err != nil { + log.Err(err).Msg("Failed to convert message") + go ms.sendMessageMetrics(evt, err, "Error converting", true) + return + } + var wrappedMsg *signalpb.Content + if editTargetMsg == nil { + wrappedMsg = &signalpb.Content{ + DataMessage: msg, + } + } else { + wrappedMsg = &signalpb.Content{ + EditMessage: &signalpb.EditMessage{ + TargetSentTimestamp: proto.Uint64(editTargetMsg.Timestamp), + DataMessage: msg, + }, + } + } + + timings.convert = time.Since(start) + start = time.Now() + + err = portal.sendSignalMessage(ctx, wrappedMsg, sender, evt.ID) + + timings.totalSend = time.Since(start) + go ms.sendMessageMetrics(evt, err, "Error sending", true) + if err == nil { + if editTargetMsg != nil { + err = editTargetMsg.SetTimestamp(ctx, msg.GetTimestamp()) + if err != nil { + log.Err(err).Msg("Failed to update message timestamp in database after editing") + } + } else { + portal.storeMessageInDB(ctx, evt.ID, sender.SignalID, msg.GetTimestamp(), 0) + if portal.ExpirationTime > 0 { + portal.addDisappearingMessage(ctx, evt.ID, uint32(portal.ExpirationTime), true) + } + } + } +} + +func (portal *Portal) handleMatrixRedaction(ctx context.Context, sender *User, evt *event.Event) { + log := zerolog.Ctx(ctx) + // Find the original signal message based on eventID + dbMessage, err := portal.bridge.DB.Message.GetByMXID(ctx, evt.Redacts) + if err != nil { + log.Err(err).Msg("Failed to get redaction target message") + } + // Might be a reaction redaction, find the original message for the reaction + dbReaction, err := portal.bridge.DB.Reaction.GetByMXID(ctx, evt.Redacts) + if err != nil { + log.Err(err).Msg("Failed to get redaction target reaction") + } + + if !sender.IsLoggedIn() { + sender = portal.GetRelayUser() + if sender == nil { + portal.sendMessageStatusCheckpointFailed(ctx, evt, errUserNotLoggedIn) + return + } else if !sender.IsLoggedIn() { + portal.sendMessageStatusCheckpointFailed(ctx, evt, errRelaybotNotLoggedIn) + return + } + } + + if dbMessage != nil { + if dbMessage.Sender != sender.SignalID { + portal.sendMessageStatusCheckpointFailed(ctx, evt, errRedactionTargetSentBySomeoneElse) + return + } + msg := signalmeow.DataMessageForDelete(dbMessage.Timestamp) + err = portal.sendSignalMessage(ctx, msg, sender, evt.ID) + if err != nil { + portal.sendMessageStatusCheckpointFailed(ctx, evt, err) + log.Err(err).Msg("Failed to send message redaction to Signal") + return + } + err = dbMessage.Delete(ctx) + if err != nil { + log.Err(err).Msg("Failed to delete redacted message from database") + } else if otherParts, err := portal.bridge.DB.Message.GetAllPartsBySignalID(ctx, dbMessage.Sender, dbMessage.Timestamp, portal.Receiver); err != nil { + log.Err(err).Msg("Failed to get other parts of redacted message from database") + } else if len(otherParts) > 0 { + // If there are other parts of the message, send a redaction for each of them + for _, otherPart := range otherParts { + _, err = portal.MainIntent().RedactEvent(ctx, portal.MXID, otherPart.MXID, mautrix.ReqRedact{ + Reason: "Other part of Signal message redacted", + TxnID: "mxsg_partredact_" + otherPart.MXID.String(), + }) + if err != nil { + log.Err(err). + Str("part_event_id", otherPart.MXID.String()). + Int("part_index", otherPart.PartIndex). + Msg("Failed to redact other part of redacted message") + } + err = otherPart.Delete(ctx) + if err != nil { + log.Err(err). + Str("part_event_id", otherPart.MXID.String()). + Int("part_index", otherPart.PartIndex). + Msg("Failed to delete other part of redacted message from database") + } + } + } + portal.sendMessageStatusCheckpointSuccess(ctx, evt) + } else if dbReaction != nil { + if dbReaction.Author != sender.SignalID { + portal.sendMessageStatusCheckpointFailed(ctx, evt, errUnreactTargetSentBySomeoneElse) + return + } + msg := signalmeow.DataMessageForReaction(dbReaction.Emoji, dbReaction.MsgAuthor, dbReaction.MsgTimestamp, true) + err = portal.sendSignalMessage(ctx, msg, sender, evt.ID) + if err != nil { + portal.sendMessageStatusCheckpointFailed(ctx, evt, err) + log.Err(err).Msg("Failed to send reaction redaction to Signal") + return + } + err = dbReaction.Delete(ctx) + if err != nil { + log.Err(err).Msg("Failed to delete redacted reaction from database") + } + portal.sendMessageStatusCheckpointSuccess(ctx, evt) + } else { + portal.sendMessageStatusCheckpointFailed(ctx, evt, errRedactionTargetNotFound) + } +} + +func (portal *Portal) handleMatrixReaction(ctx context.Context, sender *User, evt *event.Event) { + log := zerolog.Ctx(ctx) + if !sender.IsLoggedIn() { + portal.sendMessageStatusCheckpointFailed(ctx, evt, errCantRelayReactions) + return + } + // Find the original signal message based on eventID + relatedEventID := evt.Content.AsReaction().RelatesTo.EventID + targetMsg, err := portal.bridge.DB.Message.GetByMXID(ctx, relatedEventID) + if err != nil { + portal.sendMessageStatusCheckpointFailed(ctx, evt, err) + log.Err(err).Msg("Failed to get reaction target message") + return + } else if targetMsg == nil { + portal.sendMessageStatusCheckpointFailed(ctx, evt, errReactionTargetNotFound) + log.Warn().Msg("Reaction target message not found") + return + } + emoji := evt.Content.AsReaction().RelatesTo.Key + signalEmoji := variationselector.FullyQualify(emoji) // Signal seems to require fully qualified emojis + msg := signalmeow.DataMessageForReaction(signalEmoji, targetMsg.Sender, targetMsg.Timestamp, false) + err = portal.sendSignalMessage(ctx, msg, sender, evt.ID) + if err != nil { + portal.sendMessageStatusCheckpointFailed(ctx, evt, err) + log.Error().Msg("Failed to send reaction") + return + } + + // Signal only allows one reaction from each user + // Check if there's an existing reaction in the database for this sender and redact/delete it + dbReaction, err := portal.bridge.DB.Reaction.GetBySignalID( + ctx, + targetMsg.Sender, + targetMsg.Timestamp, + sender.SignalID, + portal.Receiver, + ) + if err != nil { + log.Err(err).Msg("Failed to get existing reaction from database") + } else if dbReaction != nil { + log.Debug().Stringer("existing_event_id", dbReaction.MXID).Msg("Redacting existing reaction after sending new one") + _, err = portal.MainIntent().RedactEvent(ctx, portal.MXID, dbReaction.MXID) + if err != nil { + log.Err(err).Msg("Failed to redact existing reaction") + } + } + if dbReaction != nil { + dbReaction.MXID = evt.ID + dbReaction.Emoji = signalEmoji + err = dbReaction.Update(ctx) + if err != nil { + log.Err(err).Msg("Failed to update reaction in database") + } + } else { + dbReaction = portal.bridge.DB.Reaction.New() + dbReaction.MXID = evt.ID + dbReaction.RoomID = portal.MXID + dbReaction.SignalChatID = portal.ChatID + dbReaction.SignalReceiver = portal.Receiver + dbReaction.Author = sender.SignalID + dbReaction.MsgAuthor = targetMsg.Sender + dbReaction.MsgTimestamp = targetMsg.Timestamp + dbReaction.Emoji = signalEmoji + err = dbReaction.Insert(ctx) + if err != nil { + log.Err(err).Msg("Failed to insert reaction to database") + } + } + + portal.sendMessageStatusCheckpointSuccess(ctx, evt) +} + +func (portal *Portal) sendSignalMessage(ctx context.Context, msg *signalpb.Content, sender *User, evtID id.EventID) error { + log := zerolog.Ctx(ctx).With(). + Str("action", "send signal message"). + Str("event_id", evtID.String()). + Str("portal_chat_id", portal.ChatID). + Logger() + ctx = log.WithContext(ctx) + + log.Debug().Msg("Sending event to Signal") + + // Check to see if portal.ChatID is a standard UUID (with dashes) + if portal.IsPrivateChat() { + // this is a 1:1 chat + result := sender.Client.SendMessage(ctx, portal.UserID(), msg) + if !result.WasSuccessful { + return result.Error + } + } else { + // this is a group chat + groupID := types.GroupIdentifier(portal.ChatID) + result, err := sender.Client.SendGroupMessage(ctx, groupID, msg) + if err != nil { + // check the start of the error string, see if it starts with "No group master key found for group identifier" + if strings.HasPrefix(err.Error(), "No group master key found for group identifier") { + portal.MainIntent().SendNotice(ctx, portal.MXID, "Missing group encryption key. Please ask a group member to send a message in this chat, then retry sending.") + } + log.Err(err).Msg("Error sending event to Signal group") + return err + } + totalRecipients := len(result.FailedToSendTo) + len(result.SuccessfullySentTo) + log = log.With(). + Int("total_recipients", totalRecipients). + 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 { + log.Warn().Msg("Only sent event to some members of Signal group") + } else { + log.Debug().Msg("Sent event to all members of Signal group") + } + } + return nil +} + +func (portal *Portal) sendMessageStatusCheckpointSuccess(ctx context.Context, evt *event.Event) { + portal.sendDeliveryReceipt(ctx, evt.ID) + portal.bridge.SendMessageSuccessCheckpoint(evt, status.MsgStepRemote, 0) + + var deliveredTo *[]id.UserID + if portal.IsPrivateChat() { + deliveredTo = &[]id.UserID{} + } + portal.sendStatusEvent(ctx, evt.ID, "", nil, deliveredTo) +} + +func (portal *Portal) sendMessageStatusCheckpointFailed(ctx context.Context, evt *event.Event, err error) { + portal.sendDeliveryReceipt(ctx, evt.ID) + portal.bridge.SendMessageErrorCheckpoint(evt, status.MsgStepRemote, err, true, 0) + portal.sendStatusEvent(ctx, evt.ID, "", err, nil) +} + +type msgconvContextKey int + +const ( + msgconvContextKeyIntent msgconvContextKey = iota + msgconvContextKeyClient +) + +func (portal *Portal) UploadMatrixMedia(ctx context.Context, data []byte, fileName, contentType string) (id.ContentURIString, error) { + intent := ctx.Value(msgconvContextKeyIntent).(*appservice.IntentAPI) + req := mautrix.ReqUploadMedia{ + ContentBytes: data, + ContentType: contentType, + FileName: fileName, + } + if portal.bridge.Config.Homeserver.AsyncMedia { + uploaded, err := intent.UploadAsync(ctx, req) + if err != nil { + return "", err + } + return uploaded.ContentURI.CUString(), nil + } else { + uploaded, err := intent.UploadMedia(ctx, req) + if err != nil { + return "", err + } + return uploaded.ContentURI.CUString(), nil + } +} + +func (portal *Portal) DownloadMatrixMedia(ctx context.Context, uriString id.ContentURIString) ([]byte, error) { + parsedURI, err := uriString.Parse() + if err != nil { + return nil, fmt.Errorf("malformed content URI: %w", err) + } + return portal.MainIntent().DownloadBytes(ctx, parsedURI) +} + +func (portal *Portal) GetData(ctx context.Context) *database.Portal { + return portal.Portal +} + +func (portal *Portal) GetClient(ctx context.Context) *signalmeow.Client { + return ctx.Value(msgconvContextKeyClient).(*signalmeow.Client) +} + +func (portal *Portal) GetMatrixReply(ctx context.Context, msg *signalpb.DataMessage_Quote) (replyTo id.EventID, replyTargetSender id.UserID) { + if msg == nil { + return + } + log := zerolog.Ctx(ctx).With(). + Str("reply_target_author", msg.GetAuthorAci()). + Uint64("reply_target_ts", msg.GetId()). + Logger() + if senderUUID, err := uuid.Parse(msg.GetAuthorAci()); err != nil { + log.Err(err).Msg("Failed to parse sender UUID in Signal quote") + } else if message, err := portal.bridge.DB.Message.GetBySignalID(ctx, senderUUID, msg.GetId(), 0, portal.Receiver); err != nil { + log.Err(err).Msg("Failed to get reply target message from database") + } else if message == nil { + log.Warn().Msg("Reply target message not found") + } else { + replyTo = message.MXID + targetUser := portal.bridge.GetUserBySignalID(message.Sender) + if targetUser != nil { + replyTargetSender = targetUser.MXID + } else { + replyTargetSender = portal.bridge.FormatPuppetMXID(message.Sender) + } + } + return +} + +func (portal *Portal) GetSignalReply(ctx context.Context, content *event.MessageEventContent) *signalpb.DataMessage_Quote { + replyToID := content.RelatesTo.GetReplyTo() + if len(replyToID) == 0 { + return nil + } + replyToMsg, err := portal.bridge.DB.Message.GetByMXID(ctx, replyToID) + if err != nil { + zerolog.Ctx(ctx).Err(err). + Str("reply_to_mxid", replyToID.String()). + Msg("Failed to get reply target message from database") + } else if replyToMsg == nil { + zerolog.Ctx(ctx).Warn(). + Str("reply_to_mxid", replyToID.String()). + Msg("Reply target message not found") + } else { + return &signalpb.DataMessage_Quote{ + Id: proto.Uint64(replyToMsg.Timestamp), + AuthorAci: proto.String(replyToMsg.Sender.String()), + Type: signalpb.DataMessage_Quote_NORMAL.Enum(), + + // This is a hack to make Signal iOS and desktop render replies to file messages. + // Unfortunately it also makes Signal Desktop show a file icon on replies to text messages. + // TODO store file or text flag in database and fill this field only when replying to file messages. + Attachments: make([]*signalpb.DataMessage_Quote_QuotedAttachment, 0), + } + } + return nil +} + +func (portal *Portal) handleSignalMessage(portalMessage portalSignalMessage) { + sender := portal.bridge.GetPuppetBySignalID(portalMessage.evt.Info.Sender) + if sender == nil { + portal.log.Warn(). + Str("sender_uuid", portalMessage.evt.Info.Sender.String()). + Msg("Couldn't get puppet for message") + return + } + switch typedEvt := portalMessage.evt.Event.(type) { + case *signalpb.DataMessage: + portal.handleSignalDataMessage(portalMessage.user, sender, typedEvt) + case *signalpb.TypingMessage: + portal.handleSignalTypingMessage(sender, typedEvt) + case *signalpb.EditMessage: + portal.handleSignalEditMessage(sender, typedEvt.GetTargetSentTimestamp(), typedEvt.GetDataMessage()) + default: + portal.log.Error(). + Type("data_type", typedEvt). + Msg("Invalid inner event type inside ChatEvent") + } +} + +func (portal *Portal) handleSignalDataMessage(source *User, sender *Puppet, msg *signalpb.DataMessage) { + genericCtx := portal.log.With(). + Str("action", "handle signal data message"). + Uint64("msg_ts", msg.GetTimestamp()). + Logger().WithContext(context.TODO()) + // Always update sender info when we receive a message from them, there's caching inside the function + sender.UpdateInfo( + genericCtx, + source, + nil, + ) + // Handle earlier missed group changes here. + // If this message is a group change, don't handle it here, it's handled below. + if msg.GetGroupV2().GetGroupChange() == nil && portal.Revision < msg.GetGroupV2().GetRevision() { + portal.UpdateInfo(genericCtx, source, nil, msg.GetGroupV2().GetRevision()) + } else if portal.IsPrivateChat() && portal.UserID() == portal.Receiver && portal.Name != NoteToSelfName { + // Slightly hacky way to make note to self names backfill + portal.UpdateDMInfo(genericCtx, false) + } + + switch { + case msgconv.CanConvertSignal(msg): + portal.handleSignalNormalDataMessage(source, sender, msg) + case msg.Reaction != nil: + portal.handleSignalReaction(sender, msg.Reaction, msg.GetTimestamp()) + case msg.Delete != nil: + portal.handleSignalDelete(sender, msg.Delete, msg.GetTimestamp()) + case msg.GetGroupV2().GetGroupChange() != nil: + portal.handleSignalGroupChange(source, sender, msg.GroupV2, msg.GetTimestamp()) + case msg.StoryContext != nil, msg.GroupCallUpdate != nil: + // ignore + default: + portal.log.Warn(). + Str("action", "handle signal message"). + Str("sender_uuid", sender.SignalID.String()). + Uint64("msg_ts", msg.GetTimestamp()). + Msg("Unrecognized content in message") + } +} + +func (portal *Portal) handleSignalGroupChange(source *User, sender *Puppet, groupMeta *signalpb.GroupContextV2, ts uint64) { + log := portal.log.With(). + Str("action", "handle signal group change"). + Str("sender_uuid", sender.SignalID.String()). + Uint64("change_ts", ts). + Uint32("new_revision", groupMeta.GetRevision()). + Logger() + ctx := log.WithContext(context.TODO()) + // TODO handle group changes properly + portal.UpdateInfo(ctx, source, nil, groupMeta.GetRevision()) +} + +func (portal *Portal) handleSignalReaction(sender *Puppet, react *signalpb.DataMessage_Reaction, ts uint64) { + log := portal.log.With(). + Str("action", "handle signal reaction"). + Str("sender_uuid", sender.SignalID.String()). + Uint64("target_msg_ts", react.GetTargetSentTimestamp()). + Str("target_msg_sender", react.GetTargetAuthorAci()). + Bool("remove", react.GetRemove()). + Logger() + ctx := log.WithContext(context.TODO()) + targetSenderUUID, err := uuid.Parse(react.GetTargetAuthorAci()) + if err != nil { + log.Err(err).Msg("Failed to parse target message sender UUID") + return + } + targetMsg, err := portal.bridge.DB.Message.GetBySignalID(ctx, targetSenderUUID, react.GetTargetSentTimestamp(), 0, portal.Receiver) + if err != nil { + log.Err(err).Msg("Failed to get target message from database") + return + } else if targetMsg == nil { + log.Warn().Msg("Target message not found") + return + } + existingReaction, err := portal.bridge.DB.Reaction.GetBySignalID(ctx, targetMsg.Sender, targetMsg.Timestamp, sender.SignalID, portal.Receiver) + if err != nil { + log.Err(err).Msg("Failed to get existing reaction from database") + return + } + intent := sender.IntentFor(portal) + if existingReaction != nil { + _, err = intent.RedactEvent(ctx, portal.MXID, existingReaction.MXID, mautrix.ReqRedact{ + TxnID: "mxsg_unreact_" + existingReaction.MXID.String(), + }) + if err != nil { + log.Err(err).Msg("Failed to redact reaction") + } + if react.GetRemove() { + err = existingReaction.Delete(ctx) + if err != nil { + log.Err(err).Msg("Failed to remove reaction from database after redacting") + } + return + } + } else if react.GetRemove() { + log.Warn().Msg("Existing reaction for removal not found") + return + } + // Create a new message event with the reaction + content := &event.ReactionEventContent{ + RelatesTo: event.RelatesTo{ + Type: event.RelAnnotation, + Key: variationselector.Add(react.GetEmoji()), + EventID: targetMsg.MXID, + }, + } + resp, err := portal.sendMatrixEvent(ctx, intent, event.EventReaction, content, nil, int64(ts)) + if err != nil { + log.Err(err).Msg("Failed to send reaction") + return + } + if existingReaction == nil { + dbReaction := portal.bridge.DB.Reaction.New() + dbReaction.MXID = resp.EventID + dbReaction.RoomID = portal.MXID + dbReaction.SignalChatID = portal.ChatID + dbReaction.SignalReceiver = portal.Receiver + dbReaction.Author = sender.SignalID + dbReaction.MsgAuthor = targetMsg.Sender + dbReaction.MsgTimestamp = targetMsg.Timestamp + dbReaction.Emoji = react.GetEmoji() + err = dbReaction.Insert(ctx) + if err != nil { + log.Err(err).Msg("Failed to insert reaction to database") + } + } else { + existingReaction.Emoji = react.GetEmoji() + existingReaction.MXID = resp.EventID + err = existingReaction.Update(ctx) + if err != nil { + log.Err(err).Msg("Failed to update reaction in database") + } + } +} + +func (portal *Portal) handleSignalDelete(sender *Puppet, delete *signalpb.DataMessage_Delete, ts uint64) { + log := portal.log.With(). + Str("action", "handle signal delete"). + Str("sender_uuid", sender.SignalID.String()). + Uint64("target_msg_ts", delete.GetTargetSentTimestamp()). + Uint64("delete_ts", ts). + Logger() + ctx := log.WithContext(context.TODO()) + targetMsg, err := portal.bridge.DB.Message.GetAllPartsBySignalID(ctx, sender.SignalID, delete.GetTargetSentTimestamp(), portal.Receiver) + if err != nil { + log.Err(err).Msg("Failed to get target message from database") + return + } else if len(targetMsg) == 0 { + log.Warn().Msg("Target message not found") + return + } + intent := sender.IntentFor(portal) + for _, part := range targetMsg { + _, err = intent.RedactEvent(ctx, portal.MXID, part.MXID, mautrix.ReqRedact{ + TxnID: "mxsg_delete_" + part.MXID.String(), + }) + if err != nil { + log.Err(err). + Int("part_index", part.PartIndex). + Str("event_id", part.MXID.String()). + Msg("Failed to redact message") + } + err = part.Delete(ctx) + if err != nil { + log.Err(err). + Int("part_index", part.PartIndex). + Msg("Failed to delete message from database") + } + } +} + +func (portal *Portal) handleSignalNormalDataMessage(source *User, sender *Puppet, msg *signalpb.DataMessage) { + log := portal.log.With(). + Str("action", "handle signal message"). + Str("sender_uuid", sender.SignalID.String()). + Uint64("msg_ts", msg.GetTimestamp()). + Logger() + ctx := log.WithContext(context.TODO()) + if portal.MXID == "" { + log.Debug().Msg("Creating Matrix room from incoming message") + if err := portal.CreateMatrixRoom(ctx, source, msg.GetGroupV2().GetRevision()); err != nil { + log.Error().Err(err).Msg("Failed to create portal room") + return + } + } + + existingMessage, err := portal.bridge.DB.Message.GetBySignalID(ctx, sender.SignalID, msg.GetTimestamp(), 0, portal.Receiver) + if err != nil { + log.Err(err).Msg("Failed to check if message was already bridged") + return + } else if existingMessage != nil { + log.Debug().Msg("Ignoring duplicate message") + return + } + + intent := sender.IntentFor(portal) + ctx = context.WithValue(ctx, msgconvContextKeyIntent, intent) + converted := portal.MsgConv.ToMatrix(ctx, msg) + if portal.bridge.Config.Bridge.CaptionInMessage { + converted.MergeCaption() + } + for i, part := range converted.Parts { + resp, err := portal.sendMatrixEvent(ctx, intent, part.Type, part.Content, part.Extra, int64(converted.Timestamp)) + if err != nil { + log.Err(err).Int("part_index", i).Msg("Failed to send message to Matrix") + continue + } + portal.storeMessageInDB(ctx, resp.EventID, sender.SignalID, converted.Timestamp, i) + if converted.DisappearIn != 0 { + portal.addDisappearingMessage(ctx, resp.EventID, converted.DisappearIn, sender.SignalID == source.SignalID) + } + } +} + +func (portal *Portal) handleSignalEditMessage(sender *Puppet, timestamp uint64, msg *signalpb.DataMessage) { + log := portal.log.With(). + Str("action", "handle signal edit"). + Str("sender_uuid", sender.SignalID.String()). + Uint64("target_msg_ts", timestamp). + Uint64("edit_msg_ts", msg.GetTimestamp()). + Logger() + if portal.MXID == "" { + log.Debug().Msg("Dropping edit message in chat with no portal") + return + } + ctx := log.WithContext(context.TODO()) + targetMessage, err := portal.bridge.DB.Message.GetAllPartsBySignalID(ctx, sender.SignalID, timestamp, portal.Receiver) + if err != nil { + log.Err(err).Msg("Failed to get target message") + return + } else if len(targetMessage) == 0 { + log.Debug().Msg("Target message not found (edit may have been already handled)") + return + } + + intent := sender.IntentFor(portal) + ctx = context.WithValue(ctx, msgconvContextKeyIntent, intent) + converted := portal.MsgConv.ToMatrix(ctx, msg) + if portal.bridge.Config.Bridge.CaptionInMessage { + converted.MergeCaption() + } + if len(converted.Parts) != len(targetMessage) { + log.Error(). + Int("target_parts", len(targetMessage)). + Int("new_parts", len(converted.Parts)). + Msg("Mismatched number of parts in edit") + return + } + for i, part := range converted.Parts { + part.Content.SetEdit(targetMessage[i].MXID) + if part.Extra != nil { + part.Extra = map[string]any{ + "m.new_content": part.Extra, + } + } + _, err = portal.sendMatrixEvent(ctx, intent, part.Type, part.Content, part.Extra, int64(converted.Timestamp)) + if err != nil { + log.Err(err).Int("part_index", i).Msg("Failed to send edit to Matrix") + } + } + err = targetMessage[0].SetTimestamp(ctx, msg.GetTimestamp()) + if err != nil { + log.Err(err).Msg("Failed to update message edit timestamp in database") + } +} + +const SignalTypingTimeout = 15 * time.Second + +func (portal *Portal) handleSignalTypingMessage(sender *Puppet, msg *signalpb.TypingMessage) { + if portal.MXID == "" { + portal.log.Debug().Msg("Dropping typing message in chat with no portal") + return + } + ctx := context.TODO() + intent := sender.IntentFor(portal) + // Don't bridge double puppeted typing notifications to avoid echoing + if intent.IsCustomPuppet { + return + } + var err error + switch msg.GetAction() { + case signalpb.TypingMessage_STARTED: + _, err = intent.UserTyping(ctx, portal.MXID, true, SignalTypingTimeout) + case signalpb.TypingMessage_STOPPED: + _, err = intent.UserTyping(ctx, portal.MXID, false, 0) + } + if err != nil { + portal.log.Err(err). + Str("user_id", sender.SignalID.String()). + Msg("Failed to handle Signal typing notification") + } +} + +func (portal *Portal) storeMessageInDB(ctx context.Context, eventID id.EventID, senderSignalID uuid.UUID, timestamp uint64, partIndex int) { + dbMessage := portal.bridge.DB.Message.New() + dbMessage.MXID = eventID + dbMessage.RoomID = portal.MXID + dbMessage.Sender = senderSignalID + dbMessage.Timestamp = timestamp + dbMessage.PartIndex = partIndex + dbMessage.SignalChatID = portal.ChatID + dbMessage.SignalReceiver = portal.Receiver + err := dbMessage.Insert(ctx) + if err != nil { + portal.log.Err(err).Msg("Failed to insert message into database") + } +} + +func (portal *Portal) addDisappearingMessage(ctx context.Context, eventID id.EventID, expireInSeconds uint32, startTimerNow bool) { + portal.bridge.disappearingMessagesManager.AddDisappearingMessage(ctx, eventID, portal.MXID, time.Duration(expireInSeconds)*time.Second, startTimerNow) +} + +func (portal *Portal) MarkDelivered(ctx context.Context, msg *database.Message) { + if !portal.IsPrivateChat() { + return + } + portal.bridge.SendRawMessageCheckpoint(&status.MessageCheckpoint{ + EventID: msg.MXID, + RoomID: portal.MXID, + Step: status.MsgStepRemote, + Timestamp: jsontime.UnixMilliNow(), + Status: status.MsgStatusDelivered, + ReportedBy: status.MsgReportedByBridge, + }) + portal.sendStatusEvent(ctx, msg.MXID, "", nil, &[]id.UserID{portal.MainIntent().UserID}) +} + +type customReadReceipt struct { + Timestamp int64 `json:"ts,omitempty"` + DoublePuppetSource string `json:"fi.mau.double_puppet_source,omitempty"` +} + +type customReadMarkers struct { + mautrix.ReqSetReadMarkers + ReadExtra customReadReceipt `json:"com.beeper.read.extra"` + FullyReadExtra customReadReceipt `json:"com.beeper.fully_read.extra"` +} + +func (portal *Portal) SendReadReceipt(ctx context.Context, sender *Puppet, msg *database.Message) error { + intent := sender.IntentFor(portal) + if intent.IsCustomPuppet { + extra := customReadReceipt{DoublePuppetSource: portal.bridge.Name} + return intent.SetReadMarkers(ctx, portal.MXID, &customReadMarkers{ + ReqSetReadMarkers: mautrix.ReqSetReadMarkers{ + Read: msg.MXID, + FullyRead: msg.MXID, + }, + ReadExtra: extra, + FullyReadExtra: extra, + }) + } else { + return intent.MarkRead(ctx, portal.MXID, msg.MXID) + } +} + +func typingDiff(prev, new []id.UserID) (started, stopped []id.UserID) { +OuterNew: + for _, userID := range new { + for _, previousUserID := range prev { + if userID == previousUserID { + continue OuterNew + } + } + started = append(started, userID) + } +OuterPrev: + for _, userID := range prev { + for _, previousUserID := range new { + if userID == previousUserID { + continue OuterPrev + } + } + stopped = append(stopped, userID) + } + return +} + +func (portal *Portal) setTyping(userIDs []id.UserID, isTyping bool) { + for _, userID := range userIDs { + user := portal.bridge.GetUserByMXID(userID) + if user == nil || !user.IsLoggedIn() { + continue + } + + // Check to see if portal.ChatID is a standard UUID (with dashes) + // Note: not handling sending to a group right now, since that will + // require SenderKey sending to not be terrible + if portal.IsPrivateChat() { + // this is a 1:1 chat + portal.log.Debug().Msg("Sending Typing event to Signal") + ctx := context.TODO() + typingMessage := signalmeow.TypingMessage(isTyping) + result := user.Client.SendMessage(ctx, portal.UserID(), typingMessage) + if !result.WasSuccessful { + portal.log.Err(result.FailedSendResult.Error).Msg("Error sending event to Signal") + } + } + } +} + +func (portal *Portal) HandleMatrixTyping(newTyping []id.UserID) { + if portal.IsNoteToSelf() { + return + } + + portal.currentlyTypingLock.Lock() + defer portal.currentlyTypingLock.Unlock() + startedTyping, stoppedTyping := typingDiff(portal.currentlyTyping, newTyping) + portal.currentlyTyping = newTyping + portal.setTyping(startedTyping, true) + portal.setTyping(stoppedTyping, false) +} + +func (portal *Portal) HandleMatrixReadReceipt(brSender bridge.User, eventID id.EventID, receipt event.ReadReceipt) { + portal.handleMatrixReadReceipt(brSender.(*User), eventID, uint64(receipt.Timestamp.UnixMilli()), true) +} + +func (portal *Portal) handleMatrixReadReceipt(sender *User, eventID id.EventID, maxTimestamp uint64, isExplicit bool) { + if !sender.IsLoggedIn() { + return + } + logWith := portal.log.With(). + Str("event_id", eventID.String()). + Str("sender", sender.MXID.String()). + Bool("explicit", isExplicit) + if isExplicit { + logWith = logWith.Str("action", "handle matrix read receipt") + } + log := logWith.Logger() + log.Debug().Msg("Handling Matrix read receipt") + portal.ScheduleDisappearing() + ctx := log.WithContext(context.TODO()) + + if isExplicit { + dbMessage, _ := portal.bridge.DB.Message.GetByMXID(ctx, eventID) + if dbMessage != nil { + maxTimestamp = dbMessage.Timestamp + } + } + prevLastReadTS := sender.GetLastReadTS(ctx, portal.PortalKey) + if maxTimestamp <= prevLastReadTS { + log.Debug(). + Uint64("prev_last_read_ts", prevLastReadTS). + Uint64("max_timestamp", maxTimestamp). + Msg("Ignoring read receipt older than last read timestamp") + return + } + minTimestamp := prevLastReadTS + if minTimestamp == 0 { + minTimestamp = maxTimestamp - 2000 + } + dbMessages, err := portal.bridge.DB.Message.GetAllBetweenTimestamps(ctx, portal.PortalKey, minTimestamp, maxTimestamp) + if err != nil { + log.Err(err).Msg("Failed to get messages between timestamps to mark as read") + return + } + messagesToRead := map[uuid.UUID][]uint64{} + for _, msg := range dbMessages { + messagesToRead[msg.Sender] = append(messagesToRead[msg.Sender], msg.Timestamp) + } + // Always update last read ts for non-explicit read receipts, because that means there's a message about to be sent + if (len(dbMessages) > 0 || !isExplicit) && maxTimestamp != prevLastReadTS { + sender.SetLastReadTS(ctx, portal.PortalKey, maxTimestamp) + } + if isExplicit || len(messagesToRead) > 0 { + log.Debug(). + Any("targets", messagesToRead). + Uint64("prev_last_read_ts", prevLastReadTS). + Uint64("min_timestamp", minTimestamp). + Uint64("max_timestamp", maxTimestamp). + Msg("Collected read receipt target messages") + } + + // TODO send sync message manually containing all read receipts instead of a separate message for each recipient + + for destination, messages := range messagesToRead { + // Don't send read receipts for own messages + if destination == sender.SignalID { + continue + } + // Don't use portal.sendSignalMessage because we're sending this straight to + // who sent the original message, not the portal's ChatID + ctx, cancel := context.WithTimeout(ctx, 10*time.Second) + result := sender.Client.SendMessage(ctx, destination, signalmeow.ReadReceptMessageForTimestamps(messages)) + cancel() + if !result.WasSuccessful { + log.Err(result.FailedSendResult.Error). + Stringer("destination", destination). + Uints64("message_ids", messages). + Msg("Failed to send read receipt to Signal") + } else { + log.Debug(). + Stringer("destination", destination). + Uints64("message_ids", messages). + Msg("Sent read receipt to Signal") + } + } +} + +func (portal *Portal) sendMainIntentMessage(ctx context.Context, content *event.MessageEventContent) (*mautrix.RespSendEvent, error) { + return portal.sendMatrixEvent(ctx, portal.MainIntent(), event.EventMessage, content, nil, 0) +} + +func (portal *Portal) encrypt(ctx context.Context, intent *appservice.IntentAPI, content *event.Content, eventType event.Type) (event.Type, error) { + if !portal.Encrypted || portal.bridge.Crypto == nil { + return eventType, nil + } + intent.AddDoublePuppetValue(content) + // TODO maybe the locking should be inside mautrix-go? + portal.encryptLock.Lock() + defer portal.encryptLock.Unlock() + err := portal.bridge.Crypto.Encrypt(ctx, portal.MXID, eventType, content) + if err != nil { + return eventType, fmt.Errorf("failed to encrypt event: %w", err) + } + return event.EventEncrypted, nil +} + +func (portal *Portal) sendMatrixEvent(ctx context.Context, intent *appservice.IntentAPI, eventType event.Type, content any, extraContent map[string]any, timestamp int64) (*mautrix.RespSendEvent, error) { + wrappedContent := event.Content{Parsed: content, Raw: extraContent} + if eventType != event.EventReaction { + var err error + eventType, err = portal.encrypt(ctx, intent, &wrappedContent, eventType) + if err != nil { + return nil, err + } + } + + _, _ = intent.UserTyping(ctx, portal.MXID, false, 0) + return intent.SendMassagedMessageEvent(ctx, portal.MXID, eventType, &wrappedContent, timestamp) +} + +func (portal *Portal) getEncryptionEventContent() (evt *event.EncryptionEventContent) { + evt = &event.EncryptionEventContent{Algorithm: id.AlgorithmMegolmV1} + if rot := portal.bridge.Config.Bridge.Encryption.Rotation; rot.EnableCustom { + evt.RotationPeriodMillis = rot.Milliseconds + evt.RotationPeriodMessages = rot.Messages + } + return +} + +func (portal *Portal) shouldSetDMRoomMetadata() bool { + return !portal.IsPrivateChat() || + portal.bridge.Config.Bridge.PrivateChatPortalMeta == "always" || + (portal.IsEncrypted() && portal.bridge.Config.Bridge.PrivateChatPortalMeta != "never") +} + +func (portal *Portal) ensureUserInvited(ctx context.Context, user *User) bool { + return user.ensureInvited(ctx, portal.MainIntent(), portal.MXID, portal.IsPrivateChat()) +} + +func (portal *Portal) CreateMatrixRoom(ctx context.Context, user *User, groupRevision uint32) error { + portal.roomCreateLock.Lock() + defer portal.roomCreateLock.Unlock() + if portal.MXID != "" { + portal.log.Debug().Msg("Not creating room: already exists") + return nil + } + portal.log.Debug().Msg("Creating matrix room") + + intent := portal.MainIntent() + + if err := intent.EnsureRegistered(ctx); err != nil { + portal.log.Error().Err(err).Msg("failed to ensure registered") + return err + } + + bridgeInfoStateKey, bridgeInfo := portal.getBridgeInfo() + initialState := []*event.Event{{ + Type: event.StateBridge, + Content: event.Content{Parsed: bridgeInfo}, + StateKey: &bridgeInfoStateKey, + }, { + // TODO remove this once https://github.com/matrix-org/matrix-doc/pull/2346 is in spec + Type: event.StateHalfShotBridge, + Content: event.Content{Parsed: bridgeInfo}, + StateKey: &bridgeInfoStateKey, + }} + + if !portal.AvatarURL.IsEmpty() { + initialState = append(initialState, &event.Event{ + Type: event.StateRoomAvatar, + Content: event.Content{Parsed: &event.RoomAvatarEventContent{ + URL: portal.AvatarURL, + }}, + }) + } + + creationContent := make(map[string]interface{}) + if !portal.bridge.Config.Bridge.FederateRooms { + creationContent["m.federate"] = false + } + + var invite []id.UserID + autoJoinInvites := portal.bridge.SpecVersions.Supports(mautrix.BeeperFeatureAutojoinInvites) + if autoJoinInvites { + invite = append(invite, user.MXID) + } + + if portal.bridge.Config.Bridge.Encryption.Default { + initialState = append(initialState, &event.Event{ + Type: event.StateEncryption, + Content: event.Content{ + Parsed: portal.getEncryptionEventContent(), + }, + }) + portal.Encrypted = true + + if portal.IsPrivateChat() { + invite = append(invite, portal.bridge.Bot.UserID) + } + } + + var dmPuppet *Puppet + var groupInfo *signalmeow.Group + if portal.IsPrivateChat() { + dmPuppet = portal.GetDMPuppet() + dmPuppet.UpdateInfo(ctx, user, nil) + portal.UpdateDMInfo(ctx, false) + } else { + groupInfo = portal.UpdateGroupInfo(ctx, user, nil, groupRevision, true) + if groupInfo == nil { + portal.log.Error().Msg("Didn't get group info after updating portal") + return errors.New("failed to get group info") + } + invite = append(invite, portal.SyncParticipants(ctx, user, groupInfo)...) + } + + req := &mautrix.ReqCreateRoom{ + Visibility: "private", + Name: portal.Name, + Topic: portal.Topic, + Invite: invite, + Preset: "private_chat", + IsDirect: portal.IsPrivateChat(), + InitialState: initialState, + CreationContent: creationContent, + + BeeperAutoJoinInvites: autoJoinInvites, + } + resp, err := intent.CreateRoom(ctx, req) + if err != nil { + portal.log.Warn().Err(err).Msg("failed to create room") + return err + } + portal.log = portal.log.With().Stringer("room_id", resp.RoomID).Logger() + + portal.NameSet = len(req.Name) > 0 + portal.TopicSet = len(req.Topic) > 0 + portal.AvatarSet = !portal.AvatarURL.IsEmpty() + portal.MXID = resp.RoomID + portal.bridge.portalsLock.Lock() + portal.bridge.portalsByMXID[portal.MXID] = portal + portal.bridge.portalsLock.Unlock() + err = portal.Update(ctx) + if err != nil { + portal.log.Err(err).Msg("Failed to save portal room ID") + return err + } + portal.log.Info().Msg("Created matrix room for portal") + + if !autoJoinInvites { + if !portal.IsPrivateChat() { + portal.SyncParticipants(ctx, user, groupInfo) + } else if portal.Encrypted { + err = portal.bridge.Bot.EnsureJoined(ctx, portal.MXID, appservice.EnsureJoinedParams{BotOverride: portal.MainIntent().Client}) + if err != nil { + portal.log.Error().Err(err).Msg("Failed to ensure bridge bot is joined to private chat portal") + } + } + user.ensureInvited(ctx, portal.MainIntent(), portal.MXID, portal.IsPrivateChat()) + } + user.syncChatDoublePuppetDetails(portal, true) + go portal.addToPersonalSpace(portal.log.WithContext(context.TODO()), user) + + if portal.IsPrivateChat() { + user.UpdateDirectChats(ctx, map[id.UserID][]id.RoomID{ + dmPuppet.MXID: {portal.MXID}, + }) + } + + return nil +} + +func (portal *Portal) GetDMPuppet() *Puppet { + if !portal.IsPrivateChat() { + return nil + } + return portal.bridge.GetPuppetBySignalID(portal.UserID()) +} + +func (portal *Portal) UpdateInfo(ctx context.Context, source *User, groupInfo *signalmeow.Group, revision uint32) { + if portal.IsPrivateChat() { + portal.UpdateDMInfo(ctx, false) + return + } + groupInfo = portal.UpdateGroupInfo(ctx, source, groupInfo, revision, false) + if groupInfo != nil { + portal.SyncParticipants(ctx, source, groupInfo) + } +} + +const PrivateChatTopic = "Signal private chat" +const NoteToSelfName = "Signal Note to Self" + +func (portal *Portal) UpdateDMInfo(ctx context.Context, forceSave bool) { + log := zerolog.Ctx(ctx).With(). + Str("function", "UpdateDMInfo"). + Logger() + log.Trace().Msg("Updating portal info") + ctx = log.WithContext(ctx) + puppet := portal.GetDMPuppet() + + update := forceSave + if portal.UserID() == portal.Receiver { + noteToSelfAvatar := portal.bridge.Config.Bridge.NoteToSelfAvatar.ParseOrIgnore() + avatarHash := sha256.Sum256([]byte(noteToSelfAvatar.String())) + + update = portal.updateName(ctx, NoteToSelfName) || update + update = portal.updateAvatarWithMXC(ctx, "notetoself", hex.EncodeToString(avatarHash[:]), noteToSelfAvatar) || update + } else if portal.shouldSetDMRoomMetadata() { + update = portal.updateName(ctx, puppet.Name) || update + update = portal.updateAvatarWithMXC(ctx, puppet.AvatarPath, puppet.AvatarHash, puppet.AvatarURL) || update + } + topic := PrivateChatTopic + if portal.bridge.Config.Bridge.NumberInTopic && puppet.Number != "" { + topic = fmt.Sprintf("%s with %s", topic, puppet.Number) + } + update = portal.updateTopic(ctx, topic) || update + if update { + err := portal.Update(ctx) + if err != nil { + log.Err(err).Msg("Failed to save portal in database after updatin group info") + } + portal.UpdateBridgeInfo(ctx) + } +} + +func (portal *Portal) UpdateGroupInfo(ctx context.Context, source *User, info *signalmeow.Group, revision uint32, forceFetch bool) *signalmeow.Group { + logWith := zerolog.Ctx(ctx).With(). + Str("function", "UpdateGroupInfo"). + Uint32("revision", revision). + Stringer("source_user_mxid", source.MXID) + if info != nil { + logWith = logWith.Uint32("info_revision", info.Revision) + } + log := logWith.Logger() + if info == nil { + if revision <= portal.Revision && !forceFetch { + log.Debug().Msg("Not fetching group info to update portal: given revision is not newer") + return nil + } + log.Debug().Msg("Fetching group info to update portal") + var err error + info, err = source.Client.RetrieveGroupByID(ctx, portal.GroupID(), revision) + if err != nil { + log.Err(err). + Stringer("source_user_id", source.MXID). + Msg("Failed to fetch group info") + return nil + } + } + if portal.Revision > info.Revision { + log.Debug().Uint32("current_revision", portal.Revision).Msg("Not updating portal with data from older revision") + return info + } + logEvt := log.Trace() + if portal.Revision != info.Revision { + logEvt = log.Debug() + } + logEvt.Uint32("current_revision", portal.Revision).Msg("Updating portal info") + ctx = log.WithContext(ctx) + update := false + if portal.Revision < info.Revision { + portal.Revision = info.Revision + update = true + } + update = portal.updateName(ctx, info.Title) || update + update = portal.updateTopic(ctx, info.Description) || update + update = portal.updateAvatarWithInfo(ctx, source, info) || update + update = portal.updateExpirationTimer(ctx, info.DisappearingMessagesDuration) || update + if update { + err := portal.Update(ctx) + if err != nil { + log.Err(err).Msg("Failed to save portal in database after updatin group info") + } + portal.UpdateBridgeInfo(ctx) + } + return info +} + +func (portal *Portal) updateExpirationTimer(ctx context.Context, newExpirationTimer uint32) bool { + if portal.ExpirationTime == newExpirationTimer { + return false + } + portal.ExpirationTime = newExpirationTimer + if portal.MXID != "" { + msg := portal.MsgConv.ConvertDisappearingTimerChangeToMatrix(ctx, newExpirationTimer, false) + _, err := portal.sendMainIntentMessage(ctx, msg.Content) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to send notice about disappearing message timer changing") + } + } + return true +} + +func (portal *Portal) updateName(ctx context.Context, newName string) bool { + if portal.Name == newName && (portal.NameSet || portal.MXID == "") { + return false + } + portal.Name = newName + portal.NameSet = false + if portal.MXID != "" { + _, err := portal.MainIntent().SetRoomName(ctx, portal.MXID, portal.Name) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to update room name") + } else { + portal.NameSet = true + } + } + return true +} + +func (portal *Portal) updateTopic(ctx context.Context, newTopic string) bool { + if portal.Topic == newTopic && (portal.TopicSet || portal.MXID == "") { + return false + } + portal.Topic = newTopic + portal.TopicSet = false + if portal.MXID != "" { + _, err := portal.MainIntent().SetRoomTopic(ctx, portal.MXID, portal.Topic) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to update room topic") + } else { + portal.TopicSet = true + } + } + return true +} + +func (portal *Portal) updateAvatarWithInfo(ctx context.Context, source *User, group *signalmeow.Group) bool { + // If the avatar path is different, the avatar probably changed + if portal.AvatarPath == group.AvatarPath && + // If the avatar mxc isn't set, we need to reupload it (except if the avatar is unset in Signal) + (!portal.AvatarURL.IsEmpty() || group.AvatarPath == "") && + // If the avatar isn't set in the room, we need to update the room state (except if there's no Matrix room yet) + (portal.AvatarSet || portal.MXID == "") { + return false + } + if portal.AvatarPath == "" { + portal.AvatarPath = "" + portal.AvatarSet = false + portal.AvatarURL = id.ContentURI{} + portal.AvatarHash = "" + // Just clear the Matrix room avatar and return + portal.updateAvatarInRoom(ctx) + return true + } + log := zerolog.Ctx(ctx) + log.Debug().Str("avatar_path", portal.AvatarPath).Msg("Downloading new group avatar from Signal") + avatarBytes, err := source.Client.DownloadGroupAvatar(ctx, group) + if err != nil { + log.Err(err).Msg("Failed to download new avatar for portal") + return true + } + hash := sha256.Sum256(avatarBytes) + newAvatarHash := hex.EncodeToString(hash[:]) + if portal.AvatarHash == newAvatarHash && (portal.AvatarSet || portal.MXID == "") { + // No need to change anything else, but save the new path to the database + return true + } + portal.AvatarPath = group.AvatarPath + portal.AvatarSet = false + portal.AvatarURL = id.ContentURI{} + portal.AvatarHash = newAvatarHash + log.Debug().Str("avatar_hash", portal.AvatarHash).Msg("Uploading new group avatar to Matrix") + resp, err := portal.MainIntent().UploadBytes(ctx, avatarBytes, http.DetectContentType(avatarBytes)) + if err != nil { + log.Err(err).Msg("Failed to upload new avatar for portal") + } else { + portal.AvatarURL = resp.ContentURI + portal.updateAvatarInRoom(ctx) + } + return true +} + +func (portal *Portal) updateAvatarWithMXC(ctx context.Context, newAvatarPath, newAvatarHash string, newAvatarURI id.ContentURI) bool { + if portal.AvatarHash == newAvatarHash && (portal.AvatarSet || portal.MXID == "") { + return false + } + portal.AvatarPath = newAvatarPath + portal.AvatarHash = newAvatarHash + portal.AvatarURL = newAvatarURI + portal.AvatarSet = false + portal.updateAvatarInRoom(ctx) + return true +} + +func (portal *Portal) updateAvatarInRoom(ctx context.Context) { + if portal.MXID == "" || portal.AvatarSet { + return + } + zerolog.Ctx(ctx).Debug(). + Str("avatar_path", portal.AvatarPath). + Str("avatar_hash", portal.AvatarHash). + Stringer("avatar_mxc", portal.AvatarURL). + Msg("Updating avatar in Matrix room") + _, err := portal.MainIntent().SetRoomAvatar(ctx, portal.MXID, portal.AvatarURL) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to update room avatar") + } else { + portal.AvatarSet = true + } +} + +func (portal *Portal) SyncParticipants(ctx context.Context, source *User, info *signalmeow.Group) []id.UserID { + log := zerolog.Ctx(ctx) + userIDs := make([]id.UserID, 0, len(info.Members)) + for _, member := range info.Members { + if member.UserID == source.SignalID { + continue + } + puppet := portal.bridge.GetPuppetBySignalID(member.UserID) + if puppet == nil { + log.Warn().Stringer("signal_user_id", member.UserID).Msg("Couldn't get puppet for group member") + continue + } + puppet.UpdateInfo(ctx, source, nil) + intent := puppet.IntentFor(portal) + userIDs = append(userIDs, intent.UserID) + if portal.MXID != "" { + err := intent.EnsureJoined(ctx, portal.MXID) + if err != nil { + log.Err(err).Stringer("signal_user_id", member.UserID).Msg("Failed to ensure user is joined to portal") + } + } + } + // TODO kick extra members on Matrix, handle pending and requesting participants on Signal + return userIDs +} + +func (portal *Portal) getBridgeInfoStateKey() string { + return fmt.Sprintf("net.maunium.signal://signal/%s", portal.ChatID) +} + +func (portal *Portal) ScheduleDisappearing() { + portal.bridge.disappearingMessagesManager.ScheduleDisappearingForRoom(context.TODO(), portal.MXID) +} + +func (portal *Portal) addToPersonalSpace(ctx context.Context, user *User) bool { + spaceID := user.GetSpaceRoom(ctx) + if len(spaceID) == 0 || user.IsInSpace(ctx, portal.PortalKey) { + return false + } + _, err := portal.bridge.Bot.SendStateEvent(ctx, spaceID, event.StateSpaceChild, portal.MXID.String(), &event.SpaceChildEventContent{ + Via: []string{portal.bridge.Config.Homeserver.Domain}, + }) + if err != nil { + zerolog.Ctx(ctx).Err(err). + Str("user_id", user.MXID.String()). + Str("space_id", spaceID.String()). + Msg("Failed to add room to user's personal filtering space") + return false + } else { + zerolog.Ctx(ctx).Debug(). + Str("user_id", user.MXID.String()). + Str("space_id", spaceID.String()). + Msg("Added room to user's personal filtering space") + user.MarkInSpace(ctx, portal.PortalKey) + return true + } +} + +func (portal *Portal) HasRelaybot() bool { + return portal.bridge.Config.Bridge.Relay.Enabled && len(portal.RelayUserID) > 0 +} + +func (portal *Portal) addRelaybotFormat(ctx context.Context, userID id.UserID, evt *event.Event, content *event.MessageEventContent) bool { + member := portal.MainIntent().Member(ctx, portal.MXID, userID) + if member == nil { + member = &event.MemberEventContent{} + } + // Stickers can't have captions, so force them into images when relaying + if evt.Type == event.EventSticker { + content.MsgType = event.MsgImage + evt.Type = event.EventMessage + } + content.EnsureHasHTML() + data, err := portal.bridge.Config.Bridge.Relay.FormatMessage(content, userID, *member) + if err != nil { + portal.log.Err(err).Msg("Failed to apply relaybot format") + } + content.FormattedBody = data + // Force FileName field so the formatted body is used as a caption + if content.FileName == "" { + content.FileName = content.Body + } + return true +} + +func (portal *Portal) Delete() { + err := portal.Portal.Delete(context.TODO()) + if err != nil { + portal.log.Err(err).Msg("Failed to delete portal from db") + } + portal.bridge.portalsLock.Lock() + delete(portal.bridge.portalsByID, portal.PortalKey) + if len(portal.MXID) > 0 { + delete(portal.bridge.portalsByMXID, portal.MXID) + } + if portal.Receiver == uuid.Nil { + portal.bridge.usersLock.Lock() + for _, user := range portal.bridge.usersBySignalID { + user.RemoveInSpaceCache(portal.PortalKey) + } + portal.bridge.usersLock.Unlock() + } else { + user := portal.bridge.GetUserBySignalID(portal.Receiver) + if user != nil { + user.RemoveInSpaceCache(portal.PortalKey) + } + } + portal.bridge.portalsLock.Unlock() +} + +func (portal *Portal) Cleanup(ctx context.Context, puppetsOnly bool) { + portal.bridge.CleanupRoom(ctx, &portal.log, portal.MainIntent(), portal.MXID, puppetsOnly) +} + +func (br *SignalBridge) CleanupRoom(ctx context.Context, log *zerolog.Logger, intent *appservice.IntentAPI, mxid id.RoomID, puppetsOnly bool) { + if len(mxid) == 0 { + return + } + if br.SpecVersions.Supports(mautrix.BeeperFeatureRoomYeeting) { + err := intent.BeeperDeleteRoom(ctx, mxid) + if err == nil || errors.Is(err, mautrix.MNotFound) { + return + } + log.Warn().Err(err).Msg("Failed to delete room using beeper yeet endpoint, falling back to normal behavior") + } + members, err := intent.JoinedMembers(ctx, mxid) + if err != nil { + log.Err(err).Msg("Failed to get portal members for cleanup") + return + } + for member := range members.Joined { + if member == intent.UserID { + continue + } + puppet := br.GetPuppetByMXID(member) + if puppet != nil { + _, err = puppet.DefaultIntent().LeaveRoom(ctx, mxid) + if err != nil { + log.Err(err).Msg("Failed to leave as puppet while cleaning up portal") + } + } else if !puppetsOnly { + _, err = intent.KickUser(ctx, mxid, &mautrix.ReqKickUser{UserID: member, Reason: "Deleting portal"}) + if err != nil { + log.Err(err).Msg("Failed to kick user while cleaning up portal") + } + } + } + _, err = intent.LeaveRoom(ctx, mxid) + if err != nil { + log.Err(err).Msg("Failed to leave room while cleaning up portal") + } +} diff --git a/provisioning.go b/provisioning.go new file mode 100644 index 0000000..7256512 --- /dev/null +++ b/provisioning.go @@ -0,0 +1,646 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber +// +// 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 main + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + _ "net/http/pprof" + "strconv" + "strings" + "sync" + "time" + + "github.com/beeper/libserv/pkg/requestlog" + "github.com/google/uuid" + "github.com/gorilla/mux" + "github.com/rs/zerolog" + "github.com/rs/zerolog/hlog" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/pkg/signalmeow" +) + +type provisioningContextKey int + +const ( + provisioningUserKey provisioningContextKey = iota +) + +type provisioningHandle struct { + id int + context context.Context + cancel context.CancelFunc + channel <-chan signalmeow.ProvisioningResponse +} + +type ProvisioningAPI struct { + bridge *SignalBridge + log zerolog.Logger + provisioningHandles []*provisioningHandle + provisioningUsers map[string]int + provisioningMutexes map[string]*sync.Mutex +} + +func (prov *ProvisioningAPI) Init() { + prov.log.Debug().Str("prefix", prov.bridge.Config.Bridge.Provisioning.Prefix).Msg("Enabling provisioning API") + prov.provisioningUsers = make(map[string]int) + prov.provisioningMutexes = make(map[string]*sync.Mutex) + r := prov.bridge.AS.Router.PathPrefix(prov.bridge.Config.Bridge.Provisioning.Prefix).Subrouter() + r.Use(hlog.NewHandler(prov.log)) + r.Use(requestlog.AccessLogger(true)) + r.Use(prov.AuthMiddleware) + r.HandleFunc("/v2/link/new", prov.LinkNew).Methods(http.MethodPost) + r.HandleFunc("/v2/link/wait/scan", prov.LinkWaitForScan).Methods(http.MethodPost) + r.HandleFunc("/v2/link/wait/account", prov.LinkWaitForAccount).Methods(http.MethodPost) + r.HandleFunc("/v2/logout", prov.Logout).Methods(http.MethodPost) + r.HandleFunc("/v2/resolve_identifier/{phonenum}", prov.ResolveIdentifier).Methods(http.MethodGet) + r.HandleFunc("/v2/pm/{phonenum}", prov.StartPM).Methods(http.MethodPost) + + if prov.bridge.Config.Bridge.Provisioning.DebugEndpoints { + prov.log.Debug().Msg("Enabling debug API at /debug") + r := prov.bridge.AS.Router.PathPrefix("/debug").Subrouter() + r.Use(prov.AuthMiddleware) + r.PathPrefix("/pprof").Handler(http.DefaultServeMux) + } +} + +func jsonResponse(w http.ResponseWriter, status int, response any) { + w.Header().Add("Content-Type", "application/json") + w.WriteHeader(status) + _ = json.NewEncoder(w).Encode(response) +} + +func (prov *ProvisioningAPI) AuthMiddleware(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + auth := strings.TrimPrefix(r.Header.Get("Authorization"), "Bearer ") + if auth != prov.bridge.Config.Bridge.Provisioning.SharedSecret { + zerolog.Ctx(r.Context()).Warn().Msg("Authentication token does not match shared secret") + jsonResponse(w, http.StatusForbidden, &mautrix.RespError{ + Err: "Authentication token does not match shared secret", + ErrCode: mautrix.MForbidden.ErrCode, + }) + return + } + userID := r.URL.Query().Get("user_id") + user := prov.bridge.GetUserByMXID(id.UserID(userID)) + h.ServeHTTP(w, r.WithContext(context.WithValue(r.Context(), provisioningUserKey, user))) + }) +} + +type Error struct { + Success bool `json:"success"` + Error string `json:"error"` + ErrCode string `json:"errcode"` +} + +type Response struct { + Success bool `json:"success"` + Status string `json:"status"` + + // For response in LinkNew + SessionID string `json:"session_id,omitempty"` + URI string `json:"uri,omitempty"` + + // For response in LinkWaitForAccount + UUID string `json:"uuid,omitempty"` + Number string `json:"number,omitempty"` + + // For response in ResolveIdentifier + *ResolveIdentifierResponse +} + +type ResolveIdentifierResponse struct { + RoomID id.RoomID `json:"room_id"` + ChatID ResolveIdentifierResponseChatID `json:"chat_id"` + JustCreated bool `json:"just_created"` + OtherUser ResolveIdentifierResponseOtherUser `json:"other_user"` +} + +type ResolveIdentifierResponseChatID struct { + UUID string `json:"uuid"` + Number string `json:"number"` +} + +type ResolveIdentifierResponseOtherUser struct { + MXID string `json:"mxid"` + DisplayName string `json:"displayname"` + AvatarURL string `json:"avatar_url"` +} + +func (prov *ProvisioningAPI) resolveIdentifier(ctx context.Context, user *User, inputPhone string) (int, *ResolveIdentifierResponse, error) { + if user.Client == nil { + return http.StatusUnauthorized, nil, errors.New("not currently connected to Signal") + } + e164Number, err := strconv.ParseUint(numberCleaner.Replace(inputPhone), 10, 64) + if err != nil { + return http.StatusBadRequest, nil, fmt.Errorf("error parsing phone number: %w", err) + } + e164String := fmt.Sprintf("+%d", e164Number) + var targetUUID uuid.UUID + if contact, err := user.Client.ContactByE164(ctx, e164String); err != nil { + return http.StatusInternalServerError, nil, fmt.Errorf("error looking up number in local contact list: %w", err) + } else if contact != nil { + targetUUID = contact.UUID + } else if resp, err := user.Client.LookupPhone(ctx, e164Number); err != nil { + return http.StatusInternalServerError, nil, fmt.Errorf("error looking up number on server: %w", err) + } else if resp[e164Number].ACI != uuid.Nil { + targetUUID = resp[e164Number].ACI + err = user.Client.Store.ContactStore.UpdatePhone(ctx, targetUUID, e164String) + if err != nil { + zerolog.Ctx(ctx).Warn().Err(err).Msg("Failed to update phone number in user's contact store") + } + } else { + return http.StatusNotFound, nil, errors.New("user not found on Signal") + } + + portal := user.GetPortalByChatID(targetUUID.String()) + puppet := prov.bridge.GetPuppetBySignalID(targetUUID) + + return http.StatusOK, &ResolveIdentifierResponse{ + RoomID: portal.MXID, + ChatID: ResolveIdentifierResponseChatID{ + UUID: targetUUID.String(), + Number: e164String, + }, + OtherUser: ResolveIdentifierResponseOtherUser{ + MXID: puppet.MXID.String(), + DisplayName: puppet.Name, + AvatarURL: puppet.AvatarURL.String(), + }, + }, nil +} + +func (prov *ProvisioningAPI) ResolveIdentifier(w http.ResponseWriter, r *http.Request) { + user := r.Context().Value(provisioningUserKey).(*User) + phoneNum := mux.Vars(r)["phonenum"] + + log := prov.log.With(). + Str("action", "resolve_identifier"). + Str("user_id", user.MXID.String()). + Str("phone_num", phoneNum). + Logger() + ctx := log.WithContext(r.Context()) + log.Debug().Msg("resolving identifier") + + status, resp, err := prov.resolveIdentifier(ctx, user, phoneNum) + if err != nil { + errCode := "M_INTERNAL" + if status == http.StatusNotFound { + log.Debug().Msg("contact not found") + errCode = "M_NOT_FOUND" + } else { + log.Err(err).Msg("error looking up contact") + } + jsonResponse(w, status, Error{ + Success: false, + Error: err.Error(), + ErrCode: errCode, + }) + return + } + jsonResponse(w, status, Response{ + Success: true, + Status: "ok", + ResolveIdentifierResponse: resp, + }) +} + +func (prov *ProvisioningAPI) StartPM(w http.ResponseWriter, r *http.Request) { + user := r.Context().Value(provisioningUserKey).(*User) + phoneNum := mux.Vars(r)["phonenum"] + + log := prov.log.With(). + Str("action", "start_pm"). + Str("user_id", user.MXID.String()). + Str("phone_num", phoneNum). + Logger() + ctx := log.WithContext(r.Context()) + log.Debug().Msg("starting private message") + + status, resp, err := prov.resolveIdentifier(ctx, user, phoneNum) + if err != nil { + errCode := "M_INTERNAL" + if status == http.StatusNotFound { + log.Debug().Msg("contact not found") + errCode = "M_NOT_FOUND" + } else { + log.Err(err).Msg("error looking up contact") + } + jsonResponse(w, status, Error{ + Success: false, + Error: err.Error(), + ErrCode: errCode, + }) + return + } + + portal := user.GetPortalByChatID(resp.ChatID.UUID) + if portal.MXID == "" { + if err := portal.CreateMatrixRoom(r.Context(), user, 0); err != nil { + log.Err(err).Msg("error looking up contact") + jsonResponse(w, http.StatusInternalServerError, Error{ + Success: false, + Error: "Error creating Matrix room", + ErrCode: "M_INTERNAL", + }) + return + } + resp.JustCreated = true + resp.RoomID = portal.MXID + } + if resp.JustCreated { + status = http.StatusCreated + } + + jsonResponse(w, status, Response{ + Success: true, + Status: "ok", + ResolveIdentifierResponse: resp, + }) +} + +func (prov *ProvisioningAPI) mutexForUser(user *User) *sync.Mutex { + if _, ok := prov.provisioningMutexes[user.MXID.String()]; !ok { + prov.provisioningMutexes[user.MXID.String()] = &sync.Mutex{} + } + return prov.provisioningMutexes[user.MXID.String()] +} + +func (prov *ProvisioningAPI) newOrExistingSession(user *User) (newSessionLoggedIn bool, handle *provisioningHandle, err error) { + prov.mutexForUser(user).Lock() + defer prov.mutexForUser(user).Unlock() + + if existingSessionID, ok := prov.provisioningUsers[user.MXID.String()]; ok { + provisioningHandle := prov.provisioningHandles[existingSessionID] + return false, provisioningHandle, nil + } + + provChan, err := user.Login() + if err != nil { + return false, nil, fmt.Errorf("Error logging in: %w", err) + } + provisioningCtx, cancel := context.WithCancel(context.TODO()) + handle = &provisioningHandle{ + context: provisioningCtx, + cancel: cancel, + channel: provChan, + } + prov.provisioningHandles = append(prov.provisioningHandles, handle) + handle.id = len(prov.provisioningHandles) - 1 + prov.provisioningUsers[user.MXID.String()] = handle.id + return true, handle, nil +} + +func (prov *ProvisioningAPI) existingSession(user *User) (handle *provisioningHandle) { + prov.mutexForUser(user).Lock() + defer prov.mutexForUser(user).Unlock() + + if existingSessionID, ok := prov.provisioningUsers[user.MXID.String()]; ok { + provisioningHandle := prov.provisioningHandles[existingSessionID] + return provisioningHandle + } + return nil +} + +func (prov *ProvisioningAPI) clearSession(ctx context.Context, user *User) { + log := zerolog.Ctx(ctx).With().Str("function", "clearSession").Logger() + prov.mutexForUser(user).Lock() + defer prov.mutexForUser(user).Unlock() + + if existingSessionID, ok := prov.provisioningUsers[user.MXID.String()]; ok { + log.Debug().Int("existing_session_id", existingSessionID).Msg("clearing existing session") + if existingSessionID >= len(prov.provisioningHandles) { + log.Warn().Msg("session does not exist") + return + } + if prov.provisioningHandles[existingSessionID].cancel != nil { + prov.provisioningHandles[existingSessionID].cancel() + } + prov.provisioningHandles[existingSessionID] = nil + delete(prov.provisioningUsers, user.MXID.String()) + } else { + prov.log.Debug().Msg("no session found") + } +} + +func (prov *ProvisioningAPI) loginOrSendError(ctx context.Context, w http.ResponseWriter, user *User) (*provisioningHandle, error) { + newSessionLoggedIn, handle, err := prov.newOrExistingSession(user) + if err != nil { + return nil, err + } + if !newSessionLoggedIn { + zerolog.Ctx(ctx).Debug(). + Int("existing_provisioning_handle", handle.id). + Msg("user already has pending provisioning request, cancelling") + prov.clearSession(ctx, user) + _, handle, err = prov.newOrExistingSession(user) + if err != nil { + return nil, fmt.Errorf("error logging in after cancelling existing session: %w", err) + } + } + return handle, nil +} + +func (prov *ProvisioningAPI) checkSessionAndReturnHandle(ctx context.Context, w http.ResponseWriter, currentSession int) *provisioningHandle { + log := zerolog.Ctx(ctx).With().Str("function", "checkSessionAndReturnHandle").Logger() + user := ctx.Value(provisioningUserKey).(*User) + handle := prov.existingSession(user) + if handle == nil { + log.Warn().Msg("no session found") + jsonResponse(w, http.StatusNotFound, Error{ + Success: false, + Error: "No session found", + ErrCode: "M_NOT_FOUND", + }) + return nil + } + if handle.id != currentSession { + log.Warn(). + Int("handle_id", handle.id). + Int("current_session", currentSession). + Msg("session_id does not match user's session_id") + jsonResponse(w, http.StatusBadRequest, Error{ + Success: false, + Error: "session_id does not match user's session_id", + ErrCode: "M_BAD_JSON", + }) + return nil + } + return handle +} + +func (prov *ProvisioningAPI) LinkNew(w http.ResponseWriter, r *http.Request) { + user := r.Context().Value(provisioningUserKey).(*User) + log := prov.log.With(). + Str("action", "link_new"). + Str("user_id", user.MXID.String()). + Logger() + ctx := log.WithContext(r.Context()) + log.Debug().Msg("starting login") + + handle, err := prov.loginOrSendError(ctx, w, user) + if err != nil { + jsonResponse(w, http.StatusInternalServerError, Error{ + Success: false, + Error: err.Error(), + ErrCode: "M_INTERNAL", + }) + return + } + + log = log.With().Int("session_id", handle.id).Logger() + log.Debug().Msg("waiting for provisioning response") + + select { + case resp := <-handle.channel: + if resp.Err != nil || resp.State == signalmeow.StateProvisioningError { + log.Err(resp.Err).Msg("Error getting provisioning URL") + jsonResponse(w, http.StatusInternalServerError, Error{ + Success: false, + Error: resp.Err.Error(), + ErrCode: "M_INTERNAL", + }) + return + } + if resp.State != signalmeow.StateProvisioningURLReceived { + log.Err(resp.Err).Stringer("state", resp.State).Msg("unexpected state") + jsonResponse(w, http.StatusInternalServerError, Error{ + Success: false, + Error: fmt.Sprintf("Unexpected state %s", resp.State.String()), + ErrCode: "M_INTERNAL", + }) + return + } + + log.Debug().Str("provisioning_url", resp.ProvisioningURL).Msg("provisioning URL received") + jsonResponse(w, http.StatusOK, Response{ + Success: true, + Status: "provisioning_url_received", + SessionID: fmt.Sprintf("%d", handle.id), + URI: resp.ProvisioningURL, + }) + case <-time.After(30 * time.Second): + log.Warn().Msg("Timeout waiting for provisioning response (new)") + jsonResponse(w, http.StatusGatewayTimeout, Error{ + Success: false, + Error: "Timeout waiting for provisioning response (new)", + ErrCode: "M_TIMEOUT", + }) + } +} + +type LinkWaitForScanRequest struct { + SessionID string `json:"session_id"` +} + +func (prov *ProvisioningAPI) LinkWaitForScan(w http.ResponseWriter, r *http.Request) { + user := r.Context().Value(provisioningUserKey).(*User) + + var body LinkWaitForScanRequest + err := json.NewDecoder(r.Body).Decode(&body) + if err != nil { + jsonResponse(w, http.StatusBadRequest, Error{ + Success: false, + Error: "Error decoding JSON body", + ErrCode: "M_BAD_JSON", + }) + return + } + sessionID, err := strconv.Atoi(body.SessionID) + if err != nil { + jsonResponse(w, http.StatusBadRequest, Error{ + Success: false, + Error: "Error decoding session ID in JSON body", + ErrCode: "M_BAD_JSON", + }) + return + } + + log := prov.log.With(). + Str("action", "link_wait_for_scan"). + Str("user_id", user.MXID.String()). + Str("session_id", body.SessionID). + Logger() + ctx := log.WithContext(r.Context()) + log.Debug().Msg("waiting for scan") + + handle := prov.checkSessionAndReturnHandle(ctx, w, sessionID) + if handle == nil { + return + } + + select { + case resp := <-handle.channel: + if resp.Err != nil || resp.State == signalmeow.StateProvisioningError { + log.Err(resp.Err).Msg("Error waiting for scan") + // If context was cancelled be chill + if errors.Is(resp.Err, context.Canceled) { + log.Debug().Msg("Context cancelled waiting for scan") + return + } + // If we error waiting for the scan, treat it as a normal error not 5xx + // so that the client will retry quietly. Also, it's really not an internal + // error, sitting with a WS open waiting for a scan is inherently flaky. + jsonResponse(w, http.StatusBadRequest, Error{ + Success: false, + Error: resp.Err.Error(), + ErrCode: "M_INTERNAL", + }) + return + } + if resp.State != signalmeow.StateProvisioningDataReceived { + log.Err(resp.Err).Stringer("state", resp.State).Msg("unexpected state") + jsonResponse(w, http.StatusInternalServerError, Error{ + Success: false, + Error: fmt.Sprintf("Unexpected state %s", resp.State.String()), + ErrCode: "M_INTERNAL", + }) + return + } + log.Debug().Msg("provisioning data received") + jsonResponse(w, http.StatusOK, Response{ + Success: true, + Status: "provisioning_data_received", + }) + + // Update user with SignalID + if resp.ProvisioningData.ACI != uuid.Nil { + user.saveSignalID(ctx, resp.ProvisioningData.ACI, resp.ProvisioningData.Number) + } + return + case <-time.After(45 * time.Second): + log.Warn().Msg("Timeout waiting for provisioning response (scan)") + // Using 400 here to match the old bridge + jsonResponse(w, http.StatusBadRequest, Error{ + Success: false, + Error: "Timeout waiting for QR code scan", + ErrCode: "M_BAD_REQUEST", + }) + return + } +} + +type LinkWaitForAccountRequest struct { + SessionID string `json:"session_id"` + DeviceName string `json:"device_name"` // TODO this seems to not be used anywhere +} + +func (prov *ProvisioningAPI) LinkWaitForAccount(w http.ResponseWriter, r *http.Request) { + user := r.Context().Value(provisioningUserKey).(*User) + + var body LinkWaitForAccountRequest + err := json.NewDecoder(r.Body).Decode(&body) + if err != nil { + jsonResponse(w, http.StatusBadRequest, Error{ + Success: false, + Error: "Error decoding JSON body", + ErrCode: "M_BAD_JSON", + }) + return + } + sessionID, err := strconv.Atoi(body.SessionID) + if err != nil { + jsonResponse(w, http.StatusBadRequest, Error{ + Success: false, + Error: "Error decoding session ID in JSON body", + ErrCode: "M_BAD_JSON", + }) + return + } + deviceName := body.DeviceName + + log := prov.log.With(). + Str("action", "link_wait_for_account"). + Str("user_id", user.MXID.String()). + Int("session_id", sessionID). + Str("device_name", deviceName). + Logger() + ctx := log.WithContext(r.Context()) + log.Debug().Msg("waiting for account") + + handle := prov.checkSessionAndReturnHandle(ctx, w, sessionID) + if handle == nil { + return + } + + select { + case resp := <-handle.channel: + if resp.Err != nil || resp.State == signalmeow.StateProvisioningError { + log.Err(resp.Err).Msg("Error waiting for account") + jsonResponse(w, http.StatusInternalServerError, Error{ + Success: false, + Error: resp.Err.Error(), + ErrCode: "M_INTERNAL", + }) + return + } + if resp.State != signalmeow.StateProvisioningPreKeysRegistered { + log.Err(resp.Err).Stringer("state", resp.State).Msg("unexpected state") + jsonResponse(w, http.StatusInternalServerError, Error{ + Success: false, + Error: fmt.Sprintf("Unexpected state %s", resp.State.String()), + ErrCode: "M_INTERNAL", + }) + return + } + + log.Debug().Msg("prekeys registered") + jsonResponse(w, http.StatusOK, Response{ + Success: true, + Status: "prekeys_registered", + UUID: user.SignalID.String(), + Number: user.SignalUsername, + }) + + // Connect to Signal!! + user.Connect() + return + case <-time.After(30 * time.Second): + log.Warn().Msg("Timeout waiting for provisioning response (account)") + jsonResponse(w, http.StatusGatewayTimeout, Error{ + Success: false, + Error: "Timeout waiting for provisioning response (account)", + ErrCode: "M_TIMEOUT", + }) + return + } +} + +func (prov *ProvisioningAPI) Logout(w http.ResponseWriter, r *http.Request) { + user := r.Context().Value(provisioningUserKey).(*User) + log := prov.log.With(). + Str("action", "logout"). + Str("user_id", user.MXID.String()). + Logger() + ctx := log.WithContext(r.Context()) + log.Debug().Msg("Logout called (but not logging out)") + + prov.clearSession(ctx, user) + + // For now do nothing - we need this API to return 200 to be compatible with + // the old Signal bridge, which needed a call to Logout before allowing LinkNew + // to be called, but we don't actually want to logout, we want to allow a reconnect. + jsonResponse(w, http.StatusOK, Response{ + Success: true, + Status: "logged_out", + }) +} diff --git a/puppet.go b/puppet.go new file mode 100644 index 0000000..67418fd --- /dev/null +++ b/puppet.go @@ -0,0 +1,402 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber +// +// 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 main + +import ( + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + "net/http" + "regexp" + "sync" + + "github.com/google/uuid" + "github.com/rs/zerolog" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/appservice" + "maunium.net/go/mautrix/bridge" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/database" + "go.mau.fi/mautrix-signal/pkg/signalmeow/types" +) + +func (br *SignalBridge) GetPuppetByMXID(mxid id.UserID) *Puppet { + signalID, ok := br.ParsePuppetMXID(mxid) + if !ok { + return nil + } + + return br.GetPuppetBySignalID(signalID) +} + +func (br *SignalBridge) GetPuppetBySignalIDString(id string) *Puppet { + parsed, err := uuid.Parse(id) + if err != nil { + return nil + } + return br.GetPuppetBySignalID(parsed) +} + +func (br *SignalBridge) GetPuppetBySignalID(id uuid.UUID) *Puppet { + br.puppetsLock.Lock() + defer br.puppetsLock.Unlock() + + if id == uuid.Nil { + br.ZLog.Warn().Msg("Trying to get puppet with empty signal_user_id") + return nil + } + + puppet, ok := br.puppets[id] + if !ok { + dbPuppet, err := br.DB.Puppet.GetBySignalID(context.TODO(), id) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get puppet from database") + return nil + } + return br.loadPuppet(context.TODO(), dbPuppet, &id) + } + return puppet +} + +func (br *SignalBridge) GetPuppetByCustomMXID(mxid id.UserID) *Puppet { + br.puppetsLock.Lock() + defer br.puppetsLock.Unlock() + + puppet, ok := br.puppetsByCustomMXID[mxid] + if !ok { + dbPuppet, err := br.DB.Puppet.GetByCustomMXID(context.TODO(), mxid) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get puppet from database") + return nil + } + return br.loadPuppet(context.TODO(), dbPuppet, nil) + } + return puppet +} + +func (br *SignalBridge) GetAllPuppetsWithCustomMXID() []*Puppet { + puppets, err := br.DB.Puppet.GetAllWithCustomMXID(context.TODO()) + if err != nil { + br.ZLog.Error().Err(err).Msg("Failed to get all puppets with custom MXID") + return nil + } + return br.dbPuppetsToPuppets(puppets) +} + +func (br *SignalBridge) FormatPuppetMXID(u uuid.UUID) id.UserID { + return id.NewUserID( + br.Config.Bridge.FormatUsername(u.String()), + br.Config.Homeserver.Domain, + ) +} + +func (br *SignalBridge) loadPuppet(ctx context.Context, dbPuppet *database.Puppet, u *uuid.UUID) *Puppet { + if dbPuppet == nil { + if u == nil { + return nil + } + dbPuppet = br.DB.Puppet.New() + dbPuppet.SignalID = *u + err := dbPuppet.Insert(ctx) + if err != nil { + br.ZLog.Error().Err(err).Stringer("signal_user_id", *u).Msg("Failed to insert new puppet") + return nil + } + } + + puppet := br.NewPuppet(dbPuppet) + br.puppets[puppet.SignalID] = puppet + if puppet.CustomMXID != "" { + br.puppetsByCustomMXID[puppet.CustomMXID] = puppet + } + return puppet +} + +func (br *SignalBridge) dbPuppetsToPuppets(dbPuppets []*database.Puppet) []*Puppet { + br.puppetsLock.Lock() + defer br.puppetsLock.Unlock() + + output := make([]*Puppet, len(dbPuppets)) + for index, dbPuppet := range dbPuppets { + if dbPuppet == nil { + continue + } + puppet, ok := br.puppets[dbPuppet.SignalID] + if !ok { + puppet = br.loadPuppet(context.TODO(), dbPuppet, nil) + } + output[index] = puppet + } + return output +} + +func (br *SignalBridge) NewPuppet(dbPuppet *database.Puppet) *Puppet { + return &Puppet{ + Puppet: dbPuppet, + bridge: br, + log: br.ZLog.With().Stringer("signal_user_id", dbPuppet.SignalID).Logger(), + + MXID: br.FormatPuppetMXID(dbPuppet.SignalID), + } +} + +func (br *SignalBridge) ParsePuppetMXID(mxid id.UserID) (uuid.UUID, bool) { + if userIDRegex == nil { + pattern := fmt.Sprintf( + "^@%s:%s$", + // The "SignalID" portion of the MXID is a (lowercase) UUID + br.Config.Bridge.FormatUsername("([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})"), + br.Config.Homeserver.Domain, + ) + br.ZLog.Debug().Str("pattern", pattern).Msg("Compiling userIDRegex") + + userIDRegex = regexp.MustCompile(pattern) + } + + match := userIDRegex.FindStringSubmatch(string(mxid)) + if len(match) == 2 { + parsed, err := uuid.Parse(match[1]) + if err != nil { + return uuid.Nil, false + } + return parsed, true + } + + return uuid.Nil, false +} + +type Puppet struct { + *database.Puppet + + bridge *SignalBridge + log zerolog.Logger + + MXID id.UserID + + customIntent *appservice.IntentAPI + customUser *User + + syncLock sync.Mutex +} + +var userIDRegex *regexp.Regexp + +var ( + _ bridge.Ghost = (*Puppet)(nil) + _ bridge.GhostWithProfile = (*Puppet)(nil) +) + +func (puppet *Puppet) GetMXID() id.UserID { + return puppet.MXID +} + +func (puppet *Puppet) DefaultIntent() *appservice.IntentAPI { + return puppet.bridge.AS.Intent(puppet.MXID) +} + +func (puppet *Puppet) CustomIntent() *appservice.IntentAPI { + if puppet == nil { + return nil + } + return puppet.customIntent +} + +func (puppet *Puppet) IntentFor(portal *Portal) *appservice.IntentAPI { + if puppet != nil { + if puppet.customIntent == nil || portal.UserID() == puppet.SignalID { + return puppet.DefaultIntent() + } + return puppet.customIntent + } + return nil +} + +func (puppet *Puppet) GetDisplayname() string { + return puppet.Name +} + +func (puppet *Puppet) GetAvatarURL() id.ContentURI { + return puppet.AvatarURL +} + +func (puppet *Puppet) UpdateInfo(ctx context.Context, source *User, info *types.Contact) { + log := zerolog.Ctx(ctx).With(). + Str("function", "Puppet.UpdateInfo"). + Stringer("signal_user_id", puppet.SignalID). + Logger() + ctx = log.WithContext(ctx) + var err error + if info == nil { + log.Debug().Msg("Fetching contact info to update puppet") + info, err = source.Client.ContactByID(ctx, puppet.SignalID) + if err != nil { + log.Err(err).Msg("Failed to fetch contact info") + return + } + } + + log.Trace().Msg("Updating puppet info") + + update := false + if info.E164 != "" && puppet.Number != info.E164 { + puppet.Number = info.E164 + update = true + } + update = puppet.updateName(ctx, info) || update + update = puppet.updateAvatar(ctx, source, info) || update + if update { + puppet.ContactInfoSet = false + puppet.UpdateContactInfo(ctx) + err = puppet.Update(ctx) + if err != nil { + log.Err(err).Msg("Failed to save puppet to database after updating") + } + go puppet.updatePortalMeta(ctx) + log.Debug().Msg("Puppet info updated") + } +} +func (puppet *Puppet) UpdateContactInfo(ctx context.Context) { + if !puppet.bridge.SpecVersions.Supports(mautrix.BeeperFeatureArbitraryProfileMeta) || puppet.ContactInfoSet { + return + } + + identifiers := []string{ + fmt.Sprintf("signal:%s", puppet.SignalID), + } + if puppet.Number != "" { + identifiers = append(identifiers, fmt.Sprintf("tel:%s", puppet.Number)) + } + contactInfo := map[string]any{ + "com.beeper.bridge.identifiers": identifiers, + "com.beeper.bridge.remote_id": puppet.SignalID.String(), + "com.beeper.bridge.service": "signal", + "com.beeper.bridge.network": "signal", + } + err := puppet.DefaultIntent().BeeperUpdateProfile(ctx, contactInfo) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to store custom contact info in profile") + } else { + puppet.ContactInfoSet = true + } +} + +func (puppet *Puppet) updatePortalMeta(ctx context.Context) { + for _, portal := range puppet.bridge.FindPrivateChatPortalsWith(puppet.SignalID) { + // Get room create lock to prevent races between receiving contact info and room creation. + portal.roomCreateLock.Lock() + portal.UpdateDMInfo(ctx, false) + portal.roomCreateLock.Unlock() + } +} + +func (puppet *Puppet) updateAvatar(ctx context.Context, source *User, info *types.Contact) bool { + var avatarData []byte + var avatarContentType string + log := zerolog.Ctx(ctx) + if puppet.bridge.Config.Bridge.UseContactAvatars && info.ContactAvatar.Hash != "" { + if puppet.AvatarHash == info.ContactAvatar.Hash && puppet.AvatarSet { + return false + } + avatarData = info.ContactAvatar.Image + avatarContentType = info.ContactAvatar.ContentType + if avatarData == nil { + // TODO what to do? 🤔 + return false + } + puppet.AvatarSet = false + puppet.AvatarPath = "" + } else { + if puppet.AvatarPath == info.ProfileAvatarPath && puppet.AvatarSet { + return false + } + if info.ProfileAvatarPath == "" { + puppet.AvatarURL = id.ContentURI{} + puppet.AvatarPath = "" + puppet.AvatarHash = "" + puppet.AvatarSet = false + err := puppet.DefaultIntent().SetAvatarURL(ctx, puppet.AvatarURL) + if err != nil { + log.Err(err).Msg("Failed to remove user avatar") + return true + } + log.Debug().Msg("Avatar removed") + puppet.AvatarSet = true + return true + } + var err error + avatarData, err = source.Client.DownloadUserAvatar(ctx, info.ProfileAvatarPath, info.ProfileKey) + if err != nil { + log.Err(err). + Str("profile_avatar_path", info.ProfileAvatarPath). + Msg("Failed to download new user avatar") + return true + } + avatarContentType = http.DetectContentType(avatarData) + } + hash := sha256.Sum256(avatarData) + newHash := hex.EncodeToString(hash[:]) + if puppet.AvatarHash == newHash && puppet.AvatarSet { + log.Debug(). + Str("avatar_hash", newHash). + Str("new_avatar_path", puppet.AvatarPath). + Msg("Avatar path changed, but hash didn't") + // Path changed, but actual avatar didn't + return true + } + puppet.AvatarPath = info.ProfileAvatarPath + puppet.AvatarHash = newHash + puppet.AvatarSet = false + puppet.AvatarURL = id.ContentURI{} + resp, err := puppet.DefaultIntent().UploadBytes(ctx, avatarData, avatarContentType) + if err != nil { + log.Err(err). + Str("avatar_hash", puppet.AvatarHash). + Msg("Failed to upload new user avatar") + return true + } + puppet.AvatarURL = resp.ContentURI + err = puppet.DefaultIntent().SetAvatarURL(ctx, puppet.AvatarURL) + if err != nil { + log.Err(err).Msg("Failed to update user avatar") + return true + } + log.Debug(). + Str("avatar_hash", newHash). + Stringer("avatar_mxc", resp.ContentURI). + Msg("Avatar updated successfully") + puppet.AvatarSet = true + return true +} + +func (puppet *Puppet) updateName(ctx context.Context, contact *types.Contact) bool { + // TODO set name quality + newName := puppet.bridge.Config.Bridge.FormatDisplayname(contact) + if puppet.NameSet && puppet.Name == newName { + return false + } + puppet.Name = newName + puppet.NameSet = false + err := puppet.DefaultIntent().SetDisplayName(ctx, newName) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to update user displayname") + } else { + puppet.NameSet = true + } + return true +} diff --git a/user.go b/user.go new file mode 100644 index 0000000..392a190 --- /dev/null +++ b/user.go @@ -0,0 +1,902 @@ +// mautrix-signal - A Matrix-signal puppeting bridge. +// Copyright (C) 2023 Scott Weber +// +// 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 main + +import ( + "context" + "errors" + "net/http" + "strings" + "sync" + "time" + + "github.com/google/uuid" + "github.com/rs/zerolog" + "golang.org/x/exp/maps" + "maunium.net/go/mautrix" + "maunium.net/go/mautrix/appservice" + "maunium.net/go/mautrix/bridge" + "maunium.net/go/mautrix/bridge/bridgeconfig" + "maunium.net/go/mautrix/bridge/status" + "maunium.net/go/mautrix/event" + "maunium.net/go/mautrix/id" + + "go.mau.fi/mautrix-signal/database" + "go.mau.fi/mautrix-signal/pkg/signalmeow" + "go.mau.fi/mautrix-signal/pkg/signalmeow/events" + signalpb "go.mau.fi/mautrix-signal/pkg/signalmeow/protobuf" +) + +var ( + ErrNotConnected = errors.New("not connected") + ErrNotLoggedIn = errors.New("not logged in") +) + +func (br *SignalBridge) GetUserByMXID(userID id.UserID) *User { + return br.maybeGetUserByMXID(userID, &userID) +} + +func (br *SignalBridge) GetUserByMXIDIfExists(userID id.UserID) *User { + return br.maybeGetUserByMXID(userID, nil) +} + +func (br *SignalBridge) maybeGetUserByMXID(userID id.UserID, userIDPtr *id.UserID) *User { + if userID == br.Bot.UserID || br.IsGhost(userID) { + return nil + } + br.usersLock.Lock() + defer br.usersLock.Unlock() + + user, ok := br.usersByMXID[userID] + if !ok { + dbUser, err := br.DB.User.GetByMXID(context.TODO(), userID) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get user from database") + return nil + } + return br.loadUser(context.TODO(), dbUser, userIDPtr) + } + return user +} + +func (br *SignalBridge) GetUserBySignalID(id uuid.UUID) *User { + br.usersLock.Lock() + defer br.usersLock.Unlock() + return br.unlockedGetUserBySignalID(id) +} + +func (br *SignalBridge) unlockedGetUserBySignalID(id uuid.UUID) *User { + user, ok := br.usersBySignalID[id] + if !ok { + dbUser, err := br.DB.User.GetBySignalID(context.TODO(), id) + if err != nil { + br.ZLog.Err(err).Msg("Failed to get user from database") + return nil + } + return br.loadUser(context.TODO(), dbUser, nil) + } + return user +} + +func (br *SignalBridge) GetAllLoggedInUsers() []*User { + br.usersLock.Lock() + defer br.usersLock.Unlock() + + dbUsers, err := br.DB.User.GetAllLoggedIn(context.TODO()) + if err != nil { + br.ZLog.Err(err).Msg("Error getting all logged in users") + return nil + } + users := make([]*User, len(dbUsers)) + + for idx, dbUser := range dbUsers { + user, ok := br.usersByMXID[dbUser.MXID] + if !ok { + user = br.loadUser(context.TODO(), dbUser, nil) + } + users[idx] = user + } + return users +} + +func (br *SignalBridge) loadUser(ctx context.Context, dbUser *database.User, mxid *id.UserID) *User { + if dbUser == nil { + if mxid == nil { + return nil + } + dbUser = br.DB.User.New() + dbUser.MXID = *mxid + err := dbUser.Insert(ctx) + if err != nil { + br.ZLog.Err(err).Msg("Error creating user %s") + return nil + } + } + + user := br.NewUser(dbUser) + br.usersByMXID[user.MXID] = user + if user.SignalID != uuid.Nil { + br.usersBySignalID[user.SignalID] = user + } + if user.ManagementRoom != "" { + br.managementRoomsLock.Lock() + br.managementRooms[user.ManagementRoom] = user + br.managementRoomsLock.Unlock() + } + return user +} + +func (br *SignalBridge) NewUser(dbUser *database.User) *User { + user := &User{ + User: dbUser, + bridge: br, + log: br.ZLog.With().Stringer("user_id", dbUser.MXID).Logger(), + + PermissionLevel: br.Config.Bridge.Permissions.Get(dbUser.MXID), + } + user.Admin = user.PermissionLevel >= bridgeconfig.PermissionLevelAdmin + user.BridgeState = br.NewBridgeStateQueue(user) + return user +} + +type User struct { + *database.User + + sync.Mutex + + bridge *SignalBridge + log zerolog.Logger + + Admin bool + PermissionLevel bridgeconfig.PermissionLevel + + Client *signalmeow.Client + + BridgeState *bridge.BridgeStateQueue + bridgeStateLock sync.Mutex + + spaceMembershipChecked bool + spaceCreateLock sync.Mutex +} + +var ( + _ bridge.User = (*User)(nil) + _ status.BridgeStateFiller = (*User)(nil) +) + +func (user *User) GetPermissionLevel() bridgeconfig.PermissionLevel { + return user.PermissionLevel +} + +func (user *User) IsLoggedIn() bool { + user.Lock() + defer user.Unlock() + + return user.Client != nil && user.Client.IsLoggedIn() +} + +func (user *User) GetManagementRoomID() id.RoomID { + return user.ManagementRoom +} + +func (user *User) SetManagementRoom(roomID id.RoomID) { + user.bridge.managementRoomsLock.Lock() + defer user.bridge.managementRoomsLock.Unlock() + + existing, ok := user.bridge.managementRooms[roomID] + if ok { + existing.ManagementRoom = "" + err := existing.Update(context.TODO()) + if err != nil { + existing.log.Err(err).Msg("Failed to update user when removing management room") + } + } + + user.ManagementRoom = roomID + user.bridge.managementRooms[user.ManagementRoom] = user + err := user.Update(context.TODO()) + if err != nil { + user.log.Error().Err(err).Msg("Error setting management room") + } +} + +func (user *User) GetIDoublePuppet() bridge.DoublePuppet { + p := user.bridge.GetPuppetByCustomMXID(user.MXID) + if p == nil || p.CustomIntent() == nil { + return nil + } + return p +} + +func (user *User) GetIGhost() bridge.Ghost { + p := user.bridge.GetPuppetBySignalID(user.SignalID) + if p == nil { + return nil + } + return p +} + +func (user *User) ensureInvited(ctx context.Context, intent *appservice.IntentAPI, roomID id.RoomID, isDirect bool) (ok bool) { + log := user.log.With().Str("action", "ensure_invited").Stringer("room_id", roomID).Logger() + if user.bridge.StateStore.IsMembership(ctx, roomID, user.MXID, event.MembershipJoin) { + ok = true + return + } + extraContent := make(map[string]interface{}) + if isDirect { + extraContent["is_direct"] = true + } + customPuppet := user.bridge.GetPuppetByCustomMXID(user.MXID) + if customPuppet != nil && customPuppet.CustomIntent() != nil { + log.Debug().Msg("adding will_auto_accept to invite content") + extraContent["fi.mau.will_auto_accept"] = true + } else { + log.Debug().Msg("NOT adding will_auto_accept to invite content") + } + _, err := intent.InviteUser(ctx, roomID, &mautrix.ReqInviteUser{UserID: user.MXID}, extraContent) + var httpErr mautrix.HTTPError + if err != nil && errors.As(err, &httpErr) && httpErr.RespError != nil && strings.Contains(httpErr.RespError.Err, "is already in the room") { + err = user.bridge.StateStore.SetMembership(ctx, roomID, user.MXID, event.MembershipJoin) + if err != nil { + log.Warn().Err(err).Msg("Failed to update membership in state store") + } + ok = true + return + } else if err != nil { + log.Warn().Err(err).Msg("Failed to invite user to room") + } else { + ok = true + } + + if customPuppet != nil && customPuppet.CustomIntent() != nil { + log.Debug().Msg("ensuring custom puppet is joined") + err = customPuppet.CustomIntent().EnsureJoined(ctx, roomID, appservice.EnsureJoinedParams{IgnoreCache: true}) + if err != nil { + log.Warn().Err(err).Msg("Failed to auto-join custom puppet") + ok = false + } else { + ok = true + } + } + return +} + +func (user *User) GetSpaceRoom(ctx context.Context) id.RoomID { + if !user.bridge.Config.Bridge.PersonalFilteringSpaces { + return "" + } + + if len(user.SpaceRoom) == 0 { + user.spaceCreateLock.Lock() + defer user.spaceCreateLock.Unlock() + if len(user.SpaceRoom) > 0 { + return user.SpaceRoom + } + + resp, err := user.bridge.Bot.CreateRoom(ctx, &mautrix.ReqCreateRoom{ + Visibility: "private", + Name: "Signal", + Topic: "Your Signal bridged chats", + InitialState: []*event.Event{{ + Type: event.StateRoomAvatar, + Content: event.Content{ + Parsed: &event.RoomAvatarEventContent{ + URL: user.bridge.Config.AppService.Bot.ParsedAvatar, + }, + }, + }}, + CreationContent: map[string]interface{}{ + "type": event.RoomTypeSpace, + }, + PowerLevelOverride: &event.PowerLevelsEventContent{ + Users: map[id.UserID]int{ + user.bridge.Bot.UserID: 9001, + user.MXID: 50, + }, + }, + }) + + if err != nil { + user.log.Err(err).Msg("Failed to auto-create space room") + } else { + user.SpaceRoom = resp.RoomID + err = user.Update(context.TODO()) + if err != nil { + user.log.Err(err).Msg("Failed to save user in database after creating space room") + } + user.ensureInvited(ctx, user.bridge.Bot, user.SpaceRoom, false) + } + } else if !user.spaceMembershipChecked { + user.ensureInvited(ctx, user.bridge.Bot, user.SpaceRoom, false) + } + user.spaceMembershipChecked = true + + return user.SpaceRoom +} + +func (user *User) syncChatDoublePuppetDetails(portal *Portal, justCreated bool) { + doublePuppet := portal.bridge.GetPuppetByCustomMXID(user.MXID) + if doublePuppet == nil { + return + } + if doublePuppet == nil || doublePuppet.CustomIntent() == nil || len(portal.MXID) == 0 { + return + } + + // TODO: Get chat setting from Signal and sync them here + //if justCreated || !user.bridge.Config.Bridge.TagOnlyOnCreate { + // chat, err := user.Client.Store.ChatSettings.GetChatSettings(portal.Key().ChatID) + // if err != nil { + // user.log.Warn().Err(err).Msgf("Failed to get settings of %s", portal.Key().ChatID) + // return + // } + // intent := doublePuppet.CustomIntent() + // if portal.Key.JID == types.StatusBroadcastJID && justCreated { + // if user.bridge.Config.Bridge.MuteStatusBroadcast { + // user.updateChatMute(intent, portal, time.Now().Add(365*24*time.Hour)) + // } + // if len(user.bridge.Config.Bridge.StatusBroadcastTag) > 0 { + // user.updateChatTag(intent, portal, user.bridge.Config.Bridge.StatusBroadcastTag, true) + // } + // return + // } else if !chat.Found { + // return + // } + // user.updateChatMute(intent, portal, chat.MutedUntil) + // user.updateChatTag(intent, portal, user.bridge.Config.Bridge.ArchiveTag, chat.Archived) + // user.updateChatTag(intent, portal, user.bridge.Config.Bridge.PinnedTag, chat.Pinned) + //} +} + +func (user *User) GetMXID() id.UserID { + return user.MXID +} +func (user *User) GetRemoteID() string { + return user.SignalID.String() +} +func (user *User) GetRemoteName() string { + return user.SignalUsername +} + +func (user *User) startupTryConnect(retryCount int) { + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateConnecting}) + + // Make sure user has the Signal device populated + user.populateSignalDevice() + + user.log.Debug().Msg("Connecting to Signal") + ctx := user.log.WithContext(context.Background()) + statusChan, err := user.Client.StartReceiveLoops(ctx) + + if err != nil { + user.log.Error().Err(err).Msg("Error connecting on startup") + if errors.Is(err, ErrNotLoggedIn) { + user.log.Warn().Msg("Not logged in, clearing Signal device keys") + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"}) + user.clearKeysAndDisconnect() + } else if retryCount < 6 { + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateTransientDisconnect, Error: "unknown-websocket-error", Message: err.Error()}) + retryInSeconds := 2 << retryCount + user.log.Debug().Int("retry_in_seconds", retryInSeconds).Msg("Sleeping and retrying connection") + time.Sleep(time.Duration(retryInSeconds) * time.Second) + user.startupTryConnect(retryCount + 1) + } else { + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateUnknownError, Error: "unknown-websocket-error", Message: err.Error()}) + } + } + + if statusChan == nil { + user.log.Error().Msg("statusChan is nil after Connect") + return + } + // After Connect returns, all bridge states are triggered by events on the statusChan + go func() { + var peekedConnectionStatus signalmeow.SignalConnectionStatus + for { + var connectionStatus signalmeow.SignalConnectionStatus + if peekedConnectionStatus.Event != signalmeow.SignalConnectionEventNone { + user.log.Debug(). + Str("peeked_connection_status_event", peekedConnectionStatus.Event.String()). + Msg("Using peeked connectionStatus event") + connectionStatus = peekedConnectionStatus + peekedConnectionStatus = signalmeow.SignalConnectionStatus{} + } else { + var ok bool + connectionStatus, ok = <-statusChan + if !ok { + user.log.Debug().Msg("statusChan channel closed") + return + } + } + + err := connectionStatus.Err + switch connectionStatus.Event { + case signalmeow.SignalConnectionEventConnected: + user.log.Debug().Msg("Sending Connected BridgeState") + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateConnected}) + + case signalmeow.SignalConnectionEventDisconnected: + user.log.Debug().Msg("Received SignalConnectionEventDisconnected") + + // Debounce: wait 7s before sending TransientDisconnect, in case we get a reconnect + // We should wait until the next message comes in, or 7 seconds has passed. + // - If a disconnected event comes in, just loop again, unless it's been more than 7 seconds. + // - If a non-disconnected event comes in, store it in peekedConnectionStatus, + // break out of this loop and go back to the top of the goroutine to handle it in the switch. + // - If 7 seconds passes without any non-disconnect messages, send the TransientDisconnect. + // (Why 7 seconds? It was 5 at first, but websockets min retry is 5 seconds, + // so it would send TransientDisconnect right before reconnecting. 7 seems to work well.) + debounceTimer := time.NewTimer(7 * time.Second) + PeekLoop: + for { + var ok bool + select { + case peekedConnectionStatus, ok = <-statusChan: + // Handle channel closing + if !ok { + user.log.Debug().Msg("connectionStatus channel closed") + return + } + // If it's another Disconnected event, just keep looping + if peekedConnectionStatus.Event == signalmeow.SignalConnectionEventDisconnected { + peekedConnectionStatus = signalmeow.SignalConnectionStatus{} + continue + } + // If it's a non-disconnect event, break out of the PeekLoop and handle it in the switch + break PeekLoop + case <-debounceTimer.C: + // Time is up, so break out of the loop and send the TransientDisconnect + break PeekLoop + } + } + // We're out of the PeekLoop, so either we got a non-disconnect event, or it's been 7 seconds (or both). + // We want to send TransientDisconnect if it's been 7 seconds, but not if the latest event was something + // other than Disconnected + if !debounceTimer.Stop() { // If the timer has already expired + // Send TransientDisconnect only if the latest event is a disconnect or no event + // (peekedConnectionStatus could be something else if the timer and the event race) + if peekedConnectionStatus.Event == signalmeow.SignalConnectionEventDisconnected || + peekedConnectionStatus.Event == signalmeow.SignalConnectionEventNone { + user.log.Debug().Msg("Sending TransientDisconnect BridgeState") + if err == nil { + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateTransientDisconnect}) + } else { + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateTransientDisconnect, Error: "unknown-websocket-error", Message: err.Error()}) + } + } + } + + case signalmeow.SignalConnectionEventLoggedOut: + user.log.Debug().Msg("Sending BadCredentials BridgeState") + if err == nil { + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"}) + } else { + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: err.Error()}) + } + user.clearKeysAndDisconnect() + if managementRoom := user.GetManagementRoomID(); managementRoom != "" { + _, _ = user.bridge.Bot.SendText(ctx, managementRoom, "You've been logged out of Signal") + } + + case signalmeow.SignalConnectionEventError: + user.log.Debug().Msg("Sending UnknownError BridgeState") + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateUnknownError, Error: "unknown-websocket-error", Message: err.Error()}) + + case signalmeow.SignalConnectionCleanShutdown: + if user.Client.IsLoggedIn() { + user.log.Debug().Msg("Clean Shutdown - sending no BridgeState") + } else { + user.log.Debug().Msg("Clean Shutdown, but logged out - Sending BadCredentials BridgeState") + user.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"}) + } + } + } + }() +} + +func (user *User) clearKeysAndDisconnect() { + // We need to clear out keys associated with the Signal device that no longer has valid credentials + user.log.Debug().Msg("Clearing out Signal device keys") + err := user.Client.ClearKeysAndDisconnect(context.TODO()) + if err != nil { + user.log.Err(err).Msg("Error clearing device keys") + } +} + +func (br *SignalBridge) StartUsers() []*User { + br.ZLog.Debug().Msg("Starting users") + var startingUsers []*User + + usersWithToken := br.GetAllLoggedInUsers() + for _, u := range usersWithToken { + device := u.populateSignalDevice() + if device == nil || !device.IsLoggedIn() { + br.ZLog.Warn().Stringer("user_id", u.MXID).Msg("No device found for user, skipping Connect and sending BadCredentials BridgeState") + u.BridgeState.Send(status.BridgeState{StateEvent: status.StateBadCredentials, Message: "You have been logged out of Signal, please reconnect"}) + continue + } + startingUsers = append(startingUsers, u) + go u.Connect() + } + if len(usersWithToken) == 0 { + br.SendGlobalBridgeState(status.BridgeState{StateEvent: status.StateUnconfigured}.Fill(nil)) + } + + br.ZLog.Debug().Msg("Starting custom puppets") + for _, customPuppet := range br.GetAllPuppetsWithCustomMXID() { + go func(puppet *Puppet) { + br.ZLog.Debug().Stringer("user_id", puppet.CustomMXID).Msg("Starting custom puppet") + + if err := puppet.StartCustomMXID(true); err != nil { + puppet.log.Error().Err(err).Msg("Failed to start custom puppet") + } + }(customPuppet) + } + return startingUsers +} + +func (user *User) Login() (<-chan signalmeow.ProvisioningResponse, error) { + user.Lock() + defer user.Unlock() + + provChan := signalmeow.PerformProvisioning(context.TODO(), user.bridge.MeowStore, user.bridge.Config.Signal.DeviceName) + + return provChan, nil +} + +func (user *User) Connect() { + user.startupTryConnect(0) +} + +func (user *User) saveSignalID(ctx context.Context, id uuid.UUID, number string) { + user.bridge.usersLock.Lock() + defer user.bridge.usersLock.Unlock() + if user.SignalID == id && user.SignalUsername == number { + return + } + if user.SignalID != id { + existingUser := user.bridge.unlockedGetUserBySignalID(id) + if existingUser != nil { + // TODO this doesn't clear the signal store properly + // the store also only has the uuid as primary key, even though it should have uuid + device id + zerolog.Ctx(ctx).Warn(). + Stringer("previous_user", existingUser.MXID). + Stringer("signal_uuid", id). + Msg("Another user is already logged in with same UUID, logging out previous user") + _ = existingUser.Disconnect() + existingUser.SignalID = uuid.Nil + existingUser.SignalUsername = "" + err := existingUser.Update(ctx) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to clear previous user's signal UUID") + } + } + } + user.SignalID = id + user.SignalUsername = number + user.bridge.usersBySignalID[id] = user + err := user.Update(ctx) + if err != nil { + zerolog.Ctx(ctx).Err(err).Msg("Failed to save user's signal UUID") + } +} + +func (user *User) populateSignalDevice() *signalmeow.Client { + user.Lock() + defer user.Unlock() + log := user.log.With(). + Str("action", "populate signal device"). + Str("signal_id", user.SignalID.String()). + Logger() + + if user.SignalID == uuid.Nil { + return nil + } + // TODO clear client on logout properly so that populating can skip creating if it already exists + /*else if user.Client != nil { + return user.Client + }*/ + + device, err := user.bridge.MeowStore.DeviceByACI(context.TODO(), user.SignalID) + if err != nil { + log.Err(err).Msg("Failed to get device from database") + return nil + } else if device == nil { + log.Err(ErrNotLoggedIn).Msg("No device found for user") + return nil + } + + user.Client = &signalmeow.Client{ + Store: device, + EventHandler: user.eventHandler, + } + go user.tryAutomaticDoublePuppeting() + return user.Client +} + +func (user *User) handleReceipt(evt *events.Receipt) { + log := user.log.With(). + Str("action", "handle receipt"). + Str("receipt_type", evt.Content.GetType().String()). + Str("sender_uuid", evt.Sender.String()). + Logger() + ctx := log.WithContext(context.TODO()) + messages, err := user.bridge.DB.Message.GetManyBySignalID(ctx, user.SignalID, evt.Content.GetTimestamp(), user.SignalID, false) + if err != nil { + log.Err(err).Msg("Failed to get receipt target messages from database") + return + } + sender := user.bridge.GetPuppetBySignalID(evt.Sender) + missingMessageIDMap := make(map[uint64]struct{}, len(evt.Content.GetTimestamp())) + for _, msg := range evt.Content.GetTimestamp() { + missingMessageIDMap[msg] = struct{}{} + } + foundMessageIDs := make([]uint64, len(messages)) + switch evt.Content.GetType() { + case signalpb.ReceiptMessage_READ: + messageMap := make(map[string]*database.Message) + for i, msg := range messages { + foundMessageIDs[i] = msg.Timestamp + delete(missingMessageIDMap, msg.Timestamp) + // The database returns messages from newest to oldest, so only include the first message per chat + _, ok := messageMap[msg.SignalChatID] + if !ok { + messageMap[msg.SignalChatID] = msg + } + } + log.Debug(). + Uints64("found_message_ids", foundMessageIDs). + Uints64("not_found_message_ids", maps.Keys(missingMessageIDMap)). + Int("chat_count", len(messageMap)). + Msg("Received read receipt") + for _, msg := range messageMap { + portal := user.GetPortalByChatID(msg.SignalChatID) + if portal == nil { + continue + } + err = portal.SendReadReceipt(ctx, sender, msg) + if err != nil { + log.Err(err).Msg("Failed to send read receipt") + } + } + case signalpb.ReceiptMessage_DELIVERY: + messageMap := make(map[string][]*database.Message) + for i, msg := range messages { + foundMessageIDs[i] = msg.Timestamp + delete(missingMessageIDMap, msg.Timestamp) + messageMap[msg.SignalChatID] = append(messageMap[msg.SignalChatID], msg) + } + log.Debug(). + Uints64("found_message_ids", foundMessageIDs). + Uints64("not_found_message_ids", maps.Keys(missingMessageIDMap)). + Int("chat_count", len(messageMap)). + Msg("Received delivery receipt") + for _, msgs := range messageMap { + portal := user.GetPortalByChatID(msgs[0].SignalChatID) + if portal == nil { + continue + } + // There should always only be 1 part, but use the last part to be safe + portal.MarkDelivered(ctx, msgs[len(msgs)-1]) + } + } +} + +func (user *User) handleReadSelf(evt *events.ReadSelf) { + ctx := context.TODO() + messagesByChat := map[string]*database.Message{} + for _, part := range evt.Messages { + log := user.log.With(). + Str("action", "handle read self"). + Str("sender_uuid", part.GetSenderAci()). + Uint64("msg_timestamp", part.GetTimestamp()). + Logger() + ctx := log.WithContext(context.TODO()) + if senderUUID, err := uuid.Parse(part.GetSenderAci()); err != nil { + log.Err(err).Msg("Failed to parse sender UUID") + } else if msg, err := user.bridge.DB.Message.GetLastPartBySignalIDWithUnknownReceiver(ctx, senderUUID, part.GetTimestamp(), user.SignalID); err != nil { + log.Err(err).Msg("Failed to get message from database") + } else if msg == nil { + log.Warn().Msg("Message not found in database") + } else if existingMsg, ok := messagesByChat[msg.SignalChatID]; ok && existingMsg.Timestamp > msg.Timestamp { + log.Trace(). + Str("chat_id", msg.SignalChatID). + Uint64("newer_msg", existingMsg.Timestamp). + Msg("Receipt event contains a newer message, skipping this one") + } else { + log.Trace().Str("chat_id", msg.SignalChatID).Msg("Received own read receipt") + messagesByChat[msg.SignalChatID] = msg + } + } + puppet := user.bridge.GetPuppetBySignalID(user.SignalID) + for _, msg := range messagesByChat { + portal := user.GetPortalByChatID(msg.SignalChatID) + if portal == nil { + continue + } + user.log.Debug(). + Str("action", "handle read self"). + Str("chat_id", msg.SignalChatID). + Uint64("msg_timestamp", msg.Timestamp). + Str("msg_mxid", msg.MXID.String()). + Msg("Bridging own read receipt") + portal.ScheduleDisappearing() + user.SetLastReadTS(ctx, portal.PortalKey, msg.Timestamp) + err := portal.SendReadReceipt(ctx, puppet, msg) + if err != nil { + user.log.Err(err).Stringer("mxid", msg.MXID).Msg("Failed to send read receipt") + } + } +} + +func (user *User) handleContactList(evt *events.ContactList) { + ctx := user.log.With().Str("action", "handle contact list").Logger().WithContext(context.TODO()) + for _, contact := range evt.Contacts { + puppet := user.bridge.GetPuppetBySignalID(contact.UUID) + if puppet == nil { + return + } + puppet.UpdateInfo(ctx, user, contact) + } +} + +func (user *User) eventHandler(rawEvt events.SignalEvent) { + switch evt := rawEvt.(type) { + case *events.ChatEvent: + portal := user.GetPortalByChatID(evt.Info.ChatID) + if portal != nil { + portal.signalMessages <- portalSignalMessage{user: user, evt: evt} + } else { + user.log.Warn().Str("chat_id", evt.Info.ChatID).Msg("Couldn't get portal, dropping message") + } + case *events.Receipt: + user.handleReceipt(evt) + case *events.ReadSelf: + user.handleReadSelf(evt) + case *events.Call: + portal := user.GetPortalByChatID(evt.Info.ChatID) + content := &event.MessageEventContent{MsgType: event.MsgNotice} + if evt.IsRinging { + content.Body = "Incoming call" + if portal.IsPrivateChat() { + content.MsgType = event.MsgText + } + } else { + content.Body = "Call ended" + } + portal.sendMainIntentMessage(context.TODO(), content) + case *events.ContactList: + user.handleContactList(evt) + default: + user.log.Warn().Type("event_type", evt).Msg("Unrecognized event type from signalmeow") + } +} + +func (user *User) GetPortalByChatID(signalID string) *Portal { + pk := database.PortalKey{ + ChatID: signalID, + Receiver: user.SignalID, + } + return user.bridge.GetPortalByChatID(pk) +} + +func (user *User) disconnectNoLock() (*signalmeow.Client, error) { + if user.Client == nil { + return nil, ErrNotConnected + } + + disconnectedDevice := user.Client + err := user.Client.StopReceiveLoops() + user.Client = nil + return disconnectedDevice, err +} + +func (user *User) Disconnect() error { + user.Lock() + defer user.Unlock() + user.log.Info().Msg("Disconnecting session manually") + _, err := user.disconnectNoLock() + return err +} + +func (user *User) Logout() error { + user.Lock() + defer user.Unlock() + user.log.Info().Msg("Logging out of session") + loggedOutDevice, err := user.disconnectNoLock() + user.bridge.MeowStore.DeleteDevice(context.TODO(), &loggedOutDevice.Store.DeviceData) + user.bridge.GetPuppetByCustomMXID(user.MXID).ClearCustomMXID() + return err +} + +func (user *User) UpdateDirectChats(ctx context.Context, chats map[id.UserID][]id.RoomID) { + if !user.bridge.Config.Bridge.SyncDirectChatList { + return + } + + puppet := user.bridge.GetPuppetByMXID(user.MXID) + if puppet == nil { + return + } + + intent := puppet.CustomIntent() + if intent == nil { + return + } + + method := http.MethodPatch + if chats == nil { + chats = user.getDirectChats() + method = http.MethodPut + } + + user.log.Debug().Msg("Updating m.direct list on homeserver") + + var err error + if user.bridge.Config.Homeserver.Software == bridgeconfig.SoftwareAsmux { + urlPath := intent.BuildURL(mautrix.ClientURLPath{"unstable", "com.beeper.asmux", "dms"}) + _, err = intent.MakeFullRequest(ctx, mautrix.FullRequest{ + Method: method, + URL: urlPath, + Headers: http.Header{"X-Asmux-Auth": {user.bridge.AS.Registration.AppToken}}, + RequestJSON: chats, + }) + } else { + existingChats := map[id.UserID][]id.RoomID{} + + err = intent.GetAccountData(ctx, event.AccountDataDirectChats.Type, &existingChats) + if err != nil { + user.log.Warn().Err(err).Msg("Failed to get m.direct event to update it") + return + } + + for userID, rooms := range existingChats { + if _, ok := user.bridge.ParsePuppetMXID(userID); !ok { + // This is not a ghost user, include it in the new list + chats[userID] = rooms + } else if _, ok := chats[userID]; !ok && method == http.MethodPatch { + // This is a ghost user, but we're not replacing the whole list, so include it too + chats[userID] = rooms + } + } + + err = intent.SetAccountData(ctx, event.AccountDataDirectChats.Type, &chats) + } + + if err != nil { + user.log.Warn().Err(err).Msg("Failed to update m.direct event") + } +} + +func (user *User) getDirectChats() map[id.UserID][]id.RoomID { + chats := map[id.UserID][]id.RoomID{} + + privateChats, err := user.bridge.DB.Portal.FindPrivateChatsOf(context.TODO(), user.SignalID) + if err != nil { + user.log.Err(err).Msg("Failed to get private chats") + return chats + } + for _, portal := range privateChats { + if portal.MXID != "" { + puppetMXID := user.bridge.FormatPuppetMXID(portal.UserID()) + + chats[puppetMXID] = []id.RoomID{portal.MXID} + } + } + + return chats +}