Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display name of user who left the room or changed their name #7

Open
finefoot opened this issue Oct 15, 2020 · 0 comments
Open

Display name of user who left the room or changed their name #7

finefoot opened this issue Oct 15, 2020 · 0 comments

Comments

@finefoot
Copy link
Contributor

Traceback (most recent call last):
  File "matrix-archive.py", line 320, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "matrix-archive.py", line 305, in main
    await write_event(client, room, f, event)
  File "matrix-archive.py", line 223, in write_event
    await output_file.write(serialize_event(dict(type="text", body=event.body,)))
  File "matrix-archive.py", line 214, in <lambda>
    sender_name=room.users[event.sender].display_name,
KeyError: ...

If a user has left the room, the display name can't be fetched from room.users[event.sender].display_name because there is no event.sender in room.users.

However, the bigger issue is, that when the event took place (the message/media was sent etc.), the user might have had a completely different display name. The Element webapp is able to provide the correct display name, so I guess there has to be a different way to get to the name other than via room.users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant