summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2010-12-24 18:54:50 +0000
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2010-12-24 19:21:29 +0000
commit58e4e7a9daf2bfddd113a37c92bd9ce356a35fe3 (patch)
tree5639ba87f58632dd7d45048d46c3108d4dcf2c72
parente1d4be017898b2524088ad11b97feb8a2699f9a8 (diff)
downloadtelepathy-logger-58e4e7a9daf2bfddd113a37c92bd9ce356a35fe3.tar.gz
Use TPL_IS_ENTRY_FOO to diferentiate entries
-rw-r--r--telepathy-logger/log-store-sqlite.c5
-rw-r--r--telepathy-logger/log-store-xml.c22
2 files changed, 11 insertions, 16 deletions
diff --git a/telepathy-logger/log-store-sqlite.c b/telepathy-logger/log-store-sqlite.c
index 3d5bc68..1d43ba6 100644
--- a/telepathy-logger/log-store-sqlite.c
+++ b/telepathy-logger/log-store-sqlite.c
@@ -445,8 +445,9 @@ tpl_log_store_sqlite_add_message_counter (TplLogStore *self,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- if (_tpl_entry_get_signal_type (message) !=
- TPL_ENTRY_TEXT_SIGNAL_RECEIVED)
+ if ((TPL_IS_ENTRY_TEXT (message) == FALSE) ||
+ (_tpl_entry_get_signal_type (message) !=
+ TPL_ENTRY_TEXT_SIGNAL_RECEIVED))
{
DEBUG ("ignoring msg %s, not interesting for message-counter",
_tpl_entry_get_log_id (message));
diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c
index 0a8c525..dbf05a0 100644
--- a/telepathy-logger/log-store-xml.c
+++ b/telepathy-logger/log-store-xml.c
@@ -559,20 +559,14 @@ log_store_xml_add_message (TplLogStore *store,
g_return_val_if_fail (TPL_IS_ENTRY (message), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- switch (_tpl_entry_get_signal_type (TPL_ENTRY (message)))
- {
- case TPL_ENTRY_CHANNEL_TEXT_SIGNAL_SENT:
- case TPL_ENTRY_CHANNEL_TEXT_SIGNAL_RECEIVED:
- case TPL_ENTRY_CHANNEL_TEXT_SIGNAL_SEND_ERROR:
- case TPL_ENTRY_CHANNEL_TEXT_SIGNAL_LOST_MESSAGE:
- return add_message_text (self, TPL_ENTRY_TEXT (message), error);
- default:
- DEBUG ("TplEntrySignalType not handled by this LogStore (%s). "
- "Ignoring Entry", log_store_xml_get_name (store));
- /* do not consider it an error, this LogStore simply do not want/need
- * this Entry */
- return TRUE;
- }
+ if (TPL_IS_ENTRY_TEXT (message))
+ return add_message_text (self, TPL_ENTRY_TEXT (message), error);
+
+ DEBUG ("TplEntrySignalType not handled by this LogStore (%s). "
+ "Ignoring Entry", log_store_xml_get_name (store));
+ /* do not consider it an error, this LogStore simply do not want/need
+ * this Entry */
+ return TRUE;
}