changeset 2025:33426f7fb4a9

MUC mediated invitation: don't show empty reason on declined invitation
author Mikael Berthe <mikael@lilotux.net>
date Sat, 25 Aug 2012 12:05:31 +0200
parents 789779fd728d
children 564d99cdf0d1
files mcabber/mcabber/xmpp_muc.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_muc.c	Sat Aug 25 12:05:19 2012 +0200
+++ b/mcabber/mcabber/xmpp_muc.c	Sat Aug 25 12:05:31 2012 +0200
@@ -767,7 +767,7 @@
   GSList *room_elt;
 
   sbuf = g_string_new("");
-  if (reason) {
+  if (reason && reason[0]) {
     g_string_printf(sbuf,
                     "Received an invitation to <%s>, from <%s>, reason: %s",
                     to, from, reason);
@@ -857,11 +857,11 @@
     const char *decline_from = lm_message_node_get_attribute(node, "from");
     const char *reason = lm_message_node_get_child_value(node, "reason");
     if (decline_from) {
-      if (reason)
-        scr_LogPrint(LPRINT_LOGNORM, "<%s> declines your invitation: %s.",
+      if (reason && reason[0])
+        scr_LogPrint(LPRINT_LOGNORM, "<%s> declined your invitation: %s.",
                      from, reason);
       else
-        scr_LogPrint(LPRINT_LOGNORM, "<%s> declines your invitation.", from);
+        scr_LogPrint(LPRINT_LOGNORM, "<%s> declined your invitation.", from);
     }
   }