diff src/plugins/plugin_misc_text_commands.py @ 515:29b5ef129488

plugin XEP-0045, plugin text commands: added '/title' command
author Goffi <goffi@goffi.org>
date Sat, 20 Oct 2012 18:02:14 +0200
parents 64ff046dc201
children 59b32c04e105
line wrap: on
line diff
--- a/src/plugins/plugin_misc_text_commands.py	Sat Oct 20 17:24:30 2012 +0200
+++ b/src/plugins/plugin_misc_text_commands.py	Sat Oct 20 18:02:14 2012 +0200
@@ -127,3 +127,19 @@
         """just a synonym of /leave"""
         return self.cmd_leave(mess_data, profile)
 
+    def cmd_title(self, mess_data, profile):
+        debug("Catched title command")
+        
+        if mess_data['type'] != "groupchat":
+            #/leave command does nothing if we are not on a group chat
+            info("Ignoring /title command on a non groupchat message")
+            return True
+         
+        subject = mess_data["unparsed"].strip()
+        
+        if subject:
+            room = mess_data["to"]
+            self.host.plugins["XEP-0045"].subject(room, subject, profile)
+
+        return False
+