libpurple/protocols/jabber/auth.c

changeset 42128
118067ca0367
parent 42102
0601c6f60bff
child 42172
7c2d151b410d
equal deleted inserted replaced
42127:18acb99a0fa6 42128:118067ca0367
72 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR, 72 PURPLE_CONNECTION_ERROR_ENCRYPTION_ERROR,
73 _("Server requires plaintext authentication over an unencrypted stream")); 73 _("Server requires plaintext authentication over an unencrypted stream"));
74 } 74 }
75 75
76 static void 76 static void
77 auth_old_pass_cb(PurpleConnection *gc, PurpleRequestFields *fields) 77 auth_old_pass_cb(PurpleConnection *gc, PurpleRequestPage *page) {
78 {
79 PurpleAccount *account; 78 PurpleAccount *account;
80 JabberStream *js; 79 JabberStream *js;
81 const char *entry; 80 const char *entry;
82 gboolean remember; 81 gboolean remember;
83 82
85 PURPLE_ASSERT_CONNECTION_IS_VALID(gc); 84 PURPLE_ASSERT_CONNECTION_IS_VALID(gc);
86 85
87 account = purple_connection_get_account(gc); 86 account = purple_connection_get_account(gc);
88 js = purple_connection_get_protocol_data(gc); 87 js = purple_connection_get_protocol_data(gc);
89 88
90 entry = purple_request_fields_get_string(fields, "password"); 89 entry = purple_request_page_get_string(page, "password");
91 remember = purple_request_fields_get_bool(fields, "remember"); 90 remember = purple_request_page_get_bool(page, "remember");
92 91
93 if (!entry || !*entry) 92 if (!entry || !*entry)
94 { 93 {
95 purple_notify_error(account, NULL, 94 purple_notify_error(account, NULL,
96 _("Password is required to sign on."), NULL, 95 _("Password is required to sign on."), NULL,
114 /* Restart our connection. */ 113 /* Restart our connection. */
115 jabber_auth_start_old(js); 114 jabber_auth_start_old(js);
116 } 115 }
117 116
118 static void 117 static void
119 auth_no_pass_cb(PurpleConnection *gc, 118 auth_no_pass_cb(PurpleConnection *gc, G_GNUC_UNUSED PurpleRequestPage *page) {
120 G_GNUC_UNUSED PurpleRequestFields *fields)
121 {
122 /* TODO: the password prompt dialog doesn't get disposed if the account disconnects */ 119 /* TODO: the password prompt dialog doesn't get disposed if the account disconnects */
123 PURPLE_ASSERT_CONNECTION_IS_VALID(gc); 120 PURPLE_ASSERT_CONNECTION_IS_VALID(gc);
124 121
125 /* Disable the account as the user has cancelled connecting */ 122 /* Disable the account as the user has cancelled connecting */
126 purple_account_set_enabled(purple_connection_get_account(gc), FALSE); 123 purple_account_set_enabled(purple_connection_get_account(gc), FALSE);

mercurial