mirror of
https://github.com/element-hq/synapse
synced 2024-09-04 03:10:07 +00:00
Look for name, topic in the event content rather than the event itself when persisting room name and topic events
This commit is contained in:
parent
f70e622d59
commit
9c71d945d6
1 changed files with 4 additions and 4 deletions
|
@ -135,26 +135,26 @@ class RoomStore(SQLBaseStore):
|
||||||
defer.returnValue(ret)
|
defer.returnValue(ret)
|
||||||
|
|
||||||
def _store_room_topic_txn(self, txn, event):
|
def _store_room_topic_txn(self, txn, event):
|
||||||
if hasattr(event, "topic"):
|
if hasattr(event, "content") and "topic" in event.content:
|
||||||
self._simple_insert_txn(
|
self._simple_insert_txn(
|
||||||
txn,
|
txn,
|
||||||
"topics",
|
"topics",
|
||||||
{
|
{
|
||||||
"event_id": event.event_id,
|
"event_id": event.event_id,
|
||||||
"room_id": event.room_id,
|
"room_id": event.room_id,
|
||||||
"topic": event.topic,
|
"topic": event.content["topic"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
def _store_room_name_txn(self, txn, event):
|
def _store_room_name_txn(self, txn, event):
|
||||||
if hasattr(event, "name"):
|
if hasattr(event, "content") and "name" in event.content:
|
||||||
self._simple_insert_txn(
|
self._simple_insert_txn(
|
||||||
txn,
|
txn,
|
||||||
"room_names",
|
"room_names",
|
||||||
{
|
{
|
||||||
"event_id": event.event_id,
|
"event_id": event.event_id,
|
||||||
"room_id": event.room_id,
|
"room_id": event.room_id,
|
||||||
"name": event.name,
|
"name": event.content["name"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue