Changes in protocols/jabber/iq.c [7554702:399d65a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
r7554702 r399d65a 67 67 xt_add_child(reply, xt_new_node("name", set_getstr(&ic->acc->set, "user_agent"), NULL)); 68 68 xt_add_child(reply, xt_new_node("version", BITLBEE_VERSION, NULL)); 69 xt_add_child(reply, xt_new_node("os", ARCH, NULL));70 69 } else if (strcmp(s, XMLNS_TIME_OLD) == 0) { 71 70 time_t time_ep; … … 234 233 imcb_log(ic, "Warning: Received incomplete IQ packet while authenticating"); 235 234 imc_logout(ic, FALSE); 236 return XT_ HANDLED;235 return XT_ABORT; 237 236 } 238 237 … … 287 286 imcb_log(ic, "Warning: Received incomplete IQ packet while authenticating"); 288 287 imc_logout(ic, FALSE); 289 return XT_ HANDLED;288 return XT_ABORT; 290 289 } 291 290 … … 1060 1059 return XT_HANDLED; 1061 1060 } 1061 1062 xt_status jabber_iq_disco_muc_response(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); 1063 1064 int jabber_iq_disco_muc(struct im_connection *ic, const char *muc_server) 1065 { 1066 struct xt_node *node; 1067 int st; 1068 1069 node = xt_new_node("query", NULL, NULL); 1070 xt_add_attr(node, "xmlns", XMLNS_DISCO_ITEMS); 1071 node = jabber_make_packet("iq", "get", (char *) muc_server, node); 1072 1073 jabber_cache_add(ic, node, jabber_iq_disco_muc_response); 1074 st = jabber_write_packet(ic, node); 1075 1076 return st; 1077 } 1078 1079 xt_status jabber_iq_disco_muc_response(struct im_connection *ic, struct xt_node *node, struct xt_node *orig) 1080 { 1081 struct xt_node *query, *c; 1082 struct jabber_error *err; 1083 GSList *rooms = NULL; 1084 1085 if ((err = jabber_error_parse(xt_find_node(node->children, "error"), XMLNS_STANZA_ERROR))) { 1086 imcb_error(ic, "The server replied with an error: %s%s%s", 1087 err->code, err->text ? ": " : "", err->text ? err->text : ""); 1088 jabber_error_free(err); 1089 return XT_HANDLED; 1090 } 1091 1092 if (!(query = xt_find_node(node->children, "query"))) { 1093 imcb_error(ic, "Received incomplete MUC list reply"); 1094 return XT_HANDLED; 1095 } 1096 1097 c = query->children; 1098 while ((c = xt_find_node(c, "item"))) { 1099 char *jid = xt_find_attr(c, "jid"); 1100 1101 if (!jid || !strchr(jid, '@')) { 1102 c = c->next; 1103 continue; 1104 } 1105 1106 bee_chat_info_t *ci = g_new(bee_chat_info_t, 1); 1107 ci->title = g_strdup(xt_find_attr(c, "jid")); 1108 ci->topic = g_strdup(xt_find_attr(c, "name")); 1109 rooms = g_slist_prepend(rooms, ci); 1110 1111 c = c->next; 1112 } 1113 1114 imcb_chat_list_free(ic); 1115 ic->chatlist = g_slist_reverse(rooms); 1116 imcb_chat_list_finish(ic); 1117 1118 return XT_HANDLED; 1119 }
Note: See TracChangeset
for help on using the changeset viewer.