MUC: Don't send empty body when setting room topic
authorMikael Berthe <mikael@lilotux.net>
Sat, 28 Aug 2021 22:53:44 +0200
changeset 2359 f35b17fd1e73
parent 2358 b010ffcae282
child 2360 fef9f1a7d2aa
MUC: Don't send empty body when setting room topic Thanks to Minoru for the report.
mcabber/mcabber/xmpp.c
--- a/mcabber/mcabber/xmpp.c	Tue Oct 22 19:59:21 2019 +0200
+++ b/mcabber/mcabber/xmpp.c	Sat Aug 28 22:53:44 2021 +0200
@@ -400,8 +400,10 @@
 #endif // HAVE_GPGME || defined XEP0085
 
   x = lm_message_new_with_sub_type(fjid, LM_MESSAGE_TYPE_MESSAGE, subtype);
-  lm_message_node_add_child(x->node, "body",
-                            enc ? "This message is PGP-encrypted." : text);
+  if (text) {
+    lm_message_node_add_child(x->node, "body",
+                              enc ? "This message is PGP-encrypted." : text);
+  }
 
   if (subject)
     lm_message_node_add_child(x->node, "subject", subject);