diff options
author | Nicolò Chieffo <84yelo3@gmail.com> | 2009-07-08 23:39:17 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2009-07-08 23:39:17 +0800 |
commit | ee5227403193fe7b5dae7d5c15e33d8a9c385c3f (patch) | |
tree | 16aa2e8ba09c4f780a94307a486ae1b28a02ea33 /libempathy | |
parent | aff75bcc97abac0173dfd4cc6f9a959fbd493ae6 (diff) | |
download | gsoc2013-empathy-ee5227403193fe7b5dae7d5c15e33d8a9c385c3f.tar gsoc2013-empathy-ee5227403193fe7b5dae7d5c15e33d8a9c385c3f.tar.gz gsoc2013-empathy-ee5227403193fe7b5dae7d5c15e33d8a9c385c3f.tar.bz2 gsoc2013-empathy-ee5227403193fe7b5dae7d5c15e33d8a9c385c3f.tar.lz gsoc2013-empathy-ee5227403193fe7b5dae7d5c15e33d8a9c385c3f.tar.xz gsoc2013-empathy-ee5227403193fe7b5dae7d5c15e33d8a9c385c3f.tar.zst gsoc2013-empathy-ee5227403193fe7b5dae7d5c15e33d8a9c385c3f.zip |
Support for history message in Adium themes. Use context HTMLs.
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-log-store-empathy.c | 1 | ||||
-rw-r--r-- | libempathy/empathy-message.c | 36 | ||||
-rw-r--r-- | libempathy/empathy-message.h | 3 |
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); |