[empathy] show the date in messages coming from history (#624599)
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] show the date in messages coming from history (#624599)
- Date: Mon, 2 Aug 2010 10:41:14 +0000 (UTC)
commit bf773817f5ea14ac8566171153e2df793aeb03aa
Author: Nicolò Chieffo <yelo3 gmail com>
Date: Mon Aug 2 12:40:52 2010 +0200
show the date in messages coming from history (#624599)
libempathy-gtk/empathy-log-window.c | 2 +-
libempathy-gtk/empathy-theme-adium.c | 16 +++++++++++-----
libempathy/empathy-time.h | 3 ++-
3 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 986a3af..fcbc6e2 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -525,7 +525,7 @@ log_manager_searched_new_cb (GObject *manager,
}
g_date_strftime (date_readable, sizeof (date_readable),
- EMPATHY_TIME_FORMAT_DISPLAY_LONG, hit->date);
+ EMPATHY_DATE_FORMAT_DISPLAY_SHORT, hit->date);
g_date_strftime (tmp, sizeof (tmp),
"%Y%m%d", hit->date);
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 53c78c1..8c6301e 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -324,7 +324,8 @@ theme_adium_append_html (EmpathyThemeAdium *theme,
const gchar *contact_id,
const gchar *service_name,
const gchar *message_classes,
- time_t timestamp)
+ time_t timestamp,
+ gboolean is_backlog)
{
GString *string;
const gchar *cur = NULL;
@@ -380,8 +381,13 @@ theme_adium_append_html (EmpathyThemeAdium *theme,
cur++;
}
- dup_replace = empathy_time_to_string_local (timestamp,
- format ? format : EMPATHY_TIME_FORMAT_DISPLAY_SHORT);
+ if (is_backlog) {
+ dup_replace = empathy_time_to_string_local (timestamp,
+ format ? format : EMPATHY_TIME_DATE_FORMAT_DISPLAY_SHORT);
+ } else {
+ dup_replace = empathy_time_to_string_local (timestamp,
+ format ? format : EMPATHY_TIME_FORMAT_DISPLAY_SHORT);
+ }
replace = dup_replace;
g_free (format);
} else {
@@ -412,7 +418,7 @@ theme_adium_append_event_escaped (EmpathyChatView *view,
priv->data->status_html,
priv->data->status_len,
escaped, NULL, NULL, NULL, NULL,
- "event", empathy_time_get_current ());
+ "event", empathy_time_get_current (), FALSE);
}
/* There is no last contact */
@@ -596,7 +602,7 @@ theme_adium_append_message (EmpathyChatView *view,
theme_adium_append_html (theme, func, html, len, body_escaped,
avatar_filename, name, contact_id,
service_name, message_classes->str,
- timestamp);
+ timestamp, is_backlog);
} else {
DEBUG ("Couldn't find HTML file for this message");
}
diff --git a/libempathy/empathy-time.h b/libempathy/empathy-time.h
index 224b25c..9a14b25 100644
--- a/libempathy/empathy-time.h
+++ b/libempathy/empathy-time.h
@@ -31,7 +31,8 @@
G_BEGIN_DECLS
#define EMPATHY_TIME_FORMAT_DISPLAY_SHORT "%H:%M"
-#define EMPATHY_TIME_FORMAT_DISPLAY_LONG "%a %d %b %Y"
+#define EMPATHY_DATE_FORMAT_DISPLAY_SHORT "%a %d %b %Y"
+#define EMPATHY_TIME_DATE_FORMAT_DISPLAY_SHORT "%c"
time_t empathy_time_get_current (void);
time_t empathy_time_get_local_time (struct tm *tm);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]