# HG changeset patch # User Eric Warmenhoven # Date 968292394 0 # Node ID 5f19ec4a91f74d25bc96a6e7622c399cbe4977f8 # Parent 430a88eb4a68bcf4f5ba43c3cfd2d5ca0ffb6cdc [gaim-migrate @ 858] wow. the lagometer works as a plugin. this is how it should have been all along anyway. committer: Tailor Script diff -r 430a88eb4a68 -r 5f19ec4a91f7 plugins/lagmeter.c --- a/plugins/lagmeter.c Thu Sep 07 01:30:33 2000 +0000 +++ b/plugins/lagmeter.c Thu Sep 07 02:06:34 2000 +0000 @@ -30,7 +30,7 @@ GtkWidget *lagbox; GtkWidget *my_lagometer; struct timeval my_lag_tv; -int check_timeout; +int check_timeout = -1; guint delay = 10; static GtkWidget *confdlg; @@ -71,7 +71,7 @@ void check_lag(char **who, char **message, void *m) { char *name = g_strdup(normalize(*who)); - if (!strcasecmp(current_user->username, name) && + if (!strcasecmp(normalize(current_user->username), name) && !strcmp(*message, MY_LAG_STRING)) { struct timeval tv; int ms; @@ -94,7 +94,8 @@ } void gaim_plugin_remove() { - gtk_timeout_remove(check_timeout); + if (check_timeout != -1) + gtk_timeout_remove(check_timeout); if (confdlg) gtk_widget_destroy(confdlg); confdlg = NULL; @@ -122,7 +123,8 @@ GTK_SPIN_BUTTON(spinner)), 0, 3600); sprintf(debug_buff, "new updates: %d\n", delay); debug_print(debug_buff); - gtk_timeout_remove(check_timeout); + if (check_timeout >= 0) + gtk_timeout_remove(check_timeout); check_timeout = gtk_timeout_add(1000 * delay, (GtkFunction)send_lag, NULL); gtk_widget_destroy(confdlg); confdlg = NULL;