comparison libpurple/account.c @ 16120:e5af828c2f54

merge of 'aa2170e50c202539ea83f299b04eedf9a5d62178' and 'e6a776d806e488fa79eada7619f40300fdecda61'
author Nathan Walp <nwalp@pidgin.im>
date Sun, 15 Apr 2007 00:15:32 +0000
parents ac1a32ebd62c
children 4fc51a87ce42 08db93bbd798
comparison
equal deleted inserted replaced
16119:e57d9d5e5c86 16120:e5af828c2f54
930 purple_account_set_password(account, entry); 930 purple_account_set_password(account, entry);
931 931
932 purple_connection_new(account, FALSE, entry); 932 purple_connection_new(account, FALSE, entry);
933 } 933 }
934 934
935 static void 935 void
936 request_password(PurpleAccount *account) 936 purple_account_request_password(PurpleAccount *account, GCallback ok_cb,
937 GCallback cancel_cb, void *user_data)
937 { 938 {
938 gchar *primary; 939 gchar *primary;
939 const gchar *username; 940 const gchar *username;
940 PurpleRequestFieldGroup *group; 941 PurpleRequestFieldGroup *group;
941 PurpleRequestField *field; 942 PurpleRequestField *field;
963 purple_request_fields(account, 964 purple_request_fields(account,
964 NULL, 965 NULL,
965 primary, 966 primary,
966 NULL, 967 NULL,
967 fields, 968 fields,
968 _("OK"), G_CALLBACK(request_password_ok_cb), 969 _("OK"), ok_cb,
969 _("Cancel"), NULL, 970 _("Cancel"), cancel_cb,
970 account); 971 user_data);
971 g_free(primary); 972 g_free(primary);
972 } 973 }
973 974
974 void 975 void
975 purple_account_connect(PurpleAccount *account) 976 purple_account_connect(PurpleAccount *account)
1001 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); 1002 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
1002 password = purple_account_get_password(account); 1003 password = purple_account_get_password(account);
1003 if ((password == NULL) && 1004 if ((password == NULL) &&
1004 !(prpl_info->options & OPT_PROTO_NO_PASSWORD) && 1005 !(prpl_info->options & OPT_PROTO_NO_PASSWORD) &&
1005 !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL)) 1006 !(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL))
1006 request_password(account); 1007 purple_account_request_password(account, G_CALLBACK(request_password_ok_cb), NULL, account);
1007 else 1008 else
1008 purple_connection_new(account, FALSE, password); 1009 purple_connection_new(account, FALSE, password);
1009 } 1010 }
1010 1011
1011 void 1012 void