X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fhcxmpp.git;a=blobdiff_plain;f=xmpp.c;h=b25898466cedd68f375976bc7e93c4d38f41252f;hp=44f576190f746876c825ce52c74386cff90ae133;hb=HEAD;hpb=d50bdf2dfd70a1665cb2056dfd539e9768c2f505 diff --git a/xmpp.c b/xmpp.c index 44f5761..b258984 100644 --- a/xmpp.c +++ b/xmpp.c @@ -175,6 +175,18 @@ hc_xmpp_set_sent_msg_hook (hc_xmpp_t *xmpp, hc_xmpp_hook_t hook) xmpp->sentmsghook = hook; } +void +hc_xmpp_set_pres_hook (hc_xmpp_t *xmpp, hc_xmpp_hook_t hook) +{ + xmpp->preshook = hook; +} + +void +hc_xmpp_set_sent_pres_hook (hc_xmpp_t *xmpp, hc_xmpp_hook_t hook) +{ + xmpp->sentpreshook = hook; +} + void hc_xmpp_recv_message (hc_xmpp_t *xmpp, iks *stanza) { @@ -188,3 +200,17 @@ hc_xmpp_sent_message (hc_xmpp_t *xmpp, iks *stanza) if (xmpp->sentmsghook) xmpp->sentmsghook (xmpp, stanza); } + +void +hc_xmpp_recv_presence (hc_xmpp_t *xmpp, iks *stanza) +{ + if (xmpp->preshook) + xmpp->preshook (xmpp, stanza); +} + +void +hc_xmpp_sent_presence (hc_xmpp_t *xmpp, iks *stanza) +{ + if (xmpp->sentpreshook) + xmpp->sentpreshook (xmpp, stanza); +}