changeset 1066:d6c70d58a4b2

[gaim-migrate @ 1076] login/logout reporting to convo window and ticker working again committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 04 Nov 2000 11:18:59 +0000
parents a761951579b9
children 649199f4730e
files FIXME src/buddy.c
diffstat 2 files changed, 27 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/FIXME	Sat Nov 04 11:05:17 2000 +0000
+++ b/FIXME	Sat Nov 04 11:18:59 2000 +0000
@@ -4,7 +4,5 @@
 Need to set number of buddies in group (as an option)
 Need to not hide empty groups (as an option)
 Need to do Buddy Pounces on a per-connection basis
-Need to report logins/outs to convo window
 Need to get the permit/deny stuff put back
 Need to have per-connection protocol options (e.g. which server to connect to for IRC)
-Need to get the ticker working again.
--- a/src/buddy.c	Sat Nov 04 11:05:17 2000 +0000
+++ b/src/buddy.c	Sat Nov 04 11:18:59 2000 +0000
@@ -1495,8 +1495,10 @@
 			gtk_widget_hide(bs->pix);
 			gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm);
 			gtk_widget_show(bs->pix);
-			if (ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER)
-				BuddyTickerSetPixmap(b->name, pm, bm);
+			if (ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER) {
+				BuddyTickerAddUser(b->name, pm, bm);
+				gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogonTimeout, b->name);
+			}
 			gdk_pixmap_unref(pm);
 			gdk_bitmap_unref(bm);
 			b->present = 2;
@@ -1505,6 +1507,16 @@
 			if (!g_slist_find(bs->connlist, gc))
 				bs->connlist = g_slist_append(bs->connlist, gc);
 			bs->log_timer = gtk_timeout_add(10000, (GtkFunction)log_timeout, bs);
+			if (display_options & OPT_DISP_SHOW_LOGON) {
+				struct conversation *c = find_conversation(b->name);
+				if (c) {
+					char tmp[1024];
+					g_snprintf(tmp, sizeof(tmp), _("<HR><B>%s logged in%s%s.</B><BR><HR>"), b->name,
+							((display_options & OPT_DISP_SHOW_TIME) ? " @ " : ""),
+							((display_options & OPT_DISP_SHOW_TIME) ? date() : ""));
+					write_to_conv(c, tmp, WFLAG_SYSTEM, NULL);
+				}
+			}
 		} else {
 			if (gc->prpl->list_icon)
 				xpm = (*gc->prpl->list_icon)(b->uc);
@@ -1534,10 +1546,22 @@
 		gtk_widget_hide(bs->pix);
 		gtk_pixmap_set(GTK_PIXMAP(bs->pix), pm, bm);
 		gtk_widget_show(bs->pix);
-		if (ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER)
+		if (ticker_prefs & OPT_DISP_SHOW_BUDDYTICKER) {
 			BuddyTickerSetPixmap(b->name, pm, bm);
+			gtk_timeout_add(10000, (GtkFunction)BuddyTickerLogoutTimeout, b->name);
+		}
 		gdk_pixmap_unref(pm);
 		gdk_bitmap_unref(bm);
+		if (display_options & OPT_DISP_SHOW_LOGON) {
+			struct conversation *c = find_conversation(b->name);
+			if (c) {
+				char tmp[1024];
+				g_snprintf(tmp, sizeof(tmp), _("<HR><B>%s logged out%s%s.</B><BR><HR>"), b->name,
+						((display_options & OPT_DISP_SHOW_TIME) ? " @ " : ""),
+						((display_options & OPT_DISP_SHOW_TIME) ? date() : ""));
+				write_to_conv(c, tmp, WFLAG_SYSTEM, NULL);
+			}
+		}
 	}
 }