aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-log-store-empathy.c1
-rw-r--r--libempathy/empathy-message.c36
-rw-r--r--libempathy/empathy-message.h3
3 files changed, 40 insertions, 0 deletions
diff --git a/libempathy/empathy-log-store-empathy.c b/libempathy/empathy-log-store-empathy.c
index 7e50cb12f..b73c7218c 100644
--- a/libempathy/empathy-log-store-empathy.c
+++ b/libempathy/empathy-log-store-empathy.c
@@ -497,6 +497,7 @@ log_store_empathy_get_messages_for_file (EmpathyLogStore *self,
empathy_message_set_sender (message, sender);
empathy_message_set_timestamp (message, t);
empathy_message_set_tptype (message, msg_type);
+ empathy_message_set_is_backlog (message, TRUE);
if (cm_id_str)
empathy_message_set_id (message, cm_id);
diff --git a/libempathy/empathy-message.c b/libempathy/empathy-message.c
index d020b72e4..41b44bfb3 100644
--- a/libempathy/empathy-message.c
+++ b/libempathy/empathy-message.c
@@ -39,6 +39,7 @@ typedef struct {
EmpathyContact *receiver;
gchar *body;
time_t timestamp;
+ gboolean is_backlog;
guint id;
} EmpathyMessagePriv;
@@ -61,6 +62,7 @@ enum {
PROP_RECEIVER,
PROP_BODY,
PROP_TIMESTAMP,
+ PROP_IS_BACKLOG,
};
static void
@@ -112,6 +114,13 @@ empathy_message_class_init (EmpathyMessageClass *class)
G_MAXLONG,
-1,
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_IS_BACKLOG,
+ g_param_spec_boolean ("is-backlog",
+ "History message",
+ "If the message belongs to history",
+ FALSE,
+ G_PARAM_READWRITE));
g_type_class_add_private (object_class, sizeof (EmpathyMessagePriv));
@@ -387,6 +396,33 @@ empathy_message_set_timestamp (EmpathyMessage *message,
g_object_notify (G_OBJECT (message), "timestamp");
}
+gboolean
+empathy_message_is_backlog (EmpathyMessage *message)
+{
+ EmpathyMessagePriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_MESSAGE (message), FALSE);
+
+ priv = GET_PRIV (message);
+
+ return priv->is_backlog;
+}
+
+void
+empathy_message_set_is_backlog (EmpathyMessage *message,
+ gboolean is_backlog)
+{
+ EmpathyMessagePriv *priv;
+
+ g_return_if_fail (EMPATHY_IS_MESSAGE (message));
+
+ priv = GET_PRIV (message);
+
+ priv->is_backlog = is_backlog;
+
+ g_object_notify (G_OBJECT (message), "is-backlog");
+}
+
#define IS_SEPARATOR(ch) (ch == ' ' || ch == ',' || ch == '.' || ch == ':')
gboolean
empathy_message_should_highlight (EmpathyMessage *message)
diff --git a/libempathy/empathy-message.h b/libempathy/empathy-message.h
index 2172c9784..00064df57 100644
--- a/libempathy/empathy-message.h
+++ b/libempathy/empathy-message.h
@@ -68,6 +68,9 @@ void empathy_message_set_body (EmpathyMessage
time_t empathy_message_get_timestamp (EmpathyMessage *message);
void empathy_message_set_timestamp (EmpathyMessage *message,
time_t timestamp);
+gboolean empathy_message_is_backlog (EmpathyMessage *message);
+void empathy_message_set_is_backlog (EmpathyMessage *message,
+ gboolean is_backlog);
gboolean empathy_message_should_highlight (EmpathyMessage *message);
TpChannelTextMessageType empathy_message_type_from_str (const gchar *type_str);
const gchar * empathy_message_type_to_str (TpChannelTextMessageType type);