Mercurial > pidgin
changeset 848:5f19ec4a91f7
[gaim-migrate @ 858]
wow. the lagometer works as a plugin. this is how it should have been all along anyway.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Thu, 07 Sep 2000 02:06:34 +0000 |
parents | 430a88eb4a68 |
children | be8211f068c4 |
files | plugins/lagmeter.c |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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;