Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/oscar.c @ 29813:297d83036107
propagate from branch 'im.pidgin.pidgin' (head c023fbb554c216b1a31cd32bedf806f48cfc1e4e)
to branch 'im.pidgin.cpw.rekkanoryo.icqxstatus' (head 1431506710bed6b8f0c837b670ee314b1692990e)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sun, 16 Nov 2008 08:11:33 +0000 |
parents | 365b90fa23cf 0320b4a33432 |
children | 2d04fb25c6db |
comparison
equal
deleted
inserted
replaced
29812:365b90fa23cf | 29813:297d83036107 |
---|---|
1156 purple_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n", | 1156 purple_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n", |
1157 conn->type); | 1157 conn->type); |
1158 conn->watcher_incoming = purple_input_add(conn->fd, | 1158 conn->watcher_incoming = purple_input_add(conn->fd, |
1159 PURPLE_INPUT_READ, flap_connection_recv_cb, conn); | 1159 PURPLE_INPUT_READ, flap_connection_recv_cb, conn); |
1160 if (conn->cookie == NULL) | 1160 if (conn->cookie == NULL) |
1161 { | 1161 flap_connection_send_version(od, conn); |
1162 if (!aim_snvalid_icq(purple_account_get_username(account))) | |
1163 /* | |
1164 * We don't send this when authenticating an ICQ account | |
1165 * because for some reason ICQ is still using the | |
1166 * assy/insecure authentication procedure. | |
1167 */ | |
1168 flap_connection_send_version(od, conn); | |
1169 } | |
1170 else | 1162 else |
1171 { | 1163 { |
1172 flap_connection_send_version_with_cookie(od, conn, | 1164 flap_connection_send_version_with_cookie(od, conn, |
1173 conn->cookielen, conn->cookie); | 1165 conn->cookielen, conn->cookie); |
1174 g_free(conn->cookie); | 1166 g_free(conn->cookie); |
1698 | 1690 |
1699 msg = g_string_new("Sending hash: "); | 1691 msg = g_string_new("Sending hash: "); |
1700 for (x = 0; x < 16; x++) | 1692 for (x = 0; x < 16; x++) |
1701 g_string_append_printf(msg, "%02hhx ", (unsigned char)m[x]); | 1693 g_string_append_printf(msg, "%02hhx ", (unsigned char)m[x]); |
1702 g_string_append(msg, "\n"); | 1694 g_string_append(msg, "\n"); |
1703 purple_debug_misc("oscar", msg->str); | 1695 purple_debug_misc("oscar", "%s", msg->str); |
1704 g_string_free(msg, TRUE); | 1696 g_string_free(msg, TRUE); |
1705 | 1697 |
1706 purple_input_remove(pos->inpa); | 1698 purple_input_remove(pos->inpa); |
1707 close(pos->fd); | 1699 close(pos->fd); |
1708 aim_sendmemblock(od, pos->conn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH); | 1700 aim_sendmemblock(od, pos->conn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH); |
4896 | 4888 |
4897 if (!aim_snvalid(buddy->name)) { | 4889 if (!aim_snvalid(buddy->name)) { |
4898 gchar *buf; | 4890 gchar *buf; |
4899 buf = g_strdup_printf(_("Could not add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), buddy->name); | 4891 buf = g_strdup_printf(_("Could not add the buddy %s because the username is invalid. Usernames must be a valid email address, or start with a letter and contain only letters, numbers and spaces, or contain only numbers."), buddy->name); |
4900 if (!purple_conv_present_error(buddy->name, account, buf)) | 4892 if (!purple_conv_present_error(buddy->name, account, buf)) |
4901 purple_notify_error(gc, NULL, _("Unable To Add"), buf); | 4893 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
4902 g_free(buf); | 4894 g_free(buf); |
4903 | 4895 |
4904 /* Remove from local list */ | 4896 /* Remove from local list */ |
4905 purple_blist_remove_buddy(buddy); | 4897 purple_blist_remove_buddy(buddy); |
4906 | 4898 |
5015 va_end(ap); | 5007 va_end(ap); |
5016 | 5008 |
5017 purple_debug_error("oscar", "ssi: SNAC error %hu\n", reason); | 5009 purple_debug_error("oscar", "ssi: SNAC error %hu\n", reason); |
5018 | 5010 |
5019 if (reason == 0x0005) { | 5011 if (reason == 0x0005) { |
5020 purple_notify_error(gc, NULL, _("Unable To Retrieve Buddy List"), | 5012 purple_notify_error(gc, NULL, _("Unable to Retrieve Buddy List"), |
5021 _("The AIM servers were temporarily unable to send your buddy list. Your buddy list is not lost, and will probably become available in a few minutes.")); | 5013 _("The AIM servers were temporarily unable to send your buddy list. Your buddy list is not lost, and will probably become available in a few minutes.")); |
5022 if (od->getblisttimer > 0) | 5014 if (od->getblisttimer > 0) |
5023 purple_timeout_remove(od->getblisttimer); | 5015 purple_timeout_remove(od->getblisttimer); |
5024 od->getblisttimer = purple_timeout_add(30000, purple_ssi_rerequestdata, od); | 5016 od->getblisttimer = purple_timeout_add(30000, purple_ssi_rerequestdata, od); |
5025 return 1; | 5017 return 1; |
5044 | 5036 |
5045 msg = g_string_new("ssi rights:"); | 5037 msg = g_string_new("ssi rights:"); |
5046 for (i=0; i<numtypes; i++) | 5038 for (i=0; i<numtypes; i++) |
5047 g_string_append_printf(msg, " max type 0x%04x=%hd,", i, maxitems[i]); | 5039 g_string_append_printf(msg, " max type 0x%04x=%hd,", i, maxitems[i]); |
5048 g_string_append(msg, "\n"); | 5040 g_string_append(msg, "\n"); |
5049 purple_debug_misc("oscar", msg->str); | 5041 purple_debug_misc("oscar", "%s", msg->str); |
5050 g_string_free(msg, TRUE); | 5042 g_string_free(msg, TRUE); |
5051 | 5043 |
5052 if (numtypes >= 0) | 5044 if (numtypes >= 0) |
5053 od->rights.maxbuddies = maxitems[0]; | 5045 od->rights.maxbuddies = maxitems[0]; |
5054 if (numtypes >= 1) | 5046 if (numtypes >= 1) |
5366 | 5358 |
5367 case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ | 5359 case 0x000c: { /* you are over the limit, the cheat is to the limit, come on fhqwhgads */ |
5368 gchar *buf; | 5360 gchar *buf; |
5369 buf = g_strdup_printf(_("Could not add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); | 5361 buf = g_strdup_printf(_("Could not add the buddy %s because you have too many buddies in your buddy list. Please remove one and try again."), (retval->name ? retval->name : _("(no name)"))); |
5370 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) | 5362 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
5371 purple_notify_error(gc, NULL, _("Unable To Add"), buf); | 5363 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
5372 g_free(buf); | 5364 g_free(buf); |
5373 } | 5365 } |
5374 | 5366 |
5375 case 0x000e: { /* buddy requires authorization */ | 5367 case 0x000e: { /* buddy requires authorization */ |
5376 if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name)) | 5368 if ((retval->action == SNAC_SUBTYPE_FEEDBAG_ADD) && (retval->name)) |
5381 gchar *buf; | 5373 gchar *buf; |
5382 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); | 5374 purple_debug_error("oscar", "ssi: Action 0x%04hx was unsuccessful with error 0x%04hx\n", retval->action, retval->ack); |
5383 buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."), | 5375 buf = g_strdup_printf(_("Could not add the buddy %s for an unknown reason."), |
5384 (retval->name ? retval->name : _("(no name)"))); | 5376 (retval->name ? retval->name : _("(no name)"))); |
5385 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) | 5377 if ((retval->name != NULL) && !purple_conv_present_error(retval->name, purple_connection_get_account(gc), buf)) |
5386 purple_notify_error(gc, NULL, _("Unable To Add"), buf); | 5378 purple_notify_error(gc, NULL, _("Unable to Add"), buf); |
5387 g_free(buf); | 5379 g_free(buf); |
5388 } break; | 5380 } break; |
5389 } | 5381 } |
5390 | 5382 |
5391 retval = retval->next; | 5383 retval = retval->next; |