slidge-whatsapp 0.2.0a0__tar.gz → 0.2.1__tar.gz

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.

Files changed (23) hide show
  1. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/PKG-INFO +8 -3
  2. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/README.md +5 -1
  3. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/pyproject.toml +3 -3
  4. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/__init__.py +8 -2
  5. slidge_whatsapp-0.2.1/slidge_whatsapp/__main__.py +3 -0
  6. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/config.py +0 -6
  7. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/contact.py +4 -2
  8. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/event.go +337 -66
  9. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/gateway.go +82 -76
  10. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/gateway.py +11 -26
  11. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/group.py +23 -12
  12. slidge_whatsapp-0.2.1/slidge_whatsapp/media/ffmpeg.go +72 -0
  13. slidge_whatsapp-0.2.1/slidge_whatsapp/media/media.go +448 -0
  14. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/session.go +87 -49
  15. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/session.py +140 -66
  16. slidge_whatsapp-0.2.0a0/LICENSE +0 -661
  17. slidge_whatsapp-0.2.0a0/slidge_whatsapp/__main__.py +0 -9
  18. slidge_whatsapp-0.2.0a0/slidge_whatsapp/attachment.go +0 -386
  19. slidge_whatsapp-0.2.0a0/slidge_whatsapp/go.mod +0 -28
  20. slidge_whatsapp-0.2.0a0/slidge_whatsapp/go.sum +0 -55
  21. slidge_whatsapp-0.2.0a0/slidge_whatsapp/util.py +0 -12
  22. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/build.py +0 -0
  23. {slidge_whatsapp-0.2.0a0 → slidge_whatsapp-0.2.1}/slidge_whatsapp/command.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: slidge-whatsapp
3
- Version: 0.2.0a0
3
+ Version: 0.2.1
4
4
  Summary: A Whatsapp/XMPP gateway.
5
5
  Author: deuill
6
6
  Author-email: alex@deuill.org
@@ -8,9 +8,10 @@ Requires-Python: >=3.11,<4.0
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Programming Language :: Python :: 3.11
10
10
  Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
11
12
  Requires-Dist: linkpreview (>=0.6.5,<0.7.0)
12
13
  Requires-Dist: pybindgen (>=0.22.1,<0.23.0)
13
- Requires-Dist: slidge (>=0.2.0alpha4,<0.3.0)
14
+ Requires-Dist: slidge (>=0.2.0beta0,<0.3.0)
14
15
  Description-Content-Type: text/markdown
15
16
 
16
17
  # slidge-whatsapp
@@ -57,9 +58,13 @@ With [pipx](https://pypa.github.io/pipx/):
57
58
  pipx install slidge-whatsapp
58
59
 
59
60
  # for the bleeding edge
60
- pipx install slidge-whatsapp \
61
+ pipx install slidge-whatsapp==0.0.0.dev0 \
61
62
  --pip-args='--extra-index-url https://slidge.im/repo'
62
63
 
64
+ # to update bleeding edge installs
65
+ pipx install slidge-whatsapp==0.0.0.dev0 \
66
+ --pip-args='--extra-index-url https://slidge.im/repo' --force
67
+
63
68
  slidge-whatsapp --help
64
69
  ```
65
70
 
@@ -42,9 +42,13 @@ With [pipx](https://pypa.github.io/pipx/):
42
42
  pipx install slidge-whatsapp
43
43
 
44
44
  # for the bleeding edge
45
- pipx install slidge-whatsapp \
45
+ pipx install slidge-whatsapp==0.0.0.dev0 \
46
46
  --pip-args='--extra-index-url https://slidge.im/repo'
47
47
 
48
+ # to update bleeding edge installs
49
+ pipx install slidge-whatsapp==0.0.0.dev0 \
50
+ --pip-args='--extra-index-url https://slidge.im/repo' --force
51
+
48
52
  slidge-whatsapp --help
49
53
  ```
50
54
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "slidge-whatsapp"
3
- version = "0.2.0alpha0"
3
+ version = "0.2.1"
4
4
  description = "A Whatsapp/XMPP gateway."
5
5
  authors = ["deuill <alex@deuill.org>", "Nicoco <nicoco@nicoco.fr>"]
6
6
  readme = "README.md"
@@ -23,7 +23,7 @@ script = "build.py"
23
23
  python = "^3.11"
24
24
  linkpreview = "^0.6.5"
25
25
  pybindgen = "^0.22.1"
26
- slidge = "^0.2.0alpha4"
26
+ slidge = "^0.2.0beta0"
27
27
 
28
28
  [tool.poetry.group.dev.dependencies]
29
29
  pytest-asyncio = "^0.21.0"
@@ -48,7 +48,7 @@ requires = ["poetry-core", "pybindgen"]
48
48
  build-backend = "poetry.core.masonry.api"
49
49
 
50
50
  [tool.poetry.scripts]
51
- slidge-whatsapp = 'slidge_whatsapp.__main__:main'
51
+ slidge-whatsapp = 'slidge_whatsapp:main'
52
52
 
53
53
  [tool.mypy]
54
54
  files = ["slidge_whatsapp"]
@@ -2,10 +2,16 @@
2
2
  WhatsApp gateway using the multi-device API.
3
3
  """
4
4
 
5
+ from slidge import entrypoint
5
6
  from slidge.util.util import get_version # noqa: F401
6
7
 
7
8
  from . import command, config, contact, group, session
8
9
  from .gateway import Gateway
9
10
 
10
- __version__ = "0.2.0alpha0"
11
- __all__ = "Gateway", "session", "command", "contact", "config", "group"
11
+
12
+ def main():
13
+ entrypoint("slidge_whatsapp")
14
+
15
+
16
+ __version__ = "0.2.1"
17
+ __all__ = "Gateway", "session", "command", "contact", "config", "group", "main"
@@ -0,0 +1,3 @@
1
+ from slidge_whatsapp import main
2
+
3
+ main()
@@ -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