Add an EventValidator. Fix bugs in auth ++ storage

This commit is contained in:
Erik Johnston 2014-11-10 18:24:43 +00:00
parent ec824927c1
commit a8e565eca8
9 changed files with 64 additions and 90 deletions

View file

@ -133,26 +133,28 @@ class RoomStore(SQLBaseStore):
defer.returnValue(ret)
def _store_room_topic_txn(self, txn, event):
self._simple_insert_txn(
txn,
"topics",
{
"event_id": event.event_id,
"room_id": event.room_id,
"topic": event.topic,
}
)
if hasattr(event, "topic"):
self._simple_insert_txn(
txn,
"topics",
{
"event_id": event.event_id,
"room_id": event.room_id,
"topic": event.topic,
}
)
def _store_room_name_txn(self, txn, event):
self._simple_insert_txn(
txn,
"room_names",
{
"event_id": event.event_id,
"room_id": event.room_id,
"name": event.name,
}
)
if hasattr(event, "name"):
self._simple_insert_txn(
txn,
"room_names",
{
"event_id": event.event_id,
"room_id": event.room_id,
"name": event.name,
}
)
class RoomsTable(Table):