Mercurial > pidgin
changeset 9597:d6f398e80b32
[gaim-migrate @ 10440]
denyri added a void *data argument to most of the command related
functions. This makes it easier for language binding and such.
committer: Tailor Script <tailor@pidgin.im>
author | Tim Ringenbach <marv@pidgin.im> |
---|---|
date | Mon, 26 Jul 2004 03:27:03 +0000 |
parents | 7b3212aa698c |
children | 0ad01d743f60 |
files | plugins/ChangeLog.API src/cmds.c src/cmds.h src/gtkconv.c src/protocols/irc/parse.c src/protocols/jabber/jabber.c src/protocols/silc/silc.c src/protocols/zephyr/zephyr.c |
diffstat | 8 files changed, 175 insertions(+), 163 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/ChangeLog.API Sun Jul 25 22:47:11 2004 +0000 +++ b/plugins/ChangeLog.API Mon Jul 26 03:27:03 2004 +0000 @@ -1,6 +1,9 @@ Gaim: The Pimpin' Penguin IM Client that's good for the soul! version 0.81cvs + Commands API: + * Most functions now have a void *data argument. + Conversation API: * Changed: gaim_conv_chat_add_user() (added flags parameter) gaim_conv_chat_add_users() now (added GList of flags parameter)
--- a/src/cmds.c Sun Jul 25 22:47:11 2004 +0000 +++ b/src/cmds.c Mon Jul 26 03:27:03 2004 +0000 @@ -38,6 +38,7 @@ gchar *prpl_id; GaimCmdFunc func; gchar *help; + void *data; } GaimCmd; @@ -50,8 +51,10 @@ else return 0; } -GaimCmdId gaim_cmd_register(const gchar *cmd, const gchar *args, GaimCmdPriority p, GaimCmdFlag f, - const gchar *prpl_id, GaimCmdFunc func, const gchar *helpstr) +GaimCmdId gaim_cmd_register(const gchar *cmd, const gchar *args, + GaimCmdPriority p, GaimCmdFlag f, + const gchar *prpl_id, GaimCmdFunc func, + const gchar *helpstr, void *data) { GaimCmdId id; GaimCmd *c; @@ -71,6 +74,7 @@ c->prpl_id = prpl_id ? g_strdup(prpl_id) : NULL; c->func = func; c->help = helpstr ? g_strdup(helpstr) : NULL; + c->data = data; cmds = g_list_insert_sorted(cmds, c, (GCompareFunc)cmds_compare_func); @@ -195,6 +199,7 @@ s = g_utf8_next_char(s); } } + GaimCmdStatus gaim_cmd_do_command(GaimConversation *conv, const gchar *cmdline, const gchar *markup, gchar **error) { @@ -261,7 +266,7 @@ } tried_cmd = TRUE; - ret = c->func(conv, cmd, args, &err); + ret = c->func(conv, cmd, args, &err, c->data); if (ret == GAIM_CMD_RET_CONTINUE) { if (err) g_free(err);
--- a/src/cmds.h Sun Jul 25 22:47:11 2004 +0000 +++ b/src/cmds.h Mon Jul 26 03:27:03 2004 +0000 @@ -50,7 +50,10 @@ GAIM_CMD_RET_CONTINUE, /**< Continue, looking for other commands with the same name to call. */ }; -typedef GaimCmdRet (*GaimCmdFunc)(GaimConversation *, const gchar *cmd, gchar **args, gchar **error); +#define GAIM_CMD_FUNC(func) ((GaimCmdFunc)func) + +typedef GaimCmdRet (*GaimCmdFunc)(GaimConversation *, const gchar *cmd, + gchar **args, gchar **error, void *data); typedef guint GaimCmdId; enum _GaimCmdPriority { @@ -120,7 +123,7 @@ * Returns @c NULL on failure. */ GaimCmdId gaim_cmd_register(const gchar *cmd, const gchar *args, GaimCmdPriority p, GaimCmdFlag f, - const gchar *prpl_id, GaimCmdFunc func, const gchar *helpstr); + const gchar *prpl_id, GaimCmdFunc func, const gchar *helpstr, void *data); /** * Unregister a command with the core. @@ -142,8 +145,8 @@ * @param conv The conversation the command was typed in. * @param cmdline The command the user typed (including all arguments) as a single string. * The caller doesn't have to do any parsing, except removing the command - * prefix, which the core has no knowledge of. cmd should not contain the - * any formatting, and should be in plain text (no html entities). + * prefix, which the core has no knowledge of. cmd should not contain any + * formatting, and should be in plain text (no html entities). * @param markup This is the same as cmd, but is the formatted version. It should be in * HTML, with < > and &, at least, escaped to html entities, and should * include both the default formatting and any extra manual formatting.
--- a/src/gtkconv.c Sun Jul 25 22:47:11 2004 +0000 +++ b/src/gtkconv.c Mon Jul 26 03:27:03 2004 +0000 @@ -288,7 +288,7 @@ static GaimCmdRet me_command_cb(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { char *tmp; @@ -305,7 +305,7 @@ static GaimCmdRet debug_command_cb(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { char *tmp, *markup; GaimCmdStatus status; @@ -328,51 +328,38 @@ static GaimCmdRet help_command_cb(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { + GList *l, *text; GString *s; - GList *cmds, *l; - - s = g_string_new(_("Use \"/help <command>\" for help on a specific command.\n" - "The following commands are available in this context:\n")); - - cmds = gaim_cmd_list(conv); - for (l = cmds; l; l = l->next) - if (l->next) - g_string_append_printf(s, "%s, ", (char *)l->data); - else - g_string_append_printf(s, "%s.", (char *)l->data); - - gaim_conversation_write(conv, NULL, s->str, GAIM_MESSAGE_NO_LOG, time(NULL)); - g_string_free(s, TRUE); - g_list_free(cmds); - - return GAIM_CMD_STATUS_OK; -} - -static GaimCmdRet -help_arg_command_cb(GaimConversation *conv, - const char *cmd, char **args, char **error) -{ - GList *help, *l; - GString *s; - - s = g_string_new(""); - help = gaim_cmd_help(conv, args[0]); - - if (help) { - for (l = help; l; l = l->next) + + if (args[0] != NULL) { + s = g_string_new(""); + text = gaim_cmd_help(conv, args[0]); + + if (text) { + for (l = text; l; l = l->next) + if (l->next) + g_string_append_printf(s, "/%s\n", (char *)l->data); + else + g_string_append_printf(s, "/%s", (char *)l->data); + } else { + g_string_append(s, _("No such command (in this context).")); + } + } else { + s = g_string_new(_("Use \"/help <command>\" for help on a specific command.\n" + "The following commands are available in this context:\n")); + + text = gaim_cmd_list(conv); + for (l = text; l; l = l->next) if (l->next) - g_string_append_printf(s, "/%s\n", (char *)l->data); + g_string_append_printf(s, "%s, ", (char *)l->data); else - g_string_append_printf(s, "/%s", (char *)l->data); - } else { - g_string_append(s, _("No such command (in this context).")); + g_string_append_printf(s, "%s.", (char *)l->data); } gaim_conversation_write(conv, NULL, s->str, GAIM_MESSAGE_NO_LOG, time(NULL)); g_string_free(s, TRUE); - g_list_free(help); return GAIM_CMD_STATUS_OK; } @@ -6318,18 +6305,14 @@ **********************************************************************/ gaim_cmd_register("me", "S", GAIM_CMD_P_DEFAULT, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, - me_command_cb, _("me <action>: Send an IRC style action to a buddy or chat.")); + me_command_cb, _("me <action>: Send an IRC style action to a buddy or chat."), NULL); gaim_cmd_register("debug", "w", GAIM_CMD_P_DEFAULT, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, - debug_command_cb, _("debug <option>: Send various debug information to the current conversation.")); - - gaim_cmd_register("help", "", GAIM_CMD_P_DEFAULT, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, - help_command_cb, _("help: List available commands.")); + debug_command_cb, _("debug <option>: Send various debug information to the current conversation."), NULL); gaim_cmd_register("help", "w", GAIM_CMD_P_DEFAULT, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM, NULL, - help_arg_command_cb, _("help <command>: Help on a specific command.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, NULL, + help_command_cb, _("help <command>: Help on a specific command."), NULL); } void
--- a/src/protocols/irc/parse.c Sun Jul 25 22:47:11 2004 +0000 +++ b/src/protocols/irc/parse.c Mon Jul 26 03:27:03 2004 +0000 @@ -137,7 +137,7 @@ }; static GaimCmdRet irc_parse_gaim_cmd(GaimConversation *conv, const gchar *cmd, - gchar **args, gchar **error) + gchar **args, gchar **error, void *data) { GaimConnection *gc; struct irc_conn *irc; @@ -185,8 +185,8 @@ args[i] = '\0'; - gaim_cmd_register(c->name, args, GAIM_CMD_P_PRPL, f, "prpl-irc", irc_parse_gaim_cmd, - _(c->help)); + gaim_cmd_register(c->name, args, GAIM_CMD_P_PRPL, f, "prpl-irc", + irc_parse_gaim_cmd, _(c->help), NULL); } void irc_register_commands(void)
--- a/src/protocols/jabber/jabber.c Sun Jul 25 22:47:11 2004 +0000 +++ b/src/protocols/jabber/jabber.c Mon Jul 26 03:27:03 2004 +0000 @@ -1269,7 +1269,7 @@ } static GaimCmdRet jabber_cmd_chat_config(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); jabber_chat_request_room_configure(chat); @@ -1277,7 +1277,7 @@ } static GaimCmdRet jabber_cmd_chat_register(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); jabber_chat_register(chat); @@ -1285,7 +1285,7 @@ } static GaimCmdRet jabber_cmd_chat_topic(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); jabber_chat_change_topic(chat, args ? args[0] : NULL); @@ -1293,7 +1293,7 @@ } static GaimCmdRet jabber_cmd_chat_nick(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); @@ -1305,7 +1305,7 @@ } static GaimCmdRet jabber_cmd_chat_part(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); jabber_chat_part(chat, args ? args[0] : NULL); @@ -1313,7 +1313,7 @@ } static GaimCmdRet jabber_cmd_chat_ban(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); @@ -1329,7 +1329,7 @@ } static GaimCmdRet jabber_cmd_chat_invite(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { if(!args || !args[0]) return GAIM_CMD_RET_FAILED; @@ -1342,7 +1342,7 @@ } static GaimCmdRet jabber_cmd_chat_join(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); GHashTable *components; @@ -1365,7 +1365,7 @@ } static GaimCmdRet jabber_cmd_chat_kick(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); @@ -1381,7 +1381,7 @@ } static GaimCmdRet jabber_cmd_chat_msg(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { JabberChat *chat = jabber_chat_find_by_conv(conv); char *who; @@ -1397,46 +1397,63 @@ static void jabber_register_commands(void) { gaim_cmd_register("config", "", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-jabber", - jabber_cmd_chat_config, _("config: Configure a chat room.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, + "prpl-jabber", jabber_cmd_chat_config, + _("config: Configure a chat room."), NULL); gaim_cmd_register("configure", "", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-jabber", - jabber_cmd_chat_config, _("configure: Configure a chat room.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, + "prpl-jabber", jabber_cmd_chat_config, + _("configure: Configure a chat room."), NULL); gaim_cmd_register("nick", "s", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-jabber", - jabber_cmd_chat_nick, _("nick <new nickname>: Change your nickname.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, + "prpl-jabber", jabber_cmd_chat_nick, + _("nick <new nickname>: Change your nickname."), + NULL); gaim_cmd_register("part", "s", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | - GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", - jabber_cmd_chat_part, _("part [room]: Leave the room.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | + GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", + jabber_cmd_chat_part, _("part [room]: Leave the room."), + NULL); gaim_cmd_register("register", "", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-jabber", - jabber_cmd_chat_register, _("register: Register with a chat room.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, + "prpl-jabber", jabber_cmd_chat_register, + _("register: Register with a chat room."), NULL); /* XXX: there needs to be a core /topic cmd, methinks */ gaim_cmd_register("topic", "s", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | - GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", - jabber_cmd_chat_topic, _("topic [new topic]: View or change the topic.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | + GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", + jabber_cmd_chat_topic, + _("topic [new topic]: View or change the topic."), + NULL); gaim_cmd_register("ban", "ws", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | - GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", - jabber_cmd_chat_ban, _("ban <user> [room]: Ban a user from the room.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | + GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", + jabber_cmd_chat_ban, + _("ban <user> [room]: Ban a user from the room."), + NULL); gaim_cmd_register("invite", "ws", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | - GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", - jabber_cmd_chat_invite, _("invite <user> [room]: Invite a user to the room.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | + GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", + jabber_cmd_chat_invite, + _("invite <user> [room]: Invite a user to the room."), + NULL); gaim_cmd_register("join", "ws", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | - GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", - jabber_cmd_chat_join, _("join: <room> [server]: Join a chat on this server.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | + GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", + jabber_cmd_chat_join, + _("join: <room> [server]: Join a chat on this server."), + NULL); gaim_cmd_register("kick", "ws", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | - GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", - jabber_cmd_chat_kick, _("kick <user> [room]: Kick a user from the room.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | + GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", + jabber_cmd_chat_kick, + _("kick <user> [room]: Kick a user from the room."), + NULL); gaim_cmd_register("msg", "ws", GAIM_CMD_P_PRPL, - GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, - "prpl-jabber", - jabber_cmd_chat_msg, _("msg <user> <message>: Send a private message to another user.")); + GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, + "prpl-jabber", jabber_cmd_chat_msg, + _("msg <user> <message>: Send a private message to another user."), + NULL); } static GaimPluginPrefFrame *
--- a/src/protocols/silc/silc.c Sun Jul 25 22:47:11 2004 +0000 +++ b/src/protocols/silc/silc.c Mon Jul 26 03:27:03 2004 +0000 @@ -942,7 +942,7 @@ /********************************* Commands **********************************/ static GaimCmdRet silcgaim_cmd_chat_part(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; GaimConversation *convo; @@ -975,7 +975,7 @@ } static GaimCmdRet silcgaim_cmd_chat_topic(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; int id = 0; @@ -1013,7 +1013,7 @@ } static GaimCmdRet silcgaim_cmd_chat_join(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GHashTable *comp; @@ -1033,7 +1033,7 @@ } static GaimCmdRet silcgaim_cmd_chat_list(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; gc = gaim_conversation_get_gc(conv); @@ -1042,7 +1042,7 @@ } static GaimCmdRet silcgaim_cmd_whois(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; @@ -1057,7 +1057,7 @@ } static GaimCmdRet silcgaim_cmd_msg(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { int ret; GaimConnection *gc; @@ -1076,7 +1076,7 @@ } static GaimCmdRet silcgaim_cmd_query(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { int ret = 1; GaimConversation *convo; @@ -1110,7 +1110,7 @@ } static GaimCmdRet silcgaim_cmd_motd(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; SilcGaim sg; @@ -1140,7 +1140,7 @@ } static GaimCmdRet silcgaim_cmd_detach(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; SilcGaim sg; @@ -1162,7 +1162,7 @@ } static GaimCmdRet silcgaim_cmd_cmode(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; SilcGaim sg; @@ -1215,7 +1215,7 @@ } static GaimCmdRet silcgaim_cmd_generic(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; SilcGaim sg; @@ -1245,7 +1245,7 @@ } static GaimCmdRet silcgaim_cmd_quit(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; SilcGaim sg; @@ -1267,7 +1267,7 @@ } static GaimCmdRet silcgaim_cmd_call(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { GaimConnection *gc; SilcGaim sg; @@ -1299,109 +1299,110 @@ gaim_cmd_register("part", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, - "prpl-silc", silcgaim_cmd_chat_part, _("part [channel]: Leave the chat")); + "prpl-silc", silcgaim_cmd_chat_part, _("part [channel]: Leave the chat"), NULL); gaim_cmd_register("leave", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, - "prpl-silc", silcgaim_cmd_chat_part, _("leave [channel]: Leave the chat")); + "prpl-silc", silcgaim_cmd_chat_part, _("leave [channel]: Leave the chat"), NULL); gaim_cmd_register("topic", "s", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", - silcgaim_cmd_chat_topic, _("topic [<new topic>]: View or change the topic")); + silcgaim_cmd_chat_topic, _("topic [<new topic>]: View or change the topic"), NULL); gaim_cmd_register("join", "ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_chat_join, - _("join <channel> [<password>]: Join a chat on this network")); + _("join <channel> [<password>]: Join a chat on this network"), NULL); gaim_cmd_register("list", "", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", - silcgaim_cmd_chat_list, _("list: List channels on this network")); + silcgaim_cmd_chat_list, _("list: List channels on this network"), NULL); gaim_cmd_register("whois", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", - silcgaim_cmd_whois, _("whois <nick>: View nick's information")); + silcgaim_cmd_whois, _("whois <nick>: View nick's information"), NULL); gaim_cmd_register("msg", "ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_msg, - _("msg <nick> <message>: Send a private message to a user")); + _("msg <nick> <message>: Send a private message to a user"), NULL); gaim_cmd_register("query", "ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_query, - _("query <nick> [<message>]: Send a private message to a user")); + _("query <nick> [<message>]: Send a private message to a user"), NULL); gaim_cmd_register("motd", "", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_motd, - _("motd: View the server's Message Of The Day")); + _("motd: View the server's Message Of The Day"), NULL); gaim_cmd_register("detach", "", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_detach, - _("detach: Detach this session")); + _("detach: Detach this session"), NULL); gaim_cmd_register("quit", "s", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_quit, - _("quit [message]: Disconnect from the server, with an optional message")); + _("quit [message]: Disconnect from the server, with an optional message"), NULL); gaim_cmd_register("call", "s", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_call, - _("call <command>: Call any silc client command")); - /* These below just get passed through for the silc client library to deal with */ + _("call <command>: Call any silc client command"), NULL); + /* These below just get passed through for the silc client library to deal + * with */ gaim_cmd_register("kill", "ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_generic, - _("kill <nick> [-pubkey|<reason>]: Kill nick")); + _("kill <nick> [-pubkey|<reason>]: Kill nick"), NULL); gaim_cmd_register("nick", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_generic, - _("nick <newnick>: Change your nickname")); + _("nick <newnick>: Change your nickname"), NULL); gaim_cmd_register("whowas", "ww", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_generic, - _("whowas <nick>: View nick's information")); + _("whowas <nick>: View nick's information"), NULL); gaim_cmd_register("cmode", "wws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_cmode, - _("cmode <channel> [+|-<modes>] [arguments]: Change or display channel modes")); + _("cmode <channel> [+|-<modes>] [arguments]: Change or display channel modes"), NULL); gaim_cmd_register("cumode", "wws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_generic, - _("cumode <channel> +|-<modes> <nick>: Change nick's modes on channel")); + _("cumode <channel> +|-<modes> <nick>: Change nick's modes on channel"), NULL); gaim_cmd_register("umode", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_generic, - _("umode <usermodes>: Set your modes in the network")); + _("umode <usermodes>: Set your modes in the network"), NULL); gaim_cmd_register("oper", "s", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_generic, - _("oper <nick> [-pubkey]: Get server operator privileges")); + _("oper <nick> [-pubkey]: Get server operator privileges"), NULL); gaim_cmd_register("invite", "ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_generic, - _("invite <channel> [-|+]<nick>: invite nick or add/remove from channel invite list")); + _("invite <channel> [-|+]<nick>: invite nick or add/remove from channel invite list"), NULL); gaim_cmd_register("kick", "wws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_generic, - _("kick <channel> <nick> [comment]: Kick client from channel")); + _("kick <channel> <nick> [comment]: Kick client from channel"), NULL); gaim_cmd_register("info", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_generic, - _("info [server]: View server administrative details")); + _("info [server]: View server administrative details"), NULL); gaim_cmd_register("ban", "ww", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY | GAIM_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-silc", silcgaim_cmd_generic, - _("ban [<channel> +|-<nick>]: Ban client from channel")); + _("ban [<channel> +|-<nick>]: Ban client from channel"), NULL); gaim_cmd_register("getkey", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_generic, - _("getkey <nick|server>: Retrieve client's or server's public key")); + _("getkey <nick|server>: Retrieve client's or server's public key"), NULL); gaim_cmd_register("stats", "", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_generic, - _("stats: View server and network statistics")); + _("stats: View server and network statistics"), NULL); gaim_cmd_register("ping", "", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-silc", silcgaim_cmd_generic, - _("ping: Send PING to the connected server")); + _("ping: Send PING to the connected server"), NULL); #if 0 /* Gaim doesn't handle these yet */ gaim_cmd_register("users", "w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY,
--- a/src/protocols/zephyr/zephyr.c Sun Jul 25 22:47:11 2004 +0000 +++ b/src/protocols/zephyr/zephyr.c Mon Jul 26 03:27:03 2004 +0000 @@ -1557,7 +1557,7 @@ /* commands */ static GaimCmdRet zephyr_gaim_cmd_msg(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { char *recipient; @@ -1576,14 +1576,14 @@ } static GaimCmdRet zephyr_gaim_cmd_zlocate(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { zephyr_zloc(zgc,args[0]); return GAIM_CMD_RET_OK; } static GaimCmdRet zephyr_gaim_cmd_instance(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { /* Currently it sets the instance with leading spaces and * all. This might not be the best thing to do, though having @@ -1597,7 +1597,7 @@ } static GaimCmdRet zephyr_gaim_cmd_joinchat_cir(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { /* Join a new zephyr chat */ GHashTable *triple = g_hash_table_new(NULL,NULL); @@ -1609,7 +1609,7 @@ } static GaimCmdRet zephyr_gaim_cmd_zi(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { /* args = instance, message */ if ( zephyr_send_message("message",args[0],"",args[1],zephyr_get_signature(),"")) @@ -1619,7 +1619,7 @@ } static GaimCmdRet zephyr_gaim_cmd_zci(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { /* args = class, instance, message */ if ( zephyr_send_message(args[0],args[1],"",args[2],zephyr_get_signature(),"")) @@ -1629,7 +1629,7 @@ } static GaimCmdRet zephyr_gaim_cmd_zcir(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { /* args = class, instance, recipient, message */ if ( zephyr_send_message(args[0],args[1],args[2],args[3],zephyr_get_signature(),"")) @@ -1639,7 +1639,7 @@ } static GaimCmdRet zephyr_gaim_cmd_zir(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { /* args = instance, recipient, message */ if ( zephyr_send_message("message",args[0],args[1],args[2],zephyr_get_signature(),"")) @@ -1649,77 +1649,77 @@ } static GaimCmdRet zephyr_gaim_cmd_zc(GaimConversation *conv, - const char *cmd, char **args, char **error) + const char *cmd, char **args, char **error, void *data) { /* args = class, message */ if ( zephyr_send_message(args[0],"PERSONAL","",args[1],zephyr_get_signature(),"")) return GAIM_CMD_RET_OK; - else + else return GAIM_CMD_RET_FAILED; } -static void zephyr_register_slash_commands() +static void zephyr_register_slash_commands() { gaim_cmd_register("msg","ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_msg, _("msg <nick> <message>: Send a private message to a user")); + zephyr_gaim_cmd_msg, _("msg <nick> <message>: Send a private message to a user"), NULL); gaim_cmd_register("zlocate","w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_zlocate, _("zlocate <nick>: Locate user")); + zephyr_gaim_cmd_zlocate, _("zlocate <nick>: Locate user"), NULL); gaim_cmd_register("zl","w", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_zlocate, _("zl <nick>: Locate user")); + zephyr_gaim_cmd_zlocate, _("zl <nick>: Locate user"), NULL); gaim_cmd_register("instance","s", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_instance, _("instance <instance>: Set the instance to be used on this class")); + zephyr_gaim_cmd_instance, _("instance <instance>: Set the instance to be used on this class"), NULL); gaim_cmd_register("inst","s", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_instance, _("inst <instance>: Set the instance to be used on this class")); + zephyr_gaim_cmd_instance, _("inst <instance>: Set the instance to be used on this class"), NULL); gaim_cmd_register("sub", "www", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_joinchat_cir, - _("sub <class> <instance> <recipient>: Join a new chat")); + zephyr_gaim_cmd_joinchat_cir, + _("sub <class> <instance> <recipient>: Join a new chat"), NULL); gaim_cmd_register("zi","ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_zi, _("zi <instance>: Send a message to <message,<i>instance</i>,*>")); + zephyr_gaim_cmd_zi, _("zi <instance>: Send a message to <message,<i>instance</i>,*>"), NULL); gaim_cmd_register("zci","wws",GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_zci, - _("zci <class> <instance>: Send a message to <<i>class</i>,<i>instance</i>,*>")); + zephyr_gaim_cmd_zci, + _("zci <class> <instance>: Send a message to <<i>class</i>,<i>instance</i>,*>"), NULL); gaim_cmd_register("zcir","wwws",GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_zcir, - _("zcir <class> <instance> <recipient>: Send a message to <<i>class</i>,<i>instance</i>,<i>recipient</i>>")); + zephyr_gaim_cmd_zcir, + _("zcir <class> <instance> <recipient>: Send a message to <<i>class</i>,<i>instance</i>,<i>recipient</i>>"), NULL); gaim_cmd_register("zir","wws",GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_zir, - _("zir <instance> <recipient>: Send a message to <MESSAGE,<i>instance</i>,<i>recipient</i>>")); + zephyr_gaim_cmd_zir, + _("zir <instance> <recipient>: Send a message to <MESSAGE,<i>instance</i>,<i>recipient</i>>"), NULL); gaim_cmd_register("zc","ws", GAIM_CMD_P_PRPL, GAIM_CMD_FLAG_IM | GAIM_CMD_FLAG_CHAT | GAIM_CMD_FLAG_PRPL_ONLY, "prpl-zephyr", - zephyr_gaim_cmd_zc, _("zc <class>: Send a message to <<i>class</i>,PERSONAL,*>")); - + zephyr_gaim_cmd_zc, _("zc <class>: Send a message to <<i>class</i>,PERSONAL,*>"), NULL); + }