diff options
author | James Booth <boothj5@gmail.com> | 2014-10-18 19:10:50 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-10-18 19:10:50 +0100 |
commit | 77674beb7e8f82716f17e7d0dd60d989b54ed6d1 (patch) | |
tree | 3fd88f4a41fdfda56f8edcf94f1327d5b5266536 /src/xmpp | |
parent | 9792f3ddc9cb6b3c86e9915a30cfc98626ad00c3 (diff) | |
download | profani-tty-77674beb7e8f82716f17e7d0dd60d989b54ed6d1.tar.gz |
Show occupants role/affiliation changes
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/presence.c | 24 | ||||
-rw-r--r-- | src/xmpp/stanza.c | 4 | ||||
-rw-r--r-- | src/xmpp/stanza.h | 4 |
3 files changed, 17 insertions, 15 deletions
diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c index 80377703..620a871d 100644 --- a/src/xmpp/presence.c +++ b/src/xmpp/presence.c @@ -736,15 +736,15 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * // kicked from room } else if (g_slist_find_custom(status_codes, "307", (GCompareFunc)g_strcmp0) != NULL) { - char *actor = stanza_get_kickban_actor(stanza); - char *reason = stanza_get_kickban_reason(stanza); + char *actor = stanza_get_actor(stanza); + char *reason = stanza_get_reason(stanza); handle_room_kicked(room, actor, reason); free(reason); // banned from room } else if (g_slist_find_custom(status_codes, "301", (GCompareFunc)g_strcmp0) != NULL) { - char *actor = stanza_get_kickban_actor(stanza); - char *reason = stanza_get_kickban_reason(stanza); + char *actor = stanza_get_actor(stanza); + char *reason = stanza_get_reason(stanza); handle_room_banned(room, actor, reason); free(reason); @@ -759,8 +759,8 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * // self online } else { gboolean config_required = stanza_muc_requires_config(stanza); - char *actor = stanza_get_kickban_actor(stanza); - char *reason = stanza_get_kickban_reason(stanza); + char *actor = stanza_get_actor(stanza); + char *reason = stanza_get_reason(stanza); handle_muc_self_online(room, nick, config_required, role, affiliation, actor, reason, jid, show_str, status_str); } @@ -781,15 +781,15 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * // kicked from room if (g_slist_find_custom(status_codes, "307", (GCompareFunc)g_strcmp0) != NULL) { - char *actor = stanza_get_kickban_actor(stanza); - char *reason = stanza_get_kickban_reason(stanza); + char *actor = stanza_get_actor(stanza); + char *reason = stanza_get_reason(stanza); handle_room_occupent_kicked(room, nick, actor, reason); free(reason); // banned from room } else if (g_slist_find_custom(status_codes, "301", (GCompareFunc)g_strcmp0) != NULL) { - char *actor = stanza_get_kickban_actor(stanza); - char *reason = stanza_get_kickban_reason(stanza); + char *actor = stanza_get_actor(stanza); + char *reason = stanza_get_reason(stanza); handle_room_occupent_banned(room, nick, actor, reason); free(reason); @@ -807,7 +807,9 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * _handle_caps(stanza); } - handle_muc_occupant_online(room, nick, jid, role, affiliation, show_str, status_str); + char *actor = stanza_get_actor(stanza); + char *reason = stanza_get_reason(stanza); + handle_muc_occupant_online(room, nick, jid, role, affiliation, actor, reason, show_str, status_str); } } diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 82cebd6b..019f9629 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -1181,7 +1181,7 @@ stanza_get_muc_destroy_reason(xmpp_stanza_t *stanza) } char * -stanza_get_kickban_actor(xmpp_stanza_t *stanza) +stanza_get_actor(xmpp_stanza_t *stanza) { char *stanza_name = xmpp_stanza_get_name(stanza); if (g_strcmp0(stanza_name, STANZA_NAME_PRESENCE) == 0) { @@ -1207,7 +1207,7 @@ stanza_get_kickban_actor(xmpp_stanza_t *stanza) } char * -stanza_get_kickban_reason(xmpp_stanza_t *stanza) +stanza_get_reason(xmpp_stanza_t *stanza) { char *stanza_name = xmpp_stanza_get_name(stanza); if (g_strcmp0(stanza_name, STANZA_NAME_PRESENCE) == 0) { diff --git a/src/xmpp/stanza.h b/src/xmpp/stanza.h index cbb6d23f..1a83c5a6 100644 --- a/src/xmpp/stanza.h +++ b/src/xmpp/stanza.h @@ -258,7 +258,7 @@ gboolean stanza_room_destroyed(xmpp_stanza_t *stanza); char* stanza_get_muc_destroy_alternative_room(xmpp_stanza_t *stanza); char* stanza_get_muc_destroy_alternative_password(xmpp_stanza_t *stanza); char* stanza_get_muc_destroy_reason(xmpp_stanza_t *stanza); -char* stanza_get_kickban_actor(xmpp_stanza_t *stanza); -char* stanza_get_kickban_reason(xmpp_stanza_t *stanza); +char* stanza_get_actor(xmpp_stanza_t *stanza); +char* stanza_get_reason(xmpp_stanza_t *stanza); #endif |