comparison mcabber/src/commands.c @ 436:802da817a684

Add /rawxml command
author Mikael Berthe <mikael@lilotux.net>
date Thu, 15 Sep 2005 23:22:12 +0200
parents 48e7808c4191
children b44be19d6229
comparison
equal deleted inserted replaced
434:c918c1831d58 436:802da817a684
47 static void do_set(char *arg); 47 static void do_set(char *arg);
48 static void do_alias(char *arg); 48 static void do_alias(char *arg);
49 static void do_bind(char *arg); 49 static void do_bind(char *arg);
50 static void do_connect(char *arg); 50 static void do_connect(char *arg);
51 static void do_disconnect(char *arg); 51 static void do_disconnect(char *arg);
52 static void do_rawxml(char *arg);
52 53
53 // Global variable for the commands list 54 // Global variable for the commands list
54 static GSList *Commands; 55 static GSList *Commands;
55 56
56 57
90 0, &do_move); 91 0, &do_move);
91 cmd_add("msay", "Send a multi-lines message to the selected buddy", 92 cmd_add("msay", "Send a multi-lines message to the selected buddy",
92 COMPL_MULTILINE, 0, &do_msay); 93 COMPL_MULTILINE, 0, &do_msay);
93 //cmd_add("nick"); 94 //cmd_add("nick");
94 cmd_add("quit", "Exit the software", 0, 0, NULL); 95 cmd_add("quit", "Exit the software", 0, 0, NULL);
96 cmd_add("rawxml", "Send a raw XML string", 0, 0, &do_rawxml);
95 cmd_add("rename", "Rename the current buddy", 0, 0, &do_rename); 97 cmd_add("rename", "Rename the current buddy", 0, 0, &do_rename);
96 //cmd_add("request_auth"); 98 //cmd_add("request_auth");
97 cmd_add("roster", "Manipulate the roster/buddylist", COMPL_ROSTER, 0, 99 cmd_add("roster", "Manipulate the roster/buddylist", COMPL_ROSTER, 0,
98 &do_roster); 100 &do_roster);
99 cmd_add("say", "Say something to the selected buddy", 0, 0, &do_say); 101 cmd_add("say", "Say something to the selected buddy", 0, 0, &do_say);
821 settings_del(SETTINGS_TYPE_BINDING, keycode); 823 settings_del(SETTINGS_TYPE_BINDING, keycode);
822 else 824 else
823 settings_set(SETTINGS_TYPE_BINDING, keycode, value); 825 settings_set(SETTINGS_TYPE_BINDING, keycode, value);
824 } 826 }
825 827
828 static void do_rawxml(char *arg)
829 {
830 if (!strncasecmp(arg, "send ", 5)) {
831 for (arg += 5; *arg && *arg == ' '; arg++)
832 ;
833 scr_LogPrint(LPRINT_NORMAL, "Sending XML string");
834 jb_send_raw(arg);
835 } else {
836 scr_LogPrint(LPRINT_NORMAL, "Please read the manual page"
837 " before using /rawxml :-)");
838 }
839 }
840
826 static void do_connect(char *arg) 841 static void do_connect(char *arg)
827 { 842 {
828 mcabber_connect(); 843 mcabber_connect();
829 } 844 }
830 845