slidge 0.2.0a4__py3-none-any.whl → 0.2.0a6__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- slidge/__version__.py +1 -1
- slidge/contact/contact.py +7 -3
- slidge/group/room.py +1 -0
- slidge/util/test.py +12 -3
- {slidge-0.2.0a4.dist-info → slidge-0.2.0a6.dist-info}/METADATA +1 -1
- {slidge-0.2.0a4.dist-info → slidge-0.2.0a6.dist-info}/RECORD +9 -9
- {slidge-0.2.0a4.dist-info → slidge-0.2.0a6.dist-info}/LICENSE +0 -0
- {slidge-0.2.0a4.dist-info → slidge-0.2.0a6.dist-info}/WHEEL +0 -0
- {slidge-0.2.0a4.dist-info → slidge-0.2.0a6.dist-info}/entry_points.txt +0 -0
slidge/__version__.py
CHANGED
slidge/contact/contact.py
CHANGED
@@ -196,15 +196,19 @@ class LegacyContact(
|
|
196
196
|
def __ensure_pk(self):
|
197
197
|
if self.contact_pk is not None:
|
198
198
|
return
|
199
|
+
# This happens for legacy modules that don't follow the Roster.fill /
|
200
|
+
# populate contact attributes in Contact.update_info() method.
|
201
|
+
# This results in (even) less optimised SQL writes and read, but
|
202
|
+
# we allow it because it fits some legacy network libs better.
|
199
203
|
with self.xmpp.store.session() as orm:
|
200
204
|
orm.commit()
|
201
205
|
stored = self.xmpp.store.contacts.get_by_legacy_id(
|
202
206
|
self.user_pk, str(self.legacy_id)
|
203
207
|
)
|
204
208
|
if stored is None:
|
205
|
-
self.
|
206
|
-
|
207
|
-
|
209
|
+
self.contact_pk = self.xmpp.store.contacts.update(self, commit=True)
|
210
|
+
else:
|
211
|
+
self.contact_pk = stored.id
|
208
212
|
assert self.contact_pk is not None
|
209
213
|
|
210
214
|
def __get_subscription_string(self):
|
slidge/group/room.py
CHANGED
@@ -758,6 +758,7 @@ class LegacyMUC(
|
|
758
758
|
await self.session.contacts.ready
|
759
759
|
|
760
760
|
if self.pk is not None:
|
761
|
+
c._LegacyContact__ensure_pk() # type: ignore
|
761
762
|
assert c.contact_pk is not None
|
762
763
|
with self.__store.session():
|
763
764
|
stored = self.__participants_store.get_by_contact(self.pk, c.contact_pk)
|
slidge/util/test.py
CHANGED
@@ -218,7 +218,10 @@ class SlidgeTest(SlixTestPlus):
|
|
218
218
|
engine = self.db_engine = create_engine("sqlite+pysqlite:///:memory:")
|
219
219
|
Base.metadata.create_all(engine)
|
220
220
|
BaseGateway.store = SlidgeStore(engine)
|
221
|
-
|
221
|
+
try:
|
222
|
+
self.xmpp = BaseGateway.get_self_or_unique_subclass()()
|
223
|
+
except Exception:
|
224
|
+
raise
|
222
225
|
self.xmpp.TEST_MODE = True
|
223
226
|
PepNick.contact_store = self.xmpp.store.contacts
|
224
227
|
PepAvatar.store = self.xmpp.store
|
@@ -266,7 +269,7 @@ class SlidgeTest(SlixTestPlus):
|
|
266
269
|
slidge.db.store._session = None
|
267
270
|
Base.metadata.drop_all(self.xmpp.store._engine)
|
268
271
|
|
269
|
-
def setup_logged_session(self):
|
272
|
+
def setup_logged_session(self, n_contacts=0):
|
270
273
|
user = self.xmpp.store.users.new(
|
271
274
|
JID("romeo@montague.lit/gajim"), {"username": "romeo", "city": ""}
|
272
275
|
)
|
@@ -284,12 +287,18 @@ class SlidgeTest(SlixTestPlus):
|
|
284
287
|
assert "logging in" in stanza["status"].lower(), stanza
|
285
288
|
stanza = self.next_sent()
|
286
289
|
assert "syncing contacts" in stanza["status"].lower(), stanza
|
290
|
+
if BaseGateway.get_self_or_unique_subclass().GROUPS:
|
291
|
+
stanza = self.next_sent()
|
292
|
+
assert "syncing groups" in stanza["status"].lower(), stanza
|
293
|
+
for _ in range(n_contacts):
|
294
|
+
probe = self.next_sent()
|
295
|
+
assert probe.get_type() == "probe"
|
287
296
|
stanza = self.next_sent()
|
288
297
|
assert "yup" in stanza["status"].lower(), stanza
|
289
|
-
|
290
298
|
self.romeo: BaseSession = BaseSession.get_self_or_unique_subclass().from_jid(
|
291
299
|
JID("romeo@montague.lit")
|
292
300
|
)
|
301
|
+
|
293
302
|
self.juliet: LegacyContact = self.run_coro(
|
294
303
|
self.romeo.contacts.by_legacy_id("juliet")
|
295
304
|
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
slidge/__init__.py,sha256=S0tUjqpZlzsr8G4Y_1Xt-KCYB07qaknTB0OwHU8k29U,1587
|
2
2
|
slidge/__main__.py,sha256=Y12eh1TD_C5MB50KgEAuMffGnRFCvKYFKHD4UYSmHA0,72
|
3
|
-
slidge/__version__.py,sha256=
|
3
|
+
slidge/__version__.py,sha256=Z2v182VfCCHc2NnkauNdFLVe5MwGg5cg8dRIWwfmsHM,170
|
4
4
|
slidge/command/__init__.py,sha256=UYf1mjCYbZ5G7PIgaFTWSQRAzEJkQ6dTH8Fu_e_XnO0,613
|
5
5
|
slidge/command/adhoc.py,sha256=5xLLoWyUJqCJB7kAwD2VKYTl_7MObCsgdz-qg_WkWGs,9417
|
6
6
|
slidge/command/admin.py,sha256=x_kJ0TJhzf6d3OBIOXFjudZFO8bRYUG919td7OjMCug,6008
|
@@ -10,7 +10,7 @@ slidge/command/chat_command.py,sha256=kMnxrzmD7LhWgyO1w9Rgz1eA7PhfAJ2Rf34YWjoKrw
|
|
10
10
|
slidge/command/register.py,sha256=fzPcGUoJtainnDOiC13gWV-uYLuJcsmdKGJ-jXT1qIo,6697
|
11
11
|
slidge/command/user.py,sha256=nJnoU4t1r9oPkFFHSHHwSY8WOQNLQn9mMcwZp-yZaKA,11422
|
12
12
|
slidge/contact/__init__.py,sha256=WMMaHk7UW7YT9EH2LtPdkU0bHQaOp4ikBhbBQskmoc8,191
|
13
|
-
slidge/contact/contact.py,sha256=
|
13
|
+
slidge/contact/contact.py,sha256=yzemaELpe256B43gUXYc9CLjFhwSjr7-PwkY0uxVQfc,22169
|
14
14
|
slidge/contact/roster.py,sha256=2UPuf2XkCdt9mdjhbATxxIH5dyIiJaxA0en8t1BgJuc,9989
|
15
15
|
slidge/core/__init__.py,sha256=RG7Jj5JCJERjhqJ31lOLYV-7bH_oblClQD1KF9LsTXo,68
|
16
16
|
slidge/core/config.py,sha256=leNcN_TI0Ka1hhzOHx7cBW3fNj5xZwsiv9l8AfRY_vU,7630
|
@@ -66,7 +66,7 @@ slidge/group/__init__.py,sha256=yFt7cHqeaKIMN6f9ZyhhspOcJJvBtLedGv-iICG7lto,258
|
|
66
66
|
slidge/group/archive.py,sha256=xGPkdSk8-BT6t6lNVo1FEwiFVAttoxCma8Tsyk5r8Kg,5279
|
67
67
|
slidge/group/bookmarks.py,sha256=_LDf7A7aWkwPH88v7c-mOp8VJs3gSFM1-uCqSb4ThO8,5825
|
68
68
|
slidge/group/participant.py,sha256=VNMtqr98QVuYgiTsJ9BaaIG1noz-xe3ewyKhLeDRhBk,17033
|
69
|
-
slidge/group/room.py,sha256=
|
69
|
+
slidge/group/room.py,sha256=KqVTEwpoVvwoDqAe-eIL7-ASNebuThRL4EAZsFtdCcY,45384
|
70
70
|
slidge/main.py,sha256=TbkG5m1SgNmfaZ7TOD5VGTh4Q52XltLJayWnan8M9cw,5986
|
71
71
|
slidge/migration.py,sha256=qUrux9dYCtOfFjPIlvGfWjoyqhkdxzaOByJRqTmCoUI,1072
|
72
72
|
slidge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -108,11 +108,11 @@ slidge/util/__init__.py,sha256=BELovoTMPcPPGz3D48esBr8A4BRRHXTvavfgnArBgEc,301
|
|
108
108
|
slidge/util/archive_msg.py,sha256=xXAR0BI5r3d6KKWjae9594izCOv6iI03z2WLuTecNw8,1724
|
109
109
|
slidge/util/conf.py,sha256=1j2OnOsCBar1tOObErhXR5RC3Vl3faliOZ1U8J3My58,6613
|
110
110
|
slidge/util/db.py,sha256=4LxZj8oBYgiSnyBUnF_ALjr0TblkfNQq_p28sCfkHMY,242
|
111
|
-
slidge/util/test.py,sha256=
|
111
|
+
slidge/util/test.py,sha256=84GCSsWDaf7ukrMUaej2tuedY2Uxje5JljUt3x-V4mM,13645
|
112
112
|
slidge/util/types.py,sha256=Gif-Z9NVd_eTei1uM3_KOsdok3B1yMQwdOkOzf9vheE,5224
|
113
113
|
slidge/util/util.py,sha256=8JeE0QObNGQr_Tw4OFPwQSz_EB_zh_0t9IJmNNhW0ic,9114
|
114
|
-
slidge-0.2.
|
115
|
-
slidge-0.2.
|
116
|
-
slidge-0.2.
|
117
|
-
slidge-0.2.
|
118
|
-
slidge-0.2.
|
114
|
+
slidge-0.2.0a6.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
115
|
+
slidge-0.2.0a6.dist-info/METADATA,sha256=Y3urIslvpvtG2sPaOfhxpOoRPfxfnRIrxqzuZGT5RrM,4723
|
116
|
+
slidge-0.2.0a6.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
117
|
+
slidge-0.2.0a6.dist-info/entry_points.txt,sha256=SNl72KSocF5plsu_67xyH6wVWfGTXQbzkQgXbLtzDrQ,47
|
118
|
+
slidge-0.2.0a6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|