Add a new rule.
The scope for this rule.
The entity covered by this rule. Globs are supported.
A human-readable reason for introducing this new rule.
The event id for the new rule.
Add a new room to the list of sources. If the user isn't a member of the room, attempt to join it.
A valid room id. If this room is already in the list of sources, it will not be duplicated.
true
if the source was added, false
if it was already present.
Get the list of source rooms, i.e. the rooms from which rules need to be read.
If no source rooms are setup, the target room is used as sole source room.
Note: This method is public for testing reasons. Most clients should not need to call it directly.
This method will rewrite the Policies
object in the user's account data.
This rewrite is inherently racy and could overwrite or be overwritten by
other concurrent rewrites of the same object.
Get the target room, i.e. the room in which any new rule should be written.
If there is no target room setup, a target room is created.
Note: This method is public for testing reasons. Most clients should not need to call it directly.
This method will rewrite the Policies
object in the user's account data.
This rewrite is inherently racy and could overwrite or be overwritten by
other concurrent rewrites of the same object.
Find out whether an invite should be ignored.
A rule matching the entity, if any was found, null
otherwise.
Remove a rule.
A container for ignored invites.
Performance
This implementation is extremely naive. It expects that we are dealing with a very short list of sources (e.g. only one). If real-world applications turn out to require longer lists, we may need to rework our data structures.