# HG changeset patch # User Rob Flynn # Date 988423288 0 # Node ID 9aae465eeb6e596df25e052c67c29c9096bdb150 # Parent 5461acb8940ae952a88a52a7ada518defb334a9f [gaim-migrate @ 1778] Start of the queueing stuff committer: Tailor Script diff -r 5461acb8940a -r 9aae465eeb6e src/aim.c --- a/src/aim.c Fri Apr 27 23:53:19 2001 +0000 +++ b/src/aim.c Sat Apr 28 02:01:28 2001 +0000 @@ -68,6 +68,7 @@ GSList *away_messages = NULL; GList *conversations = NULL; GList *chat_rooms = NULL; +GSList *message_queue = NULL; GtkWidget *mainwindow = NULL; diff -r 5461acb8940a -r 9aae465eeb6e src/away.c --- a/src/away.c Fri Apr 27 23:53:19 2001 +0000 +++ b/src/away.c Sat Apr 28 02:01:28 2001 +0000 @@ -55,6 +55,20 @@ { if (imaway) { GtkWidget *tmp = imaway; + /*GSList *templist = message_queue; + + while (templist) + { + struct queued_message *qm = (struct queued_message *)templist->data; + + free(qm->message); + + message_queue = g_slist_remove(message_queue, qm); + + free(qm); + } + */ + imaway = NULL; gtk_widget_destroy(tmp); if (w != tmp) diff -r 5461acb8940a -r 9aae465eeb6e src/gaim.h --- a/src/gaim.h Fri Apr 27 23:53:19 2001 +0000 +++ b/src/gaim.h Sat Apr 28 02:01:28 2001 +0000 @@ -268,6 +268,13 @@ int options; }; +struct queued_message { + char name[80]; + char *message; + time_t tm; + struct gaim_connection *gc; +}; + struct away_message { char name[80]; char message[2048]; @@ -528,11 +535,12 @@ #define OPT_USR_KEEPALV 0x00000002 #define OPT_USR_REM_PASS 0x00000004 -#define DEFAULT_INFO "Visit the GAIM website at http://www.marko.net/gaim." +#define DEFAULT_INFO "Visit the GAIM website at http://gaim.sourceforge.net/." extern int report_idle; extern int web_browser; extern GList *aim_users; +extern GSList *message_queue; extern char sound_cmd[2048]; extern char web_command[2048]; extern struct save_pos blist_pos; diff -r 5461acb8940a -r 9aae465eeb6e src/server.c --- a/src/server.c Fri Apr 27 23:53:19 2001 +0000 +++ b/src/server.c Sat Apr 28 02:01:28 2001 +0000 @@ -309,12 +309,11 @@ serv_touch_idle(g); } - - void serv_got_im(struct gaim_connection *gc, char *name, char *message, int away, time_t mtime) { struct conversation *cnv; int new_conv = 0; + int hehe = away; char *buffy = g_strdup(message); char *angel = g_strdup(name); @@ -368,9 +367,27 @@ return; } if (cnv != NULL) { + if (cnv->makesound && (sound_options & OPT_SOUND_RECV)) play_sound(RECEIVE); + + if (gc->away) + { + struct queued_message *qm; + + qm = (struct queued_message *)g_new0(struct queued_message, 1); + snprintf(qm->name, sizeof(qm->name), "%s", name); + qm->message = strdup(message); + qm->gc = gc; + qm->tm = mtime; + + message_queue = g_slist_append(message_queue, qm); + + printf("A message has been queued.\n"); + } + write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime); + } } else { @@ -388,6 +405,22 @@ if (cnv->makesound && (sound_options & OPT_SOUND_RECV)) play_sound(RECEIVE); } + + if (gc->away) + { + struct queued_message *qm; + + qm = (struct queued_message *)g_new0(struct queued_message, 1); + snprintf(qm->name, sizeof(qm->name), "%s", name); + qm->message = strdup(message); + qm->gc = gc; + qm->tm = mtime; + + message_queue = g_slist_append(message_queue, qm); + + printf("A message has been queued.\n"); + } + write_to_conv(cnv, message, away | WFLAG_RECV, NULL, mtime); }