# HG changeset patch # User Sean Egan # Date 1015953706 0 # Node ID 1143524a2eaffb4f561cf19f7b07b643ee6568f1 # Parent d3536105d58161d29aae2627f697de0285f6b3a1 [gaim-migrate @ 3046] Laying the ground work for image send. Also an IRC fix. committer: Tailor Script diff -r d3536105d581 -r 1143524a2eaf src/buddy.c --- a/src/buddy.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/buddy.c Tue Mar 12 17:21:46 2002 +0000 @@ -1518,7 +1518,7 @@ set_convo_gc(c, u->gc); write_to_conv(c, b->message, WFLAG_SEND, NULL, time(NULL), -1); - serv_send_im(u->gc, name, b->message, 0); + serv_send_im(u->gc, name, b->message, -1, 0); } } if (b->options & OPT_POUNCE_COMMAND) { diff -r d3536105d581 -r 1143524a2eaf src/conversation.c --- a/src/conversation.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/conversation.c Tue Mar 12 17:21:46 2002 +0000 @@ -927,7 +927,7 @@ void send_callback(GtkWidget *widget, struct conversation *c) { char *buf, *buf2; - int limit; + int limit, length=0; int err = 0; if (!c->gc) @@ -1033,20 +1033,63 @@ int imflags = 0; if (c->check && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(c->check))) imflags = IM_FLAG_CHECKBOX; - err = serv_send_im(c->gc, c->name, buffy, imflags); + if (c->images) { + int id, offset; + char *bigbuf; + GSList *tmplist = c->images; + id = 1; + length = strlen(buffy) + strlen(""); + bigbuf = g_malloc(length); + g_snprintf(bigbuf, strlen(buffy)+strlen(" "), "%s", buffy); + offset = strlen(buffy) + strlen(""); + while (tmplist) { + FILE *imgfile; + struct stat st; + char imgtag[1024]; + if (stat(tmplist->data, &st) != 0) { + debug_printf("Could not stat %s\n", tmplist->data); + break; + } + g_snprintf(imgtag, sizeof(imgtag), + "", + id, st.st_size); + length = length + strlen(imgtag) + st.st_size; + bigbuf = realloc(bigbuf, length); + if (!(imgfile = fopen(c->images->data, "r"))) { + debug_printf("Could not open %s\n", tmplist->data); + break; + } + g_snprintf(bigbuf + offset, strlen(imgtag) + 1, "%s", imgtag); + offset = offset + strlen(imgtag); + fread(bigbuf + offset, 1, st.st_size, imgfile); + offset = offset + st.st_size; + g_snprintf(bigbuf + offset, strlen(""), ""); + offset= offset + strlen(""); + id++; + tmplist = tmplist->next; + } + + g_snprintf(bigbuf + offset, strlen(""), ""); + if (serv_send_im(c->gc, c->name, bigbuf, length, imflags) > 0) { + write_to_conv(c, bigbuf, WFLAG_SEND, NULL, time(NULL), length); + if (c->makesound && (sound_options & OPT_SOUND_SEND)) + play_sound(SEND); + if (im_options & OPT_IM_POPDOWN) + gtk_widget_hide(c->window); + + } + g_free(bigbuf); + } else { + if (serv_send_im(c->gc, c->name, buffy, -1, imflags) > 0) + write_to_conv(c, buf, WFLAG_SEND, NULL, time(NULL), -1); + if (c->makesound && (sound_options & OPT_SOUND_SEND)) + play_sound(SEND); + if (im_options & OPT_IM_POPDOWN) + gtk_widget_hide(c->window); + } g_free(buffy); } - - - if (err > 0) { - write_to_conv(c, buf, WFLAG_SEND, NULL, time(NULL), -1); - - if (c->makesound && (sound_options & OPT_SOUND_SEND)) - play_sound(SEND); - - if (im_options & OPT_IM_POPDOWN) - gtk_widget_hide(c->window); - } + } else { err = serv_chat_send(c->gc, c->id, buf); diff -r d3536105d581 -r 1143524a2eaf src/core.c --- a/src/core.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/core.c Tue Mar 12 17:21:46 2002 +0000 @@ -259,7 +259,7 @@ pos += len; memcpy(&flags, data + pos, sizeof(flags)); - serv_send_im(gc, who, msg, flags); + serv_send_im(gc, who, msg, -1, flags); g_free(who); g_free(msg); diff -r d3536105d581 -r 1143524a2eaf src/gaim.h --- a/src/gaim.h Tue Mar 12 02:44:22 2002 +0000 +++ b/src/gaim.h Tue Mar 12 17:21:46 2002 +0000 @@ -356,7 +356,7 @@ extern void serv_login(struct aim_user *); extern void serv_close(struct gaim_connection *); extern void serv_touch_idle(struct gaim_connection *); -extern int serv_send_im(struct gaim_connection *, char *, char *, int); +extern int serv_send_im(struct gaim_connection *, char *, char *, int, int); extern void serv_get_info(struct gaim_connection *, char *); extern void serv_get_dir(struct gaim_connection *, char *); extern void serv_set_idle(struct gaim_connection *, int); diff -r d3536105d581 -r 1143524a2eaf src/perl.c --- a/src/perl.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/perl.c Tue Mar 12 17:21:46 2002 +0000 @@ -586,7 +586,7 @@ XSRETURN(0); return; } - serv_send_im(gc, nick, what, isauto); + serv_send_im(gc, nick, what, -1, isauto); XSRETURN(0); } @@ -613,7 +613,7 @@ c = new_conversation(nick); set_convo_gc(c, gc); write_to_conv(c, what, WFLAG_SEND | (isauto ? WFLAG_AUTO : 0), NULL, time(NULL), -1); - serv_send_im(c->gc, nick, what, isauto ? IM_FLAG_AWAY : 0); + serv_send_im(c->gc, nick, what, -1, isauto ? IM_FLAG_AWAY : 0); XSRETURN(0); } diff -r d3536105d581 -r 1143524a2eaf src/protocols/gg/gg.c --- a/src/protocols/gg/gg.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/gg/gg.c Tue Mar 12 17:21:46 2002 +0000 @@ -1,6 +1,6 @@ /* * gaim - Gadu-Gadu Protocol Plugin - * $Id: gg.c 2928 2001-12-22 00:41:30Z warmenhoven $ + * $Id: gg.c 3046 2002-03-12 17:21:46Z seanegan $ * * Copyright (C) 2001 Arkadiusz Mi¶kiewicz * @@ -585,7 +585,7 @@ gd->own_status = GG_STATUS_NOT_AVAIL; } -static int agg_send_im(struct gaim_connection *gc, char *who, char *msg, int flags) +static int agg_send_im(struct gaim_connection *gc, char *who, char *msg, int len, int flags) { struct agg_data *gd = (struct agg_data *)gc->proto_data; gchar *imsg; diff -r d3536105d581 -r 1143524a2eaf src/protocols/icq/gaim_icq.c --- a/src/protocols/icq/gaim_icq.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/icq/gaim_icq.c Tue Mar 12 17:21:46 2002 +0000 @@ -361,7 +361,7 @@ g_free(id); } -static int icq_send_msg(struct gaim_connection *gc, char *who, char *msg, int flags) { +static int icq_send_msg(struct gaim_connection *gc, char *who, char *msg, int len, int flags) { if (!(flags & IM_FLAG_AWAY) && (strlen(msg) > 0)) { struct icq_data *id = (struct icq_data *)gc->proto_data; long w = atol(who); diff -r d3536105d581 -r 1143524a2eaf src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/irc/irc.c Tue Mar 12 17:21:46 2002 +0000 @@ -1462,30 +1462,35 @@ return 1; } - what++; - process_data_init(pdibuf, what, word, word_eol, TRUE); - g_string_free(str, TRUE); + process_data_init(pdibuf, what + 1, word, word_eol, TRUE); + g_string_free(str, FALSE); if (!g_strcasecmp(pdibuf, "ME")) { if (dccchat) { g_snprintf(buf, sizeof(buf), "\001ACTION %s\001\r\n", word_eol[2]); irc_write(dccchat->fd, buf, strlen(buf)); + g_free(what); return 1; } g_snprintf(buf, sizeof(buf), "PRIVMSG %s :\001ACTION %s\001\r\n", who, word_eol[2]); irc_write(id->fd, buf, strlen(buf)); + g_free(what); return 1; } else if (!g_strcasecmp(pdibuf, "INVITE")) { char buf[IRC_BUF_LEN]; g_snprintf(buf, sizeof(buf), "INVITE %s\r\n", word_eol[2]); irc_write(id->fd, buf, strlen(buf)); } else if (!g_strcasecmp(pdibuf, "TOPIC")) { - if (!*word_eol[2]) + if (!*word_eol[2]) { + g_free(what); return -EINVAL; + } g_snprintf(buf, sizeof(buf), "TOPIC %s :%s\r\n", who, word_eol[2]); irc_write(id->fd, buf, strlen(buf)); } else if (!g_strcasecmp(pdibuf, "NICK")) { - if (!*word_eol[2]) + if (!*word_eol[2]) { + g_free(what); return -EINVAL; + } g_snprintf(buf, sizeof(buf), "NICK %s\r\n", word_eol[2]); irc_write(id->fd, buf, strlen(buf)); } else if (!g_strcasecmp(pdibuf, "OP")) { @@ -1497,34 +1502,46 @@ } else if (!g_strcasecmp(pdibuf, "DEVOICE")) { set_mode(gc, who, '-', 'v', word); } else if (!g_strcasecmp(pdibuf, "QUOTE")) { - if (!*word_eol[2]) + if (!*word_eol[2]) { + g_free(what); return -EINVAL; + } g_snprintf(buf, sizeof(buf), "%s\r\n", word_eol[2]); irc_write(id->fd, buf, strlen(buf)); } else if (!g_strcasecmp(pdibuf, "SAY")) { - if (!*word_eol[2]) + if (!*word_eol[2]) { + g_free(what); return -EINVAL; + } g_snprintf(buf, sizeof(buf), "PRIVMSG %s :%s\r\n", who, word_eol[2]); irc_write(id->fd, buf, strlen(buf)); return 1; } else if (!g_strcasecmp(pdibuf, "MSG")) { - if (!*word[2]) + if (!*word[2]) { + g_free(what); return -EINVAL; - if (!*word_eol[3]) + } + if (!*word_eol[3]) { + g_free(what); return -EINVAL; + } g_snprintf(buf, sizeof(buf), "PRIVMSG %s :%s\r\n", word[2], word_eol[3]); irc_write(id->fd, buf, strlen(buf)); } else if (!g_strcasecmp(pdibuf, "KICK")) { - if (!*word[2]) + if (!*word[2]) { + g_free(what); return -EINVAL; + } if (*word_eol[3]) g_snprintf(buf, sizeof(buf), "KICK %s %s :%s\r\n", who, word[2], word_eol[3]); else g_snprintf(buf, sizeof(buf), "KICK %s %s\r\n", who, word[2]); irc_write(id->fd, buf, strlen(buf)); } else if (!g_strcasecmp(pdibuf, "JOIN") || !g_strcasecmp(pdibuf, "J")) { - if (!*word[2]) + if (!*word[2]) { + g_free(what); return -EINVAL; + } if (*word[3]) g_snprintf(buf, sizeof(buf), "JOIN %s %s\r\n", word[2], word[3]); else @@ -1534,8 +1551,10 @@ char *chan = *word[2] ? word[2] : who; char *reason = word_eol[3]; struct conversation *c; - if (!is_channel(gc, chan)) + if (!is_channel(gc, chan)) { + g_free(what); return -EINVAL; + } c = irc_find_chat(gc, chan); g_snprintf(buf, sizeof(buf), "PART %s%s%s\r\n", chan, *reason ? " :" : "", @@ -1560,8 +1579,10 @@ } else { c = find_conversation(who); } - if (!c) + if (!c) { + g_free(what); return -EINVAL; + } write_to_conv(c, "Currently supported commands:
" "WHOIS INVITE NICK LIST
" "JOIN PART TOPIC KICK
" @@ -1575,11 +1596,13 @@ } else { c = find_conversation(who); } - if (!c) + if (!c) { + g_free(what); return -EINVAL; + } write_to_conv(c, "Unknown command", WFLAG_NOLOG, NULL, time(NULL), -1); } - + g_free(what); return 0; } @@ -1613,7 +1636,7 @@ irc_write(id->fd, buf, strlen(buf)); } -static int irc_send_im(struct gaim_connection *gc, char *who, char *what, int flags) +static int irc_send_im(struct gaim_connection *gc, char *who, char *what, int len, int flags) { if (*who == '@' || *who == '+') return send_msg(gc, who + 1, what); @@ -1787,7 +1810,7 @@ chat); snprintf (buf, sizeof buf, "\001DCC CHAT chat %s %d\001\n", chat->ip_address, chat->port); - irc_send_im (gc, who, buf, 0); + irc_send_im (gc, who, buf, -1, 0); } static void irc_get_info(struct gaim_connection *gc, char *who) diff -r d3536105d581 -r 1143524a2eaf src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/jabber/jabber.c Tue Mar 12 17:21:46 2002 +0000 @@ -1503,7 +1503,7 @@ gc->proto_data = NULL; } -static int jabber_send_im(struct gaim_connection *gc, char *who, char *message, int flags) +static int jabber_send_im(struct gaim_connection *gc, char *who, char *message, int len, int flags) { xmlnode x, y; char *realwho; diff -r d3536105d581 -r 1143524a2eaf src/protocols/msn/msn.c --- a/src/protocols/msn/msn.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/msn/msn.c Tue Mar 12 17:21:46 2002 +0000 @@ -1527,7 +1527,7 @@ return MSN_TYPING_SEND_TIMEOUT; } -static int msn_send_im(struct gaim_connection *gc, char *who, char *message, int flags) +static int msn_send_im(struct gaim_connection *gc, char *who, char *message, int len, int flags) { struct msn_data *md = gc->proto_data; struct msn_switchboard *ms = msn_find_switch(gc, who); diff -r d3536105d581 -r 1143524a2eaf src/protocols/napster/napster.c --- a/src/protocols/napster/napster.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/napster/napster.c Tue Mar 12 17:21:46 2002 +0000 @@ -77,7 +77,7 @@ write(ndata->fd, message, size); } -static int nap_send_im(struct gaim_connection *gc, char *who, char *message, int flags) +static int nap_send_im(struct gaim_connection *gc, char *who, char *message, int len, int flags) { gchar buf[NAP_BUF_LEN]; diff -r d3536105d581 -r 1143524a2eaf src/protocols/oscar/aim.h --- a/src/protocols/oscar/aim.h Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/oscar/aim.h Tue Mar 12 17:21:46 2002 +0000 @@ -249,8 +249,8 @@ */ typedef struct aim_bstream_s { fu8_t *data; - fu16_t len; - fu16_t offset; + fu32_t len; + fu32_t offset; } aim_bstream_t; typedef struct aim_frame_s { @@ -838,7 +838,7 @@ faim_export int aim_send_icon(aim_session_t *sess, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum); faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen); faim_export int aim_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing); -faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg); +faim_export int aim_send_im_direct(aim_session_t *, aim_conn_t *, const char *msg, int len); faim_export const char *aim_directim_getsn(aim_conn_t *conn); faim_export aim_conn_t *aim_directim_initiate(aim_session_t *, const char *destsn); faim_export aim_conn_t *aim_directim_connect(aim_session_t *, const char *sn, const char *addr, const fu8_t *cookie); diff -r d3536105d581 -r 1143524a2eaf src/protocols/oscar/aim_cbtypes.h --- a/src/protocols/oscar/aim_cbtypes.h Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/oscar/aim_cbtypes.h Tue Mar 12 17:21:46 2002 +0000 @@ -254,7 +254,7 @@ #define AIM_CB_SPECIAL_CONNCOMPLETE 0x0004 #define AIM_CB_SPECIAL_FLAPVER 0x0005 #define AIM_CB_SPECIAL_CONNINITDONE 0x0006 -#define AIM_CB_SPECIAL_DOWNLOADIMAGE 0x007 +#define AIM_CB_SPECIAL_IMAGETRANSFER 0x007 #define AIM_CB_SPECIAL_UNKNOWN 0xffff #define AIM_CB_SPECIAL_DEFAULT AIM_CB_SPECIAL_UNKNOWN diff -r d3536105d581 -r 1143524a2eaf src/protocols/oscar/ft.c --- a/src/protocols/oscar/ft.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/oscar/ft.c Tue Mar 12 17:21:46 2002 +0000 @@ -181,12 +181,13 @@ * aim_send_im_direct - send IM client-to-client over established connection * @sess: session to conn * @conn: directim connection - * @msg: null-terminated string to send. + * @msg: null-terminated string to send. + * len: The length of the message to send, including binary data. * * Call this just like you would aim_send_im, to send a directim. You * _must_ have previously established the directim connection. */ -faim_export int aim_send_im_direct(aim_session_t *sess, aim_conn_t *conn, const char *msg) +faim_export int aim_send_im_direct(aim_session_t *sess, aim_conn_t *conn, const char *msg, int len) { struct aim_directim_intdata *intdata = (struct aim_directim_intdata *)conn->internal; aim_frame_t *fr; @@ -195,7 +196,7 @@ if (!sess || !conn || !msg || (conn->type != AIM_CONN_TYPE_RENDEZVOUS)) return -EINVAL; - if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_OFT, 0x01, strlen(msg)))) + if (!(fr = aim_tx_new(sess, conn, AIM_FRAMETYPE_OFT, 0x01, len))) return -ENOMEM; memcpy(fr->hdr.oft.magic, "ODC2", 4); @@ -216,7 +217,7 @@ aimbs_put16(&hdrbs, 0x0000); aimbs_put16(&hdrbs, 0x0000); aimbs_put16(&hdrbs, 0x0000); - aimbs_put32(&hdrbs, strlen(msg)); + aimbs_put32(&hdrbs, len); aimbs_put16(&hdrbs, 0x0000); aimbs_put16(&hdrbs, 0x0000); aimbs_put16(&hdrbs, 0x0000); @@ -251,7 +252,7 @@ i += aimutil_put16(newpacket->hdr.oft.hdr2+i, 0x393e); i += aimutil_put16(newpacket->hdr.oft.hdr2+i, 0xcac8); #endif - aimbs_putraw(&fr->data, msg, strlen(msg)); + aimbs_putraw(&fr->data, msg, len); aim_tx_enqueue(sess, fr); @@ -1121,7 +1122,7 @@ } recvd = recvd + i; msg2 = msg2 + i; - if ((userfunc=aim_callhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DOWNLOADIMAGE))) + if ((userfunc=aim_callhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_IMAGETRANSFER))) userfunc(sess, &fr, snptr, (double)recvd / payloadlength); } diff -r d3536105d581 -r 1143524a2eaf src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/oscar/oscar.c Tue Mar 12 17:21:46 2002 +0000 @@ -1273,7 +1273,7 @@ gaim_directim_incoming, 0); aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING, gaim_directim_typing, 0); - aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DOWNLOADIMAGE, + aim_conn_addhandler(od->sess, dim->conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_IMAGETRANSFER, gaim_update_ui, 0); for (i = 0; i < (int)strlen(d->ip); i++) { if (d->ip[i] == ':') { @@ -2424,13 +2424,13 @@ return 0; } -static int oscar_send_im(struct gaim_connection *gc, char *name, char *message, int imflags) { +static int oscar_send_im(struct gaim_connection *gc, char *name, char *message, int len, int imflags) { struct oscar_data *odata = (struct oscar_data *)gc->proto_data; struct direct_im *dim = find_direct_im(odata, name); int ret = 0; if (dim) { if (dim->connected) { /* If we're not connected yet, send through server */ - ret = aim_send_im_direct(odata->sess, dim->conn, message); + ret = aim_send_im_direct(odata->sess, dim->conn, message, len == -1 ? strlen(len) : len); if (ret == 0) return 1; else return ret; @@ -3146,7 +3146,7 @@ gaim_directim_incoming, 0); aim_conn_addhandler(sess, newconn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMTYPING, gaim_directim_typing, 0); - aim_conn_addhandler(sess, newconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_DOWNLOADIMAGE, + aim_conn_addhandler(sess, newconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_IMAGETRANSFER, gaim_update_ui, 0); return 1; } diff -r d3536105d581 -r 1143524a2eaf src/protocols/toc/toc.c --- a/src/protocols/toc/toc.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/toc/toc.c Tue Mar 12 17:21:46 2002 +0000 @@ -919,7 +919,7 @@ return "TOC"; } -static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int flags) +static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int len, int flags) { char buf[BUF_LEN * 2]; char *tmp = g_malloc(strlen(message) * 4 + 1); /* 4 because \n gets replaced with
*/ diff -r d3536105d581 -r 1143524a2eaf src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/yahoo/yahoo.c Tue Mar 12 17:21:46 2002 +0000 @@ -978,7 +978,7 @@ return m; } -static int yahoo_send_im(struct gaim_connection *gc, char *who, char *what, int flags) +static int yahoo_send_im(struct gaim_connection *gc, char *who, char *what, int len, int flags) { struct yahoo_data *yd = gc->proto_data; struct yahoo_packet *pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, YAHOO_STATUS_OFFLINE, 0); diff -r d3536105d581 -r 1143524a2eaf src/protocols/zephyr/zephyr.c --- a/src/protocols/zephyr/zephyr.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/protocols/zephyr/zephyr.c Tue Mar 12 17:21:46 2002 +0000 @@ -736,7 +736,7 @@ return 0; } -static int zephyr_send_im(struct gaim_connection *gc, char *who, char *im, int flags) { +static int zephyr_send_im(struct gaim_connection *gc, char *who, char *im, int len, int flags) { ZNotice_t notice; char *buf; const char *sig; diff -r d3536105d581 -r 1143524a2eaf src/prpl.h --- a/src/prpl.h Tue Mar 12 02:44:22 2002 +0000 +++ b/src/prpl.h Tue Mar 12 17:21:46 2002 +0000 @@ -102,7 +102,7 @@ void (* login) (struct aim_user *); void (* close) (struct gaim_connection *); - int (* send_im) (struct gaim_connection *, char *who, char *message, int away); + int (* send_im) (struct gaim_connection *, char *who, char *message, int len, int away); void (* set_info) (struct gaim_connection *, char *info); int (* send_typing) (struct gaim_connection *, char *name, int typing); void (* get_info) (struct gaim_connection *, char *who); diff -r d3536105d581 -r 1143524a2eaf src/server.c --- a/src/server.c Tue Mar 12 02:44:22 2002 +0000 +++ b/src/server.c Tue Mar 12 17:21:46 2002 +0000 @@ -152,11 +152,11 @@ else return 0; } -int serv_send_im(struct gaim_connection *gc, char *name, char *message, int flags) +int serv_send_im(struct gaim_connection *gc, char *name, char *message, int len, int flags) { int val = -EINVAL; if (gc->prpl && gc->prpl->send_im) - val = gc->prpl->send_im(gc, name, message, flags); + val = gc->prpl->send_im(gc, name, message, len, flags); if (!(flags & IM_FLAG_AWAY)) serv_touch_idle(gc); @@ -494,7 +494,7 @@ if ((away_options & OPT_AWAY_TIK_HACK) && gc->away && strlen(gc->away) && (len < 0) && !strcmp(message, ">>>Automated Message: Getting Away Message<<<")) { char *tmpmsg = stylize(awaymessage->message, MSG_LEN); - serv_send_im(gc, name, tmpmsg, IM_FLAG_AWAY); + serv_send_im(gc, name, tmpmsg, -1, IM_FLAG_AWAY); g_free(tmpmsg); g_free(name); g_free(message); @@ -621,7 +621,7 @@ /* apply default fonts and colors */ tmpmsg = stylize(gc->away, MSG_LEN); - serv_send_im(gc, name, away_subs(tmpmsg, alias), IM_FLAG_AWAY); + serv_send_im(gc, name, away_subs(tmpmsg, alias), -1, IM_FLAG_AWAY); if (!cnv && clistqueue && (away_options & OPT_AWAY_QUEUE)) { struct queued_message *qm; qm = g_new0(struct queued_message, 1); diff -r d3536105d581 -r 1143524a2eaf src/ui.h --- a/src/ui.h Tue Mar 12 02:44:22 2002 +0000 +++ b/src/ui.h Tue Mar 12 17:21:46 2002 +0000 @@ -154,6 +154,7 @@ GtkWidget *menu; GtkWidget *check; GtkWidget *progress; + GSList *images; /* A list of filenames to embed */ gint unseen; guint typing_timeout; time_t type_again;