Skip to content
Snippets Groups Projects
Commit d4eb4a35 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

fix: GroupchatInfo: Don’t set subject when loading from disco info

Disco provides only the subject text not the author and timestamp.
It’s better to set this info separately when we receive the subject
from the MUC. This has the drawback that we can’t show the subject
when we only show the disco (StartChatDialog). But everything else
would bring alot more complexity than it’s worth.

Fixes #11040
parent 9aa42d78
No related branches found
No related tags found
No related merge requests found
......@@ -191,9 +191,6 @@ def set_from_disco_info(self, info: DiscoInfo) -> None:
if self._minimal:
return
# Set subject
self.set_subject(info.muc_subject)
# Set user
has_users = info.muc_users is not None
self._ui.users.set_text(info.muc_users or '')
......
......@@ -6,6 +6,7 @@
from nbxmpp.protocol import Iq
from nbxmpp.modules.discovery import parse_disco_info
from nbxmpp.structs import MucSubject
from gajim.common.const import CSSPriority
......@@ -86,6 +87,10 @@
</query>
</iq>''')
subject = ('Lorem ipsum dolor sit amet, consetetur sadipscing elitr sed '
'diam nonumy eirmod tempor invidunt ut labore et dolore magna')
disco_info = parse_disco_info(stanza)
class GroupchatInfo(Gtk.ApplicationWindow):
......@@ -107,10 +112,9 @@ def __init__(self):
self.add(self._main_box)
self._muc_info_box.set_from_disco_info(disco_info)
self._muc_info_box.set_subject(
'Lorem ipsum dolor sit amet, consetetur sadipscing elitr sed '
'diam nonumy eirmod tempor invidunt ut labore et dolore magna')
self._muc_info_box.set_author('userX', None)
self._muc_info_box.set_subject(MucSubject(text=subject,
author='someone',
timestamp=None))
self.show_all()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment