Do not send a groupchat-style message when changing a MUC room topic
Esp. bad when the permission is denied... (Reported by bb)
--- a/mcabber/src/commands.c Sat Feb 23 12:00:56 2008 +0100
+++ b/mcabber/src/commands.c Sun Feb 24 13:41:36 2008 +0100
@@ -2526,8 +2526,6 @@
static void room_topic(gpointer bud, char *arg)
{
- gchar *msg;
-
if (!buddy_getinsideroom(bud)) {
scr_LogPrint(LPRINT_NORMAL, "You are not in this room.");
return;
@@ -2545,10 +2543,8 @@
arg = to_utf8(arg);
// Set the topic
- msg = g_strdup_printf("%s has set the topic to: %s", mkcmdstr("me"), arg);
- jb_send_msg(buddy_getjid(bud), msg, ROSTER_TYPE_ROOM, arg, NULL, NULL, NULL);
+ jb_send_msg(buddy_getjid(bud), NULL, ROSTER_TYPE_ROOM, arg, NULL, NULL, NULL);
g_free(arg);
- g_free(msg);
}
static void room_destroy(gpointer bud, char *arg)
--- a/mcabber/src/jabglue.c Sat Feb 23 12:00:56 2008 +0100
+++ b/mcabber/src/jabglue.c Sun Feb 24 13:41:36 2008 +0100
@@ -601,7 +601,11 @@
if (encrypted)
*encrypted = 0;
- if (!online) return;
+ if (!online)
+ return;
+
+ if (!text && type == ROSTER_TYPE_USER)
+ return;
if (type_overwrite)
strtype = type_overwrite;