Keep track of what rooms the bot is in, and what users are in them #20

Closed
opened 2020-10-18 21:00:03 +00:00 by projectmoon · 2 comments
Owner

This is necessary foundational work for managing the bot's services in a private chat (direct message) instead of spamming commands out in the open. As most commands are planned to be per-room, giving commands in a DM need to be contextually aware of a room, either by giving a room ID/number or setting the room and having all commands afterward operate on that room.

Checklist:

  • Prevent duplicate event processing due to the way Matrix SDK retrieves events when joining a room.
  • When a user joins a room, and record the user in the rooms namespace in the database.
  • When a user leaves the room, remove the user from the room list.
  • When the bot joins a room, add all users in the room to the database.
  • When the bot joins a room, add the room name/ID to a room info struct/tree.
  • When the bot leaves a room, wipe out all information about the room from the database.
  • On startup, sync room member lists as an async task. Update member list for every room the bot is in.

The bot should always exclude itself from member lists. Because direct messages are rooms, we might also want to ignore direct message rooms. This can be done with Matrix SDK.

This is necessary foundational work for managing the bot's services in a private chat (direct message) instead of spamming commands out in the open. As most commands are planned to be per-room, giving commands in a DM need to be contextually aware of a room, either by giving a room ID/number or setting the room and having all commands afterward operate on that room. Checklist: - [X] Prevent duplicate event processing due to the way Matrix SDK retrieves events when joining a room. - [X] When a user joins a room, and record the user in the rooms namespace in the database. - [X] When a user leaves the room, remove the user from the room list. - [ ] When the bot joins a room, add all users in the room to the database. - [ ] When the bot joins a room, add the room name/ID to a room info struct/tree. - [X] When the bot leaves a room, wipe out all information about the room from the database. - [ ] On startup, sync room member lists as an async task. Update member list for every room the bot is in. The bot should always exclude itself from member lists. Because direct messages are rooms, we might also want to ignore direct message rooms. This can be done with [Matrix SDK](https://github.com/matrix-org/matrix-rust-sdk/commit/883183324f7c8a0a0afc92b8c906ab51be9a12b7).
Author
Owner

These will be implemented by #44:

  • Prevent duplicate event processing due to the way Matrix SDK retrieves events when joining a room.
  • When a user joins a room, and record the user in the rooms namespace in the database.
  • When a user leaves the room, remove the user from the room list.
  • When the bot joins a room, add all users in the room to the database.
  • When the bot leaves a room, wipe out all information about the room from the database.

This leaves these two remaining to be implemented in a later PR:

  • When the bot joins a room, add the room name/ID to a room info struct/tree.
  • On startup, sync room member lists as an async task. Update member list for every room the bot is in.
These will be implemented by #44: - Prevent duplicate event processing due to the way Matrix SDK retrieves events when joining a room. - When a user joins a room, and record the user in the rooms namespace in the database. - When a user leaves the room, remove the user from the room list. - When the bot joins a room, add all users in the room to the database. - When the bot leaves a room, wipe out all information about the room from the database. This leaves these two remaining to be implemented in a later PR: - When the bot joins a room, add the room name/ID to a room info struct/tree. - On startup, sync room member lists as an async task. Update member list for every room the bot is in.
Author
Owner

This issue is closed by actually removing all of the code implemented in #44, because the Matrix SDK can do this for us on demand with locally cached information.

This issue is closed by actually removing all of the code implemented in #44, because the Matrix SDK can do this for us on demand with locally cached information.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: projectmoon/tenebrous-dicebot#20
No description provided.