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