changeset 2376:b31f0edaf48d

[gaim-migrate @ 2389] hi committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 27 Sep 2001 22:48:16 +0000
parents 09fe1b00d31f
children 466b29d35b85
files plugins/lagmeter.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/lagmeter.c	Thu Sep 27 20:54:02 2001 +0000
+++ b/plugins/lagmeter.c	Thu Sep 27 22:48:16 2001 +0000
@@ -59,13 +59,16 @@
 
 static void check_lag(struct gaim_connection *gc, char **who, char **message, void *m) {
 	char *name;
+	gboolean good = FALSE;
 	if (gc != my_gc)
 		return;
 
 	name = g_strdup(normalize(*who));
-	if (!strcasecmp(normalize(gc->username), name) &&
-	    (*message != NULL) &&
-	    !strcmp(*message, MY_LAG_STRING)) {
+	if (!g_strcasecmp(normalize(gc->username), name))
+		good = TRUE;
+	if (!g_strcasecmp(normalize(gc->displayname), name))
+		good = TRUE;
+	if (good && (*message != NULL) && !strcmp(*message, MY_LAG_STRING)) {
 		struct timeval tv;
 		int ms;
 
@@ -96,7 +99,9 @@
 				g_free(buf);
 			} else
 				serv_send_im(my_gc, my_gc->username, m, 1);
-		} else
+		} else if (strcmp(my_gc->username, my_gc->displayname))
+			serv_send_im(my_gc, my_gc->displayname, m, 1);
+		else
 			serv_send_im(my_gc, my_gc->username, m, 1);
 		g_free(m);
 		return TRUE;