Mercurial > ~mikael > mcabber > hg
diff mcabber/src/commands.c @ 1138:8ba4b1e8b42d
Add command /buffer close_all
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 04 Feb 2007 11:41:05 +0100 |
parents | 5d7c05932b13 |
children | c30c315dc447 |
line wrap: on
line diff
--- a/mcabber/src/commands.c Sat Feb 03 20:45:37 2007 +0100 +++ b/mcabber/src/commands.c Sun Feb 04 11:41:05 2007 +0100 @@ -175,6 +175,7 @@ compl_add_category_word(COMPL_BUFFER, "%"); compl_add_category_word(COMPL_BUFFER, "purge"); compl_add_category_word(COMPL_BUFFER, "close"); + compl_add_category_word(COMPL_BUFFER, "close_all"); compl_add_category_word(COMPL_BUFFER, "scroll_lock"); compl_add_category_word(COMPL_BUFFER, "scroll_unlock"); compl_add_category_word(COMPL_BUFFER, "scroll_toggle"); @@ -1220,11 +1221,6 @@ if (!current_buddy) return; - if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP) { - scr_LogPrint(LPRINT_NORMAL, "Groups have no buffer."); - return; - } - paramlst = split_arg(arg, 2, 1); // subcmd, arg subcmd = *paramlst; arg = *(paramlst+1); @@ -1235,6 +1231,13 @@ return; } + if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP && + strcasecmp(subcmd, "close_all")) { + scr_LogPrint(LPRINT_NORMAL, "Groups have no buffer."); + free_arg_lst(paramlst); + return; + } + if (!strcasecmp(subcmd, "top")) { scr_BufferTopBottom(-1); } else if (!strcasecmp(subcmd, "bottom")) { @@ -1243,6 +1246,8 @@ scr_BufferClear(); } else if (!strcasecmp(subcmd, "close")) { scr_BufferPurge(1); + } else if (!strcasecmp(subcmd, "close_all")) { + scr_BufferPurgeAll(1); } else if (!strcasecmp(subcmd, "purge")) { scr_BufferPurge(0); } else if (!strcasecmp(subcmd, "scroll_lock")) {