# HG changeset patch # User Eric Warmenhoven # Date 992133943 0 # Node ID 7739e648a28a5b9c3675d6097e580ca4e3c5a680 # Parent 5b79252ea95c06aaed66ed729a82c22f804dd972 [gaim-migrate @ 1991] hi luigiwalser committer: Tailor Script diff -r 5b79252ea95c -r 7739e648a28a src/server.c --- a/src/server.c Sat Jun 09 23:57:28 2001 +0000 +++ b/src/server.c Sun Jun 10 00:45:43 2001 +0000 @@ -388,15 +388,27 @@ /* woo. i'm actually going to comment this function. isn't that fun. make sure to follow along, kids */ void serv_got_im(struct gaim_connection *gc, char *name, char *message, int away, time_t mtime) { + char *buffy; + char *angel; + int plugin_return; + struct conversation *cnv; int new_conv = 0; + /* we should update the conversation window buttons and menu, if it exists. */ + cnv = find_conversation(name); + if (cnv) + set_convo_gc(cnv, gc); + /* we do the new_conv check here in case any plugins decide to create it */ + else + new_conv = 1; + /* plugin stuff. we pass a char ** but we don't want to pass what's been given us * by the prpls. so we create temp holders and pass those instead. it's basically * just to avoid segfaults. */ - char *buffy = g_strdup(message); - char *angel = g_strdup(name); - int plugin_return = plugin_event(event_im_recv, gc, &angel, &buffy, 0); + buffy = g_strdup(message); + angel = g_strdup(name); + plugin_return = plugin_event(event_im_recv, gc, &angel, &buffy, 0); if (!buffy || !angel || plugin_return) { if (buffy) @@ -421,11 +433,6 @@ return; } - /* we should update the conversation window buttons and menu, if it exists. */ - cnv = find_conversation(name); - if (cnv) - set_convo_gc(cnv, gc); - /* if you can't figure this out, stop reading right now. * "we're not worthy! we're not worthy!" */ if (general_options & OPT_GEN_SEND_LINKS) @@ -497,7 +504,6 @@ * will take care of not playing while away), and then write it to the * convo window. */ if (cnv == NULL) { - new_conv = 1; cnv = new_conversation(name); set_convo_gc(cnv, gc); } @@ -550,7 +556,6 @@ * it (if it does exist it was updated earlier), then play a sound indicating we've * received it and then display it. easy. */ if (cnv == NULL) { - new_conv = 1; cnv = new_conversation(name); set_convo_gc(cnv, gc); }