# HG changeset patch # User Evan Schoenberg # Date 1212853265 0 # Node ID f1a0258b44f425775f7b85c226b8495545480bff # Parent a3759c05cc5bc36c844348b3610c3c61ee5e5f2c Added paramater to aim_send_login() to allow control over whether we want multiple logins or not per AIM connection. If TRUE, we have the current behavior, in which the AIM server prompts the user as to what to do. If FALSE, existing logins are disconnected as we connect. We pass OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS, which is TRUE. diff -r a3759c05cc5b -r f1a0258b44f4 libpurple/protocols/oscar/family_auth.c --- a/libpurple/protocols/oscar/family_auth.c Sat Jun 07 14:26:41 2008 +0000 +++ b/libpurple/protocols/oscar/family_auth.c Sat Jun 07 15:41:05 2008 +0000 @@ -200,9 +200,13 @@ * usually happens for AOL accounts. We are told that we * should truncate it if the 0x0017/0x0007 SNAC contains * a TLV of type 0x0026 with data 0x0000. + * @param allow_multiple_logins Allow multiple logins? If TRUE, the AIM + * server will prompt the user when multiple logins occur. If + * FALSE, existing connections (on other clients) will be + * disconnected automatically as we connect. */ int -aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key) +aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key, gboolean allow_multiple_logins) { FlapFrame *frame; GSList *tlvlist = NULL; @@ -256,7 +260,7 @@ * If set, old-fashioned buddy lists will not work. You will need * to use SSI. */ - aim_tlvlist_add_8(&tlvlist, 0x004a, 0x01); + aim_tlvlist_add_8(&tlvlist, 0x004a, (allow_multiple_logins ? 0x01 : 0x02)); aim_tlvlist_write(&frame->data, &tlvlist); diff -r a3759c05cc5b -r f1a0258b44f4 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Sat Jun 07 14:26:41 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sat Jun 07 15:41:05 2008 +0000 @@ -1811,7 +1811,8 @@ aim_send_login(od, conn, purple_account_get_username(account), purple_connection_get_password(gc), truncate_pass, - od->icq ? &icqinfo : &aiminfo, key); + od->icq ? &icqinfo : &aiminfo, key, + /* allow multple logins? */ OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS); purple_connection_update_progress(gc, _("Password sent"), 2, OSCAR_CONNECT_STEPS); ck[2] = 0x6c; diff -r a3759c05cc5b -r f1a0258b44f4 libpurple/protocols/oscar/oscar.h --- a/libpurple/protocols/oscar/oscar.h Sat Jun 07 14:26:41 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.h Sat Jun 07 15:41:05 2008 +0000 @@ -594,7 +594,7 @@ void aim_clientready(OscarData *od, FlapConnection *conn); int aim_request_login(OscarData *od, FlapConnection *conn, const char *sn); -int aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key); +int aim_send_login(OscarData *od, FlapConnection *conn, const char *sn, const char *password, gboolean truncate_pass, ClientInfo *ci, const char *key, gboolean allow_multiple_logins); /* 0x000b */ int aim_auth_securid_send(OscarData *od, const char *securid); void aim_cleansnacs(OscarData *, int maxage); diff -r a3759c05cc5b -r f1a0258b44f4 libpurple/protocols/oscar/oscarcommon.h --- a/libpurple/protocols/oscar/oscarcommon.h Sat Jun 07 14:26:41 2008 +0000 +++ b/libpurple/protocols/oscar/oscarcommon.h Sat Jun 07 15:41:05 2008 +0000 @@ -41,6 +41,7 @@ #define OSCAR_DEFAULT_HIDE_IP TRUE #define OSCAR_DEFAULT_WEB_AWARE FALSE #define OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY FALSE +#define OSCAR_DEFAULT_ALLOW_MULTIPLE_LOGINS TRUE #ifdef _WIN32 const char *oscar_get_locale_charset(void);