diff frontends/src/quick_frontend/quick_chat.py @ 2022:88c41a195728

primitivus (chat): added :topic (and :subject and :title aliases) to change subject with a dialog (/!\ urwid SàText need to be updated)
author Goffi <goffi@goffi.org>
date Sun, 24 Jul 2016 19:00:50 +0200
parents f67da1cab6d3
children 01aff34e8873
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_chat.py	Sun Jul 24 18:59:02 2016 +0200
+++ b/frontends/src/quick_frontend/quick_chat.py	Sun Jul 24 19:00:50 2016 +0200
@@ -423,9 +423,17 @@
 
     def setSubject(self, subject):
         """Set title for a group chat"""
-        self.subject = subject
         if self.type != C.CHAT_GROUP:
             raise exceptions.InternalError("trying to set subject for a non group chat window")
+        self.subject = subject
+
+    def changeSubject(self, new_subject):
+        """Change the subject of the room
+
+        This change the subject on the room itself (i.e. via XMPP),
+        while setSubject change the subject of this widget
+        """
+        self.host.bridge.mucSubject(unicode(self.target), new_subject, self.profile)
 
     def addGamePanel(self, widget):
         """Insert a game panel to this Chat dialog.