comparison src/protocols/jabber/auth.c @ 8135:8f4ce853e685

[gaim-migrate @ 8840] created a convenience function, and used it. a lot. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 17 Jan 2004 19:36:29 +0000
parents 380d2bbdef1a
children 1e145b735b05
comparison
equal deleted inserted replaced
8134:ea3eb461efc0 8135:8f4ce853e685
64 if(!mechs) { 64 if(!mechs) {
65 gaim_connection_error(js->gc, _("Invalid response from server.")); 65 gaim_connection_error(js->gc, _("Invalid response from server."));
66 return; 66 return;
67 } 67 }
68 68
69 for(mechnode = mechs->child; mechnode; mechnode = mechnode->next) 69 for(mechnode = xmlnode_get_child(mechs, "mechanism"); mechnode;
70 mechnode = xmlnode_get_next_twin(mechnode))
70 { 71 {
71 if(mechnode->type == NODE_TYPE_TAG) { 72 char *mech_name = xmlnode_get_data(mechnode);
72 char *mech_name = xmlnode_get_data(mechnode); 73 if(mech_name && !strcmp(mech_name, "DIGEST-MD5"))
73 if(mech_name && !strcmp(mech_name, "DIGEST-MD5")) 74 digest_md5 = TRUE;
74 digest_md5 = TRUE; 75 else if(mech_name && !strcmp(mech_name, "PLAIN"))
75 else if(mech_name && !strcmp(mech_name, "PLAIN")) 76 plain = TRUE;
76 plain = TRUE; 77 g_free(mech_name);
77 g_free(mech_name);
78 }
79 } 78 }
80 79
81 auth = xmlnode_new("auth"); 80 auth = xmlnode_new("auth");
82 xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl"); 81 xmlnode_set_attrib(auth, "xmlns", "urn:ietf:params:xml:ns:xmpp-sasl");
83 82