org.guifications.plugins.enhancedhistory: fec5a89700da07e11306cab382e8853853534b6f

rekkanoryo at guifications.org rekkanoryo at guifications.org
Sun Nov 11 18:25:05 CST 2007


-----------------------------------------------------------------
Revision: fec5a89700da07e11306cab382e8853853534b6f
Ancestor: e3e9a2dd0db7f425bd429a20fc15624d51e62b43
Author: rekkanoryo at guifications.org
Date: 2007-11-12T00:21:28
Branch: org.guifications.plugins.enhancedhistory

Renamed entries:
        enhancedhist/enhanced_history.c to enhancedhist/enhanced_hist.c
Added files:
        enhancedhist/.build enhancedhist/.pidgin-plugin
        enhancedhist/Makefile.am
Modified files:
        configure.ac enhancedhist/enhanced_hist.c

ChangeLog: 

Some work on this plugin merge.  More to come.

-----------------------------------------------------------------
This revision's diffstat output:
 configure.ac                 |    1 
 enhancedhist/Makefile.am     |   29 +++
 enhancedhist/enhanced_hist.c |  355 +++++++++++++++++--------------------------
 3 files changed, 175 insertions(+), 210 deletions(-)
-------------- next part --------------
============================================================
--- enhancedhist/.build	da39a3ee5e6b4b0d3255bfef95601890afd80709
+++ enhancedhist/.build	da39a3ee5e6b4b0d3255bfef95601890afd80709
============================================================
--- enhancedhist/.pidgin-plugin	da39a3ee5e6b4b0d3255bfef95601890afd80709
+++ enhancedhist/.pidgin-plugin	da39a3ee5e6b4b0d3255bfef95601890afd80709
============================================================
--- enhancedhist/Makefile.am	c7c32524d39b866ece3282dc5c38137e7fa235d5
+++ enhancedhist/Makefile.am	c7c32524d39b866ece3282dc5c38137e7fa235d5
@@ -0,0 +1,29 @@
+EXTRA_DIST = \
+	.build \
+	.pidgin-plugin \
+	Makefile.mingw
+
+enhanced_histdir = $(PIDGIN_LIBDIR)
+
+enhanced_hist_la_LDFLAGS = -module -avoid-version
+
+if HAVE_PIDGIN
+
+enhanced_hist_LTLIBRARIES = enhanced_hist.la
+
+enhanced_hist_la_LIBADD = \
+	$(PIDGIN_LIBS) \
+	$(GLIB_LIBS)
+
+enhanced_hist_la_SOURCES = enhanced_hist.c
+
+endif
+
+AM_CPPFLAGS = \
+	-DLIBDIR=\"$(PIDGIN_LIBDIR)\" \
+	-DDATADIR=\"$(PIDGIN_DATADIR)\" \
+	$(DEBUG_CFLAGS) \
+	$(PIDGIN_CFLAGS) \
+	$(GTK_CFLAGS) \
+	$(GLIB_CFLAGS)
+
============================================================
--- configure.ac	b1d9c77798e8f6551bb6dc3662903e9ae9e6cc33
+++ configure.ac	4a83eaa2e0d1eff56a7dfe3e3454f3ef7fca8bc2
@@ -313,6 +313,7 @@ AC_OUTPUT([
 	dice/Makefile
 	difftopic/Makefile
 	eight_ball/Makefile
+	enhancedhist/Makefile
 	findip/Makefile
 	flip/Makefile
 	groupmsg/Makefile
============================================================
--- enhancedhist/enhanced_history.c	2b11b4c3fbee747a1ea04b6dfe6959cf32b9c87f
+++ enhancedhist/enhanced_hist.c	c1738b81dad947d27a5536557c6aeea2a37df327
@@ -1,5 +1,5 @@
 /*
- * Release Notification Plugin
+ * enhanced_hist.c - Enhanced History Plugin for libpurple
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -12,52 +12,10 @@
  * General Public License for more details.
  */
 
- /* DESCRIPTION: Puts log of past conversations in the user's IM window
- * Allows the user to select the number of conversations to display from
- * gaim plugin preferences.
+/* SUMMARY: Puts log of past conversations in the user's IM window and
+ * allows the user to select the number of conversations to display from
+ * purple plugin preferences.
  *
- * Created: 02/11/2005
- * Last Updated: 05/07/2007
- *
- * Change Log
- *     1.2:
- *          Made a version that compiles with pidgin 2.0.0 
- *     1.1:
- *     	   Apparently local times weren't neccesarily being converted to UTC before
- *     	   being compared to the log time in linux.
- *     1.0:
- *         Fixed time limitations. Changed the way the conversation timestamp/header
- *         is printed (copied how its done from the history.c that comes with gaim).
- *     0.9:
- *         Changed the plugin preference paths so they aren't stomping on the plugin
- *         example anymore. Large overhaul on how the program is coded. 
- *         Making use of iterators rather than manual loop conditions.
- *         
- *          Added the ability to specify the age of the logs viewed. 
- *          i.e. if the user selects (30 mins and 1 hour), Only logs dated less than 90 mins
- *          from the current system time will be shown. The smaller of the two constraints
- *          (# of chats / time constraints) will determine the number of logs shown.
- *     0.8:
- *         Changed the way dates of conversations are displayed.
- *         Removed the need for the user to select the loggin mode.
- *     0.7:
- *         Changed the names of the conversation type constants to work with gaim 2.0
- *     0.6:
- *         Added the option to display inline dates from the log files.
- *         Fixed a memory leak. Commented the code significantly more.
- *     0.5:
- *         Added the option to disable log display for IMs and chats independently.
- *     0.4:
- *         The data size limitation was pretty much worthless, so I removed that.
- *         I changed the Options flag for how the IM html prints, so that it has colors.
- *     0.3:
- *         Added weak implementation to limit the chats based on data size.
- *     0.2:
- *         Added GUI/preferences window for gaim.
- *     0.1:
- *         Initial revision, allows static number of past conversations
- *         to be displayed. (Only changed by recompiling yourself).
- *
  * Author: 
  *         Andrew Pangborn  - gaim at andrewpangborn.com
  *
@@ -65,25 +23,7 @@
  *         Ankit Singla
  */
 
-#include "gaim-compat.h"
-#include "gtkgaim-compat.h"
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifndef GAIM_PLUGINS
-# define GAIM_PLUGINS
-#endif
-
-#ifndef GAIM_WEBSITE
-#define GAIM_WEBSITE PURPLE_WEBSITE
-#endif
-
-#include "prpl.h"
-#include "internal.h"
-#include "pidgin.h"
-
 #include "conversation.h"
 #include "debug.h"
 #include "log.h"
@@ -100,15 +40,15 @@
 
 #define HISTORY_PLUGIN_ID "gtk-enhanced-history"
 
-#define NUM_OF_CHATS (gaim_prefs_get_int("/plugins/core/enhanced_history/int"))
-#define NUM_MINS (gaim_prefs_get_int("/plugins/core/enhanced_history/mins"))
-#define NUM_HOURS (gaim_prefs_get_int("/plugins/core/enhanced_history/hours"))
-#define NUM_DAYS (gaim_prefs_get_int("/plugins/core/enhanced_history/days"))
-#define	PREF_DATE (gaim_prefs_get_string("/plugins/core/enhanced_history/string_date"))
-#define	PREF_IM (gaim_prefs_get_string("/plugins/core/enhanced_history/string_im"))
-#define PREF_CHAT (gaim_prefs_get_string("/plugins/core/enhanced_history/string_chat"))
+#define NUM_OF_CHATS (purple_prefs_get_int("/plugins/core/enhanced_history/int"))
+#define NUM_MINS (purple_prefs_get_int("/plugins/core/enhanced_history/mins"))
+#define NUM_HOURS (purple_prefs_get_int("/plugins/core/enhanced_history/hours"))
+#define NUM_DAYS (purple_prefs_get_int("/plugins/core/enhanced_history/days"))
+#define	PREF_DATE (purple_prefs_get_string("/plugins/core/enhanced_history/string_date"))
+#define	PREF_IM (purple_prefs_get_string("/plugins/core/enhanced_history/string_im"))
+#define PREF_CHAT (purple_prefs_get_string("/plugins/core/enhanced_history/string_chat"))
 
-GaimPluginPref *ppref;
+PurplePluginPref *ppref;
 
 static gboolean _scroll_imhtml_to_end(gpointer data)
 {
@@ -118,37 +58,37 @@ static gboolean _scroll_imhtml_to_end(gp
 	return FALSE;
 }
 
-static void historize(GaimConversation *c)
+static void historize(PurpleConversation *c)
 {
-	GaimAccount *account = gaim_conversation_get_account(c);
-	const char *name = gaim_conversation_get_name(c);
-	GaimConversationType convtype;
+	PurpleAccount *account = purple_conversation_get_account(c);
+	PurpleConversationType convtype;
+	PidginConversation *gtkconv = NULL;
+	GtkIMHtmlOptions options;
 	GList *logs = NULL;
-	const char *alias = name;
-	GaimGtkConversation *gtkconv;
+	GSList *buddies = NULL;
+	const char *name = NULL, *alias = NULL, *LOG_MODE = NULL;
+	char *header, *protocol, *history;
 	guint flags;
-	GtkIMHtmlOptions options;
-	char *header;
-	char *protocol;
-	char* history;
 	int size = 0;
 	int counter;
-	const char *LOG_MODE = gaim_prefs_get_string("/purple/logging/format");
-	GSList *buddies;
-	
 
-	// If logging isn't enabled, don't show any history
-	if(!gaim_prefs_get_bool("/purple/logging/log_ims") && !gaim_prefs_get_bool("/purple/logging/log_chats")) {
+	account = purple_conversation_get_account(c);
+	name = purple_conversation_get_name(c);
+	alias = name;
+	LOG_MODE = purple_prefs_get_string("/purple/logging/format");
+
+	/* If logging isn't enabled, don't show any history */
+	if(!purple_prefs_get_bool("/purple/logging/log_ims") &&
+			!purple_prefs_get_bool("/purple/logging/log_chats"))
 		return;
-	}
 	
 	/* If the user wants to show 0 logs, stop now */
 	if(NUM_OF_CHATS == 0) {
 		return;
 	}
 	
-	// If the logging mode is html, set the output options to include no newline.
-	// Otherwise, it's normal text, so we don't need extra lines
+	/* If the logging mode is html, set the output options to include no newline.
+	 * Otherwise, it's normal text, so we don't need extra lines */
 	if(strcasecmp(LOG_MODE,"html")==0) {
 		options = GTK_IMHTML_NO_NEWLINE;
 	} else {
@@ -156,31 +96,31 @@ static void historize(GaimConversation *
 	}
 	
 	/* Find buddies for this conversation. */
-	buddies = gaim_find_buddies(account, name);
+	buddies = purple_find_buddies(account, name);
 
 	/* If we found at least one buddy, save the first buddy's alias. */
 	if (buddies != NULL)
-		alias = gaim_buddy_get_contact_alias((GaimBuddy *)buddies->data);
+		alias = purple_buddy_get_contact_alias((PurpleBuddy *)buddies->data);
 
-	/* Determine whether this is an IM or a chat. In either case, if the user has that particular log type
-	    disabled, the logs file doesnt not get specified */
-	convtype = gaim_conversation_get_type(c);
-	if (convtype == GAIM_CONV_TYPE_IM && !strcmp(PREF_IM,"yes")) {
-		logs = gaim_log_get_logs(GAIM_LOG_IM,
-				gaim_conversation_get_name(c), gaim_conversation_get_account(c));
-		logs = gaim_log_get_logs(GAIM_LOG_IM,
-				gaim_conversation_get_name(c), gaim_conversation_get_account(c));
-	} else if (convtype == GAIM_CONV_TYPE_CHAT && !strcmp(PREF_CHAT,"yes")) {
-		logs = gaim_log_get_logs(GAIM_LOG_CHAT,
-			gaim_conversation_get_name(c), gaim_conversation_get_account(c));
+	/* Determine whether this is an IM or a chat. In either case, if the user has that
+	 * particular log type disabled, the logs file doesnt not get specified */
+	convtype = purple_conversation_get_type(c);
+	if (convtype == PURPLE_CONV_TYPE_IM && !strcmp(PREF_IM,"yes")) {
+		logs = purple_log_get_logs(PURPLE_LOG_IM,
+				purple_conversation_get_name(c), purple_conversation_get_account(c));
+		logs = purple_log_get_logs(PURPLE_LOG_IM,
+				purple_conversation_get_name(c), purple_conversation_get_account(c));
+	} else if (convtype == PURPLE_CONV_TYPE_CHAT && !strcmp(PREF_CHAT,"yes")) {
+		logs = purple_log_get_logs(PURPLE_LOG_CHAT,
+			purple_conversation_get_name(c), purple_conversation_get_account(c));
 	}
 
-	// The logs are non-existant or the user has disabled this type for log displaying.
+	/* The logs are non-existant or the user has disabled this type for log displaying. */
 	if (!logs) {
 		return;
 	}
 
-	gtkconv = GAIM_GTK_CONVERSATION(c);
+	gtkconv = PURPLE_GTK_CONVERSATION(c);
 
 	size = g_list_length(logs);
 	
@@ -189,8 +129,8 @@ static void historize(GaimConversation *
 		size=NUM_OF_CHATS;
 	}
 
-	// No idea wth this does, it was in the original history plugin
-	if (flags & GAIM_LOG_READ_NO_NEWLINE) {
+	/* No idea wth this does, it was in the original history plugin */
+	if (flags & PURPLE_LOG_READ_NO_NEWLINE) {
 		options |= GTK_IMHTML_NO_NEWLINE;
 	}
 
@@ -213,8 +153,8 @@ static void historize(GaimConversation *
 		local_tm = gmtime(&t);
 		t = mktime(local_tm);
 		
-		/* Pull the local time from the gaim log, convert it to UTC time */
-		log_tm = gmtime(&((GaimLog*)logs->data)->time);
+		/* Pull the local time from the purple log, convert it to UTC time */
+		log_tm = gmtime(&((PurpleLog*)logs->data)->time);
 		log_time = mktime(log_tm);
 		printf("Local Time as int: %d \n",(int)t);
 		printf("Log Time as int: %d \n",(int) mktime(log_tm));
@@ -226,10 +166,11 @@ static void historize(GaimConversation *
 		if(diff_time > limit_time) {
 			return;
 		}
-		//Iterate to the end of the list, stop while messages are under limit, we just want a count here
+		/* Iterate to the end of the list, stop while messages are under limit, we just
+		 * want a count here */
 		while( logs->next && diff_time <= limit_time && counter < (NUM_OF_CHATS-1)) {
 			logs = logs->next;
-			log_tm = gmtime(&((GaimLog*)logs->data)->time);
+			log_tm = gmtime(&((PurpleLog*)logs->data)->time);
 			log_time = mktime(log_tm);
 			diff_time = difftime( t, log_time );
 			counter++;
@@ -245,7 +186,7 @@ static void historize(GaimConversation *
 	/* Loop through the logs and print them to the window */
 	while(logs) {
 		protocol = g_strdup(gtk_imhtml_get_protocol_name(GTK_IMHTML(gtkconv->imhtml)));
-		gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml),gaim_account_get_protocol_name(((GaimLog*)logs->data)->account));
+		gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->imhtml),purple_account_get_protocol_name(((PurpleLog*)logs->data)->account));
 		
 		if (gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtkconv->imhtml)))) {
 			gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), "<BR>", options);
@@ -253,7 +194,7 @@ static void historize(GaimConversation *
 
 		/* Print a header at the beginning of the log */
 		header = g_strdup_printf(_("<b>Conversation with %s on %s:</b><br>"), alias,
-							 gaim_date_format_full(localtime(&((GaimLog *)logs->data)->time)));
+							 purple_date_format_full(localtime(&((PurpleLog *)logs->data)->time)));
 		
 		if(strcmp(PREF_DATE,"yes")==0) {
 			gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), header, options);
@@ -261,7 +202,7 @@ static void historize(GaimConversation *
 		g_free(header);
 
 		/* Copy the log string into the history array */
-		history = gaim_log_read((GaimLog*)logs->data, &flags);		
+		history = purple_log_read((PurpleLog*)logs->data, &flags);		
 		
 		gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), history, options);
 		g_free(history);
@@ -276,144 +217,138 @@ static void historize(GaimConversation *
 	g_object_ref(G_OBJECT(gtkconv->imhtml));
 	g_idle_add(_scroll_imhtml_to_end, gtkconv->imhtml);
 	
-	// Clear the allocated memory that the logs are using
-	g_list_foreach(logs,(GFunc)gaim_log_free, NULL);
+	/* Clear the allocated memory that the logs are using */
+	g_list_foreach(logs,(GFunc)purple_log_free, NULL);
 	g_list_free(logs);
 	
 }
 
 static gboolean
-plugin_load(GaimPlugin *plugin)
+plugin_load(PurplePlugin *plugin)
 {
-	gaim_signal_connect(gaim_conversations_get_handle(),
+	purple_signal_connect(purple_conversations_get_handle(),
 						"conversation-created",
-						plugin, GAIM_CALLBACK(historize), NULL);
+						plugin, PURPLE_CALLBACK(historize), NULL);
 
 	return TRUE;
 }
 
-static GaimPluginPrefFrame *
-get_plugin_pref_frame(GaimPlugin *plugin) {
-	GaimPluginPrefFrame *frame;
+static PurplePluginPrefFrame *
+get_plugin_pref_frame(PurplePlugin *plugin) {
+	PurplePluginPrefFrame *frame;
 
-	frame = gaim_plugin_pref_frame_new();
+	frame = purple_plugin_pref_frame_new();
 
-	//Label for the number of chats
-	ppref = gaim_plugin_pref_new_with_label("# Of Previous Conversations to Display");
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Label for the number of chats */
+	ppref = purple_plugin_pref_new_with_label("# Of Previous Conversations to Display");
+	purple_plugin_pref_frame_add(frame, ppref);
 
-	//Integer input-box for number of chats
-	ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/int","# of Chats:");
-	gaim_plugin_pref_set_bounds(ppref, 0, 255);
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/*Integer input-box for number of chats */
+	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/int","# of Chats:");
+	purple_plugin_pref_set_bounds(ppref, 0, 255);
+	purple_plugin_pref_frame_add(frame, ppref);
 
-	//Label for the date option
-	ppref = gaim_plugin_pref_new_with_label("Would you like the date of the log displayed in-line with the text?");
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Label for the date option */
+	ppref = purple_plugin_pref_new_with_label("Would you like the date of the log displayed in-line with the text?");
+	purple_plugin_pref_frame_add(frame, ppref);
 	
-	//Drop-down selection for Date insertion
-	ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/string_date","Dates:");
-		    gaim_plugin_pref_set_type(ppref, GAIM_PLUGIN_PREF_CHOICE);
-		    gaim_plugin_pref_add_choice(ppref, "yes", "yes");
-		    gaim_plugin_pref_add_choice(ppref, "no", "no");
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Drop-down selection for Date insertion */
+	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/string_date","Dates:");
+    purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
+    purple_plugin_pref_add_choice(ppref, "yes", "yes");
+    purple_plugin_pref_add_choice(ppref, "no", "no");
+	purple_plugin_pref_frame_add(frame, ppref);
 	
-	//Label for the log display
-	ppref = gaim_plugin_pref_new_with_label("For which conversation types would you like to display the log?");
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Label for the log display */
+	ppref = purple_plugin_pref_new_with_label("For which conversation types would you like to display the log?");
+	purple_plugin_pref_frame_add(frame, ppref);
 
-	//Drop-down selection for IM Log displaying
-	ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/string_im","Instant Messages:");
-		    gaim_plugin_pref_set_type(ppref, GAIM_PLUGIN_PREF_CHOICE);
-		    gaim_plugin_pref_add_choice(ppref, "yes", "yes");
-		    gaim_plugin_pref_add_choice(ppref, "no", "no");
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Drop-down selection for IM Log displaying */
+	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/string_im","Instant Messages:");
+    purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
+    purple_plugin_pref_add_choice(ppref, "yes", "yes");
+    purple_plugin_pref_add_choice(ppref, "no", "no");
+	purple_plugin_pref_frame_add(frame, ppref);
 
-	//Drop-down selection for Chat Log displaying
-	ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/string_chat","Chat Rooms / IRC:");
-		    gaim_plugin_pref_set_type(ppref, GAIM_PLUGIN_PREF_CHOICE);
-		    gaim_plugin_pref_add_choice(ppref, "yes", "yes");
-		    gaim_plugin_pref_add_choice(ppref, "no", "no");
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Drop-down selection for Chat Log displaying */
+	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/string_chat","Chat Rooms / IRC:");
+    purple_plugin_pref_set_type(ppref, PURPLE_PLUGIN_PREF_CHOICE);
+    purple_plugin_pref_add_choice(ppref, "yes", "yes");
+    purple_plugin_pref_add_choice(ppref, "no", "no");
+	purple_plugin_pref_frame_add(frame, ppref);
 	
-	//Label for maximum log age option
-	ppref = gaim_plugin_pref_new_with_label("Maximum age for logs view (0 for no limit):");
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Label for maximum log age option */
+	ppref = purple_plugin_pref_new_with_label("Maximum age for logs view (0 for no limit):");
+	purple_plugin_pref_frame_add(frame, ppref);
 	
-	//Input for minutes
-	ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/mins","# Mins:");
-	gaim_plugin_pref_set_bounds(ppref, 0, 60);
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Input for minutes */
+	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/mins","# Mins:");
+	purple_plugin_pref_set_bounds(ppref, 0, 60);
+	purple_plugin_pref_frame_add(frame, ppref);
 
-	//Input for hours
-	ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/hours","# Hours:");
-	gaim_plugin_pref_set_bounds(ppref, 0, 24);
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Input for hours */
+	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/hours","# Hours:");
+	purple_plugin_pref_set_bounds(ppref, 0, 24);
+	purple_plugin_pref_frame_add(frame, ppref);
 		
-	//Input for days
-	ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/days","# Days:");
-	gaim_plugin_pref_set_bounds(ppref, 0, 255);
-	gaim_plugin_pref_frame_add(frame, ppref);
+	/* Input for days */
+	ppref = purple_plugin_pref_new_with_name_and_label("/plugins/core/enhanced_history/days","# Days:");
+	purple_plugin_pref_set_bounds(ppref, 0, 255);
+	purple_plugin_pref_frame_add(frame, ppref);
 
 	
 	return frame;
 }
 
-static GaimPluginUiInfo prefs_info = {
+static PurplePluginUiInfo prefs_info = {
 	get_plugin_pref_frame
 };
 
 
-static GaimPluginInfo info =
+static PurplePluginInfo info =
 {
-	GAIM_PLUGIN_MAGIC,
-	GAIM_MAJOR_VERSION,
-	GAIM_MINOR_VERSION,
-	GAIM_PLUGIN_STANDARD,                             /**< type           */
-	NULL,                                             /**< ui_requirement */
-	0,                                                /**< flags          */
-	NULL,                                             /**< dependencies   */
-	GAIM_PRIORITY_DEFAULT,                            /**< priority       */
+	PURPLE_PLUGIN_MAGIC,
+	PURPLE_MAJOR_VERSION,
+	PURPLE_MINOR_VERSION,
+	PURPLE_PLUGIN_STANDARD,
+	NULL,
+	0,
+	NULL,
+	PURPLE_PRIORITY_DEFAULT,
 
-	"core-enhanced_history",                     /**< id             */
-	"Enhanced_History",                           /**< name           */
-	VERSION,                                          /**< version        */
-	                                                  /**  summary        */
+	"gtk-plugin_pack-enhanced_history",
+	"Enhanced History",
+	VERSION,
 	"An enhanced version of the history plugin.",
-	                                                  /**  description    */
 	"An enhanced versoin of the history plugin. Grants ability to select the number of previous conversations to show instead of just one.",
-	"Andrew Pangborn <gaim at andrewpangborn.com>",      /**< author         */
-	GAIM_WEBSITE,                                     /**< homepage       */
-
-	plugin_load,                                             /**< load           */
-	NULL,                                             /**< unload         */
-	NULL,                                             /**< destroy        */
-
-	NULL,                                             /**< ui_info        */
-	NULL,                                             /**< extra_info     */
-	&prefs_info,                                      /**< prefs_info     */
+	"Andrew Pangborn <gaim at andrewpangborn.com>",
+	PURPLE_WEBSITE,
+	plugin_load,
+	NULL,
+	NULL, 
+	NULL,
+	NULL,
+	&prefs_info,
+	NULL,
+	NULL,
+	NULL,
+	NULL,
 	NULL
 };
 
 static void
-init_plugin(GaimPlugin *plugin)
+init_plugin(PurplePlugin *plugin)
 {
-	gaim_prefs_add_none("/plugins/core/enhanced_history");
-	gaim_prefs_add_int("/plugins/core/enhanced_history/int", 3);
-	gaim_prefs_add_int("/plugins/core/enhanced_history/int2",5);
-	gaim_prefs_add_int("/plugins/core/enhanced_history/mins",0);
-	gaim_prefs_add_int("/plugins/core/enhanced_history/hours",0);
-	gaim_prefs_add_int("/plugins/core/enhanced_history/days",0);
-	gaim_prefs_add_string("/plugins/core/enhanced_history/string_date","yes");
-	gaim_prefs_add_string("/plugins/core/enhanced_history/string_im","yes");
-	gaim_prefs_add_string("/plugins/core/enhanced_history/string_chat","yes");
+	purple_prefs_add_none("/plugins/core/enhanced_history");
+	purple_prefs_add_int("/plugins/core/enhanced_history/int", 3);
+	purple_prefs_add_int("/plugins/core/enhanced_history/mins",0);
+	purple_prefs_add_int("/plugins/core/enhanced_history/hours",0);
+	purple_prefs_add_int("/plugins/core/enhanced_history/days",0);
+	purple_prefs_add_string("/plugins/core/enhanced_history/string_date","yes");
+	purple_prefs_add_string("/plugins/core/enhanced_history/string_im","yes");
+	purple_prefs_add_string("/plugins/core/enhanced_history/string_chat","yes");
 
 }
 
-GAIM_INIT_PLUGIN(enhanced_history, init_plugin, info)
+PURPLE_INIT_PLUGIN(enhanced_history, init_plugin, info)
 
-
-
-
-
-


More information about the Plugins-commits mailing list