jjj333-p / dendrite-admin-interface

[Early Developmentt] A bot interface for administrating a Dendrite server using the administration api and some database interfacing
https://matrix.to/#/#admin-interface-support:pain.agency
GNU Affero General Public License v3.0
6 stars 0 forks source link

see current joined members to a room or rooms per member #5

Open jjj333-p opened 9 months ago

jjj333-p commented 9 months ago
dendrite=# select * from syncapi_memberships limit 5;
            room_id            |            user_id             | membership |                   event_id                   | stream_pos | topological_pos 
-------------------------------+--------------------------------+------------+----------------------------------------------+------------+-----------------
 !nHIa7kVnDHVjnioH:pain.agency | @wa2_233257362130:pain.agency  | invite     | $kgFFDI48Ys5TAR6HSWleejBKZbUGIRQ056kHDJAf00s |     142806 |            4100
 !RoWLiUSm6QQcHv4u:pain.agency | @jjj333_p_1325:envs.net        | invite     | $bpIHLcMG9QjRVh-9-fhiAloqjMjPXRpBKg-UU8uhxZM |         18 |               8
 !RoWLiUSm6QQcHv4u:pain.agency | @jjj333_p_1325:envs.net        | join       | $XYJgNPuwJv23ecL10OyrRTc5u_rsWjNuND5xTlaf14o |         24 |              10
 !nHIa7kVnDHVjnioH:pain.agency | @wa2_2348028310407:pain.agency | invite     | $pkPyF9oOZY0fBBI2hez2oig7ssLnnlj0qdQJj15IFck |     765512 |            9746
 !nHIa7kVnDHVjnioH:pain.agency | @wa2_2348161174073:pain.agency | leave      | $er9QUU6duubatP0XogvdeRY6IHwe0KSeoIn_6K_RNLk |    1023870 |           16717
(5 rows)

dendrite=# 

the syncapi_memberships table includes data such that with a little parcing (or just creative psql commands) it would be convenient to make a command to show all rooms a user is in or all members in a room without evacuating that user or room. this could be useful for some monitoring tasks

perhaps something like !members [roomid] or !joinedroomsrooms [mxid]