diff mcabber/src/commands.c @ 464:e4840b288be0

Add "/buffer date"
author Mikael Berthe <mikael@lilotux.net>
date Thu, 29 Sep 2005 22:31:56 +0200
parents d580e87c11ed
children a926523d2392
line wrap: on
line diff
--- a/mcabber/src/commands.c	Thu Sep 29 22:03:22 2005 +0200
+++ b/mcabber/src/commands.c	Thu Sep 29 22:31:56 2005 +0200
@@ -136,6 +136,7 @@
   compl_add_category_word(COMPL_BUFFER, "top");
   compl_add_category_word(COMPL_BUFFER, "search_backward");
   compl_add_category_word(COMPL_BUFFER, "search_forward");
+  compl_add_category_word(COMPL_BUFFER, "date");
   compl_add_category_word(COMPL_BUFFER, "%");
 
   // Group category
@@ -660,6 +661,22 @@
       search_dir = 1;
     else
       scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
+  } else if (!strncasecmp(arg, "date", 4)) {
+    arg += 4;
+    if (*arg++ != ' ') {
+      scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
+      return;
+    }
+    while (*arg == ' ') arg++;
+    if (*arg) {
+      time_t t = from_iso8601(arg, 0);
+      if (t)
+        scr_BufferDate(t);
+      else
+        scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
+    }
+    else
+      scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
   } else if (*arg == '%') {
     arg++;
     while (*arg == ' ') arg++;