add subscription support

This commit is contained in:
Dmitry Podgorny
2012-11-11 14:00:21 +02:00
parent 7958a450bd
commit c3b0e80432
10 changed files with 173 additions and 19 deletions

View File

@@ -144,6 +144,32 @@ prof_handle_error_message(const char *from, const char *err_msg)
win_show_error_msg(from, err_msg);
}
void
prof_handle_subscription(const char *from, jabber_subscr_t type)
{
switch (type) {
case PRESENCE_SUBSCRIBE:
/* TODO: auto-subscribe if needed */
cons_show("Received authorization request from %s", from);
log_info("Received authorization request from %s", from);
win_show_system_msg(from, "Authorization request, type '/sub add' to accept or '/sub del' to reject");
break;
case PRESENCE_SUBSCRIBED:
cons_show("Subscription received from %s", from);
log_info("Subscription received from %s", from);
win_show_system_msg(from, "Subscribed");
break;
case PRESENCE_UNSUBSCRIBED:
cons_show("%s deleted subscription", from);
log_info("%s deleted subscription", from);
win_show_system_msg(from, "Unsubscribed");
break;
default:
/* unknown type */
break;
}
}
void
prof_handle_login_success(const char *jid)
{