Hello!!!

i need help with the attached python script, my intention is to handle
subscription
and unsubscription but so far i can't make my callback react to those types
of presence
if i send a presence of type available or unavailable it works ok, but
anything except those
two and my callback (presenceCB) doesn't react at all.
I'm using jabber.py-0.3-1 and the script's code is mostly from the
test_client provided
with it, btw test_client works flawlessly so i don't understand why mine
don't :(

Any help would be appreciated,

TIA
 Ali
import jabber

def presenceCB(con, prs):
        who = str(prs.getFrom())
        type = prs.getType()
        if type == None:
                type = "available"
        print "Who: %s" % (who)
        print "Type: %s" % (type)

def messageCB(con, prs):
        print "Who: %s" % (str(prs.getFrom))

con = jabber.Client(host="localhost", debug=True)
con.setPresenceHandler(presenceCB)
con.setMessageHandler(messageCB)
con.connect()
con.auth("horariod", "secret", "python")
print "Conected..."
con.sendInitPresence()
while(1):
        con.process(3)



Reply via email to