slidge 0.1.1__py3-none-any.whl → 0.1.3__py3-none-any.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.
- slidge/core/gateway/base.py +1 -1
- slidge/core/gateway/session_dispatcher.py +15 -0
- slidge/group/participant.py +6 -6
- {slidge-0.1.1.dist-info → slidge-0.1.3.dist-info}/METADATA +5 -4
- {slidge-0.1.1.dist-info → slidge-0.1.3.dist-info}/RECORD +8 -8
- {slidge-0.1.1.dist-info → slidge-0.1.3.dist-info}/LICENSE +0 -0
- {slidge-0.1.1.dist-info → slidge-0.1.3.dist-info}/WHEEL +0 -0
- {slidge-0.1.1.dist-info → slidge-0.1.3.dist-info}/entry_points.txt +0 -0
slidge/core/gateway/base.py
CHANGED
@@ -448,6 +448,15 @@ class SessionDispatcher:
|
|
448
448
|
entity.react(legacy_id, emojis, xmpp_id=xmpp_id, carbon=True)
|
449
449
|
|
450
450
|
async def on_presence(self, p: Presence):
|
451
|
+
if p.get_plugin("muc_join", check=True):
|
452
|
+
# handled in on_groupchat_join
|
453
|
+
# without this early return, since we switch from and to in this
|
454
|
+
# presence stanza, on_groupchat_join ends up trying to instantiate
|
455
|
+
# a MUC with the user's JID, which in turn leads to slidge sending
|
456
|
+
# a (error) presence from=the user's JID, which terminates the
|
457
|
+
# XML stream.
|
458
|
+
return
|
459
|
+
|
451
460
|
session = await self.__get_session(p)
|
452
461
|
|
453
462
|
pto = p.get_to()
|
@@ -473,6 +482,12 @@ class SessionDispatcher:
|
|
473
482
|
if muc is None or p.get_from().resource not in muc.user_resources:
|
474
483
|
return
|
475
484
|
|
485
|
+
if pto.resource == muc.user_nick:
|
486
|
+
# Ignore presence stanzas with the valid nick.
|
487
|
+
# even if joined to the group, we might receive those from clients,
|
488
|
+
# when setting a status message, or going away, etc.
|
489
|
+
return
|
490
|
+
|
476
491
|
# We can't use XMPPError here because from must be room@slidge/VALID-USER-NICK
|
477
492
|
|
478
493
|
error_from = JID(muc.jid)
|
slidge/group/participant.py
CHANGED
@@ -108,7 +108,7 @@ class LegacyParticipant(
|
|
108
108
|
msg = self._make_message()
|
109
109
|
msg["muc"]["affiliation"] = self._affiliation
|
110
110
|
msg["type"] = "normal"
|
111
|
-
if not self.muc.is_anonymous:
|
111
|
+
if not self.muc.is_anonymous and not self.is_system:
|
112
112
|
if self.contact:
|
113
113
|
msg["muc"]["jid"] = self.contact.jid
|
114
114
|
else:
|
@@ -143,6 +143,7 @@ class LegacyParticipant(
|
|
143
143
|
|
144
144
|
if self.is_system:
|
145
145
|
self.jid = j
|
146
|
+
self._nickname_no_illegal = ""
|
146
147
|
return
|
147
148
|
|
148
149
|
nickname = unescaped_nickname
|
@@ -213,7 +214,6 @@ class LegacyParticipant(
|
|
213
214
|
|
214
215
|
kwargs["status_codes"] = set()
|
215
216
|
p = self._make_presence(ptype="available", last_seen=last_seen, **kwargs)
|
216
|
-
self.__add_nick_element(p)
|
217
217
|
self._send(p)
|
218
218
|
|
219
219
|
if old:
|
@@ -235,7 +235,7 @@ class LegacyParticipant(
|
|
235
235
|
codes = status_codes or set()
|
236
236
|
if self.is_user:
|
237
237
|
codes.add(110)
|
238
|
-
if not self.muc.is_anonymous:
|
238
|
+
if not self.muc.is_anonymous and not self.is_system:
|
239
239
|
if self.is_user:
|
240
240
|
if user_full_jid:
|
241
241
|
p["muc"]["jid"] = user_full_jid
|
@@ -301,6 +301,7 @@ class LegacyParticipant(
|
|
301
301
|
**send_kwargs,
|
302
302
|
) -> MessageOrPresenceTypeVar:
|
303
303
|
stanza["occupant-id"]["id"] = self.__occupant_id
|
304
|
+
self.__add_nick_element(stanza)
|
304
305
|
if isinstance(stanza, Presence):
|
305
306
|
if stanza["type"] == "unavailable" and not self.__presence_sent:
|
306
307
|
return stanza # type:ignore
|
@@ -344,11 +345,11 @@ class LegacyParticipant(
|
|
344
345
|
)
|
345
346
|
return item
|
346
347
|
|
347
|
-
def __add_nick_element(self,
|
348
|
+
def __add_nick_element(self, stanza: Union[Presence, Message]):
|
348
349
|
if (nick := self._nickname_no_illegal) != self.jid.resource:
|
349
350
|
n = self.xmpp.plugin["xep_0172"].stanza.UserNick()
|
350
351
|
n["nick"] = nick
|
351
|
-
|
352
|
+
stanza.append(n)
|
352
353
|
|
353
354
|
def _get_last_presence(self) -> Optional[CachedPresence]:
|
354
355
|
own = super()._get_last_presence()
|
@@ -400,7 +401,6 @@ class LegacyParticipant(
|
|
400
401
|
)
|
401
402
|
if presence_id:
|
402
403
|
p["id"] = presence_id
|
403
|
-
self.__add_nick_element(p)
|
404
404
|
self._send(p, full_jid)
|
405
405
|
|
406
406
|
def leave(self):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: slidge
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: XMPP bridging framework
|
5
5
|
Home-page: https://sr.ht/~nicoco/slidge/
|
6
6
|
License: AGPL-3.0-or-later
|
@@ -20,9 +20,11 @@ Requires-Dist: pickle-secure (>=0.99.9,<0.100.0)
|
|
20
20
|
Requires-Dist: python-magic (>=0.4.27,<0.5.0)
|
21
21
|
Requires-Dist: qrcode (>=7.4.1,<8.0.0)
|
22
22
|
Requires-Dist: slixmpp (>=1.8.5,<2.0.0)
|
23
|
+
Project-URL: Documentation, https://slidge.im/
|
24
|
+
Project-URL: Repository, https://git.sr.ht/~nicoco/slidge/
|
23
25
|
Description-Content-Type: text/markdown
|
24
26
|
|
25
|
-

|
26
28
|
|
27
29
|
[Home](https://sr.ht/~nicoco/slidge) |
|
28
30
|
[Docs](https://slidge.im/core) |
|
@@ -66,8 +68,7 @@ bundle.
|
|
66
68
|
Status
|
67
69
|
------
|
68
70
|
|
69
|
-
Slidge is **beta**-grade software
|
70
|
-
Group chat support is **experimental**.
|
71
|
+
Slidge is **beta**-grade software. It support groups and 1:1 chats.
|
71
72
|
|
72
73
|
Try slidge and give us some
|
73
74
|
feedback, through the [MUC](xmpp:slidge@conference.nicoco.fr?join), the
|
@@ -15,7 +15,7 @@ slidge/core/__init__.py,sha256=RG7Jj5JCJERjhqJ31lOLYV-7bH_oblClQD1KF9LsTXo,68
|
|
15
15
|
slidge/core/cache.py,sha256=Tkw8Bsor8zTN5wPIsBzxfnEk8GaOXMIauO4iBXxgv3M,5443
|
16
16
|
slidge/core/config.py,sha256=upZsWObT14foXc5HaXlOcZPLhGL2KSeK0K-QwPDHL3I,7392
|
17
17
|
slidge/core/gateway/__init__.py,sha256=rZckY2gAE-mon77_DSsAW1XtWqhBAETE2d4FqZ8pJXk,58
|
18
|
-
slidge/core/gateway/base.py,sha256=
|
18
|
+
slidge/core/gateway/base.py,sha256=SOjoEV6MME2gGDS7oZgA3RdWBlqdrZeQs5Usf80ijcY,34645
|
19
19
|
slidge/core/gateway/caps.py,sha256=Qosd3cZ356mGzzQkdP6Y8OZ5c0l7H3Lr2wptoFrD1qU,1919
|
20
20
|
slidge/core/gateway/delivery_receipt.py,sha256=AT_9gvZrtWpSRsDJcYjE8CmF7TW-YBbUPdqNW5zWAdo,1352
|
21
21
|
slidge/core/gateway/disco.py,sha256=_ylFGQAzBvKSe1iB85uhBnRUXExExDrEaFa5MEM3E7Y,2230
|
@@ -25,7 +25,7 @@ slidge/core/gateway/ping.py,sha256=YUmreEyEw89l0M65D_AylL5oW4xj4lvJvhwucyiKofw,1
|
|
25
25
|
slidge/core/gateway/presence.py,sha256=Ow2tWRx-tBL9mGeYRrHLboxD2CdJ32w9yor1kHZEL4U,2732
|
26
26
|
slidge/core/gateway/registration.py,sha256=KmxDFV3N01gCs_58Re9QIxJukYP7S3_i6IbukZxzEIs,1619
|
27
27
|
slidge/core/gateway/search.py,sha256=ZZPnZlTYFedsQAY-80ZX2el_oej6X7HfIwydYdTxl-o,3518
|
28
|
-
slidge/core/gateway/session_dispatcher.py,sha256=
|
28
|
+
slidge/core/gateway/session_dispatcher.py,sha256=UoBygDrgKIwIb-0TcrPzxxg_AuFhkexGGgvWZWroLts,29641
|
29
29
|
slidge/core/gateway/vcard_temp.py,sha256=uCSefV1D0Xx7Ex40t4uS0KHF7cbnq-xixAQQBxTtme8,4639
|
30
30
|
slidge/core/mixins/__init__.py,sha256=iAVi4gzekXIR2xDS8ic1gSguvBbfVSScWArM4t87L-U,368
|
31
31
|
slidge/core/mixins/attachment.py,sha256=yu7AzrRUCvKM_4AXYO1a83I4o_Sc8h3zteNRYOP2LgU,17808
|
@@ -42,7 +42,7 @@ slidge/core/session.py,sha256=xKyFxmi_tbp0WJNB7uJX_AENA2u1Pc0EzGr54ajmzfA,26134
|
|
42
42
|
slidge/group/__init__.py,sha256=yFt7cHqeaKIMN6f9ZyhhspOcJJvBtLedGv-iICG7lto,258
|
43
43
|
slidge/group/archive.py,sha256=5lnhUZ27RoVsYgcs-KiYiOLHZtB7VfRozLiTf0ZGNjM,3426
|
44
44
|
slidge/group/bookmarks.py,sha256=2uX7EiMlJJhYOnTXS1oJOchF5u_hFQAlp8VT2mcPqi0,5944
|
45
|
-
slidge/group/participant.py,sha256=
|
45
|
+
slidge/group/participant.py,sha256=hZNxh8QXaYb4AjVqUYQmHPwWnec1RdyQVDP1sZE85Jk,14947
|
46
46
|
slidge/group/room.py,sha256=I6cysvz8rfL6mZZ2AloYufJeG4FlDkEmESLH5oG8b-0,38972
|
47
47
|
slidge/migration.py,sha256=PPSjYMFsc9WGWWiSHWqUskpV_L9OJcrlecRf-Z0Vw_E,334
|
48
48
|
slidge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -89,8 +89,8 @@ slidge/util/sql.py,sha256=xjSldsDwgpZc20cmk6UfS4nhdc7Hbuml7kjH6IZgT0I,16517
|
|
89
89
|
slidge/util/test.py,sha256=8cTrL-traDv2jfvfTDNgqewsBJH19ePQ1bf7qzp1RHQ,10688
|
90
90
|
slidge/util/types.py,sha256=djIOI4kBBKl_2w8gm7QLtE3NDOCA832rD_GU7A3N6U4,4689
|
91
91
|
slidge/util/util.py,sha256=t8t1nPybcitpmuSlYsOwZ8gDjfiEwTjaa4D7vtzrvQ8,8587
|
92
|
-
slidge-0.1.
|
93
|
-
slidge-0.1.
|
94
|
-
slidge-0.1.
|
95
|
-
slidge-0.1.
|
96
|
-
slidge-0.1.
|
92
|
+
slidge-0.1.3.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
93
|
+
slidge-0.1.3.dist-info/METADATA,sha256=yCKNkKIY6QS_HY0XKsRFaIQ68hpDGeh1lRPFKgLOgrk,4736
|
94
|
+
slidge-0.1.3.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
95
|
+
slidge-0.1.3.dist-info/entry_points.txt,sha256=SNl72KSocF5plsu_67xyH6wVWfGTXQbzkQgXbLtzDrQ,47
|
96
|
+
slidge-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|