示例#1
0
    def _handle_jid(self, e):
        self.log(e)
        self.jid = JID.parse(e.xml_text)
        
        self.status = ACTIVE

        self.send(self.jid, 'jid')

        # Sends the initial presence information to the server
        self.propagate(element=Stanza.to_element(Stanza(u'presence')))
        
        # Asks immediatly for the client's roster list
        iq = Iq.create_get_iq(from_jid=unicode(self.jid), stanza_id=generate_unique())
        E(u'query', namespace=XMPP_ROSTER_NS, parent=iq)   
        self.propagate(element=iq)
示例#2
0
 def create_error_iq(self, from_jid=None, to_jid=None, stanza_id=None):
     return Stanza.to_element(Stanza(u'iq', from_jid=from_jid, to_jid=to_jid,
                                     type=u'error', stanza_id=stanza_id))
示例#3
0
 def create_result_iq(self, from_jid=None, to_jid=None, stanza_id=None):
     return Stanza.to_element(Stanza(u'iq', from_jid=from_jid, to_jid=to_jid,
                                     type=u'result', stanza_id=stanza_id))