43 #define DESCRIPTION ( \ |
43 #define DESCRIPTION ( \ |
44 "Sends output of command to buddy\n" \ |
44 "Sends output of command to buddy\n" \ |
45 "Recognizes options cmd_shell, cmd_redirect_stderr, cmd_header and cmd_header_inline\n" \ |
45 "Recognizes options cmd_shell, cmd_redirect_stderr, cmd_header and cmd_header_inline\n" \ |
46 "Provides command /cmd" ) |
46 "Provides command /cmd" ) |
47 |
47 |
48 static module_info_t info_cmd_dev = { |
48 module_info_t info_cmd = { |
49 .branch = "dev", |
49 .branch = MCABBER_BRANCH, |
50 .api = 20, |
50 .api = MCABBER_API_VERSION, |
51 .version = PROJECT_VERSION, |
51 .version = PROJECT_VERSION, |
52 .description = DESCRIPTION, |
52 .description = DESCRIPTION, |
53 .requires = NULL, |
53 .requires = NULL, |
54 .init = mcmd_init, |
54 .init = mcmd_init, |
55 .uninit = mcmd_uninit, |
55 .uninit = mcmd_uninit, |
56 .next = NULL, |
56 .next = NULL, |
57 }; |
|
58 |
|
59 module_info_t info_cmd = { |
|
60 .branch = "0.10.1", |
|
61 .api = 1, |
|
62 .version = PROJECT_VERSION, |
|
63 .description = DESCRIPTION, |
|
64 .requires = NULL, |
|
65 .init = mcmd_init, |
|
66 .uninit = mcmd_uninit, |
|
67 .next = &info_cmd_dev, |
|
68 }; |
57 }; |
69 |
58 |
70 typedef struct { |
59 typedef struct { |
71 gchar *jid; |
60 gchar *jid; |
72 GString *input; |
61 GString *input; |
305 } |
294 } |
306 g_io_channel_set_close_on_unref (channel, TRUE); |
295 g_io_channel_set_close_on_unref (channel, TRUE); |
307 } |
296 } |
308 |
297 |
309 { |
298 { |
310 cmd_cb_t *cb = g_new (cmd_cb_t, 1); |
299 cmd_cb_t *cb = g_slice_new (cmd_cb_t); |
311 |
300 |
312 if (settings_opt_get_int ("cmd_header")) { |
301 if (settings_opt_get_int ("cmd_header")) { |
313 if (settings_opt_get_int ("cmd_header_inline") || is_room (jid)) { |
302 if (settings_opt_get_int ("cmd_header_inline") || is_room (jid)) { |
314 gchar *mesg = g_strdup_printf ("$ %s", arg); |
303 gchar *mesg = g_strdup_printf ("$ %s", arg); |
315 gchar *utf = to_utf8 (mesg); |
304 gchar *utf = to_utf8 (mesg); |