comparison mcabber/mcabber/xmpp_muc.c @ 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 33483d3324cf
children 564d99cdf0d1
comparison
equal deleted inserted replaced
2024:789779fd728d 2025:33426f7fb4a9
765 GString *sbuf; 765 GString *sbuf;
766 char *barejid; 766 char *barejid;
767 GSList *room_elt; 767 GSList *room_elt;
768 768
769 sbuf = g_string_new(""); 769 sbuf = g_string_new("");
770 if (reason) { 770 if (reason && reason[0]) {
771 g_string_printf(sbuf, 771 g_string_printf(sbuf,
772 "Received an invitation to <%s>, from <%s>, reason: %s", 772 "Received an invitation to <%s>, from <%s>, reason: %s",
773 to, from, reason); 773 to, from, reason);
774 } else { 774 } else {
775 g_string_printf(sbuf, "Received an invitation to <%s>, from <%s>", 775 g_string_printf(sbuf, "Received an invitation to <%s>, from <%s>",
855 node = lm_message_node_get_child(x, "decline"); 855 node = lm_message_node_get_child(x, "decline");
856 if (node) { 856 if (node) {
857 const char *decline_from = lm_message_node_get_attribute(node, "from"); 857 const char *decline_from = lm_message_node_get_attribute(node, "from");
858 const char *reason = lm_message_node_get_child_value(node, "reason"); 858 const char *reason = lm_message_node_get_child_value(node, "reason");
859 if (decline_from) { 859 if (decline_from) {
860 if (reason) 860 if (reason && reason[0])
861 scr_LogPrint(LPRINT_LOGNORM, "<%s> declines your invitation: %s.", 861 scr_LogPrint(LPRINT_LOGNORM, "<%s> declined your invitation: %s.",
862 from, reason); 862 from, reason);
863 else 863 else
864 scr_LogPrint(LPRINT_LOGNORM, "<%s> declines your invitation.", from); 864 scr_LogPrint(LPRINT_LOGNORM, "<%s> declined your invitation.", from);
865 } 865 }
866 } 866 }
867 867
868 // status codes 868 // status codes
869 for (node = x -> children; node; node = node -> next) { 869 for (node = x -> children; node; node = node -> next) {