def sendPresence(pytrans, to, fro, show=None, status=None, priority=None, ptype=None, avatarHash=None, nickname=None, payload=[]):
# Strip the resource off any presence subscribes (as per XMPP RFC 3921 Section 5.1.6)
# Makes eJabberd behave :)
- if ptype == "subscribe":
+ if ptype in ("subscribe", "subscribed", "unsubscribe", "unsubscribed"):
to = jid.intern(to).userhost()
+ fro = jid.intern(fro).userhost()
el = Element((None, "presence"))
el.attributes["to"] = to