From cd9b196a70940669a8eac700eb89974c3590460f Mon Sep 17 00:00:00 2001 From: projectmoon Date: Fri, 6 Nov 2020 21:21:43 +0000 Subject: [PATCH] Update 'Feature: Room State Management' --- Feature%3A-Room-State-Management.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Feature%3A-Room-State-Management.md b/Feature%3A-Room-State-Management.md index 98e3c23..16f5d61 100644 --- a/Feature%3A-Room-State-Management.md +++ b/Feature%3A-Room-State-Management.md @@ -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. +RoomInfo struct is created/updated when the bot joins a 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 +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 \ No newline at end of file