summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-03-05 16:06:00 +0000
committerCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-03-12 14:07:50 +0100
commit4e260679680fff96fbbb821de5752476acd45c79 (patch)
treeea871f694e194d45dea2869997a83c8442dcbe08
parent5acca9ffd109628c9f6e1f9b9fa768ca67f7c203 (diff)
downloadtelepathy-logger-4e260679680fff96fbbb821de5752476acd45c79.tar.gz
Using constants where possible for time formats and special values
-rw-r--r--telepathy-logger/channel-text.c11
-rw-r--r--telepathy-logger/log-manager.c2
-rw-r--r--telepathy-logger/log-store-empathy.c2
3 files changed, 9 insertions, 6 deletions
diff --git a/telepathy-logger/channel-text.c b/telepathy-logger/channel-text.c
index 194c1b2..331072a 100644
--- a/telepathy-logger/channel-text.c
+++ b/telepathy-logger/channel-text.c
@@ -696,8 +696,8 @@ got_message_pending_messages_cb (TpProxy *proxy,
"message-received", NULL);
tpl_message_token = create_message_token (channel_path,
- tpl_time_to_string_local (message_timestamp, "%Y%m%d%H%M%S"),
- message_id);
+ tpl_time_to_string_local (message_timestamp,
+ TPL_LOG_STORE_INDEX_TIMESTAMP_FORMAT), message_id);
/* look for the current token among the TPL indexed tokens/log_id */
l = g_list_find_custom (indexed_pending_msg, tpl_message_token,
@@ -1048,7 +1048,9 @@ on_sent_signal_cb (TpChannel *proxy,
channel_path = tp_proxy_get_object_path (TP_PROXY (tpl_text));
log_id = create_message_token (channel_path,
- tpl_time_to_string_local (arg_Timestamp, "%Y%m%d%H%M%S"), G_MAXUINT);
+ tpl_time_to_string_local (arg_Timestamp,
+ TPL_LOG_STORE_INDEX_TIMESTAMP_FORMAT),
+ TPL_LOG_ENTRY_MSG_ID_ACKNOWLEDGED);
/* Initialize data for TplContact */
me = tpl_channel_text_get_my_contact (tpl_text);
@@ -1256,7 +1258,8 @@ on_received_signal_cb (TpChannel *proxy,
const gchar *account_path = tp_proxy_get_object_path (TP_PROXY (account));
const gchar *channel_path = tp_proxy_get_object_path (TP_PROXY (tpl_text));
gchar *log_id = create_message_token (channel_path,
- tpl_time_to_string_local (arg_Timestamp, "%Y%m%d%H%M%S"), arg_ID);
+ tpl_time_to_string_local (arg_Timestamp,
+ TPL_LOG_STORE_INDEX_TIMESTAMP_FORMAT), arg_ID);
/* First, check if log_id has already been logged
*
diff --git a/telepathy-logger/log-manager.c b/telepathy-logger/log-manager.c
index 45ba997..6452427 100644
--- a/telepathy-logger/log-manager.c
+++ b/telepathy-logger/log-manager.c
@@ -717,7 +717,7 @@ tpl_log_manager_get_date_readable (const gchar *date)
t = tpl_time_parse (date);
- return tpl_time_to_string_local (t, "%a %d %b %Y");
+ return tpl_time_to_string_local (t, TPL_TIME_FORMAT_DISPLAY_LONG);
}
diff --git a/telepathy-logger/log-store-empathy.c b/telepathy-logger/log-store-empathy.c
index 59df2b6..775e3f1 100644
--- a/telepathy-logger/log-store-empathy.c
+++ b/telepathy-logger/log-store-empathy.c
@@ -539,7 +539,7 @@ log_store_empathy_get_messages_for_file (TplLogStore *self,
if (cm_id_str)
cm_id = atoi (cm_id_str);
else
- cm_id = 0;
+ cm_id = TPL_LOG_ENTRY_MSG_ID_ACKNOWLEDGED;
t = tpl_time_parse (time_);