comparison mcabber/mcabber/commands.c @ 1729:e6e89b1d7831

Minor style and header updates
author Mikael Berthe <mikael@lilotux.net>
date Sun, 28 Feb 2010 15:19:27 +0100
parents 98917ddcbaab
children 4e57d6275a86
comparison
equal deleted inserted replaced
1728:15b3834cbe5f 1729:e6e89b1d7831
1 /* 1 /*
2 * commands.c -- user commands handling 2 * commands.c -- user commands handling
3 * 3 *
4 * Copyright (C) 2005-2009 Mikael Berthe <mikael@lilotux.net> 4 * Copyright (C) 2005-2010 Mikael Berthe <mikael@lilotux.net>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at 8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version. 9 * your option) any later version.
196 &do_roster); 196 &do_roster);
197 cmd_add("say", "Say something to the selected buddy", 0, 0, &do_say); 197 cmd_add("say", "Say something to the selected buddy", 0, 0, &do_say);
198 cmd_add("say_to", "Say something to a specific buddy", COMPL_JID, 0, 198 cmd_add("say_to", "Say something to a specific buddy", COMPL_JID, 0,
199 &do_say_to); 199 &do_say_to);
200 cmd_add("screen_refresh", "Redraw mcabber screen", 0, 0, &do_screen_refresh); 200 cmd_add("screen_refresh", "Redraw mcabber screen", 0, 0, &do_screen_refresh);
201 //cmd_add("search");
202 cmd_add("set", "Set/query an option value", 0, 0, &do_set); 201 cmd_add("set", "Set/query an option value", 0, 0, &do_set);
203 cmd_add("source", "Read a configuration file", 0, 0, &do_source); 202 cmd_add("source", "Read a configuration file", 0, 0, &do_source);
204 cmd_add("status", "Show or set your status", COMPL_STATUS, 0, &do_status); 203 cmd_add("status", "Show or set your status", COMPL_STATUS, 0, &do_status);
205 cmd_add("status_to", "Show or set your status for one recipient", 204 cmd_add("status_to", "Show or set your status for one recipient",
206 COMPL_JID, COMPL_STATUS, &do_status_to); 205 COMPL_JID, COMPL_STATUS, &do_status_to);
1272 send_message_to(bjid, msg, subj, type_overwrite, FALSE); 1271 send_message_to(bjid, msg, subj, type_overwrite, FALSE);
1273 } 1272 }
1274 1273
1275 static LmMessageSubType scan_mtype(char **arg) 1274 static LmMessageSubType scan_mtype(char **arg)
1276 { 1275 {
1277 //Try splitting it 1276 // Try splitting it
1278 char **parlist = split_arg(*arg, 2, 1); 1277 char **parlist = split_arg(*arg, 2, 1);
1279 LmMessageSubType result = LM_MESSAGE_SUB_TYPE_NOT_SET; 1278 LmMessageSubType result = LM_MESSAGE_SUB_TYPE_NOT_SET;
1280 //Is it any good parameter? 1279 // Is it a good parameter?
1281 if (parlist && *parlist) { 1280 if (parlist && *parlist) {
1282 if (!strcmp("-n", *parlist)) { 1281 if (!strcmp("-n", *parlist)) {
1283 result = LM_MESSAGE_SUB_TYPE_NORMAL; 1282 result = LM_MESSAGE_SUB_TYPE_NORMAL;
1284 } else if (!strcmp("-h", *parlist)) { 1283 } else if (!strcmp("-h", *parlist)) {
1285 result = LM_MESSAGE_SUB_TYPE_HEADLINE; 1284 result = LM_MESSAGE_SUB_TYPE_HEADLINE;
1286 } 1285 }
1287 if (result != LM_MESSAGE_SUB_TYPE_NOT_SET || (!strcmp("--", *parlist))) 1286 if (result != LM_MESSAGE_SUB_TYPE_NOT_SET || (!strcmp("--", *parlist)))
1288 *arg += strlen(*arg) - (parlist[1] ? strlen(parlist[1]) : 0); 1287 *arg += strlen(*arg) - (parlist[1] ? strlen(parlist[1]) : 0);
1289 } 1288 }
1290 //Anything found? -> skip it 1289 // Anything found? -> skip it
1291 free_arg_lst(parlist); 1290 free_arg_lst(parlist);
1292 return result; 1291 return result;
1293 } 1292 }
1294 1293
1295 static void do_say_internal(char *arg, int parse_flags) 1294 static void do_say_internal(char *arg, int parse_flags)