Mercurial > pidgin.yaz
changeset 27180:28b5fcfb7444
Check in a change requested by Gregory Cypes from AOL. They want clients
to be able to specify the clientstring and distribution id used when
authenticating. Seems like a reasonable request.
If the UI doesn't change these preferences then the default values from the
ClientInfo struct are used.
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 10 Jun 2009 07:44:35 +0000 |
parents | db373b572015 |
children | 48bfcbe20b11 |
files | libpurple/protocols/oscar/family_auth.c libpurple/protocols/oscar/oscar.c |
diffstat | 2 files changed, 34 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/oscar/family_auth.c Wed Jun 10 01:07:29 2009 +0000 +++ b/libpurple/protocols/oscar/family_auth.c Wed Jun 10 07:44:35 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);
--- a/libpurple/protocols/oscar/oscar.c Wed Jun 10 01:07:29 2009 +0000 +++ b/libpurple/protocols/oscar/oscar.c Wed Jun 10 07:44:35 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");