Opening PM from search results adds chat as ResourceContact if not joined
Versions
- OS: Manjaro
- Gajim version: master 220815
- GTK version: 3.24.34
- Python-nbxmpp version: master 220815
Steps to reproduce the problem
- Search history, click on a result from a PM (but: the PM is from a group chat where you are not joined anymore)
- Leave chat open, restart Gajim
Expected behavior
Chat gone on the next restart
Actual behavior
Gajim stores the PM chat in the workspace's open_chats
as a contact:
[
"xmppserver.tld",
{
"__type": "JID",
"value": "channel@conference.xmppserver.tld/Julia"
},
"contact",
false
]
This results in a traceback when Gajim tries to add this chat to the chat list.
Traceback (most recent call last):
File "/home/x/DEV/Gajim/gajim/gajim/gui/application.py", line 391, in _handle_local_options
self._startup()
File "/home/x/DEV/Gajim/gajim/gajim/gui/application.py", line 278, in _startup
MainWindow()
File "/home/x/DEV/Gajim/gajim/gajim/gui/main.py", line 135, in __init__
self._load_chats()
File "/home/x/DEV/Gajim/gajim/gajim/gui/main.py", line 891, in _load_chats
self._chat_page.load_workspace_chats(workspace_id)
File "/home/x/DEV/Gajim/gajim/gajim/gui/chat_page.py", line 254, in load_workspace_chats
self.add_chat_for_workspace(workspace_id,
File "/home/x/DEV/Gajim/gajim/gajim/gui/chat_page.py", line 237, in add_chat_for_workspace
self._chat_list_stack.add_chat(workspace_id, account, jid, type_,
File "/home/x/DEV/Gajim/gajim/gajim/gui/chat_list_stack.py", line 197, in add_chat
chat_list.add_chat(account, jid, type_, pinned)
File "/home/x/DEV/Gajim/gajim/gajim/gui/chat_list.py", line 259, in add_chat
row = ChatRow(self._workspace_id, account, jid, type_, pinned)
File "/home/x/DEV/Gajim/gajim/gajim/gui/chat_list.py", line 577, in __init__
self.contact_name: str = self.contact.name
AttributeError: 'ResourceContact' object has no attribute 'name'