コード例 #1
0
ファイル: adhoc.py プロジェクト: hugs/xmppclient
 def onExecuteCommand(self, iq):
     'Called when we receive a relevant iq'
     if self.testAuth:
         if not self.testAuth(jid.internJID(iq['from'])):
             pass # disallow
     node = iq.command['node']
     if node not in self.commands: # shouldn't really happen ever
         self._entity._xmlstream.send(messageStanza(iq['from'], "no such command"))
     cmd = self.commands[node]
     # call the function specified
     newIq = cmd(self._entity._xmlstream, iq)
     if newIq:
         # send the resulting iq back
         self._entity._xmlstream.send(newIq)
コード例 #2
0
ファイル: adhoc.py プロジェクト: hugs/xmppclient
 def sendResponse(result, xmlstream, to):
     xmlstream.send(messageStanza(to, result))
コード例 #3
0
ファイル: bot.py プロジェクト: hugs/xmppclient
 def receiveAuthorizedCommand(self, msg):
     "Called when we receive a message from a whitelisted address.. override in your own class"
     m = messageStanza(msg['from'], 'whitelisted :)', 'normal')
     self._xmlstream.send(m)