slidge 0.3.0a3__py3-none-any.whl → 0.3.0b2__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/contact/contact.py +2 -2
- slidge/contact/roster.py +2 -0
- slidge/core/dispatcher/message/message.py +3 -1
- slidge/core/dispatcher/presence.py +5 -0
- slidge/core/gateway.py +1 -1
- slidge/core/mixins/attachment.py +31 -0
- slidge/core/mixins/avatar.py +8 -13
- slidge/core/session.py +7 -3
- slidge/db/alembic/versions/cef02a8b1451_initial_schema.py +361 -0
- slidge/group/participant.py +1 -1
- slidge/group/room.py +52 -53
- slidge/main.py +6 -4
- slidge/migration.py +14 -5
- slidge/util/conf.py +4 -1
- {slidge-0.3.0a3.dist-info → slidge-0.3.0b2.dist-info}/METADATA +1 -1
- {slidge-0.3.0a3.dist-info → slidge-0.3.0b2.dist-info}/RECORD +20 -43
- slidge/db/alembic/versions/0337c90c0b96_unify_legacy_xmpp_id_mappings.py +0 -183
- slidge/db/alembic/versions/04cf35e3cf85_add_participant_nickname_no_illegal.py +0 -33
- slidge/db/alembic/versions/09f27f098baa_add_missing_attributes_in_room.py +0 -36
- slidge/db/alembic/versions/15b0bd83407a_remove_bogus_unique_constraints_on_room_.py +0 -85
- slidge/db/alembic/versions/2461390c0af2_store_contacts_caps_verstring_in_db.py +0 -36
- slidge/db/alembic/versions/29f5280c61aa_store_subject_setter_in_room.py +0 -37
- slidge/db/alembic/versions/2b1f45ab7379_store_room_subject_setter_by_nickname.py +0 -41
- slidge/db/alembic/versions/3071e0fa69d4_add_contact_client_type.py +0 -52
- slidge/db/alembic/versions/3231d2c623bc_add_unique_contraint_for_attachment_.py +0 -33
- slidge/db/alembic/versions/45c24cc73c91_add_bob.py +0 -42
- slidge/db/alembic/versions/4dbd23a3f868_new_avatar_store.py +0 -105
- slidge/db/alembic/versions/54ce3cde350c_use_hash_for_avatar_filenames.py +0 -50
- slidge/db/alembic/versions/58b98dacf819_refactor.py +0 -118
- slidge/db/alembic/versions/5bd48bfdffa2_lift_room_legacy_id_constraint.py +0 -61
- slidge/db/alembic/versions/75a62b74b239_ditch_hats_table.py +0 -74
- slidge/db/alembic/versions/82a4af84b679_add_muc_history_filled.py +0 -48
- slidge/db/alembic/versions/8b993243a536_add_vcard_content_to_contact_table.py +0 -43
- slidge/db/alembic/versions/8d2ced764698_rely_on_db_to_store_contacts_rooms_and_.py +0 -139
- slidge/db/alembic/versions/aa9d82a7f6ef_db_creation.py +0 -50
- slidge/db/alembic/versions/abba1ae0edb3_store_avatar_legacy_id_in_the_contact_.py +0 -79
- slidge/db/alembic/versions/b33993e87db3_move_everything_to_persistent_db.py +0 -214
- slidge/db/alembic/versions/b64b1a793483_add_source_and_legacy_id_for_archived_.py +0 -52
- slidge/db/alembic/versions/c4a8ec35a0e8_per_room_user_nick.py +0 -34
- slidge/db/alembic/versions/e91195719c2c_store_users_avatars_persistently.py +0 -26
- {slidge-0.3.0a3.dist-info → slidge-0.3.0b2.dist-info}/WHEEL +0 -0
- {slidge-0.3.0a3.dist-info → slidge-0.3.0b2.dist-info}/entry_points.txt +0 -0
- {slidge-0.3.0a3.dist-info → slidge-0.3.0b2.dist-info}/licenses/LICENSE +0 -0
- {slidge-0.3.0a3.dist-info → slidge-0.3.0b2.dist-info}/top_level.txt +0 -0
slidge/group/room.py
CHANGED
@@ -3,6 +3,8 @@ import logging
|
|
3
3
|
import re
|
4
4
|
import string
|
5
5
|
import warnings
|
6
|
+
from asyncio import Lock
|
7
|
+
from contextlib import asynccontextmanager
|
6
8
|
from copy import copy
|
7
9
|
from datetime import datetime, timedelta, timezone
|
8
10
|
from typing import TYPE_CHECKING, AsyncIterator, Generic, Optional, Type, Union
|
@@ -19,7 +21,6 @@ from slixmpp.plugins.xep_0492.stanza import NS as NOTIFY_NS
|
|
19
21
|
from slixmpp.plugins.xep_0492.stanza import WhenLiteral
|
20
22
|
from slixmpp.xmlstream import ET
|
21
23
|
from sqlalchemy.orm import Session as OrmSession
|
22
|
-
from sqlalchemy.orm.exc import DetachedInstanceError
|
23
24
|
|
24
25
|
from ..contact.contact import LegacyContact
|
25
26
|
from ..contact.roster import ContactIsUser
|
@@ -28,7 +29,6 @@ from ..core.mixins.disco import ChatterDiscoMixin
|
|
28
29
|
from ..core.mixins.recipient import ReactionRecipientMixin, ThreadRecipientMixin
|
29
30
|
from ..db.models import Participant, Room
|
30
31
|
from ..util.jid_escaping import unescape_node
|
31
|
-
from ..util.lock import NamedLockMixin
|
32
32
|
from ..util.types import (
|
33
33
|
HoleBound,
|
34
34
|
LegacyGroupIdType,
|
@@ -56,7 +56,6 @@ class LegacyMUC(
|
|
56
56
|
LegacyGroupIdType, LegacyMessageType, LegacyParticipantType, LegacyUserIdType
|
57
57
|
],
|
58
58
|
AvatarMixin,
|
59
|
-
NamedLockMixin,
|
60
59
|
ChatterDiscoMixin,
|
61
60
|
ReactionRecipientMixin,
|
62
61
|
ThreadRecipientMixin,
|
@@ -242,53 +241,46 @@ class LegacyMUC(
|
|
242
241
|
)
|
243
242
|
self.commit()
|
244
243
|
|
244
|
+
@asynccontextmanager
|
245
|
+
async def lock(self, id_: str) -> AsyncIterator[None]:
|
246
|
+
async with self.session.lock((self.legacy_id, id_)):
|
247
|
+
yield
|
248
|
+
|
249
|
+
def get_lock(self, id_: str) -> Lock | None:
|
250
|
+
return self.session.get_lock((self.legacy_id, id_))
|
251
|
+
|
245
252
|
async def __fill_participants(self) -> None:
|
246
|
-
if self.participants_filled:
|
247
|
-
return
|
248
253
|
async with self.lock("fill participants"):
|
254
|
+
with self.xmpp.store.session(expire_on_commit=False) as orm:
|
255
|
+
orm.add(self.stored)
|
256
|
+
with orm.no_autoflush:
|
257
|
+
orm.refresh(self.stored, ["participants_filled"])
|
258
|
+
if self.participants_filled:
|
259
|
+
return
|
249
260
|
parts: list[Participant] = []
|
250
|
-
resources
|
261
|
+
resources = set[str]()
|
262
|
+
# During fill_participants(), self.get_participant*() methods may
|
263
|
+
# return a participant with a conflicting nick/resource.
|
251
264
|
async for participant in self.fill_participants():
|
252
|
-
if participant.stored.
|
265
|
+
if participant.stored.resource in resources:
|
266
|
+
self.log.warning(
|
267
|
+
"Participant '%s' was yielded more than once by fill_participants()",
|
268
|
+
participant.stored.resource,
|
269
|
+
)
|
253
270
|
continue
|
254
|
-
# During fill_participants(), self.get_participant*() methods may
|
255
|
-
# return a participant with a conflicting nick/resource. There is
|
256
|
-
# a better way to fix this than the logic below, but this better way
|
257
|
-
# has not been found yet.
|
258
|
-
if participant.jid.resource in resources:
|
259
|
-
if participant.contact is None:
|
260
|
-
self.log.warning(
|
261
|
-
"Ditching participant %s", participant.nickname
|
262
|
-
)
|
263
|
-
del participant
|
264
|
-
continue
|
265
|
-
else:
|
266
|
-
nickname = (
|
267
|
-
f"{participant.nickname} ({participant.contact.jid.node})"
|
268
|
-
)
|
269
|
-
participant = self._participant_cls(
|
270
|
-
self,
|
271
|
-
Participant(nickname=nickname, room=self.stored),
|
272
|
-
contact=participant.contact,
|
273
|
-
)
|
274
|
-
resources.add(participant.jid.resource)
|
275
271
|
parts.append(participant.stored)
|
272
|
+
resources.add(participant.stored.resource)
|
276
273
|
with self.xmpp.store.session(expire_on_commit=False) as orm:
|
277
|
-
# FIXME: something must be wrong with all these refreshes and merge,
|
278
|
-
# but I did not manage to get rid of them without getting various
|
279
|
-
# sqlalchemy exceptions raised everywhere
|
280
274
|
orm.add(self.stored)
|
281
|
-
|
282
|
-
|
275
|
+
# because self.fill_participants() is async, self.stored may be stale at
|
276
|
+
# this point, and the only thing we want to update is the participant list
|
277
|
+
# and the participant_filled attribute.
|
278
|
+
with orm.no_autoflush:
|
279
|
+
orm.refresh(self.stored)
|
280
|
+
for part in parts:
|
281
|
+
orm.merge(part)
|
283
282
|
self.stored.participants_filled = True
|
284
|
-
for part in parts:
|
285
|
-
if part.resource in known:
|
286
|
-
continue
|
287
|
-
part = orm.merge(part)
|
288
|
-
orm.add(part)
|
289
|
-
self.stored.participants.append(part)
|
290
283
|
orm.commit()
|
291
|
-
orm.refresh(self.stored)
|
292
284
|
|
293
285
|
async def get_participants(
|
294
286
|
self, affiliation: Optional[MucAffiliation] = None
|
@@ -305,10 +297,14 @@ class LegacyMUC(
|
|
305
297
|
yield self.participant_from_store(db_participant)
|
306
298
|
|
307
299
|
async def __fill_history(self) -> None:
|
308
|
-
if self.stored.history_filled:
|
309
|
-
self.log.debug("History has already been fetched.")
|
310
|
-
return
|
311
300
|
async with self.lock("fill history"):
|
301
|
+
with self.xmpp.store.session(expire_on_commit=False) as orm:
|
302
|
+
orm.add(self.stored)
|
303
|
+
with orm.no_autoflush:
|
304
|
+
orm.refresh(self.stored, ["history_filled"])
|
305
|
+
if self.stored.history_filled:
|
306
|
+
self.log.debug("History has already been fetched.")
|
307
|
+
return
|
312
308
|
log.debug("Fetching history for %s", self)
|
313
309
|
try:
|
314
310
|
before, after = self.archive.get_hole_bounds()
|
@@ -642,6 +638,10 @@ class LegacyMUC(
|
|
642
638
|
|
643
639
|
if user_participant is None:
|
644
640
|
user_participant = await self.get_user_participant()
|
641
|
+
with self.xmpp.store.session() as orm:
|
642
|
+
orm.add(self.stored)
|
643
|
+
with orm.no_autoflush:
|
644
|
+
orm.refresh(self.stored, ["participants"])
|
645
645
|
if not user_participant.is_user:
|
646
646
|
self.log.warning("is_user flag not set participant on user_participant")
|
647
647
|
user_participant.is_user = True # type:ignore
|
@@ -778,16 +778,15 @@ class LegacyMUC(
|
|
778
778
|
"""
|
779
779
|
await self.session.contacts.ready
|
780
780
|
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
return self.participant_from_store(stored=stored, contact=c)
|
781
|
+
with self.xmpp.store.session() as orm:
|
782
|
+
self.stored = orm.merge(self.stored)
|
783
|
+
stored = (
|
784
|
+
orm.query(Participant)
|
785
|
+
.filter_by(contact=c.stored, room=self.stored)
|
786
|
+
.one_or_none()
|
787
|
+
)
|
788
|
+
if stored is not None:
|
789
|
+
return self.participant_from_store(stored=stored, contact=c)
|
791
790
|
|
792
791
|
nickname = c.name or unescape_node(c.jid.node)
|
793
792
|
|
slidge/main.py
CHANGED
@@ -166,10 +166,12 @@ def main(module_name: str | None = None) -> None:
|
|
166
166
|
f"_{config.LEGACY_MODULE.split('.')[-1].upper()}_"
|
167
167
|
)
|
168
168
|
logging.debug("Env var prefix: %s", ConfigModule.ENV_VAR_PREFIX)
|
169
|
-
ConfigModule(plugin_config_obj).set_conf(unknown_argv)
|
170
|
-
|
171
|
-
|
172
|
-
|
169
|
+
_, unknown_argv = ConfigModule(plugin_config_obj).set_conf(unknown_argv)
|
170
|
+
|
171
|
+
if unknown_argv:
|
172
|
+
logging.error(
|
173
|
+
f"These config options have not been recognized and ignored: {unknown_argv}"
|
174
|
+
)
|
173
175
|
|
174
176
|
migrate()
|
175
177
|
|
slidge/migration.py
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
import logging
|
2
2
|
import shutil
|
3
3
|
import sys
|
4
|
+
import traceback
|
4
5
|
from pathlib import Path
|
5
6
|
|
6
7
|
from alembic import command
|
7
8
|
from alembic.config import Config
|
8
|
-
from slixmpp import JID
|
9
9
|
|
10
10
|
from .core import config
|
11
|
-
from .db.meta import get_engine
|
12
|
-
from .db.models import GatewayUser
|
13
|
-
from .db.store import SlidgeStore
|
14
11
|
|
15
12
|
|
16
13
|
def remove_avatar_cache_v1() -> None:
|
@@ -32,7 +29,15 @@ def get_alembic_cfg() -> Config:
|
|
32
29
|
|
33
30
|
def migrate() -> None:
|
34
31
|
remove_avatar_cache_v1()
|
35
|
-
|
32
|
+
try:
|
33
|
+
command.upgrade(get_alembic_cfg(), "head")
|
34
|
+
except Exception as e:
|
35
|
+
traceback.print_exception(e)
|
36
|
+
print(
|
37
|
+
"Something went wrong during the migration. "
|
38
|
+
"This is expected if you upgrade from slidge 0.2, in this case you need to start from a fresh database."
|
39
|
+
)
|
40
|
+
exit(1)
|
36
41
|
|
37
42
|
|
38
43
|
def main() -> None:
|
@@ -41,6 +46,10 @@ def main() -> None:
|
|
41
46
|
|
42
47
|
Usage: python -m slidge.migration "Revision message blah blah blah"
|
43
48
|
"""
|
49
|
+
dev_db = Path(".") / "dev" / "slidge.sqlite"
|
50
|
+
if dev_db.exists():
|
51
|
+
# always start from a clean state
|
52
|
+
dev_db.unlink()
|
44
53
|
alembic_cfg = get_alembic_cfg()
|
45
54
|
command.upgrade(alembic_cfg, "head")
|
46
55
|
command.revision(alembic_cfg, sys.argv[1], autogenerate=True)
|
slidge/util/conf.py
CHANGED
@@ -159,7 +159,10 @@ class ConfigModule:
|
|
159
159
|
upper = _argv_to_option_name(a)
|
160
160
|
opt = options_long.get(upper)
|
161
161
|
if opt and opt.type is bool:
|
162
|
-
if
|
162
|
+
if (
|
163
|
+
not aa.startswith("-")
|
164
|
+
and _argv_to_option_name(aa) not in options_long
|
165
|
+
):
|
163
166
|
log.debug("Removing %s from argv", aa)
|
164
167
|
skip_next = True
|
165
168
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
slidge/__init__.py,sha256=OWGOMz8wl6I6XNUT9ipE9IFD-OinS8zQGGn4U_z3IWw,1835
|
2
2
|
slidge/__main__.py,sha256=ydjUklOoavS4YlGfjRX_8BQN2DaSbaXPMi47RkOgcFI,37
|
3
|
-
slidge/main.py,sha256=
|
4
|
-
slidge/migration.py,sha256=
|
3
|
+
slidge/main.py,sha256=bUdAau6TorsPpDRBPfzvUolHlXF5K-BY9aJdSmNUcyw,7109
|
4
|
+
slidge/migration.py,sha256=Y_PJ9ahHwcgwP1gnGByIiUJSxTu2DYFpmNiPdOpVgoQ,1545
|
5
5
|
slidge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
6
|
slidge/command/__init__.py,sha256=UYf1mjCYbZ5G7PIgaFTWSQRAzEJkQ6dTH8Fu_e_XnO0,613
|
7
7
|
slidge/command/adhoc.py,sha256=NCHammJdl30eHniiYukYQZKp1IeI-5qv5u9NncLNSNM,10760
|
@@ -12,17 +12,17 @@ slidge/command/chat_command.py,sha256=r_qalygOCsEoS-OgWw8IIlAzTufhXNjduONbeoepUI
|
|
12
12
|
slidge/command/register.py,sha256=BduDI31Kx8CbWWEdjybimTA5Wcfhn-Jkt8sSPsySCpo,6724
|
13
13
|
slidge/command/user.py,sha256=VS7xuADXXes941OyiJbxC_C8d5hcqm-TSS4Gu82_8PQ,12173
|
14
14
|
slidge/contact/__init__.py,sha256=WMMaHk7UW7YT9EH2LtPdkU0bHQaOp4ikBhbBQskmoc8,191
|
15
|
-
slidge/contact/contact.py,sha256=
|
16
|
-
slidge/contact/roster.py,sha256=
|
15
|
+
slidge/contact/contact.py,sha256=AZSpBInijGXn5hP_eJQhdyCOcUnzM62h65ZliyFZWhg,19497
|
16
|
+
slidge/contact/roster.py,sha256=uZ3iCl8oa7kEpIptUVa9p1k51bSvbuQq1pUGnf_zru8,9791
|
17
17
|
slidge/core/__init__.py,sha256=RG7Jj5JCJERjhqJ31lOLYV-7bH_oblClQD1KF9LsTXo,68
|
18
18
|
slidge/core/config.py,sha256=1HxHQ5BOnYghi8V5KbCQ6sUsNnXzAZAIoFA5PrMqH4E,6060
|
19
|
-
slidge/core/gateway.py,sha256=
|
19
|
+
slidge/core/gateway.py,sha256=0nuWlig6K4urNowoEKCVkSvEVH46BhR70A52fH6O4AE,40956
|
20
20
|
slidge/core/pubsub.py,sha256=-YK49tEdz_SLM3O8Y9zvu3p5KYhxgNpqbsD57rOIdNI,12141
|
21
|
-
slidge/core/session.py,sha256=
|
21
|
+
slidge/core/session.py,sha256=Rji81tCEVI5zpKtKpMIuclKvDR0XuHZRki8ivIhtNnQ,29500
|
22
22
|
slidge/core/dispatcher/__init__.py,sha256=1EXcjXietUKlxEqdrCWCV3xZ3q_DSsjHoqWrPMbtYao,84
|
23
23
|
slidge/core/dispatcher/caps.py,sha256=gISaHtFwFDXtkSrSsAkZfPiHQyXfmXg3v_YYU0w9iDg,2254
|
24
24
|
slidge/core/dispatcher/disco.py,sha256=xVPyBFnnkON-JjjM1oydRa-dqnDbwAZER2MGQACRhVk,2309
|
25
|
-
slidge/core/dispatcher/presence.py,sha256=
|
25
|
+
slidge/core/dispatcher/presence.py,sha256=rxL2tDlH7a1NxfN_URDNFCHnjG_e-4Ke5UWMh8zXeOo,6928
|
26
26
|
slidge/core/dispatcher/registration.py,sha256=Qa3fYZFJ4NaVz-FsnXorCmMQ9WyO7oZte1Zvro5f74E,3415
|
27
27
|
slidge/core/dispatcher/search.py,sha256=bL5cwMOtsfnX5IH-t60S1PudpeMWZnF4-qksrKDuDyc,3411
|
28
28
|
slidge/core/dispatcher/session_dispatcher.py,sha256=ysgPhns7NgUxhmkgEwRv-yDkSnUIXEdc-FsgqDqQAkE,3466
|
@@ -31,7 +31,7 @@ slidge/core/dispatcher/vcard.py,sha256=qHZZShq3Iyvgh1FkcAgGhdKXF5m1VUqeb4EWkY0cb
|
|
31
31
|
slidge/core/dispatcher/message/__init__.py,sha256=gNeZZ0wtCI9JBqMe6tpumwV1TjY0mnPWTJc94uFTN-I,244
|
32
32
|
slidge/core/dispatcher/message/chat_state.py,sha256=RbtM_nlZyvOHusZkDEP0TXA4wMp_N435490eE4wW8U0,2143
|
33
33
|
slidge/core/dispatcher/message/marker.py,sha256=WZyf72_SM6sDGPMEOzhu93o2KbgxSxNF25jwsiM7h2A,2439
|
34
|
-
slidge/core/dispatcher/message/message.py,sha256=
|
34
|
+
slidge/core/dispatcher/message/message.py,sha256=RK1sX4cBSvPZLiUGYoT-pdCB01ll1761Ryr7Tu0AuBc,16202
|
35
35
|
slidge/core/dispatcher/muc/__init__.py,sha256=60YUr0i8PCZEPyNNTynJueRbbxF5pqzdyVf8z_XFXmM,290
|
36
36
|
slidge/core/dispatcher/muc/admin.py,sha256=1tDZ9hHD6q5SqCjsYOpDimPB3Iyl21YO5RnK1goEGso,3284
|
37
37
|
slidge/core/dispatcher/muc/mam.py,sha256=7vfmMI_mJOIrc9KCbtTibJSowhZTBBFwXWc84Ikpu3I,2994
|
@@ -39,8 +39,8 @@ slidge/core/dispatcher/muc/misc.py,sha256=FYo5FdmzksEuUCfCLLOOm8_8plXtZFQP8IzvzV
|
|
39
39
|
slidge/core/dispatcher/muc/owner.py,sha256=dDAxpRaA8H_NJQNIyBNixck2oG4GHZeEQqPhKd7MmDQ,3359
|
40
40
|
slidge/core/dispatcher/muc/ping.py,sha256=EgKKS9AvMnW-vINGcoGbtk6NdbN9A7zVaGfT5T7F6YE,1699
|
41
41
|
slidge/core/mixins/__init__.py,sha256=Zea39CCwjJU5XfHwcYPEZ9Sin8z1BZxoV68G2RwC3nE,386
|
42
|
-
slidge/core/mixins/attachment.py,sha256=
|
43
|
-
slidge/core/mixins/avatar.py,sha256=
|
42
|
+
slidge/core/mixins/attachment.py,sha256=f_8SZGyEAK00fzpwUWyIocPzdkSl5awPihR6_GCgdDo,21766
|
43
|
+
slidge/core/mixins/avatar.py,sha256=0E0mQxdTUcJQrYXlBkYqkNl4bYuga4cIC1s4XA2rED8,5559
|
44
44
|
slidge/core/mixins/base.py,sha256=MOd-pas38_52VawQVlxWtBtmTKC6My9G0ZaCeQxOJbs,748
|
45
45
|
slidge/core/mixins/db.py,sha256=a6idm-FgHWfDK-MJZWy5AkkBlyY8JmwOB8xAFmm0E9g,1934
|
46
46
|
slidge/core/mixins/disco.py,sha256=jk3Z1B6zTuisHv8VKNRJodIo0ee5btYHh2ZrlflPj_Q,3670
|
@@ -57,35 +57,12 @@ slidge/db/store.py,sha256=shgBqGutbAeMD6T3sqH7Qo4IKs9TWwjwfH5-NDpj-kY,19399
|
|
57
57
|
slidge/db/alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
58
58
|
slidge/db/alembic/env.py,sha256=hsBlRNs0zF5diSHGRSa8Fi3qRVQDA2rJdR41AEIdvxc,1642
|
59
59
|
slidge/db/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
60
|
-
slidge/db/alembic/versions/
|
61
|
-
slidge/db/alembic/versions/04cf35e3cf85_add_participant_nickname_no_illegal.py,sha256=Dwz_azOXr7Tsw7Wnj0L8mknITIPXO9ewEsRn169EUNA,904
|
62
|
-
slidge/db/alembic/versions/09f27f098baa_add_missing_attributes_in_room.py,sha256=mUL-0Io6ZPd_QbnKfwGYyjdMcM2uxQ0Wg72H23-2t_E,1033
|
63
|
-
slidge/db/alembic/versions/15b0bd83407a_remove_bogus_unique_constraints_on_room_.py,sha256=kzHuHGhzey5CY0p_OsKf5a-3zSk2649wqg2ToLiSD1I,2927
|
64
|
-
slidge/db/alembic/versions/2461390c0af2_store_contacts_caps_verstring_in_db.py,sha256=CLB-kOP9Rc0FJIKDLef912L5sYkjpTIPC8fhrIdrC7k,1084
|
65
|
-
slidge/db/alembic/versions/29f5280c61aa_store_subject_setter_in_room.py,sha256=f8TFS28CXjGhvIn41UYMoHYeODfqhKfo4O7gk-JwA1E,1134
|
66
|
-
slidge/db/alembic/versions/2b1f45ab7379_store_room_subject_setter_by_nickname.py,sha256=CMVP2wFz6s7t57eWdSaGtck8BXzfVPJhHE5AoWi34tI,1359
|
67
|
-
slidge/db/alembic/versions/3071e0fa69d4_add_contact_client_type.py,sha256=jCdwCOnX9VDgnqIFFHGKaPA7w87Hm9nvR1rMY0LrA30,1394
|
68
|
-
slidge/db/alembic/versions/3231d2c623bc_add_unique_contraint_for_attachment_.py,sha256=eWO-j092aqrcYxUQwAGXNY7OMpgGi-a9zlg3Q9IB-Hk,926
|
69
|
-
slidge/db/alembic/versions/45c24cc73c91_add_bob.py,sha256=UjMySZ5LaInyPt0KbAxx0rF4GQhZh8CwBeqHtNPdG1c,1249
|
70
|
-
slidge/db/alembic/versions/4dbd23a3f868_new_avatar_store.py,sha256=JhT83RJfXlKu2y8iB4twtuINGfa9YKNh6jURXVedHOc,4002
|
71
|
-
slidge/db/alembic/versions/54ce3cde350c_use_hash_for_avatar_filenames.py,sha256=aNwlpXCHI_TEnVt2w-C8OrdH02-FhgrKbZkEqt40ay4,1495
|
72
|
-
slidge/db/alembic/versions/58b98dacf819_refactor.py,sha256=bQG57V7b0UK6of4MdDpoBNDtPQH5AYHqAkt3RL9OmaI,5001
|
73
|
-
slidge/db/alembic/versions/5bd48bfdffa2_lift_room_legacy_id_constraint.py,sha256=m3USa76h0O2Xut-NePXIOZfkXl0bx0d5FyjOYpd34Jo,1977
|
74
|
-
slidge/db/alembic/versions/75a62b74b239_ditch_hats_table.py,sha256=INKDe7Y5iMETpyFmwMyQm-RrnGjP9gbcC_pWKuXoi2I,2388
|
75
|
-
slidge/db/alembic/versions/82a4af84b679_add_muc_history_filled.py,sha256=g37po0ydp8ZmzJrE5oFV7GscnploxjCtPDpw28SqVGk,1429
|
76
|
-
slidge/db/alembic/versions/8b993243a536_add_vcard_content_to_contact_table.py,sha256=18tG8B03Kq8Qz_-mMd28Beed6jow8XNTtrz7gT5QY3g,1210
|
77
|
-
slidge/db/alembic/versions/8d2ced764698_rely_on_db_to_store_contacts_rooms_and_.py,sha256=ikoAlRV3_BJcDcFRANF-9HTB--0xpY0C5XdGuMuW9c0,4866
|
78
|
-
slidge/db/alembic/versions/aa9d82a7f6ef_db_creation.py,sha256=eFlfn-LiDph05yyCc8gmtJwVKzgrSHwyWJ6nuVfEpQA,1391
|
79
|
-
slidge/db/alembic/versions/abba1ae0edb3_store_avatar_legacy_id_in_the_contact_.py,sha256=VprqEVHipYuM-ea-CIM4_ubOD5zJ9inLTbhXc869n3A,2779
|
80
|
-
slidge/db/alembic/versions/b33993e87db3_move_everything_to_persistent_db.py,sha256=2tiRxoC9PYOQn6XQrwK0JTEsb45Pzp2PsKoZSS4rcIA,7564
|
81
|
-
slidge/db/alembic/versions/b64b1a793483_add_source_and_legacy_id_for_archived_.py,sha256=r2sOgR5HcfueJyc3cWNDRmlZzdHOSX6nl2gef54wDbk,1559
|
82
|
-
slidge/db/alembic/versions/c4a8ec35a0e8_per_room_user_nick.py,sha256=jjQmlRv6nqdm5q6LbwVpSUSkTBj1c76Hiq8e8q77q3g,933
|
83
|
-
slidge/db/alembic/versions/e91195719c2c_store_users_avatars_persistently.py,sha256=8Ga3VFgKrzMs_-B8OPtfP-0rey_MFaDg-QGtSbaft3o,640
|
60
|
+
slidge/db/alembic/versions/cef02a8b1451_initial_schema.py,sha256=D1K-flfTM9Vkk0YFzg6HbmoDyEb2u5c751aXk2YzVVg,14881
|
84
61
|
slidge/group/__init__.py,sha256=yFt7cHqeaKIMN6f9ZyhhspOcJJvBtLedGv-iICG7lto,258
|
85
62
|
slidge/group/archive.py,sha256=DKwyde15-Op2rXuQBvdSmFcAKhUyWuorpEFcRSmDHec,5956
|
86
63
|
slidge/group/bookmarks.py,sha256=UWrUjZMWlDmwKFRuNEqxZSx4cvXFib4AP_l388ApJa8,7086
|
87
|
-
slidge/group/participant.py,sha256=
|
88
|
-
slidge/group/room.py,sha256=
|
64
|
+
slidge/group/participant.py,sha256=eMwUgbEtxGjWMmIqUfS8uSKlaStitZ3D68M_RixQeso,17676
|
65
|
+
slidge/group/room.py,sha256=_KP0jIh9f9k0yDRWCe7BsZBQesfm1lwbHpN9WYRKuzc,48391
|
89
66
|
slidge/slixfix/__init__.py,sha256=LvaYZQYjr4l_45AYYpod1dB3MUaZye18vKF-4H8Bm20,4758
|
90
67
|
slidge/slixfix/delivery_receipt.py,sha256=JmogxsiXYEbTmCM4fvC5wkQs0jBsaJtKl4j_B_18riE,1415
|
91
68
|
slidge/slixfix/roster.py,sha256=DjjHQqCsKsPChUxV7S0Pm4IAgjfrwgm5tcTdJi3N_gY,1670
|
@@ -104,15 +81,15 @@ slidge/slixfix/xep_0292/__init__.py,sha256=_MvS9wGra6ig3P_dPAVlCPDJkiOFvUWGjaRsH
|
|
104
81
|
slidge/slixfix/xep_0292/vcard4.py,sha256=I6EXdTQ51nfF5qvKh7WMAluELbFsdtnYHrsV_8PrjK4,366
|
105
82
|
slidge/util/__init__.py,sha256=BELovoTMPcPPGz3D48esBr8A4BRRHXTvavfgnArBgEc,301
|
106
83
|
slidge/util/archive_msg.py,sha256=hGNquu38ouSWSc-kz_oAYPXwjhUVZNSedIpwkrXHSd0,1826
|
107
|
-
slidge/util/conf.py,sha256=
|
84
|
+
slidge/util/conf.py,sha256=Wv-xr1fQfz6jDCBpj2e5Nm-igMpdIjsYsVfoY8grJoo,7380
|
108
85
|
slidge/util/jid_escaping.py,sha256=QJ2Yj_j1gTmiO9g2r187iVCu7kia_O5ABhRiLAO2TG4,1073
|
109
86
|
slidge/util/lock.py,sha256=ZnUi3LGiz271-YeYKo9JzxovJCoSwlP9P65pNyHIO9o,1029
|
110
87
|
slidge/util/test.py,sha256=_E6er2BtQlpyzTUmp4u8C9KhBYzbLrmTwSVgxGObKHU,13988
|
111
88
|
slidge/util/types.py,sha256=xJ84ZvaUOU_VVJSjEMysgNSl05k0_O9YKbyW-JUrsMI,5635
|
112
89
|
slidge/util/util.py,sha256=4hihLCl4SsB5S14TT3bP8tDPP_Zg9rYbSfLdLB9-G_Q,9332
|
113
|
-
slidge-0.3.
|
114
|
-
slidge-0.3.
|
115
|
-
slidge-0.3.
|
116
|
-
slidge-0.3.
|
117
|
-
slidge-0.3.
|
118
|
-
slidge-0.3.
|
90
|
+
slidge-0.3.0b2.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
91
|
+
slidge-0.3.0b2.dist-info/METADATA,sha256=_O_tp1b_KiJA94aoQQG0e0Nbg37mt-P7BFJY6Gn0xcg,5056
|
92
|
+
slidge-0.3.0b2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
93
|
+
slidge-0.3.0b2.dist-info/entry_points.txt,sha256=py3_x834fFJ2TEzPd18Wt2DnysdAfuVqJ5zzBrXbAZs,44
|
94
|
+
slidge-0.3.0b2.dist-info/top_level.txt,sha256=2LRjDYHaGZ5ieCMF8xy58JIiabRMzX-MGMbCZwfE17c,7
|
95
|
+
slidge-0.3.0b2.dist-info/RECORD,,
|
@@ -1,183 +0,0 @@
|
|
1
|
-
"""Unify legacy/XMPP id mappings
|
2
|
-
|
3
|
-
Revision ID: 0337c90c0b96
|
4
|
-
Revises: 58b98dacf819
|
5
|
-
Create Date: 2025-04-25 20:22:47.612652
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "0337c90c0b96"
|
16
|
-
down_revision: Union[str, None] = "58b98dacf819"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
op.create_table(
|
24
|
-
"direct_msg",
|
25
|
-
sa.Column("foreign_key", sa.Integer(), nullable=False),
|
26
|
-
sa.Column("id", sa.Integer(), nullable=False),
|
27
|
-
sa.Column("legacy_id", sa.String(), nullable=False),
|
28
|
-
sa.Column("xmpp_id", sa.String(), nullable=False),
|
29
|
-
sa.ForeignKeyConstraint(
|
30
|
-
["foreign_key"],
|
31
|
-
["contact.id"],
|
32
|
-
name=op.f("fk_direct_msg_foreign_key_contact"),
|
33
|
-
),
|
34
|
-
sa.PrimaryKeyConstraint("id", name=op.f("pk_direct_msg")),
|
35
|
-
)
|
36
|
-
with op.batch_alter_table("direct_msg", schema=None) as batch_op:
|
37
|
-
batch_op.create_index(
|
38
|
-
"ix_direct_msg_legacy_id", ["legacy_id", "foreign_key"], unique=False
|
39
|
-
)
|
40
|
-
|
41
|
-
op.create_table(
|
42
|
-
"direct_thread",
|
43
|
-
sa.Column("foreign_key", sa.Integer(), nullable=False),
|
44
|
-
sa.Column("id", sa.Integer(), nullable=False),
|
45
|
-
sa.Column("legacy_id", sa.String(), nullable=False),
|
46
|
-
sa.Column("xmpp_id", sa.String(), nullable=False),
|
47
|
-
sa.ForeignKeyConstraint(
|
48
|
-
["foreign_key"],
|
49
|
-
["contact.id"],
|
50
|
-
name=op.f("fk_direct_thread_foreign_key_contact"),
|
51
|
-
),
|
52
|
-
sa.PrimaryKeyConstraint("id", name=op.f("pk_direct_thread")),
|
53
|
-
)
|
54
|
-
with op.batch_alter_table("direct_thread", schema=None) as batch_op:
|
55
|
-
batch_op.create_index(
|
56
|
-
"ix_direct_direct_thread_id", ["legacy_id", "foreign_key"], unique=False
|
57
|
-
)
|
58
|
-
|
59
|
-
op.create_table(
|
60
|
-
"group_msg",
|
61
|
-
sa.Column("foreign_key", sa.Integer(), nullable=False),
|
62
|
-
sa.Column("id", sa.Integer(), nullable=False),
|
63
|
-
sa.Column("legacy_id", sa.String(), nullable=False),
|
64
|
-
sa.Column("xmpp_id", sa.String(), nullable=False),
|
65
|
-
sa.ForeignKeyConstraint(
|
66
|
-
["foreign_key"], ["room.id"], name=op.f("fk_group_msg_foreign_key_room")
|
67
|
-
),
|
68
|
-
sa.PrimaryKeyConstraint("id", name=op.f("pk_group_msg")),
|
69
|
-
)
|
70
|
-
with op.batch_alter_table("group_msg", schema=None) as batch_op:
|
71
|
-
batch_op.create_index(
|
72
|
-
"ix_group_msg_legacy_id", ["legacy_id", "foreign_key"], unique=False
|
73
|
-
)
|
74
|
-
|
75
|
-
op.create_table(
|
76
|
-
"group_thread",
|
77
|
-
sa.Column("foreign_key", sa.Integer(), nullable=False),
|
78
|
-
sa.Column("id", sa.Integer(), nullable=False),
|
79
|
-
sa.Column("legacy_id", sa.String(), nullable=False),
|
80
|
-
sa.Column("xmpp_id", sa.String(), nullable=False),
|
81
|
-
sa.ForeignKeyConstraint(
|
82
|
-
["foreign_key"], ["room.id"], name=op.f("fk_group_thread_foreign_key_room")
|
83
|
-
),
|
84
|
-
sa.PrimaryKeyConstraint("id", name=op.f("pk_group_thread")),
|
85
|
-
)
|
86
|
-
with op.batch_alter_table("group_thread", schema=None) as batch_op:
|
87
|
-
batch_op.create_index(
|
88
|
-
"ix_direct_group_thread_id", ["legacy_id", "foreign_key"], unique=False
|
89
|
-
)
|
90
|
-
|
91
|
-
with op.batch_alter_table("xmpp_ids_multi", schema=None) as batch_op:
|
92
|
-
batch_op.drop_index("legacy_ids_multi_user_account_id_xmpp_id")
|
93
|
-
|
94
|
-
op.drop_table("xmpp_ids_multi")
|
95
|
-
with op.batch_alter_table("xmpp_to_legacy_ids", schema=None) as batch_op:
|
96
|
-
batch_op.drop_index("xmpp_legacy")
|
97
|
-
|
98
|
-
op.drop_table("xmpp_to_legacy_ids")
|
99
|
-
with op.batch_alter_table("legacy_ids_multi", schema=None) as batch_op:
|
100
|
-
batch_op.drop_index("legacy_ids_multi_user_account_id_legacy_id")
|
101
|
-
|
102
|
-
op.drop_table("legacy_ids_multi")
|
103
|
-
# ### end Alembic commands ###
|
104
|
-
|
105
|
-
|
106
|
-
def downgrade() -> None:
|
107
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
108
|
-
op.create_table(
|
109
|
-
"legacy_ids_multi",
|
110
|
-
sa.Column("id", sa.INTEGER(), nullable=False),
|
111
|
-
sa.Column("user_account_id", sa.INTEGER(), nullable=False),
|
112
|
-
sa.Column("legacy_id", sa.VARCHAR(), nullable=False),
|
113
|
-
sa.ForeignKeyConstraint(
|
114
|
-
["user_account_id"],
|
115
|
-
["user_account.id"],
|
116
|
-
),
|
117
|
-
sa.PrimaryKeyConstraint("id"),
|
118
|
-
)
|
119
|
-
with op.batch_alter_table("legacy_ids_multi", schema=None) as batch_op:
|
120
|
-
batch_op.create_index(
|
121
|
-
"legacy_ids_multi_user_account_id_legacy_id",
|
122
|
-
["user_account_id", "legacy_id"],
|
123
|
-
unique=1,
|
124
|
-
)
|
125
|
-
|
126
|
-
op.create_table(
|
127
|
-
"xmpp_to_legacy_ids",
|
128
|
-
sa.Column("id", sa.INTEGER(), nullable=False),
|
129
|
-
sa.Column("user_account_id", sa.INTEGER(), nullable=False),
|
130
|
-
sa.Column("xmpp_id", sa.VARCHAR(), nullable=False),
|
131
|
-
sa.Column("legacy_id", sa.VARCHAR(), nullable=False),
|
132
|
-
sa.Column("type", sa.VARCHAR(length=10), nullable=False),
|
133
|
-
sa.ForeignKeyConstraint(
|
134
|
-
["user_account_id"],
|
135
|
-
["user_account.id"],
|
136
|
-
),
|
137
|
-
sa.PrimaryKeyConstraint("id"),
|
138
|
-
)
|
139
|
-
with op.batch_alter_table("xmpp_to_legacy_ids", schema=None) as batch_op:
|
140
|
-
batch_op.create_index(
|
141
|
-
"xmpp_legacy", ["user_account_id", "xmpp_id", "legacy_id"], unique=1
|
142
|
-
)
|
143
|
-
|
144
|
-
op.create_table(
|
145
|
-
"xmpp_ids_multi",
|
146
|
-
sa.Column("id", sa.INTEGER(), nullable=False),
|
147
|
-
sa.Column("user_account_id", sa.INTEGER(), nullable=False),
|
148
|
-
sa.Column("xmpp_id", sa.VARCHAR(), nullable=False),
|
149
|
-
sa.Column("legacy_ids_multi_id", sa.INTEGER(), nullable=False),
|
150
|
-
sa.ForeignKeyConstraint(
|
151
|
-
["legacy_ids_multi_id"],
|
152
|
-
["legacy_ids_multi.id"],
|
153
|
-
),
|
154
|
-
sa.ForeignKeyConstraint(
|
155
|
-
["user_account_id"],
|
156
|
-
["user_account.id"],
|
157
|
-
),
|
158
|
-
sa.PrimaryKeyConstraint("id"),
|
159
|
-
)
|
160
|
-
with op.batch_alter_table("xmpp_ids_multi", schema=None) as batch_op:
|
161
|
-
batch_op.create_index(
|
162
|
-
"legacy_ids_multi_user_account_id_xmpp_id",
|
163
|
-
["user_account_id", "xmpp_id"],
|
164
|
-
unique=1,
|
165
|
-
)
|
166
|
-
|
167
|
-
with op.batch_alter_table("group_thread", schema=None) as batch_op:
|
168
|
-
batch_op.drop_index("ix_direct_group_thread_id")
|
169
|
-
|
170
|
-
op.drop_table("group_thread")
|
171
|
-
with op.batch_alter_table("group_msg", schema=None) as batch_op:
|
172
|
-
batch_op.drop_index("ix_group_msg_legacy_id")
|
173
|
-
|
174
|
-
op.drop_table("group_msg")
|
175
|
-
with op.batch_alter_table("direct_thread", schema=None) as batch_op:
|
176
|
-
batch_op.drop_index("ix_direct_direct_thread_id")
|
177
|
-
|
178
|
-
op.drop_table("direct_thread")
|
179
|
-
with op.batch_alter_table("direct_msg", schema=None) as batch_op:
|
180
|
-
batch_op.drop_index("ix_direct_msg_legacy_id")
|
181
|
-
|
182
|
-
op.drop_table("direct_msg")
|
183
|
-
# ### end Alembic commands ###
|
@@ -1,33 +0,0 @@
|
|
1
|
-
"""Add Participant.nickname_no_illegal
|
2
|
-
|
3
|
-
Revision ID: 04cf35e3cf85
|
4
|
-
Revises: 15b0bd83407a
|
5
|
-
Create Date: 2025-02-22 06:57:45.491326
|
6
|
-
|
7
|
-
"""
|
8
|
-
|
9
|
-
from typing import Sequence, Union
|
10
|
-
|
11
|
-
import sqlalchemy as sa
|
12
|
-
from alembic import op
|
13
|
-
|
14
|
-
# revision identifiers, used by Alembic.
|
15
|
-
revision: str = "04cf35e3cf85"
|
16
|
-
down_revision: Union[str, None] = "15b0bd83407a"
|
17
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
-
depends_on: Union[str, Sequence[str], None] = None
|
19
|
-
|
20
|
-
|
21
|
-
def upgrade() -> None:
|
22
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
23
|
-
with op.batch_alter_table("participant", schema=None) as batch_op:
|
24
|
-
batch_op.add_column(
|
25
|
-
sa.Column("nickname_no_illegal", sa.String(), nullable=True)
|
26
|
-
)
|
27
|
-
|
28
|
-
# ### end Alembic commands ###
|
29
|
-
|
30
|
-
|
31
|
-
def downgrade() -> None:
|
32
|
-
with op.batch_alter_table("participant", schema=None) as batch_op:
|
33
|
-
batch_op.drop_column("nickname_no_illegal")
|
@@ -1,36 +0,0 @@
|
|
1
|
-
"""Add n_participants attributes to Room
|
2
|
-
|
3
|
-
Should have been part of another commit, but I messed up some rebase
|
4
|
-
|
5
|
-
Revision ID: 09f27f098baa
|
6
|
-
Revises: 29f5280c61aa
|
7
|
-
Create Date: 2024-07-11 10:54:21.155871
|
8
|
-
|
9
|
-
"""
|
10
|
-
|
11
|
-
from typing import Sequence, Union
|
12
|
-
|
13
|
-
import sqlalchemy as sa
|
14
|
-
from alembic import op
|
15
|
-
|
16
|
-
# revision identifiers, used by Alembic.
|
17
|
-
revision: str = "09f27f098baa"
|
18
|
-
down_revision: Union[str, None] = "29f5280c61aa"
|
19
|
-
branch_labels: Union[str, Sequence[str], None] = None
|
20
|
-
depends_on: Union[str, Sequence[str], None] = None
|
21
|
-
|
22
|
-
|
23
|
-
def upgrade() -> None:
|
24
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
25
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
26
|
-
batch_op.add_column(sa.Column("n_participants", sa.Integer(), nullable=True))
|
27
|
-
|
28
|
-
# ### end Alembic commands ###
|
29
|
-
|
30
|
-
|
31
|
-
def downgrade() -> None:
|
32
|
-
# ### commands auto generated by Alembic - please adjust! ###
|
33
|
-
with op.batch_alter_table("room", schema=None) as batch_op:
|
34
|
-
batch_op.drop_column("n_participants")
|
35
|
-
|
36
|
-
# ### end Alembic commands ###
|