Exemple #1
0
def onPresence(conn, msg):
    if msg.getFrom().getDomain() == config.conference:
        conf, nickname = msg.getFrom().getNode(), msg.getFrom().getResource()
        role = msg.getTag("x", namespace = xmpp.NS_MUC_USER)
        if role and role.getTag("item").getAttr("jid"):
            person = xmpp.JID(role.getTag("item").getAttr("jid"))
            alive = role.getTag("item").getAttr("role") != "none" and msg.getAttr("type") != "unavailable"
            #print "%s: %s is %s and is he alive: %s" % (conf, person, nickname, alive)
            if conf == config.mainChannel:
                registry.onPresence(person, nickname, alive)
            else:
                confObj = getConfByName(conf)
                if confObj:
                    confObj.onPresence(conn, person, nickname, alive)
Exemple #2
0
def onPresence(conn, msg):
    if msg.getFrom().getDomain() == config.conference:
        conf, nickname = msg.getFrom().getNode(), msg.getFrom().getResource()
        role = msg.getTag("x", namespace=xmpp.NS_MUC_USER)
        if role and role.getTag("item").getAttr("jid"):
            person = xmpp.JID(role.getTag("item").getAttr("jid"))
            alive = role.getTag("item").getAttr(
                "role") != "none" and msg.getAttr("type") != "unavailable"
            #print "%s: %s is %s and is he alive: %s" % (conf, person, nickname, alive)
            if conf == config.mainChannel:
                registry.onPresence(person, nickname, alive)
            else:
                confObj = getConfByName(conf)
                if confObj:
                    confObj.onPresence(conn, person, nickname, alive)
    raise xmpp.NodeProcessed
Exemple #3
0
def onBattleMessage(conn, msg, confName):
    conf = getConfByName(confName)
    if conf:
        conf.onMessage(conn, msg)
Exemple #4
0
def onBattleMessage(conn, msg, confName):
    conf = getConfByName(confName)
    if conf:
        conf.onMessage(conn, msg)