changeset 2006:fa6694a193ec

Add configuration setting for previous commit
author Hermitifier
date Thu, 09 Feb 2012 14:21:36 +0100
parents e0aedfa091ec
children a859ed648638
files mcabber/mcabber/xmpp_muc.c mcabber/mcabberrc.example
diffstat 2 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_muc.c	Tue Feb 07 12:13:02 2012 +0100
+++ b/mcabber/mcabber/xmpp_muc.c	Thu Feb 09 14:21:36 2012 +0100
@@ -357,11 +357,19 @@
   gchar *nickjid;
   gchar *mbuf;
   enum room_flagjoins flagjoins;
+  char *tmp = NULL;
+  int printjid;
 
-  if (mbjid && autowhois == autowhois_off)
+  printjid = settings_opt_get_int("muc_print_jid");
+  if (mbjid && autowhois == autowhois_off && printjid) {
+    if (printjid == 1)
+      tmp = strchr(mbjid, JID_RESOURCE_SEPARATOR);
+    if (tmp) *tmp = '\0';
     nickjid = g_strdup_printf("%s <%s>", rname, mbjid);
-  else
+    if (tmp) *tmp = JID_RESOURCE_SEPARATOR;
+  } else {
     nickjid = g_strdup(rname);
+  }
 
   if (!buddy_getinsideroom(room_elt->data)) {
     // We weren't inside the room yet.  Now we are.
--- a/mcabber/mcabberrc.example	Tue Feb 07 12:13:02 2012 +0100
+++ b/mcabber/mcabberrc.example	Thu Feb 09 14:21:36 2012 +0100
@@ -323,6 +323,12 @@
 # Set 'muc_auto_whois' to 1 if you want to call /room whois each time
 # somebody joins a room. (default: 0)
 #set muc_auto_whois = 0
+# Set 'muc_print_jid' to see real jid in non-anonynmous room when somebody
+# joins. This setting will be ignored when auto_whois is enabled.
+# 0: only nick (don't print jid even if available)
+# 1: nick and bare jid
+# 2: nick and full jid with resource
+#set muc_print_jid = 1
 #
 # Set 'muc_disable_nick_hl' to 1 if you don't want mcabber to color lines
 # containing your nickname in a MUC room.