slidge-whatsapp 0.2.6__cp312-cp312-manylinux_2_36_aarch64.whl → 0.3.0b0__cp312-cp312-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.
Files changed (258) hide show
  1. slidge_whatsapp/contact.py +13 -3
  2. slidge_whatsapp/event.go +115 -39
  3. slidge_whatsapp/gateway.go +7 -63
  4. slidge_whatsapp/gateway.py +2 -3
  5. slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.h +169 -152
  6. slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.so +0 -0
  7. slidge_whatsapp/generated/build.py +134 -120
  8. slidge_whatsapp/generated/whatsapp.c +1511 -1239
  9. slidge_whatsapp/generated/whatsapp.go +1263 -1152
  10. slidge_whatsapp/generated/whatsapp.py +1171 -1046
  11. slidge_whatsapp/generated/whatsapp_go.h +169 -152
  12. slidge_whatsapp/go.mod +18 -15
  13. slidge_whatsapp/go.sum +38 -32
  14. slidge_whatsapp/group.py +34 -30
  15. slidge_whatsapp/media/media.go +6 -2
  16. slidge_whatsapp/session.go +33 -16
  17. slidge_whatsapp/session.py +46 -14
  18. slidge_whatsapp/vendor/github.com/beeper/argo-go/LICENSE +9 -0
  19. slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockreader.go +329 -0
  20. slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockwriter.go +417 -0
  21. slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/decoder.go +652 -0
  22. slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/encoder.go +985 -0
  23. slidge_whatsapp/vendor/github.com/beeper/argo-go/header/header.go +135 -0
  24. slidge_whatsapp/vendor/github.com/beeper/argo-go/internal/util/util.go +133 -0
  25. slidge_whatsapp/vendor/github.com/beeper/argo-go/label/label.go +384 -0
  26. slidge_whatsapp/vendor/github.com/beeper/argo-go/label/wiremarkers.go +37 -0
  27. slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/bitset/bitset.go +197 -0
  28. slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/buf/buf.go +420 -0
  29. slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/varint/varint.go +246 -0
  30. slidge_whatsapp/vendor/github.com/beeper/argo-go/wire/wire.go +614 -0
  31. slidge_whatsapp/vendor/github.com/beeper/argo-go/wirecodec/decode.go +341 -0
  32. slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/LICENSE +21 -0
  33. slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/list.go +95 -0
  34. slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/orderedmap.go +187 -0
  35. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz.go +1 -0
  36. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo.go +3 -0
  37. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_nocgo.go +4 -5
  38. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_darwin.go +11 -1
  39. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_linux.go +10 -0
  40. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_windows.go +12 -0
  41. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/.gitignore +0 -2
  42. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +30 -0
  43. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/COPYRIGHT.txt +6 -1
  44. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/README.md +14 -17
  45. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi.go +1 -1
  46. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi2.go +7 -0
  47. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/LICENSE +21 -0
  48. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_amd64/libffi.8.dylib +0 -0
  49. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_arm64/libffi.8.dylib +0 -0
  50. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/windows_amd64/libffi-8.dll +0 -0
  51. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif.go +15 -0
  52. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif_arm64.go +16 -0
  53. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed.go +49 -0
  54. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_amd64.go +10 -0
  55. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_arm64.go +10 -0
  56. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_windows_amd64.go +10 -0
  57. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +51 -13
  58. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/init.go +22 -9
  59. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -0
  60. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +3096 -1651
  61. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +188 -128
  62. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go +13 -140
  63. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +4 -0
  64. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +2 -2
  65. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.25.go +37 -0
  66. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/LICENSE +19 -0
  67. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/argmap.go +37 -0
  68. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/collections.go +148 -0
  69. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/comment.go +31 -0
  70. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/decode.go +216 -0
  71. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/definition.go +110 -0
  72. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/directive.go +43 -0
  73. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/document.go +89 -0
  74. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/dumper.go +159 -0
  75. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/fragment.go +41 -0
  76. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/operation.go +32 -0
  77. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/path.go +72 -0
  78. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/selection.go +41 -0
  79. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/source.go +19 -0
  80. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/type.go +68 -0
  81. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/value.go +122 -0
  82. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +60 -26
  83. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +1 -6
  84. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +2 -1
  85. slidge_whatsapp/vendor/go.mau.fi/util/exstrings/stringutil.go +104 -0
  86. slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +19 -3
  87. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.pre-commit-config.yaml +3 -3
  88. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +1 -1
  89. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/hash.go +1 -1
  90. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +5 -1
  91. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo-wire-type-store.argo +63 -0
  92. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo.go +62 -0
  93. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/name-to-queryids.json +306 -0
  94. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +40 -7
  95. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/encoder.go +1 -1
  96. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +2 -1
  97. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +79 -45
  98. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +13 -6
  99. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +19 -12
  100. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +26 -6
  101. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +3 -0
  102. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +99 -27
  103. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +54 -26
  104. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +1 -0
  105. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +208 -57
  106. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +2 -14
  107. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/newsletter.go +83 -7
  108. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +17 -8
  109. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +2 -2
  110. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +15 -6
  111. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/extra.go +7 -0
  112. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.pb.go +983 -0
  113. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.proto +85 -0
  114. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/extra.go +3 -0
  115. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.pb.go +197 -0
  116. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.proto +13 -0
  117. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.pb.go +279 -0
  118. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.proto +21 -0
  119. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.pb.go +137 -0
  120. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.proto +10 -0
  121. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.pb.go +313 -0
  122. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.proto +27 -0
  123. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.pb.go +1299 -0
  124. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.proto +112 -0
  125. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.pb.go +514 -0
  126. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.proto +47 -0
  127. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.pb.go +123 -0
  128. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.proto +7 -0
  129. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/extra.go +3 -0
  130. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.pb.go +720 -0
  131. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.proto +59 -0
  132. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/extra.go +3 -0
  133. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.pb.go +365 -0
  134. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.proto +33 -0
  135. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.pb.go +1238 -0
  136. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.proto +105 -0
  137. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +16 -4
  138. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +3 -0
  139. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.pb.go +5156 -0
  140. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.proto +516 -0
  141. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.pb.go +46 -10
  142. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.proto +4 -0
  143. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +8975 -11209
  144. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +193 -421
  145. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +52 -23
  146. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +3 -0
  147. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.pb.go +198 -0
  148. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.proto +14 -0
  149. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/extra.go +7 -6
  150. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +952 -0
  151. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +88 -0
  152. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1143 -463
  153. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +60 -0
  154. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +60 -38
  155. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +3 -0
  156. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +11 -3
  157. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +2 -0
  158. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +20 -7
  159. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingfields.json +1 -0
  160. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingtoken.go +176 -0
  161. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +10 -2
  162. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +38 -21
  163. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +1 -0
  164. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +1 -1
  165. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +3 -2
  166. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +9 -6
  167. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +25 -5
  168. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +4 -2
  169. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/10-chat-db-lid-migration-ts.sql +2 -0
  170. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +5 -1
  171. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/call.go +1 -0
  172. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +13 -2
  173. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +2 -1
  174. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +1 -0
  175. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/user.go +2 -0
  176. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +14 -8
  177. slidge_whatsapp/vendor/golang.org/x/crypto/curve25519/curve25519.go +1 -1
  178. slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +44 -2
  179. slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +8 -8
  180. slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +14 -3
  181. slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +7 -29
  182. slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +53 -71
  183. slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +20 -74
  184. slidge_whatsapp/vendor/golang.org/x/sys/unix/affinity_linux.go +1 -3
  185. slidge_whatsapp/vendor/golang.org/x/sys/unix/mkerrors.sh +3 -0
  186. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +1 -55
  187. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_solaris.go +1 -1
  188. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux.go +47 -16
  189. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +3 -0
  190. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +3 -0
  191. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +3 -0
  192. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +3 -0
  193. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +3 -0
  194. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +3 -0
  195. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +3 -0
  196. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +3 -0
  197. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +3 -0
  198. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +3 -0
  199. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +3 -0
  200. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +3 -0
  201. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +3 -0
  202. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +3 -0
  203. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +3 -0
  204. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +4 -4
  205. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +1 -0
  206. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +1 -0
  207. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +1 -0
  208. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +1 -0
  209. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +1 -0
  210. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +1 -0
  211. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +1 -0
  212. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +1 -0
  213. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +1 -0
  214. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +1 -0
  215. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +1 -0
  216. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +1 -0
  217. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +1 -0
  218. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +1 -0
  219. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +1 -0
  220. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux.go +168 -12
  221. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +17 -1
  222. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +16 -0
  223. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +18 -2
  224. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +16 -0
  225. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +16 -0
  226. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +17 -1
  227. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +16 -0
  228. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +16 -0
  229. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +17 -1
  230. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +18 -2
  231. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +16 -0
  232. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +16 -0
  233. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +16 -0
  234. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +16 -0
  235. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +16 -0
  236. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +6 -0
  237. slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +483 -483
  238. slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +25 -1
  239. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
  240. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +10 -5
  241. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/presence.go +33 -0
  242. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +6 -0
  243. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +68 -22
  244. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +2 -1
  245. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +8 -37
  246. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/presence.go +0 -3
  247. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
  248. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +8 -0
  249. slidge_whatsapp/vendor/modules.txt +57 -23
  250. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/METADATA +2 -2
  251. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/RECORD +254 -174
  252. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi_amd64.go +0 -7
  253. slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +0 -61
  254. slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +0 -16
  255. slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +0 -20
  256. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/LICENSE +0 -0
  257. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/WHEEL +0 -0
  258. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0b0.dist-info}/entry_points.txt +0 -0
@@ -25,11 +25,11 @@ import (
25
25
  "go.mau.fi/libsignal/protocol"
26
26
  "go.mau.fi/libsignal/session"
27
27
  "go.mau.fi/libsignal/signalerror"
28
- "go.mau.fi/util/ptr"
29
28
  "go.mau.fi/util/random"
30
29
  "google.golang.org/protobuf/proto"
31
30
 
32
31
  waBinary "go.mau.fi/whatsmeow/binary"
32
+ "go.mau.fi/whatsmeow/proto/waBotMetadata"
33
33
  "go.mau.fi/whatsmeow/proto/waCommon"
34
34
  "go.mau.fi/whatsmeow/proto/waE2E"
35
35
  "go.mau.fi/whatsmeow/types"
@@ -224,7 +224,7 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
224
224
  }
225
225
 
226
226
  isBotMode := isInlineBotMode || to.IsBot()
227
- needsMessageSecret := isBotMode
227
+ needsMessageSecret := isBotMode || cli.shouldIncludeReportingToken(message)
228
228
  var extraParams nodeExtraParams
229
229
 
230
230
  if needsMessageSecret {
@@ -238,7 +238,7 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
238
238
 
239
239
  if isBotMode {
240
240
  if message.MessageContextInfo.BotMetadata == nil {
241
- message.MessageContextInfo.BotMetadata = &waE2E.BotMetadata{
241
+ message.MessageContextInfo.BotMetadata = &waBotMetadata.BotMetadata{
242
242
  PersonaID: proto.String("867051314767696$760019659443059"),
243
243
  }
244
244
  }
@@ -296,10 +296,6 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
296
296
  if cachedData.AddressingMode == types.AddressingModeLID {
297
297
  ownID = cli.getOwnLID()
298
298
  extraParams.addressingMode = types.AddressingModeLID
299
- if req.Meta == nil {
300
- req.Meta = &types.MsgMetaInfo{}
301
- }
302
- req.Meta.DeprecatedLIDSession = ptr.Ptr(false)
303
299
  } else if cachedData.CommunityAnnouncementGroup && req.Meta != nil {
304
300
  ownID = cli.getOwnLID()
305
301
  // Why is this set to PN?
@@ -315,11 +311,6 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
315
311
  resp.DebugTimings.GetParticipants = time.Since(start)
316
312
  } else if to.Server == types.HiddenUserServer {
317
313
  ownID = cli.getOwnLID()
318
- extraParams.addressingMode = types.AddressingModeLID
319
- // if req.Meta == nil {
320
- // req.Meta = &types.MsgMetaInfo{}
321
- // }
322
- // req.Meta.DeprecatedLIDSession = ptr.Ptr(false)
323
314
  }
324
315
  if req.Meta != nil {
325
316
  extraParams.metaNode = &waBinary.Node{
@@ -361,8 +352,8 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waE2E
361
352
  var data []byte
362
353
  switch to.Server {
363
354
  case types.GroupServer, types.BroadcastServer:
364
- phash, data, err = cli.sendGroup(ctx, to, groupParticipants, req.ID, message, &resp.DebugTimings, extraParams)
365
- case types.DefaultUserServer, types.BotServer:
355
+ phash, data, err = cli.sendGroup(ctx, ownID, to, groupParticipants, req.ID, message, &resp.DebugTimings, extraParams)
356
+ case types.DefaultUserServer, types.BotServer, types.HiddenUserServer:
366
357
  if req.Peer {
367
358
  data, err = cli.sendPeerMessage(ctx, to, req.ID, message, &resp.DebugTimings)
368
359
  } else {
@@ -588,13 +579,14 @@ func ParseDisappearingTimerString(val string) (time.Duration, bool) {
588
579
  // and in groups the server will just reject the change. You can use the DisappearingTimer<Duration> constants for convenience.
589
580
  //
590
581
  // In groups, the server will echo the change as a notification, so it'll show up as a *events.GroupInfo update.
591
- func (cli *Client) SetDisappearingTimer(chat types.JID, timer time.Duration) (err error) {
582
+ func (cli *Client) SetDisappearingTimer(chat types.JID, timer time.Duration, settingTS time.Time) (err error) {
592
583
  switch chat.Server {
593
- case types.DefaultUserServer:
584
+ case types.DefaultUserServer, types.HiddenUserServer:
594
585
  _, err = cli.SendMessage(context.TODO(), chat, &waE2E.Message{
595
586
  ProtocolMessage: &waE2E.ProtocolMessage{
596
- Type: waE2E.ProtocolMessage_EPHEMERAL_SETTING.Enum(),
597
- EphemeralExpiration: proto.Uint32(uint32(timer.Seconds())),
587
+ Type: waE2E.ProtocolMessage_EPHEMERAL_SETTING.Enum(),
588
+ EphemeralExpiration: proto.Uint32(uint32(timer.Seconds())),
589
+ EphemeralSettingTimestamp: proto.Int64(settingTS.Unix()),
598
590
  },
599
591
  })
600
592
  case types.GroupServer:
@@ -688,6 +680,7 @@ type nodeExtraParams struct {
688
680
 
689
681
  func (cli *Client) sendGroup(
690
682
  ctx context.Context,
683
+ ownID,
691
684
  to types.JID,
692
685
  participants []types.JID,
693
686
  id types.MessageID,
@@ -746,6 +739,9 @@ func (cli *Client) sendGroup(
746
739
  skMsg.Attrs["mediatype"] = mediaType
747
740
  }
748
741
  node.Content = append(node.GetChildren(), skMsg)
742
+ if cli.shouldIncludeReportingToken(message) && message.GetMessageContextInfo().GetMessageSecret() != nil {
743
+ node.Content = append(node.GetChildren(), cli.getMessageReportingToken(plaintext, message, ownID, to, id))
744
+ }
749
745
 
750
746
  start = time.Now()
751
747
  data, err := cli.sendNodeAndGetData(*node)
@@ -799,6 +795,20 @@ func (cli *Client) sendDM(
799
795
  if err != nil {
800
796
  return nil, err
801
797
  }
798
+
799
+ if cli.shouldIncludeReportingToken(message) && message.GetMessageContextInfo().GetMessageSecret() != nil {
800
+ node.Content = append(node.GetChildren(), cli.getMessageReportingToken(messagePlaintext, message, ownID, to, id))
801
+ }
802
+
803
+ if tcToken, err := cli.Store.PrivacyTokens.GetPrivacyToken(ctx, to); err != nil {
804
+ cli.Log.Warnf("Failed to get privacy token for %s: %v", to, err)
805
+ } else if tcToken != nil {
806
+ node.Content = append(node.GetChildren(), waBinary.Node{
807
+ Tag: "tctoken",
808
+ Content: tcToken.Token,
809
+ })
810
+ }
811
+
802
812
  start = time.Now()
803
813
  data, err := cli.sendNodeAndGetData(*node)
804
814
  timings.Send = time.Since(start)
@@ -983,8 +993,15 @@ func (cli *Client) preparePeerMessageNode(
983
993
  err = fmt.Errorf("failed to marshal message: %w", err)
984
994
  return nil, err
985
995
  }
996
+ encryptionIdentity := to
997
+ if to.Server == types.DefaultUserServer {
998
+ encryptionIdentity, err = cli.Store.LIDs.GetLIDForPN(ctx, to)
999
+ if err != nil {
1000
+ return nil, fmt.Errorf("failed to get LID for PN %s: %w", to, err)
1001
+ }
1002
+ }
986
1003
  start = time.Now()
987
- encrypted, isPreKey, err := cli.encryptMessageForDevice(ctx, plaintext, to, nil, nil)
1004
+ encrypted, isPreKey, err := cli.encryptMessageForDevice(ctx, plaintext, encryptionIdentity, nil, nil)
988
1005
  timings.PeerEncrypt = time.Since(start)
989
1006
  if err != nil {
990
1007
  return nil, fmt.Errorf("failed to encrypt peer message for %s: %v", to, err)
@@ -1154,7 +1171,7 @@ func (cli *Client) encryptMessageForDevices(
1154
1171
  for _, jid := range allDevices {
1155
1172
  plaintext := msgPlaintext
1156
1173
  if (jid.User == ownJID.User || jid.User == ownLID.User) && dsmPlaintext != nil {
1157
- if jid == ownJID {
1174
+ if jid == ownJID || jid == ownLID {
1158
1175
  continue
1159
1176
  }
1160
1177
  plaintext = dsmPlaintext
@@ -1273,7 +1290,7 @@ func (cli *Client) encryptMessageForDevice(
1273
1290
  } else if contains, err := cli.Store.ContainsSession(ctx, to.SignalAddress()); err != nil {
1274
1291
  return nil, false, err
1275
1292
  } else if !contains {
1276
- return nil, false, ErrNoSession
1293
+ return nil, false, fmt.Errorf("%w with %s", ErrNoSession, to.SignalAddress().String())
1277
1294
  }
1278
1295
  cipher := session.NewCipher(builder, to.SignalAddress())
1279
1296
  ciphertext, err := cipher.Encrypt(ctx, padMessage(plaintext))
@@ -36,6 +36,7 @@ import (
36
36
 
37
37
  const FBMessageVersion = 3
38
38
  const FBMessageApplicationVersion = 2
39
+ const IGMessageApplicationVersion = 3
39
40
  const FBConsumerMessageVersion = 1
40
41
  const FBArmadilloMessageVersion = 1
41
42
 
@@ -76,7 +76,7 @@ func (vc WAVersionContainer) ProtoAppVersion() *waWa6.ClientPayload_UserAgent_Ap
76
76
  }
77
77
 
78
78
  // waVersion is the WhatsApp web client version
79
- var waVersion = WAVersionContainer{2, 3000, 1022781640}
79
+ var waVersion = WAVersionContainer{2, 3000, 1026436087}
80
80
 
81
81
  // waVersionHash is the md5 hash of a dot-separated waVersion
82
82
  var waVersionHash [16]byte
@@ -37,6 +37,7 @@ var NoopDevice = &Device{
37
37
  MsgSecrets: nilStore,
38
38
  PrivacyTokens: nilStore,
39
39
  EventBuffer: nilStore,
40
+ LIDs: nilStore,
40
41
  Container: nilStore,
41
42
  }
42
43
 
@@ -199,8 +200,8 @@ func (n *NoopStore) PutMessageSecret(ctx context.Context, chat, sender types.JID
199
200
  return n.Error
200
201
  }
201
202
 
202
- func (n *NoopStore) GetMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID) ([]byte, error) {
203
- return nil, n.Error
203
+ func (n *NoopStore) GetMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID) ([]byte, types.JID, error) {
204
+ return nil, types.EmptyJID, n.Error
204
205
  }
205
206
 
206
207
  func (n *NoopStore) PutPrivacyTokens(ctx context.Context, tokens ...PrivacyToken) error {
@@ -115,7 +115,7 @@ const getAllDevicesQuery = `
115
115
  SELECT jid, lid, registration_id, noise_key, identity_key,
116
116
  signed_pre_key, signed_pre_key_id, signed_pre_key_sig,
117
117
  adv_key, adv_details, adv_account_sig, adv_account_sig_key, adv_device_sig,
118
- platform, business_name, push_name, facebook_uuid
118
+ platform, business_name, push_name, facebook_uuid, lid_migration_ts
119
119
  FROM whatsmeow_device
120
120
  `
121
121
 
@@ -133,7 +133,7 @@ func (c *Container) scanDevice(row dbutil.Scannable) (*store.Device, error) {
133
133
  &device.ID, &device.LID, &device.RegistrationID, &noisePriv, &identityPriv,
134
134
  &preKeyPriv, &device.SignedPreKey.KeyID, &preKeySig,
135
135
  &device.AdvSecretKey, &account.Details, &account.AccountSignature, &account.AccountSignatureKey, &account.DeviceSignature,
136
- &device.Platform, &device.BusinessName, &device.PushName, &fbUUID)
136
+ &device.Platform, &device.BusinessName, &device.PushName, &fbUUID, &device.LIDMigrationTimestamp)
137
137
  if err != nil {
138
138
  return nil, fmt.Errorf("failed to scan session: %w", err)
139
139
  } else if len(noisePriv) != 32 || len(identityPriv) != 32 || len(preKeyPriv) != 32 || len(preKeySig) != 64 {
@@ -202,13 +202,14 @@ const (
202
202
  INSERT INTO whatsmeow_device (jid, lid, registration_id, noise_key, identity_key,
203
203
  signed_pre_key, signed_pre_key_id, signed_pre_key_sig,
204
204
  adv_key, adv_details, adv_account_sig, adv_account_sig_key, adv_device_sig,
205
- platform, business_name, push_name, facebook_uuid)
206
- VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)
205
+ platform, business_name, push_name, facebook_uuid, lid_migration_ts)
206
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18)
207
207
  ON CONFLICT (jid) DO UPDATE
208
208
  SET lid=excluded.lid,
209
209
  platform=excluded.platform,
210
210
  business_name=excluded.business_name,
211
- push_name=excluded.push_name
211
+ push_name=excluded.push_name,
212
+ lid_migration_ts=excluded.lid_migration_ts
212
213
  `
213
214
  deleteDeviceQuery = `DELETE FROM whatsmeow_device WHERE jid=$1`
214
215
  )
@@ -252,7 +253,9 @@ func (c *Container) PutDevice(ctx context.Context, device *store.Device) error {
252
253
  device.ID, device.LID, device.RegistrationID, device.NoiseKey.Priv[:], device.IdentityKey.Priv[:],
253
254
  device.SignedPreKey.Priv[:], device.SignedPreKey.KeyID, device.SignedPreKey.Signature[:],
254
255
  device.AdvSecretKey, device.Account.Details, device.Account.AccountSignature, device.Account.AccountSignatureKey, device.Account.DeviceSignature,
255
- device.Platform, device.BusinessName, device.PushName, uuid.NullUUID{UUID: device.FacebookUUID, Valid: device.FacebookUUID != uuid.Nil})
256
+ device.Platform, device.BusinessName, device.PushName, uuid.NullUUID{UUID: device.FacebookUUID, Valid: device.FacebookUUID != uuid.Nil},
257
+ device.LIDMigrationTimestamp,
258
+ )
256
259
 
257
260
  if !device.Initialized {
258
261
  c.initializeDevice(device)
@@ -733,7 +733,9 @@ const (
733
733
 
734
734
  func (s *SQLStore) PutMutedUntil(ctx context.Context, chat types.JID, mutedUntil time.Time) error {
735
735
  var val int64
736
- if !mutedUntil.IsZero() {
736
+ if mutedUntil == store.MutedForever {
737
+ val = -1
738
+ } else if !mutedUntil.IsZero() {
737
739
  val = mutedUntil.Unix()
738
740
  }
739
741
  _, err := s.db.Exec(ctx, fmt.Sprintf(putChatSettingQuery, "muted_until"), s.JID, chat, val)
@@ -760,7 +762,9 @@ func (s *SQLStore) GetChatSettings(ctx context.Context, chat types.JID) (setting
760
762
  } else {
761
763
  settings.Found = true
762
764
  }
763
- if mutedUntil != 0 {
765
+ if mutedUntil < 0 {
766
+ settings.MutedUntil = store.MutedForever
767
+ } else if mutedUntil > 0 {
764
768
  settings.MutedUntil = time.Unix(mutedUntil, 0)
765
769
  }
766
770
  return
@@ -773,7 +777,23 @@ const (
773
777
  ON CONFLICT (our_jid, chat_jid, sender_jid, message_id) DO NOTHING
774
778
  `
775
779
  getMsgSecret = `
776
- SELECT key FROM whatsmeow_message_secrets WHERE our_jid=$1 AND chat_jid=$2 AND sender_jid=$3 AND message_id=$4
780
+ SELECT key, sender_jid
781
+ FROM whatsmeow_message_secrets
782
+ WHERE our_jid=$1 AND (chat_jid=$2 OR chat_jid=(
783
+ CASE
784
+ WHEN $2 LIKE '%@lid'
785
+ THEN (SELECT pn || '@s.whatsapp.net' FROM whatsmeow_lid_map WHERE lid=replace($2, '@lid', ''))
786
+ WHEN $2 LIKE '%@s.whatsapp.net'
787
+ THEN (SELECT lid || '@lid' FROM whatsmeow_lid_map WHERE lid=replace($2, '@s.whatsapp.net', ''))
788
+ END
789
+ )) AND message_id=$4 AND (sender_jid=$3 OR sender_jid=(
790
+ CASE
791
+ WHEN $3 LIKE '%@lid'
792
+ THEN (SELECT pn || '@s.whatsapp.net' FROM whatsmeow_lid_map WHERE lid=replace($3, '@lid', ''))
793
+ WHEN $3 LIKE '%@s.whatsapp.net'
794
+ THEN (SELECT lid || '@lid' FROM whatsmeow_lid_map WHERE lid=replace($3, '@s.whatsapp.net', ''))
795
+ END
796
+ ))
777
797
  `
778
798
  )
779
799
 
@@ -797,8 +817,8 @@ func (s *SQLStore) PutMessageSecret(ctx context.Context, chat, sender types.JID,
797
817
  return
798
818
  }
799
819
 
800
- func (s *SQLStore) GetMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID) (secret []byte, err error) {
801
- err = s.db.QueryRow(ctx, getMsgSecret, s.JID, chat.ToNonAD(), sender.ToNonAD(), id).Scan(&secret)
820
+ func (s *SQLStore) GetMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID) (secret []byte, realSender types.JID, err error) {
821
+ err = s.db.QueryRow(ctx, getMsgSecret, s.JID, chat.ToNonAD(), sender.ToNonAD(), id).Scan(&secret, &realSender)
802
822
  if errors.Is(err, sql.ErrNoRows) {
803
823
  err = nil
804
824
  }
@@ -1,4 +1,4 @@
1
- -- v0 -> v9 (compatible with v8+): Latest schema
1
+ -- v0 -> v10 (compatible with v8+): Latest schema
2
2
  CREATE TABLE whatsmeow_device (
3
3
  jid TEXT PRIMARY KEY,
4
4
  lid TEXT,
@@ -22,7 +22,9 @@ CREATE TABLE whatsmeow_device (
22
22
 
23
23
  platform TEXT NOT NULL DEFAULT '',
24
24
  business_name TEXT NOT NULL DEFAULT '',
25
- push_name TEXT NOT NULL DEFAULT ''
25
+ push_name TEXT NOT NULL DEFAULT '',
26
+
27
+ lid_migration_ts BIGINT NOT NULL DEFAULT 0
26
28
  );
27
29
 
28
30
  CREATE TABLE whatsmeow_identity_keys (
@@ -0,0 +1,2 @@
1
+ -- v10 (compatible with v8+): Add lid migration timestamp to device table
2
+ ALTER TABLE whatsmeow_device ADD COLUMN lid_migration_ts BIGINT NOT NULL DEFAULT 0;
@@ -91,6 +91,8 @@ type ContactStore interface {
91
91
  GetAllContacts(ctx context.Context) (map[types.JID]types.ContactInfo, error)
92
92
  }
93
93
 
94
+ var MutedForever = time.Date(9999, 12, 31, 23, 59, 59, 999999999, time.UTC)
95
+
94
96
  type ChatSettingsStore interface {
95
97
  PutMutedUntil(ctx context.Context, chat types.JID, mutedUntil time.Time) error
96
98
  PutPinned(ctx context.Context, chat types.JID, pinned bool) error
@@ -113,7 +115,7 @@ type MessageSecretInsert struct {
113
115
  type MsgSecretStore interface {
114
116
  PutMessageSecrets(ctx context.Context, inserts []MessageSecretInsert) error
115
117
  PutMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID, secret []byte) error
116
- GetMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID) ([]byte, error)
118
+ GetMessageSecret(ctx context.Context, chat, sender types.JID, id types.MessageID) ([]byte, types.JID, error)
117
119
  }
118
120
 
119
121
  type PrivacyToken struct {
@@ -192,6 +194,8 @@ type Device struct {
192
194
  BusinessName string
193
195
  PushName string
194
196
 
197
+ LIDMigrationTimestamp int64
198
+
195
199
  FacebookUUID uuid.UUID
196
200
 
197
201
  Initialized bool
@@ -13,6 +13,7 @@ type BasicCallMeta struct {
13
13
  Timestamp time.Time
14
14
  CallCreator JID
15
15
  CallID string
16
+ GroupJID JID
16
17
  }
17
18
 
18
19
  type CallRemoteMeta struct {
@@ -14,6 +14,7 @@ import (
14
14
 
15
15
  waBinary "go.mau.fi/whatsmeow/binary"
16
16
  armadillo "go.mau.fi/whatsmeow/proto"
17
+ "go.mau.fi/whatsmeow/proto/instamadilloTransportPayload"
17
18
  "go.mau.fi/whatsmeow/proto/waArmadilloApplication"
18
19
  "go.mau.fi/whatsmeow/proto/waConsumerApplication"
19
20
  "go.mau.fi/whatsmeow/proto/waE2E"
@@ -296,6 +297,7 @@ type Message struct {
296
297
  IsViewOnceV2Extension bool // True if the message was unwrapped from a ViewOnceMessageV2Extension
297
298
  IsDocumentWithCaption bool // True if the message was unwrapped from a DocumentWithCaptionMessage
298
299
  IsLottieSticker bool // True if the message was unwrapped from a LottieStickerMessage
300
+ IsBotInvoke bool // True if the message was unwrapped from a BotInvokeMessage
299
301
  IsEdit bool // True if the message was unwrapped from an EditedMessage
300
302
 
301
303
  // If this event was parsed from a WebMessageInfo (i.e. from a history sync or unavailable message request), the source data is here.
@@ -319,8 +321,10 @@ type FBMessage struct {
319
321
  // If the message was re-requested from the sender, this is the number of retries it took.
320
322
  RetryCount int
321
323
 
322
- Transport *waMsgTransport.MessageTransport // The first level of wrapping the message was in
323
- Application *waMsgApplication.MessageApplication // The second level of wrapping the message was in
324
+ Transport *waMsgTransport.MessageTransport // The first level of wrapping the message was in
325
+
326
+ FBApplication *waMsgApplication.MessageApplication // The second level of wrapping the message was in, for FB messages
327
+ IGTransport *instamadilloTransportPayload.TransportPayload // The second level of wrapping the message was in, for IG messages
324
328
  }
325
329
 
326
330
  func (evt *FBMessage) GetConsumerApplication() *waConsumerApplication.ConsumerApplication {
@@ -347,6 +351,10 @@ func (evt *Message) UnwrapRaw() *Message {
347
351
  }
348
352
  evt.Message = evt.Message.GetDeviceSentMessage().GetMessage()
349
353
  }
354
+ if evt.Message.GetBotInvokeMessage().GetMessage() != nil {
355
+ evt.Message = evt.Message.GetBotInvokeMessage().GetMessage()
356
+ evt.IsBotInvoke = true
357
+ }
350
358
  if evt.Message.GetEphemeralMessage().GetMessage() != nil {
351
359
  evt.Message = evt.Message.GetEphemeralMessage().GetMessage()
352
360
  evt.IsEphemeral = true
@@ -378,6 +386,9 @@ func (evt *Message) UnwrapRaw() *Message {
378
386
  evt.Message = evt.Message.GetEditedMessage().GetMessage()
379
387
  evt.IsEdit = true
380
388
  }
389
+ if evt.Message != nil && evt.RawMessage != nil && evt.Message.MessageContextInfo == nil && evt.RawMessage.MessageContextInfo != nil {
390
+ evt.Message.MessageContextInfo = evt.RawMessage.MessageContextInfo
391
+ }
381
392
  return evt
382
393
  }
383
394
 
@@ -39,7 +39,8 @@ var (
39
39
  ServerJID = NewJID("", DefaultUserServer)
40
40
  BroadcastServerJID = NewJID("", BroadcastServer)
41
41
  StatusBroadcastJID = NewJID("status", BroadcastServer)
42
- PSAJID = NewJID("0", LegacyUserServer)
42
+ LegacyPSAJID = NewJID("0", LegacyUserServer)
43
+ PSAJID = NewJID("0", DefaultUserServer)
43
44
  OfficialBusinessJID = NewJID("16505361212", LegacyUserServer)
44
45
  MetaAIJID = NewJID("13135550002", DefaultUserServer)
45
46
  NewMetaAIJID = NewJID("867051314767696", BotServer)
@@ -78,6 +78,7 @@ type MsgMetaInfo struct {
78
78
  // Bot things
79
79
  TargetID MessageID
80
80
  TargetSender JID
81
+ TargetChat JID
81
82
 
82
83
  DeprecatedLIDSession *bool
83
84
 
@@ -56,6 +56,8 @@ type ProfilePictureInfo struct {
56
56
  Type string `json:"type"` // The type of image. Known types include "image" (full res) and "preview" (thumbnail).
57
57
 
58
58
  DirectPath string `json:"direct_path"` // The path to the image, probably not very useful
59
+
60
+ Hash []byte `json:"hash"` // Some kind of hash (format is unknown)
59
61
  }
60
62
 
61
63
  // ContactInfo contains the cached names of a WhatsApp user.
@@ -8,6 +8,7 @@ package whatsmeow
8
8
 
9
9
  import (
10
10
  "context"
11
+ "encoding/base64"
11
12
  "errors"
12
13
  "fmt"
13
14
  "slices"
@@ -338,8 +339,8 @@ func (cli *Client) parseBusinessProfile(node *waBinary.Node) (*types.BusinessPro
338
339
  if !ok {
339
340
  return nil, errors.New("missing jid in business profile")
340
341
  }
341
- address := string(profileNode.GetChildByTag("address").Content.([]byte))
342
- email := string(profileNode.GetChildByTag("email").Content.([]byte))
342
+ address, _ := profileNode.GetChildByTag("address").Content.([]byte)
343
+ email, _ := profileNode.GetChildByTag("email").Content.([]byte)
343
344
  businessHour := profileNode.GetChildByTag("business_hours")
344
345
  businessHourTimezone := businessHour.AttrGetter().String("timezone")
345
346
  businessHoursConfigs := businessHour.GetChildren()
@@ -348,7 +349,7 @@ func (cli *Client) parseBusinessProfile(node *waBinary.Node) (*types.BusinessPro
348
349
  if config.Tag != "business_hours_config" {
349
350
  continue
350
351
  }
351
- dow := config.AttrGetter().String("dow")
352
+ dow := config.AttrGetter().String("day_of_week")
352
353
  mode := config.AttrGetter().String("mode")
353
354
  openTime := config.AttrGetter().String("open_time")
354
355
  closeTime := config.AttrGetter().String("close_time")
@@ -366,21 +367,23 @@ func (cli *Client) parseBusinessProfile(node *waBinary.Node) (*types.BusinessPro
366
367
  continue
367
368
  }
368
369
  id := category.AttrGetter().String("id")
369
- name := string(category.Content.([]byte))
370
+ name, _ := category.Content.([]byte)
370
371
  categories = append(categories, types.Category{
371
372
  ID: id,
372
- Name: name,
373
+ Name: string(name),
373
374
  })
374
375
  }
375
376
  profileOptionsNode := profileNode.GetChildByTag("profile_options")
376
377
  profileOptions := make(map[string]string)
377
378
  for _, option := range profileOptionsNode.GetChildren() {
378
- profileOptions[option.Tag] = string(option.Content.([]byte))
379
+ optValueBytes, _ := option.Content.([]byte)
380
+ profileOptions[option.Tag] = string(optValueBytes)
381
+ // TODO parse bot_fields
379
382
  }
380
383
  return &types.BusinessProfile{
381
384
  JID: jid,
382
- Email: email,
383
- Address: address,
385
+ Email: string(email),
386
+ Address: string(address),
384
387
  Categories: categories,
385
388
  ProfileOptions: profileOptions,
386
389
  BusinessHoursTimeZone: businessHourTimezone,
@@ -561,11 +564,14 @@ func (cli *Client) GetProfilePictureInfo(jid types.JID, params *GetProfilePictur
561
564
  ag := picture.AttrGetter()
562
565
  if ag.OptionalInt("status") == 304 {
563
566
  return nil, nil
567
+ } else if ag.OptionalInt("status") == 204 {
568
+ return nil, ErrProfilePictureNotSet
564
569
  }
565
570
  info.ID = ag.String("id")
566
571
  info.URL = ag.String("url")
567
572
  info.Type = ag.String("type")
568
573
  info.DirectPath = ag.String("direct_path")
574
+ info.Hash, _ = base64.StdEncoding.DecodeString(ag.OptionalString("hash"))
569
575
  if !ag.OK() {
570
576
  return &info, ag.Error()
571
577
  }
@@ -36,7 +36,7 @@ func ScalarBaseMult(dst, scalar *[32]byte) {
36
36
  curve := ecdh.X25519()
37
37
  priv, err := curve.NewPrivateKey(scalar[:])
38
38
  if err != nil {
39
- panic("curve25519: internal error: scalarBaseMult was not 32 bytes")
39
+ panic("curve25519: " + err.Error())
40
40
  }
41
41
  copy(dst[:], priv.PublicKey().Bytes())
42
42
  }
@@ -55,7 +55,7 @@ func configFromServer(h1 *http.Server, h2 *Server) http2Config {
55
55
  PermitProhibitedCipherSuites: h2.PermitProhibitedCipherSuites,
56
56
  CountError: h2.CountError,
57
57
  }
58
- fillNetHTTPServerConfig(&conf, h1)
58
+ fillNetHTTPConfig(&conf, h1.HTTP2)
59
59
  setConfigDefaults(&conf, true)
60
60
  return conf
61
61
  }
@@ -81,7 +81,7 @@ func configFromTransport(h2 *Transport) http2Config {
81
81
  }
82
82
 
83
83
  if h2.t1 != nil {
84
- fillNetHTTPTransportConfig(&conf, h2.t1)
84
+ fillNetHTTPConfig(&conf, h2.t1.HTTP2)
85
85
  }
86
86
  setConfigDefaults(&conf, false)
87
87
  return conf
@@ -120,3 +120,45 @@ func adjustHTTP1MaxHeaderSize(n int64) int64 {
120
120
  const typicalHeaders = 10 // conservative
121
121
  return n + typicalHeaders*perFieldOverhead
122
122
  }
123
+
124
+ func fillNetHTTPConfig(conf *http2Config, h2 *http.HTTP2Config) {
125
+ if h2 == nil {
126
+ return
127
+ }
128
+ if h2.MaxConcurrentStreams != 0 {
129
+ conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
130
+ }
131
+ if h2.MaxEncoderHeaderTableSize != 0 {
132
+ conf.MaxEncoderHeaderTableSize = uint32(h2.MaxEncoderHeaderTableSize)
133
+ }
134
+ if h2.MaxDecoderHeaderTableSize != 0 {
135
+ conf.MaxDecoderHeaderTableSize = uint32(h2.MaxDecoderHeaderTableSize)
136
+ }
137
+ if h2.MaxConcurrentStreams != 0 {
138
+ conf.MaxConcurrentStreams = uint32(h2.MaxConcurrentStreams)
139
+ }
140
+ if h2.MaxReadFrameSize != 0 {
141
+ conf.MaxReadFrameSize = uint32(h2.MaxReadFrameSize)
142
+ }
143
+ if h2.MaxReceiveBufferPerConnection != 0 {
144
+ conf.MaxUploadBufferPerConnection = int32(h2.MaxReceiveBufferPerConnection)
145
+ }
146
+ if h2.MaxReceiveBufferPerStream != 0 {
147
+ conf.MaxUploadBufferPerStream = int32(h2.MaxReceiveBufferPerStream)
148
+ }
149
+ if h2.SendPingTimeout != 0 {
150
+ conf.SendPingTimeout = h2.SendPingTimeout
151
+ }
152
+ if h2.PingTimeout != 0 {
153
+ conf.PingTimeout = h2.PingTimeout
154
+ }
155
+ if h2.WriteByteTimeout != 0 {
156
+ conf.WriteByteTimeout = h2.WriteByteTimeout
157
+ }
158
+ if h2.PermitProhibitedCipherSuites {
159
+ conf.PermitProhibitedCipherSuites = true
160
+ }
161
+ if h2.CountError != nil {
162
+ conf.CountError = h2.CountError
163
+ }
164
+ }
@@ -39,7 +39,7 @@ const (
39
39
  FrameContinuation FrameType = 0x9
40
40
  )
41
41
 
42
- var frameName = map[FrameType]string{
42
+ var frameNames = [...]string{
43
43
  FrameData: "DATA",
44
44
  FrameHeaders: "HEADERS",
45
45
  FramePriority: "PRIORITY",
@@ -53,10 +53,10 @@ var frameName = map[FrameType]string{
53
53
  }
54
54
 
55
55
  func (t FrameType) String() string {
56
- if s, ok := frameName[t]; ok {
57
- return s
56
+ if int(t) < len(frameNames) {
57
+ return frameNames[t]
58
58
  }
59
- return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", uint8(t))
59
+ return fmt.Sprintf("UNKNOWN_FRAME_TYPE_%d", t)
60
60
  }
61
61
 
62
62
  // Flags is a bitmask of HTTP/2 flags.
@@ -124,7 +124,7 @@ var flagName = map[FrameType]map[Flags]string{
124
124
  // might be 0).
125
125
  type frameParser func(fc *frameCache, fh FrameHeader, countError func(string), payload []byte) (Frame, error)
126
126
 
127
- var frameParsers = map[FrameType]frameParser{
127
+ var frameParsers = [...]frameParser{
128
128
  FrameData: parseDataFrame,
129
129
  FrameHeaders: parseHeadersFrame,
130
130
  FramePriority: parsePriorityFrame,
@@ -138,8 +138,8 @@ var frameParsers = map[FrameType]frameParser{
138
138
  }
139
139
 
140
140
  func typeFrameParser(t FrameType) frameParser {
141
- if f := frameParsers[t]; f != nil {
142
- return f
141
+ if int(t) < len(frameParsers) {
142
+ return frameParsers[t]
143
143
  }
144
144
  return parseUnknownFrame
145
145
  }
@@ -509,7 +509,7 @@ func (fr *Framer) ReadFrame() (Frame, error) {
509
509
  }
510
510
  if fh.Length > fr.maxReadSize {
511
511
  if fh == invalidHTTP1LookingFrameHeader() {
512
- return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err)
512
+ return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", ErrFrameTooLarge)
513
513
  }
514
514
  return nil, ErrFrameTooLarge
515
515
  }