diff mcabber/src/commands.c @ 549:448e299e45da

MUC: "/room topic" shows the current room topic
author Mikael Berthe <mikael@lilotux.net>
date Sun, 27 Nov 2005 21:38:53 +0100
parents 887c1bd37617
children ba5271b49f21
line wrap: on
line diff
--- a/mcabber/src/commands.c	Sun Nov 27 21:26:55 2005 +0100
+++ b/mcabber/src/commands.c	Sun Nov 27 21:38:53 2005 +0100
@@ -1287,8 +1287,14 @@
   } else if (!strncasecmp(arg, "topic", 5))  {
     gchar *msg;
     arg += 5;
-    if (*arg++ != ' ') {
-      scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
+    for (; *arg && *arg == ' '; arg++)
+      ;
+    if (!*arg) {
+      const char *topic = buddy_gettopic(bud);
+      if (topic)
+        scr_LogPrint(LPRINT_NORMAL, "Topic: %s", topic);
+      else
+        scr_LogPrint(LPRINT_NORMAL, "No topic has been set");
       return;
     }
     for (; *arg && *arg == ' '; arg++)