# HG changeset patch # User Mark Doliner # Date 1188456327 0 # Node ID 6c726af063c9286a0b0d55749f6e786b82039569 # Parent 1a8d6ab0c662510e4c2bce530febad4f85380981 Revert jeff2's changes from 2007-08-12. Specifically revision a86eabd31cf08d9b410391ddba7a201bbeb35f9c. The changes were made to the im.pidgin.soc.2007.msimprpl. I'm guessing he checked these in accidentally. It caused a bunch of compile warnings. diff -r 1a8d6ab0c662 -r 6c726af063c9 libpurple/example/nullclient.c --- a/libpurple/example/nullclient.c Thu Aug 30 03:26:52 2007 +0000 +++ b/libpurple/example/nullclient.c Thu Aug 30 06:45:27 2007 +0000 @@ -197,7 +197,7 @@ purple_util_set_user_dir(CUSTOM_USER_DIRECTORY); /* We do not want any debugging for now to keep the noise to a minimum. */ - purple_debug_set_enabled(TRUE); + purple_debug_set_enabled(FALSE); /* Set the core-uiops, which is used to * - initialize the ui specific preferences. @@ -257,24 +257,6 @@ PURPLE_CALLBACK(signed_on), NULL); } - - - -void signedOn( PurpleConnection *gc, gpointer dummy ) { - - - if( gc ) { - - PurpleAccount* a = purple_connection_get_account( gc ); - - if( a ) { - - purple_presence_set_idle( purple_account_get_presence( a ), TRUE, time( NULL ) ); - } - } -} - - int main() { GList *iter; @@ -300,26 +282,30 @@ names = g_list_append(names, info->id); } } + printf("Select the protocol [0-%d]: ", i-1); + fgets(name, sizeof(name), stdin); + sscanf(name, "%d", &num); + prpl = g_list_nth_data(names, num); + + printf("Username: "); + fgets(name, sizeof(name), stdin); + name[strlen(name) - 1] = 0; /* strip the \n at the end */ /* Create the account */ - account = purple_account_new("msimprpl@xyzzy.cjb.net", "prpl-myspace" ); - purple_account_set_password(account, "4224jc" ); + account = purple_account_new(name, prpl); + + /* Get the password for the account */ + password = getpass("Password: "); + purple_account_set_password(account, password); /* It's necessary to enable the account first. */ purple_account_set_enabled(account, UI_ID, TRUE); -#if 0 - static int handle; - purple_signal_connect( purple_connections_get_handle(), - "signed-on", &handle, - PURPLE_CALLBACK( signedOn ), - NULL ); - /* Now, to connect the account(s), create a status and activate it. */ - purple_savedstatus_activate( purple_savedstatus_get_default() ); + status = purple_savedstatus_new(NULL, PURPLE_STATUS_AVAILABLE); + purple_savedstatus_activate(status); connect_to_signals_for_demonstration_purposes_only(); -#endif g_main_loop_run(loop);