Mercurial > pidgin
comparison libpurple/protocols/jabber/jabber.c @ 17835: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 |
comparison
equal
deleted
inserted
replaced
17834:a75079eae085 | 17835:6ab1089e2101 |
---|---|
49 #include "message.h" | 49 #include "message.h" |
50 #include "parser.h" | 50 #include "parser.h" |
51 #include "presence.h" | 51 #include "presence.h" |
52 #include "jabber.h" | 52 #include "jabber.h" |
53 #include "roster.h" | 53 #include "roster.h" |
54 #include "ping.h" | |
54 #include "si.h" | 55 #include "si.h" |
55 #include "xdata.h" | 56 #include "xdata.h" |
56 #include "pep.h" | 57 #include "pep.h" |
57 | 58 |
58 #define JABBER_CONNECT_STEPS (js->gsc ? 8 : 5) | 59 #define JABBER_CONNECT_STEPS (js->gsc ? 8 : 5) |
1786 who = g_strdup_printf("%s@%s/%s", chat->room, chat->server, args[0]); | 1787 who = g_strdup_printf("%s@%s/%s", chat->room, chat->server, args[0]); |
1787 | 1788 |
1788 jabber_message_send_im(purple_conversation_get_gc(conv), who, args[1], 0); | 1789 jabber_message_send_im(purple_conversation_get_gc(conv), who, args[1], 0); |
1789 | 1790 |
1790 g_free(who); | 1791 g_free(who); |
1792 return PURPLE_CMD_RET_OK; | |
1793 } | |
1794 | |
1795 static PurpleCmdRet jabber_cmd_ping(PurpleConversation *conv, | |
1796 const char *cmd, char **args, char **error, void *data) | |
1797 { | |
1798 if(!args || !args[0]) | |
1799 return PURPLE_CMD_RET_FAILED; | |
1800 | |
1801 if(!jabber_ping_jid(conv, args[0])) { | |
1802 *error = g_strdup_printf(_("Unable to ping user %s"), args[0]); | |
1803 return PURPLE_CMD_RET_FAILED; | |
1804 } | |
1805 | |
1791 return PURPLE_CMD_RET_OK; | 1806 return PURPLE_CMD_RET_OK; |
1792 } | 1807 } |
1793 | 1808 |
1794 gboolean jabber_offline_message(const PurpleBuddy *buddy) | 1809 gboolean jabber_offline_message(const PurpleBuddy *buddy) |
1795 { | 1810 { |
1866 purple_cmd_register("msg", "ws", PURPLE_CMD_P_PRPL, | 1881 purple_cmd_register("msg", "ws", PURPLE_CMD_P_PRPL, |
1867 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, | 1882 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, |
1868 "prpl-jabber", jabber_cmd_chat_msg, | 1883 "prpl-jabber", jabber_cmd_chat_msg, |
1869 _("msg <user> <message>: Send a private message to another user."), | 1884 _("msg <user> <message>: Send a private message to another user."), |
1870 NULL); | 1885 NULL); |
1886 purple_cmd_register("ping", "w", PURPLE_CMD_P_PRPL, | |
1887 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | | |
1888 PURPLE_CMD_FLAG_PRPL_ONLY, | |
1889 "prpl-jabber", jabber_cmd_ping, | |
1890 _("ping <jid>: Ping a user/component/server."), | |
1891 NULL); | |
1892 | |
1871 } | 1893 } |
1872 | 1894 |
1873 void | 1895 void |
1874 jabber_init_plugin(PurplePlugin *plugin) | 1896 jabber_init_plugin(PurplePlugin *plugin) |
1875 { | 1897 { |