pidgin: 7336d0ba: Added paramater to aim_send_login() to a...

evands at pidgin.im evands at pidgin.im
Sat Jun 7 11:45:40 EDT 2008


-----------------------------------------------------------------
Revision: 7336d0ba37008b29f80397209f6bdc4420772b13
Ancestor: 8748a31a486936dbb05a6ba4cc872f622b7b9c15
Author: evands at pidgin.im
Date: 2008-06-07T15:41:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/7336d0ba37008b29f80397209f6bdc4420772b13

Modified files:
        libpurple/protocols/oscar/family_auth.c
        libpurple/protocols/oscar/oscar.c
        libpurple/protocols/oscar/oscar.h
        libpurple/protocols/oscar/oscarcommon.h

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_auth.c	d815be8a1198dda9769c32e3d5a2f69c81c86e9d
+++ libpurple/protocols/oscar/family_auth.c	3b8f087e8165345ecc68af0d427ad1ce6c11f2fb
@@ -200,9 +200,13 @@ goddamnicq2(OscarData *od, FlapConnectio
  *        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 @@ aim_send_login(OscarData *od, FlapConnec
 	 * 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);
 
============================================================
--- libpurple/protocols/oscar/oscar.c	cf81aca1a128dc9defe7fcbd074503df44ce7a37
+++ libpurple/protocols/oscar/oscar.c	f19e6dde8c09025bf1785f502b7cec17a88e0d31
@@ -1811,7 +1811,8 @@ purple_parse_login(OscarData *od, FlapCo
 
 	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;
============================================================
--- libpurple/protocols/oscar/oscar.h	4029373a48bd83562f1810ba730699521ae28a1d
+++ libpurple/protocols/oscar/oscar.h	e8c5db2f4a4b035c65fc414be0f359b140522c04
@@ -594,7 +594,7 @@ int aim_request_login(OscarData *od, Fla
 
 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);
============================================================
--- libpurple/protocols/oscar/oscarcommon.h	ace4700e7cb8150609f0404be479ab90f10b64e3
+++ libpurple/protocols/oscar/oscarcommon.h	49db0c1100450e5914b921e8ecc8720cf543ebee
@@ -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);


More information about the Commits mailing list