comparison 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
comparison
equal deleted inserted replaced
514:fe79a724e6fa 515:29b5ef129488
125 125
126 def cmd_part(self, mess_data, profile): 126 def cmd_part(self, mess_data, profile):
127 """just a synonym of /leave""" 127 """just a synonym of /leave"""
128 return self.cmd_leave(mess_data, profile) 128 return self.cmd_leave(mess_data, profile)
129 129
130 def cmd_title(self, mess_data, profile):
131 debug("Catched title command")
132
133 if mess_data['type'] != "groupchat":
134 #/leave command does nothing if we are not on a group chat
135 info("Ignoring /title command on a non groupchat message")
136 return True
137
138 subject = mess_data["unparsed"].strip()
139
140 if subject:
141 room = mess_data["to"]
142 self.host.plugins["XEP-0045"].subject(room, subject, profile)
143
144 return False
145