From: <ma...@us...> - 2006-08-21 04:12:11
|
Revision: 16940 Author: marv_sf Date: 2006-08-20 21:12:07 -0700 (Sun, 20 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16940&view=rev Log Message: ----------- up the protocol version, handle the new buddy list message (which i renamed the service for again), pretend auth type 2 is auth type 1, note when a buddy is an msn buddy, and possibly even send msn buddy messages correctly. I haven't really tested if everything works with the new protocol version, but I can always lower it again if bad things start happening and I don't have time to fix them before the release. I don't know if sending messages to msn users really works or not, it seems to be down server side at the moment. Someone test when msn gets it working again :P There's no way to add msn contacts to your yahoo account from within gaim. Not sure how we'll do the UI for that. Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/yahoo_friend.h trunk/libgaim/protocols/yahoo/yahoo_packet.h Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-21 04:06:33 UTC (rev 16939) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-21 04:12:07 UTC (rev 16940) @@ -469,6 +469,65 @@ } } +static void yahoo_process_list_15(GaimConnection *gc, struct yahoo_packet *pkt) +{ + GSList *l = pkt->hash; + + GaimAccount *account = gaim_connection_get_account(gc); + GHashTable *ht; + char *grp = NULL; + char *norm_bud = NULL; + + ht = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_slist_free); + + while (l) { + struct yahoo_pair *pair = l->data; + YahooFriend *f = NULL; /* It's your friends. They're going to want you to share your StarBursts. */ + /* But what if you had no friends? */ + GaimBuddy *b; + GaimGroup *g; + + + l = l->next; + + switch (pair->key) { + case 302: /* what is this? it's always 318 before a group, 319 before a s/n */ + case 300: /* ditto */ + break; + case 65: /* This is the group */ + g_free(grp); + grp = yahoo_string_decode(gc, pair->value, FALSE); + break; + case 7: /* buddy's s/n */ + g_free(norm_bud); + norm_bud = g_strdup(gaim_normalize(account, pair->value)); + f = yahoo_friend_find_or_new(gc, norm_bud); + if (!(b = gaim_find_buddy(account, norm_bud))) { + if (!(g = gaim_find_group(grp))) { + g = gaim_group_new(grp); + gaim_blist_add_group(g, NULL); + } + b = gaim_buddy_new(account, norm_bud, NULL); + gaim_blist_add_buddy(b, NULL, g, NULL); + } + yahoo_do_group_check(account, ht, norm_bud, grp); + + break; + case 241: /* msn user */ + if (f && *pair->value == '1') + f->msn = TRUE; + break; + /* case 242: */ /* this seems related to 241 */ + /* break; */ + } + } + + g_hash_table_foreach(ht, yahoo_do_group_cleanup, NULL); + g_hash_table_destroy(ht); + g_free(grp); + g_free(norm_bud); +} + static void yahoo_process_list(GaimConnection *gc, struct yahoo_packet *pkt) { GSList *l = pkt->hash; @@ -1710,6 +1769,7 @@ yahoo_process_auth_old(gc, seed); break; case 1: + case 2: /* This case seems to work, could probably use testing */ yahoo_process_auth_new(gc, seed); break; default: @@ -2042,6 +2102,7 @@ case YAHOO_SERVICE_CHATLOGON: case YAHOO_SERVICE_CHATLOGOFF: case YAHOO_SERVICE_Y6_STATUS_UPDATE: + case YAHOO_SERVICE_STATUS_15: yahoo_process_status(gc, pkt); break; case YAHOO_SERVICE_NOTIFY: @@ -2067,6 +2128,9 @@ case YAHOO_SERVICE_LIST: yahoo_process_list(gc, pkt); break; + case YAHOO_SERVICE_LIST_15: + yahoo_process_list_15(gc, pkt); + break; case YAHOO_SERVICE_AUTH: yahoo_process_auth(gc, pkt); break; @@ -3121,10 +3185,14 @@ gboolean utf8 = TRUE; GaimWhiteboard *wb; int ret = 1; + YahooFriend *f = NULL; msg2 = yahoo_string_encode(gc, msg, &utf8); yahoo_packet_hash(pkt, "ss", 1, gaim_connection_get_display_name(gc), 5, who); + if ((f = yahoo_friend_find(gc, who)) && f->msn) + yahoo_packet_hash_str(pkt, 241, "1"); + if (utf8) yahoo_packet_hash_str(pkt, 97, "1"); yahoo_packet_hash_str(pkt, 14, msg2); Modified: trunk/libgaim/protocols/yahoo/yahoo_friend.h =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_friend.h 2006-08-21 04:06:33 UTC (rev 16939) +++ trunk/libgaim/protocols/yahoo/yahoo_friend.h 2006-08-21 04:12:07 UTC (rev 16940) @@ -47,6 +47,7 @@ char *ip; gboolean bicon_sent_request; YahooPresenceVisibility presence; + gboolean msn; } YahooFriend; YahooFriend *yahoo_friend_find(GaimConnection *gc, const char *name); Modified: trunk/libgaim/protocols/yahoo/yahoo_packet.h =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_packet.h 2006-08-21 04:06:33 UTC (rev 16939) +++ trunk/libgaim/protocols/yahoo/yahoo_packet.h 2006-08-21 04:12:07 UTC (rev 16940) @@ -98,7 +98,7 @@ YAHOO_SERVICE_VERIFY_ID_EXISTS = 0xc8, YAHOO_SERVICE_AUDIBLE = 0xd0, YAHOO_SERVICE_STATUS_15 = 0xf0, - YAHOO_SERVICE_BUDDYLIST_15 = 0Xf1, + YAHOO_SERVICE_LIST_15 = 0Xf1, YAHOO_SERVICE_WEBLOGIN = 0x0226, YAHOO_SERVICE_SMS_MSG = 0x02ea }; @@ -116,7 +116,7 @@ }; #define YAHOO_WEBMESSENGER_PROTO_VER 0x0065 -#define YAHOO_PROTO_VER 0x000c +#define YAHOO_PROTO_VER 0x000f #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-08-21 04:42:16
|
Revision: 16941 Author: marv_sf Date: 2006-08-20 21:42:11 -0700 (Sun, 20 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16941&view=rev Log Message: ----------- silence some warnings by casting several things to (char *) that are actually unsigned char *'s. Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/yahoo_packet.c trunk/libgaim/protocols/yahoo/yahoo_picture.c Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-21 04:12:07 UTC (rev 16940) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-21 04:42:11 UTC (rev 16941) @@ -2382,7 +2382,7 @@ yd->rxqueue = g_realloc(yd->rxqueue, yd->rxlen + len + 1); memcpy(yd->rxqueue + yd->rxlen, buf, len); yd->rxlen += len; - i = buf = yd->rxqueue; + i = buf = (char *)yd->rxqueue; len = yd->rxlen; } buf[len] = '\0'; Modified: trunk/libgaim/protocols/yahoo/yahoo_packet.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-08-21 04:12:07 UTC (rev 16940) +++ trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-08-21 04:42:11 UTC (rev 16941) @@ -113,7 +113,7 @@ void yahoo_packet_read(struct yahoo_packet *pkt, const guchar *data, int len) { int pos = 0; - char key[64], *delimiter, *esc; + char key[64], *delimiter; gboolean accept; int x; struct yahoo_pair *pair; @@ -174,10 +174,13 @@ pkt->hash = g_slist_prepend(pkt->hash, pair); #ifdef DEBUG - esc = g_strescape(pair->value, NULL); - gaim_debug(GAIM_DEBUG_MISC, "yahoo", - "Key: %d \tValue: %s\n", pair->key, esc); - g_free(esc); + { + char *esc; + esc = g_strescape(pair->value, NULL); + gaim_debug(GAIM_DEBUG_MISC, "yahoo", + "Key: %d \tValue: %s\n", pair->key, esc); + g_free(esc); + } #endif } else { g_free(pair); Modified: trunk/libgaim/protocols/yahoo/yahoo_picture.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-08-21 04:12:07 UTC (rev 16940) +++ trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-08-21 04:42:11 UTC (rev 16941) @@ -464,7 +464,7 @@ pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, &pkt_buf); yahoo_packet_free(pkt); - g_string_prepend_len(d->str, pkt_buf, pkt_buf_len); + g_string_prepend_len(d->str, (char *)pkt_buf, pkt_buf_len); g_free(pkt_buf); g_string_prepend(d->str, header); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-08-22 04:46:49
|
Revision: 16970 Author: marv_sf Date: 2006-08-21 21:46:42 -0700 (Mon, 21 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16970&view=rev Log Message: ----------- I managed to do it wrong. Turns out I hadn't signed up for the beta, and was trying to send messages to the LCS version of my hotmail email address. What is LCS anyway? So now I think we properly support sending messages to LCS and windows live, assuming you manage to add those buddies in another client. I don't know what to do about duplicate screen names, or actually adding them. Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/yahoo_friend.h Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-22 03:01:52 UTC (rev 16969) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-22 04:46:42 UTC (rev 16970) @@ -513,9 +513,9 @@ yahoo_do_group_check(account, ht, norm_bud, grp); break; - case 241: /* msn user */ - if (f && *pair->value == '1') - f->msn = TRUE; + case 241: /* another protocol user */ + if (f) + f->protocol = strtol(pair->value, NULL, 10); break; /* case 242: */ /* this seems related to 241 */ /* break; */ @@ -3190,8 +3190,8 @@ msg2 = yahoo_string_encode(gc, msg, &utf8); yahoo_packet_hash(pkt, "ss", 1, gaim_connection_get_display_name(gc), 5, who); - if ((f = yahoo_friend_find(gc, who)) && f->msn) - yahoo_packet_hash_str(pkt, 241, "1"); + if ((f = yahoo_friend_find(gc, who)) && f->protocol) + yahoo_packet_hash_int(pkt, 241, f->protocol); if (utf8) yahoo_packet_hash_str(pkt, 97, "1"); Modified: trunk/libgaim/protocols/yahoo/yahoo_friend.h =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_friend.h 2006-08-22 03:01:52 UTC (rev 16969) +++ trunk/libgaim/protocols/yahoo/yahoo_friend.h 2006-08-22 04:46:42 UTC (rev 16970) @@ -47,7 +47,7 @@ char *ip; gboolean bicon_sent_request; YahooPresenceVisibility presence; - gboolean msn; + int protocol; /* 1=LCS, 2=MSN*/ } YahooFriend; YahooFriend *yahoo_friend_find(GaimConnection *gc, const char *name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2006-08-22 05:30:36
|
Revision: 16971 Author: marv_sf Date: 2006-08-21 22:30:30 -0700 (Mon, 21 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16971&view=rev Log Message: ----------- Add an encoding option. Let's you specify something other than iso-8859-1 for the nonUTF-8 pieces of the protocol. Modified Paths: -------------- trunk/libgaim/protocols/yahoo/util.c trunk/libgaim/protocols/yahoo/yahoo.c Modified: trunk/libgaim/protocols/yahoo/util.c =================================================================== --- trunk/libgaim/protocols/yahoo/util.c 2006-08-22 04:46:42 UTC (rev 16970) +++ trunk/libgaim/protocols/yahoo/util.c 2006-08-22 05:30:30 UTC (rev 16971) @@ -59,7 +59,7 @@ if (yd->jp) to_codeset = "SHIFT_JIS"; else - to_codeset = "ISO-8859-1"; + to_codeset = gaim_account_get_string(gaim_connection_get_account(gc), "local_charset", "ISO-8859-1"); ret = g_convert_with_fallback(str, strlen(str), to_codeset, "UTF-8", "?", NULL, NULL, NULL); if (ret) @@ -80,7 +80,7 @@ { struct yahoo_data *yd = gc->proto_data; char *ret; - char *from_codeset; + const char *from_codeset; if (utf8) { if (g_utf8_validate(str, -1, NULL)) @@ -90,7 +90,7 @@ if (yd->jp) from_codeset = "SHIFT_JIS"; else - from_codeset = "ISO-8859-1"; + from_codeset = gaim_account_get_string(gaim_connection_get_account(gc), "local_charset", "ISO-8859-1"); ret = g_convert_with_fallback(str, strlen(str), "UTF-8", from_codeset, NULL, NULL, NULL, NULL); Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-22 04:46:42 UTC (rev 16970) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-08-22 05:30:30 UTC (rev 16971) @@ -3884,6 +3884,10 @@ option = gaim_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + option = gaim_account_option_string_new(_("Encoding"), "local_charset", "ISO-8859-1"); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + + #if 0 option = gaim_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-09-03 07:40:22
|
Revision: 17136 http://svn.sourceforge.net/gaim/?rev=17136&view=rev Author: thekingant Date: 2006-09-03 00:40:11 -0700 (Sun, 03 Sep 2006) Log Message: ----------- Better connection error messages for Yahoo Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/ycht.c Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-09-03 07:18:35 UTC (rev 17135) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-09-03 07:40:11 UTC (rev 17136) @@ -2233,9 +2233,21 @@ len = read(yd->fd, buf, sizeof(buf)); - if (len <= 0) { - gaim_connection_error(gc, _("Unable to read")); + if (len < 0) { + gchar *tmp; + + if (errno == EAGAIN) + /* No worries */ + return; + + tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + strerror(errno)); + gaim_connection_error(gc, tmp); + g_free(tmp); return; + } else if (len == 0) { + gaim_connection_error(gc, _("Server closed the connection.")); + return; } yd->rxqueue = g_realloc(yd->rxqueue, len + yd->rxlen); @@ -2378,10 +2390,21 @@ GString *s; len = read(source, bufread, sizeof(bufread) - 1); - if (len < 0 && errno == EAGAIN) + + if (len < 0) { + gchar *tmp; + + if (errno == EAGAIN) + /* No worries */ + return; + + tmp = g_strdup_printf(_("Lost connection with server:\n%s"), + strerror(errno)); + gaim_connection_error(gc, tmp); + g_free(tmp); return; - else if (len <= 0) { - gaim_connection_error(gc, _("Unable to read")); + } else if (len == 0) { + gaim_connection_error(gc, _("Server closed the connection.")); return; } @@ -2396,7 +2419,7 @@ if ((strncmp(buf, "HTTP/1.0 302", strlen("HTTP/1.0 302")) && strncmp(buf, "HTTP/1.1 302", strlen("HTTP/1.1 302")))) { - gaim_connection_error(gc, _("Unable to read")); + gaim_connection_error(gc, _("Received unexpected HTTP response from server.")); return; } Modified: trunk/libgaim/protocols/yahoo/ycht.c =================================================================== --- trunk/libgaim/protocols/yahoo/ycht.c 2006-09-03 07:18:35 UTC (rev 17135) +++ trunk/libgaim/protocols/yahoo/ycht.c 2006-09-03 07:40:11 UTC (rev 17136) @@ -465,12 +465,21 @@ len = read(ycht->fd, buf, sizeof(buf)); - if (len < 0 && errno == EAGAIN) - return; + if (len < 0) { + gchar *tmp; - if (len <= 0) { - ycht_connection_error(ycht, _("Unable to read")); + if (errno == EAGAIN) + /* No worries */ + return; + + tmp = g_strdup_printf(_("Lost connection with server\n%s"), + strerror(errno)); + ycht_connection_error(ycht, tmp); + g_free(tmp); return; + } else if (len == 0) { + ycht_connection_error(ycht, _("Server closed the connection.")); + return; } ycht->rxqueue = g_realloc(ycht->rxqueue, len + ycht->rxlen); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-09-04 21:58:57
|
Revision: 17160 http://svn.sourceforge.net/gaim/?rev=17160&view=rev Author: evands Date: 2006-09-04 14:58:49 -0700 (Mon, 04 Sep 2006) Log Message: ----------- This patch was mentioned by Mark on gaim-devel; Tim replied, "That sounds good. As long as they're both #define's I can easily change." which they are :) Yahoo! Japan appears to not support - or at least not support in its current iteration -- the new Yahoo protocol version (0x000f), disconnecting us immediately if we send it. When connecting to Yahoo Japan, we now send the old version, (0x000c). Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo_filexfer.c trunk/libgaim/protocols/yahoo/yahoo_packet.c trunk/libgaim/protocols/yahoo/yahoo_packet.h trunk/libgaim/protocols/yahoo/yahoo_picture.c Modified: trunk/libgaim/protocols/yahoo/yahoo_filexfer.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_filexfer.c 2006-09-04 08:19:17 UTC (rev 17159) +++ trunk/libgaim/protocols/yahoo/yahoo_filexfer.c 2006-09-04 21:58:49 UTC (rev 17160) @@ -212,7 +212,7 @@ content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); - pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, &pkt_buf); + pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); yahoo_packet_free(pkt); host = gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST); Modified: trunk/libgaim/protocols/yahoo/yahoo_packet.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-09-04 08:19:17 UTC (rev 17159) +++ trunk/libgaim/protocols/yahoo/yahoo_packet.c 2006-09-04 21:58:49 UTC (rev 17160) @@ -294,7 +294,7 @@ size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, - guchar **buf) + gboolean jp, guchar **buf) { size_t pktlen = yahoo_packet_length(pkt); size_t len = YAHOO_PACKET_HDRLEN + pktlen; @@ -307,6 +307,8 @@ if (wm) pos += yahoo_put16(data + pos, YAHOO_WEBMESSENGER_PROTO_VER); + else if (jp) + pos += yahoo_put16(data + pos, YAHOO_PROTO_VER_JAPAN); else pos += yahoo_put16(data + pos, YAHOO_PROTO_VER); pos += yahoo_put16(data + pos, 0x0000); @@ -331,7 +333,7 @@ if (yd->fd < 0) return -1; - len = yahoo_packet_build(pkt, 0, yd->wm, &data); + len = yahoo_packet_build(pkt, 0, yd->wm, yd->jp, &data); yahoo_packet_dump(data, len); if (yd->txhandler == -1) Modified: trunk/libgaim/protocols/yahoo/yahoo_packet.h =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_packet.h 2006-09-04 08:19:17 UTC (rev 17159) +++ trunk/libgaim/protocols/yahoo/yahoo_packet.h 2006-09-04 21:58:49 UTC (rev 17160) @@ -117,6 +117,7 @@ #define YAHOO_WEBMESSENGER_PROTO_VER 0x0065 #define YAHOO_PROTO_VER 0x000f +#define YAHOO_PROTO_VER_JAPAN 0x000c #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4) @@ -127,7 +128,7 @@ void yahoo_packet_hash_int(struct yahoo_packet *pkt, int key, int value); int yahoo_packet_send(struct yahoo_packet *pkt, struct yahoo_data *yd); int yahoo_packet_send_and_free(struct yahoo_packet *pkt, struct yahoo_data *yd); -size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, +size_t yahoo_packet_build(struct yahoo_packet *pkt, int pad, gboolean wm, gboolean jp, guchar **buf); void yahoo_packet_read(struct yahoo_packet *pkt, const guchar *data, int len); void yahoo_packet_write(struct yahoo_packet *pkt, guchar *data); Modified: trunk/libgaim/protocols/yahoo/yahoo_picture.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-09-04 08:19:17 UTC (rev 17159) +++ trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-09-04 21:58:49 UTC (rev 17160) @@ -481,7 +481,7 @@ /* There's no magic here, we just need to prepend in reverse order */ g_string_prepend(d->str, "29\xc0\x80"); - pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, &pkt_buf); + pkt_buf_len = yahoo_packet_build(pkt, 8, FALSE, yd->jp, &pkt_buf); yahoo_packet_free(pkt); g_string_prepend_len(d->str, (char *)pkt_buf, pkt_buf_len); g_free(pkt_buf); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ev...@us...> - 2006-09-26 23:20:44
|
Revision: 17377 http://svn.sourceforge.net/gaim/?rev=17377&view=rev Author: evands Date: 2006-09-26 16:20:39 -0700 (Tue, 26 Sep 2006) Log Message: ----------- A pending yahoo_buddy_icon_upload() request is now cancelled when disconnecting or if a second upload request is made, which can happen if the user rapidly changes buddy icons. Modified Paths: -------------- trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/yahoo.h trunk/libgaim/protocols/yahoo/yahoo_picture.c Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-09-26 23:02:40 UTC (rev 17376) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-09-26 23:20:39 UTC (rev 17377) @@ -2778,6 +2778,8 @@ yd->rxlen = 0; g_free(yd->picture_url); + if (yd->buddy_icon_connect_data) + gaim_proxy_connect_cancel(yd->buddy_icon_connect_data); if (yd->picture_upload_todo) yahoo_buddy_icon_upload_data_free(yd->picture_upload_todo); if (yd->ycht) Modified: trunk/libgaim/protocols/yahoo/yahoo.h =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.h 2006-09-26 23:02:40 UTC (rev 17376) +++ trunk/libgaim/protocols/yahoo/yahoo.h 2006-09-26 23:20:39 UTC (rev 17377) @@ -137,6 +137,7 @@ /* ew. we have to check the icon before we connect, * but can't upload it til we're connected. */ struct yahoo_buddy_icon_upload_data *picture_upload_todo; + GaimProxyConnectData *buddy_icon_connect_data; struct _YchtConn *ycht; Modified: trunk/libgaim/protocols/yahoo/yahoo_picture.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-09-26 23:02:40 UTC (rev 17376) +++ trunk/libgaim/protocols/yahoo/yahoo_picture.c 2006-09-26 23:20:39 UTC (rev 17377) @@ -444,13 +444,15 @@ account = gaim_connection_get_account(gc); yd = gc->proto_data; + /* Buddy icon connect is now complete; clear the GaimProxyConnectData */ + yd->buddy_icon_connect_data = NULL; + if (source < 0) { gaim_debug_error("yahoo", "Buddy icon upload failed, no file desc.\n"); yahoo_buddy_icon_upload_data_free(d); return; } - pkt = yahoo_packet_new(0xc2, YAHOO_STATUS_AVAILABLE, yd->session_id); size = g_strdup_printf("%" G_GSIZE_FORMAT, d->str->len); @@ -498,26 +500,37 @@ { GaimAccount *account = gaim_connection_get_account(gc); struct yahoo_data *yd = gc->proto_data; + GaimProxyConnectData *connect_data = NULL; g_return_if_fail(d != NULL); + if (yd->buddy_icon_connect_data) { + /* Cancel any in-progress buddy icon upload */ + gaim_proxy_connect_cancel(yd->buddy_icon_connect_data); + yd->buddy_icon_connect_data = NULL; + } + if (yd->jp) { - if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host", YAHOOJP_XFER_HOST), - gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), - yahoo_buddy_icon_upload_connected, d) == NULL) + if ((connect_data = gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host", YAHOOJP_XFER_HOST), + gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), + yahoo_buddy_icon_upload_connected, d)) == NULL) { gaim_debug_error("yahoo", "Uploading our buddy icon failed to connect.\n"); yahoo_buddy_icon_upload_data_free(d); } } else { - if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), - gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), - yahoo_buddy_icon_upload_connected, d) == NULL) + if ((connect_data = gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), + gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), + yahoo_buddy_icon_upload_connected, d)) == NULL) { gaim_debug_error("yahoo", "Uploading our buddy icon failed to connect.\n"); yahoo_buddy_icon_upload_data_free(d); } } + + if (connect_data) { + yd->buddy_icon_connect_data = connect_data; + } } void yahoo_set_buddy_icon(GaimConnection *gc, const char *iconfile) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <the...@us...> - 2006-10-28 20:38:39
|
Revision: 17611 http://svn.sourceforge.net/gaim/?rev=17611&view=rev Author: thekingant Date: 2006-10-28 13:38:25 -0700 (Sat, 28 Oct 2006) Log Message: ----------- sf patch #1582046, from Henning Noren "This patch removes a unused array and makes some other static const. These small changes moves 14 memory pages from private to shared on my system." Modified Paths: -------------- trunk/libgaim/protocols/yahoo/util.c trunk/libgaim/protocols/yahoo/yahoo.c trunk/libgaim/protocols/yahoo/yahoo_auth.c trunk/libgaim/protocols/yahoo/yahoo_doodle.c Modified: trunk/libgaim/protocols/yahoo/util.c =================================================================== --- trunk/libgaim/protocols/yahoo/util.c 2006-10-28 20:11:46 UTC (rev 17610) +++ trunk/libgaim/protocols/yahoo/util.c 2006-10-28 20:38:25 UTC (rev 17611) @@ -342,7 +342,7 @@ /* borrowed from gtkimhtml */ #define MAX_FONT_SIZE 7 #define POINT_SIZE(x) (_point_sizes [MIN ((x > 0 ? x : 1), MAX_FONT_SIZE) - 1]) -static gint _point_sizes [] = { 8, 10, 12, 14, 20, 30, 40 }; +static const gint _point_sizes [] = { 8, 10, 12, 14, 20, 30, 40 }; enum fatype { size, color, face, junk }; typedef struct { Modified: trunk/libgaim/protocols/yahoo/yahoo.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo.c 2006-10-28 20:11:46 UTC (rev 17610) +++ trunk/libgaim/protocols/yahoo/yahoo.c 2006-10-28 20:38:25 UTC (rev 17611) @@ -1170,7 +1170,7 @@ } } /* This is the y64 alphabet... it's like base64, but has a . and a _ */ -char base64digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._"; +static const char base64digits[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._"; /* This is taken from Sylpheed by Hiroyuki Yamamoto. We have our own tobase64 function * in util.c, but it has a bug I don't feel like finding right now ;) */ Modified: trunk/libgaim/protocols/yahoo/yahoo_auth.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_auth.c 2006-10-28 20:11:46 UTC (rev 17610) +++ trunk/libgaim/protocols/yahoo/yahoo_auth.c 2006-10-28 20:38:25 UTC (rev 17611) @@ -13,7 +13,7 @@ /************* * Ugliness * *************/ -auth_function_t main_function_list[5][96] = { +static const auth_function_t main_function_list[5][96] = { { { 0, 0x0, 0x0 }, { 0, 0x0, 0x0 }, @@ -506,7 +506,7 @@ } }; -struct buffer_t type_three_list[NUM_TYPE_THREES]={ +static const struct buffer_t type_three_list[NUM_TYPE_THREES]={ { 0x538920, "\x7a\x61\x31\x57\x9\xbc\x11\x8d\x6a\x12\x3a\x4d\x76\xbf\x19\x86\x2c\xc8\x69\x60\x84\x1\xc9\x21\xb1\xa6\xf\x99\xcd\xa0\x71\x8b\x5f\xb2\xd2\x53\xed\xf9\x55\xa\x50\x14\x15\xad\x88\x52\x5d\xbb\xe\xe5\xd\x56\x3e\x9b\xc7\x17\x9a\x97\x92\x23\x0\x37\xaa\x27\xf6\xb6\x33\xb5\xc5\xd1\x38\x1b\x85\x42\x13\xe1\x64\x1d\x4c\x87\x9f\x3c\x40\xdf\x7b\xd5\xae\xc6\x7c\xec\xd7\x49\x35\x2f\x2b\x9d\x32\xbd\x93\x45\x73\x91\x34\xd4\x39\x1e\x96\x65\xeb\x82\x5a\xf3\xd8\xf1\x41\xce\x9c\xe6\x90\x7d\x6b\x29\x6\xc1\x3d\x4e\xe3\xdb\x48\x6c\x62\x72\x7f\xfe\xdd\xcf\xa1\x24\x4f\xc0\xd0\x3f\x2d\x5c\x78\x6f\x3b\x10\xef\xba\xb\x25\xd6\x1f\x58\x8c\xf8\xcc\xc2\x5\xb3\xfa\xa4\xac\x6e\xf5\x18\x2a\x26\x5e\xf4\x79\xb8\xc3\x16\xe2\xf2\x83\x30\x59\xda\xe9\x36\x7\x46\xa9\xde\x77\xd3\xa3\x98\x8\x1c\xe7\xee\x51\xe8\xfb\x2\xc4\xfd\xff\x22\xaf\x7e\xcb\x68\xc\x28\xe4\x63\xca\x70\x75\xb0\x74\xa7\xea\x20\x4\x4b\xa5\xb7\xf7\xfc\x4a\x47\xf0\xa8\x81\xbe\xe0\x66\x8e\x44\x54\x6d\x80\xb9\x95\x2e\xab\x8a\x1a\x94\xdc\x89\xb4\x5b\x9e\xd9\x8f\xa2\x43\x67\x3" }, { 0x538a20, "\x28\xeb\x74\xef\xb7\x73\x79\xd1\x46\xcc\xfb\x3b\x91\xc2\x16\xcb\x93\xaf\x51\x88\xb0\x5d\xfa\xfc\xc\xf\xc8\x4a\x53\x17\x8e\xec\x81\x36\xc6\xdc\xbc\x89\xa\x1f\x78\xdd\x76\x6c\x85\xd2\x13\xb9\x3a\x97\xde\x86\x3e\x12\xbe\x68\x23\x6a\x58\xce\xea\xe3\xa8\x5a\x8c\x3\x8a\x9d\xfe\xf3\x47\x63\xdf\x44\xaa\xd9\x24\xf0\x5b\xe2\x9c\xd3\xa9\x2e\xfd\x8b\xbd\xa4\x7a\x42\x5f\x4d\xa2\x48\x83\xcd\xe\x27\x61\xcf\xd\x50\x6f\x49\xae\xc7\x2f\x31\x39\x8f\x11\xdb\xad\x6b\x7f\xb6\x55\x62\x4c\x66\xc4\x75\xf6\x1b\xc1\xf1\x90\x95\x65\x9\xe0\xb4\xbf\xf4\x35\x37\x1c\x67\xe8\xf9\xe6\x56\x99\x22\xc0\xe9\x92\x21\xe1\x7d\x6e\x34\xd4\x8d\x96\x20\x52\xd0\x69\x2d\xf8\x7e\x4f\xb\xac\x71\xa3\xe5\x2a\xa5\xc5\x18\x5e\x6\xca\x2\x4b\x26\xf5\xab\x9f\xe7\x15\x3d\xd6\x4\x8\xee\xbb\x57\x0\x40\xd5\xa7\x1d\x45\xa6\x2c\xff\x9a\x32\x84\x1a\x14\xf7\x80\xd8\x43\x72\x7\x98\x38\x87\x33\xb1\x29\xb3\x7c\x30\xba\x94\xc9\x64\xe4\x1\x77\x3c\x2b\x82\x54\x6d\x9e\xf2\x3f\xed\xc3\x4e\x5c\x60\x70\x19\xa0\xb8\xda\x5\xb2\x10\x7b\x25\xb5\x9b\x59\x41\x1e\xa1\xd7" }, { 0x539320, "\x9c\x3b\xec\x3e\x7b\x79\x6f\x88\x42\xe6\xe1\x9b\xa3\xd\x83\x86\x7a\xfc\xc5\xb3\xdb\x7c\xf6\xa\xb7\xe7\x3c\x53\x28\x65\xf2\xa9\x6a\xf4\xef\x2c\x3d\xf8\xed\x6\xaf\x31\x75\xab\xf3\x73\xee\x20\x95\x1b\xe\x19\xa8\x5b\xa5\x66\x74\x85\x11\x60\x1e\x2a\x6c\x48\x50\x2f\x9a\x2e\x55\xaa\xcb\x64\x40\x4c\x25\xe9\xd0\xfd\x2d\x46\x8b\x81\x8d\xd2\x32\x4a\xc6\x7\xd6\xbf\xfb\x98\xd4\x76\x7e\xc\xfa\xde\x14\xa6\xd5\xe2\x90\xd1\xeb\xd3\x58\xbb\x5f\x94\xf7\x78\x54\x27\x52\xb6\x22\xea\x8c\xc8\x7d\x87\x12\x9d\xa1\x63\x38\xd8\x35\x2b\xc9\x56\x10\x9f\x1a\x2\xbe\xf1\x59\x17\x9e\xac\x5a\xb8\x1\xb5\x30\xad\xff\xe0\x49\xe8\x23\x4e\x6b\x16\xdc\x4f\x89\x68\x43\xc1\x99\x4\xa7\x33\x92\x84\xa4\x26\x34\x41\x1d\xb2\x91\x61\xc2\x51\x8f\x36\xfe\x5\xa2\xf9\xb\x13\x71\x82\x6e\x5d\xb4\xdf\xdd\x7f\xa0\xcd\x44\xc7\x70\x4d\xf0\x1c\x4b\x45\x57\x37\x3a\xcc\xf5\x8a\xd9\xe4\xbc\x15\xc3\x62\xc4\x39\x72\x47\x97\xbd\x8\xe5\x67\x18\xb1\x77\x8e\x1f\x9\xba\xf\xd7\xb0\x24\xce\xda\x0\x96\xca\x69\x3\x6d\x93\xae\xe3\x3f\x5c\xcf\xc0\xb9\x29\x80\x21\x5e" }, @@ -614,7 +614,7 @@ { 0x546398, "\x2f\x62\x9b\xe4\xee\xdb\x3f\x8d\xd3\xd7\x9c\x32\xd6\x4a\xca\x50\xe1\x8e\x6e\xf9\x99\xc5\x4e\xdf\x46\x5d\xd5\xb7\x6d\xb1\xb9\x7e\xf\xad\x44\x96\x13\x6c\x97\x26\xa8\x9f\x85\xde\xed\x56\xce\xda\xb0\xb\x1c\xb8\x3d\x5a\x1f\xdd\x84\xf3\xcd\x9e\x73\x28\x61\x8c\xbb\x69\x64\x4f\x0\x49\x3c\x75\xc3\x29\x8a\xe2\x4d\xc7\xcb\x10\xd\xe9\x7f\xc4\x60\x1b\x5f\xd1\x45\x42\x93\x59\xe8\x74\xff\x7a\x72\xea\xd4\xa\x3e\x7d\xc1\x31\xa4\x66\x92\xfd\xf6\x6b\x3b\xba\xbc\x19\x6a\x54\x4b\x38\x47\x43\x33\x91\x8b\xe\xae\x4\x76\x4c\xab\xc6\xbe\x36\xd0\xa0\x67\x90\x87\xf5\x9a\x77\xe6\xcf\xb2\x12\x22\x8\x37\x30\xaf\x16\x3\x58\xf1\xaa\x1e\x25\xeb\xf4\x21\xa9\xfe\x27\x83\xdc\x6\x2a\x48\x78\x68\xb4\xa7\x79\x9\x80\x81\xc8\x52\x17\xcc\x2d\x15\x94\x8f\xa1\x14\x98\xe7\xd9\x7b\xb6\x82\x5\xbf\x39\x88\xac\x86\xa2\xf8\xef\x23\x2e\x95\xd2\xa6\xf2\x2c\x3a\x2b\x65\x55\x18\xc9\x35\x57\x24\xd8\xec\xf7\xf0\xb3\x5b\x6f\xfb\x20\xbd\x5c\xfa\x71\x63\xc0\x1d\xe0\x53\x2\xa5\x7c\x51\x11\xb5\xfc\x1a\x5e\x9d\x40\x34\x1\x7\x89\xa3\xc\x70\xe5\xe3\x41\xc2" }, }; -struct buffer_t type_four_list[NUM_TYPE_FOURS]={ +static const struct buffer_t type_four_list[NUM_TYPE_FOURS]={ { 0x55f320, "\x39\x25\x29\x3c\x2b\x3a\x32\x23\x26\x24\x2d\x3d\x35\x2e\x3b\x38\x20\x27\x28\x22\x33\x3f\x2c\x3e\x36\x2a\x30\x2f\x21\x34\x31\x37\x00" }, { 0x55f340, "\x5f\x4b\x40\x5e\x43\x4e\x55\x41\x5a\x57\x5d\x5b\x51\x4f\x4a\x52\x53\x58\x42\x44\x49\x46\x4d\x47\x48\x45\x50\x59\x4c\x54\x56\x5c\x00" }, { 0x55f360, "\x7a\x7c\x6f\x6c\x60\x62\x73\x69\x71\x65\x6d\x72\x78\x6b\x64\x70\x74\x7b\x7e\x76\x67\x68\x63\x77\x79\x7f\x61\x6e\x75\x66\x6a\x7d\x00" }, @@ -663,7 +663,7 @@ { 0x55f380, "\x98\x88\x94\x97\x83\x90\x99\x84\x8d\x9c\x86\x9d\x9e\x92\x91\x8b\x8f\x82\x8e\x9b\x93\x85\x87\x96\x95\x8a\x8c\x9a\x80\x81\x9f\x89\x00" } }; -struct buffer_t type_five_list[NUM_TYPE_FIVES]={ +static const struct buffer_t type_five_list[NUM_TYPE_FIVES]={ { 0x55f3f8, "\xef\xe7\xf6\xfd\xeb\xf4\xec\xe2\xf7\xf9\xea\xe4\xf8\xff\xf5\xfa\xe8\xee\xfc\xe9\xe5\xfb\xe6\xe0\xfe\xed\xf2\xe1\xf1\xf0\xe3\xf3\x00" }, { 0x562948, "\x47\x41\x56\x59\x45\x40\x58\x48\x49\x57\x55\x54\x5a\x4c\x4f\x4d\x51\x5c\x53\x4a\x52\x5d\x5f\x5e\x50\x43\x42\x5b\x44\x46\x4b\x4e\x00" }, { 0x561258, "\x5b\x49\x5f\x43\x57\x4c\x54\x59\x5c\x5a\x51\x52\x5d\x4a\x5e\x47\x44\x56\x55\x4d\x40\x50\x58\x48\x46\x45\x4f\x41\x4b\x4e\x53\x42\x00" }, @@ -727,7 +727,7 @@ hash *= 0x9e3779b1; if (outer_loop > 1) { - auth_function_t *ft; + const auth_function_t *ft; int remainder; @@ -874,7 +874,7 @@ unsigned int yahoo_auth_finalCountdown(unsigned int challenge, int divisor, int inner_loop, int outer_loop) { - auth_function_t *ft; + const auth_function_t *ft; int remainder = challenge % divisor; Modified: trunk/libgaim/protocols/yahoo/yahoo_doodle.c =================================================================== --- trunk/libgaim/protocols/yahoo/yahoo_doodle.c 2006-10-28 20:11:46 UTC (rev 17610) +++ trunk/libgaim/protocols/yahoo/yahoo_doodle.c 2006-10-28 20:38:25 UTC (rev 17611) @@ -56,6 +56,7 @@ /****************************************************************************** * Globals *****************************************************************************/ +#if 0 const int DefaultColorRGB24[] = { DOODLE_COLOR_RED, @@ -72,6 +73,7 @@ DOODLE_COLOR_GREY, DOODLE_COLOR_WHITE }; +#endif /****************************************************************************** * Functions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |