slidge 0.1.3__py3-none-any.whl → 0.2.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- slidge/__init__.py +3 -5
- slidge/__main__.py +2 -197
- slidge/__version__.py +5 -0
- slidge/command/adhoc.py +40 -17
- slidge/command/admin.py +24 -12
- slidge/command/base.py +10 -8
- slidge/command/categories.py +13 -3
- slidge/command/chat_command.py +29 -2
- slidge/command/register.py +32 -16
- slidge/command/user.py +106 -13
- slidge/contact/contact.py +254 -50
- slidge/contact/roster.py +124 -53
- slidge/core/config.py +19 -13
- slidge/core/dispatcher/__init__.py +3 -0
- slidge/core/{gateway → dispatcher}/caps.py +12 -8
- slidge/core/{gateway → dispatcher}/disco.py +10 -18
- slidge/core/dispatcher/message/__init__.py +10 -0
- slidge/core/dispatcher/message/chat_state.py +40 -0
- slidge/core/dispatcher/message/marker.py +62 -0
- slidge/core/dispatcher/message/message.py +397 -0
- slidge/core/dispatcher/muc/__init__.py +12 -0
- slidge/core/dispatcher/muc/admin.py +98 -0
- slidge/core/{gateway → dispatcher/muc}/mam.py +25 -17
- slidge/core/dispatcher/muc/misc.py +121 -0
- slidge/core/dispatcher/muc/owner.py +96 -0
- slidge/core/{gateway → dispatcher/muc}/ping.py +11 -17
- slidge/core/dispatcher/presence.py +176 -0
- slidge/core/dispatcher/registration.py +85 -0
- slidge/core/{gateway → dispatcher}/search.py +9 -16
- slidge/core/dispatcher/session_dispatcher.py +84 -0
- slidge/core/dispatcher/util.py +174 -0
- slidge/core/{gateway/vcard_temp.py → dispatcher/vcard.py} +35 -19
- slidge/core/{gateway/base.py → gateway.py} +176 -153
- slidge/core/mixins/__init__.py +11 -1
- slidge/core/mixins/attachment.py +106 -67
- slidge/core/mixins/avatar.py +94 -25
- slidge/core/mixins/base.py +10 -4
- slidge/core/mixins/db.py +18 -0
- slidge/core/mixins/disco.py +0 -10
- slidge/core/mixins/lock.py +10 -8
- slidge/core/mixins/message.py +11 -195
- slidge/core/mixins/message_maker.py +17 -9
- slidge/core/mixins/message_text.py +211 -0
- slidge/core/mixins/presence.py +17 -4
- slidge/core/pubsub.py +114 -288
- slidge/core/session.py +101 -40
- slidge/db/__init__.py +4 -0
- slidge/db/alembic/__init__.py +0 -0
- slidge/db/alembic/env.py +64 -0
- slidge/db/alembic/old_user_store.py +183 -0
- slidge/db/alembic/script.py.mako +26 -0
- slidge/db/alembic/versions/09f27f098baa_add_missing_attributes_in_room.py +36 -0
- slidge/db/alembic/versions/15b0bd83407a_remove_bogus_unique_constraints_on_room_.py +85 -0
- slidge/db/alembic/versions/2461390c0af2_store_contacts_caps_verstring_in_db.py +36 -0
- slidge/db/alembic/versions/29f5280c61aa_store_subject_setter_in_room.py +37 -0
- slidge/db/alembic/versions/2b1f45ab7379_store_room_subject_setter_by_nickname.py +41 -0
- slidge/db/alembic/versions/3071e0fa69d4_add_contact_client_type.py +52 -0
- slidge/db/alembic/versions/45c24cc73c91_add_bob.py +42 -0
- slidge/db/alembic/versions/5bd48bfdffa2_lift_room_legacy_id_constraint.py +61 -0
- slidge/db/alembic/versions/82a4af84b679_add_muc_history_filled.py +48 -0
- slidge/db/alembic/versions/8b993243a536_add_vcard_content_to_contact_table.py +43 -0
- slidge/db/alembic/versions/8d2ced764698_rely_on_db_to_store_contacts_rooms_and_.py +139 -0
- slidge/db/alembic/versions/aa9d82a7f6ef_db_creation.py +101 -0
- slidge/db/alembic/versions/abba1ae0edb3_store_avatar_legacy_id_in_the_contact_.py +79 -0
- slidge/db/alembic/versions/b33993e87db3_move_everything_to_persistent_db.py +214 -0
- slidge/db/alembic/versions/b64b1a793483_add_source_and_legacy_id_for_archived_.py +52 -0
- slidge/db/alembic/versions/c4a8ec35a0e8_per_room_user_nick.py +34 -0
- slidge/db/alembic/versions/e91195719c2c_store_users_avatars_persistently.py +26 -0
- slidge/db/avatar.py +205 -0
- slidge/db/meta.py +72 -0
- slidge/db/models.py +405 -0
- slidge/db/store.py +1257 -0
- slidge/group/archive.py +58 -14
- slidge/group/bookmarks.py +89 -65
- slidge/group/participant.py +107 -40
- slidge/group/room.py +402 -213
- slidge/main.py +202 -0
- slidge/migration.py +45 -1
- slidge/slixfix/__init__.py +31 -1
- slidge/{core/gateway → slixfix}/delivery_receipt.py +1 -1
- slidge/slixfix/roster.py +13 -4
- slidge/slixfix/xep_0292/vcard4.py +1 -87
- slidge/util/archive_msg.py +2 -1
- slidge/util/db.py +4 -228
- slidge/util/test.py +91 -4
- slidge/util/types.py +39 -4
- slidge/util/util.py +45 -2
- {slidge-0.1.3.dist-info → slidge-0.2.0.dist-info}/METADATA +10 -5
- slidge-0.2.0.dist-info/RECORD +131 -0
- slidge-0.2.0.dist-info/entry_points.txt +3 -0
- slidge/core/cache.py +0 -183
- slidge/core/gateway/__init__.py +0 -3
- slidge/core/gateway/muc_admin.py +0 -35
- slidge/core/gateway/presence.py +0 -95
- slidge/core/gateway/registration.py +0 -53
- slidge/core/gateway/session_dispatcher.py +0 -804
- slidge/util/schema.sql +0 -126
- slidge/util/sql.py +0 -508
- slidge-0.1.3.dist-info/RECORD +0 -96
- slidge-0.1.3.dist-info/entry_points.txt +0 -3
- {slidge-0.1.3.dist-info → slidge-0.2.0.dist-info}/LICENSE +0 -0
- {slidge-0.1.3.dist-info → slidge-0.2.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,131 @@
|
|
1
|
+
slidge/__init__.py,sha256=S0tUjqpZlzsr8G4Y_1Xt-KCYB07qaknTB0OwHU8k29U,1587
|
2
|
+
slidge/__main__.py,sha256=ydjUklOoavS4YlGfjRX_8BQN2DaSbaXPMi47RkOgcFI,37
|
3
|
+
slidge/__version__.py,sha256=iJF5QDC1zHTgO_CiKY97xyDU4XokVblccJBkIkeypgo,164
|
4
|
+
slidge/command/__init__.py,sha256=UYf1mjCYbZ5G7PIgaFTWSQRAzEJkQ6dTH8Fu_e_XnO0,613
|
5
|
+
slidge/command/adhoc.py,sha256=-AO4h1N6owSuuqZon5tDL29O6qmEeAd1pcPjGCkzKRs,10065
|
6
|
+
slidge/command/admin.py,sha256=TYrzgCIhjcTIwl1IUaFlUd3D98SPyao10gB20zo8b3Q,6187
|
7
|
+
slidge/command/base.py,sha256=S_bKUJB0fnKs58PvjgFf15_6cw-8k2bMeSECTmFxQGQ,13155
|
8
|
+
slidge/command/categories.py,sha256=vF0KGDV9sEn8TNkcMoDRw-u3gEyNHSXghOU2JRHQtKs,351
|
9
|
+
slidge/command/chat_command.py,sha256=8_1mqXNLlcwzozbNhZAAYwxavG09rNR_o9G3TwY-lO8,10941
|
10
|
+
slidge/command/register.py,sha256=fzPcGUoJtainnDOiC13gWV-uYLuJcsmdKGJ-jXT1qIo,6697
|
11
|
+
slidge/command/user.py,sha256=0pt9k41npv7MRI_0vauuR1JPb7Gf7UE2lOQeL2XNd7U,12065
|
12
|
+
slidge/contact/__init__.py,sha256=WMMaHk7UW7YT9EH2LtPdkU0bHQaOp4ikBhbBQskmoc8,191
|
13
|
+
slidge/contact/contact.py,sha256=kKtJ9NPLS9DPVyyahx_K-Mtp5k5UQdQJZavC1XCmWlc,23104
|
14
|
+
slidge/contact/roster.py,sha256=-Ei0f0cXX1LFpY29u4Ik68ikno3m2WRA5n5l8Nbjd_E,10267
|
15
|
+
slidge/core/__init__.py,sha256=RG7Jj5JCJERjhqJ31lOLYV-7bH_oblClQD1KF9LsTXo,68
|
16
|
+
slidge/core/config.py,sha256=WP3-ScXqdAhJBX7IRB5pBi_tAV_vE6G5W3Z-LGGULQw,7691
|
17
|
+
slidge/core/dispatcher/__init__.py,sha256=1EXcjXietUKlxEqdrCWCV3xZ3q_DSsjHoqWrPMbtYao,84
|
18
|
+
slidge/core/dispatcher/caps.py,sha256=vzCAXo_bhALuLEpJWtyJTzVfWx96g1AsWD8_wkoDl0Y,2028
|
19
|
+
slidge/core/dispatcher/disco.py,sha256=j56VY9NIFzwPEWFKQQZ7YIqS9GdD-ZaF_K8a2L-JvRk,2006
|
20
|
+
slidge/core/dispatcher/message/__init__.py,sha256=vpDGOc_U9XvkUU_ws9n9-5M2NPJ87XGTVpuIxM7Z99k,223
|
21
|
+
slidge/core/dispatcher/message/chat_state.py,sha256=sCdEpzbgmvBmTovNOCv9uY6v0eJZcWVvDYAGlAV3FJ4,1735
|
22
|
+
slidge/core/dispatcher/message/marker.py,sha256=f1ezaMoHupBFZY7aUMsWLAQG7G1J9b3ihxICCkpGtis,2411
|
23
|
+
slidge/core/dispatcher/message/message.py,sha256=HwauW2kGionLyDWG01OSa9a14gYzoovJuJvGbfB4nt4,15296
|
24
|
+
slidge/core/dispatcher/muc/__init__.py,sha256=V8URHLJ_y7mk-7Id6FzRuczb1Uq_Z69fhxvzHuVLH1w,269
|
25
|
+
slidge/core/dispatcher/muc/admin.py,sha256=s21V2LEqc0e_DIpipEhhQdpae762lW1lVqj4wjFhX8M,3364
|
26
|
+
slidge/core/dispatcher/muc/mam.py,sha256=1ROVP4ZPEVEH-HR5qRV4YwHz-V15uu5gyhv1ZwwKhk8,2821
|
27
|
+
slidge/core/dispatcher/muc/misc.py,sha256=bHBjMC-Pu3jR5hAPGMzXf-C05UbACIwg38YbJUxHIxk,4068
|
28
|
+
slidge/core/dispatcher/muc/owner.py,sha256=1a6YV7b_mmi1jC6q1ko8weeL8imQA-s-hYGPLIHd10I,3308
|
29
|
+
slidge/core/dispatcher/muc/ping.py,sha256=lb1VQPhiUPZ19KhbofRXMVCcY6wwQ2w-asnqtANaAwA,1660
|
30
|
+
slidge/core/dispatcher/presence.py,sha256=062I98OR2-iJOwU_UT2DHMxK4YlEo6Sbot282ab_-zo,6419
|
31
|
+
slidge/core/dispatcher/registration.py,sha256=Xmbw9NF3LUppCOa3XzreopdKDitZnwl_5HE-kds74n8,3155
|
32
|
+
slidge/core/dispatcher/search.py,sha256=9cGj0wwvyYlP_Yk440Y12sgo4Y1p-JWUDSJP5Zxch0M,3296
|
33
|
+
slidge/core/dispatcher/session_dispatcher.py,sha256=_njTftgpUKKMP-hgAo99Hu0YrIa6E9OTzSYdiMW000w,2844
|
34
|
+
slidge/core/dispatcher/util.py,sha256=YtXyVxM3orE7aYWs-GbJumtLTI63OpaQY_t4FMTjoZo,5754
|
35
|
+
slidge/core/dispatcher/vcard.py,sha256=Rmx-wCz6Lps0mXCO48HppNQlS3GOgMuzuw9hZYBdlVU,5130
|
36
|
+
slidge/core/gateway.py,sha256=NhIgxZKPnOpwsx50OKgyZyk9nfU8ZlUSMddwIDIhFcw,36351
|
37
|
+
slidge/core/mixins/__init__.py,sha256=muReAzgvENgMvlfm0Fpe6BQFfm2EMjoDe9ZhGgo6Vig,627
|
38
|
+
slidge/core/mixins/attachment.py,sha256=qHtv2I1buTmPO1jwRIpq2rixq5XTAljeWYj2eMWSw2k,19623
|
39
|
+
slidge/core/mixins/avatar.py,sha256=kGIIZzLSNuxF9bIvt5Bv03_uT_pU5QV1kS7cRu6-GUA,7874
|
40
|
+
slidge/core/mixins/base.py,sha256=MOd-pas38_52VawQVlxWtBtmTKC6My9G0ZaCeQxOJbs,748
|
41
|
+
slidge/core/mixins/db.py,sha256=5Qpegd7D8e5TLXLLINYcf_DuVdN-7wNmsfztUuFYPcU,442
|
42
|
+
slidge/core/mixins/disco.py,sha256=jk3Z1B6zTuisHv8VKNRJodIo0ee5btYHh2ZrlflPj_Q,3670
|
43
|
+
slidge/core/mixins/lock.py,sha256=Vf1rrkbyNbSprr38WGfZiMgTB7AdbqH8ppFHY8N2yXE,975
|
44
|
+
slidge/core/mixins/message.py,sha256=FB3VoaT81xUNVnaBMSwNJoHfrVv4Iv2678yDQH-23Rw,7551
|
45
|
+
slidge/core/mixins/message_maker.py,sha256=TcCutHi0sIwL6beJNkN7XyR0aDIbA0xZyxd2Gc9ulG4,6022
|
46
|
+
slidge/core/mixins/message_text.py,sha256=pCY4tezEuwB2ZuUyUi72i4v9AJkxp_SWF1jrFsn94Ns,8096
|
47
|
+
slidge/core/mixins/presence.py,sha256=yywo6KAw8C7GaZSMrSMuioNfhW08MrnobHt8XbHd0q8,7891
|
48
|
+
slidge/core/mixins/recipient.py,sha256=U-YppozUO8pA94jmD3-qmhkykTebPNaOVWc3JDPC9w8,1302
|
49
|
+
slidge/core/pubsub.py,sha256=oTiS5KFQJAmsgkhOsvfvthT-LkuZGQSCrrUG0JskNkI,11907
|
50
|
+
slidge/core/session.py,sha256=nQexpCd1jlHOhQPnFI4ri-5odp3N2pU5HO4l7WFetZY,28148
|
51
|
+
slidge/db/__init__.py,sha256=EBDH1JSEhgqYcli2Bw11CRC749wJk8AOucgBzmhDSvU,105
|
52
|
+
slidge/db/alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
|
+
slidge/db/alembic/env.py,sha256=hsBlRNs0zF5diSHGRSa8Fi3qRVQDA2rJdR41AEIdvxc,1642
|
54
|
+
slidge/db/alembic/old_user_store.py,sha256=zFOv0JEWQQK0_TMRlU4Z0G5Mc9pxvEErLyOzXmRAe5Q,5209
|
55
|
+
slidge/db/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
56
|
+
slidge/db/alembic/versions/09f27f098baa_add_missing_attributes_in_room.py,sha256=mUL-0Io6ZPd_QbnKfwGYyjdMcM2uxQ0Wg72H23-2t_E,1033
|
57
|
+
slidge/db/alembic/versions/15b0bd83407a_remove_bogus_unique_constraints_on_room_.py,sha256=kzHuHGhzey5CY0p_OsKf5a-3zSk2649wqg2ToLiSD1I,2927
|
58
|
+
slidge/db/alembic/versions/2461390c0af2_store_contacts_caps_verstring_in_db.py,sha256=CLB-kOP9Rc0FJIKDLef912L5sYkjpTIPC8fhrIdrC7k,1084
|
59
|
+
slidge/db/alembic/versions/29f5280c61aa_store_subject_setter_in_room.py,sha256=f8TFS28CXjGhvIn41UYMoHYeODfqhKfo4O7gk-JwA1E,1134
|
60
|
+
slidge/db/alembic/versions/2b1f45ab7379_store_room_subject_setter_by_nickname.py,sha256=CMVP2wFz6s7t57eWdSaGtck8BXzfVPJhHE5AoWi34tI,1359
|
61
|
+
slidge/db/alembic/versions/3071e0fa69d4_add_contact_client_type.py,sha256=jCdwCOnX9VDgnqIFFHGKaPA7w87Hm9nvR1rMY0LrA30,1394
|
62
|
+
slidge/db/alembic/versions/45c24cc73c91_add_bob.py,sha256=UjMySZ5LaInyPt0KbAxx0rF4GQhZh8CwBeqHtNPdG1c,1249
|
63
|
+
slidge/db/alembic/versions/5bd48bfdffa2_lift_room_legacy_id_constraint.py,sha256=m3USa76h0O2Xut-NePXIOZfkXl0bx0d5FyjOYpd34Jo,1977
|
64
|
+
slidge/db/alembic/versions/82a4af84b679_add_muc_history_filled.py,sha256=g37po0ydp8ZmzJrE5oFV7GscnploxjCtPDpw28SqVGk,1429
|
65
|
+
slidge/db/alembic/versions/8b993243a536_add_vcard_content_to_contact_table.py,sha256=18tG8B03Kq8Qz_-mMd28Beed6jow8XNTtrz7gT5QY3g,1210
|
66
|
+
slidge/db/alembic/versions/8d2ced764698_rely_on_db_to_store_contacts_rooms_and_.py,sha256=ikoAlRV3_BJcDcFRANF-9HTB--0xpY0C5XdGuMuW9c0,4866
|
67
|
+
slidge/db/alembic/versions/aa9d82a7f6ef_db_creation.py,sha256=XFHaHjPMoxKxKRjNBnYHBzMtS6K38ENcsGzgzlyp60g,2649
|
68
|
+
slidge/db/alembic/versions/abba1ae0edb3_store_avatar_legacy_id_in_the_contact_.py,sha256=VprqEVHipYuM-ea-CIM4_ubOD5zJ9inLTbhXc869n3A,2779
|
69
|
+
slidge/db/alembic/versions/b33993e87db3_move_everything_to_persistent_db.py,sha256=2tiRxoC9PYOQn6XQrwK0JTEsb45Pzp2PsKoZSS4rcIA,7564
|
70
|
+
slidge/db/alembic/versions/b64b1a793483_add_source_and_legacy_id_for_archived_.py,sha256=r2sOgR5HcfueJyc3cWNDRmlZzdHOSX6nl2gef54wDbk,1559
|
71
|
+
slidge/db/alembic/versions/c4a8ec35a0e8_per_room_user_nick.py,sha256=jjQmlRv6nqdm5q6LbwVpSUSkTBj1c76Hiq8e8q77q3g,933
|
72
|
+
slidge/db/alembic/versions/e91195719c2c_store_users_avatars_persistently.py,sha256=8Ga3VFgKrzMs_-B8OPtfP-0rey_MFaDg-QGtSbaft3o,640
|
73
|
+
slidge/db/avatar.py,sha256=FfRt2Vu11ZKD9F3x1_drawvUd-TDE3mp7SE3BZ9hOOg,6467
|
74
|
+
slidge/db/meta.py,sha256=v1Jf-npZ28QwdGpsLQWLBHEbEP3-jnPrygRg05tJ_Iw,1831
|
75
|
+
slidge/db/models.py,sha256=HL9pv0y2YQzdn4bkewhJmWEctOPleJ4pu8EyUzm3Fzc,13859
|
76
|
+
slidge/db/store.py,sha256=KDQ0rp7h6FHgONTYBvucytE7n6Fhsgxgo0pgX18dsTA,46696
|
77
|
+
slidge/group/__init__.py,sha256=yFt7cHqeaKIMN6f9ZyhhspOcJJvBtLedGv-iICG7lto,258
|
78
|
+
slidge/group/archive.py,sha256=xGPkdSk8-BT6t6lNVo1FEwiFVAttoxCma8Tsyk5r8Kg,5279
|
79
|
+
slidge/group/bookmarks.py,sha256=AvFL34bEX6n3OP1Np309T5hrLK9GnjkjdyLJ3uiLZyc,6616
|
80
|
+
slidge/group/participant.py,sha256=Wtq03Ix55AxlK4pvYVIalLwmKklJiIAsZdeLADJNJgU,17138
|
81
|
+
slidge/group/room.py,sha256=IizSwUBoKLvcvLpDseHIW_2KAky38uWsSv-poJuCAF0,46019
|
82
|
+
slidge/main.py,sha256=8oND7xpR3eLw7b62fT61UhYlmNp_9gv3tNz2N3xR7-c,6232
|
83
|
+
slidge/migration.py,sha256=4BJmPIRB56_WIhRTqBFIIBXuvnhhBjjOMl4CE7jY6oc,1541
|
84
|
+
slidge/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
85
|
+
slidge/slixfix/__init__.py,sha256=A1481U6RCfcJUvKF_Lkek5VI5vKbI0cN12KgQ6rk8GE,2576
|
86
|
+
slidge/slixfix/delivery_receipt.py,sha256=3bWdZH3-X3CZJXmnI_TpjkTUUK-EY4Ktm78lW0-40fc,1366
|
87
|
+
slidge/slixfix/link_preview/__init__.py,sha256=TDPTSEH5FQxgGpQpQIde-D72AHg-6YVWG-tOj4KpKmU,290
|
88
|
+
slidge/slixfix/link_preview/link_preview.py,sha256=9PgdfnoyVMHnXS0w5OFp0wz3ku96Ck-HtRXbVUlDi1U,448
|
89
|
+
slidge/slixfix/link_preview/stanza.py,sha256=YAXoNw2MD0a3nzvldGKlvSemjUMbUEG23regzmj4Ntc,2664
|
90
|
+
slidge/slixfix/roster.py,sha256=KvDjh9q7pqaZf69H93okfib13cc95uVZUJ6rzpqmDaU,1704
|
91
|
+
slidge/slixfix/xep_0077/__init__.py,sha256=0lY1YXdgAsfrfxI_Woxaf1etHCJXe35Xtntq_icF6nA,325
|
92
|
+
slidge/slixfix/xep_0077/register.py,sha256=6nwTfHNL7Z9-1wUhpAF743TNbjQLCMP7Rflkdad8d60,10431
|
93
|
+
slidge/slixfix/xep_0077/stanza.py,sha256=Lngly7F1ChCkNKn7yl1QmN838fO-KqkAhkazxzDsz80,2410
|
94
|
+
slidge/slixfix/xep_0100/__init__.py,sha256=AtEXDQOrEWodkN3fgKR0W3Ezsz_Zza6cgO5ZaZS-JOo,107
|
95
|
+
slidge/slixfix/xep_0100/gateway.py,sha256=Fhxs2sUPnVRPa1o7RXCncnbBO2gjeZx3pbItug-8OiA,4501
|
96
|
+
slidge/slixfix/xep_0100/stanza.py,sha256=7vCzej9VFQupsTpGGl0cJWuGNH4I6oVcckBu_-fE55c,232
|
97
|
+
slidge/slixfix/xep_0153/__init__.py,sha256=wZCTLaVsXQn_wYEHA8YXdGCsspvj2rvq92iyi16W0xA,319
|
98
|
+
slidge/slixfix/xep_0153/stanza.py,sha256=qhVfxlJEKuYDuWnd_I_VT4TtJbpX2opN6kG8oxYrc3o,735
|
99
|
+
slidge/slixfix/xep_0153/vcard_avatar.py,sha256=mzaReW5c1OaeL39CeGvuzIkh3j-Z5mc2joLqn5cNc5Q,658
|
100
|
+
slidge/slixfix/xep_0264/__init__.py,sha256=c6g_y-PAwQJZ4ZLWcwXc6Q5xRPeXTvvvJH4ZKQpkj3o,109
|
101
|
+
slidge/slixfix/xep_0264/stanza.py,sha256=YvkI9rsGztkc9yOZBjf5PNKReW8aeGdF6MnrsfDckYs,864
|
102
|
+
slidge/slixfix/xep_0264/thumbnail.py,sha256=6ukgPCWJTFUnew4USB6hNtEk_ZcpWcFAvHr2r0T5znw,456
|
103
|
+
slidge/slixfix/xep_0292/__init__.py,sha256=_MvS9wGra6ig3P_dPAVlCPDJkiOFvUWGjaRsHj1woUg,98
|
104
|
+
slidge/slixfix/xep_0292/vcard4.py,sha256=jL-TOW3eG2QXLduSLNq03L8HoUNmvy8kTZI5ojvo6GE,358
|
105
|
+
slidge/slixfix/xep_0313/__init__.py,sha256=rpvXxN4Fi-ey4Ww39OEAXoiaeWs3XMqvzR64hA6j_x4,368
|
106
|
+
slidge/slixfix/xep_0313/mam.py,sha256=2USgMGgklnGXPcw_1F3482HxIyd41TLx0uit43_RthA,9211
|
107
|
+
slidge/slixfix/xep_0313/stanza.py,sha256=WriAx6XKiiyZTkoTw5RHcgu3ZYdkDd6hjQ0wHqDkXE0,10249
|
108
|
+
slidge/slixfix/xep_0317/__init__.py,sha256=KRMpj3n2TYTyXzlGHdGXzNbMEvbHxn7Qd1WxqRIkrhU,104
|
109
|
+
slidge/slixfix/xep_0317/hats.py,sha256=HAZ7y5DNehpdPVpNpgo1JxnG2GVhVSElLYdARiL9KJQ,290
|
110
|
+
slidge/slixfix/xep_0317/stanza.py,sha256=HYSJSUHqPNHmrpJsschb__qazfb2Jm3WUxLsrmPqC4I,659
|
111
|
+
slidge/slixfix/xep_0356_old/__init__.py,sha256=3jGWJX2m5gWgDCxcVqCsCCVPRTcfmU96yenwvAJtOKE,180
|
112
|
+
slidge/slixfix/xep_0356_old/privilege.py,sha256=kcJzFbzhOHtQMtzOJpvvwm1pghSpealWnqhC0zc8dGo,5338
|
113
|
+
slidge/slixfix/xep_0356_old/stanza.py,sha256=i7aqcaTg6PBhVwbHToLtlrwxBj7uO-M7VrYSyElyEKI,1229
|
114
|
+
slidge/slixfix/xep_0424/__init__.py,sha256=ngz0GBepiJs_cocaohkDRTiaB8mvaEwXoqQBv9Av9o8,284
|
115
|
+
slidge/slixfix/xep_0424/retraction.py,sha256=VmJQCj4umtjslnU1ydVOL6KquZnVvqgPTAyoE1KQKwE,2448
|
116
|
+
slidge/slixfix/xep_0424/stanza.py,sha256=mT8QzRX3YcyTqTSfaaWKxyhag1s1-iQy5QW9nH6cyU8,753
|
117
|
+
slidge/slixfix/xep_0490/__init__.py,sha256=Rhu_1h1P34LfIP_yr4JQ_PBHcuNBLDzLdJMnNmNJRrE,158
|
118
|
+
slidge/slixfix/xep_0490/mds.py,sha256=KaITeEzSWgpGyU7RP-iwipjSyCEdVMPiVIT5vHVK-RM,1527
|
119
|
+
slidge/slixfix/xep_0490/stanza.py,sha256=ztec_ipyhUFz_uWQYkS0Q6LlsNiSBBC5aZK-qSmhHXk,443
|
120
|
+
slidge/util/__init__.py,sha256=BELovoTMPcPPGz3D48esBr8A4BRRHXTvavfgnArBgEc,301
|
121
|
+
slidge/util/archive_msg.py,sha256=xXAR0BI5r3d6KKWjae9594izCOv6iI03z2WLuTecNw8,1724
|
122
|
+
slidge/util/conf.py,sha256=1j2OnOsCBar1tOObErhXR5RC3Vl3faliOZ1U8J3My58,6613
|
123
|
+
slidge/util/db.py,sha256=4LxZj8oBYgiSnyBUnF_ALjr0TblkfNQq_p28sCfkHMY,242
|
124
|
+
slidge/util/test.py,sha256=xnGXK0wvua49ncQm4linIfH24Ux6oCkm5A71k2V80zI,14007
|
125
|
+
slidge/util/types.py,sha256=R_xfS5mRL0XUJIoDpnaAkZlTOoLPerduXBFftaVwIAI,5489
|
126
|
+
slidge/util/util.py,sha256=An4BRIHktZGXnu4kCwaKYaSye_PlyuxEm_4SC9YvPhc,9594
|
127
|
+
slidge-0.2.0.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
128
|
+
slidge-0.2.0.dist-info/METADATA,sha256=onfCG5umAhWWSLS_nGynAYGiS2ODedaJ1z1Q9ftwQXA,5003
|
129
|
+
slidge-0.2.0.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
|
130
|
+
slidge-0.2.0.dist-info/entry_points.txt,sha256=btz6mbzx1X6fjFWAS_Bo5qNi8PtxUsDgunt-6r4JDHw,43
|
131
|
+
slidge-0.2.0.dist-info/RECORD,,
|
slidge/core/cache.py
DELETED
@@ -1,183 +0,0 @@
|
|
1
|
-
import asyncio
|
2
|
-
import hashlib
|
3
|
-
import io
|
4
|
-
import logging
|
5
|
-
import shelve
|
6
|
-
import uuid
|
7
|
-
from concurrent.futures import ThreadPoolExecutor
|
8
|
-
from dataclasses import dataclass
|
9
|
-
from http import HTTPStatus
|
10
|
-
from pathlib import Path
|
11
|
-
from typing import Optional
|
12
|
-
|
13
|
-
import aiohttp
|
14
|
-
from multidict import CIMultiDictProxy
|
15
|
-
from PIL import Image
|
16
|
-
from slixmpp import JID
|
17
|
-
|
18
|
-
from ..util.types import URL, LegacyFileIdType
|
19
|
-
from . import config
|
20
|
-
|
21
|
-
|
22
|
-
@dataclass
|
23
|
-
class CachedAvatar:
|
24
|
-
filename: str
|
25
|
-
hash: str
|
26
|
-
height: int
|
27
|
-
width: int
|
28
|
-
root: Path
|
29
|
-
etag: Optional[str] = None
|
30
|
-
last_modified: Optional[str] = None
|
31
|
-
|
32
|
-
@property
|
33
|
-
def data(self):
|
34
|
-
return self.path.read_bytes()
|
35
|
-
|
36
|
-
@property
|
37
|
-
def path(self):
|
38
|
-
return self.root / self.filename
|
39
|
-
|
40
|
-
|
41
|
-
class AvatarCache:
|
42
|
-
_shelf_path: str
|
43
|
-
_jid_to_legacy_path: str
|
44
|
-
dir: Path
|
45
|
-
http: aiohttp.ClientSession
|
46
|
-
|
47
|
-
def __init__(self):
|
48
|
-
self._thread_pool = ThreadPoolExecutor(config.AVATAR_RESAMPLING_THREADS)
|
49
|
-
|
50
|
-
def set_dir(self, path: Path):
|
51
|
-
self.dir = path
|
52
|
-
self.dir.mkdir(exist_ok=True)
|
53
|
-
self._shelf_path = str(path / "slidge_avatar_cache.shelf")
|
54
|
-
self._jid_to_legacy_path = str(path / "jid_to_avatar_unique_id.shelf")
|
55
|
-
|
56
|
-
def close(self):
|
57
|
-
self._thread_pool.shutdown(cancel_futures=True)
|
58
|
-
|
59
|
-
def __get_http_headers(self, cached: Optional[CachedAvatar]):
|
60
|
-
headers = {}
|
61
|
-
if cached and (self.dir / cached.filename).exists():
|
62
|
-
if last_modified := cached.last_modified:
|
63
|
-
headers["If-Modified-Since"] = last_modified
|
64
|
-
if etag := cached.etag:
|
65
|
-
headers["If-None-Match"] = etag
|
66
|
-
return headers
|
67
|
-
|
68
|
-
async def get_avatar_from_url_alone(self, url: str, jid: JID):
|
69
|
-
"""
|
70
|
-
Used when no avatar unique ID is passed. Store and use http headers
|
71
|
-
to avoid fetching ut
|
72
|
-
"""
|
73
|
-
cached = self.get(url)
|
74
|
-
headers = self.__get_http_headers(cached)
|
75
|
-
async with _download_lock:
|
76
|
-
return await self.__download(cached, url, headers, jid)
|
77
|
-
|
78
|
-
async def __download(
|
79
|
-
self,
|
80
|
-
cached: Optional[CachedAvatar],
|
81
|
-
url: str,
|
82
|
-
headers: dict[str, str],
|
83
|
-
jid: JID,
|
84
|
-
):
|
85
|
-
async with self.http.get(url, headers=headers) as response:
|
86
|
-
if response.status == HTTPStatus.NOT_MODIFIED:
|
87
|
-
log.debug("Using avatar cache for %s", jid)
|
88
|
-
return cached
|
89
|
-
log.debug("Download avatar for %s", jid)
|
90
|
-
return await self.convert_and_store(
|
91
|
-
Image.open(io.BytesIO(await response.read())),
|
92
|
-
url,
|
93
|
-
jid,
|
94
|
-
response.headers,
|
95
|
-
)
|
96
|
-
|
97
|
-
async def url_has_changed(self, url: URL):
|
98
|
-
with shelve.open(self._shelf_path) as s:
|
99
|
-
cached = s.get(url)
|
100
|
-
if cached is None:
|
101
|
-
return True
|
102
|
-
headers = self.__get_http_headers(cached)
|
103
|
-
async with self.http.head(url, headers=headers) as response:
|
104
|
-
return response.status != HTTPStatus.NOT_MODIFIED
|
105
|
-
|
106
|
-
def get(self, unique_id: LegacyFileIdType) -> Optional[CachedAvatar]:
|
107
|
-
with shelve.open(self._shelf_path) as s:
|
108
|
-
return s.get(str(unique_id))
|
109
|
-
|
110
|
-
def get_cached_id_for(self, jid: JID) -> Optional[LegacyFileIdType]:
|
111
|
-
with shelve.open(self._jid_to_legacy_path) as s:
|
112
|
-
return s.get(str(jid))
|
113
|
-
|
114
|
-
def store_jid(self, jid: JID, uid: LegacyFileIdType):
|
115
|
-
with shelve.open(self._jid_to_legacy_path) as s:
|
116
|
-
s[str(jid)] = uid
|
117
|
-
|
118
|
-
def delete_jid(self, jid: JID):
|
119
|
-
try:
|
120
|
-
with shelve.open(self._jid_to_legacy_path) as s:
|
121
|
-
del s[str(jid)]
|
122
|
-
except KeyError:
|
123
|
-
pass
|
124
|
-
|
125
|
-
async def convert_and_store(
|
126
|
-
self,
|
127
|
-
img: Image.Image,
|
128
|
-
unique_id: LegacyFileIdType,
|
129
|
-
jid: JID,
|
130
|
-
response_headers: Optional[CIMultiDictProxy[str]] = None,
|
131
|
-
) -> CachedAvatar:
|
132
|
-
resize = (size := config.AVATAR_SIZE) and any(x > size for x in img.size)
|
133
|
-
if resize:
|
134
|
-
await asyncio.get_event_loop().run_in_executor(
|
135
|
-
self._thread_pool, img.thumbnail, (size, size)
|
136
|
-
)
|
137
|
-
log.debug("Resampled image to %s", img.size)
|
138
|
-
|
139
|
-
filename = str(uuid.uuid1()) + ".png"
|
140
|
-
file_path = self.dir / filename
|
141
|
-
|
142
|
-
if (
|
143
|
-
not resize
|
144
|
-
and img.format == "PNG"
|
145
|
-
and isinstance(unique_id, str)
|
146
|
-
and (path := Path(unique_id))
|
147
|
-
and path.exists()
|
148
|
-
):
|
149
|
-
img_bytes = path.read_bytes()
|
150
|
-
else:
|
151
|
-
with io.BytesIO() as f:
|
152
|
-
img.save(f, format="PNG")
|
153
|
-
img_bytes = f.getvalue()
|
154
|
-
|
155
|
-
with file_path.open("wb") as file:
|
156
|
-
file.write(img_bytes)
|
157
|
-
|
158
|
-
hash_ = hashlib.sha1(img_bytes).hexdigest()
|
159
|
-
|
160
|
-
avatar = CachedAvatar(
|
161
|
-
filename=filename,
|
162
|
-
hash=hash_,
|
163
|
-
height=img.height,
|
164
|
-
width=img.width,
|
165
|
-
root=self.dir,
|
166
|
-
)
|
167
|
-
if response_headers:
|
168
|
-
avatar.etag = response_headers.get("etag")
|
169
|
-
avatar.last_modified = response_headers.get("last-modified")
|
170
|
-
with shelve.open(self._shelf_path) as s:
|
171
|
-
s[str(unique_id)] = avatar
|
172
|
-
self.store_jid(jid, unique_id)
|
173
|
-
return avatar
|
174
|
-
|
175
|
-
|
176
|
-
avatar_cache = AvatarCache()
|
177
|
-
log = logging.getLogger(__name__)
|
178
|
-
_download_lock = asyncio.Lock()
|
179
|
-
|
180
|
-
__all__ = (
|
181
|
-
"CachedAvatar",
|
182
|
-
"avatar_cache",
|
183
|
-
)
|
slidge/core/gateway/__init__.py
DELETED
slidge/core/gateway/muc_admin.py
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
from typing import TYPE_CHECKING
|
2
|
-
|
3
|
-
from slixmpp import CoroutineCallback, Iq, StanzaPath
|
4
|
-
from slixmpp.exceptions import XMPPError
|
5
|
-
|
6
|
-
if TYPE_CHECKING:
|
7
|
-
from .base import BaseGateway
|
8
|
-
|
9
|
-
|
10
|
-
class MucAdmin:
|
11
|
-
def __init__(self, xmpp: "BaseGateway"):
|
12
|
-
self.xmpp = xmpp
|
13
|
-
xmpp.register_handler(
|
14
|
-
CoroutineCallback(
|
15
|
-
"muc#admin",
|
16
|
-
StanzaPath("iq@type=get/mucadmin_query"),
|
17
|
-
self._handle_admin, # type: ignore
|
18
|
-
)
|
19
|
-
)
|
20
|
-
|
21
|
-
async def _handle_admin(self, iq: Iq):
|
22
|
-
muc = await self.xmpp.get_muc_from_stanza(iq)
|
23
|
-
|
24
|
-
affiliation = iq["mucadmin_query"]["item"]["affiliation"]
|
25
|
-
|
26
|
-
if not affiliation:
|
27
|
-
raise XMPPError("bad-request")
|
28
|
-
|
29
|
-
reply = iq.reply()
|
30
|
-
reply.enable("mucadmin_query")
|
31
|
-
for participant in await muc.get_participants():
|
32
|
-
if not participant.affiliation == affiliation:
|
33
|
-
continue
|
34
|
-
reply["mucadmin_query"].append(participant.mucadmin_item())
|
35
|
-
reply.send()
|
slidge/core/gateway/presence.py
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
import logging
|
2
|
-
|
3
|
-
from slixmpp import JID, Presence
|
4
|
-
|
5
|
-
from ..session import BaseSession
|
6
|
-
|
7
|
-
|
8
|
-
class _IsDirectedAtComponent(Exception):
|
9
|
-
def __init__(self, session: BaseSession):
|
10
|
-
self.session = session
|
11
|
-
|
12
|
-
|
13
|
-
class PresenceHandlerMixin:
|
14
|
-
boundjid: JID
|
15
|
-
|
16
|
-
def get_session_from_stanza(self, s) -> BaseSession:
|
17
|
-
raise NotImplementedError
|
18
|
-
|
19
|
-
async def __get_contact(self, pres: Presence):
|
20
|
-
sess = await self.__get_session(pres)
|
21
|
-
pto = pres.get_to()
|
22
|
-
if pto == self.boundjid.bare:
|
23
|
-
raise _IsDirectedAtComponent(sess)
|
24
|
-
await sess.contacts.ready
|
25
|
-
return await sess.contacts.by_jid(pto)
|
26
|
-
|
27
|
-
async def __get_session(self, p: Presence):
|
28
|
-
sess = self.get_session_from_stanza(p)
|
29
|
-
return sess
|
30
|
-
|
31
|
-
async def _handle_subscribe(self, pres: Presence):
|
32
|
-
try:
|
33
|
-
contact = await self.__get_contact(pres)
|
34
|
-
except _IsDirectedAtComponent:
|
35
|
-
pres.reply().send()
|
36
|
-
return
|
37
|
-
|
38
|
-
if contact.is_friend:
|
39
|
-
pres.reply().send()
|
40
|
-
else:
|
41
|
-
await contact.on_friend_request(pres["status"])
|
42
|
-
|
43
|
-
async def _handle_unsubscribe(self, pres: Presence):
|
44
|
-
pres.reply().send()
|
45
|
-
|
46
|
-
try:
|
47
|
-
contact = await self.__get_contact(pres)
|
48
|
-
except _IsDirectedAtComponent as e:
|
49
|
-
e.session.send_gateway_message("Bye bye!")
|
50
|
-
await e.session.kill_by_jid(e.session.user.jid)
|
51
|
-
return
|
52
|
-
|
53
|
-
contact.is_friend = False
|
54
|
-
await contact.on_friend_delete(pres["status"])
|
55
|
-
|
56
|
-
async def _handle_subscribed(self, pres: Presence):
|
57
|
-
try:
|
58
|
-
contact = await self.__get_contact(pres)
|
59
|
-
except _IsDirectedAtComponent:
|
60
|
-
return
|
61
|
-
|
62
|
-
await contact.on_friend_accept()
|
63
|
-
|
64
|
-
async def _handle_unsubscribed(self, pres: Presence):
|
65
|
-
try:
|
66
|
-
contact = await self.__get_contact(pres)
|
67
|
-
except _IsDirectedAtComponent:
|
68
|
-
return
|
69
|
-
|
70
|
-
if contact.is_friend:
|
71
|
-
contact.is_friend = False
|
72
|
-
await contact.on_friend_delete(pres["status"])
|
73
|
-
|
74
|
-
async def _handle_probe(self, pres: Presence):
|
75
|
-
try:
|
76
|
-
contact = await self.__get_contact(pres)
|
77
|
-
except _IsDirectedAtComponent:
|
78
|
-
session = await self.__get_session(pres)
|
79
|
-
session.send_cached_presence(pres.get_from())
|
80
|
-
return
|
81
|
-
if contact.is_friend:
|
82
|
-
contact.send_last_presence(force=True)
|
83
|
-
else:
|
84
|
-
reply = pres.reply()
|
85
|
-
reply["type"] = "unsubscribed"
|
86
|
-
reply.send()
|
87
|
-
|
88
|
-
async def _handle_new_subscription(self, pres: Presence):
|
89
|
-
pass
|
90
|
-
|
91
|
-
async def _handle_removed_subscription(self, pres: Presence):
|
92
|
-
pass
|
93
|
-
|
94
|
-
|
95
|
-
log = logging.getLogger(__name__)
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import logging
|
2
|
-
from typing import TYPE_CHECKING, Optional
|
3
|
-
|
4
|
-
from slixmpp import JID, Iq
|
5
|
-
|
6
|
-
from ...util.db import user_store
|
7
|
-
|
8
|
-
if TYPE_CHECKING:
|
9
|
-
from .base import BaseGateway
|
10
|
-
|
11
|
-
|
12
|
-
class Registration:
|
13
|
-
def __init__(self, xmpp: "BaseGateway"):
|
14
|
-
self.xmpp = xmpp
|
15
|
-
xmpp["xep_0077"].api.register(
|
16
|
-
user_store.get,
|
17
|
-
"user_get",
|
18
|
-
)
|
19
|
-
xmpp["xep_0077"].api.register(
|
20
|
-
user_store.remove,
|
21
|
-
"user_remove",
|
22
|
-
)
|
23
|
-
xmpp["xep_0077"].api.register(
|
24
|
-
self.xmpp.make_registration_form, "make_registration_form"
|
25
|
-
)
|
26
|
-
xmpp["xep_0077"].api.register(self._user_validate, "user_validate")
|
27
|
-
xmpp["xep_0077"].api.register(self._user_modify, "user_modify")
|
28
|
-
|
29
|
-
async def _user_validate(self, _gateway_jid, _node, ifrom: JID, iq: Iq):
|
30
|
-
"""
|
31
|
-
SliXMPP internal API stuff
|
32
|
-
"""
|
33
|
-
xmpp = self.xmpp
|
34
|
-
log.debug("User validate: %s", ifrom.bare)
|
35
|
-
form_dict = {f.var: iq.get(f.var) for f in xmpp.REGISTRATION_FIELDS}
|
36
|
-
xmpp.raise_if_not_allowed_jid(ifrom)
|
37
|
-
await xmpp.user_prevalidate(ifrom, form_dict)
|
38
|
-
log.info("New user: %s", ifrom.bare)
|
39
|
-
user_store.add(ifrom, form_dict)
|
40
|
-
|
41
|
-
async def _user_modify(
|
42
|
-
self, _gateway_jid, _node, ifrom: JID, form_dict: dict[str, Optional[str]]
|
43
|
-
):
|
44
|
-
"""
|
45
|
-
SliXMPP internal API stuff
|
46
|
-
"""
|
47
|
-
user = user_store.get_by_jid(ifrom)
|
48
|
-
log.debug("Modify user: %s", user)
|
49
|
-
await self.xmpp.user_prevalidate(ifrom, form_dict)
|
50
|
-
user_store.add(ifrom, form_dict)
|
51
|
-
|
52
|
-
|
53
|
-
log = logging.getLogger(__name__)
|