diff options
author | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2009-12-04 13:21:05 -0200 |
---|---|---|
committer | Cosimo Alfarano <cosimo.alfarano@collabora.co.uk> | 2009-12-04 13:21:05 -0200 |
commit | 35c657537049f36e2d6fa445008a498dde4c8423 (patch) | |
tree | 584cc3e3550934c77691de2f0364d0b2cda1c5cc | |
parent | 295573e92177b1c5077359e000c8dae3718e8e51 (diff) | |
download | telepathy-logger-35c657537049f36e2d6fa445008a498dde4c8423.tar.gz |
First example of TplLogStore working (almost)
* it logs only sent messages
* it uses ~/.local/share/TpLogger/logs/ so it won't interfere with
Empathy's alrady existing logs
* probable problems with several functions in the logstore that still
referes to libempathy
-rw-r--r-- | include/.tpl_contact.h.swp | bin | 12288 -> 0 bytes | |||
-rwxr-xr-x | src/compile.sh | 2 | ||||
-rw-r--r-- | src/logstore/tags | 329 | ||||
-rw-r--r-- | src/logstore/tpl-log-store-empathy.c | 2 | ||||
-rw-r--r-- | src/tpl_headless_logger_init.c | 3 | ||||
-rw-r--r-- | src/tpl_text_channel_data.c | 29 |
6 files changed, 30 insertions, 335 deletions
diff --git a/include/.tpl_contact.h.swp b/include/.tpl_contact.h.swp Binary files differdeleted file mode 100644 index 02daa89..0000000 --- a/include/.tpl_contact.h.swp +++ /dev/null diff --git a/src/compile.sh b/src/compile.sh index 57d54fb..53062d2 100755 --- a/src/compile.sh +++ b/src/compile.sh @@ -1,6 +1,6 @@ #!/bin/bash -PACKAGE_NAME="TpHeadlessLogger" +PACKAGE_NAME="TpLogger" CC=${CC:-gcc} CCOPTS="-DPACKAGE_NAME=\"${PACKAGE_NAME}\" --std=c99 -g -I/usr/include/libempathy -I../include -Wall -Werror" # -pedantic" PKGS="telepathy-glib libempathy" diff --git a/src/logstore/tags b/src/logstore/tags deleted file mode 100644 index 8a7d349..0000000 --- a/src/logstore/tags +++ /dev/null @@ -1,329 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ -!_TAG_PROGRAM_NAME Exuberant Ctags // -!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ -!_TAG_PROGRAM_VERSION 5.8 // -CCOPTS ../Makefile /^CCOPTS="--std=c99 -g -I. -Wall -Werror `pkg-config --libs`" # -pedantic"$/;" m -CHANNEL_INTERFACE ../observer.py /^ CONNECTION_INTERFACE_ALIASING$/;" i -CHANNEL_INTERFACE_CHANNEL_TYPE ../observer.py /^CHANNEL_INTERFACE_CHANNEL_TYPE = CHANNEL_INTERFACE + '.ChannelType'$/;" v -CHANNEL_INTERFACE_MESSAGES ../observer.py /^ CONNECTION_INTERFACE_ALIASING$/;" i -CHANNEL_INTERFACE_TARGET_HANDLE ../observer.py /^CHANNEL_INTERFACE_TARGET_HANDLE = CHANNEL_INTERFACE + '.TargetHandle'$/;" v -CHANNEL_TYPE_TEXT ../observer.py /^from telepathy.server.channel import CHANNEL_TYPE_TEXT$/;" i -CLIENT ../observer.py /^ CONNECTION_INTERFACE_ALIASING$/;" i -CLIENT_OBSERVER ../observer.py /^ CONNECTION_INTERFACE_ALIASING$/;" i -CONNECTION ../observer.py /^ CONNECTION_INTERFACE_ALIASING$/;" i -CONNECTION_INTERFACE_ALIASING ../observer.py /^ CONNECTION_INTERFACE_ALIASING$/;" i -CONNECTION_INTERFACE_CONTACTS ../observer.py /^ CONNECTION_INTERFACE_ALIASING$/;" i -ClientObserver ../observer.py /^from telepathy._generated.Client_Observer import ClientObserver$/;" i -CouchDatabase ../observer.py /^from desktopcouch.records.server import CouchDatabase$/;" i -CouchdbLogger ../observer.py /^class CouchdbLogger(ClientObserver, DBusProperties):$/;" c -DBusGMainLoop ../observer.py /^from dbus.mainloop.glib import DBusGMainLoop$/;" i -DBusProperties ../observer.py /^from telepathy.server import DBusProperties$/;" i -DEBUG_FLAG empathy-log-manager.c 40;" d file: -DEBUG_FLAG empathy-log-store-empathy.c 43;" d file: -EMPATHY_IS_LOG_MANAGER empathy-log-manager.h 41;" d -EMPATHY_IS_LOG_MANAGER_CLASS empathy-log-manager.h 43;" d -EMPATHY_IS_LOG_STORE empathy-log-store.h 39;" d -EMPATHY_IS_LOG_STORE_EMPATHY empathy-log-store-empathy.h 40;" d -EMPATHY_IS_LOG_STORE_EMPATHY_CLASS empathy-log-store-empathy.h 42;" d -EMPATHY_LOG_MANAGER empathy-log-manager.h 35;" d -EMPATHY_LOG_MANAGER_CLASS empathy-log-manager.h 38;" d -EMPATHY_LOG_MANAGER_GET_CLASS empathy-log-manager.h 45;" d -EMPATHY_LOG_STORE empathy-log-store.h 36;" d -EMPATHY_LOG_STORE_EMPATHY empathy-log-store-empathy.h 34;" d -EMPATHY_LOG_STORE_EMPATHY_CLASS empathy-log-store-empathy.h 37;" d -EMPATHY_LOG_STORE_EMPATHY_GET_CLASS empathy-log-store-empathy.h 44;" d -EMPATHY_LOG_STORE_GET_INTERFACE empathy-log-store.h 41;" d -EMPATHY_TYPE_LOG_MANAGER empathy-log-manager.h 34;" d -EMPATHY_TYPE_LOG_STORE empathy-log-store.h 35;" d -EMPATHY_TYPE_LOG_STORE_EMPATHY empathy-log-store-empathy.h 32;" d -EmpathyLogManager empathy-log-manager.h /^typedef struct _EmpathyLogManager EmpathyLogManager;$/;" t typeref:struct:_EmpathyLogManager -EmpathyLogManagerClass empathy-log-manager.h /^typedef struct _EmpathyLogManagerClass EmpathyLogManagerClass;$/;" t typeref:struct:_EmpathyLogManagerClass -EmpathyLogManagerPriv empathy-log-manager.c /^} EmpathyLogManagerPriv;$/;" t typeref:struct:__anon1 file: -EmpathyLogMessageFilter empathy-log-manager.h /^typedef gboolean (*EmpathyLogMessageFilter) (EmpathyMessage *message,$/;" t -EmpathyLogSearchHit empathy-log-manager.h /^typedef struct _EmpathyLogSearchHit EmpathyLogSearchHit;$/;" t typeref:struct:_EmpathyLogSearchHit -EmpathyLogStore empathy-log-store.h /^typedef struct _EmpathyLogStore EmpathyLogStore; \/* dummy object *\/$/;" t typeref:struct:_EmpathyLogStore -EmpathyLogStoreEmpathy empathy-log-store-empathy.h /^typedef struct _EmpathyLogStoreEmpathy EmpathyLogStoreEmpathy;$/;" t typeref:struct:_EmpathyLogStoreEmpathy -EmpathyLogStoreEmpathyClass empathy-log-store-empathy.h /^typedef struct _EmpathyLogStoreEmpathyClass EmpathyLogStoreEmpathyClass;$/;" t typeref:struct:_EmpathyLogStoreEmpathyClass -EmpathyLogStoreInterface empathy-log-store.h /^typedef struct _EmpathyLogStoreInterface EmpathyLogStoreInterface;$/;" t typeref:struct:_EmpathyLogStoreInterface -GET_PRIV empathy-log-manager.c 43;" d file: -GET_PRIV empathy-log-store-empathy.c 61;" d file: -IMPLEMENT ../tpl_observer.c 253;" d file: -IMPLEMENT ../tpl_observer.c 256;" d file: -IS_TPL_OBSERVER ../tpl_observer.h 14;" d -IS_TPL_OBSERVER_CLASS ../tpl_observer.h 15;" d -InstantMessage ../observer.py /^class InstantMessage():$/;" c -InstantMessageStorage ../observer.py /^class InstantMessageStorage():$/;" c -LOG_DIR_CHATROOMS empathy-log-store-empathy.c 48;" d file: -LOG_DIR_CREATE_MODE empathy-log-store-empathy.c 46;" d file: -LOG_FILENAME_SUFFIX empathy-log-store-empathy.c 49;" d file: -LOG_FILE_CREATE_MODE empathy-log-store-empathy.c 47;" d file: -LOG_FOOTER empathy-log-store-empathy.c 57;" d file: -LOG_HEADER empathy-log-store-empathy.c 52;" d file: -LOG_TIME_FORMAT empathy-log-store-empathy.c 51;" d file: -LOG_TIME_FORMAT_FULL empathy-log-store-empathy.c 50;" d file: -MODULES ../Makefile /^MODULES="tpl_observer.c tpl_headless_logger_init.c tpl_text_channel.c test.c"$/;" m -ObserveChannels ../observer.py /^ observer_info):$/;" m class:CouchdbLogger -PKGS ../Makefile /^PKGS="telepathy-glib"$/;" m -PROP_0 ../tpl_observer.c /^ PROP_0,$/;" e enum:__anon9 file: -PROP_CHANNEL_FILTER ../tpl_observer.c /^ PROP_CHANNEL_FILTER$/;" e enum:__anon9 file: -PROP_INTERFACES ../tpl_observer.c /^ PROP_INTERFACES,$/;" e enum:__anon9 file: -RECORD_TYPE ../observer.py /^RECORD_TYPE = 'http:\/\/www.rtg.in.ua\/empathy-im-couchdb'$/;" v -Record ../observer.py /^from desktopcouch.records.record import Record $/;" i -TPL_CHANNEL ../tpl_channel_data.h 16;" d -TPL_CHANNEL_CLASS ../tpl_channel_data.h 17;" d -TPL_CHANNEL_GET_CLASS ../tpl_channel_data.h 20;" d -TPL_IS_CHANNEL ../tpl_channel_data.h 18;" d -TPL_IS_CHANNEL_CLASS ../tpl_channel_data.h 19;" d -TPL_IS_LOG_ENTRY ../tpl_log_entry_text.h 11;" d -TPL_IS_LOG_ENTRY_CLASS ../tpl_log_entry_text.h 12;" d -TPL_IS_TEXT_CHANNEL ../tpl_text_channel_data.h 19;" d -TPL_IS_TEXT_CHANNEL_CLASS ../tpl_text_channel_data.h 20;" d -TPL_LOG_ENTRY ../tpl_log_entry_text.h 9;" d -TPL_LOG_ENTRY_CLASS ../tpl_log_entry_text.h 10;" d -TPL_LOG_ENTRY_GET_CLASS ../tpl_log_entry_text.h 13;" d -TPL_LOG_ENTRY_TEXT_CHANNEL_ERROR ../tpl_log_entry_text.h /^ TPL_LOG_ENTRY_TEXT_CHANNEL_ERROR,$/;" e enum:__anon5 -TPL_LOG_ENTRY_TEXT_CHANNEL_IN ../tpl_log_entry_text.h /^ TPL_LOG_ENTRY_TEXT_CHANNEL_IN,$/;" e enum:__anon6 -TPL_LOG_ENTRY_TEXT_CHANNEL_LOSTMESSAGE ../tpl_log_entry_text.h /^ TPL_LOG_ENTRY_TEXT_CHANNEL_LOSTMESSAGE$/;" e enum:__anon5 -TPL_LOG_ENTRY_TEXT_CHANNEL_MESSAGE ../tpl_log_entry_text.h /^ TPL_LOG_ENTRY_TEXT_CHANNEL_MESSAGE, \/\/ IN or OUT$/;" e enum:__anon5 -TPL_LOG_ENTRY_TEXT_CHANNEL_OUT ../tpl_log_entry_text.h /^ TPL_LOG_ENTRY_TEXT_CHANNEL_OUT$/;" e enum:__anon6 -TPL_OBSERVER ../tpl_observer.h 12;" d -TPL_OBSERVER_CLASS ../tpl_observer.h 13;" d -TPL_OBSERVER_GET_CLASS ../tpl_observer.h 16;" d -TPL_OBSERVER_OBJECT_PATH ../tpl_observer.h 21;" d -TPL_OBSERVER_WELL_KNOWN_BUS_NAME ../tpl_observer.h 19;" d -TPL_SET_NULL ../tpl_channel_data.c 14;" d file: -TPL_SET_NULL ../tpl_channel_data.c 24;" d file: -TPL_SET_NULL ../tpl_log_entry_text.c 12;" d file: -TPL_SET_NULL ../tpl_log_entry_text.c 13;" d file: -TPL_SET_NULL ../tpl_text_channel_data.c 154;" d file: -TPL_SET_NULL ../tpl_text_channel_data.c 158;" d file: -TPL_TEXT_CHANNEL ../tpl_text_channel_data.h 17;" d -TPL_TEXT_CHANNEL_CLASS ../tpl_text_channel_data.h 18;" d -TPL_TEXT_CHANNEL_GET_CLASS ../tpl_text_channel_data.h 21;" d -TPL_TYPE_CHANNEL ../tpl_channel_data.h 15;" d -TPL_TYPE_LOG_ENTRY ../tpl_log_entry_text.h 8;" d -TPL_TYPE_TEXT_CHANNEL ../tpl_text_channel_data.h 16;" d -TP_CONTACT_CONTACTS_LEN ../tpl_text_channel_data.c 9;" d file: -TP_CONTACT_FEATURES_LEN ../tpl_text_channel_data.c 8;" d file: -TP_CONTACT_MYSELF ../tpl_text_channel_data.c 10;" d file: -TP_CONTACT_REMOTE ../tpl_text_channel_data.c 11;" d file: -TP_IFACE_CHAN_TEXT ../tpl_observer.h 7;" d -TYPE_TPL_OBSERVER ../tpl_observer.h 11;" d -TplChannel ../tpl_channel_data.h /^} TplChannel;$/;" t typeref:struct:__anon3 -TplChannelClass ../tpl_channel_data.h /^} TplChannelClass;$/;" t typeref:struct:__anon4 -TplLogEntryClass ../tpl_log_entry_text.h /^} TplLogEntryClass;$/;" t typeref:struct:__anon8 -TplLogEntryText ../tpl_log_entry_text.h /^} TplLogEntryText;$/;" t typeref:struct:__anon7 -TplLogEntryTextDirection ../tpl_log_entry_text.h /^} TplLogEntryTextDirection;$/;" t typeref:enum:__anon6 -TplLogEntryTextType ../tpl_log_entry_text.h /^} TplLogEntryTextType;$/;" t typeref:enum:__anon5 -TplLogStoreEmpathyPriv empathy-log-store-empathy.c /^} TplLogStoreEmpathyPriv;$/;" t typeref:struct:__anon2 file: -TplObserver ../tpl_observer.h /^typedef struct _TplObserver TplObserver;$/;" t typeref:struct:_TplObserver -TplObserverClass ../tpl_observer.h /^typedef struct _TplObserverClass TplObserverClass;$/;" t typeref:struct:_TplObserverClass -TplTextChannel ../tpl_text_channel_data.h /^} TplTextChannel;$/;" t typeref:struct:__anon10 -TplTextChannelClass ../tpl_text_channel_data.h /^} TplTextChannelClass;$/;" t typeref:struct:__anon11 -_EmpathyLogManager empathy-log-manager.h /^struct _EmpathyLogManager$/;" s -_EmpathyLogManagerClass empathy-log-manager.h /^struct _EmpathyLogManagerClass$/;" s -_EmpathyLogSearchHit empathy-log-manager.h /^struct _EmpathyLogSearchHit$/;" s -_EmpathyLogStoreEmpathy empathy-log-store-empathy.h /^struct _EmpathyLogStoreEmpathy$/;" s -_EmpathyLogStoreEmpathyClass empathy-log-store-empathy.h /^struct _EmpathyLogStoreEmpathyClass$/;" s -_EmpathyLogStoreInterface empathy-log-store.h /^struct _EmpathyLogStoreInterface$/;" s -_TplObserver ../tpl_observer.h /^struct _TplObserver$/;" s -_TplObserverClass ../tpl_observer.h /^struct _TplObserverClass$/;" s -__EMPATHY_LOG_MANAGER_H__ empathy-log-manager.h 25;" d -__EMPATHY_LOG_STORE_EMPATHY_H__ empathy-log-store-empathy.h 26;" d -__EMPATHY_LOG_STORE_H__ empathy-log-store.h 24;" d -__TPL_DATA_H__ ../tpl_channel_data.h 2;" d -__TPL_LOG_ENTRY_H__ ../tpl_log_entry_text.h 2;" d -__TPL_OBSERVER_H__ ../tpl_observer.h 2;" d -__TPL_TEXT_CHANNEL_H__ ../tpl_text_channel_data.h 2;" d -__TPL_UTILS_H__ ../tpl_utils.h 2;" d -__init__ ../observer.py /^ def __init__(self):$/;" m class:InstantMessage -__init__ ../observer.py /^ def __init__(self):$/;" m class:InstantMessageStorage -__init__ ../observer.py /^ def __init__(self, *args):$/;" m class:CouchdbLogger -_channel_on_received_signal_cb ../tpl_text_channel_data.c /^void _channel_on_received_signal_cb (TpChannel *proxy,$/;" f -_channel_on_sent_signal_cb ../tpl_text_channel_data.c /^void _channel_on_sent_signal_cb (TpChannel *proxy,$/;" f -_observe_channel_when_ready_cb ../tpl_observer.c /^void _observe_channel_when_ready_cb(TpChannel *channel,$/;" f -_ref_object_if_not_null ../tpl_utils.c /^void _ref_object_if_not_null(void* data) {$/;" f -_tp_connection_called_when_ready_cb ../tpl_observer.c /^void _tp_connection_called_when_ready_cb(TpConnection *connection,$/;" f -_tpl_text_channel_connect_signals ../tpl_text_channel_data.c /^void _tpl_text_channel_connect_signals(TplTextChannel* self) {$/;" f -_tpl_text_channel_set_ready_cb ../tpl_text_channel_data.c /^void _tpl_text_channel_set_ready_cb(TpConnection *connection,$/;" f -_unref_object_if_not_null ../tpl_utils.c /^void _unref_object_if_not_null(void* data) {$/;" f -account ../tpl_channel_data.h /^ TpAccount *account;$/;" m struct:__anon3 -account empathy-log-manager.h /^ TpAccount *account;$/;" m struct:_EmpathyLogSearchHit -account_manager empathy-log-store-empathy.c /^ TpAccountManager *account_manager;$/;" m struct:__anon2 file: -account_path ../tpl_channel_data.h /^ const gchar *account_path;$/;" m struct:__anon3 -ack_message empathy-log-store.h /^ void (*ack_message) (EmpathyLogStore *self, const gchar *chat_id,$/;" m struct:_EmpathyLogStoreInterface -add_message empathy-log-store.h /^ gboolean (*add_message) (EmpathyLogStore *self, const gchar *chat_id,$/;" m struct:_EmpathyLogStoreInterface -basedir empathy-log-store-empathy.c /^ gchar *basedir;$/;" m struct:__anon2 file: -channel ../tpl_channel_data.h /^ TpChannel *channel;$/;" m struct:__anon3 -channel_path ../tpl_channel_data.h /^ const gchar *channel_path;$/;" m struct:__anon3 -channel_properties ../tpl_channel_data.h /^ GHashTable *channel_properties;$/;" m struct:__anon3 -channel_type ../tpl_channel_data.h /^ const gchar *channel_type;$/;" m struct:__anon3 -chat_id empathy-log-manager.h /^ gchar *chat_id;$/;" m struct:_EmpathyLogSearchHit -client_interfaces ../tpl_observer.c /^static const char *client_interfaces[] = {$/;" v file: -connection ../tpl_channel_data.h /^ TpConnection *connection;$/;" m struct:__anon3 -connection_path ../tpl_channel_data.h /^ const gchar *connection_path;$/;" m struct:__anon3 -date empathy-log-manager.h /^ gchar *date;$/;" m struct:_EmpathyLogSearchHit -datetime ../observer.py /^from datetime import datetime$/;" i -dbus ../observer.py /^import dbus$/;" i -dbus_props_class ../tpl_observer.h /^ TpDBusPropertiesMixinClass dbus_props_class;$/;" m struct:_TplObserverClass -direction ../tpl_log_entry_text.h /^ TplLogEntryTextDirection direction;$/;" m struct:__anon7 -empathy_log_manager_add_message empathy-log-manager.c /^empathy_log_manager_add_message (EmpathyLogManager *manager,$/;" f -empathy_log_manager_class_init empathy-log-manager.c /^empathy_log_manager_class_init (EmpathyLogManagerClass *klass)$/;" f file: -empathy_log_manager_dup_singleton empathy-log-manager.c /^empathy_log_manager_dup_singleton (void)$/;" f -empathy_log_manager_exists empathy-log-manager.c /^empathy_log_manager_exists (EmpathyLogManager *manager,$/;" f -empathy_log_manager_get_chats empathy-log-manager.c /^empathy_log_manager_get_chats (EmpathyLogManager *manager,$/;" f -empathy_log_manager_get_date_readable empathy-log-manager.c /^empathy_log_manager_get_date_readable (const gchar *date)$/;" f -empathy_log_manager_get_dates empathy-log-manager.c /^empathy_log_manager_get_dates (EmpathyLogManager *manager,$/;" f -empathy_log_manager_get_filtered_messages empathy-log-manager.c /^empathy_log_manager_get_filtered_messages (EmpathyLogManager *manager,$/;" f -empathy_log_manager_get_messages_for_date empathy-log-manager.c /^empathy_log_manager_get_messages_for_date (EmpathyLogManager *manager,$/;" f -empathy_log_manager_init empathy-log-manager.c /^empathy_log_manager_init (EmpathyLogManager *manager)$/;" f file: -empathy_log_manager_observe empathy-log-manager.c /^empathy_log_manager_observe (EmpathyLogManager *log_manager,$/;" f -empathy_log_manager_search_free empathy-log-manager.c /^empathy_log_manager_search_free (GList *hits)$/;" f -empathy_log_manager_search_hit_free empathy-log-manager.c /^empathy_log_manager_search_hit_free (EmpathyLogSearchHit *hit)$/;" f -empathy_log_manager_search_new empathy-log-manager.c /^empathy_log_manager_search_new (EmpathyLogManager *manager,$/;" f -empathy_log_store_ack_message empathy-log-store.c /^empathy_log_store_ack_message (EmpathyLogStore *self,$/;" f -empathy_log_store_add_message empathy-log-store.c /^empathy_log_store_add_message (EmpathyLogStore *self,$/;" f -empathy_log_store_exists empathy-log-store.c /^empathy_log_store_exists (EmpathyLogStore *self,$/;" f -empathy_log_store_get_chats empathy-log-store.c /^empathy_log_store_get_chats (EmpathyLogStore *self,$/;" f -empathy_log_store_get_dates empathy-log-store.c /^empathy_log_store_get_dates (EmpathyLogStore *self,$/;" f -empathy_log_store_get_filtered_messages empathy-log-store.c /^empathy_log_store_get_filtered_messages (EmpathyLogStore *self,$/;" f -empathy_log_store_get_last_messages empathy-log-store.c /^empathy_log_store_get_last_messages (EmpathyLogStore *self,$/;" f -empathy_log_store_get_messages_for_date empathy-log-store.c /^empathy_log_store_get_messages_for_date (EmpathyLogStore *self,$/;" f -empathy_log_store_get_name empathy-log-store.c /^empathy_log_store_get_name (EmpathyLogStore *self)$/;" f -empathy_log_store_get_type empathy-log-store.c /^empathy_log_store_get_type (void)$/;" f -empathy_log_store_search_new empathy-log-store.c /^empathy_log_store_search_new (EmpathyLogStore *self,$/;" f -exists empathy-log-store.h /^ gboolean (*exists) (EmpathyLogStore *self, TpAccount *account,$/;" m struct:_EmpathyLogStoreInterface -features ../tpl_text_channel_data.c /^static TpContactFeature features[TP_CONTACT_FEATURES_LEN] = {$/;" v file: -filename empathy-log-manager.h /^ gchar *filename;$/;" m struct:_EmpathyLogSearchHit -from_id ../tpl_log_entry_text.h /^ const gchar *from_id, *receiver_id;$/;" m struct:__anon7 -get_chats empathy-log-store.h /^ GList * (*get_chats) (EmpathyLogStore *self,$/;" m struct:_EmpathyLogStoreInterface -get_dates empathy-log-store.h /^ GList * (*get_dates) (EmpathyLogStore *self, TpAccount *account,$/;" m struct:_EmpathyLogStoreInterface -get_filtered_messages empathy-log-store.h /^ GList * (*get_filtered_messages) (EmpathyLogStore *self, TpAccount *account,$/;" m struct:_EmpathyLogStoreInterface -get_last_messages empathy-log-store.h /^ GList * (*get_last_messages) (EmpathyLogStore *self, TpAccount *account,$/;" m struct:_EmpathyLogStoreInterface -get_messages_for_date empathy-log-store.h /^ GList * (*get_messages_for_date) (EmpathyLogStore *self,$/;" m struct:_EmpathyLogStoreInterface -get_name empathy-log-store.h /^ const gchar * (*get_name) (EmpathyLogStore *self);$/;" m struct:_EmpathyLogStoreInterface -gobject ../observer.py /^import gobject$/;" i -is_chatroom empathy-log-manager.h /^ gboolean is_chatroom;$/;" m struct:_EmpathyLogSearchHit -log_manager_chat_received_message_cb empathy-log-manager.c /^log_manager_chat_received_message_cb (EmpathyTpChat *tp_chat,$/;" f file: -log_manager_constructor empathy-log-manager.c /^log_manager_constructor (GType type,$/;" f file: -log_manager_dispatcher_observe_cb empathy-log-manager.c /^log_manager_dispatcher_observe_cb (EmpathyDispatcher *dispatcher,$/;" f file: -log_manager_finalize empathy-log-manager.c /^log_manager_finalize (GObject *object)$/;" f file: -log_manager_message_date_cmp empathy-log-manager.c /^log_manager_message_date_cmp (gconstpointer a,$/;" f file: -log_store_account_to_dirname empathy-log-store-empathy.c /^log_store_account_to_dirname (TpAccount *account)$/;" f file: -log_store_empathy_add_message empathy-log-store-empathy.c /^log_store_empathy_add_message (TplLogStore *self,$/;" f file: -log_store_empathy_exists empathy-log-store-empathy.c /^log_store_empathy_exists (TplLogStore *self,$/;" f file: -log_store_empathy_finalize empathy-log-store-empathy.c /^log_store_empathy_finalize (GObject *object)$/;" f file: -log_store_empathy_get_all_files empathy-log-store-empathy.c /^log_store_empathy_get_all_files (TplLogStore *self,$/;" f file: -log_store_empathy_get_chats empathy-log-store-empathy.c /^log_store_empathy_get_chats (TplLogStore *self,$/;" f file: -log_store_empathy_get_chats_for_dir empathy-log-store-empathy.c /^log_store_empathy_get_chats_for_dir (TplLogStore *self,$/;" f file: -log_store_empathy_get_dates empathy-log-store-empathy.c /^log_store_empathy_get_dates (TplLogStore *self,$/;" f file: -log_store_empathy_get_dir empathy-log-store-empathy.c /^log_store_empathy_get_dir (TplLogStore *self,$/;" f file: -log_store_empathy_get_filename empathy-log-store-empathy.c /^log_store_empathy_get_filename (TplLogStore *self,$/;" f file: -log_store_empathy_get_filename_for_date empathy-log-store-empathy.c /^log_store_empathy_get_filename_for_date (TplLogStore *self,$/;" f file: -log_store_empathy_get_filtered_messages empathy-log-store-empathy.c /^log_store_empathy_get_filtered_messages (TplLogStore *self,$/;" f file: -log_store_empathy_get_messages_for_date empathy-log-store-empathy.c /^log_store_empathy_get_messages_for_date (TplLogStore *self,$/;" f file: -log_store_empathy_get_messages_for_file empathy-log-store-empathy.c /^log_store_empathy_get_messages_for_file (TplLogStore *self,$/;" f file: -log_store_empathy_get_name empathy-log-store-empathy.c /^log_store_empathy_get_name (TplLogStore *self)$/;" f file: -log_store_empathy_get_timestamp_filename empathy-log-store-empathy.c /^log_store_empathy_get_timestamp_filename (void)$/;" f file: -log_store_empathy_get_timestamp_from_message empathy-log-store-empathy.c /^log_store_empathy_get_timestamp_from_message (TplLogEntry *message)$/;" f file: -log_store_empathy_search_hit_new empathy-log-store-empathy.c /^log_store_empathy_search_hit_new (TplLogStore *self,$/;" f file: -log_store_empathy_search_new empathy-log-store-empathy.c /^log_store_empathy_search_new (TplLogStore *self,$/;" f file: -log_store_iface_init empathy-log-store-empathy.c /^log_store_iface_init (gpointer g_iface,$/;" f file: -loop ../test.c /^static GMainLoop *loop = NULL;$/;" v file: -main ../observer.py /^def main():$/;" f -main ../test.c /^int main(int argc, char *argv[])$/;" f -manager_singleton empathy-log-manager.c /^static EmpathyLogManager * manager_singleton = NULL;$/;" v file: -message ../tpl_log_entry_text.h /^ const gchar *message;$/;" m struct:__anon7 -message_received_handler ../observer.py /^ def message_received_handler(self, message=None, path=None):$/;" m class:CouchdbLogger -message_sent_handler ../observer.py /^ message_token='', path=None):$/;" m class:CouchdbLogger -my_contact ../tpl_text_channel_data.h /^ TpContact *remote_contact, *my_contact;$/;" m struct:__anon10 -name empathy-log-store-empathy.c /^ gchar *name;$/;" m struct:__anon2 file: -observer ../tpl_channel_data.h /^ TpSvcClientObserver *observer;$/;" m struct:__anon3 -observer_iface_init ../tpl_observer.c /^observer_iface_init (gpointer g_iface, gpointer iface_data)$/;" f file: -parent ../tpl_channel_data.h /^ GObject parent;$/;" m struct:__anon3 -parent ../tpl_log_entry_text.h /^ GObject parent;$/;" m struct:__anon7 -parent ../tpl_observer.h /^ GObject parent;$/;" m struct:_TplObserver -parent ../tpl_text_channel_data.h /^ GObject parent;$/;" m struct:__anon10 -parent empathy-log-manager.h /^ GObject parent;$/;" m struct:_EmpathyLogManager -parent empathy-log-store-empathy.h /^ GObject parent;$/;" m struct:_EmpathyLogStoreEmpathy -parent empathy-log-store-empathy.h /^ GObjectClass parent;$/;" m struct:_EmpathyLogStoreEmpathyClass -parent empathy-log-store.h /^ GTypeInterface parent;$/;" m struct:_EmpathyLogStoreInterface -parent_class ../tpl_channel_data.h /^ GObjectClass parent_class;$/;" m struct:__anon4 -parent_class ../tpl_log_entry_text.h /^ GObjectClass parent_class;$/;" m struct:__anon8 -parent_class ../tpl_observer.h /^ GObjectClass parent_class;$/;" m struct:_TplObserverClass -parent_class ../tpl_text_channel_data.h /^ GObjectClass parent_class;$/;" m struct:__anon11 -parent_class empathy-log-manager.h /^ GObjectClass parent_class;$/;" m struct:_EmpathyLogManagerClass -priv empathy-log-manager.h /^ gpointer priv;$/;" m struct:_EmpathyLogManager -priv empathy-log-store-empathy.h /^ gpointer priv;$/;" m struct:_EmpathyLogStoreEmpathy -publish ../observer.py /^def publish():$/;" f -put ../observer.py /^ def put(self, message):$/;" m class:InstantMessageStorage -receiver_alias ../tpl_log_entry_text.h /^ const gchar *sender_alias, *receiver_alias;$/;" m struct:__anon7 -receiver_id ../tpl_log_entry_text.h /^ const gchar *from_id, *receiver_id;$/;" m struct:__anon7 -register_channel ../observer.py /^ def register_channel(self, account, connection, channel, props):$/;" m class:CouchdbLogger -remote_contact ../tpl_text_channel_data.h /^ TpContact *remote_contact, *my_contact;$/;" m struct:__anon10 -search_new empathy-log-store.h /^ GList * (*search_new) (EmpathyLogStore *self, const gchar *text);$/;" m struct:_EmpathyLogStoreInterface -sender_alias ../tpl_log_entry_text.h /^ const gchar *sender_alias, *receiver_alias;$/;" m struct:__anon7 -server ../observer.py /^import telepathy.server$/;" i -stores empathy-log-manager.c /^ GList *stores;$/;" m struct:__anon1 file: -telepathy ../observer.py /^import telepathy$/;" i -telepathy ../observer.py /^import telepathy.server$/;" i -tpl_channel ../tpl_log_entry_text.h /^ TplChannel *tpl_channel;$/;" m struct:__anon7 -tpl_channel ../tpl_text_channel_data.h /^ TplChannel *tpl_channel;$/;" m struct:__anon10 -tpl_channel_class_init ../tpl_channel_data.c /^static void tpl_channel_class_init(TplChannelClass* klass) {$/;" f file: -tpl_channel_free ../tpl_channel_data.c /^void tpl_channel_free(TplChannel* tpl_text) {$/;" f -tpl_channel_get_account ../tpl_channel_data.c /^TpAccount *tpl_channel_get_account(TplChannel *self) {$/;" f -tpl_channel_get_account_path ../tpl_channel_data.c /^const gchar *tpl_channel_get_account_path(TplChannel *self) {$/;" f -tpl_channel_get_channel ../tpl_channel_data.c /^TpChannel *tpl_channel_get_channel(TplChannel *self) {$/;" f -tpl_channel_get_channel_path ../tpl_channel_data.c /^const gchar *tpl_channel_get_channel_path(TplChannel *self) {$/;" f -tpl_channel_get_channel_properties ../tpl_channel_data.c /^GHashTable *tpl_channel_get_channel_properties(TplChannel *self) {$/;" f -tpl_channel_get_channel_type ../tpl_channel_data.c /^const gchar *tpl_channel_get_channel_type(TplChannel *self) {$/;" f -tpl_channel_get_connection ../tpl_channel_data.c /^TpConnection *tpl_channel_get_connection(TplChannel *self) {$/;" f -tpl_channel_get_connection_path ../tpl_channel_data.c /^const gchar *tpl_channel_get_connection_path(TplChannel *self) {$/;" f -tpl_channel_get_observer ../tpl_channel_data.c /^TpSvcClientObserver* tpl_channel_get_observer(TplChannel *self) {$/;" f -tpl_channel_init ../tpl_channel_data.c /^static void tpl_channel_init(TplChannel* self) {$/;" f file: -tpl_channel_new ../tpl_channel_data.c /^TplChannel* tpl_channel_new(TpSvcClientObserver* observer) {$/;" f -tpl_channel_set_account ../tpl_channel_data.c /^void tpl_channel_set_account(TplChannel *self, TpAccount *data) {$/;" f -tpl_channel_set_account_path ../tpl_channel_data.c /^void tpl_channel_set_account_path(TplChannel *self, const gchar *data) {$/;" f -tpl_channel_set_channel ../tpl_channel_data.c /^void tpl_channel_set_channel(TplChannel *self, TpChannel *data) {$/;" f -tpl_channel_set_channel_path ../tpl_channel_data.c /^void tpl_channel_set_channel_path(TplChannel *self, const gchar *data) {$/;" f -tpl_channel_set_channel_properties ../tpl_channel_data.c /^void tpl_channel_set_channel_properties(TplChannel *self, GHashTable *data) {$/;" f -tpl_channel_set_channel_type ../tpl_channel_data.c /^void tpl_channel_set_channel_type(TplChannel *self, const gchar *data) {$/;" f -tpl_channel_set_connection ../tpl_channel_data.c /^void tpl_channel_set_connection(TplChannel *self, TpConnection *data) {$/;" f -tpl_channel_set_connection_path ../tpl_channel_data.c /^void tpl_channel_set_connection_path(TplChannel *self, const gchar *data) {$/;" f -tpl_channel_set_observer ../tpl_channel_data.c /^void tpl_channel_set_observer(TplChannel *self,$/;" f -tpl_headless_logger_init ../tpl_headless_logger_init.c /^void tpl_headless_logger_init(void)$/;" f -tpl_log_entry_class_init ../tpl_log_entry_text.c /^static void tpl_log_entry_class_init(TplLogEntryClass* klass) {$/;" f file: -tpl_log_entry_init ../tpl_log_entry_text.c /^static void tpl_log_entry_init(TplLogEntry* self) {$/;" f file: -tpl_log_entry_new ../tpl_log_entry_text.c /^TplLogEntry *tpl_log_entry_new(void) {$/;" f -tpl_log_entry_text_get_direction ../tpl_log_entry_text.c /^TplLogEntryTextDirection tpl_log_entry_text_get_direction (TplLogEntry *self) {$/;" f -tpl_log_entry_text_get_message ../tpl_log_entry_text.c /^const gchar *tpl_log_entry_text_get_message (TplLogEntry *self) {$/;" f -tpl_log_entry_text_get_receiver ../tpl_log_entry_text.c /^TpContact *tpl_log_entry_text_get_receiver (TplLogEntry *self) {$/;" f -tpl_log_entry_text_get_sender ../tpl_log_entry_text.c /^TpContact *tpl_log_entry_text_get_sender (TplLogEntry *self) {$/;" f -tpl_log_entry_text_get_tpl_channel ../tpl_log_entry_text.c /^TplTextChannel *tpl_log_entry_text_get_tpl_channel(TplLogEntryText *self) {$/;" f -tpl_log_entry_text_get_type ../tpl_log_entry_text.c /^TplLogEntryTextType tpl_log_entry_text_get_type (TplLogEntry *self) {$/;" f -tpl_log_entry_text_set_direction ../tpl_log_entry_text.c /^void tpl_log_entry_text_set_direction (TplLogEntry *self, TplLogEntryTextDirection data) {$/;" f -tpl_log_entry_text_set_message ../tpl_log_entry_text.c /^void tpl_log_entry_text_set_message (TplLogEntry *self, const gchar *data) {$/;" f -tpl_log_entry_text_set_receiver ../tpl_log_entry_text.c /^void tpl_log_entry_text_set_receiver (TplLogEntry *self, TpContact *data) {$/;" f -tpl_log_entry_text_set_sender ../tpl_log_entry_text.c /^void tpl_log_entry_text_set_sender (TplLogEntry *self, TpContact *data) {$/;" f -tpl_log_entry_text_set_tpl_channel ../tpl_log_entry_text.c /^void tpl_log_entry_text_set_tpl_channel(TplLogEntryText *self, TplChannel *data) {$/;" f -tpl_log_entry_text_set_type ../tpl_log_entry_text.c /^void tpl_log_entry_text_set_type (TplLogEntry *self, TplLogEntryTextType data) {$/;" f -tpl_log_store_empathy_class_init empathy-log-store-empathy.c /^tpl_log_store_empathy_class_init (TplLogStoreEmpathyClass *klass)$/;" f file: -tpl_log_store_empathy_init empathy-log-store-empathy.c /^tpl_log_store_empathy_init (TplLogStoreEmpathy *self)$/;" f file: -tpl_observer_class_init ../tpl_observer.c /^tpl_observer_class_init (TplObserverClass *klass)$/;" f file: -tpl_observer_get_property ../tpl_observer.c /^tpl_observer_get_property (GObject *self,$/;" f file: -tpl_observer_init ../tpl_observer.c /^tpl_observer_init (TplObserver *self)$/;" f file: -tpl_observer_new ../tpl_observer.c /^TplObserver *tpl_observer_new (void)$/;" f -tpl_observer_observe_channels ../tpl_observer.c /^tpl_observer_observe_channels (TpSvcClientObserver *self,$/;" f file: -tpl_text_channel_class_init ../tpl_text_channel_data.c /^static void tpl_text_channel_class_init(TplTextChannelClass* klass) {$/;" f file: -tpl_text_channel_free ../tpl_text_channel_data.c /^void tpl_text_channel_free(TplTextChannel* tpl_text) {$/;" f -tpl_text_channel_get_my_contact ../tpl_text_channel_data.c /^TpContact *tpl_text_channel_get_my_contact(TplTextChannel *self)$/;" f -tpl_text_channel_get_remote_contact ../tpl_text_channel_data.c /^TpContact *tpl_text_channel_get_remote_contact(TplTextChannel *self)$/;" f -tpl_text_channel_get_tpl_channel ../tpl_text_channel_data.c /^TplChannel *tpl_text_channel_get_tpl_channel(TplTextChannel *self) {$/;" f -tpl_text_channel_init ../tpl_text_channel_data.c /^static void tpl_text_channel_init(TplTextChannel* self) {$/;" f file: -tpl_text_channel_new ../tpl_text_channel_data.c /^TplTextChannel* tpl_text_channel_new(TplChannel* tpl_channel)$/;" f -tpl_text_channel_set_my_contact ../tpl_text_channel_data.c /^void tpl_text_channel_set_my_contact(TplTextChannel *self, TpContact *data)$/;" f -tpl_text_channel_set_remote_contact ../tpl_text_channel_data.c /^void tpl_text_channel_set_remote_contact(TplTextChannel *self, TpContact *data)$/;" f -tpl_text_channel_set_tpl_channel ../tpl_text_channel_data.c /^void tpl_text_channel_set_tpl_channel(TplTextChannel *self, TplChannel *data) {$/;" f -type ../tpl_log_entry_text.h /^ TplLogEntryTextType type; $/;" m struct:__anon7 diff --git a/src/logstore/tpl-log-store-empathy.c b/src/logstore/tpl-log-store-empathy.c index 07f5a34..0409cfb 100644 --- a/src/logstore/tpl-log-store-empathy.c +++ b/src/logstore/tpl-log-store-empathy.c @@ -110,7 +110,7 @@ tpl_log_store_empathy_init (TplLogStoreEmpathy *self) priv->basedir = g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (), PACKAGE_NAME, "logs", NULL); - priv->name = g_strdup ("Empathy"); + priv->name = g_strdup ("TpLogger"); priv->account_manager = tp_account_manager_dup (); } diff --git a/src/tpl_headless_logger_init.c b/src/tpl_headless_logger_init.c index a54b94b..a7b630d 100644 --- a/src/tpl_headless_logger_init.c +++ b/src/tpl_headless_logger_init.c @@ -17,7 +17,6 @@ void tpl_headless_logger_init(void) DBusGConnection *bus; TpDBusDaemon *tp_bus; GError *error = NULL; - TplLogStoreEmpathy *logstore; bus = tp_get_bus(); tp_bus = tp_dbus_daemon_new(bus); @@ -31,11 +30,9 @@ void tpl_headless_logger_init(void) g_error_free(error); } - logstore = g_object_new(TPL_TYPE_LOG_STORE_EMPATHY, NULL); observer = tpl_observer_new (); dbus_g_connection_register_g_object (bus, TPL_OBSERVER_OBJECT_PATH, G_OBJECT(observer)); - observer->logstore = logstore; } diff --git a/src/tpl_text_channel_data.c b/src/tpl_text_channel_data.c index 5c3bee3..de5e922 100644 --- a/src/tpl_text_channel_data.c +++ b/src/tpl_text_channel_data.c @@ -1,5 +1,7 @@ #include <telepathy-glib/contact.h> +#include <tpl-log-store.h> +#include <tpl-log-store-empathy.h> #include <tpl_observer.h> #include <tpl_channel_data.h> #include <tpl_text_channel_data.h> @@ -45,6 +47,7 @@ void _channel_on_sent_signal_cb (TpChannel *proxy, gpointer user_data, GObject *weak_object) { + GError *error=NULL; TplTextChannel *tpl_text = TPL_TEXT_CHANNEL(user_data); TpContact *remote,*me; const gchar *my_id, *my_alias, *remote_id, *remote_alias; @@ -53,6 +56,7 @@ void _channel_on_sent_signal_cb (TpChannel *proxy, TplContact *tpl_contact_sender; TplContact *tpl_contact_receiver; TplLogEntryText *log; + TplLogStoreEmpathy *logstore; me = tpl_text_channel_get_my_contact(tpl_text); @@ -78,6 +82,7 @@ void _channel_on_sent_signal_cb (TpChannel *proxy, CONTACT_ENTRY_SET(identifier, my_id); CONTACT_ENTRY_SET(presence_status, my_pres_status); CONTACT_ENTRY_SET(presence_message, my_pres_msg ); + CONTACT_ENTRY_SET(contact_type, TPL_CONTACT_USER); #undef CONTACT_ENTRY_SET #define CONTACT_ENTRY_SET(x,y) tpl_contact_set_##x(tpl_contact_receiver,y) CONTACT_ENTRY_SET(contact, remote); @@ -85,6 +90,7 @@ void _channel_on_sent_signal_cb (TpChannel *proxy, CONTACT_ENTRY_SET(identifier, remote_id); CONTACT_ENTRY_SET(presence_status, remote_pres_status ); CONTACT_ENTRY_SET(presence_message, remote_pres_msg); + CONTACT_ENTRY_SET(contact_type, TPL_CONTACT_USER); #undef CONTACT_ENTRY_SET g_message("%s (%s): %s\n", @@ -100,7 +106,28 @@ void _channel_on_sent_signal_cb (TpChannel *proxy, tpl_log_entry_text_set_receiver(log, tpl_contact_receiver); tpl_log_entry_text_set_message(log, arg_Text); tpl_log_entry_text_set_message_type(log, arg_Type); - tpl_log_entry_text_set_signal_type(log, TPL_LOG_ENTRY_TEXT_CHANNEL_MESSAGE); + tpl_log_entry_text_set_signal_type(log, + TPL_LOG_ENTRY_TEXT_CHANNEL_MESSAGE); + tpl_log_entry_text_set_timestamp(log, (time_t) arg_Timestamp); + tpl_log_entry_text_set_id(log, 123); + + + logstore = g_object_new(TPL_TYPE_LOG_STORE_EMPATHY, NULL); + if (!TPL_LOG_STORE_GET_INTERFACE(logstore)->add_message) { + g_warning("LOGSTORE IFACE: add message not implemented\n"); + return; + } + + tpl_log_store_add_message( TPL_LOG_STORE(logstore), + tpl_contact_get_identifier(tpl_contact_sender), + FALSE, + log, + &error); + if(error!=NULL) { + g_error("LOGSTORE: %s", error->message); + g_clear_error(&error); + g_error_free(error); + } } |