Captcha MUC: Gajim is unable to distinguish between groupchat and a roster contact
Please first check if another issue has been opened for your problem
Versions
- OS: Fedora 37
- Gajim version: 1.5.4
- GTK version: 3.24.35
- Python-nbxmpp version: 3.2.5
Steps to reproduce the problem
I have two clients: Conversations and Gajim. Both online at the same time. The story is like this:
- I joined a groupchat with Conversations and got a message about a CAPTCHA that I need to enter
- I entered the CAPTCHA and the server let me through with Conversations
- Next I see that Gajim did not join the groupchat, but has several messages about CAPTCHA from this groupchat like from the roster contact
- I am unable to join the groupchat because Gajim thinks it's a roster contact
- Gajim restarted, the groupchat removed from roster manually (not sure in which order)
- Joined the groupchat.
- Now Gajim does not suggest nicks in the groupchat.
Expected behavior
- Gajim hadnles CAPTCHA messages properly and correctly distinguishes between groupchat and a 1-to-1 chat.
- Gajim suggests nicknames in groupchats.
Actual behavior
12/15/2022 12:24:04 (W) gajim.c.m.muc (helldev.net) Can’t join MUC xxx@conference.example.com, state: JOINING
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/gajim/gtk/start_chat.py", line 483, in _on_join_clicked
app.window.show_add_join_groupchat(
File "/usr/lib/python3.11/site-packages/gajim/gtk/main.py", line 1125, in show_add_join_groupchat
self.add_group_chat(account, JID.from_string(jid), select=True)
File "/usr/lib/python3.11/site-packages/gajim/gtk/main.py", line 923, in add_group_chat
self._chat_page.add_chat_for_workspace(workspace_id,
File "/usr/lib/python3.11/site-packages/gajim/gtk/chat_page.py", line 235, in add_chat_for_workspace
client.get_module('Contacts').add_group_chat_contact(jid)
File "/usr/lib/python3.11/site-packages/gajim/common/modules/contacts.py", line 149, in add_group_chat_contact
raise ValueError(f'Trying to add GroupchatContact {jid}, '
ValueError: Trying to add GroupchatContact xxx@conference.example.com, but contact already exists as xxx@conference.example.com (helldev.net) (in roster: False)
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/gajim/gtk/chat_action_processor.py", line 83, in _on_key_press
res = self._nick_completion.process_key_press(textview, event)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/gajim/gtk/groupchat_nick_completion.py", line 87, in process_key_press
self._suggestions = self._generate_suggestions(prefix)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/gajim/gtk/groupchat_nick_completion.py", line 149, in _generate_suggestions
if _nick_matching(nick):
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/gajim/gtk/groupchat_nick_completion.py", line 132, in _nick_matching
participant = self._contact.get_resource(nick)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/gajim/common/modules/contacts.py", line 714, in get_resource
contact = self.add_resource(resource)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/gajim/common/modules/contacts.py", line 690, in add_resource
assert resource is not None
AssertionError