Changes in protocols/jabber/iq.c [7554702:b38f655]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
r7554702 rb38f655 28 28 static xt_status jabber_iq_display_vcard(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); 29 29 static xt_status jabber_gmail_handle_new(struct im_connection *ic, struct xt_node *node); 30 static xt_status jabber_iq_carbons_response(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);31 30 32 31 xt_status jabber_pkt_iq(struct xt_node *node, gpointer data) … … 53 52 (c = xt_find_node(node->children, "time"))) || 54 53 !(s = xt_find_attr(c, "xmlns"))) { 55 56 reply = jabber_make_error_packet(node, "service-unavailable", "cancel", NULL); 57 st = jabber_write_packet(ic, reply); 58 xt_free_node(reply); 59 return st; 54 /* Sigh. Who decided to suddenly invent new elements 55 instead of just sticking with <query/>? */ 56 return XT_HANDLED; 60 57 } 61 58 … … 121 118 XMLNS_BYTESTREAMS, 122 119 XMLNS_FILETRANSFER, 123 XMLNS_CARBONS,124 120 NULL }; 125 121 const char **f; … … 138 134 } else { 139 135 xt_free_node(reply); 140 reply = jabber_make_error_packet(node, " service-unavailable", "cancel", NULL);136 reply = jabber_make_error_packet(node, "feature-not-implemented", "cancel", NULL); 141 137 pack = 0; 142 138 } … … 389 385 struct xt_node *response; 390 386 struct jabber_data *jd = ic->proto_data; 391 392 response = jabber_make_packet("iq", "result", jd->me, NULL);387 388 response = jabber_make_packet("iq", "result", g_strdup_printf("%s@%s", jd->username, jd->server), NULL); 393 389 394 390 jabber_cache_add(ic, response, NULL); … … 1008 1004 { 1009 1005 struct jabber_data *jd = ic->proto_data; 1010 struct xt_node *query, *id; 1011 1012 if (!(query = xt_find_node(node->children, "query"))) { 1013 return XT_HANDLED; 1014 } 1015 1016 if (xt_find_node_by_attr(query->children, "feature", "var", XMLNS_CARBONS) && 1017 set_getbool(&ic->acc->set, "carbons")) { 1018 1019 struct xt_node *enable, *iq; 1020 1021 enable = xt_new_node("enable", NULL, NULL); 1022 xt_add_attr(enable, "xmlns", XMLNS_CARBONS); 1023 iq = jabber_make_packet("iq", "set", NULL, enable); 1024 1025 jabber_cache_add(ic, iq, jabber_iq_carbons_response); 1026 jabber_write_packet(ic, iq); 1027 } 1028 1029 if ((id = xt_find_node(query->children, "identity"))) { 1006 struct xt_node *id; 1007 1008 if ((id = xt_find_path(node, "query/identity"))) { 1030 1009 char *cat, *type, *name; 1031 1010 … … 1044 1023 return XT_HANDLED; 1045 1024 } 1046 1047 static xt_status jabber_iq_carbons_response(struct im_connection *ic,1048 struct xt_node *node, struct xt_node *orig)1049 {1050 struct jabber_error *err;1051 1052 if ((err = jabber_error_parse(xt_find_node(node->children, "error"), XMLNS_STANZA_ERROR))) {1053 imcb_error(ic, "Error enabling carbons: %s%s%s",1054 err->code, err->text ? ": " : "", err->text ? err->text : "");1055 jabber_error_free(err);1056 } else {1057 imcb_log(ic, "Carbons enabled");1058 }1059 1060 return XT_HANDLED;1061 }
Note: See TracChangeset
for help on using the changeset viewer.