Changes in protocols/jabber/iq.c [b38f655:7554702]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/iq.c
rb38f655 r7554702 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); 30 31 31 32 xt_status jabber_pkt_iq(struct xt_node *node, gpointer data) … … 52 53 (c = xt_find_node(node->children, "time"))) || 53 54 !(s = xt_find_attr(c, "xmlns"))) { 54 /* Sigh. Who decided to suddenly invent new elements 55 instead of just sticking with <query/>? */ 56 return XT_HANDLED; 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; 57 60 } 58 61 … … 118 121 XMLNS_BYTESTREAMS, 119 122 XMLNS_FILETRANSFER, 123 XMLNS_CARBONS, 120 124 NULL }; 121 125 const char **f; … … 134 138 } else { 135 139 xt_free_node(reply); 136 reply = jabber_make_error_packet(node, " feature-not-implemented", "cancel", NULL);140 reply = jabber_make_error_packet(node, "service-unavailable", "cancel", NULL); 137 141 pack = 0; 138 142 } … … 385 389 struct xt_node *response; 386 390 struct jabber_data *jd = ic->proto_data; 387 388 response = jabber_make_packet("iq", "result", g_strdup_printf("%s@%s", jd->username, jd->server), NULL);391 392 response = jabber_make_packet("iq", "result", jd->me, NULL); 389 393 390 394 jabber_cache_add(ic, response, NULL); … … 1004 1008 { 1005 1009 struct jabber_data *jd = ic->proto_data; 1006 struct xt_node *id; 1007 1008 if ((id = xt_find_path(node, "query/identity"))) { 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"))) { 1009 1030 char *cat, *type, *name; 1010 1031 … … 1023 1044 return XT_HANDLED; 1024 1045 } 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.