Update synapse/server_notices/server_notices_manager.py

Co-authored-by: Erik Johnston <erikj@jki.re>
pull/16679/head
Mathieu Velten 2023-12-12 15:07:11 +01:00 committed by GitHub
parent d8aaaef3b4
commit 66debd9118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 1 deletions

View File

@ -354,7 +354,16 @@ class ServerNoticesManager:
"",
)
if room_info_event and room_info_event.get(info_content_key) == info_value:
existing_info_value = None
if room_info_event:
existing_info_value = room_info_event.get(info_content_key)
if existing_info_value == info_value:
return
if not existing_info_value and not info_value:
# A missing `info_value` can either be represented by a None
# or an empty string, so we assume that if they're both falsey
# they're equivalent.
return
return
if info_value is None: