Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/xmpp_muc.c @ 2124:af7e705380b2
MUC: when supported, prefer to show actor's nick over actor's jid on kick/ban.
author | sh!zeeg <shizeeque@gmail.com> |
---|---|
date | Wed, 14 May 2014 14:13:27 +0400 |
parents | 564d99cdf0d1 |
children | fef71336e429 |
comparison
equal
deleted
inserted
replaced
2123:300e7bf4416a | 2124:af7e705380b2 |
---|---|
333 from, p); | 333 from, p); |
334 } | 334 } |
335 *mbjid = lm_message_node_get_attribute(y, "jid"); | 335 *mbjid = lm_message_node_get_attribute(y, "jid"); |
336 *mbnick = lm_message_node_get_attribute(y, "nick"); | 336 *mbnick = lm_message_node_get_attribute(y, "nick"); |
337 // For kick/ban, there can be actor and reason tags | 337 // For kick/ban, there can be actor and reason tags |
338 z = lm_message_node_find_child(y, "actor"); | |
339 if (z) { | |
340 // prefer nick over jid | |
341 *actorjid = lm_message_node_get_attribute(z, "nick"); | |
342 if (!*actorjid) | |
343 *actorjid = lm_message_node_get_attribute(z, "jid"); | |
344 } | |
345 | |
338 *reason = lm_message_node_get_child_value(y, "reason"); | 346 *reason = lm_message_node_get_child_value(y, "reason"); |
339 if (*reason && !**reason) | 347 if (*reason && !**reason) |
340 *reason = NULL; | 348 *reason = NULL; |
341 z = lm_message_node_find_child(y, "actor"); | |
342 if (z) | |
343 *actorjid = lm_message_node_get_attribute(z, "jid"); | |
344 } | 349 } |
345 | 350 |
346 // muc_handle_join(...) | 351 // muc_handle_join(...) |
347 // Handle a join event in a MUC room. | 352 // Handle a join event in a MUC room. |
348 // This function will return the new_member value TRUE if somebody else joins | 353 // This function will return the new_member value TRUE if somebody else joins |