# HG changeset patch # User Luke Schierer # Date 1058983090 0 # Node ID bb811465c82d369e0270ffa635d747e67a579ec4 # Parent d176f3299696fceb426b9df604b01abc3b1107c8 [gaim-migrate @ 6786] Paul A (darkrain) writes: " the attached patch updates mailchk.c to the new gaim API and fixes one or two bugs (having to do with the plugin trying to draw a box when there wasn't actually a window to draw it in)" committer: Tailor Script diff -r d176f3299696 -r bb811465c82d ChangeLog --- a/ChangeLog Wed Jul 23 17:53:48 2003 +0000 +++ b/ChangeLog Wed Jul 23 17:58:10 2003 +0000 @@ -2,7 +2,7 @@ version 0.67 * Various bug fixes (larne from irc, Tim Ringenbach, Bjoern - Voigt) + Voigt, Paul A (darkrain)) * British English "translation" updated (Sam Halliday) * Chinese (Traditional) translation updated (Ambrose C. Li) * German translation updated (Bjoern Voigt) diff -r d176f3299696 -r bb811465c82d plugins/mailchk.c --- a/plugins/mailchk.c Wed Jul 23 17:53:48 2003 +0000 +++ b/plugins/mailchk.c Wed Jul 23 17:58:10 2003 +0000 @@ -1,8 +1,11 @@ -#include "gaim.h" -#include "gtkplugin.h" +#include "internal.h" + #include "blist.h" #include "gtkblist.h" +#include "debug.h" #include "sound.h" +#include "gtkplugin.h" + #include #include #include @@ -53,17 +56,16 @@ { gint count = check_mail(); struct gaim_buddy_list *list = gaim_get_blist(); + if (count == -1) return FALSE; - if (!list || !GAIM_GTK_BLIST(list)) + if (!list || !GAIM_IS_GTK_BLIST(list) || !(GAIM_GTK_BLIST(list)->vbox)) return TRUE; if (!mail) { /* guess we better build it then :P */ - //GList *tmp = gtk_container_get_children(GTK_CONTAINER(GAIM_GTK_BLIST(list))); - //GtkWidget *vbox2 = (GtkWidget *)tmp->data; - GtkWidget *vbox = (GtkWidget *)(GAIM_GTK_BLIST(list)->vbox); + GtkWidget *vbox = GAIM_GTK_BLIST(list)->vbox; mail = gtk_label_new("No mail messages."); gtk_box_pack_start(GTK_BOX(vbox), mail, FALSE, FALSE, 0); @@ -85,17 +87,19 @@ return TRUE; } -static void signon_cb(struct gaim_connection *gc) +static void signon_cb(GaimConnection *gc) { struct gaim_buddy_list *list = gaim_get_blist(); - if (list && GAIM_GTK_BLIST(list) && !timer) + if (list && GAIM_IS_GTK_BLIST(list) && !timer) { + check_timeout(NULL); /* we want the box to be drawn immediately */ timer = g_timeout_add(2000, check_timeout, NULL); + } } -static void signoff_cb(struct gaim_connection *gc) +static void signoff_cb(GaimConnection *gc) { struct gaim_buddy_list *list = gaim_get_blist(); - if ((!list || !GAIM_GTK_BLIST(list)) && timer) { + if ((!list || !GAIM_IS_GTK_BLIST(list) || !GAIM_GTK_BLIST(list)->vbox) && timer) { g_source_remove(timer); timer = 0; } @@ -114,7 +118,7 @@ return FALSE; } - if (list && GAIM_GTK_BLIST(list)) + if (list && GAIM_IS_GTK_BLIST(list) && GAIM_GTK_BLIST(list)->vbox) timer = g_timeout_add(2000, check_timeout, NULL); gaim_signal_connect(plugin, event_signon, signon_cb, NULL); @@ -138,29 +142,24 @@ static GaimPluginInfo info = { - 2, /**< api_version */ - GAIM_PLUGIN_STANDARD, /**< type */ - GAIM_GTK_PLUGIN_TYPE, /**< ui_requirement */ - 0, /**< flags */ - NULL, /**< dependencies */ - GAIM_PRIORITY_DEFAULT, /**< priority */ - - MAILCHK_PLUGIN_ID, /**< id */ - N_("Mail Checker"), /**< name */ - VERSION, /**< version */ - /** summary */ + 2, + GAIM_PLUGIN_STANDARD, + GAIM_GTK_PLUGIN_TYPE, + 0, + NULL, + GAIM_PRIORITY_DEFAULT, + MAILCHK_PLUGIN_ID, + N_("Mail Checker"), + VERSION, N_("Checks for new local mail."), - /** description */ N_("Checks for new local mail."), - "Eric Warmenhoven ", /**< author */ - WEBSITE, /**< homepage */ - - plugin_load, /**< load */ - plugin_unload, /**< unload */ - NULL, /**< destroy */ - - NULL, /**< ui_info */ - NULL /**< extra_info */ + "Eric Warmenhoven ", + WEBSITE, + plugin_load, + plugin_unload, + NULL, + NULL, + NULL }; static void