comparison libpurple/protocols/yahoo/yahoo.c @ 24967:adf153852bcf

propagate from branch 'im.pidgin.pidgin' (head df86c6f1de324e87828356aa8d5c369abd533b58) to branch 'im.pidgin.pidgin.vv' (head 5bf87e309f2fee61842cccf4992de4866349570c)
author Mike Ruprecht <maiku@soc.pidgin.im>
date Mon, 24 Nov 2008 10:59:08 +0000
parents 4d752d07a126 9e0458c98b4c
children 25e2ab1fff1d
comparison
equal deleted inserted replaced
24966:bee5ab815291 24967:adf153852bcf
3617 char *msg2; 3617 char *msg2;
3618 gboolean utf8 = TRUE; 3618 gboolean utf8 = TRUE;
3619 PurpleWhiteboard *wb; 3619 PurpleWhiteboard *wb;
3620 int ret = 1; 3620 int ret = 1;
3621 YahooFriend *f = NULL; 3621 YahooFriend *f = NULL;
3622 gsize lenb = 0;
3623 glong lenc = 0;
3622 3624
3623 msg2 = yahoo_string_encode(gc, msg, &utf8); 3625 msg2 = yahoo_string_encode(gc, msg, &utf8);
3626
3627 if(msg2) {
3628 lenb = strlen(msg2);
3629 lenc = g_utf8_strlen(msg2, -1);
3630
3631 if(lenb > YAHOO_MAX_MESSAGE_LENGTH_BYTES || lenc > YAHOO_MAX_MESSAGE_LENGTH_CHARS) {
3632 purple_debug_info("yahoo", "Message too big. Length is %" G_GSIZE_FORMAT
3633 " bytes, %ld characters. Max is %d bytes, %d chars."
3634 " Message is '%s'.\n", lenb, lenc, YAHOO_MAX_MESSAGE_LENGTH_BYTES,
3635 YAHOO_MAX_MESSAGE_LENGTH_CHARS, msg2);
3636 yahoo_packet_free(pkt);
3637 g_free(msg);
3638 g_free(msg2);
3639 return -E2BIG;
3640 }
3641 }
3624 3642
3625 yahoo_packet_hash(pkt, "ss", 1, purple_connection_get_display_name(gc), 5, who); 3643 yahoo_packet_hash(pkt, "ss", 1, purple_connection_get_display_name(gc), 5, who);
3626 if ((f = yahoo_friend_find(gc, who)) && f->protocol) 3644 if ((f = yahoo_friend_find(gc, who)) && f->protocol)
3627 yahoo_packet_hash_int(pkt, 241, f->protocol); 3645 yahoo_packet_hash_int(pkt, 241, f->protocol);
3628 3646