Mercurial > pidgin.yaz
comparison src/protocols/toc/toc.c @ 6982:083d1e4a9c78
[gaim-migrate @ 7538]
This is Mr. Holland's Opus. And by Mr. Holland I mean Robot101. He
rewrote the coreish IM image support so that the binary data gets
ripped out in the prpl and put in an imgstore instead of just being
passed in the same huge as char string as the actual message. This
is good because it's prpl agnostic, or something. It also means
we don't have a silly length of "-1" with pretty much every send or
receive IM function.
It should be crash free, bug free, and memleak free, but additional
testing is always a good thing.
If you like good stuff then you'll love this patch. But don't take
my word for it--ba dun dunt!
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 27 Sep 2003 19:17:21 +0000 |
parents | 1c4e4c725e0d |
children | 86ed8b2aa665 |
comparison
equal
deleted
inserted
replaced
6981:abd3c684da31 | 6982:083d1e4a9c78 |
---|---|
738 message++; | 738 message++; |
739 message++; | 739 message++; |
740 | 740 |
741 a = (away && (*away == 'T')) ? GAIM_IM_AUTO_RESP : 0; | 741 a = (away && (*away == 'T')) ? GAIM_IM_AUTO_RESP : 0; |
742 | 742 |
743 serv_got_im(gc, c, message, a, time(NULL), -1); | 743 serv_got_im(gc, c, message, a, time(NULL)); |
744 } else if (!g_ascii_strcasecmp(c, "UPDATE_BUDDY")) { | 744 } else if (!g_ascii_strcasecmp(c, "UPDATE_BUDDY")) { |
745 char *l, *uc, *tmp; | 745 char *l, *uc, *tmp; |
746 int logged, evil, idle, type = 0; | 746 int logged, evil, idle, type = 0; |
747 time_t signon, time_idle; | 747 time_t signon, time_idle; |
748 | 748 |
1057 gaim_debug(GAIM_DEBUG_ERROR, "toc", | 1057 gaim_debug(GAIM_DEBUG_ERROR, "toc", |
1058 "don't know what to do with %s\n", c); | 1058 "don't know what to do with %s\n", c); |
1059 } | 1059 } |
1060 } | 1060 } |
1061 | 1061 |
1062 static int toc_send_im(GaimConnection *gc, const char *name, const char *message, int len, GaimImFlags flags) | 1062 static int toc_send_im(GaimConnection *gc, const char *name, const char *message, GaimImFlags flags) |
1063 { | 1063 { |
1064 char *buf1, *buf2; | 1064 char *buf1, *buf2; |
1065 | 1065 |
1066 #if 1 | 1066 #if 1 |
1067 /* This is the old, non-i18n way */ | 1067 /* This is the old, non-i18n way */ |
1087 * After that, you need to convert buf1 to that encoding, and keep track | 1087 * After that, you need to convert buf1 to that encoding, and keep track |
1088 * of the length of the resulting string. Then you need to make sure | 1088 * of the length of the resulting string. Then you need to make sure |
1089 * that length is passed to sflap_send(). | 1089 * that length is passed to sflap_send(). |
1090 */ | 1090 */ |
1091 | 1091 |
1092 if (len + 52 > MSG_LEN) { | 1092 if (strlen(buf1) + 52 > MSG_LEN) { |
1093 g_free(buf1); | 1093 g_free(buf1); |
1094 return -E2BIG; | 1094 return -E2BIG; |
1095 } | 1095 } |
1096 | 1096 |
1097 buf2 = g_strdup_printf("toc2_send_im_enc %s F U en \"%s\" %s", normalize(name), buf1, | 1097 buf2 = g_strdup_printf("toc2_send_im_enc %s F U en \"%s\" %s", normalize(name), buf1, |