slidge-whatsapp 0.2.0b0__cp311-cp311-manylinux_2_36_x86_64.whl → 0.2.2__cp311-cp311-manylinux_2_36_x86_64.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 (32) hide show
  1. slidge_whatsapp/__init__.py +1 -1
  2. slidge_whatsapp/config.py +0 -6
  3. slidge_whatsapp/contact.py +4 -2
  4. slidge_whatsapp/event.go +389 -87
  5. slidge_whatsapp/gateway.go +82 -76
  6. slidge_whatsapp/gateway.py +11 -26
  7. slidge_whatsapp/generated/_whatsapp.cpython-311-x86_64-linux-gnu.h +606 -0
  8. slidge_whatsapp/generated/_whatsapp.cpython-311-x86_64-linux-gnu.so +0 -0
  9. slidge_whatsapp/generated/build.py +131 -114
  10. slidge_whatsapp/generated/go.py +12 -100
  11. slidge_whatsapp/generated/whatsapp.c +6887 -0
  12. slidge_whatsapp/generated/whatsapp.go +3572 -0
  13. slidge_whatsapp/generated/whatsapp.py +1263 -1169
  14. slidge_whatsapp/generated/whatsapp_go.h +606 -0
  15. slidge_whatsapp/go.mod +17 -16
  16. slidge_whatsapp/go.sum +32 -25
  17. slidge_whatsapp/group.py +24 -18
  18. slidge_whatsapp/media/ffmpeg.go +72 -0
  19. slidge_whatsapp/media/media.go +542 -0
  20. slidge_whatsapp/media/mupdf.go +47 -0
  21. slidge_whatsapp/media/stub.go +19 -0
  22. slidge_whatsapp/session.go +125 -54
  23. slidge_whatsapp/session.py +134 -61
  24. slidge_whatsapp-0.2.2.dist-info/METADATA +744 -0
  25. slidge_whatsapp-0.2.2.dist-info/RECORD +31 -0
  26. {slidge_whatsapp-0.2.0b0.dist-info → slidge_whatsapp-0.2.2.dist-info}/WHEEL +1 -1
  27. slidge_whatsapp/attachment.go +0 -386
  28. slidge_whatsapp/util.py +0 -12
  29. slidge_whatsapp-0.2.0b0.dist-info/METADATA +0 -85
  30. slidge_whatsapp-0.2.0b0.dist-info/RECORD +0 -25
  31. {slidge_whatsapp-0.2.0b0.dist-info → slidge_whatsapp-0.2.2.dist-info}/LICENSE +0 -0
  32. {slidge_whatsapp-0.2.0b0.dist-info → slidge_whatsapp-0.2.2.dist-info}/entry_points.txt +0 -0
@@ -13,5 +13,5 @@ def main():
13
13
  entrypoint("slidge_whatsapp")
14
14
 
15
15
 
16
- __version__ = "0.2.0beta"
16
+ __version__ = "v0.2.2"
17
17
  __all__ = "Gateway", "session", "command", "contact", "config", "group", "main"
slidge_whatsapp/config.py CHANGED
@@ -26,12 +26,6 @@ ALWAYS_SYNC_ROSTER__DOC = (
26
26
  "Whether or not to perform a full sync of the WhatsApp roster on startup."
27
27
  )
28
28
 
29
- SKIP_VERIFY_TLS = False
30
- SKIP_VERIFY_TLS__DOC = (
31
- "Whether or not HTTPS connections made by this plugin should verify TLS"
32
- " certificates."
33
- )
34
-
35
29
  ENABLE_LINK_PREVIEWS = True
36
30
  ENABLE_LINK_PREVIEWS__DOC = (
37
31
  "Whether or not previews for links (URLs) should be generated on outgoing messages"
@@ -47,16 +47,18 @@ class Roster(LegacyRoster[str, Contact]):
47
47
  """
48
48
  Adds a WhatsApp contact to local roster, filling all required and optional information.
49
49
  """
50
+ # Don't attempt to add ourselves to the roster.
50
51
  if data.JID == self.user_legacy_id:
51
- # with the current implementation, we don't allow that
52
52
  return None
53
53
  contact = await self.by_legacy_id(data.JID)
54
54
  contact.name = data.Name
55
55
  contact.is_friend = True
56
56
  try:
57
57
  avatar = self.session.whatsapp.GetAvatar(data.JID, contact.avatar or "")
58
- if avatar.URL:
58
+ if avatar.URL and contact.avatar != avatar.ID:
59
59
  await contact.set_avatar(avatar.URL, avatar.ID)
60
+ elif avatar.URL == "":
61
+ await contact.set_avatar(None)
60
62
  except RuntimeError as err:
61
63
  self.session.log.error(
62
64
  "Failed getting avatar for contact %s: %s", data.JID, err