slidge-whatsapp 0.2.0a0__cp311-cp311-manylinux_2_36_x86_64.whl → 0.2.1__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.
Potentially problematic release.
This version of slidge-whatsapp might be problematic. Click here for more details.
- slidge_whatsapp/__init__.py +8 -2
- slidge_whatsapp/__main__.py +2 -8
- slidge_whatsapp/config.py +0 -6
- slidge_whatsapp/contact.py +4 -2
- slidge_whatsapp/event.go +337 -66
- slidge_whatsapp/gateway.go +82 -76
- slidge_whatsapp/gateway.py +11 -26
- slidge_whatsapp/generated/_whatsapp.cpython-311-x86_64-linux-gnu.h +614 -0
- slidge_whatsapp/generated/_whatsapp.cpython-311-x86_64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +119 -97
- slidge_whatsapp/generated/go.py +0 -22
- slidge_whatsapp/generated/whatsapp.c +6980 -0
- slidge_whatsapp/generated/whatsapp.go +3645 -0
- slidge_whatsapp/generated/whatsapp.py +1239 -1055
- slidge_whatsapp/generated/whatsapp_go.h +614 -0
- slidge_whatsapp/group.py +23 -12
- slidge_whatsapp/media/ffmpeg.go +72 -0
- slidge_whatsapp/media/media.go +448 -0
- slidge_whatsapp/session.go +87 -49
- slidge_whatsapp/session.py +140 -66
- {slidge_whatsapp-0.2.0a0.dist-info → slidge_whatsapp-0.2.1.dist-info}/METADATA +8 -3
- slidge_whatsapp-0.2.1.dist-info/RECORD +26 -0
- {slidge_whatsapp-0.2.0a0.dist-info → slidge_whatsapp-0.2.1.dist-info}/WHEEL +1 -1
- slidge_whatsapp-0.2.1.dist-info/entry_points.txt +3 -0
- slidge_whatsapp/attachment.go +0 -386
- slidge_whatsapp/go.mod +0 -28
- slidge_whatsapp/go.sum +0 -55
- slidge_whatsapp/util.py +0 -12
- slidge_whatsapp-0.2.0a0.dist-info/LICENSE +0 -661
- slidge_whatsapp-0.2.0a0.dist-info/RECORD +0 -25
- slidge_whatsapp-0.2.0a0.dist-info/entry_points.txt +0 -3
slidge_whatsapp/__init__.py
CHANGED
|
@@ -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
|
-
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
def main():
|
|
13
|
+
entrypoint("slidge_whatsapp")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
__version__ = "0.2.1"
|
|
17
|
+
__all__ = "Gateway", "session", "command", "contact", "config", "group", "main"
|
slidge_whatsapp/__main__.py
CHANGED
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"
|
slidge_whatsapp/contact.py
CHANGED
|
@@ -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
|