Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jabber.c @ 26329:f5e613e05332
Applied disco-2.patch from nops with some modifications:
* Alphabetized includes and Makefiles
* Removed purple_disco_set_ui_ops(NULL) in finch; ops is NULL by default.
* A few string changes
* Removed DISCO_PREF_LAST_SERVER. Default to our server, but store
the last requested in the JabberStream* and use it if available.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sun, 29 Mar 2009 19:29:22 +0000 |
parents | 7ace7bf0bfad |
children | b290c7b9fc73 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sat Mar 28 16:58:32 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Mar 29 19:29:22 2009 +0000 @@ -1062,22 +1062,24 @@ group = purple_request_field_group_new(NULL); purple_request_fields_add_group(fields, group); - if(js->registration) - field = purple_request_field_string_new("username", _("Username"), js->user->node, FALSE); - else - field = purple_request_field_string_new("username", _("Username"), NULL, FALSE); - - purple_request_field_group_add_field(group, field); - - if(js->registration) - field = purple_request_field_string_new("password", _("Password"), - purple_connection_get_password(js->gc), FALSE); - else - field = purple_request_field_string_new("password", _("Password"), NULL, FALSE); - - purple_request_field_string_set_masked(field, TRUE); - purple_request_field_group_add_field(group, field); - + if(xmlnode_get_child(query, "username")) { + if(js->registration) + field = purple_request_field_string_new("username", _("Username"), js->user->node, FALSE); + else + field = purple_request_field_string_new("username", _("Username"), NULL, FALSE); + + purple_request_field_group_add_field(group, field); + } + if(xmlnode_get_child(query, "password")) { + if(js->registration) + field = purple_request_field_string_new("password", _("Password"), + purple_connection_get_password(js->gc), FALSE); + else + field = purple_request_field_string_new("password", _("Password"), NULL, FALSE); + + purple_request_field_string_set_masked(field, TRUE); + purple_request_field_group_add_field(group, field); + } if(xmlnode_get_child(query, "name")) { if(js->registration) field = purple_request_field_string_new("name", _("Name"), @@ -1414,6 +1416,7 @@ g_free(js->old_uri); g_free(js->old_track); g_free(js->expected_rspauth); + g_free(js->last_disco_server); if (js->keepalive_timeout != -1) purple_timeout_remove(js->keepalive_timeout);