Hi,
new updates on Yahoo Transport and Avatars ...

Well, the thing is that any modification on the Yahoo Transport regarding the avatars was not affecting Gajim ... mmmm why? well, I dived in the code of Gajim and notice that Gajim implements its own functions to get the avatar ... not using the ones offered by the transport.

To the question of:

what happens if you alter:
      if pay[each][213] == '1':
to
      if pay[each][213] == '1' or pay[each][213] == '2':

Apparently, the messages/answers were the same ... I mean, when dealing with pay[each][213] == '1' or pay[each][213] == '2' the functions replies "OK" ... mmmm it's weird because i didn't see the new avatar, although the return value was as OK.

The new approach is to dive in the code of "Gaim" (not Gajim) to see how Gaim download any kind of avatar. Gajim only gets to download Buddy Icons ... Gaim gets any kind of download ...

So far, this is the only code I got from Gaim ... apparently it does not make any distinction from any kind of avatars ... it should work the same :(((((

           case 197: /* Avatars */
           {
               char *decoded, *tmp;
               guint len;

               if (pair->value) {
                   gaim_base64_decode(pair->value, &decoded, &len);
                   if (len) {
                       tmp = gaim_str_binary_to_ascii(decoded, len);
                       gaim_debug_info("yahoo", "Got key 197, value =
   %s\n", tmp);
                       g_free(tmp);
                   }
                   g_free(decoded);
               }
               break;
           }



I'll keep posted if i get any updates,


Jean



Norman Rasmussen wrote:
On 1/22/07, Jean Verger <[EMAIL PROTECTED]> wrote:
- Any reason for this behavior?

Not really, I haven't installed the Yahoo client, so I didn't know
there was an Option B.  Option A is easy to test because you can do
everything via the web-site.

- I've been trying to modify the code. I thought that the key was in
ylib.py:

        if pay[each][213] == '1':
                b = avatar.getavatar(pay[each][197], self.dumpProtocol)
                    if b != None and self.handlers.has_key('avatar'):
self.handlers['avatar'](self.fromjid,pay[each][7],b)

Analyzing the packets, I noticed that avatars type B have pay[each][213]
equals to 2.
However, the surprising/frustrating/funny part of all this is that  when
I comment out any part of the code that makes a reference to the avatar,
the avatar is still been displayed ...

I'm pretty sure Gajim caches the avatar, so you'd have to clear out
the Gajim cache too to really notice that the avatar is gone.

what happens if you alter:
        if pay[each][213] == '1':
to:
        if pay[each][213] == '1' or pay[each][213] == '2':
?

Any hint on how Yahoo Transport is dealing with avatars? Any
document/experience?
no docs, best thing to do is make sure dumpProtocol is enabled, then
you can see the raw data.

At the moment what happens is that the yahoo server send a hash of the
image data, which is then fetched via http from the yahoo image
server.  If the Option B images are stored on the same server then
adding the above code should make things 'just work'.  If there's a
different url for those images then something like ethereal is useful
to sniff it out.

If you get it working, please post the patch so that I can apply it :-)

_______________________________________________
py-transports mailing list
py-transports@blathersource.org
http://www.modevia.com/cgi-bin/mailman/listinfo/py-transports

Reply via email to