Permalink
Browse files

added Message Overview plugin: view all message activity in a single …

…buffer.
  • Loading branch information...
1 parent bdcb67f commit 670198a5d590f033c1d3a872b7965a599c5e8d31 @cooper cooper committed Apr 9, 2012
Showing with 4,037 additions and 1 deletion.
  1. +3,949 −0 src/fe-gtk/xtext.c.1
  2. +1 −1 src/plugins/Makefile
  3. +13 −0 src/plugins/message-overview/Makefile
  4. +74 −0 src/plugins/message-overview/message-overview.c
View
@@ -1,5 +1,5 @@
include ../../buildsys.mk
include ../../extra.mk
-SUBDIRS = autoaway country exec helloworld highlight-notify identify-msg presence timer ${PYTHON}
+SUBDIRS = autoaway country exec helloworld highlight-notify identify-msg message-overview presence timer ${PYTHON}
@@ -0,0 +1,13 @@
+include ../../../extra.mk
+
+PLUGIN = message-overview${PLUGIN_SUFFIX}
+SRCS = message-overview.c
+
+include ../../../buildsys.mk
+
+plugindir := ${plugindir}/plugins
+
+CFLAGS += ${PLUGIN_CFLAGS}
+CPPFLAGS += -I../../.. -I../.. -I../../common $(COMMON_CFLAGS) $(GUI_CFLAGS) -DLOCALEDIR=\"$(localedir)\" -DSHAREDIR=\"$(prefix)/share\"
+LIBS += $(COMMON_LIBS) $(GUI_LIBS)
+
@@ -0,0 +1,74 @@
+/* GChat
+ * Copyright (C) 2012 Mitchell Cooper
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <glib.h>
+
+#include "common/plugin.h"
+#include "common/xchat.h"
+#include "common/xchatc.h"
+#include "common/signal_factory.h"
+#include "common/text.h"
+
+static void
+process_message(gpointer *params)
+{
+ session *sess = params[0];
+ gchar *from = params[1];
+ gchar *message = params[2];
+ gchar *nickchar = params[3];
+ gchar *idtext = params[4];
+ gint nickcolor = color_of(from);
+ gint chancolor = color_of(sess->channel);
+ gchar *temp = g_strdup_printf("\x03%d%s\x03 \2(\2\x03%d%s\x03\2)\2", nickcolor, from, chancolor, sess->channel);
+ gchar *nick;
+
+ if (prefs.colorednicks)
+ {
+ nick = g_strdup(temp);
+ g_free(temp);
+ }
+ else
+ {
+ nick = g_strdup(from);
+ }
+
+ session_print_format(main_sess, "channel message", nick, nickchar, idtext, message);
+ g_free(nick);
+}
+
+gboolean
+init(Plugin *p)
+{
+ signal_attach("action public", process_message);
+ signal_attach("message public", process_message);
+
+ return TRUE;
+}
+
+gboolean
+fini(Plugin *p)
+{
+ signal_disconnect("action public", process_message);
+ signal_disconnect("message public", process_message);
+
+ return TRUE;
+}
+
+PLUGIN_DECLARE("Message Overview", PACKAGE_VERSION,
+ "Allows you to view all message activity in a single buffer.",
+ "Mitchell Cooper", init, fini);

0 comments on commit 670198a

Please sign in to comment.