summaryrefslogtreecommitdiff
path: root/telepathy-logger/log-store-empathy.c
blob: 651c721929f6517b08daf5737d9c111dfd8cc9fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * Copyright ©2013 Collabora Ltd.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */

/*
 * This is a subclass of TplLogStoreXml to read logs from the directory Empathy
 * used to store them it. It disables writing to that legacy location.
 */

#include "config.h"
#include "log-store-empathy-internal.h"

#include "telepathy-logger/log-store-internal.h"

static void log_store_iface_init (gpointer g_iface, gpointer iface_data);

G_DEFINE_TYPE_WITH_CODE (TplLogStoreEmpathy, _tpl_log_store_empathy,
    TPL_TYPE_LOG_STORE_XML,
    G_IMPLEMENT_INTERFACE (TPL_TYPE_LOG_STORE, log_store_iface_init))

static void
_tpl_log_store_empathy_init (TplLogStoreEmpathy *self)
{
}

static void
_tpl_log_store_empathy_class_init (TplLogStoreEmpathyClass *klass)
{
}


static const gchar *
log_store_empathy_get_name (TplLogStore *store)
{
  TplLogStoreXml *self = (TplLogStoreXml *) store;

  g_return_val_if_fail (TPL_IS_LOG_STORE_EMPATHY (self), NULL);

  return "Empathy";
}

static void
log_store_iface_init (gpointer g_iface,
    gpointer iface_data)
{
  TplLogStoreInterface *iface = (TplLogStoreInterface *) g_iface;

  iface->get_name = log_store_empathy_get_name;

  /* We don't want to store new logs in Empathy's directory, just read the old
   * ones. */
  iface->add_event = NULL;
}