Add room member count condition and default rule to make a noise on rooms of only 2 people.

This commit is contained in:
David Baker 2015-01-30 14:46:03 +00:00
parent 1251d017c1
commit 322a047502
3 changed files with 63 additions and 6 deletions

View file

@ -375,9 +375,12 @@ class DataStore(RoomMemberStore, RoomStore,
"redacted": del_sql,
}
if event_type:
if event_type and state_key is not None:
sql += " AND s.type = ? AND s.state_key = ? "
args = (room_id, event_type, state_key)
elif event_type:
sql += " AND s.type = ?"
args = (room_id, event_type)
else:
args = (room_id, )