# HG changeset patch # User Elliott Sales de Andrade # Date 1244696835 0 # Node ID 48bfcbe20b11216b6342a529f165d46ad436c91d # Parent 28b5fcfb74446ff81d878c6797292728ab6e3488# Parent d679d47c82be331cd219d9685d88c1b9a40665d2 merge of '86d7e4c199cf2a62e48fd6fe79e35e3c80cc7926' and 'ddd8012e657f100977759e1d1312576b04b464b9' diff -r d679d47c82be -r 48bfcbe20b11 libpurple/protocols/oscar/family_auth.c --- a/libpurple/protocols/oscar/family_auth.c Thu Jun 11 02:21:44 2009 +0000 +++ b/libpurple/protocols/oscar/family_auth.c Thu Jun 11 05:07:15 2009 +0000 @@ -129,6 +129,8 @@ GSList *tlvlist = NULL; int passwdlen; guint8 *password_encoded; + const char *clientstring; + guint32 distrib; passwdlen = strlen(password); password_encoded = (guint8 *)g_malloc(passwdlen+1); @@ -139,18 +141,25 @@ aim_encode_password(password, password_encoded); + clientstring = purple_prefs_get_string("/plugins/prpl/oscar/clientstring"); + if (clientstring == NULL) + clientstring = ci->clientstring; + distrib = purple_prefs_get_int("/plugins/prpl/oscar/distid"); + if ((gint32)distrib == -1) + distrib = ci->distrib; + byte_stream_put32(&frame->data, 0x00000001); /* FLAP Version */ aim_tlvlist_add_str(&tlvlist, 0x0001, sn); aim_tlvlist_add_raw(&tlvlist, 0x0002, passwdlen, password_encoded); - if (ci->clientstring) - aim_tlvlist_add_str(&tlvlist, 0x0003, ci->clientstring); + if (clientstring) + aim_tlvlist_add_str(&tlvlist, 0x0003, clientstring); aim_tlvlist_add_16(&tlvlist, 0x0016, (guint16)ci->clientid); aim_tlvlist_add_16(&tlvlist, 0x0017, (guint16)ci->major); aim_tlvlist_add_16(&tlvlist, 0x0018, (guint16)ci->minor); aim_tlvlist_add_16(&tlvlist, 0x0019, (guint16)ci->point); aim_tlvlist_add_16(&tlvlist, 0x001a, (guint16)ci->build); - aim_tlvlist_add_32(&tlvlist, 0x0014, (guint32)ci->distrib); /* distribution chan */ + aim_tlvlist_add_32(&tlvlist, 0x0014, distrib); /* distribution chan */ aim_tlvlist_add_str(&tlvlist, 0x000f, ci->lang); aim_tlvlist_add_str(&tlvlist, 0x000e, ci->country); @@ -210,6 +219,8 @@ guint8 digest[16]; aim_snacid_t snacid; size_t password_len; + const char *clientstring; + guint32 distrib; if (!ci || !sn || !password) return -EINVAL; @@ -236,20 +247,27 @@ aim_encode_password_md5(password, password_len, key, digest); + clientstring = purple_prefs_get_string("/plugins/prpl/oscar/clientstring"); + if (clientstring == NULL) + clientstring = ci->clientstring; + distrib = purple_prefs_get_int("/plugins/prpl/oscar/distid"); + if ((gint32)distrib == -1) + distrib = ci->distrib; + aim_tlvlist_add_raw(&tlvlist, 0x0025, 16, digest); #ifndef USE_OLD_MD5 aim_tlvlist_add_noval(&tlvlist, 0x004c); #endif - if (ci->clientstring) - aim_tlvlist_add_str(&tlvlist, 0x0003, ci->clientstring); + if (clientstring) + aim_tlvlist_add_str(&tlvlist, 0x0003, clientstring); aim_tlvlist_add_16(&tlvlist, 0x0016, (guint16)ci->clientid); aim_tlvlist_add_16(&tlvlist, 0x0017, (guint16)ci->major); aim_tlvlist_add_16(&tlvlist, 0x0018, (guint16)ci->minor); aim_tlvlist_add_16(&tlvlist, 0x0019, (guint16)ci->point); aim_tlvlist_add_16(&tlvlist, 0x001a, (guint16)ci->build); - aim_tlvlist_add_32(&tlvlist, 0x0014, (guint32)ci->distrib); + aim_tlvlist_add_32(&tlvlist, 0x0014, distrib); aim_tlvlist_add_str(&tlvlist, 0x000f, ci->lang); aim_tlvlist_add_str(&tlvlist, 0x000e, ci->country); diff -r d679d47c82be -r 48bfcbe20b11 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Thu Jun 11 02:21:44 2009 +0000 +++ b/libpurple/protocols/oscar/oscar.c Thu Jun 11 05:07:15 2009 +0000 @@ -7022,6 +7022,16 @@ /* Preferences */ purple_prefs_add_none("/plugins/prpl/oscar"); purple_prefs_add_bool("/plugins/prpl/oscar/recent_buddies", FALSE); + + /* + * These two preferences will normally not be changed. UIs can optionally + * use them to override these two version fields which are sent to the + * server when logging in. AOL requested this change to allow clients to + * use custom values. + */ + purple_prefs_add_string("/plugins/prpl/oscar/clientstring", NULL); + purple_prefs_add_int("/plugins/prpl/oscar/distid", -1); + purple_prefs_remove("/plugins/prpl/oscar/show_idle"); purple_prefs_remove("/plugins/prpl/oscar/always_use_rv_proxy");