libpurple/example/nullclient.c

changeset 40680
f9ea6d5e8992
parent 40541
9ceb8d25d4d9
child 40804
5496016b3c00
equal deleted inserted replaced
40679:062a4574af3e 40680:f9ea6d5e8992
158 } 158 }
159 #endif /* _WIN32 || __BIONIC__ */ 159 #endif /* _WIN32 || __BIONIC__ */
160 160
161 int main(int argc, char *argv[]) 161 int main(int argc, char *argv[])
162 { 162 {
163 PurpleCredentialManager *manager = NULL;
163 GList *list, *iter; 164 GList *list, *iter;
164 int i, num; 165 int i, num;
165 GList *names = NULL; 166 GList *names = NULL;
166 const char *protocol = NULL; 167 const char *protocol = NULL;
167 char name[128]; 168 char name[128];
223 /* Create the account */ 224 /* Create the account */
224 account = purple_account_new(name, protocol); 225 account = purple_account_new(name, protocol);
225 226
226 /* Get the password for the account */ 227 /* Get the password for the account */
227 password = getpass("Password: "); 228 password = getpass("Password: ");
228 purple_account_set_password(account, password, NULL, NULL); 229
230 manager = purple_credential_manager_get_default();
231 purple_credential_manager_write_password_async(manager, account, password,
232 NULL, NULL, NULL);
229 233
230 /* It's necessary to enable the account first. */ 234 /* It's necessary to enable the account first. */
231 purple_account_set_enabled(account, UI_ID, TRUE); 235 purple_account_set_enabled(account, UI_ID, TRUE);
232 236
233 /* Now, to connect the account(s), create a status and activate it. */ 237 /* Now, to connect the account(s), create a status and activate it. */

mercurial