libpurple/protocols/jabber/bosh.c

changeset 38358
30ba44276e74
parent 36257
c5445f25f90f
parent 38260
dcada91c0912
child 38433
361c801c4536
equal deleted inserted replaced
38346:dee30d35e5e7 38358:30ba44276e74
201 201
202 data = purple_http_response_get_data(response, &data_len); 202 data = purple_http_response_get_data(response, &data_len);
203 root = purple_xmlnode_from_str(data, data_len); 203 root = purple_xmlnode_from_str(data, data_len);
204 204
205 type = purple_xmlnode_get_attrib(root, "type"); 205 type = purple_xmlnode_get_attrib(root, "type");
206 if (g_strcmp0(type, "terminate") == 0) { 206 if (purple_strequal(type, "terminate")) {
207 purple_connection_error(conn->js->gc, 207 purple_connection_error(conn->js->gc,
208 PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("The BOSH " 208 PURPLE_CONNECTION_ERROR_OTHER_ERROR, _("The BOSH "
209 "connection manager terminated your session.")); 209 "connection manager terminated your session."));
210 purple_xmlnode_free(root); 210 purple_xmlnode_free(root);
211 return NULL; 211 return NULL;
243 243
244 /* Workaround for non-compliant servers that don't stamp 244 /* Workaround for non-compliant servers that don't stamp
245 * the right xmlns on these packets. See #11315. 245 * the right xmlns on these packets. See #11315.
246 */ 246 */
247 xmlns = purple_xmlnode_get_namespace(child); 247 xmlns = purple_xmlnode_get_namespace(child);
248 if ((xmlns == NULL || g_strcmp0(xmlns, NS_BOSH) == 0) && 248 if ((xmlns == NULL || purple_strequal(xmlns, NS_BOSH)) &&
249 (g_strcmp0(child->name, "iq") == 0 || 249 (purple_strequal(child->name, "iq") ||
250 g_strcmp0(child->name, "message") == 0 || 250 purple_strequal(child->name, "message") ||
251 g_strcmp0(child->name, "presence") == 0)) 251 purple_strequal(child->name, "presence")))
252 { 252 {
253 purple_xmlnode_set_namespace(child, NS_XMPP_CLIENT); 253 purple_xmlnode_set_namespace(child, NS_XMPP_CLIENT);
254 } 254 }
255 255
256 jabber_process_packet(bosh_conn->js, &child); 256 jabber_process_packet(bosh_conn->js, &child);

mercurial