slidge-whatsapp 0.2.5__cp311-cp311-manylinux_2_36_aarch64.whl → 0.2.7__cp311-cp311-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/config.py +3 -0
- slidge_whatsapp/event.go +31 -26
- slidge_whatsapp/gateway.go +13 -9
- slidge_whatsapp/gateway.py +2 -2
- slidge_whatsapp/generated/_whatsapp.cpython-311-aarch64-linux-gnu.h +170 -170
- slidge_whatsapp/generated/_whatsapp.cpython-311-aarch64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +135 -135
- slidge_whatsapp/generated/whatsapp.c +1496 -1496
- slidge_whatsapp/generated/whatsapp.go +1137 -1137
- slidge_whatsapp/generated/whatsapp.py +1216 -1216
- slidge_whatsapp/generated/whatsapp_go.h +170 -170
- slidge_whatsapp/go.mod +15 -12
- slidge_whatsapp/go.sum +35 -29
- slidge_whatsapp/media/media.go +21 -11
- slidge_whatsapp/session.go +73 -66
- slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn.go +4 -4
- slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_darwin.go +0 -5
- slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +3 -0
- slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols.go +40 -20
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +14 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +2 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/fun.go +10 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_unix.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_windows.go +1 -1
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -7
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/callback.go +2 -1
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +8510 -5090
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +344 -150
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3.go +57 -23
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.c +4 -0
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.go +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/.gitignore +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/LICENSE +202 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/README.md +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid.go +35 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_gccgo.go +26 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.c +23 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.go +22 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.go +35 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.s +18 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.go +28 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.s +44 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_slow.go +24 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_gccgo_go1.8.go +17 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +38 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.5.go +57 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.6.go +43 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.9.go +37 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/CONTRIBUTING.md +43 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/README.md +31 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/console.go +20 -5
- slidge_whatsapp/vendor/github.com/rs/zerolog/log/log.go +131 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/log.go +1 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/sampler.go +4 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/writer.go +9 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupCipher.go +17 -6
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupSessionBuilder.go +17 -7
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/store/SenderKeyStore.go +4 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/chain/ChainKey.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/identity/IdentityKey.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/logger/DefaultLogger.go +2 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/FingerprintProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/LocalStorageProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/WhisperTextProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/session/Session.go +41 -17
- slidge_whatsapp/vendor/go.mau.fi/libsignal/session/SessionCipher.go +64 -30
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/IdentityKeyStore.go +5 -3
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/MessageKeyStore.go +6 -4
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/PreKeyStore.go +6 -4
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SessionStore.go +8 -6
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SignedPreKeyStore.go +7 -5
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/connlog.go +257 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/database.go +309 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/iter.go +233 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/json.go +47 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/log.go +129 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/massinsert.go +164 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/queryhelper.go +137 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/reflectscan.go +30 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/transaction.go +180 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgrades.go +250 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgradetable.go +331 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exerrors/dualerror.go +33 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exerrors/must.go +23 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/cors.go +32 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +64 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +36 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/middleware.go +30 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +37 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exstrings/stringutil.go +76 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +88 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/returnonce.go +25 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/ringbuffer.go +139 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncmap.go +94 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncset.go +136 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/callermarshal.go +28 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/defaults.go +32 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/generics.go +45 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/writer.go +81 -0
- slidge_whatsapp/vendor/go.mau.fi/util/ptr/ptr.go +43 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +27 -26
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/encode.go +4 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/keys.go +5 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +27 -25
- 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/broadcast.go +5 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +119 -37
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +29 -11
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +63 -30
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +74 -34
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +61 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +188 -152
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaconn.go +5 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaretry.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +444 -135
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +118 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +78 -42
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +7 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair.go +42 -18
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/prekeys.go +9 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/privacysettings.go +10 -11
- 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/waAdv/WAAdv.pb.go +39 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.go +354 -175
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.proto +5 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +170 -15
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +4 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.go +29 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.go +13 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.go +344 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.proto +26 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.pb.go → WACompanionReg.pb.go} +184 -89
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.proto → WACompanionReg.proto} +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.go +173 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.go +78 -16
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.proto +5 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +7428 -2151
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +373 -44
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +456 -135
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +14 -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/waMediaTransport/WAMediaTransport.pb.go +162 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.proto +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.go +32 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.proto +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.go +192 -52
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.proto +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.go +60 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/extra.go +7 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.go +39 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.go +61 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +800 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +72 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1344 -438
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +52 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.go +27 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.go +59 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +382 -78
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +563 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +4 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +25 -9
- 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 +39 -21
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +261 -75
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +28 -16
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +3 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +85 -43
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/signal.go +75 -88
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +86 -65
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/lidmap.go +186 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +291 -167
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +155 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/03-message-secrets.sql +11 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/04-privacy-tokens.sql +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/05-account-jid-format.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/06-facebook-uuid.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/07-account-lid.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/08-lid-mapping.sql +5 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/09-decryption-buffer.sql +10 -0
- 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/sqlstore/upgrades/upgrades.go +22 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +107 -56
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/botmap.go +210 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +13 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/group.go +15 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +7 -8
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +18 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/update.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/upload.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +47 -29
- slidge_whatsapp/vendor/golang.org/x/exp/LICENSE +27 -0
- slidge_whatsapp/vendor/golang.org/x/exp/PATENTS +22 -0
- slidge_whatsapp/vendor/golang.org/x/exp/constraints/constraints.go +54 -0
- slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/guts.go +50 -0
- slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/.gitignore +2 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/ascii.go +53 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/ciphers.go +641 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/client_conn_pool.go +311 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +122 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +61 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/databuffer.go +149 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/errors.go +145 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/flow.go +120 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +1702 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +170 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/encode.go +245 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/hpack.go +523 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/tables.go +403 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +432 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/pipe.go +184 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +3350 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +20 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +3287 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/unencrypted.go +32 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/write.go +381 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched.go +251 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_priority.go +451 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_random.go +77 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_roundrobin.go +119 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/go118.go +13 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/idna10.0.0.go +769 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/idna9.0.0.go +717 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/pre_go118.go +11 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/punycode.go +217 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables10.0.0.go +4559 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables11.0.0.go +4653 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables12.0.0.go +4733 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables13.0.0.go +4959 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables9.0.0.go +4486 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie.go +51 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie12.0.0.go +30 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie13.0.0.go +30 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trieval.go +119 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/request.go +467 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +148 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux.go +16 -26
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +84 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +20 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +84 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +20 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/security_windows.go +44 -5
- slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall_windows.go +4 -2
- slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +239 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +9 -0
- slidge_whatsapp/vendor/golang.org/x/text/LICENSE +27 -0
- slidge_whatsapp/vendor/golang.org/x/text/PATENTS +22 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule.go +336 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +11 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +14 -0
- slidge_whatsapp/vendor/golang.org/x/text/transform/transform.go +709 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/core.go +1071 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +1815 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +1887 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +1923 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +1955 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +1781 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/composition.go +512 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/forminfo.go +279 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/iter.go +458 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/normalize.go +610 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +7657 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +7693 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +7710 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +7760 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +7637 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
- 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 +3 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +16 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/{strings_unsafe_go121.go → strings_unsafe.go} +0 -2
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/proto/merge.go +6 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +2 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/{value_unsafe_go121.go → value_unsafe.go} +0 -2
- slidge_whatsapp/vendor/modules.txt +52 -13
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/METADATA +1 -1
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/RECORD +330 -184
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/WHEEL +1 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/CNAME +0 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/_config.yml +0 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.raw +0 -23
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.raw +0 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WAWebProtobufsCompanionReg.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go +0 -296
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go +0 -94
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go +0 -98
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/LICENSE +0 -0
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/entry_points.txt +0 -0
slidge_whatsapp/session.go
CHANGED
|
@@ -8,6 +8,7 @@ import (
|
|
|
8
8
|
"fmt"
|
|
9
9
|
"image/jpeg"
|
|
10
10
|
"math/rand"
|
|
11
|
+
"slices"
|
|
11
12
|
"time"
|
|
12
13
|
|
|
13
14
|
// Internal packages.
|
|
@@ -68,10 +69,11 @@ type Session struct {
|
|
|
68
69
|
func (s *Session) Login() error {
|
|
69
70
|
var err error
|
|
70
71
|
var store *store.Device
|
|
72
|
+
var ctx = context.Background()
|
|
71
73
|
|
|
72
74
|
// Try to fetch existing device from given device JID.
|
|
73
75
|
if s.device.ID != "" {
|
|
74
|
-
store, err = s.gateway.container.GetDevice(s.device.JID())
|
|
76
|
+
store, err = s.gateway.container.GetDevice(ctx, s.device.JID())
|
|
75
77
|
if err != nil {
|
|
76
78
|
return err
|
|
77
79
|
}
|
|
@@ -153,7 +155,7 @@ func (s *Session) Logout() error {
|
|
|
153
155
|
return nil
|
|
154
156
|
}
|
|
155
157
|
|
|
156
|
-
err := s.client.Logout()
|
|
158
|
+
err := s.client.Logout(context.Background())
|
|
157
159
|
s.client = nil
|
|
158
160
|
close(s.presenceChan)
|
|
159
161
|
|
|
@@ -176,16 +178,17 @@ func (s *Session) Disconnect() error {
|
|
|
176
178
|
// [Session] is already paired, or if the phone number given is empty or invalid.
|
|
177
179
|
func (s *Session) PairPhone(phone string) (string, error) {
|
|
178
180
|
if s.client == nil {
|
|
179
|
-
return "", fmt.Errorf("
|
|
181
|
+
return "", fmt.Errorf("cannot pair for uninitialized session")
|
|
180
182
|
} else if s.client.Store.ID != nil {
|
|
181
|
-
return "", fmt.Errorf("
|
|
183
|
+
return "", fmt.Errorf("refusing to pair for connected session")
|
|
182
184
|
} else if phone == "" {
|
|
183
|
-
return "", fmt.Errorf("
|
|
185
|
+
return "", fmt.Errorf("cannot pair for empty phone number")
|
|
184
186
|
}
|
|
185
187
|
|
|
186
|
-
|
|
188
|
+
var ctx = context.Background()
|
|
189
|
+
code, err := s.client.PairPhone(ctx, phone, true, whatsmeow.PairClientChrome, "Chrome (Linux)")
|
|
187
190
|
if err != nil {
|
|
188
|
-
return "", fmt.Errorf("
|
|
191
|
+
return "", fmt.Errorf("failed to pair with phone number: %s", err)
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
return code, nil
|
|
@@ -196,14 +199,15 @@ func (s *Session) PairPhone(phone string) (string, error) {
|
|
|
196
199
|
// documentation for the [Message] type for more information.
|
|
197
200
|
func (s *Session) SendMessage(message Message) error {
|
|
198
201
|
if s.client == nil || s.client.Store.ID == nil {
|
|
199
|
-
return fmt.Errorf("
|
|
202
|
+
return fmt.Errorf("cannot send message for unauthenticated session")
|
|
200
203
|
}
|
|
201
204
|
|
|
202
205
|
jid, err := types.ParseJID(message.JID)
|
|
203
206
|
if err != nil {
|
|
204
|
-
return fmt.Errorf("
|
|
207
|
+
return fmt.Errorf("could not parse sender JID for message: %s", err)
|
|
205
208
|
}
|
|
206
209
|
|
|
210
|
+
var ctx = context.Background()
|
|
207
211
|
var payload *waE2E.Message
|
|
208
212
|
var extra whatsmeow.SendRequestExtra
|
|
209
213
|
|
|
@@ -215,13 +219,13 @@ func (s *Session) SendMessage(message Message) error {
|
|
|
215
219
|
}
|
|
216
220
|
|
|
217
221
|
// Upload attachment into WhatsApp before sending message.
|
|
218
|
-
if payload, err = uploadAttachment(s.client, &message.Attachments[0]); err != nil {
|
|
219
|
-
return fmt.Errorf("
|
|
222
|
+
if payload, err = uploadAttachment(ctx, s.client, &message.Attachments[0]); err != nil {
|
|
223
|
+
return fmt.Errorf("failed uploading attachment: %s", err)
|
|
220
224
|
}
|
|
221
225
|
extra.ID = message.ID
|
|
222
226
|
case MessageEdit:
|
|
223
227
|
// Edit existing message by ID.
|
|
224
|
-
payload = s.client.BuildEdit(s.device.JID().ToNonAD(), message.ID, s.getMessagePayload(message))
|
|
228
|
+
payload = s.client.BuildEdit(s.device.JID().ToNonAD(), message.ID, s.getMessagePayload(ctx, message))
|
|
225
229
|
case MessageRevoke:
|
|
226
230
|
// Don't send message, but revoke existing message by ID.
|
|
227
231
|
var originJID types.JID
|
|
@@ -232,7 +236,7 @@ func (s *Session) SendMessage(message Message) error {
|
|
|
232
236
|
// A message moderation
|
|
233
237
|
originJID, err = types.ParseJID(message.OriginJID)
|
|
234
238
|
if err != nil {
|
|
235
|
-
return fmt.Errorf("
|
|
239
|
+
return fmt.Errorf("could not parse sender JID for message: %s", err)
|
|
236
240
|
}
|
|
237
241
|
}
|
|
238
242
|
payload = s.client.BuildRevoke(jid, originJID, message.ID)
|
|
@@ -251,12 +255,12 @@ func (s *Session) SendMessage(message Message) error {
|
|
|
251
255
|
},
|
|
252
256
|
}
|
|
253
257
|
default:
|
|
254
|
-
payload = s.getMessagePayload(message)
|
|
258
|
+
payload = s.getMessagePayload(ctx, message)
|
|
255
259
|
extra.ID = message.ID
|
|
256
260
|
}
|
|
257
261
|
|
|
258
262
|
s.gateway.logger.Debugf("Sending message to JID '%s': %+v", jid, payload)
|
|
259
|
-
_, err = s.client.SendMessage(
|
|
263
|
+
_, err = s.client.SendMessage(ctx, jid, payload, extra)
|
|
260
264
|
return err
|
|
261
265
|
}
|
|
262
266
|
|
|
@@ -268,11 +272,9 @@ const (
|
|
|
268
272
|
// GetMessagePayload returns a concrete WhatsApp protocol message for the given Message representation.
|
|
269
273
|
// The specific fields set within the protocol message, as well as its type, can depend on specific
|
|
270
274
|
// fields set in the Message type, and may be nested recursively (e.g. when replying to a reply).
|
|
271
|
-
func (s *Session) getMessagePayload(message Message) *waE2E.Message {
|
|
272
|
-
var payload *waE2E.Message
|
|
273
|
-
var ctx = context.Background()
|
|
274
|
-
|
|
275
|
+
func (s *Session) getMessagePayload(ctx context.Context, message Message) *waE2E.Message {
|
|
275
276
|
// Compose extended message when made as a reply to a different message.
|
|
277
|
+
var payload *waE2E.Message
|
|
276
278
|
if message.ReplyID != "" {
|
|
277
279
|
// Fall back to our own JID if no origin JID has been specified, in which case we assume
|
|
278
280
|
// we're replying to our own messages.
|
|
@@ -357,12 +359,12 @@ func (s *Session) GenerateMessageID() string {
|
|
|
357
359
|
// contact specified within.
|
|
358
360
|
func (s *Session) SendChatState(state ChatState) error {
|
|
359
361
|
if s.client == nil || s.client.Store.ID == nil {
|
|
360
|
-
return fmt.Errorf("
|
|
362
|
+
return fmt.Errorf("cannot send chat state for unauthenticated session")
|
|
361
363
|
}
|
|
362
364
|
|
|
363
365
|
jid, err := types.ParseJID(state.JID)
|
|
364
366
|
if err != nil {
|
|
365
|
-
return fmt.Errorf("
|
|
367
|
+
return fmt.Errorf("could not parse sender JID for chat state: %s", err)
|
|
366
368
|
}
|
|
367
369
|
|
|
368
370
|
var presence types.ChatPresence
|
|
@@ -379,7 +381,7 @@ func (s *Session) SendChatState(state ChatState) error {
|
|
|
379
381
|
// SendReceipt sends a read receipt to WhatsApp for the message IDs specified within.
|
|
380
382
|
func (s *Session) SendReceipt(receipt Receipt) error {
|
|
381
383
|
if s.client == nil || s.client.Store.ID == nil {
|
|
382
|
-
return fmt.Errorf("
|
|
384
|
+
return fmt.Errorf("cannot send receipt for unauthenticated session")
|
|
383
385
|
}
|
|
384
386
|
|
|
385
387
|
var jid, senderJID types.JID
|
|
@@ -387,17 +389,17 @@ func (s *Session) SendReceipt(receipt Receipt) error {
|
|
|
387
389
|
|
|
388
390
|
if receipt.GroupJID != "" {
|
|
389
391
|
if senderJID, err = types.ParseJID(receipt.JID); err != nil {
|
|
390
|
-
return fmt.Errorf("
|
|
392
|
+
return fmt.Errorf("could not parse sender JID for receipt: %s", err)
|
|
391
393
|
} else if jid, err = types.ParseJID(receipt.GroupJID); err != nil {
|
|
392
|
-
return fmt.Errorf("
|
|
394
|
+
return fmt.Errorf("could not parse group JID for receipt: %s", err)
|
|
393
395
|
}
|
|
394
396
|
} else {
|
|
395
397
|
if jid, err = types.ParseJID(receipt.JID); err != nil {
|
|
396
|
-
return fmt.Errorf("
|
|
398
|
+
return fmt.Errorf("could not parse sender JID for receipt: %s", err)
|
|
397
399
|
}
|
|
398
400
|
}
|
|
399
401
|
|
|
400
|
-
ids :=
|
|
402
|
+
ids := slices.Clone(receipt.MessageIDs)
|
|
401
403
|
return s.client.MarkRead(ids, time.Unix(receipt.Timestamp, 0), jid, senderJID)
|
|
402
404
|
}
|
|
403
405
|
|
|
@@ -405,7 +407,7 @@ func (s *Session) SendReceipt(receipt Receipt) error {
|
|
|
405
407
|
// user. An error is returned if setting availability fails for any reason.
|
|
406
408
|
func (s *Session) SendPresence(presence PresenceKind, statusMessage string) error {
|
|
407
409
|
if s.client == nil || s.client.Store.ID == nil {
|
|
408
|
-
return fmt.Errorf("
|
|
410
|
+
return fmt.Errorf("cannot send presence for unauthenticated session")
|
|
409
411
|
}
|
|
410
412
|
|
|
411
413
|
var err error
|
|
@@ -429,22 +431,23 @@ func (s *Session) SendPresence(presence PresenceKind, statusMessage string) erro
|
|
|
429
431
|
// If `refresh` is `true`, FetchRoster will pull application state from the remote service and
|
|
430
432
|
// synchronize any contacts found with the adapter.
|
|
431
433
|
func (s *Session) GetContacts(refresh bool) ([]Contact, error) {
|
|
434
|
+
var ctx = context.Background()
|
|
432
435
|
if s.client == nil || s.client.Store.ID == nil {
|
|
433
|
-
return nil, fmt.Errorf("
|
|
436
|
+
return nil, fmt.Errorf("cannot get contacts for unauthenticated session")
|
|
434
437
|
}
|
|
435
438
|
|
|
436
439
|
// Synchronize remote application state with local state if requested.
|
|
437
440
|
if refresh {
|
|
438
|
-
err := s.client.FetchAppState(appstate.WAPatchCriticalUnblockLow, false, false)
|
|
441
|
+
err := s.client.FetchAppState(ctx, appstate.WAPatchCriticalUnblockLow, false, false)
|
|
439
442
|
if err != nil {
|
|
440
443
|
s.gateway.logger.Warnf("Could not get app state from server: %s", err)
|
|
441
444
|
}
|
|
442
445
|
}
|
|
443
446
|
|
|
444
447
|
// Synchronize local contact state with overarching gateway for all local contacts.
|
|
445
|
-
data, err := s.client.Store.Contacts.GetAllContacts()
|
|
448
|
+
data, err := s.client.Store.Contacts.GetAllContacts(ctx)
|
|
446
449
|
if err != nil {
|
|
447
|
-
return nil, fmt.Errorf("
|
|
450
|
+
return nil, fmt.Errorf("failed getting local contacts: %s", err)
|
|
448
451
|
}
|
|
449
452
|
|
|
450
453
|
var contacts []Contact
|
|
@@ -464,12 +467,12 @@ func (s *Session) GetContacts(refresh bool) ([]Contact, error) {
|
|
|
464
467
|
// information on present participants.
|
|
465
468
|
func (s *Session) GetGroups() ([]Group, error) {
|
|
466
469
|
if s.client == nil || s.client.Store.ID == nil {
|
|
467
|
-
return nil, fmt.Errorf("
|
|
470
|
+
return nil, fmt.Errorf("cannot get groups for unauthenticated session")
|
|
468
471
|
}
|
|
469
472
|
|
|
470
473
|
data, err := s.client.GetJoinedGroups()
|
|
471
474
|
if err != nil {
|
|
472
|
-
return nil, fmt.Errorf("
|
|
475
|
+
return nil, fmt.Errorf("failed getting groups: %s", err)
|
|
473
476
|
}
|
|
474
477
|
|
|
475
478
|
var groups []Group
|
|
@@ -484,14 +487,14 @@ func (s *Session) GetGroups() ([]Group, error) {
|
|
|
484
487
|
// participant JIDs given.
|
|
485
488
|
func (s *Session) CreateGroup(name string, participants []string) (Group, error) {
|
|
486
489
|
if s.client == nil || s.client.Store.ID == nil {
|
|
487
|
-
return Group{}, fmt.Errorf("
|
|
490
|
+
return Group{}, fmt.Errorf("cannot create group for unauthenticated session")
|
|
488
491
|
}
|
|
489
492
|
|
|
490
493
|
var jids []types.JID
|
|
491
494
|
for _, p := range participants {
|
|
492
495
|
jid, err := types.ParseJID(p)
|
|
493
496
|
if err != nil {
|
|
494
|
-
return Group{}, fmt.Errorf("
|
|
497
|
+
return Group{}, fmt.Errorf("could not parse participant JID: %s", err)
|
|
495
498
|
}
|
|
496
499
|
|
|
497
500
|
jids = append(jids, jid)
|
|
@@ -500,7 +503,7 @@ func (s *Session) CreateGroup(name string, participants []string) (Group, error)
|
|
|
500
503
|
req := whatsmeow.ReqCreateGroup{Name: name, Participants: jids}
|
|
501
504
|
info, err := s.client.CreateGroup(req)
|
|
502
505
|
if err != nil {
|
|
503
|
-
return Group{}, fmt.Errorf("
|
|
506
|
+
return Group{}, fmt.Errorf("could not create group: %s", err)
|
|
504
507
|
}
|
|
505
508
|
|
|
506
509
|
return newGroup(s.client, info), nil
|
|
@@ -509,12 +512,12 @@ func (s *Session) CreateGroup(name string, participants []string) (Group, error)
|
|
|
509
512
|
// LeaveGroup attempts to remove our own user from the given WhatsApp group, for the JID given.
|
|
510
513
|
func (s *Session) LeaveGroup(resourceID string) error {
|
|
511
514
|
if s.client == nil || s.client.Store.ID == nil {
|
|
512
|
-
return fmt.Errorf("
|
|
515
|
+
return fmt.Errorf("cannot leave group for unauthenticated session")
|
|
513
516
|
}
|
|
514
517
|
|
|
515
518
|
jid, err := types.ParseJID(resourceID)
|
|
516
519
|
if err != nil {
|
|
517
|
-
return fmt.Errorf("
|
|
520
|
+
return fmt.Errorf("could not parse JID for leaving group: %s", err)
|
|
518
521
|
}
|
|
519
522
|
|
|
520
523
|
return s.client.LeaveGroup(jid)
|
|
@@ -525,19 +528,19 @@ func (s *Session) LeaveGroup(resourceID string) error {
|
|
|
525
528
|
// for the given ID has not changed.
|
|
526
529
|
func (s *Session) GetAvatar(resourceID, avatarID string) (Avatar, error) {
|
|
527
530
|
if s.client == nil || s.client.Store.ID == nil {
|
|
528
|
-
return Avatar{}, fmt.Errorf("
|
|
531
|
+
return Avatar{}, fmt.Errorf("cannot get avatar for unauthenticated session")
|
|
529
532
|
}
|
|
530
533
|
|
|
531
534
|
jid, err := types.ParseJID(resourceID)
|
|
532
535
|
if err != nil {
|
|
533
|
-
return Avatar{}, fmt.Errorf("
|
|
536
|
+
return Avatar{}, fmt.Errorf("could not parse JID for avatar: %s", err)
|
|
534
537
|
}
|
|
535
538
|
|
|
536
539
|
p, err := s.client.GetProfilePictureInfo(jid, &whatsmeow.GetProfilePictureParams{ExistingID: avatarID})
|
|
537
540
|
if errors.Is(err, whatsmeow.ErrProfilePictureNotSet) || errors.Is(err, whatsmeow.ErrProfilePictureUnauthorized) {
|
|
538
541
|
return Avatar{}, nil
|
|
539
542
|
} else if err != nil {
|
|
540
|
-
return Avatar{}, fmt.Errorf("
|
|
543
|
+
return Avatar{}, fmt.Errorf("could not get avatar: %s", err)
|
|
541
544
|
} else if p != nil {
|
|
542
545
|
return Avatar{ID: p.ID, URL: p.URL}, nil
|
|
543
546
|
}
|
|
@@ -550,7 +553,7 @@ func (s *Session) GetAvatar(resourceID, avatarID string) (Avatar, error) {
|
|
|
550
553
|
// typically used as a cache reference or in providing to future calls for [Session.GetAvatar].
|
|
551
554
|
func (s *Session) SetAvatar(resourceID string, avatar []byte) (string, error) {
|
|
552
555
|
if s.client == nil || s.client.Store.ID == nil {
|
|
553
|
-
return "", fmt.Errorf("
|
|
556
|
+
return "", fmt.Errorf("cannot set avatar for unauthenticated session")
|
|
554
557
|
}
|
|
555
558
|
|
|
556
559
|
var ctx = context.Background()
|
|
@@ -561,7 +564,7 @@ func (s *Session) SetAvatar(resourceID string, avatar []byte) (string, error) {
|
|
|
561
564
|
if resourceID == "" {
|
|
562
565
|
jid = types.EmptyJID
|
|
563
566
|
} else if jid, err = types.ParseJID(resourceID); err != nil {
|
|
564
|
-
return "", fmt.Errorf("
|
|
567
|
+
return "", fmt.Errorf("could not parse JID for avatar: %s", err)
|
|
565
568
|
}
|
|
566
569
|
|
|
567
570
|
if len(avatar) == 0 {
|
|
@@ -570,7 +573,7 @@ func (s *Session) SetAvatar(resourceID string, avatar []byte) (string, error) {
|
|
|
570
573
|
// Ensure avatar is in JPEG format, and convert before setting if needed.
|
|
571
574
|
data, err := media.Convert(ctx, avatar, &media.Spec{MIME: media.TypeJPEG})
|
|
572
575
|
if err != nil {
|
|
573
|
-
return "", fmt.Errorf("
|
|
576
|
+
return "", fmt.Errorf("failed converting avatar to JPEG: %s", err)
|
|
574
577
|
}
|
|
575
578
|
|
|
576
579
|
return s.client.SetGroupPhoto(jid, data)
|
|
@@ -580,12 +583,12 @@ func (s *Session) SetAvatar(resourceID string, avatar []byte) (string, error) {
|
|
|
580
583
|
// SetGroupName updates the name of a WhatsApp group for the Group JID given.
|
|
581
584
|
func (s *Session) SetGroupName(resourceID, name string) error {
|
|
582
585
|
if s.client == nil || s.client.Store.ID == nil {
|
|
583
|
-
return fmt.Errorf("
|
|
586
|
+
return fmt.Errorf("cannot set group name for unauthenticated session")
|
|
584
587
|
}
|
|
585
588
|
|
|
586
589
|
jid, err := types.ParseJID(resourceID)
|
|
587
590
|
if err != nil {
|
|
588
|
-
return fmt.Errorf("
|
|
591
|
+
return fmt.Errorf("could not parse JID for group name change: %s", err)
|
|
589
592
|
}
|
|
590
593
|
|
|
591
594
|
return s.client.SetGroupName(jid, name)
|
|
@@ -594,12 +597,12 @@ func (s *Session) SetGroupName(resourceID, name string) error {
|
|
|
594
597
|
// SetGroupName updates the topic of a WhatsApp group for the Group JID given.
|
|
595
598
|
func (s *Session) SetGroupTopic(resourceID, topic string) error {
|
|
596
599
|
if s.client == nil || s.client.Store.ID == nil {
|
|
597
|
-
return fmt.Errorf("
|
|
600
|
+
return fmt.Errorf("cannot set group topic for unauthenticated session")
|
|
598
601
|
}
|
|
599
602
|
|
|
600
603
|
jid, err := types.ParseJID(resourceID)
|
|
601
604
|
if err != nil {
|
|
602
|
-
return fmt.Errorf("
|
|
605
|
+
return fmt.Errorf("could not parse JID for group topic change: %s", err)
|
|
603
606
|
}
|
|
604
607
|
|
|
605
608
|
return s.client.SetGroupTopic(jid, "", "", topic)
|
|
@@ -610,26 +613,27 @@ func (s *Session) SetGroupTopic(resourceID, topic string) error {
|
|
|
610
613
|
// removals, and changes to privileges. Participant JIDs given must be part of the authenticated
|
|
611
614
|
// session's roster at least, and must also be active group participants for other types of changes.
|
|
612
615
|
func (s *Session) UpdateGroupParticipants(resourceID string, participants []GroupParticipant) ([]GroupParticipant, error) {
|
|
616
|
+
var ctx = context.Background()
|
|
613
617
|
if s.client == nil || s.client.Store.ID == nil {
|
|
614
|
-
return nil, fmt.Errorf("
|
|
618
|
+
return nil, fmt.Errorf("cannot update group participants for unauthenticated session")
|
|
615
619
|
}
|
|
616
620
|
|
|
617
621
|
jid, err := types.ParseJID(resourceID)
|
|
618
622
|
if err != nil {
|
|
619
|
-
return nil, fmt.Errorf("
|
|
623
|
+
return nil, fmt.Errorf("could not parse JID for group participant update: %s", err)
|
|
620
624
|
}
|
|
621
625
|
|
|
622
626
|
var changes = make(map[whatsmeow.ParticipantChange][]types.JID)
|
|
623
627
|
for _, p := range participants {
|
|
624
628
|
participantJID, err := types.ParseJID(p.JID)
|
|
625
629
|
if err != nil {
|
|
626
|
-
return nil, fmt.Errorf("
|
|
630
|
+
return nil, fmt.Errorf("could not parse participant JID for update: %s", err)
|
|
627
631
|
}
|
|
628
632
|
|
|
629
|
-
if c, err := s.client.Store.Contacts.GetContact(participantJID); err != nil {
|
|
630
|
-
return nil, fmt.Errorf("
|
|
633
|
+
if c, err := s.client.Store.Contacts.GetContact(ctx, participantJID); err != nil {
|
|
634
|
+
return nil, fmt.Errorf("could not fetch contact for participant: %s", err)
|
|
631
635
|
} else if !c.Found {
|
|
632
|
-
return nil, fmt.Errorf("
|
|
636
|
+
return nil, fmt.Errorf("cannot update group participant for contact '%s' not in roster", participantJID)
|
|
633
637
|
}
|
|
634
638
|
|
|
635
639
|
c := p.Action.toParticipantChange()
|
|
@@ -640,7 +644,7 @@ func (s *Session) UpdateGroupParticipants(resourceID string, participants []Grou
|
|
|
640
644
|
for change, participantJIDs := range changes {
|
|
641
645
|
participants, err := s.client.UpdateGroupParticipants(jid, participantJIDs, change)
|
|
642
646
|
if err != nil {
|
|
643
|
-
return nil, fmt.Errorf("
|
|
647
|
+
return nil, fmt.Errorf("failed setting group affiliation: %s", err)
|
|
644
648
|
}
|
|
645
649
|
for i := range participants {
|
|
646
650
|
p := newGroupParticipant(participants[i])
|
|
@@ -659,12 +663,13 @@ func (s *Session) UpdateGroupParticipants(resourceID string, participants []Grou
|
|
|
659
663
|
// error is returned if no contact was found, but any unexpected errors will otherwise be returned
|
|
660
664
|
// directly.
|
|
661
665
|
func (s *Session) FindContact(phone string) (Contact, error) {
|
|
666
|
+
var ctx = context.Background()
|
|
662
667
|
if s.client == nil || s.client.Store.ID == nil {
|
|
663
|
-
return Contact{}, fmt.Errorf("
|
|
668
|
+
return Contact{}, fmt.Errorf("cannot find contact for unauthenticated session")
|
|
664
669
|
}
|
|
665
670
|
|
|
666
671
|
jid := types.NewJID(phone, DefaultUserServer)
|
|
667
|
-
if c, err := s.client.Store.Contacts.GetContact(jid); err == nil && c.Found {
|
|
672
|
+
if c, err := s.client.Store.Contacts.GetContact(ctx, jid); err == nil && c.Found {
|
|
668
673
|
if _, e := newContactEvent(jid, c); e != nil {
|
|
669
674
|
return e.Contact, nil
|
|
670
675
|
}
|
|
@@ -672,9 +677,9 @@ func (s *Session) FindContact(phone string) (Contact, error) {
|
|
|
672
677
|
|
|
673
678
|
resp, err := s.client.IsOnWhatsApp([]string{phone})
|
|
674
679
|
if err != nil {
|
|
675
|
-
return Contact{}, fmt.Errorf("
|
|
680
|
+
return Contact{}, fmt.Errorf("failed looking up contact '%s': %s", phone, err)
|
|
676
681
|
} else if len(resp) != 1 {
|
|
677
|
-
return Contact{}, fmt.Errorf("
|
|
682
|
+
return Contact{}, fmt.Errorf("failed looking up contact '%s': invalid response", phone)
|
|
678
683
|
} else if !resp[0].IsIn || resp[0].JID.IsEmpty() {
|
|
679
684
|
return Contact{}, nil
|
|
680
685
|
}
|
|
@@ -687,13 +692,14 @@ func (s *Session) FindContact(phone string) (Contact, error) {
|
|
|
687
692
|
// history should then be handled as a `HistorySync` event of type `ON_DEMAND`, in the session-wide
|
|
688
693
|
// event handler. An error will be returned if requesting history fails for any reason.
|
|
689
694
|
func (s *Session) RequestMessageHistory(resourceID string, oldestMessage Message) error {
|
|
695
|
+
var ctx = context.Background()
|
|
690
696
|
if s.client == nil || s.client.Store.ID == nil {
|
|
691
|
-
return fmt.Errorf("
|
|
697
|
+
return fmt.Errorf("cannot request history for unauthenticated session")
|
|
692
698
|
}
|
|
693
699
|
|
|
694
700
|
jid, err := types.ParseJID(resourceID)
|
|
695
701
|
if err != nil {
|
|
696
|
-
return fmt.Errorf("
|
|
702
|
+
return fmt.Errorf("could not parse JID for history request: %s", err)
|
|
697
703
|
}
|
|
698
704
|
|
|
699
705
|
info := &types.MessageInfo{
|
|
@@ -703,9 +709,9 @@ func (s *Session) RequestMessageHistory(resourceID string, oldestMessage Message
|
|
|
703
709
|
}
|
|
704
710
|
|
|
705
711
|
req := s.client.BuildHistorySyncRequest(info, maxHistorySyncMessages)
|
|
706
|
-
_, err = s.client.SendMessage(
|
|
712
|
+
_, err = s.client.SendMessage(ctx, s.device.JID().ToNonAD(), req, whatsmeow.SendRequestExtra{Peer: true})
|
|
707
713
|
if err != nil {
|
|
708
|
-
return fmt.Errorf("
|
|
714
|
+
return fmt.Errorf("failed to request history for %s: %s", resourceID, err)
|
|
709
715
|
}
|
|
710
716
|
|
|
711
717
|
return nil
|
|
@@ -739,7 +745,8 @@ func (s *Session) propagateEvent(kind EventKind, payload *EventPayload) {
|
|
|
739
745
|
// HandleEvent processes the given incoming WhatsApp event, checking its concrete type and
|
|
740
746
|
// propagating it to the adapter event handler. Unknown or unhandled events are ignored, and any
|
|
741
747
|
// errors that occur during processing are logged.
|
|
742
|
-
func (s *Session) handleEvent(evt
|
|
748
|
+
func (s *Session) handleEvent(evt any) {
|
|
749
|
+
var ctx = context.Background()
|
|
743
750
|
s.gateway.logger.Debugf("Handling event '%T': %+v", evt, evt)
|
|
744
751
|
|
|
745
752
|
switch evt := evt.(type) {
|
|
@@ -755,7 +762,7 @@ func (s *Session) handleEvent(evt interface{}) {
|
|
|
755
762
|
case events.ConnectFailureLoggedOut:
|
|
756
763
|
// These events are handled separately.
|
|
757
764
|
default:
|
|
758
|
-
s.gateway.logger.Errorf("
|
|
765
|
+
s.gateway.logger.Errorf("failed to connect: %s", evt.Message)
|
|
759
766
|
s.propagateEvent(EventConnect, &EventPayload{Connect: Connect{Error: evt.Message}})
|
|
760
767
|
}
|
|
761
768
|
case *events.Connected, *events.PushNameSetting:
|
|
@@ -806,7 +813,7 @@ func (s *Session) handleEvent(evt interface{}) {
|
|
|
806
813
|
s.propagateEvent(newCallEvent(callStateFromReason(evt.Reason), evt.BasicCallMeta))
|
|
807
814
|
case *events.LoggedOut:
|
|
808
815
|
s.client.Disconnect()
|
|
809
|
-
if err := s.client.Store.Delete(); err != nil {
|
|
816
|
+
if err := s.client.Store.Delete(ctx); err != nil {
|
|
810
817
|
s.gateway.logger.Warnf("Unable to delete local device state on logout: %s", err)
|
|
811
818
|
}
|
|
812
819
|
s.client = nil
|
|
@@ -83,17 +83,17 @@ func loadSymbol(handle uintptr, name string) (uintptr, error) {
|
|
|
83
83
|
// appear to work if you link directly to the C function on darwin arm64.
|
|
84
84
|
|
|
85
85
|
//go:linkname dlopen dlopen
|
|
86
|
-
var dlopen
|
|
86
|
+
var dlopen uint8
|
|
87
87
|
var dlopenABI0 = uintptr(unsafe.Pointer(&dlopen))
|
|
88
88
|
|
|
89
89
|
//go:linkname dlsym dlsym
|
|
90
|
-
var dlsym
|
|
90
|
+
var dlsym uint8
|
|
91
91
|
var dlsymABI0 = uintptr(unsafe.Pointer(&dlsym))
|
|
92
92
|
|
|
93
93
|
//go:linkname dlclose dlclose
|
|
94
|
-
var dlclose
|
|
94
|
+
var dlclose uint8
|
|
95
95
|
var dlcloseABI0 = uintptr(unsafe.Pointer(&dlclose))
|
|
96
96
|
|
|
97
97
|
//go:linkname dlerror dlerror
|
|
98
|
-
var dlerror
|
|
98
|
+
var dlerror uint8
|
|
99
99
|
var dlerrorABI0 = uintptr(unsafe.Pointer(&dlerror))
|
|
@@ -17,8 +17,3 @@ const (
|
|
|
17
17
|
//go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib"
|
|
18
18
|
//go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib"
|
|
19
19
|
//go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib"
|
|
20
|
-
|
|
21
|
-
//go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib"
|
|
22
|
-
//go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib"
|
|
23
|
-
//go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib"
|
|
24
|
-
//go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib"
|
|
@@ -19,6 +19,7 @@ var (
|
|
|
19
19
|
)
|
|
20
20
|
|
|
21
21
|
//go:nosplit
|
|
22
|
+
//go:norace
|
|
22
23
|
func x_cgo_notify_runtime_init_done() {
|
|
23
24
|
pthread_mutex_lock(&runtime_init_mu)
|
|
24
25
|
runtime_init_done = 1
|
|
@@ -28,6 +29,8 @@ func x_cgo_notify_runtime_init_done() {
|
|
|
28
29
|
|
|
29
30
|
// Store the g into a thread-specific value associated with the pthread key pthread_g.
|
|
30
31
|
// And pthread_key_destructor will dropm when the thread is exiting.
|
|
32
|
+
//
|
|
33
|
+
//go:norace
|
|
31
34
|
func x_cgo_bindm(g unsafe.Pointer) {
|
|
32
35
|
// We assume this will always succeed, otherwise, there might be extra M leaking,
|
|
33
36
|
// when a C thread exits after a cgo call.
|