Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
88daed91 by wurstsalat at 2022-11-25T16:24:19+01:00
cq: Contacts: Add more log output
- - - - -
b8c09a65 by wurstsalat at 2022-11-25T17:38:12+01:00
fix: SearchView: Set chat type correctly for ResultRows
Fixes #11087
- - - - -
2 changed files:
- gajim/common/modules/contacts.py
- gajim/gtk/search_view.py
Changes:
=====================================
gajim/common/modules/contacts.py
=====================================
@@ -147,7 +147,8 @@ def add_group_chat_contact(self, jid: Union[str, JID]) ->
GroupchatContact:
if contact is not None:
if not isinstance(contact, GroupchatContact):
raise ValueError(f'Trying to add GroupchatContact {jid}, '
- f'but contact exists already as {contact}')
+ f'but contact already exists as {contact} '
+ f'(in roster: {contact.is_in_roster})')
return contact
contact = GroupchatContact(self._log, jid, self._account)
=====================================
gajim/gtk/search_view.py
=====================================
@@ -201,7 +201,7 @@ def _add_results(self) -> None:
result_row = ResultRow(
msg,
accounts[msg.account_id],
- archive_jid.jid)
+ JID.from_string(archive_jid.jid))
else:
assert self._account is not None
assert self._jid is not None
@@ -347,8 +347,7 @@ def _on_row_activated(_listbox: SearchView, row: ResultRow)
-> None:
control.scroll_to_message(row.log_line_id, row.timestamp)
return
- # Wrong chat or no control opened
- # TODO: type 'pm' is KindConstant.CHAT_MSG_RECV, too
+ # Other chat or no control opened
jid = JID.from_string(row.jid)
app.window.add_chat(row.account, jid, row.type, select=True)
control = app.window.get_control()
@@ -407,6 +406,8 @@ def __init__(self, msg: SearchLogRow, account: str, jid:
JID) -> None:
self.type = 'contact'
if msg.kind == KindConstant.GC_MSG:
self.type = 'groupchat'
+ if jid.is_full:
+ self.type = 'pm'
self.contact = self._client.get_module('Contacts').get_contact(
jid, groupchat=self.type == 'groupchat')
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/027b2d47f61ff9329eed44597c8c061854c6218c...b8c09a6556df030ff0a107ee3893e1471153773d
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/compare/027b2d47f61ff9329eed44597c8c061854c6218c...b8c09a6556df030ff0a107ee3893e1471153773d
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits