slidge-whatsapp 0.2.6__cp313-cp313-manylinux_2_36_aarch64.whl → 0.3.0b0__cp313-cp313-manylinux_2_36_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of slidge-whatsapp might be problematic. Click here for more details.
- slidge_whatsapp/contact.py +13 -3
- slidge_whatsapp/event.go +115 -39
- slidge_whatsapp/gateway.go +7 -63
- slidge_whatsapp/gateway.py +2 -3
- slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.h +156 -139
- slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +135 -121
- slidge_whatsapp/generated/whatsapp.c +1441 -1169
- slidge_whatsapp/generated/whatsapp.go +1090 -979
- slidge_whatsapp/generated/whatsapp.py +854 -729
- slidge_whatsapp/generated/whatsapp_go.h +156 -139
- slidge_whatsapp/go.mod +18 -15
- slidge_whatsapp/go.sum +38 -32
- slidge_whatsapp/group.py +34 -30
- slidge_whatsapp/media/media.go +6 -2
- slidge_whatsapp/session.go +33 -16
- slidge_whatsapp/session.py +46 -14
- slidge_whatsapp/vendor/github.com/beeper/argo-go/LICENSE +9 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockreader.go +329 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockwriter.go +417 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/decoder.go +652 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/encoder.go +985 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/header/header.go +135 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/internal/util/util.go +133 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/label/label.go +384 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/label/wiremarkers.go +37 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/bitset/bitset.go +197 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/buf/buf.go +420 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/varint/varint.go +246 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/wire/wire.go +614 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/wirecodec/decode.go +341 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/LICENSE +21 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/list.go +95 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/orderedmap.go +187 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz.go +1 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo.go +3 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_nocgo.go +4 -5
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_darwin.go +11 -1
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_linux.go +10 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_windows.go +12 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/.gitignore +0 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +30 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/COPYRIGHT.txt +6 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/README.md +14 -17
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi2.go +7 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/LICENSE +21 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_amd64/libffi.8.dylib +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_arm64/libffi.8.dylib +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/windows_amd64/libffi-8.dll +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif.go +15 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif_arm64.go +16 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed.go +49 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_amd64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_arm64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_windows_amd64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +51 -13
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/init.go +22 -9
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -0
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +3096 -1651
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +188 -128
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go +13 -140
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +2 -2
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.25.go +37 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/LICENSE +19 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/argmap.go +37 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/collections.go +148 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/comment.go +31 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/decode.go +216 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/definition.go +110 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/directive.go +43 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/document.go +89 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/dumper.go +159 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/fragment.go +41 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/operation.go +32 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/path.go +72 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/selection.go +41 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/source.go +19 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/type.go +68 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/value.go +122 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +60 -26
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +1 -6
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/util/exstrings/stringutil.go +104 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +19 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.pre-commit-config.yaml +3 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/hash.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +5 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo-wire-type-store.argo +63 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo.go +62 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/name-to-queryids.json +306 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +40 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/encoder.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +79 -45
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +13 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +19 -12
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +26 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +99 -27
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +54 -26
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +208 -57
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +2 -14
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/newsletter.go +83 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +17 -8
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +2 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +15 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/extra.go +7 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.pb.go +983 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.proto +85 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.pb.go +197 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.proto +13 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.pb.go +279 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.proto +21 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.pb.go +137 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.proto +10 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.pb.go +313 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.proto +27 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.pb.go +1299 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.proto +112 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.pb.go +514 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.proto +47 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.pb.go +123 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.proto +7 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.pb.go +720 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.proto +59 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.pb.go +365 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.proto +33 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.pb.go +1238 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.proto +105 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +16 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.pb.go +5156 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.proto +516 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.pb.go +46 -10
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.proto +4 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +8975 -11209
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +193 -421
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +52 -23
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.pb.go +198 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.proto +14 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/extra.go +7 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +952 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +88 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1143 -463
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +60 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +60 -38
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +11 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +20 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingfields.json +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingtoken.go +176 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +10 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +38 -21
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +9 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +25 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +4 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/10-chat-db-lid-migration-ts.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +5 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/call.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +13 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/user.go +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +14 -8
- slidge_whatsapp/vendor/golang.org/x/crypto/curve25519/curve25519.go +1 -1
- slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +44 -2
- slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +8 -8
- slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +14 -3
- slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +7 -29
- slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +53 -71
- slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +20 -74
- slidge_whatsapp/vendor/golang.org/x/sys/unix/affinity_linux.go +1 -3
- slidge_whatsapp/vendor/golang.org/x/sys/unix/mkerrors.sh +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +1 -55
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_solaris.go +1 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux.go +47 -16
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +4 -4
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux.go +168 -12
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +18 -2
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +18 -2
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +6 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +483 -483
- slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +25 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +10 -5
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/presence.go +33 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +6 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +68 -22
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +2 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +8 -37
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/presence.go +0 -3
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +8 -0
- slidge_whatsapp/vendor/modules.txt +57 -23
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/METADATA +2 -2
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/RECORD +254 -174
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi_amd64.go +0 -7
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +0 -61
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +0 -16
- slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +0 -20
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/LICENSE +0 -0
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/WHEEL +0 -0
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/entry_points.txt +0 -0
|
@@ -16,6 +16,7 @@ import (
|
|
|
16
16
|
"fmt"
|
|
17
17
|
"io"
|
|
18
18
|
"runtime/debug"
|
|
19
|
+
"strconv"
|
|
19
20
|
"time"
|
|
20
21
|
|
|
21
22
|
"github.com/rs/zerolog"
|
|
@@ -30,6 +31,7 @@ import (
|
|
|
30
31
|
waBinary "go.mau.fi/whatsmeow/binary"
|
|
31
32
|
"go.mau.fi/whatsmeow/proto/waE2E"
|
|
32
33
|
"go.mau.fi/whatsmeow/proto/waHistorySync"
|
|
34
|
+
"go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload"
|
|
33
35
|
"go.mau.fi/whatsmeow/proto/waWeb"
|
|
34
36
|
"go.mau.fi/whatsmeow/store"
|
|
35
37
|
"go.mau.fi/whatsmeow/types"
|
|
@@ -39,7 +41,7 @@ import (
|
|
|
39
41
|
var pbSerializer = store.SignalProtobufSerializer
|
|
40
42
|
|
|
41
43
|
func (cli *Client) handleEncryptedMessage(node *waBinary.Node) {
|
|
42
|
-
ctx :=
|
|
44
|
+
ctx := cli.BackgroundEventCtx
|
|
43
45
|
info, err := cli.parseMessageInfo(node)
|
|
44
46
|
if err != nil {
|
|
45
47
|
cli.Log.Warnf("Failed to parse message: %v", err)
|
|
@@ -50,23 +52,24 @@ func (cli *Client) handleEncryptedMessage(node *waBinary.Node) {
|
|
|
50
52
|
cli.StoreLIDPNMapping(ctx, info.RecipientAlt, info.Chat)
|
|
51
53
|
}
|
|
52
54
|
if info.VerifiedName != nil && len(info.VerifiedName.Details.GetVerifiedName()) > 0 {
|
|
53
|
-
go cli.updateBusinessName(
|
|
55
|
+
go cli.updateBusinessName(cli.BackgroundEventCtx, info.Sender, info, info.VerifiedName.Details.GetVerifiedName())
|
|
54
56
|
}
|
|
55
|
-
if len(info.PushName) > 0 && info.PushName != "-" {
|
|
56
|
-
go cli.updatePushName(
|
|
57
|
+
if len(info.PushName) > 0 && info.PushName != "-" && (cli.MessengerConfig == nil || info.PushName != "username") {
|
|
58
|
+
go cli.updatePushName(cli.BackgroundEventCtx, info.Sender, info, info.PushName)
|
|
57
59
|
}
|
|
58
|
-
|
|
60
|
+
var cancelled bool
|
|
61
|
+
defer cli.maybeDeferredAck(ctx, node)(&cancelled)
|
|
59
62
|
if info.Sender.Server == types.NewsletterServer {
|
|
60
|
-
cli.handlePlaintextMessage(ctx, info, node)
|
|
63
|
+
cancelled = cli.handlePlaintextMessage(ctx, info, node)
|
|
61
64
|
} else {
|
|
62
|
-
cli.decryptMessages(ctx, info, node)
|
|
65
|
+
cancelled = cli.decryptMessages(ctx, info, node)
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
func (cli *Client) parseMessageSource(node *waBinary.Node, requireParticipant bool) (source types.MessageSource, err error) {
|
|
68
71
|
clientID := cli.getOwnID()
|
|
69
|
-
clientLID := cli.
|
|
72
|
+
clientLID := cli.getOwnLID()
|
|
70
73
|
if clientID.IsEmpty() {
|
|
71
74
|
err = ErrNotLoggedIn
|
|
72
75
|
return
|
|
@@ -106,8 +109,8 @@ func (cli *Client) parseMessageSource(node *waBinary.Node, requireParticipant bo
|
|
|
106
109
|
} else {
|
|
107
110
|
source.Chat = from.ToNonAD()
|
|
108
111
|
}
|
|
109
|
-
if source.
|
|
110
|
-
source.RecipientAlt = ag.OptionalJIDOrEmpty("peer_recipient_pn")
|
|
112
|
+
if source.Chat.Server == types.HiddenUserServer {
|
|
113
|
+
source.RecipientAlt = ag.OptionalJIDOrEmpty("peer_recipient_pn")
|
|
111
114
|
} else {
|
|
112
115
|
source.RecipientAlt = ag.OptionalJIDOrEmpty("peer_recipient_lid")
|
|
113
116
|
}
|
|
@@ -124,7 +127,7 @@ func (cli *Client) parseMessageSource(node *waBinary.Node, requireParticipant bo
|
|
|
124
127
|
} else {
|
|
125
128
|
source.Chat = from.ToNonAD()
|
|
126
129
|
source.Sender = from
|
|
127
|
-
if source.
|
|
130
|
+
if source.Sender.Server == types.HiddenUserServer {
|
|
128
131
|
source.SenderAlt = ag.OptionalJIDOrEmpty("sender_pn")
|
|
129
132
|
} else {
|
|
130
133
|
source.SenderAlt = ag.OptionalJIDOrEmpty("sender_lid")
|
|
@@ -156,6 +159,7 @@ func (cli *Client) parseMsgMetaInfo(node waBinary.Node) (metaInfo types.MsgMetaI
|
|
|
156
159
|
ag := metaNode.AttrGetter()
|
|
157
160
|
metaInfo.TargetID = types.MessageID(ag.OptionalString("target_id"))
|
|
158
161
|
metaInfo.TargetSender = ag.OptionalJIDOrEmpty("target_sender_jid")
|
|
162
|
+
metaInfo.TargetChat = ag.OptionalJIDOrEmpty("target_chat_jid")
|
|
159
163
|
deprecatedLIDSession, ok := ag.GetBool("deprecated_lid_session", false)
|
|
160
164
|
if ok {
|
|
161
165
|
metaInfo.DeprecatedLIDSession = &deprecatedLIDSession
|
|
@@ -218,7 +222,7 @@ func (cli *Client) parseMessageInfo(node *waBinary.Node) (*types.MessageInfo, er
|
|
|
218
222
|
return &info, nil
|
|
219
223
|
}
|
|
220
224
|
|
|
221
|
-
func (cli *Client) handlePlaintextMessage(ctx context.Context, info *types.MessageInfo, node *waBinary.Node) {
|
|
225
|
+
func (cli *Client) handlePlaintextMessage(ctx context.Context, info *types.MessageInfo, node *waBinary.Node) (handlerFailed bool) {
|
|
222
226
|
// TODO edits have an additional <meta msg_edit_t="1696321271735" original_msg_t="1696321248"/> node
|
|
223
227
|
plaintext, ok := node.GetOptionalChildByTag("plaintext")
|
|
224
228
|
if !ok {
|
|
@@ -249,7 +253,7 @@ func (cli *Client) handlePlaintextMessage(ctx context.Context, info *types.Messa
|
|
|
249
253
|
OriginalTS: meta.AttrGetter().UnixTime("original_msg_t"),
|
|
250
254
|
}
|
|
251
255
|
}
|
|
252
|
-
cli.dispatchEvent(evt.UnwrapRaw())
|
|
256
|
+
return cli.dispatchEvent(evt.UnwrapRaw())
|
|
253
257
|
}
|
|
254
258
|
|
|
255
259
|
func (cli *Client) migrateSessionStore(ctx context.Context, pn, lid types.JID) {
|
|
@@ -259,12 +263,16 @@ func (cli *Client) migrateSessionStore(ctx context.Context, pn, lid types.JID) {
|
|
|
259
263
|
}
|
|
260
264
|
}
|
|
261
265
|
|
|
262
|
-
func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo, node *waBinary.Node) {
|
|
266
|
+
func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo, node *waBinary.Node) (handlerFailed bool) {
|
|
263
267
|
unavailableNode, ok := node.GetOptionalChildByTag("unavailable")
|
|
264
268
|
if ok && len(node.GetChildrenByTag("enc")) == 0 {
|
|
265
269
|
uType := events.UnavailableType(unavailableNode.AttrGetter().String("type"))
|
|
266
270
|
cli.Log.Warnf("Unavailable message %s from %s (type: %q)", info.ID, info.SourceString(), uType)
|
|
267
|
-
|
|
271
|
+
if cli.SynchronousAck {
|
|
272
|
+
cli.immediateRequestMessageFromPhone(ctx, info)
|
|
273
|
+
} else {
|
|
274
|
+
go cli.delayedRequestMessageFromPhone(info)
|
|
275
|
+
}
|
|
268
276
|
cli.dispatchEvent(&events.UndecryptableMessage{Info: *info, IsUnavailable: true, UnavailableType: uType})
|
|
269
277
|
return
|
|
270
278
|
}
|
|
@@ -307,14 +315,12 @@ func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo,
|
|
|
307
315
|
decrypted, ciphertextHash, err = cli.decryptGroupMsg(ctx, &child, senderEncryptionJID, info.Chat, info.Timestamp)
|
|
308
316
|
} else if encType == "msmsg" && info.Sender.IsBot() {
|
|
309
317
|
targetSenderJID := info.MsgMetaInfo.TargetSender
|
|
310
|
-
messageSecretSenderJID := targetSenderJID
|
|
311
318
|
if targetSenderJID.User == "" {
|
|
312
319
|
if info.Sender.Server == types.BotServer {
|
|
313
|
-
targetSenderJID = cli.
|
|
320
|
+
targetSenderJID = cli.getOwnLID()
|
|
314
321
|
} else {
|
|
315
322
|
targetSenderJID = cli.getOwnID()
|
|
316
323
|
}
|
|
317
|
-
messageSecretSenderJID = cli.getOwnID()
|
|
318
324
|
}
|
|
319
325
|
var decryptMessageID string
|
|
320
326
|
if info.MsgBotInfo.EditType == types.EditTypeInner || info.MsgBotInfo.EditType == types.EditTypeLast {
|
|
@@ -324,7 +330,7 @@ func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo,
|
|
|
324
330
|
}
|
|
325
331
|
var msMsg waE2E.MessageSecretMessage
|
|
326
332
|
var messageSecret []byte
|
|
327
|
-
if messageSecret, err = cli.Store.MsgSecrets.GetMessageSecret(ctx, info.Chat,
|
|
333
|
+
if messageSecret, _, err = cli.Store.MsgSecrets.GetMessageSecret(ctx, info.Chat, targetSenderJID, info.MsgMetaInfo.TargetID); err != nil {
|
|
328
334
|
err = fmt.Errorf("failed to get message secret for %s: %v", info.MsgMetaInfo.TargetID, err)
|
|
329
335
|
} else if messageSecret == nil {
|
|
330
336
|
err = fmt.Errorf("message secret for %s not found", info.MsgMetaInfo.TargetID)
|
|
@@ -342,12 +348,20 @@ func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo,
|
|
|
342
348
|
cli.Log.Debugf("Ignoring message %s from %s: %v", info.ID, info.SourceString(), err)
|
|
343
349
|
return
|
|
344
350
|
} else if err != nil {
|
|
345
|
-
cli.Log.Warnf("Error decrypting message from %s: %v", info.SourceString(), err)
|
|
351
|
+
cli.Log.Warnf("Error decrypting message %s from %s: %v", info.ID, info.SourceString(), err)
|
|
352
|
+
if ctx.Err() != nil || errors.Is(err, context.Canceled) {
|
|
353
|
+
handlerFailed = true
|
|
354
|
+
return
|
|
355
|
+
}
|
|
346
356
|
isUnavailable := encType == "skmsg" && !containsDirectMsg && errors.Is(err, signalerror.ErrNoSenderKeyForUser)
|
|
347
357
|
if encType != "msmsg" {
|
|
348
|
-
|
|
358
|
+
if cli.SynchronousAck {
|
|
359
|
+
cli.sendRetryReceipt(ctx, node, info, isUnavailable)
|
|
360
|
+
} else {
|
|
361
|
+
go cli.sendRetryReceipt(context.WithoutCancel(ctx), node, info, isUnavailable)
|
|
362
|
+
}
|
|
349
363
|
}
|
|
350
|
-
cli.dispatchEvent(&events.UndecryptableMessage{
|
|
364
|
+
handlerFailed = cli.dispatchEvent(&events.UndecryptableMessage{
|
|
351
365
|
Info: *info,
|
|
352
366
|
IsUnavailable: isUnavailable,
|
|
353
367
|
DecryptFailMode: events.DecryptFailMode(ag.OptionalString("decrypt-fail")),
|
|
@@ -365,14 +379,17 @@ func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo,
|
|
|
365
379
|
cli.Log.Warnf("Error unmarshaling decrypted message from %s: %v", info.SourceString(), err)
|
|
366
380
|
continue
|
|
367
381
|
}
|
|
368
|
-
cli.handleDecryptedMessage(ctx, info, &msg, retryCount)
|
|
382
|
+
handlerFailed = cli.handleDecryptedMessage(ctx, info, &msg, retryCount)
|
|
369
383
|
handled = true
|
|
370
384
|
case 3:
|
|
371
|
-
handled = cli.handleDecryptedArmadillo(ctx, info, decrypted, retryCount)
|
|
385
|
+
handled, handlerFailed = cli.handleDecryptedArmadillo(ctx, info, decrypted, retryCount)
|
|
372
386
|
default:
|
|
373
387
|
cli.Log.Warnf("Unknown version %d in decrypted message from %s", ag.Int("v"), info.SourceString())
|
|
374
388
|
}
|
|
375
|
-
if
|
|
389
|
+
if handlerFailed {
|
|
390
|
+
cli.Log.Warnf("Handler for %s failed", info.ID)
|
|
391
|
+
}
|
|
392
|
+
if ciphertextHash != nil && cli.EnableDecryptedEventBuffer && !handlerFailed {
|
|
376
393
|
// Use the context passed to decryptMessages
|
|
377
394
|
err = cli.Store.EventBuffer.ClearBufferedEventPlaintext(ctx, *ciphertextHash)
|
|
378
395
|
if err != nil {
|
|
@@ -385,7 +402,7 @@ func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo,
|
|
|
385
402
|
Msg("Deleted event plaintext from buffer")
|
|
386
403
|
}
|
|
387
404
|
|
|
388
|
-
if time.Since(cli.lastDecryptedBufferClear) > 12*time.Hour {
|
|
405
|
+
if time.Since(cli.lastDecryptedBufferClear) > 12*time.Hour && ctx.Err() == nil {
|
|
389
406
|
cli.lastDecryptedBufferClear = time.Now()
|
|
390
407
|
go func() {
|
|
391
408
|
err := cli.Store.EventBuffer.DeleteOldBufferedHashes(context.WithoutCancel(ctx))
|
|
@@ -396,9 +413,10 @@ func (cli *Client) decryptMessages(ctx context.Context, info *types.MessageInfo,
|
|
|
396
413
|
}
|
|
397
414
|
}
|
|
398
415
|
}
|
|
399
|
-
if handled {
|
|
416
|
+
if handled && !handlerFailed {
|
|
400
417
|
go cli.sendMessageReceipt(info)
|
|
401
418
|
}
|
|
419
|
+
return
|
|
402
420
|
}
|
|
403
421
|
|
|
404
422
|
func (cli *Client) clearUntrustedIdentity(ctx context.Context, target types.JID) error {
|
|
@@ -605,32 +623,52 @@ func (cli *Client) handleHistorySyncNotificationLoop() {
|
|
|
605
623
|
go cli.handleHistorySyncNotificationLoop()
|
|
606
624
|
}
|
|
607
625
|
}()
|
|
608
|
-
ctx :=
|
|
626
|
+
ctx := cli.BackgroundEventCtx
|
|
609
627
|
for notif := range cli.historySyncNotifications {
|
|
610
|
-
cli.
|
|
628
|
+
blob, err := cli.DownloadHistorySync(ctx, notif, false)
|
|
629
|
+
if err != nil {
|
|
630
|
+
cli.Log.Errorf("Failed to download history sync: %v", err)
|
|
631
|
+
} else {
|
|
632
|
+
cli.dispatchEvent(&events.HistorySync{Data: blob})
|
|
633
|
+
}
|
|
611
634
|
}
|
|
612
635
|
}
|
|
613
636
|
|
|
614
|
-
|
|
637
|
+
// DownloadHistorySync will download and parse the history sync blob from the given history sync notification.
|
|
638
|
+
//
|
|
639
|
+
// You only need to call this manually if you set [Client.ManualHistorySyncDownload] to true.
|
|
640
|
+
// By default, whatsmeow will call this automatically and dispatch an [events.HistorySync] with the parsed data.
|
|
641
|
+
func (cli *Client) DownloadHistorySync(ctx context.Context, notif *waE2E.HistorySyncNotification, synchronousStorage bool) (*waHistorySync.HistorySync, error) {
|
|
615
642
|
var historySync waHistorySync.HistorySync
|
|
616
643
|
if data, err := cli.Download(ctx, notif); err != nil {
|
|
617
|
-
|
|
644
|
+
return nil, fmt.Errorf("failed to download: %w", err)
|
|
618
645
|
} else if reader, err := zlib.NewReader(bytes.NewReader(data)); err != nil {
|
|
619
|
-
|
|
646
|
+
return nil, fmt.Errorf("failed to prepare to decompress: %w", err)
|
|
620
647
|
} else if rawData, err := io.ReadAll(reader); err != nil {
|
|
621
|
-
|
|
648
|
+
return nil, fmt.Errorf("failed to decompress: %w", err)
|
|
622
649
|
} else if err = proto.Unmarshal(rawData, &historySync); err != nil {
|
|
623
|
-
|
|
650
|
+
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
|
624
651
|
} else {
|
|
625
|
-
cli.Log.Debugf("Received history sync (type %s, chunk %d)", historySync.GetSyncType(), historySync.GetChunkOrder())
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
652
|
+
cli.Log.Debugf("Received history sync (type %s, chunk %d, progress %d)", historySync.GetSyncType(), historySync.GetChunkOrder(), historySync.GetProgress())
|
|
653
|
+
doStorage := func(ctx context.Context) {
|
|
654
|
+
if historySync.GetSyncType() == waHistorySync.HistorySync_PUSH_NAME {
|
|
655
|
+
cli.handleHistoricalPushNames(ctx, historySync.GetPushnames())
|
|
656
|
+
} else if len(historySync.GetConversations()) > 0 {
|
|
657
|
+
cli.storeHistoricalMessageSecrets(ctx, historySync.GetConversations())
|
|
658
|
+
}
|
|
659
|
+
if len(historySync.GetPhoneNumberToLidMappings()) > 0 {
|
|
660
|
+
cli.storeHistoricalPNLIDMappings(ctx, historySync.GetPhoneNumberToLidMappings())
|
|
661
|
+
}
|
|
662
|
+
if historySync.GlobalSettings != nil {
|
|
663
|
+
cli.storeGlobalSettings(ctx, historySync.GlobalSettings)
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
if synchronousStorage {
|
|
667
|
+
doStorage(ctx)
|
|
668
|
+
} else {
|
|
669
|
+
go doStorage(context.WithoutCancel(ctx))
|
|
670
|
+
}
|
|
671
|
+
return &historySync, nil
|
|
634
672
|
}
|
|
635
673
|
}
|
|
636
674
|
|
|
@@ -670,10 +708,11 @@ func (cli *Client) handleAppStateSyncKeyShare(ctx context.Context, keys *waE2E.A
|
|
|
670
708
|
}
|
|
671
709
|
}
|
|
672
710
|
|
|
673
|
-
func (cli *Client) handlePlaceholderResendResponse(msg *waE2E.PeerDataOperationRequestResponseMessage) {
|
|
711
|
+
func (cli *Client) handlePlaceholderResendResponse(msg *waE2E.PeerDataOperationRequestResponseMessage) (ok bool) {
|
|
674
712
|
reqID := msg.GetStanzaID()
|
|
675
713
|
parts := msg.GetPeerDataOperationResult()
|
|
676
714
|
cli.Log.Debugf("Handling response to placeholder resend request %s with %d items", reqID, len(parts))
|
|
715
|
+
ok = true
|
|
677
716
|
for i, part := range parts {
|
|
678
717
|
var webMsg waWeb.WebMessageInfo
|
|
679
718
|
if resp := part.GetPlaceholderMessageResendResponse(); resp == nil {
|
|
@@ -684,36 +723,50 @@ func (cli *Client) handlePlaceholderResendResponse(msg *waE2E.PeerDataOperationR
|
|
|
684
723
|
cli.Log.Warnf("Failed to parse web message info in item #%d of response to %s: %v", i+1, reqID, err)
|
|
685
724
|
} else {
|
|
686
725
|
msgEvt.UnavailableRequestID = reqID
|
|
687
|
-
cli.dispatchEvent(msgEvt)
|
|
726
|
+
ok = cli.dispatchEvent(msgEvt) && ok
|
|
688
727
|
}
|
|
689
728
|
}
|
|
729
|
+
return
|
|
690
730
|
}
|
|
691
731
|
|
|
692
|
-
func (cli *Client) handleProtocolMessage(ctx context.Context, info *types.MessageInfo, msg *waE2E.Message) {
|
|
732
|
+
func (cli *Client) handleProtocolMessage(ctx context.Context, info *types.MessageInfo, msg *waE2E.Message) (ok bool) {
|
|
733
|
+
ok = true
|
|
693
734
|
protoMsg := msg.GetProtocolMessage()
|
|
694
735
|
|
|
695
|
-
if
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
736
|
+
if !info.IsFromMe {
|
|
737
|
+
return
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
if protoMsg.GetHistorySyncNotification() != nil {
|
|
741
|
+
if !cli.ManualHistorySyncDownload {
|
|
742
|
+
cli.historySyncNotifications <- protoMsg.HistorySyncNotification
|
|
743
|
+
if cli.historySyncHandlerStarted.CompareAndSwap(false, true) {
|
|
744
|
+
go cli.handleHistorySyncNotificationLoop()
|
|
745
|
+
}
|
|
699
746
|
}
|
|
700
747
|
go cli.sendProtocolMessageReceipt(info.ID, types.ReceiptTypeHistorySync)
|
|
701
748
|
}
|
|
702
749
|
|
|
750
|
+
if protoMsg.GetLidMigrationMappingSyncMessage() != nil {
|
|
751
|
+
cli.storeLIDSyncMessage(ctx, protoMsg.GetLidMigrationMappingSyncMessage().GetEncodedMappingPayload())
|
|
752
|
+
}
|
|
753
|
+
|
|
703
754
|
if protoMsg.GetPeerDataOperationRequestResponseMessage().GetPeerDataOperationRequestType() == waE2E.PeerDataOperationRequestType_PLACEHOLDER_MESSAGE_RESEND {
|
|
704
|
-
|
|
755
|
+
ok = cli.handlePlaceholderResendResponse(protoMsg.GetPeerDataOperationRequestResponseMessage()) && ok
|
|
705
756
|
}
|
|
706
757
|
|
|
707
|
-
if protoMsg.GetAppStateSyncKeyShare() != nil
|
|
758
|
+
if protoMsg.GetAppStateSyncKeyShare() != nil {
|
|
708
759
|
go cli.handleAppStateSyncKeyShare(context.WithoutCancel(ctx), protoMsg.AppStateSyncKeyShare)
|
|
709
760
|
}
|
|
710
761
|
|
|
711
762
|
if info.Category == "peer" {
|
|
712
763
|
go cli.sendProtocolMessageReceipt(info.ID, types.ReceiptTypePeerMsg)
|
|
713
764
|
}
|
|
765
|
+
return
|
|
714
766
|
}
|
|
715
767
|
|
|
716
|
-
func (cli *Client) processProtocolParts(ctx context.Context, info *types.MessageInfo, msg *waE2E.Message) {
|
|
768
|
+
func (cli *Client) processProtocolParts(ctx context.Context, info *types.MessageInfo, msg *waE2E.Message) (ok bool) {
|
|
769
|
+
ok = true
|
|
717
770
|
cli.storeMessageSecret(ctx, info, msg)
|
|
718
771
|
// Hopefully sender key distribution messages and protocol messages can't be inside ephemeral messages
|
|
719
772
|
if msg.GetDeviceSentMessage().GetMessage() != nil {
|
|
@@ -733,8 +786,9 @@ func (cli *Client) processProtocolParts(ctx context.Context, info *types.Message
|
|
|
733
786
|
// N.B. Edits are protocol messages, but they're also wrapped inside EditedMessage,
|
|
734
787
|
// which is only unwrapped after processProtocolParts, so this won't trigger for edits.
|
|
735
788
|
if msg.GetProtocolMessage() != nil {
|
|
736
|
-
cli.handleProtocolMessage(ctx, info, msg)
|
|
789
|
+
ok = cli.handleProtocolMessage(ctx, info, msg) && ok
|
|
737
790
|
}
|
|
791
|
+
return
|
|
738
792
|
}
|
|
739
793
|
|
|
740
794
|
func (cli *Client) storeMessageSecret(ctx context.Context, info *types.MessageInfo, msg *waE2E.Message) {
|
|
@@ -816,10 +870,107 @@ func (cli *Client) storeHistoricalMessageSecrets(ctx context.Context, conversati
|
|
|
816
870
|
}
|
|
817
871
|
}
|
|
818
872
|
|
|
819
|
-
func (cli *Client)
|
|
820
|
-
|
|
873
|
+
func (cli *Client) storeLIDSyncMessage(ctx context.Context, msg []byte) {
|
|
874
|
+
var decoded waLidMigrationSyncPayload.LIDMigrationMappingSyncPayload
|
|
875
|
+
err := proto.Unmarshal(msg, &decoded)
|
|
876
|
+
if err != nil {
|
|
877
|
+
zerolog.Ctx(ctx).Err(err).Msg("Failed to unmarshal LID migration mapping sync payload")
|
|
878
|
+
return
|
|
879
|
+
}
|
|
880
|
+
if cli.Store.LIDMigrationTimestamp == 0 && decoded.GetChatDbMigrationTimestamp() > 0 {
|
|
881
|
+
cli.Store.LIDMigrationTimestamp = int64(decoded.GetChatDbMigrationTimestamp())
|
|
882
|
+
err = cli.Store.Save(ctx)
|
|
883
|
+
if err != nil {
|
|
884
|
+
zerolog.Ctx(ctx).Err(err).
|
|
885
|
+
Int64("lid_migration_timestamp", cli.Store.LIDMigrationTimestamp).
|
|
886
|
+
Msg("Failed to save chat DB LID migration timestamp")
|
|
887
|
+
} else {
|
|
888
|
+
zerolog.Ctx(ctx).Debug().
|
|
889
|
+
Int64("lid_migration_timestamp", cli.Store.LIDMigrationTimestamp).
|
|
890
|
+
Msg("Saved chat DB LID migration timestamp")
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
lidPairs := make([]store.LIDMapping, len(decoded.PnToLidMappings))
|
|
894
|
+
for i, mapping := range decoded.PnToLidMappings {
|
|
895
|
+
lidPairs[i] = store.LIDMapping{
|
|
896
|
+
LID: types.JID{User: strconv.FormatUint(mapping.GetAssignedLid(), 10), Server: types.HiddenUserServer},
|
|
897
|
+
PN: types.JID{User: strconv.FormatUint(mapping.GetPn(), 10), Server: types.DefaultUserServer},
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
err = cli.Store.LIDs.PutManyLIDMappings(ctx, lidPairs)
|
|
901
|
+
if err != nil {
|
|
902
|
+
zerolog.Ctx(ctx).Err(err).
|
|
903
|
+
Int("pair_count", len(lidPairs)).
|
|
904
|
+
Msg("Failed to store phone number to LID mappings from sync message")
|
|
905
|
+
} else {
|
|
906
|
+
zerolog.Ctx(ctx).Debug().
|
|
907
|
+
Int("pair_count", len(lidPairs)).
|
|
908
|
+
Msg("Stored PN-LID mappings from sync message")
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
func (cli *Client) storeGlobalSettings(ctx context.Context, settings *waHistorySync.GlobalSettings) {
|
|
913
|
+
if cli.Store.LIDMigrationTimestamp == 0 && settings.GetChatDbLidMigrationTimestamp() > 0 {
|
|
914
|
+
cli.Store.LIDMigrationTimestamp = settings.GetChatDbLidMigrationTimestamp()
|
|
915
|
+
err := cli.Store.Save(ctx)
|
|
916
|
+
if err != nil {
|
|
917
|
+
zerolog.Ctx(ctx).Err(err).
|
|
918
|
+
Int64("lid_migration_timestamp", cli.Store.LIDMigrationTimestamp).
|
|
919
|
+
Msg("Failed to save chat DB LID migration timestamp")
|
|
920
|
+
} else {
|
|
921
|
+
zerolog.Ctx(ctx).Debug().
|
|
922
|
+
Int64("lid_migration_timestamp", cli.Store.LIDMigrationTimestamp).
|
|
923
|
+
Msg("Saved chat DB LID migration timestamp")
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
func (cli *Client) storeHistoricalPNLIDMappings(ctx context.Context, mappings []*waHistorySync.PhoneNumberToLIDMapping) {
|
|
929
|
+
lidPairs := make([]store.LIDMapping, 0, len(mappings))
|
|
930
|
+
for _, mapping := range mappings {
|
|
931
|
+
pn, err := types.ParseJID(mapping.GetPnJID())
|
|
932
|
+
if err != nil {
|
|
933
|
+
zerolog.Ctx(ctx).Err(err).
|
|
934
|
+
Str("pn_jid", mapping.GetPnJID()).
|
|
935
|
+
Str("lid_jid", mapping.GetLidJID()).
|
|
936
|
+
Msg("Failed to parse phone number from history sync")
|
|
937
|
+
continue
|
|
938
|
+
}
|
|
939
|
+
if pn.Server == types.LegacyUserServer {
|
|
940
|
+
pn.Server = types.DefaultUserServer
|
|
941
|
+
}
|
|
942
|
+
lid, err := types.ParseJID(mapping.GetLidJID())
|
|
943
|
+
if err != nil {
|
|
944
|
+
zerolog.Ctx(ctx).Err(err).
|
|
945
|
+
Str("pn_jid", mapping.GetPnJID()).
|
|
946
|
+
Str("lid_jid", mapping.GetLidJID()).
|
|
947
|
+
Msg("Failed to parse LID from history sync")
|
|
948
|
+
continue
|
|
949
|
+
}
|
|
950
|
+
lidPairs = append(lidPairs, store.LIDMapping{
|
|
951
|
+
LID: lid,
|
|
952
|
+
PN: pn,
|
|
953
|
+
})
|
|
954
|
+
}
|
|
955
|
+
err := cli.Store.LIDs.PutManyLIDMappings(ctx, lidPairs)
|
|
956
|
+
if err != nil {
|
|
957
|
+
zerolog.Ctx(ctx).Err(err).
|
|
958
|
+
Int("pair_count", len(lidPairs)).
|
|
959
|
+
Msg("Failed to store phone number to LID mappings from history sync")
|
|
960
|
+
} else {
|
|
961
|
+
zerolog.Ctx(ctx).Debug().
|
|
962
|
+
Int("pair_count", len(lidPairs)).
|
|
963
|
+
Msg("Stored PN-LID mappings from history sync")
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
func (cli *Client) handleDecryptedMessage(ctx context.Context, info *types.MessageInfo, msg *waE2E.Message, retryCount int) bool {
|
|
968
|
+
ok := cli.processProtocolParts(ctx, info, msg)
|
|
969
|
+
if !ok {
|
|
970
|
+
return false
|
|
971
|
+
}
|
|
821
972
|
evt := &events.Message{Info: *info, RawMessage: msg, RetryCount: retryCount}
|
|
822
|
-
cli.dispatchEvent(evt.UnwrapRaw())
|
|
973
|
+
return cli.dispatchEvent(evt.UnwrapRaw())
|
|
823
974
|
}
|
|
824
975
|
|
|
825
976
|
func (cli *Client) sendProtocolMessageReceipt(id types.MessageID, msgType types.ReceiptType) {
|
|
@@ -98,22 +98,10 @@ func (cli *Client) decryptMsgSecret(ctx context.Context, msg *events.Message, us
|
|
|
98
98
|
if err != nil {
|
|
99
99
|
return nil, err
|
|
100
100
|
}
|
|
101
|
-
baseEncKey, err := cli.Store.MsgSecrets.GetMessageSecret(ctx, msg.Info.Chat, origSender, origMsgKey.GetID())
|
|
101
|
+
baseEncKey, origSender, err := cli.Store.MsgSecrets.GetMessageSecret(ctx, msg.Info.Chat, origSender, origMsgKey.GetID())
|
|
102
102
|
if err != nil {
|
|
103
103
|
return nil, fmt.Errorf("failed to get original message secret key: %w", err)
|
|
104
104
|
}
|
|
105
|
-
if baseEncKey == nil && origMsgKey.GetFromMe() && origSender.Server == types.HiddenUserServer {
|
|
106
|
-
origSender, err = cli.Store.LIDs.GetPNForLID(ctx, origSender)
|
|
107
|
-
if err != nil {
|
|
108
|
-
return nil, fmt.Errorf("%w (also failed to get PN for LID: %w)", ErrOriginalMessageSecretNotFound, err)
|
|
109
|
-
} else if origSender.IsEmpty() {
|
|
110
|
-
return nil, fmt.Errorf("%w (PN for LID not found)", ErrOriginalMessageSecretNotFound)
|
|
111
|
-
}
|
|
112
|
-
baseEncKey, err = cli.Store.MsgSecrets.GetMessageSecret(ctx, msg.Info.Chat, origSender, origMsgKey.GetID())
|
|
113
|
-
if err != nil {
|
|
114
|
-
return nil, fmt.Errorf("failed to get original message secret key with PN: %w", err)
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
105
|
if baseEncKey == nil {
|
|
118
106
|
return nil, ErrOriginalMessageSecretNotFound
|
|
119
107
|
}
|
|
@@ -132,7 +120,7 @@ func (cli *Client) encryptMsgSecret(ctx context.Context, ownID, chat, origSender
|
|
|
132
120
|
return nil, nil, ErrNotLoggedIn
|
|
133
121
|
}
|
|
134
122
|
|
|
135
|
-
baseEncKey, err := cli.Store.MsgSecrets.GetMessageSecret(ctx, chat, origSender, origMsgID)
|
|
123
|
+
baseEncKey, origSender, err := cli.Store.MsgSecrets.GetMessageSecret(ctx, chat, origSender, origMsgID)
|
|
136
124
|
if err != nil {
|
|
137
125
|
return nil, nil, fmt.Errorf("failed to get original message secret key: %w", err)
|
|
138
126
|
} else if baseEncKey == nil {
|
|
@@ -10,10 +10,16 @@ import (
|
|
|
10
10
|
"context"
|
|
11
11
|
"encoding/json"
|
|
12
12
|
"fmt"
|
|
13
|
+
"log"
|
|
13
14
|
"strings"
|
|
14
15
|
"time"
|
|
15
16
|
|
|
17
|
+
"github.com/beeper/argo-go/codec"
|
|
18
|
+
"github.com/beeper/argo-go/pkg/buf"
|
|
19
|
+
|
|
20
|
+
"go.mau.fi/whatsmeow/argo"
|
|
16
21
|
waBinary "go.mau.fi/whatsmeow/binary"
|
|
22
|
+
"go.mau.fi/whatsmeow/proto/waWa6"
|
|
17
23
|
"go.mau.fi/whatsmeow/types"
|
|
18
24
|
)
|
|
19
25
|
|
|
@@ -118,9 +124,53 @@ const (
|
|
|
118
124
|
mutationCreateNewsletter = "6234210096708695"
|
|
119
125
|
mutationUnfollowNewsletter = "6392786840836363"
|
|
120
126
|
mutationFollowNewsletter = "9926858900719341"
|
|
127
|
+
|
|
128
|
+
// desktop & mobile
|
|
129
|
+
queryFetchNewsletterDesktop = "9779843322044422"
|
|
130
|
+
queryRecommendedNewslettersDesktop = "27256776790637714"
|
|
131
|
+
querySubscribedNewslettersDesktop = "8621797084555037"
|
|
132
|
+
queryNewsletterSubscribersDesktop = "25403502652570342"
|
|
133
|
+
mutationMuteNewsletterDesktop = "5971669009605755" // variables -> {newsletter_id, updates->{description, settings}}, output: xwa2_newsletter_update -> NewsletterMetadata without viewer meta
|
|
134
|
+
mutationUnmuteNewsletterDesktop = "6104029483058502"
|
|
135
|
+
mutationUpdateNewsletterDesktop = "7839742399440946"
|
|
136
|
+
mutationCreateNewsletterDesktop = "27527996220149684"
|
|
137
|
+
mutationUnfollowNewsletterDesktop = "8782612271820087"
|
|
138
|
+
mutationFollowNewsletterDesktop = "8621797084555037"
|
|
121
139
|
)
|
|
122
140
|
|
|
141
|
+
func convertQueryID(cli *Client, queryID string) string {
|
|
142
|
+
if payload := cli.Store.GetClientPayload(); payload.GetUserAgent().Platform == waWa6.ClientPayload_UserAgent_MACOS.Enum() || payload.GetWebInfo() == nil {
|
|
143
|
+
switch queryID {
|
|
144
|
+
case queryFetchNewsletter:
|
|
145
|
+
return queryFetchNewsletterDesktop
|
|
146
|
+
case queryRecommendedNewsletters:
|
|
147
|
+
return queryRecommendedNewslettersDesktop
|
|
148
|
+
case querySubscribedNewsletters:
|
|
149
|
+
return querySubscribedNewslettersDesktop
|
|
150
|
+
case queryNewsletterSubscribers:
|
|
151
|
+
return queryNewsletterSubscribersDesktop
|
|
152
|
+
case mutationMuteNewsletter:
|
|
153
|
+
return mutationMuteNewsletterDesktop
|
|
154
|
+
case mutationUnmuteNewsletter:
|
|
155
|
+
return mutationUnmuteNewsletterDesktop
|
|
156
|
+
case mutationUpdateNewsletter:
|
|
157
|
+
return mutationUpdateNewsletterDesktop
|
|
158
|
+
case mutationCreateNewsletter:
|
|
159
|
+
return mutationCreateNewsletterDesktop
|
|
160
|
+
case mutationUnfollowNewsletter:
|
|
161
|
+
return mutationUnfollowNewsletterDesktop
|
|
162
|
+
case mutationFollowNewsletter:
|
|
163
|
+
return mutationFollowNewsletterDesktop
|
|
164
|
+
default:
|
|
165
|
+
return queryID
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
return queryID
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
123
172
|
func (cli *Client) sendMexIQ(ctx context.Context, queryID string, variables any) (json.RawMessage, error) {
|
|
173
|
+
queryID = convertQueryID(cli, queryID)
|
|
124
174
|
payload, err := json.Marshal(map[string]any{
|
|
125
175
|
"variables": variables,
|
|
126
176
|
})
|
|
@@ -151,14 +201,40 @@ func (cli *Client) sendMexIQ(ctx context.Context, queryID string, variables any)
|
|
|
151
201
|
if !ok {
|
|
152
202
|
return nil, fmt.Errorf("unexpected content type %T in mex response", result.Content)
|
|
153
203
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
204
|
+
if result.AttrGetter().OptionalString("format") == "argo" {
|
|
205
|
+
store, err := argo.GetStore()
|
|
206
|
+
if err != nil {
|
|
207
|
+
return nil, err
|
|
208
|
+
}
|
|
209
|
+
queryIDMap, err := argo.GetQueryIDToMessageName()
|
|
210
|
+
if err != nil {
|
|
211
|
+
return nil, err
|
|
212
|
+
}
|
|
213
|
+
wt := store[queryIDMap[queryID]]
|
|
214
|
+
|
|
215
|
+
decoder, err := codec.NewArgoDecoder(buf.NewBufReadonly(resultContent))
|
|
216
|
+
if err != nil {
|
|
217
|
+
return nil, err
|
|
218
|
+
}
|
|
219
|
+
data, err := decoder.ArgoToMap(wt)
|
|
220
|
+
if err != nil {
|
|
221
|
+
log.Fatalf("argo to map error: %v", err)
|
|
222
|
+
}
|
|
223
|
+
b, err := json.Marshal(data)
|
|
224
|
+
if err != nil {
|
|
225
|
+
return nil, err
|
|
226
|
+
}
|
|
227
|
+
return b, nil
|
|
228
|
+
} else {
|
|
229
|
+
var gqlResp types.GraphQLResponse
|
|
230
|
+
err = json.Unmarshal(resultContent, &gqlResp)
|
|
231
|
+
if err != nil {
|
|
232
|
+
return nil, fmt.Errorf("failed to unmarshal graphql response: %w", err)
|
|
233
|
+
} else if len(gqlResp.Errors) > 0 {
|
|
234
|
+
return gqlResp.Data, fmt.Errorf("graphql error: %w", gqlResp.Errors)
|
|
235
|
+
}
|
|
236
|
+
return gqlResp.Data, nil
|
|
160
237
|
}
|
|
161
|
-
return gqlResp.Data, nil
|
|
162
238
|
}
|
|
163
239
|
|
|
164
240
|
type respGetNewsletterInfo struct {
|