From 1c1baa324277f38f610bdae5e7c767e252a90450 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Fri, 6 Nov 2020 21:11:27 +0000 Subject: [PATCH] Update 'Feature: Room State Management' --- Feature%3A-Room-State-Management.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Feature%3A-Room-State-Management.md diff --git a/Feature%3A-Room-State-Management.md b/Feature%3A-Room-State-Management.md new file mode 100644 index 0000000..98e3c23 --- /dev/null +++ b/Feature%3A-Room-State-Management.md @@ -0,0 +1,15 @@ +# Room State Management + +Planning and design of the room state management "feature." + +* The bot must keep track of rooms it is in, and what users are in each room. + +## Bot Changes + +Listen to Matrix event for when users enter and leave rooms. This is easily accomplished with the `on_room_member` event. When the bot joins a room for the first time, member events are fired for every member in the room. It seems to sync everything, so you will get a join and leave notification many times, potentially. + +The bot does not get membership events from other users when leaving a room. Instead, it will get a member event of leaving the room for itself. In that circumstance, it should delete all user information in the database for the room. + +## Database Changes + +New DB object `Rooms`. Trees for room -> list of users, and maybe user -> list of rooms. We need user -> list of rooms for easy implementation of private conversation command execution. \ No newline at end of file