changeset 23311:f1a0258b44f4

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.
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 07 Jun 2008 15:41:05 +0000
parents a3759c05cc5b
children afdbbf36499e
files libpurple/protocols/oscar/family_auth.c libpurple/protocols/oscar/oscar.c libpurple/protocols/oscar/oscar.h libpurple/protocols/oscar/oscarcommon.h
diffstat 4 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
--- 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;
--- 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);
--- 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);