Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
7b3971b6 by wurstsalat at 2022-11-16T16:50:52+01:00
fix: Preview: Respect MUC context for PMs
Fixes #11289
- - - - -
2 changed files:
- gajim/common/modules/contacts.py
- gajim/gtk/conversation/rows/message.py
Changes:
=====================================
gajim/common/modules/contacts.py
=====================================
@@ -863,6 +863,10 @@ def is_in_roster(self) -> bool:
def room(self) -> GroupchatContact:
return self._module('Contacts').get_bare_contact(self.jid.bare)
+ @property
+ def muc_context(self) -> Optional[str]:
+ return self.room.muc_context
+
@property
def presence(self) -> MUCPresenceData:
return self._presence
=====================================
gajim/gtk/conversation/rows/message.py
=====================================
@@ -45,6 +45,7 @@
from gajim.common.i18n import _
from gajim.common.i18n import is_rtl_text
from gajim.common.modules.contacts import GroupchatContact
+from gajim.common.modules.contacts import GroupchatParticipant
from gajim.common.types import ChatContactT
from .base import BaseRow
@@ -121,7 +122,8 @@ def __init__(self,
if is_previewable:
muc_context = None
- if isinstance(self._contact, GroupchatContact):
+ if isinstance(self._contact,
+ (GroupchatContact, GroupchatParticipant)):
muc_context = self._contact.muc_context
self._message_widget = PreviewWidget(account)
app.preview_manager.create_preview(
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/7b3971b65374d51f74677a91618568ecbe672d25
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/7b3971b65374d51f74677a91618568ecbe672d25
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