Logo Search packages:      
Sourcecode: jabber-irc version File versions  Download package

def adhoc::Retrieve_Rules::cmdFirstStage (   self,
  conn,
  event 
)

Build the reply to complete the request

Definition at line 286 of file adhoc.py.

00286                                       :
        """Build the reply to complete the request"""
        fromjid = event.getFrom().getStripped().__str__()
        to = event.getTo()
        room = irc_ulower(to.getNode())
        try:
            channel, server = room.split('%',1)
            channel = JIDDecode(channel)
        except ValueError:
            channel=''
            server=room
            sys.exc_clear()
        if channel == '':
            if self.transport.users.has_key(fromjid) \
              and self.transport.users[fromjid].has_key(server):
                # TODO: RULES must become pending event, so it can go back to the right resource
                self.transport.users[fromjid][server].ruleshash = ''
                self.transport.users[fromjid][server].send_raw('RULES')
                reply = event.buildReply('result')
                form = DataForm(typ='result',data=[DataField(value='Command completed.',typ='fixed')])
                reply.addChild(name='command',namespace=NS_COMMANDS,attrs={'node':event.getTagAttr('command','node'),'sessionid':self.getSessionID(),'status':'completed'},payload=[form])
                self._owner.send(reply)
                raise NodeProcessed
            else:
                self._owner.send(Error(event,ERR_ITEM_NOT_FOUND))
                raise NodeProcessed
        else:
            self._owner.send(Error(event,ERR_ITEM_NOT_FOUND))
            raise NodeProcessed
            raise NodeProcessed


Generated by  Doxygen 1.6.0   Back to index