/soc/2015/igor.gajowiak/chatlog: bb41b42e8b9a: Added an export i...

Igor Gajowiak igor.gajowiak at gmail.com
Sun Aug 2 17:46:26 EDT 2015


Changeset: bb41b42e8b9ad3cd2197301673347a5c02487b10
Author:	 Igor Gajowiak <igor.gajowiak at gmail.com>
Date:	 2015-08-02 23:46 +0200
Branch:	 default
URL: https://hg.pidgin.im/soc/2015/igor.gajowiak/chatlog/rev/bb41b42e8b9a

Description:

Added an export interface to the generic log.

diffstat:

 libpurple/genericlog.c |   3 +++
 libpurple/genericlog.h |  21 ++++++++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletions(-)

diffs (54 lines):

diff --git a/libpurple/genericlog.c b/libpurple/genericlog.c
--- a/libpurple/genericlog.c
+++ b/libpurple/genericlog.c
@@ -382,6 +382,9 @@ purple_genericlog_class_init(PurpleGener
 	klass->get_all_buddies = NULL;
 	klass->get_all_days = NULL;
 	klass->wipe_log_for_buddy = NULL;
+	klass->init_export = NULL;
+	klass->read_chunk = NULL;
+	klass->finalize_export = NULL;
 
 	klass->reserved1 = NULL;
 	klass->reserved2 = NULL;
diff --git a/libpurple/genericlog.h b/libpurple/genericlog.h
--- a/libpurple/genericlog.h
+++ b/libpurple/genericlog.h
@@ -85,10 +85,22 @@ struct _PurpleGenericLog
  * @wipe_log_for_buddy: Deletes all messages sent to or received from
  *                      a given buddy. Returns %TRUE if operation succeeds,
  *                      %FALSE otherwise.
+ * @init_export:     Initializes an export procedure. Plugins should store their
+ *                   export state in an output parameter. The state will be used
+ *                   for future calls to export_chunk. Returns %TRUE if
+ *                   operation succeeds, %FALSE otherwise.
+ * @export_chunk:    Reads chunk_size messages and stores them and their
+ *                   respective accounts in the given #GArray objects. Plugins
+ *                   can ignore chunk_size parameter but it might affect
+ *                   UI responsiveness. Returning no messages means end of
+ *                   export. Returns %TRUE if operation succeeds,
+ *                   %FALSE otherwise.
+ * @finalize_export: Finalizes an export procedure. Returns %TRUE if operation
+ *                   succeeds, %FALSE otherwise.
  *
  * The abstract base class for all log implementations. A conforming plugin
  * must implement at least activate and deactivate methods. Not supported
- * operations must be set to %NULL.
+ * operations are by default set to %NULL.
  */
 struct _PurpleGenericLogClass
 {
@@ -116,6 +128,13 @@ struct _PurpleGenericLogClass
 
 	gboolean (*wipe_log_for_buddy)(PurpleBuddy *buddy);
 
+	gboolean (*init_export) (void **export_state);
+
+	gboolean (*read_chunk) (void *export_state, guint chunk_size,
+		GArray *accounts, GArray *messages);
+
+	gboolean (*finalize_export) (void *export_state);
+
 	void (*reserved1)(void);
 	void (*reserved2)(void);
 	void (*reserved3)(void);



More information about the Commits mailing list