changeset 191:948100a8cb23

[gaim-migrate @ 201] Wrote a plugin for IcedSoal to put an asterisk in the titlebar of conversations where you haven't replied to the person yet (e.g. you weren't the last person to say something). committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 27 Apr 2000 12:14:16 +0000
parents 3a8809beb5ce
children e9ca9146ebf1
files plugins/Makefile.am plugins/notify.c
diffstat 2 files changed, 52 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/Makefile.am	Thu Apr 27 08:16:15 2000 +0000
+++ b/plugins/Makefile.am	Thu Apr 27 12:14:16 2000 +0000
@@ -10,4 +10,4 @@
 plugin_DATA = autorecon.so iconaway.so spellchk.so
 plugindir = $(libdir)/gaim
 EXTRA_DIST = CRAZY HOWTO SIGNALS autorecon.c chkmail.c filectl.c gaiminc.c \
-	iconaway.c simple.c spellchk.c toc_commands.c
+	iconaway.c notify.c simple.c spellchk.c toc_commands.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/notify.c	Thu Apr 27 12:14:16 2000 +0000
@@ -0,0 +1,51 @@
+#define GAIM_PLUGINS
+#include "gaim.h"
+
+#include <gtk/gtk.h>
+
+void *handle;
+
+void received_im(char **who, char **what, void *m) {
+	char buf[256];
+	struct conversation *cnv = find_conversation(*who);
+	GtkWindow *win;
+
+	if (cnv == NULL)
+		cnv = new_conversation(*who);
+
+	win = (GtkWindow *)cnv->window;
+
+	g_snprintf(buf, sizeof(buf), "%s", win->title);
+	if (!strstr(buf, "(*) ")) {
+		g_snprintf(buf, sizeof(buf), "(*) %s", win->title);
+		gtk_window_set_title(win, buf);
+	}
+}
+
+void sent_im(char *who, char **what, void *m) {
+	char buf[256];
+	struct conversation *c = find_conversation(who);
+	GtkWindow *win = (GtkWindow *)c->window;
+
+	g_snprintf(buf, sizeof(buf), "%s", win->title);
+	if (strstr(buf, "(*) ")) {
+		g_snprintf(buf, sizeof(buf), "%s", &win->title[4]);
+		gtk_window_set_title(win, buf);
+	}
+}
+
+void gaim_plugin_init(void *hndl) {
+	handle = hndl;
+
+	gaim_signal_connect(handle, event_im_recv, received_im, NULL);
+	gaim_signal_connect(handle, event_im_send, sent_im, NULL);
+}
+
+char *name() {
+	return "Visual Notification";
+}
+
+char *description() {
+	return "Puts an asterisk in the title bar of all conversations"
+		" where you have not responded to a message yet.";
+}