Update 'Feature: Room State Management'

projectmoon 2020-11-06 21:21:43 +00:00
parent 1c1baa3242
commit cd9b196a70
1 changed files with 16 additions and 1 deletions

@ -10,6 +10,21 @@ Listen to Matrix event for when users enter and leave rooms. This is easily acco
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. 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.
RoomInfo struct is created/updated when the bot joins a room.
## Database Changes ## 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. New DB object `Rooms`. Keep track of users and the rooms they are in, both by username to a list of room IDs, and a room ID to list of usernames. It will also keep track of actual room information.
Trees:
* username -> list of room ids, for easy implementation of private conversation command execution.
* room id -> list of users
* room id -> RoomInfo
## Architcture Changse
A new `RoomInfo` struct must be created, and possibly a whole new layer of the application. This layer doesn't exist yet, because we've been dealing only with strings and integers so far.
RoomInfo must store at least:
* Room ID
* Room name