Mercurial > pidgin
comparison plugins/lagmeter.c @ 2351:4e2d8992774e
[gaim-migrate @ 2364]
handle jabber better. sigh.
committer: Tailor Script <tailor@pidgin.im>
| author | Eric Warmenhoven <eric@warmenhoven.org> |
|---|---|
| date | Sun, 23 Sep 2001 20:32:16 +0000 |
| parents | c9c20663e05b |
| children | abdf5f081b29 |
comparison
equal
deleted
inserted
replaced
| 2350:0264a8a27e69 | 2351:4e2d8992774e |
|---|---|
| 1 #define GAIM_PLUGINS | 1 #define GAIM_PLUGINS |
| 2 #include "gaim.h" | 2 #include "gaim.h" |
| 3 #include "prpl.h" | |
| 3 | 4 |
| 4 #include <time.h> | 5 #include <time.h> |
| 5 #include <sys/types.h> | 6 #include <sys/types.h> |
| 6 #include <sys/time.h> | 7 #include <sys/time.h> |
| 7 #include <string.h> | 8 #include <string.h> |
| 82 | 83 |
| 83 static gint send_lag() { | 84 static gint send_lag() { |
| 84 gettimeofday(&my_lag_tv, NULL); | 85 gettimeofday(&my_lag_tv, NULL); |
| 85 if (g_slist_find(connections, my_gc)) { | 86 if (g_slist_find(connections, my_gc)) { |
| 86 char *m = g_strdup(MY_LAG_STRING); | 87 char *m = g_strdup(MY_LAG_STRING); |
| 87 serv_send_im(my_gc, my_gc->username, m, 1); | 88 if (my_gc->protocol == PROTO_JABBER) { |
| 89 if (!strchr(my_gc->username, '@')) { | |
| 90 char buf = g_strconcat(my_gc->username, "@jabber.org/GAIM", NULL); | |
| 91 serv_send_im(my_gc, buf, m, 1); | |
| 92 g_free(buf); | |
| 93 } else if (!strchr(my_gc->username, '/')) { | |
| 94 char buf = g_strconcat(my_gc->username, "@jabber.org/GAIM", NULL); | |
| 95 serv_send_im(my_gc, buf, m, 1); | |
| 96 g_free(buf); | |
| 97 } else | |
| 98 serv_send_im(my_gc, my_gc->username, m, 1); | |
| 99 } else | |
| 100 serv_send_im(my_gc, my_gc->username, m, 1); | |
| 88 g_free(m); | 101 g_free(m); |
| 89 return TRUE; | 102 return TRUE; |
| 90 } else { | 103 } else { |
| 91 debug_printf("LAGMETER: send_lag called for connection that no longer exists\n"); | 104 debug_printf("LAGMETER: send_lag called for connection that no longer exists\n"); |
| 92 check_timeout = 0; | 105 check_timeout = 0; |
