Mercurial > ~mikael > mcabber > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
1137:5752017f6e2b | 1138:8ba4b1e8b42d |
---|---|
173 compl_add_category_word(COMPL_BUFFER, "search_forward"); | 173 compl_add_category_word(COMPL_BUFFER, "search_forward"); |
174 compl_add_category_word(COMPL_BUFFER, "date"); | 174 compl_add_category_word(COMPL_BUFFER, "date"); |
175 compl_add_category_word(COMPL_BUFFER, "%"); | 175 compl_add_category_word(COMPL_BUFFER, "%"); |
176 compl_add_category_word(COMPL_BUFFER, "purge"); | 176 compl_add_category_word(COMPL_BUFFER, "purge"); |
177 compl_add_category_word(COMPL_BUFFER, "close"); | 177 compl_add_category_word(COMPL_BUFFER, "close"); |
178 compl_add_category_word(COMPL_BUFFER, "close_all"); | |
178 compl_add_category_word(COMPL_BUFFER, "scroll_lock"); | 179 compl_add_category_word(COMPL_BUFFER, "scroll_lock"); |
179 compl_add_category_word(COMPL_BUFFER, "scroll_unlock"); | 180 compl_add_category_word(COMPL_BUFFER, "scroll_unlock"); |
180 compl_add_category_word(COMPL_BUFFER, "scroll_toggle"); | 181 compl_add_category_word(COMPL_BUFFER, "scroll_toggle"); |
181 | 182 |
182 // Group category | 183 // Group category |
1218 char *subcmd; | 1219 char *subcmd; |
1219 | 1220 |
1220 if (!current_buddy) | 1221 if (!current_buddy) |
1221 return; | 1222 return; |
1222 | 1223 |
1223 if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP) { | |
1224 scr_LogPrint(LPRINT_NORMAL, "Groups have no buffer."); | |
1225 return; | |
1226 } | |
1227 | |
1228 paramlst = split_arg(arg, 2, 1); // subcmd, arg | 1224 paramlst = split_arg(arg, 2, 1); // subcmd, arg |
1229 subcmd = *paramlst; | 1225 subcmd = *paramlst; |
1230 arg = *(paramlst+1); | 1226 arg = *(paramlst+1); |
1231 | 1227 |
1232 if (!subcmd || !*subcmd) { | 1228 if (!subcmd || !*subcmd) { |
1233 scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); | 1229 scr_LogPrint(LPRINT_NORMAL, "Missing parameter."); |
1230 free_arg_lst(paramlst); | |
1231 return; | |
1232 } | |
1233 | |
1234 if (buddy_gettype(BUDDATA(current_buddy)) & ROSTER_TYPE_GROUP && | |
1235 strcasecmp(subcmd, "close_all")) { | |
1236 scr_LogPrint(LPRINT_NORMAL, "Groups have no buffer."); | |
1234 free_arg_lst(paramlst); | 1237 free_arg_lst(paramlst); |
1235 return; | 1238 return; |
1236 } | 1239 } |
1237 | 1240 |
1238 if (!strcasecmp(subcmd, "top")) { | 1241 if (!strcasecmp(subcmd, "top")) { |
1241 scr_BufferTopBottom(1); | 1244 scr_BufferTopBottom(1); |
1242 } else if (!strcasecmp(subcmd, "clear")) { | 1245 } else if (!strcasecmp(subcmd, "clear")) { |
1243 scr_BufferClear(); | 1246 scr_BufferClear(); |
1244 } else if (!strcasecmp(subcmd, "close")) { | 1247 } else if (!strcasecmp(subcmd, "close")) { |
1245 scr_BufferPurge(1); | 1248 scr_BufferPurge(1); |
1249 } else if (!strcasecmp(subcmd, "close_all")) { | |
1250 scr_BufferPurgeAll(1); | |
1246 } else if (!strcasecmp(subcmd, "purge")) { | 1251 } else if (!strcasecmp(subcmd, "purge")) { |
1247 scr_BufferPurge(0); | 1252 scr_BufferPurge(0); |
1248 } else if (!strcasecmp(subcmd, "scroll_lock")) { | 1253 } else if (!strcasecmp(subcmd, "scroll_lock")) { |
1249 scr_BufferScrollLock(1); | 1254 scr_BufferScrollLock(1); |
1250 } else if (!strcasecmp(subcmd, "scroll_unlock")) { | 1255 } else if (!strcasecmp(subcmd, "scroll_unlock")) { |