Ejemplo n.º 1
0
    def connectionMade(self):
        self.send(AvailablePresence())

        # add handlers

        # join room
        pres = Presence()
        pres['to'] = self.room + '/' + self.nick
        pres.addElement((NS_MUC, 'x'))
        self.send(pres)
Ejemplo n.º 2
0
 def connectionMade(self):
     self.send(AvailablePresence())
     # join room
     pres = Presence()
     pres['to'] = self.room + '/' + self.nick
     x = pres.addElement((NS_MUC, 'x'))
     if not self.password is None:
         x.addElement('password', content = self.password)
     self.send(pres)
Ejemplo n.º 3
0
    def sendOnePresence(self, room_name, nick, role, recipient, presenceType):
        p = Presence(recipient, presenceType)
        p['from'] = "%s@%s/%s" % (room_name, self.jid, nick)
        x = p.addElement(('http://jabber.org/protocol/muc#user', 'x'))
        item = x.addElement('item')
        item['affiliation'] = 'none'
        item['role'] = role

        self.send(p)
Ejemplo n.º 4
0
    def connectionMade(self):
        self.send(AvailablePresence())

        # add handlers

        # join room
        pres = Presence()
        pres['to'] = self.room + '/' + self.nick
        x = pres.addElement((NS_MUC, 'x'))
        if not self.password is None:
            x.addElement('password', content = self.password)
        self.send(pres)