summaryrefslogtreecommitdiff
path: root/libpurple/protocols/yahoo
diff options
context:
space:
mode:
authorJohn Bailey <rekkanoryo@rekkanoryo.org>2008-02-06 18:06:44 +0000
committerJohn Bailey <rekkanoryo@rekkanoryo.org>2008-02-06 18:06:44 +0000
commit4a073693b5e562c100a38e889d6ea486f78d038b (patch)
treecc4e5ec8adb70a7bb51c81879a2eede07a44407a /libpurple/protocols/yahoo
parent892dce38f1a6dcc6a4c3d7715f05490594bf1c47 (diff)
downloadpidgin-4a073693b5e562c100a38e889d6ea486f78d038b.tar.gz
Simplified version of the newest patch on #4533 to not try Yahoo protocolcpw.rekkanoryo.yahoop15ft
version 15 file transfer on Yahoo Japan.
Diffstat (limited to 'libpurple/protocols/yahoo')
-rw-r--r--libpurple/protocols/yahoo/yahoo.c50
-rw-r--r--libpurple/protocols/yahoo/yahoo.h11
-rw-r--r--libpurple/protocols/yahoo/yahoo_filexfer.c23
3 files changed, 60 insertions, 24 deletions
diff --git a/libpurple/protocols/yahoo/yahoo.c b/libpurple/protocols/yahoo/yahoo.c
index 5156832f6f..e997d527aa 100644
--- a/libpurple/protocols/yahoo/yahoo.c
+++ b/libpurple/protocols/yahoo/yahoo.c
@@ -1471,13 +1471,24 @@ static void yahoo_process_auth_old(PurpleConnection *gc, const char *seed)
to_y64(result96, digest, 16);
pack = yahoo_packet_new(YAHOO_SERVICE_AUTHRESP, YAHOO_STATUS_AVAILABLE, 0);
- yahoo_packet_hash(pack, "ssssss",
- 0, name,
- 6, result6,
- 96, result96,
- 1, name,
- 244, YAHOO_CLIENT_VERSION_ID,
- 135, YAHOO_CLIENT_VERSION);
+
+ if(yd->jp) {
+ yahoo_packet_hash(pack, "sssss",
+ 0, name,
+ 6, result6,
+ 96, result96,
+ 1, name,
+ 135, YAHOOJP_CLIENT_VERSION);
+ } else {
+ yahoo_packet_hash(pack, "ssssss",
+ 0, name,
+ 6, result6,
+ 96, result96,
+ 1, name,
+ 244, YAHOO_CLIENT_VERSION_ID,
+ 135, YAHOO_CLIENT_VERSION);
+ }
+
yahoo_packet_send_and_free(pack, yd);
g_free(hash_string_p);
@@ -1923,13 +1934,24 @@ static void yahoo_process_auth_new(PurpleConnection *gc, const char *seed)
}
purple_debug_info("yahoo", "yahoo status: %d\n", yd->current_status);
pack = yahoo_packet_new(YAHOO_SERVICE_AUTHRESP, yd->current_status, 0);
- yahoo_packet_hash(pack, "ssssss",
- 0, name,
- 6, resp_6,
- 96, resp_96,
- 1, name,
- 244, YAHOO_CLIENT_VERSION_ID,
- 135, YAHOO_CLIENT_VERSION);
+
+ if(yd->jp) {
+ yahoo_packet_hash(pack, "sssss",
+ 0, name,
+ 6, resp_6,
+ 96, resp_96,
+ 1, name,
+ 135, YAHOOJP_CLIENT_VERSION);
+ } else {
+ yahoo_packet_hash(pack, "ssssss",
+ 0, name,
+ 6, resp_6,
+ 96, resp_96,
+ 1, name,
+ 244, YAHOO_CLIENT_VERSION_ID,
+ 135, YAHOO_CLIENT_VERSION);
+ }
+
if (yd->picture_checksum)
yahoo_packet_hash_int(pack, 192, yd->picture_checksum);
diff --git a/libpurple/protocols/yahoo/yahoo.h b/libpurple/protocols/yahoo/yahoo.h
index 8150d5c82a..59e2ad9bbf 100644
--- a/libpurple/protocols/yahoo/yahoo.h
+++ b/libpurple/protocols/yahoo/yahoo.h
@@ -46,7 +46,7 @@
#define YAHOOJP_XFER_HOST "filetransfer.msg.yahoo.co.jp"
#define YAHOOJP_WEBCAM_HOST "wc.yahoo.co.jp"
/*not sure, must test:*/
-#define YAHOOJP_XFER_RELAY_HOST "relay.msg.yahoo.com"
+#define YAHOOJP_XFER_RELAY_HOST "relay.msg.yahoo.co.jp"
#define YAHOOJP_XFER_RELAY_PORT 80
#define YAHOOJP_ROOMLIST_URL "http://insider.msg.yahoo.co.jp/ycontent/"
#define YAHOOJP_ROOMLIST_LOCALE "ja"
@@ -76,6 +76,15 @@
#define YAHOO_CLIENT_VERSION_ID "2097087"
#define YAHOO_CLIENT_VERSION "8.1.0.421"
+#define YAHOOJP_CLIENT_VERSION "6,0,0,1710"
+
+#if 0
+/* The following were observed with the Yahoo Japan client current as of January
+ * 2008, but appear not to work correctly for file transfer. Here as reference */
+# define YAHOOJP_CLIENT_VERSION_ID "524223"
+# define YAHOOJP_CLIENT_VERSION "7,0,1,1"
+#endif
+
/* Index into attention types list. */
#define YAHOO_BUZZ 0
diff --git a/libpurple/protocols/yahoo/yahoo_filexfer.c b/libpurple/protocols/yahoo/yahoo_filexfer.c
index 6db5ceb863..a2b2a6f440 100644
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c
@@ -1033,18 +1033,19 @@ static void yahoo_xfer_dns_connected_15(GSList *hosts, gpointer data, const char
void yahoo_send_file(PurpleConnection *gc, const char *who, const char *file)
{
struct yahoo_xfer_data *xfer_data;
- struct yahoo_data *yd;
+ struct yahoo_data *yd = gc->proto_data;
int ver = 0;
PurpleXfer *xfer = yahoo_new_xfer(gc, who);
YahooFriend *yf = yahoo_friend_find(gc, who);
- /* To determine whether client uses ymsg 15 i.e. client is higher than YM 7 */
- if(yf && yf->version_id > 500000)
- ver=15;
+ /* To determine if we should use yahoo p15 for transfer. Check other user's
+ * reported version, but if we're on Yahoo Japan, ignore it. */
+ if(yf && yf->version_id > 500000 && !yd->jp)
+ ver = 15;
+
g_return_if_fail(xfer != NULL);
if(ver == 15) {
- yd = gc->proto_data;
xfer_data = xfer->data;
xfer_data->status_15 = STARTED;
purple_xfer_set_init_fnc(xfer, yahoo_xfer_init_15);
@@ -1320,17 +1321,21 @@ void yahoo_process_filetrans_15(PurpleConnection *gc, struct yahoo_packet *pkt)
if(!xfer)
return;
/*
- * In the file trans info packet tht we must reply with , we are supposed to mention the ip address...
+ * In the file trans info packet that we must reply with, we are
+ * supposed to mention the ip address...
* purple connect does not give me a way of finding the ip address...
- * so, purple dnsquery is used... but retries, trying with next ip address etc. is not implemented..TODO
+ * so, purple dnsquery is used... but retries, trying with next ip
+ * address etc. is not implemented..TODO
*/
if (yd->jp)
{
- purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer);
+ purple_dnsquery_a(YAHOOJP_XFER_RELAY_HOST, YAHOOJP_XFER_RELAY_PORT,
+ yahoo_xfer_dns_connected_15, xfer);
}
else
{
- purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT, yahoo_xfer_dns_connected_15, xfer);
+ purple_dnsquery_a(YAHOO_XFER_RELAY_HOST, YAHOO_XFER_RELAY_PORT,
+ yahoo_xfer_dns_connected_15, xfer);
}
return;
}