comparison libpurple/protocols/jabber/jabber.c @ 17572:2e0799b916b9

Fixed whitespace to match the coding convention used in libpurple
author Andreas Monitzer <pidgin@monitzer.com>
date Tue, 12 Jun 2007 01:25:46 +0000
parents df5bb342b10e
children 2f067d8fb19a
comparison
equal deleted inserted replaced
17571:2f23a77eaa04 17572:2e0799b916b9
8 * the Free Software Foundation; either version 2 of the License, or 8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version. 9 * (at your option) any later version.
10 * 10 *
11 * This program is distributed in the hope that it will be useful, 11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 14 * GNU General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 19 *
20 */ 20 */
21 #include "internal.h" 21 #include "internal.h"
22 22
23 #include "account.h" 23 #include "account.h"
64 static void jabber_stream_init(JabberStream *js) 64 static void jabber_stream_init(JabberStream *js)
65 { 65 {
66 char *open_stream; 66 char *open_stream;
67 67
68 open_stream = g_strdup_printf("<stream:stream to='%s' " 68 open_stream = g_strdup_printf("<stream:stream to='%s' "
69 "xmlns='jabber:client' " 69 "xmlns='jabber:client' "
70 "xmlns:stream='http://etherx.jabber.org/streams' " 70 "xmlns:stream='http://etherx.jabber.org/streams' "
71 "version='1.0'>", 71 "version='1.0'>",
72 js->user->domain); 72 js->user->domain);
73 /* setup the parser fresh for each stream */ 73 /* setup the parser fresh for each stream */
74 jabber_parser_setup(js); 74 jabber_parser_setup(js);
949 } 949 }
950 950
951 if(!js->gsc) { 951 if(!js->gsc) {
952 if (connect_server[0]) { 952 if (connect_server[0]) {
953 jabber_login_connect(js, js->user->domain, server, 953 jabber_login_connect(js, js->user->domain, server,
954 purple_account_get_int(account, 954 purple_account_get_int(account,
955 "port", 5222)); 955 "port", 5222));
956 } else { 956 } else {
957 js->srv_query_data = purple_srv_resolve("xmpp-client", 957 js->srv_query_data = purple_srv_resolve("xmpp-client",
958 "tcp", 958 "tcp",
959 js->user->domain, 959 js->user->domain,
960 srv_resolved_cb, 960 srv_resolved_cb,
961 js); 961 js);
962 } 962 }
963 } 963 }
964 } 964 }
965 965
966 void jabber_close(PurpleConnection *gc) 966 void jabber_close(PurpleConnection *gc)
1093 1093
1094 js->idle = idle ? time(NULL) - idle : idle; 1094 js->idle = idle ? time(NULL) - idle : idle;
1095 } 1095 }
1096 1096
1097 void jabber_add_feature(const char *shortname, const char *namespace) { 1097 void jabber_add_feature(const char *shortname, const char *namespace) {
1098 JabberFeature *feat = g_new0(JabberFeature,1); 1098 JabberFeature *feat = g_new0(JabberFeature,1);
1099 feat->shortname = g_strdup(shortname); 1099 feat->shortname = g_strdup(shortname);
1100 feat->namespace = g_strdup(namespace); 1100 feat->namespace = g_strdup(namespace);
1101 1101
1102 /* try to remove just in case it already exists in the list */ 1102 /* try to remove just in case it already exists in the list */
1103 jabber_remove_feature(shortname); 1103 jabber_remove_feature(shortname);
1104 1104
1105 jabber_features = g_list_append(jabber_features, feat); 1105 jabber_features = g_list_append(jabber_features, feat);
1106 } 1106 }
1107 1107
1108 void jabber_remove_feature(const char *shortname) { 1108 void jabber_remove_feature(const char *shortname) {
1109 GList *feature; 1109 GList *feature;
1110 for(feature = jabber_features; feature; feature = feature->next) { 1110 for(feature = jabber_features; feature; feature = feature->next) {
1111 JabberFeature *feat = (JabberFeature*)feature->data; 1111 JabberFeature *feat = (JabberFeature*)feature->data;
1112 if(!strcmp(feat->shortname, shortname)) { 1112 if(!strcmp(feat->shortname, shortname)) {
1113 g_free(feat->shortname); 1113 g_free(feat->shortname);
1114 g_free(feat->namespace); 1114 g_free(feat->namespace);
1115 1115
1116 g_free(feature->data); 1116 g_free(feature->data);
1117 feature = g_list_delete_link(feature, feature); 1117 feature = g_list_delete_link(feature, feature);
1118 break; 1118 break;
1119 } 1119 }
1120 } 1120 }
1121 } 1121 }
1122 1122
1123 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b) 1123 const char *jabber_list_icon(PurpleAccount *a, PurpleBuddy *b)
1124 { 1124 {
1125 return "jabber"; 1125 return "jabber";
1269 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, 1269 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE,
1270 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_ONLINE), 1270 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_ONLINE),
1271 NULL, TRUE, TRUE, FALSE, 1271 NULL, TRUE, TRUE, FALSE,
1272 "priority", _("Priority"), priority_value, 1272 "priority", _("Priority"), priority_value,
1273 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), 1273 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
1274 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_INT), 1274 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_STRING),
1275 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING), 1275 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING),
1276 NULL); 1276 NULL);
1277 types = g_list_append(types, type); 1277 types = g_list_append(types, type);
1278 1278
1279 priority_value = purple_value_new(PURPLE_TYPE_INT); 1279 priority_value = purple_value_new(PURPLE_TYPE_INT);
1280 purple_value_set_int(priority_value, 1); 1280 purple_value_set_int(priority_value, 1);
1281 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE, 1281 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AVAILABLE,
1282 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_CHAT), 1282 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_CHAT),
1283 _("Chatty"), TRUE, TRUE, FALSE, 1283 _("Chatty"), TRUE, TRUE, FALSE,
1284 "priority", _("Priority"), priority_value, 1284 "priority", _("Priority"), priority_value,
1285 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), 1285 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
1286 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_INT), 1286 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_STRING),
1287 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING), 1287 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING),
1288 NULL); 1288 NULL);
1289 types = g_list_append(types, type); 1289 types = g_list_append(types, type);
1290 1290
1291 priority_value = purple_value_new(PURPLE_TYPE_INT); 1291 priority_value = purple_value_new(PURPLE_TYPE_INT);
1292 purple_value_set_int(priority_value, 0); 1292 purple_value_set_int(priority_value, 0);
1293 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY, 1293 type = purple_status_type_new_with_attrs(PURPLE_STATUS_AWAY,
1294 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_AWAY), 1294 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_AWAY),
1295 NULL, TRUE, TRUE, FALSE, 1295 NULL, TRUE, TRUE, FALSE,
1296 "priority", _("Priority"), priority_value, 1296 "priority", _("Priority"), priority_value,
1297 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), 1297 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
1298 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_INT), 1298 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_STRING),
1299 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING), 1299 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING),
1300 NULL); 1300 NULL);
1301 types = g_list_append(types, type); 1301 types = g_list_append(types, type);
1302 1302
1303 priority_value = purple_value_new(PURPLE_TYPE_INT); 1303 priority_value = purple_value_new(PURPLE_TYPE_INT);
1304 purple_value_set_int(priority_value, 0); 1304 purple_value_set_int(priority_value, 0);
1305 type = purple_status_type_new_with_attrs(PURPLE_STATUS_EXTENDED_AWAY, 1305 type = purple_status_type_new_with_attrs(PURPLE_STATUS_EXTENDED_AWAY,
1306 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_XA), 1306 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_XA),
1307 NULL, TRUE, TRUE, FALSE, 1307 NULL, TRUE, TRUE, FALSE,
1308 "priority", _("Priority"), priority_value, 1308 "priority", _("Priority"), priority_value,
1309 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), 1309 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
1310 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_INT), 1310 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_STRING),
1311 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING), 1311 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING),
1312 NULL); 1312 NULL);
1313 types = g_list_append(types, type); 1313 types = g_list_append(types, type);
1314 1314
1315 priority_value = purple_value_new(PURPLE_TYPE_INT); 1315 priority_value = purple_value_new(PURPLE_TYPE_INT);
1316 purple_value_set_int(priority_value, 0); 1316 purple_value_set_int(priority_value, 0);
1317 type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE, 1317 type = purple_status_type_new_with_attrs(PURPLE_STATUS_UNAVAILABLE,
1318 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_DND), 1318 jabber_buddy_state_get_status_id(JABBER_BUDDY_STATE_DND),
1319 _("Do Not Disturb"), TRUE, TRUE, FALSE, 1319 _("Do Not Disturb"), TRUE, TRUE, FALSE,
1320 "priority", _("Priority"), priority_value, 1320 "priority", _("Priority"), priority_value,
1321 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING), 1321 "message", _("Message"), purple_value_new(PURPLE_TYPE_STRING),
1322 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_INT), 1322 "mood", _("Mood"), purple_value_new(PURPLE_TYPE_STRING),
1323 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING), 1323 "moodtext", _("Mood Text"), purple_value_new(PURPLE_TYPE_STRING),
1324 NULL); 1324 NULL);
1325 types = g_list_append(types, type); 1325 types = g_list_append(types, type);
1326 1326
1327 /* 1327 /*
1328 if(js->protocol_version == JABBER_PROTO_0_9) 1328 if(js->protocol_version == JABBER_PROTO_0_9)
1427 { 1427 {
1428 GList *m = NULL; 1428 GList *m = NULL;
1429 PurplePluginAction *act; 1429 PurplePluginAction *act;
1430 1430
1431 act = purple_plugin_action_new(_("Set User Info..."), 1431 act = purple_plugin_action_new(_("Set User Info..."),
1432 jabber_setup_set_info); 1432 jabber_setup_set_info);
1433 m = g_list_append(m, act); 1433 m = g_list_append(m, act);
1434 1434
1435 /* if (js->protocol_options & CHANGE_PASSWORD) { */ 1435 /* if (js->protocol_options & CHANGE_PASSWORD) { */
1436 act = purple_plugin_action_new(_("Change Password..."), 1436 act = purple_plugin_action_new(_("Change Password..."),
1437 jabber_password_change); 1437 jabber_password_change);
1438 m = g_list_append(m, act); 1438 m = g_list_append(m, act);
1439 /* } */ 1439 /* } */
1440 1440
1441 act = purple_plugin_action_new(_("Search for Users..."), 1441 act = purple_plugin_action_new(_("Search for Users..."),
1442 jabber_user_search_begin); 1442 jabber_user_search_begin);
1443 m = g_list_append(m, act); 1443 m = g_list_append(m, act);
1444 1444
1445 return m; 1445 return m;
1446 } 1446 }
1447 1447
1718 1718
1719 if (!args || !args[0] || !args[1]) 1719 if (!args || !args[0] || !args[1])
1720 return PURPLE_CMD_RET_FAILED; 1720 return PURPLE_CMD_RET_FAILED;
1721 1721
1722 if (strcmp(args[1], "owner") != 0 && 1722 if (strcmp(args[1], "owner") != 0 &&
1723 strcmp(args[1], "admin") != 0 && 1723 strcmp(args[1], "admin") != 0 &&
1724 strcmp(args[1], "member") != 0 && 1724 strcmp(args[1], "member") != 0 &&
1725 strcmp(args[1], "outcast") != 0 && 1725 strcmp(args[1], "outcast") != 0 &&
1726 strcmp(args[1], "none") != 0) { 1726 strcmp(args[1], "none") != 0) {
1727 *error = g_strdup_printf(_("Unknown affiliation: \"%s\""), args[1]); 1727 *error = g_strdup_printf(_("Unknown affiliation: \"%s\""), args[1]);
1728 return PURPLE_CMD_RET_FAILED; 1728 return PURPLE_CMD_RET_FAILED;
1729 } 1729 }
1730 1730
1731 if (!jabber_chat_affiliate_user(chat, args[0], args[1])) { 1731 if (!jabber_chat_affiliate_user(chat, args[0], args[1])) {
1743 1743
1744 if (!args || !args[0] || !args[1]) 1744 if (!args || !args[0] || !args[1])
1745 return PURPLE_CMD_RET_FAILED; 1745 return PURPLE_CMD_RET_FAILED;
1746 1746
1747 if (strcmp(args[1], "moderator") != 0 && 1747 if (strcmp(args[1], "moderator") != 0 &&
1748 strcmp(args[1], "participant") != 0 && 1748 strcmp(args[1], "participant") != 0 &&
1749 strcmp(args[1], "visitor") != 0 && 1749 strcmp(args[1], "visitor") != 0 &&
1750 strcmp(args[1], "none") != 0) { 1750 strcmp(args[1], "none") != 0) {
1751 *error = g_strdup_printf(_("Unknown role: \"%s\""), args[1]); 1751 *error = g_strdup_printf(_("Unknown role: \"%s\""), args[1]);
1752 return PURPLE_CMD_RET_FAILED; 1752 return PURPLE_CMD_RET_FAILED;
1753 } 1753 }
1754 1754
1755 chat = jabber_chat_find_by_conv(conv); 1755 chat = jabber_chat_find_by_conv(conv);
1756 1756
1757 if (!jabber_chat_role_user(chat, args[0], args[1])) { 1757 if (!jabber_chat_role_user(chat, args[0], args[1])) {
1758 *error = g_strdup_printf(_("Unable to set role \"%s\" for user: %s"), 1758 *error = g_strdup_printf(_("Unable to set role \"%s\" for user: %s"),
1759 args[1], args[0]); 1759 args[1], args[0]);
1760 return PURPLE_CMD_RET_FAILED; 1760 return PURPLE_CMD_RET_FAILED;
1761 } 1761 }
1762 1762
1763 return PURPLE_CMD_RET_OK; 1763 return PURPLE_CMD_RET_OK;
1764 } 1764 }
1849 } 1849 }
1850 1850
1851 void jabber_register_commands(void) 1851 void jabber_register_commands(void)
1852 { 1852 {
1853 purple_cmd_register("config", "", PURPLE_CMD_P_PRPL, 1853 purple_cmd_register("config", "", PURPLE_CMD_P_PRPL,
1854 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, 1854 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
1855 "prpl-jabber", jabber_cmd_chat_config, 1855 "prpl-jabber", jabber_cmd_chat_config,
1856 _("config: Configure a chat room."), NULL); 1856 _("config: Configure a chat room."), NULL);
1857 purple_cmd_register("configure", "", PURPLE_CMD_P_PRPL, 1857 purple_cmd_register("configure", "", PURPLE_CMD_P_PRPL,
1858 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, 1858 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
1859 "prpl-jabber", jabber_cmd_chat_config, 1859 "prpl-jabber", jabber_cmd_chat_config,
1860 _("configure: Configure a chat room."), NULL); 1860 _("configure: Configure a chat room."), NULL);
1861 purple_cmd_register("nick", "s", PURPLE_CMD_P_PRPL, 1861 purple_cmd_register("nick", "s", PURPLE_CMD_P_PRPL,
1862 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, 1862 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
1863 "prpl-jabber", jabber_cmd_chat_nick, 1863 "prpl-jabber", jabber_cmd_chat_nick,
1864 _("nick &lt;new nickname&gt;: Change your nickname."), 1864 _("nick &lt;new nickname&gt;: Change your nickname."),
1865 NULL); 1865 NULL);
1866 purple_cmd_register("part", "s", PURPLE_CMD_P_PRPL, 1866 purple_cmd_register("part", "s", PURPLE_CMD_P_PRPL,
1867 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1867 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1868 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1868 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1869 jabber_cmd_chat_part, _("part [room]: Leave the room."), 1869 jabber_cmd_chat_part, _("part [room]: Leave the room."),
1870 NULL); 1870 NULL);
1871 purple_cmd_register("register", "", PURPLE_CMD_P_PRPL, 1871 purple_cmd_register("register", "", PURPLE_CMD_P_PRPL,
1872 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, 1872 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
1873 "prpl-jabber", jabber_cmd_chat_register, 1873 "prpl-jabber", jabber_cmd_chat_register,
1874 _("register: Register with a chat room."), NULL); 1874 _("register: Register with a chat room."), NULL);
1875 /* XXX: there needs to be a core /topic cmd, methinks */ 1875 /* XXX: there needs to be a core /topic cmd, methinks */
1876 purple_cmd_register("topic", "s", PURPLE_CMD_P_PRPL, 1876 purple_cmd_register("topic", "s", PURPLE_CMD_P_PRPL,
1877 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1877 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1878 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1878 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1879 jabber_cmd_chat_topic, 1879 jabber_cmd_chat_topic,
1880 _("topic [new topic]: View or change the topic."), 1880 _("topic [new topic]: View or change the topic."),
1881 NULL); 1881 NULL);
1882 purple_cmd_register("ban", "ws", PURPLE_CMD_P_PRPL, 1882 purple_cmd_register("ban", "ws", PURPLE_CMD_P_PRPL,
1883 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1883 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1884 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1884 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1885 jabber_cmd_chat_ban, 1885 jabber_cmd_chat_ban,
1886 _("ban &lt;user&gt; [room]: Ban a user from the room."), 1886 _("ban &lt;user&gt; [room]: Ban a user from the room."),
1887 NULL); 1887 NULL);
1888 purple_cmd_register("affiliate", "ws", PURPLE_CMD_P_PRPL, 1888 purple_cmd_register("affiliate", "ws", PURPLE_CMD_P_PRPL,
1889 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1889 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1890 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1890 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1891 jabber_cmd_chat_affiliate, 1891 jabber_cmd_chat_affiliate,
1892 _("affiliate &lt;user&gt; &lt;owner|admin|member|outcast|none&gt;: Set a user's affiliation with the room."), 1892 _("affiliate &lt;user&gt; &lt;owner|admin|member|outcast|none&gt;: Set a user's affiliation with the room."),
1893 NULL); 1893 NULL);
1894 purple_cmd_register("role", "ws", PURPLE_CMD_P_PRPL, 1894 purple_cmd_register("role", "ws", PURPLE_CMD_P_PRPL,
1895 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1895 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1896 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1896 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1897 jabber_cmd_chat_role, 1897 jabber_cmd_chat_role,
1898 _("role &lt;user&gt; &lt;moderator|participant|visitor|none&gt;: Set a user's role in the room."), 1898 _("role &lt;user&gt; &lt;moderator|participant|visitor|none&gt;: Set a user's role in the room."),
1899 NULL); 1899 NULL);
1900 purple_cmd_register("invite", "ws", PURPLE_CMD_P_PRPL, 1900 purple_cmd_register("invite", "ws", PURPLE_CMD_P_PRPL,
1901 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1901 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1902 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1902 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1903 jabber_cmd_chat_invite, 1903 jabber_cmd_chat_invite,
1904 _("invite &lt;user&gt; [message]: Invite a user to the room."), 1904 _("invite &lt;user&gt; [message]: Invite a user to the room."),
1905 NULL); 1905 NULL);
1906 purple_cmd_register("join", "ws", PURPLE_CMD_P_PRPL, 1906 purple_cmd_register("join", "ws", PURPLE_CMD_P_PRPL,
1907 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1907 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1908 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1908 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1909 jabber_cmd_chat_join, 1909 jabber_cmd_chat_join,
1910 _("join: &lt;room&gt; [server]: Join a chat on this server."), 1910 _("join: &lt;room&gt; [server]: Join a chat on this server."),
1911 NULL); 1911 NULL);
1912 purple_cmd_register("kick", "ws", PURPLE_CMD_P_PRPL, 1912 purple_cmd_register("kick", "ws", PURPLE_CMD_P_PRPL,
1913 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY | 1913 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY |
1914 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber", 1914 PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS, "prpl-jabber",
1915 jabber_cmd_chat_kick, 1915 jabber_cmd_chat_kick,
1916 _("kick &lt;user&gt; [room]: Kick a user from the room."), 1916 _("kick &lt;user&gt; [room]: Kick a user from the room."),
1917 NULL); 1917 NULL);
1918 purple_cmd_register("msg", "ws", PURPLE_CMD_P_PRPL, 1918 purple_cmd_register("msg", "ws", PURPLE_CMD_P_PRPL,
1919 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, 1919 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
1920 "prpl-jabber", jabber_cmd_chat_msg, 1920 "prpl-jabber", jabber_cmd_chat_msg,
1921 _("msg &lt;user&gt; &lt;message&gt;: Send a private message to another user."), 1921 _("msg &lt;user&gt; &lt;message&gt;: Send a private message to another user."),
1922 NULL); 1922 NULL);
1923 purple_cmd_register("ping", "w", PURPLE_CMD_P_PRPL, 1923 purple_cmd_register("ping", "w", PURPLE_CMD_P_PRPL,
1924 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM | 1924 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_IM |
1925 PURPLE_CMD_FLAG_PRPL_ONLY, 1925 PURPLE_CMD_FLAG_PRPL_ONLY,
1926 "prpl-jabber", jabber_cmd_ping, 1926 "prpl-jabber", jabber_cmd_ping,
1927 _("ping &lt;jid&gt;: Ping a user/component/server."), 1927 _("ping &lt;jid&gt;: Ping a user/component/server."),
1928 NULL); 1928 NULL);
1929 1929
1930 } 1930 }
1931 1931
1932 void 1932 void
1933 jabber_init_plugin(PurplePlugin *plugin) 1933 jabber_init_plugin(PurplePlugin *plugin)
1934 { 1934 {
1935 my_protocol = plugin; 1935 my_protocol = plugin;
1936 } 1936 }