comparison 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
comparison
equal deleted inserted replaced
463:339e85418b49 464:e4840b288be0
134 compl_add_category_word(COMPL_BUFFER, "bottom"); 134 compl_add_category_word(COMPL_BUFFER, "bottom");
135 compl_add_category_word(COMPL_BUFFER, "clear"); 135 compl_add_category_word(COMPL_BUFFER, "clear");
136 compl_add_category_word(COMPL_BUFFER, "top"); 136 compl_add_category_word(COMPL_BUFFER, "top");
137 compl_add_category_word(COMPL_BUFFER, "search_backward"); 137 compl_add_category_word(COMPL_BUFFER, "search_backward");
138 compl_add_category_word(COMPL_BUFFER, "search_forward"); 138 compl_add_category_word(COMPL_BUFFER, "search_forward");
139 compl_add_category_word(COMPL_BUFFER, "date");
139 compl_add_category_word(COMPL_BUFFER, "%"); 140 compl_add_category_word(COMPL_BUFFER, "%");
140 141
141 // Group category 142 // Group category
142 compl_add_category_word(COMPL_GROUP, "fold"); 143 compl_add_category_word(COMPL_GROUP, "fold");
143 compl_add_category_word(COMPL_GROUP, "unfold"); 144 compl_add_category_word(COMPL_GROUP, "unfold");
658 arg += 14; 659 arg += 14;
659 if (*arg++ == ' ') 660 if (*arg++ == ' ')
660 search_dir = 1; 661 search_dir = 1;
661 else 662 else
662 scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter"); 663 scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
664 } else if (!strncasecmp(arg, "date", 4)) {
665 arg += 4;
666 if (*arg++ != ' ') {
667 scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
668 return;
669 }
670 while (*arg == ' ') arg++;
671 if (*arg) {
672 time_t t = from_iso8601(arg, 0);
673 if (t)
674 scr_BufferDate(t);
675 else
676 scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
677 }
678 else
679 scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
663 } else if (*arg == '%') { 680 } else if (*arg == '%') {
664 arg++; 681 arg++;
665 while (*arg == ' ') arg++; 682 while (*arg == ' ') arg++;
666 if (*arg) 683 if (*arg)
667 scr_BufferPercent(atoi(arg)); 684 scr_BufferPercent(atoi(arg));