Comment briefly on how we keep user_directory up to date

pull/2252/head
Erik Johnston 2017-05-31 17:11:18 +01:00
parent f1378aef91
commit cc7609aa9f
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,16 @@ class UserDirectoyHandler(object):
"""Handles querying of and keeping updated the user_directory.
N.B.: ASSUMES IT IS THE ONLY THING THAT MODIFIES THE USER DIRECTORY
The user directory is filled with users who this server can see are joined to a
world_readable or publically joinable room. We keep a database table up to date
by streaming changes of the current state and recalculating whether users should
be in the directory or not when necessary.
For each user in the directory we also store a room_id which is public and that the
user is joined to. This allows us to ignore history_visibility and join_rules changes
for that user in all other public rooms, as we know they'll still be in at least
one public room.
"""
def __init__(self, hs):