--- a/irssi/Makefile.am Tue May 20 06:06:17 2008 -0400
+++ b/irssi/Makefile.am Mon Jun 09 00:27:46 2008 -0400
@@ -1,5 +1,6 @@
--- a/irssi/datechange.c Tue May 20 06:06:17 2008 -0400
+++ b/irssi/datechange.c Mon Jun 09 00:27:46 2008 -0400
@@ -27,7 +27,7 @@
/******************************************************************************
@@ -85,8 +85,8 @@
purple_conversation_write(conv, NULL, message,
PURPLE_MESSAGE_NO_LOG | PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_ACTIVE_ONLY,
- if ((irssi_datechange_get_day(&t) == 1) &&
- (irssi_datechange_get_month(&t) == 0))
+ if ((irssi_datechange_get_day(&t) == 1) && (irssi_datechange_get_month(&t) == 0) && + purple_prefs_get_bool(SENDNEWYEAR_PREF)) const gchar *new_year = _("Happy New Year");
if(conv->type == PURPLE_CONV_TYPE_IM)
@@ -110,20 +110,22 @@
irssi_datechange_init(PurplePlugin *plugin) {
- if(irssi_datechange_timeout_id != 0)
- purple_timeout_remove(irssi_datechange_timeout_id);
+ if(purple_prefs_get_bool(DATECHANGE_PREF)) { + if(irssi_datechange_timeout_id != 0) + purple_timeout_remove(irssi_datechange_timeout_id);
- lastday = irssi_datechange_get_day(&t);
+ lastday = irssi_datechange_get_day(&t); - /* set this to get called every 30 seconds.
- * Yes we only care about a day change, but i'd rather get it in the first
- * 30 seconds of the change rather than nearly a min later.
- irssi_datechange_timeout_id = g_timeout_add(30000,
- irssi_datechange_timeout_cb,
+ /* set this to get called every 30 seconds. + * Yes we only care about a day change, but i'd rather get it in the first + * 30 seconds of the change rather than nearly a min later. + irssi_datechange_timeout_id = g_timeout_add(30000, + irssi_datechange_timeout_cb, --- a/irssi/irssi.c Tue May 20 06:06:17 2008 -0400
+++ b/irssi/irssi.c Mon Jun 09 00:27:46 2008 -0400
@@ -23,22 +23,11 @@
/* If you can't figure out what this line is for, DON'T TOUCH IT. */
#include "../common/pp_internal.h"
-/* define these so the plugin info struct way at the bottom is cleaner */
-#define PLUGIN_ID "gtk-plugin_pack-irssi"
-#define PLUGIN_STATIC_NAME "irssi"
-#define PLUGIN_AUTHOR "\n" \
- "\tGary Kramlich <grim@reaperworld.com>\n" \
- "\tJohn Bailey <rekkanoryo@rekkanoryo.org>\n" \
- "\tSadrul Habib Chowdhury <sadrul@users.sourceforge.net>"
+/* Local plugin headers */ irssi_load(PurplePlugin *plugin) {
@@ -62,6 +51,38 @@
+static PurplePluginPrefFrame * +irssi_pref_frame(PurplePlugin *plugin) { + PurplePluginPrefFrame *frame; + PurplePluginPref *pref; + frame = purple_plugin_pref_frame_new(); + pref = purple_plugin_pref_new_with_label(_("Enable Features:")); + purple_plugin_pref_frame_add(frame, pref); + pref = purple_plugin_pref_new_with_name_and_label(TEXTFMT_PREF, _("Text Formatting")); + purple_plugin_pref_frame_add(frame, pref); + pref = purple_plugin_pref_new_with_name_and_label(DATECHANGE_PREF, _("Date Change Notification")); + purple_plugin_pref_frame_add(frame, pref); + pref = purple_plugin_pref_new_with_name_and_label(SENDNEWYEAR_PREF, _("Happy New Year Message")); + purple_plugin_pref_frame_add(frame, pref); +static PurplePluginUiInfo irssi_prefs_info = { static PurplePluginInfo irssi_info = { /* this tells Purple about the plugin */
PURPLE_PLUGIN_MAGIC, /* Magic */
PURPLE_MAJOR_VERSION, /* Purple Major Version */
@@ -86,7 +107,7 @@
+ &irssi_prefs_info, /* prefs_info */ @@ -113,6 +134,12 @@
"irssi to be used in Purple. It lets you know in all open "
"conversations when the day has changed, adds the lastlog command, "
"adds the window command, etc. The day changed message is not logged.");
+ purple_prefs_add_none(PREFS_ROOT_PARENT); + purple_prefs_add_none(PREFS_ROOT); + purple_prefs_add_bool(TEXTFMT_PREF, TRUE); + purple_prefs_add_bool(DATECHANGE_PREF, TRUE); + purple_prefs_add_bool(SENDNEWYEAR_PREF, TRUE); PURPLE_INIT_PLUGIN(PLUGIN_STATIC_NAME, irssi_init, irssi_info)