diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-07-14 14:23:57 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-08-11 11:24:57 +0200 |
commit | b483f64c57c77a14542bae8b54e688efb282dd3b (patch) | |
tree | c39b478588cf447b44951c86dbf85c1262247332 | |
parent | b5c75d1427067d7eef7301d208a7d496b64ee2b8 (diff) | |
download | telepathy-logger-b483f64c57c77a14542bae8b54e688efb282dd3b.tar.gz |
add tpl_log_manager_search_hit_new
-rw-r--r-- | telepathy-logger/log-manager-internal.h | 6 | ||||
-rw-r--r-- | telepathy-logger/log-manager.c | 26 |
2 files changed, 32 insertions, 0 deletions
diff --git a/telepathy-logger/log-manager-internal.h b/telepathy-logger/log-manager-internal.h index 1eb2fd5..6072f6f 100644 --- a/telepathy-logger/log-manager-internal.h +++ b/telepathy-logger/log-manager-internal.h @@ -84,6 +84,12 @@ void _tpl_log_manager_search_in_identifier_chats_new_async ( GAsyncReadyCallback callback, gpointer user_data); +TplLogSearchHit * _tpl_log_manager_search_hit_new (TpAccount *account, + const gchar *chat_id, + gboolean is_chatroom, + const gchar *filename, + GDate *date); + void _tpl_log_manager_search_hit_free (TplLogSearchHit *hit); gint _tpl_log_manager_search_hit_compare (TplLogSearchHit *a, diff --git a/telepathy-logger/log-manager.c b/telepathy-logger/log-manager.c index 6416167..ca18e41 100644 --- a/telepathy-logger/log-manager.c +++ b/telepathy-logger/log-manager.c @@ -739,6 +739,32 @@ _tpl_log_manager_search (TplLogManager *manager, return out; } +TplLogSearchHit * +_tpl_log_manager_search_hit_new (TpAccount *account, + const gchar *chat_id, + gboolean is_chatroom, + const gchar *filename, + GDate *date) +{ + TplLogSearchHit *hit = g_slice_new0 (TplLogSearchHit); + + g_assert (chat_id != NULL); + + if (account != NULL) + hit->account = g_object_ref (account); + + hit->chat_id = g_strdup (chat_id); + hit->is_chatroom = is_chatroom; + + if (filename != NULL) + hit->filename = g_strdup (filename); + + if (date != NULL) + hit->date = g_date_new_dmy (g_date_get_day (date), g_date_get_month (date), + g_date_get_year (date)); + + return hit; +} void _tpl_log_manager_search_hit_free (TplLogSearchHit *hit) |