def addUser(jid): jid = unicode(jid.getStripped()) iMan.set_entry('roster', jid, "last_login", time.time()) iMan.set_entry('roster', jid, "last_message", time.time()) set_attr(jid, 'rank', const.RANK_USER)
def set_attr(jid, attr, rank): """Set 'jid's attr to value.""" return iMan.set_entry('roster', jid, attr, value)