changeset 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 300e7bf4416a
children fef71336e429
files mcabber/mcabber/xmpp_muc.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_muc.c	Wed May 14 13:57:56 2014 +0400
+++ b/mcabber/mcabber/xmpp_muc.c	Wed May 14 14:13:27 2014 +0400
@@ -335,12 +335,17 @@
   *mbjid = lm_message_node_get_attribute(y, "jid");
   *mbnick = lm_message_node_get_attribute(y, "nick");
   // For kick/ban, there can be actor and reason tags
+  z = lm_message_node_find_child(y, "actor");
+  if (z) {
+    // prefer nick over jid
+    *actorjid = lm_message_node_get_attribute(z, "nick");
+    if (!*actorjid)
+      *actorjid = lm_message_node_get_attribute(z, "jid");
+  }
+
   *reason = lm_message_node_get_child_value(y, "reason");
   if (*reason && !**reason)
     *reason = NULL;
-  z = lm_message_node_find_child(y, "actor");
-  if (z)
-    *actorjid = lm_message_node_get_attribute(z, "jid");
 }
 
 //  muc_handle_join(...)