Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
88daed91
by wurstsalat at 2022-11-25T16:24:19+01:00
-
b8c09a65
by wurstsalat at 2022-11-25T17:38:12+01:00
2 changed files:
Changes:
| ... | ... | @@ -147,7 +147,8 @@ def add_group_chat_contact(self, jid: Union[str, JID]) -> GroupchatContact: |
| 147 | 147 | if contact is not None:
|
| 148 | 148 | if not isinstance(contact, GroupchatContact):
|
| 149 | 149 | raise ValueError(f'Trying to add GroupchatContact {jid}, '
|
| 150 | - f'but contact exists already as {contact}')
|
|
| 150 | + f'but contact already exists as {contact} '
|
|
| 151 | + f'(in roster: {contact.is_in_roster})')
|
|
| 151 | 152 | return contact
|
| 152 | 153 | |
| 153 | 154 | contact = GroupchatContact(self._log, jid, self._account)
|
| ... | ... | @@ -201,7 +201,7 @@ def _add_results(self) -> None: |
| 201 | 201 | result_row = ResultRow(
|
| 202 | 202 | msg,
|
| 203 | 203 | accounts[msg.account_id],
|
| 204 | - archive_jid.jid)
|
|
| 204 | + JID.from_string(archive_jid.jid))
|
|
| 205 | 205 | else:
|
| 206 | 206 | assert self._account is not None
|
| 207 | 207 | assert self._jid is not None
|
| ... | ... | @@ -347,8 +347,7 @@ def _on_row_activated(_listbox: SearchView, row: ResultRow) -> None: |
| 347 | 347 | control.scroll_to_message(row.log_line_id, row.timestamp)
|
| 348 | 348 | return
|
| 349 | 349 | |
| 350 | - # Wrong chat or no control opened
|
|
| 351 | - # TODO: type 'pm' is KindConstant.CHAT_MSG_RECV, too
|
|
| 350 | + # Other chat or no control opened
|
|
| 352 | 351 | jid = JID.from_string(row.jid)
|
| 353 | 352 | app.window.add_chat(row.account, jid, row.type, select=True)
|
| 354 | 353 | control = app.window.get_control()
|
| ... | ... | @@ -407,6 +406,8 @@ def __init__(self, msg: SearchLogRow, account: str, jid: JID) -> None: |
| 407 | 406 | self.type = 'contact'
|
| 408 | 407 | if msg.kind == KindConstant.GC_MSG:
|
| 409 | 408 | self.type = 'groupchat'
|
| 409 | + if jid.is_full:
|
|
| 410 | + self.type = 'pm'
|
|
| 410 | 411 | |
| 411 | 412 | self.contact = self._client.get_module('Contacts').get_contact(
|
| 412 | 413 | jid, groupchat=self.type == 'groupchat')
|