Appease the linter

This commit is contained in:
Johannes Marbach 2025-02-28 10:58:53 +01:00
parent 42c518225b
commit 4dbca25a40
2 changed files with 4 additions and 2 deletions

View file

@ -3106,7 +3106,7 @@ class PersistEventsStore:
txn,
event,
"content.topic",
get_plain_text_topic_from_event_content(event.content),
get_plain_text_topic_from_event_content(event.content) or "",
)
def _store_room_name_txn(self, txn: LoggingTransaction, event: EventBase) -> None:

View file

@ -13,6 +13,8 @@
#
#
from typing import Optional
from synapse.types import JsonDict
from synapse.util.stringutils import random_string
@ -30,7 +32,7 @@ def generate_fake_event_id() -> str:
return "$" + random_string(43)
def get_plain_text_topic_from_event_content(content: JsonDict):
def get_plain_text_topic_from_event_content(content: JsonDict) -> Optional[str]:
"""
Given the content of an m.room.topic event returns the plain text topic
representation if any exists.