plugin text commands: added /join command
This commit is contained in:
parent
d75b24427e
commit
4225b694d0
1 changed files with 20 additions and 4 deletions
|
|
@ -90,6 +90,22 @@ class TextCommands():
|
|||
|
||||
return False
|
||||
|
||||
def cmd_join(self, mess_data, profile):
|
||||
debug("Catched join command")
|
||||
|
||||
if mess_data['type'] != "groupchat":
|
||||
#/leave command does nothing if we are not on a group chat
|
||||
info("Ignoring /join command on a non groupchat message")
|
||||
return True
|
||||
|
||||
if mess_data["unparsed"].strip():
|
||||
room = self._getRoomJID(mess_data["unparsed"].strip(), mess_data["to"].host)
|
||||
nick = (self.host.plugins["XEP-0045"].getRoomNick(mess_data["to"].userhost(), profile) or
|
||||
self.host.getClient(profile).jid.user)
|
||||
self.host.plugins["XEP-0045"].join(room, nick, {}, profile)
|
||||
|
||||
return False
|
||||
|
||||
def cmd_leave(self, mess_data, profile):
|
||||
debug("Catched leave command")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue