diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2010-12-24 19:00:57 +0000 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2010-12-24 19:21:29 +0000 |
commit | 75a9bbffaa0e6c774a31c2f61fe73bbc40378a79 (patch) | |
tree | c2b014ae3401c60d5ff6a94507006275d04bcd8a | |
parent | 58e4e7a9daf2bfddd113a37c92bd9ce356a35fe3 (diff) | |
download | telepathy-logger-75a9bbffaa0e6c774a31c2f61fe73bbc40378a79.tar.gz |
Move text signal types from TplEntry to TplEntryText
-rw-r--r-- | telepathy-logger/channel-text.c | 4 | ||||
-rw-r--r-- | telepathy-logger/entry-internal.h | 18 | ||||
-rw-r--r-- | telepathy-logger/entry-text-internal.h | 6 | ||||
-rw-r--r-- | telepathy-logger/entry-text.c | 21 | ||||
-rw-r--r-- | telepathy-logger/entry.c | 19 | ||||
-rw-r--r-- | telepathy-logger/log-store-sqlite.c | 2 | ||||
-rw-r--r-- | telepathy-logger/log-store-xml.c | 2 |
7 files changed, 31 insertions, 41 deletions
diff --git a/telepathy-logger/channel-text.c b/telepathy-logger/channel-text.c index be9680b..e09a743 100644 --- a/telepathy-logger/channel-text.c +++ b/telepathy-logger/channel-text.c @@ -1119,12 +1119,12 @@ on_sent_signal_cb (TpChannel *proxy, _tpl_entry_set_channel_path (TPL_ENTRY (log), channel_path); _tpl_entry_set_chat_id (log, chat_id); _tpl_entry_set_timestamp (log, (time_t) arg_Timestamp); - _tpl_entry_set_signal_type (log, TPL_ENTRY_TEXT_SIGNAL_SENT); _tpl_entry_set_sender (log, tpl_entity_sender); /* NULL when it's a chatroom */ if (tpl_entity_receiver != NULL) _tpl_entry_set_receiver (log, tpl_entity_receiver); _tpl_entry_text_set_message (text_log, arg_Text); + _tpl_entry_text_set_signal_type (text_log, TPL_ENTRY_TEXT_SIGNAL_SENT); _tpl_entry_text_set_message_type (text_log, arg_Type); _tpl_entry_text_set_tpl_channel_text (text_log, tpl_text); @@ -1325,7 +1325,7 @@ on_received_signal_cb (TpChannel *proxy, _tpl_entry_text_set_tpl_channel_text (text_log, tpl_text); _tpl_entry_text_set_message (text_log, arg_Text); _tpl_entry_text_set_message_type (text_log, arg_Type); - _tpl_entry_set_signal_type (log, + _tpl_entry_text_set_signal_type (text_log, TPL_ENTRY_TEXT_SIGNAL_RECEIVED); me = _tpl_channel_text_get_my_contact (tpl_text); diff --git a/telepathy-logger/entry-internal.h b/telepathy-logger/entry-internal.h index e98af6e..84750f2 100644 --- a/telepathy-logger/entry-internal.h +++ b/telepathy-logger/entry-internal.h @@ -33,20 +33,6 @@ G_BEGIN_DECLS typedef enum { - TPL_ENTRY_SIGNAL_NONE = 0, - - TPL_ENTRY_CHANNEL_TEXT_SIGNAL_SENT, - TPL_ENTRY_CHANNEL_TEXT_SIGNAL_RECEIVED, - TPL_ENTRY_CHANNEL_TEXT_SIGNAL_SEND_ERROR, - TPL_ENTRY_CHANNEL_TEXT_SIGNAL_LOST_MESSAGE, - TPL_ENTRY_CHANNEL_TEXT_SIGNAL_CHAT_STATUS_CHANGED, - - TPL_ENTRY_CHANNEL_SIGNAL_CHANNEL_CLOSED - -} TplEntrySignalType; - -typedef enum -{ TPL_ENTRY_ERROR, TPL_ENTRY_TEXT } TplEntryType; @@ -71,9 +57,6 @@ struct _TplEntryClass { void _tpl_entry_set_timestamp (TplEntry *self, gint64 data); -void _tpl_entry_set_signal_type (TplEntry *self, - TplEntrySignalType data); - void _tpl_entry_set_direction (TplEntry *self, TplEntryDirection data); @@ -89,7 +72,6 @@ void _tpl_entry_set_sender (TplEntry *self, void _tpl_entry_set_receiver (TplEntry *self, TplEntity *data); -TplEntrySignalType _tpl_entry_get_signal_type (TplEntry *self); const gchar * _tpl_entry_get_chat_id (TplEntry * self); const gchar * _tpl_entry_get_channel_path (TplEntry *self); diff --git a/telepathy-logger/entry-text-internal.h b/telepathy-logger/entry-text-internal.h index 08d53ba..3b68f8d 100644 --- a/telepathy-logger/entry-text-internal.h +++ b/telepathy-logger/entry-text-internal.h @@ -65,6 +65,9 @@ const gchar * _tpl_entry_text_message_type_to_str ( TplChannelText * _tpl_entry_text_get_tpl_channel_text ( TplEntryText *self); +TplEntryTextSignalType _tpl_entry_text_get_signal_type ( + TplEntryText *self); + void _tpl_entry_text_set_tpl_channel_text (TplEntryText *self, TplChannelText *data); @@ -88,6 +91,9 @@ gboolean _tpl_entry_text_equal (TplEntry *message1, void _tpl_entry_text_set_pending_msg_id (TplEntryText *self, gint data); +void _tpl_entry_text_set_signal_type (TplEntryText *self, + TplEntryTextSignalType signal_type); + gboolean _tpl_entry_text_is_pending (TplEntryText *self); G_END_DECLS diff --git a/telepathy-logger/entry-text.c b/telepathy-logger/entry-text.c index 64a6014..ae2e9fa 100644 --- a/telepathy-logger/entry-text.c +++ b/telepathy-logger/entry-text.c @@ -51,6 +51,8 @@ G_DEFINE_TYPE (TplEntryText, tpl_entry_text, TPL_TYPE_ENTRY) struct _TplEntryTextPriv { + TplEntryTextSignalType signal_type; + TplChannelText *tpl_text; TpChannelTextMessageType message_type; gchar *message; @@ -296,6 +298,25 @@ _tpl_entry_text_get_tpl_channel_text (TplEntryText * self) return self->priv->tpl_text; } + +TplEntryTextSignalType +_tpl_entry_text_get_signal_type (TplEntryText *self) +{ + g_return_val_if_fail (TPL_IS_ENTRY_TEXT (self), TPL_ENTRY_TEXT_SIGNAL_NONE); + + return self->priv->signal_type; +} + + +void +_tpl_entry_text_set_signal_type (TplEntryText *self, + TplEntryTextSignalType signal_type) +{ + g_return_if_fail (TPL_IS_ENTRY_TEXT (self)); + + self->priv->signal_type = signal_type; +} + /** * tpl_entry_text_get_message * @self: a #TplEntryText diff --git a/telepathy-logger/entry.c b/telepathy-logger/entry.c index 3f8be73..f9dd091 100644 --- a/telepathy-logger/entry.c +++ b/telepathy-logger/entry.c @@ -80,7 +80,6 @@ struct _TplEntryPriv { gchar *log_id; gint64 timestamp; - TplEntrySignalType signal_type; gchar *chat_id; TpAccount *account; gchar *channel_path; @@ -330,15 +329,6 @@ tpl_entry_get_timestamp (TplEntry *self) return self->priv->timestamp; } -TplEntrySignalType -_tpl_entry_get_signal_type (TplEntry *self) -{ - g_return_val_if_fail (TPL_IS_ENTRY (self), TPL_ENTRY_SIGNAL_NONE); - - return self->priv->signal_type; -} - - const gchar * _tpl_entry_get_log_id (TplEntry *self) { @@ -432,15 +422,6 @@ _tpl_entry_set_timestamp (TplEntry *self, } -void -_tpl_entry_set_signal_type (TplEntry *self, - TplEntrySignalType data) -{ - g_return_if_fail (TPL_IS_ENTRY (self)); - - self->priv->signal_type = data; -} - /* set just on construction time */ static void tpl_entry_set_log_id (TplEntry *self, diff --git a/telepathy-logger/log-store-sqlite.c b/telepathy-logger/log-store-sqlite.c index 1d43ba6..7559c16 100644 --- a/telepathy-logger/log-store-sqlite.c +++ b/telepathy-logger/log-store-sqlite.c @@ -446,7 +446,7 @@ tpl_log_store_sqlite_add_message_counter (TplLogStore *self, g_return_val_if_fail (error == NULL || *error == NULL, FALSE); if ((TPL_IS_ENTRY_TEXT (message) == FALSE) || - (_tpl_entry_get_signal_type (message) != + (_tpl_entry_text_get_signal_type (TPL_ENTRY_TEXT (message)) != TPL_ENTRY_TEXT_SIGNAL_RECEIVED)) { DEBUG ("ignoring msg %s, not interesting for message-counter", diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c index dbf05a0..0b3f24a 100644 --- a/telepathy-logger/log-store-xml.c +++ b/telepathy-logger/log-store-xml.c @@ -523,7 +523,7 @@ add_message_text (TplLogStoreXml *self, g_return_val_if_fail (TPL_IS_LOG_STORE_XML (self), FALSE); g_return_val_if_fail (TPL_IS_ENTRY_TEXT (message), FALSE); - signal_type = _tpl_entry_get_signal_type (TPL_ENTRY (message)); + signal_type = _tpl_entry_text_get_signal_type (message); switch (signal_type) { |