Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Changing server_notices_mxid_avatar_url does not change notices user avatar image #7478

Closed
ptman opened this issue May 12, 2020 · 6 comments
Closed

Comments

@ptman
Copy link
Contributor

ptman commented May 12, 2020

Description

The server notices user (and room) avatar doesn't work. Instead riot shows an S.

Steps to reproduce

server_notices:
  system_mxid_localpart: 'notices'
  system_mxid_display_name: 'Server Notices'
  system_mxid_avatar_url: 'mxc://.../...'
  room_name: 'Server Notices'

Version information

  • Version: 1.12.4+bionic1
  • Install method: apt
  • Platform: ubuntu 18.04
@anoadragon453
Copy link
Member

Hm, I'm unable to reproduce this locally on the release-v1.12.4 branch or develop.

Using config:

server_notices:
  system_mxid_localpart: 'notices'
  system_mxid_display_name: 'Server Notices'
  system_mxid_avatar_url: 'mxc://half-shot.uk/6fc3fb176d5246f1e7cf7d89ad4248b8'
  room_name: 'Server Notices'

And sending command:

curl -X POST -H 'Authorization: Bearer xxx' -i http://localhost:8008/_synapse/admin/v1/send_server_notice --data '{
    "user_id": "@bob:localhost",
    "content": {
        "msgtype": "m.text",
        "body": "Sup yo"
    }
}'

Things seem to work as they should:

image

One thing I did notice is that editing system_mxid_display_name and system_mxid_avatar_url without setting system_mxid_localpart to a new localpart doesn't change the display name or avatar url. Indeed it seems those are only set when creating a new Server Notices room with a user:

# 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,
}

Is that what you're referring to?

@ptman
Copy link
Contributor Author

ptman commented May 12, 2020

Well, I was unable to check with a fresh room, but someone else did and claimed it also didn't get the avatar correctly. But shouldn't the avatar also be fixed for existing rooms?

@ptman ptman changed the title server_notices_mxid_avatar_url has not effect on avatar image server_notices_mxid_avatar_url has no effect on avatar image May 12, 2020
@anoadragon453
Copy link
Member

Well, I was unable to check with a fresh room, but someone else did and claimed it also didn't get the avatar correctly. But shouldn't the avatar also be fixed for existing rooms?

Yes, I think so, but that's a different issue to this one if I understand it correctly.

@ptman
Copy link
Contributor Author

ptman commented May 13, 2020

is there an existing issue?

@ptman ptman changed the title server_notices_mxid_avatar_url has no effect on avatar image Changing server_notices_mxid_avatar_url does not change notices user avatar image May 13, 2020
@anoadragon453
Copy link
Member

anoadragon453 commented May 13, 2020

Not from what I can see. I believe there's two separate issues here:

  1. Your config is being misinterpreted somehow to pull out a blank MXC url and 'S' as the displayname. There is/may be a bug somewhere.
  2. MXC URL and displayname changes only take effect upon starting Synapse with a new server notices localpart

2 may be causing 1, but 2 should be a separate issue. I've gone ahead and created one for 2 here: #7494

@anoadragon453
Copy link
Member

Going by the new title, I think #7494 may cover your issue? Please re-open if not.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants