pidgin/purple-plugin-pack

Add marv's DeWYSIWYGification plugin, ported to libpurple
org.guifications.plugins
2007-10-20, nosnilmot
4e4ea4b77402
Parents 663108442de4
Children 54bc97cc78bc
Add marv's DeWYSIWYGification plugin, ported to libpurple
--- a/ChangeLog Sat Oct 20 16:03:50 2007 -0400
+++ b/ChangeLog Sat Oct 20 17:11:08 2007 -0400
@@ -24,6 +24,7 @@
* Fixed building with ancient glib. (Bodo Bellut)
* Removed the .build file from hideconv to remove it from default
builds. Pidgin will have persistent conversations soon.
+ * Added dewysiwygification plugin
Version 2.1.1: 8/19/07
* Fixed lack of .build, .pidgin-plugin, and Makefile.mingw for convbadger
--- a/configure.ac Sat Oct 20 16:03:50 2007 -0400
+++ b/configure.ac Sat Oct 20 17:11:08 2007 -0400
@@ -309,6 +309,7 @@
buddytime/Makefile
chronic/Makefile
convbadger/Makefile
+ dewysiwygification/Makefile
dice/Makefile
difftopic/Makefile
eight_ball/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dewysiwygification/Makefile.am Sat Oct 20 17:11:08 2007 -0400
@@ -0,0 +1,26 @@
+EXTRA_DIST = .purple-plugin .build Makefile.mingw
+
+dewysiwygificationdir = $(PURPLE_LIBDIR)
+
+dewysiwygification_la_LDFLAGS = -module -avoid-version
+
+if HAVE_PURPLE
+
+dewysiwygification_LTLIBRARIES = dewysiwygification.la
+
+dewysiwygification_la_SOURCES = \
+ dewysiwygification.c
+
+dewysiwygification_la_LIBADD = \
+ $(GLIB_LIBS) \
+ $(PURPLE_LIBS)
+
+endif
+
+AM_CPPFLAGS = \
+ -DLIBDIR=\"$(PURPLE_LIBDIR)\" \
+ -DDATADIR=\"$(PURPLE_DATADIR)\" \
+ -DPIXMAPSDIR=\"$(PURPLE_PIXMAPSDIR)\" \
+ $(DEBUG_CFLAGS) \
+ $(PURPLE_CFLAGS)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dewysiwygification/dewysiwygification.c Sat Oct 20 17:11:08 2007 -0400
@@ -0,0 +1,117 @@
+/*
+ * DeWYSIWYGification - Lets you type in HTML without it being escaped to entities.
+ * Copyright (C) 2004 Tim Ringenbach <omarvo@hotmail.com>
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA.
+ */
+
+#include "../common/pp_internal.h"
+
+#include <debug.h>
+#include <plugin.h>
+#include <signals.h>
+#include <util.h>
+#include <version.h>
+
+#include <stdio.h>
+#include <string.h>
+#ifndef _WIN32
+#include <strings.h>
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#define DEWYSIWYGIFICATION_PLUGIN_ID "dewysiwygification"
+
+
+static gboolean
+substitute_words_send_im(PurpleAccount *account, const char *receiver,
+ char **message)
+{
+ char *tmp;
+
+ if (message == NULL || *message == NULL)
+ return FALSE;
+
+ tmp = purple_unescape_html(*message);
+ g_free(*message);
+ *message = tmp;
+
+ purple_debug_misc("dewysiwygification", "it's now: %s", tmp);
+
+ return FALSE;
+}
+
+static gboolean
+substitute_words_send_chat(PurpleAccount *account, char **message, int id)
+{
+ char *tmp;
+
+ if (message == NULL || *message == NULL)
+ return FALSE;
+
+ tmp = purple_unescape_html(*message);
+ g_free(*message);
+ *message = tmp;
+
+ purple_debug_misc("dewysiwygification", "it's now: %s", tmp);
+
+ return FALSE;
+}
+
+static gboolean
+plugin_load(PurplePlugin *plugin)
+{
+ void *conv_handle = purple_conversations_get_handle();
+
+
+ purple_signal_connect(conv_handle, "sending-im-msg",
+ plugin, PURPLE_CALLBACK(substitute_words_send_im), NULL);
+ purple_signal_connect(conv_handle, "sending-chat-msg",
+ plugin, PURPLE_CALLBACK(substitute_words_send_chat), NULL);
+
+ return TRUE;
+}
+
+static PurplePluginInfo info =
+{
+ PURPLE_PLUGIN_MAGIC,
+ PURPLE_MAJOR_VERSION,
+ PURPLE_MINOR_VERSION,
+ PURPLE_PLUGIN_STANDARD,
+ NULL,
+ 0,
+ NULL,
+ PURPLE_PRIORITY_DEFAULT,
+ DEWYSIWYGIFICATION_PLUGIN_ID,
+ N_("DeWYSIWYGification Plugin"),
+ VERSION,
+ N_("Lets you type in HTML without it being escaped to entities."),
+ N_("Lets you type in HTML without it being escaped to entities. This will not work well for some protocols. Use \"&lt;\" for a literal \"<\"."),
+ "Tim Ringenbach <omarvo@hotmail.com>",
+ PP_WEBSITE,
+ plugin_load,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+static void
+init_plugin(PurplePlugin *plugin)
+{
+}
+
+PURPLE_INIT_PLUGIN(dewysiwygification, init_plugin, info)