Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jabber.c @ 17562:6ab1089e2101
applied patch for supporting XEP-0199: XMPP Ping
author | Andreas Monitzer <pidgin@monitzer.com> |
---|---|
date | Wed, 06 Jun 2007 00:04:29 +0000 |
parents | a75079eae085 |
children | 95affacf6f82 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Wed Jun 06 00:01:15 2007 +0000 +++ b/libpurple/protocols/jabber/jabber.c Wed Jun 06 00:04:29 2007 +0000 @@ -51,6 +51,7 @@ #include "presence.h" #include "jabber.h" #include "roster.h" +#include "ping.h" #include "si.h" #include "xdata.h" #include "pep.h" @@ -1791,6 +1792,20 @@ return PURPLE_CMD_RET_OK; } +static PurpleCmdRet jabber_cmd_ping(PurpleConversation *conv, + const char *cmd, char **args, char **error, void *data) +{ + if(!args || !args[0]) + return PURPLE_CMD_RET_FAILED; + + if(!jabber_ping_jid(conv, args[0])) { + *error = g_strdup_printf(_("Unable to ping user %s"), args[0]); + return PURPLE_CMD_RET_FAILED; + } + + return PURPLE_CMD_RET_OK; +} + gboolean jabber_offline_message(const PurpleBuddy *buddy) { return TRUE; @@ -1868,6 +1883,13 @@ "prpl-jabber", jabber_cmd_chat_msg, _("msg <user> <message>: Send a private message to another user."), NULL); + purple_cmd_register("ping", "w", PURPLE_CMD_P_PRPL, + PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | + PURPLE_CMD_FLAG_PRPL_ONLY, + "prpl-jabber", jabber_cmd_ping, + _("ping <jid>: Ping a user/component/server."), + NULL); + } void