/* * Process any new messages we have waiting in the message queue. */ static gboolean owl_process_messages_dispatch(GSource *source, GSourceFunc callback, gpointer user_data) { int newmsgs=0; int followlast = owl_global_should_followlast(&g); owl_message *m; /* Grab incoming messages. */ while (owl_global_messagequeue_pending(&g)) { m = owl_global_messagequeue_popmsg(&g); if (owl_process_message(m)) newmsgs = 1; } if (newmsgs) { /* follow the last message if we're supposed to */ if (followlast) owl_function_lastmsg_noredisplay(); /* do the newmsgproc thing */ owl_function_do_newmsgproc(); /* redisplay if necessary */ /* this should be optimized to not run if the new messages won't be displayed */ owl_mainwin_redisplay(owl_global_get_mainwin(&g)); } return TRUE; }
/* * Process any new messages we have waiting in the message queue. * Returns 1 if any messages were added to the message list, and 0 otherwise. */ int owl_process_messages(owl_ps_action *d, void *p) { int newmsgs=0; int followlast = owl_global_should_followlast(&g); owl_message *m; /* Grab incoming messages. */ while (owl_global_messagequeue_pending(&g)) { m = owl_global_messagequeue_popmsg(&g); if (owl_process_message(m)) newmsgs = 1; } if (newmsgs) { /* follow the last message if we're supposed to */ if (followlast) owl_function_lastmsg_noredisplay(); /* do the newmsgproc thing */ owl_function_do_newmsgproc(); /* redisplay if necessary */ /* this should be optimized to not run if the new messages won't be displayed */ owl_mainwin_redisplay(owl_global_get_mainwin(&g)); } return newmsgs; }