mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-17 07:09:07 -05:00
Allow overriding the server_notices user's avatar
probably should have done this in the first place, like @turt2live suggested.
This commit is contained in:
parent
043f05a078
commit
9bf4b2bda3
3 changed files with 32 additions and 9 deletions
|
|
@ -113,6 +113,19 @@ class ServerNoticesManager(object):
|
|||
# apparently no existing notice room: create a new one
|
||||
logger.info("Creating server notices room for %s", user_id)
|
||||
|
||||
# see if we want to override the profile info for the server user.
|
||||
# note that if we want to override either the display name or the
|
||||
# avatar, we have to use both.
|
||||
join_profile = None
|
||||
if (
|
||||
self._config.server_notices_mxid_display_name is not None or
|
||||
self._config.server_notices_mxid_avatar_url is not None
|
||||
):
|
||||
join_profile = {
|
||||
"displayname": self._config.server_notices_mxid_display_name,
|
||||
"avatar_url": self._config.server_notices_mxid_avatar_url,
|
||||
}
|
||||
|
||||
requester = create_requester(system_mxid)
|
||||
info = yield self._room_creation_handler.create_room(
|
||||
requester,
|
||||
|
|
@ -125,9 +138,7 @@ class ServerNoticesManager(object):
|
|||
"invite": (user_id,)
|
||||
},
|
||||
ratelimit=False,
|
||||
creator_join_profile={
|
||||
"displayname": self._config.server_notices_mxid_display_name,
|
||||
},
|
||||
creator_join_profile=join_profile,
|
||||
)
|
||||
room_id = info['room_id']
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue