Opened 4 years ago

Closed 3 years ago

#15381 closed defect (fixed)

Name as Alias from Contact Details

Reported by: FireDK Owned by: sulabh.dev
Milestone: 2.10.7 Component: Yahoo!/Yahoo! JAPAN
Version: 2.10.6 Keywords:
Cc:

Description

Yahoo Messenger has a nifty little feature that allows setting Contact Details for the persons on your list. I have used this to set a name for each of my contacts. Up until a couple of days ago Pidgin would load these names directly from my Yahoo account and display them as alias for contacts (saving me the trouble of having to set custom aliases in Pidgin). For some reason it does not do this any more so I'm stuck with just account names in Pidgin, while the contact names are properly displayed in Yahoo Messenger. Since I did not alter my Pidgin installation in any way I assume there has been some kind of change with the Yahoo servers.

Parsing through a debug log, the only lines that seem connected to any alias data are:

(11:31:50) network: found network (11:31:50) network: found network (11:31:50) network: Received Network Change Notification. Current network count is 2, previous count was 2.

(11:32:00) yahoo: 7 bytes to read, rxlen is 27 (11:32:00) yahoo: Yahoo Service: 0x0b Status: 1 (11:32:00) yahoo: Fetched 137 bytes of alias data (11:32:00) yahoo: Fetched 137 bytes of alias data

It would really like this functionality back but since I am not 100% sure it is an actual bug and not a problem with my setup, please let me know if this bug is reproducible or not.

Attachments (1)

yahoo-alias-15381.diff (2.1 KB) - added by csalgau 4 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 4 years ago by csalgau

Fellow pidginers. I took the 10 minutes needed to debug this. It appears Yahoo! has started enforcing the user agent used by Yahoo! Messenger for obtaining the address book updates. I'll try to post a patch for this shortly. If somebody already has a building environment set up and is willing to do this, the details are Yahoo! uses User-Agent: Mozilla/4.0 (compatible; MSIE 5.5) in 11.5.0.228 (latest version I believe) Pidgin uses User-Agent: Mozilla/5.0. Change this and you're home free.

edit: I forgot to specify where/what/when. The problematic query is around libpurple/protocols/yahoo/yahoo_aliases.c:yahoo_fetch_aliases() as defined in libpurple/protocols/yahoo/libymsg.h we currently have #define YAHOO_CLIENT_USERAGENT "Mozilla/5.0" This is not consistent with what Yahoo! does. Their HTTP(at least) user agent for querying Pager urls is the Mozilla/4.0 one. I found it hard coded in ft60.dll in the latest Yahoo! Messenger build. Ads and other, newer links use the locally installed IE user agent.

Last edited 4 years ago by csalgau (previous) (diff)

comment:2 Changed 4 years ago by ionut.ticus

Great work, csalgau! I can confirm the modification you suggested solves the problem. I changed #define YAHOO_CLIENT_USERAGENT "Mozilla/5.0" with #define YAHOO_CLIENT_USERAGENT "Mozilla/4.0 (compatible; MSIE 5.5)" in libpurple/protocols/yahoo/libymsg.h:98 and the aliases are displayed correctly again. The version I tested this against is 2.10.6 on ArchLinux? x86_64; I used abs to download and compile the package.

Changed 4 years ago by csalgau

comment:3 Changed 4 years ago by csalgau

So I've finally managed to set up my build environment. I've attached a slightly improved patch. Somebody able to commit it might also find it in my bitbucket patch queue. It appears Yahoo does indeed use the previous url in other places, so I think limiting the scope to aliases is preferable for the moment. I'll come back with a better idea when I have some time to look at all the traffic dumps I have.

And here's a windows build of this patch and of #15273, for anyone interested.

Last edited 4 years ago by csalgau (previous) (diff)

comment:4 Changed 4 years ago by datallah

Ticket #15405 has been marked as a duplicate of this ticket.

comment:5 follow-up: Changed 4 years ago by FireDK

The patched version posted by csalgau does indeed solve this problem, however the build seems quite unstable (I've been using the Windows build he posted) and crashes randomly, most times after ending a conversation and closing the chat window. I don't believe this is caused by the patch for Yahoo names but I thought it's worth mentioning.

comment:6 follow-up: Changed 4 years ago by QuLogic

Is there any reason you can't just replace the User Agent entirely?

comment:7 in reply to: ↑ 5 Changed 4 years ago by csalgau

Replying to FireDK:

The patched version posted by csalgau does indeed solve this problem, however the build seems quite unstable (I've been using the Windows build he posted) and crashes randomly, most times after ending a conversation and closing the chat window. I don't believe this is caused by the patch for Yahoo names but I thought it's worth mentioning.

Terribly sorry for those. I have noticed the exact same behavior, but I see no reason for that in the diffs. It's probably something else added between 2.10.6 and 33470:0f5fd72228e3, but I've given that a quick check a few days ago and I don't remember seeing any clear problems. I'll do it again on Friday.

comment:8 in reply to: ↑ 6 Changed 4 years ago by csalgau

Replying to QuLogic:

Is there any reason you can't just replace the User Agent entirely?

It appears Yahoo! Messenger is currently using about 4 different user agents. One for logins(a weird thing), one for things like address book queries(this problem), one for advertising and integrated content(local IE user agent) and one for some content I can't recall now(the value of YAHOO_CLIENT_USERAGENT). While I could just go on a limb and say I'll set everything to the same one and check if that works, there's the small matter of that patch guideline with "don't do anything the official client doesn't do". I'd say it's better to stick to the tested UA for now. There are quite a number of changes between YMSG16 and YMSG19 and some things might work according to the old version. I'm hoping to give it some work over the weekend.

In the meantime, as a note to anyone interested: It appears that if you force Y!M 11.5 to go trough an http proxy, it will change the used protocol to an XML based one. Most requests that were previously done in YMSG packets are now sent over POSTS to "/". Having done this initially, for a second I thought this was YSMG19, but removing the http proxy constraint showed more YMSG packages. I'll have to revisit this, but at a fast glance the key/value pairs for services/commands appear to have a different meaning.

comment:9 follow-up: Changed 4 years ago by rekkanoryo

csalgu, how should I credit you for this patch? It looks good enough to me.

comment:10 in reply to: ↑ 9 Changed 4 years ago by csalgau

You can use "Catalin Salgau" for that, but please forgo including my email anywhere.

comment:11 Changed 3 years ago by Catalin Salgau <unknown>

  • Milestone set to 2.10.7
  • Resolution set to fixed
  • Status changed from new to closed

(In [5dd3e2938d7b]):
Official Yahoo! Messenger clients use a number of User Agent strings when making its various HTTP and HTTPS connections to do things such as download alias data and contact pictures. Apparently the servers are now enforcing that connecting clients use the correct User Agent string. This patch makes libpurple use the correct User Agent string when doing address book queries, like getting buddy alias data. Fixes #15381.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!