aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorPatryk Zawadzki <patrys@pld-linux.org>2009-06-19 17:49:32 +0800
committerPatryk Zawadzki <patrys@pld-linux.org>2009-06-19 17:49:32 +0800
commit5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b (patch)
treec92dd42d526b9191161eb6580b80bd25164990a8 /libempathy-gtk
parentd8c0a34b31f6e8c0c0f09d8a529970b888cee17c (diff)
downloadgsoc2013-empathy-5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b.tar
gsoc2013-empathy-5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b.tar.gz
gsoc2013-empathy-5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b.tar.bz2
gsoc2013-empathy-5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b.tar.lz
gsoc2013-empathy-5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b.tar.xz
gsoc2013-empathy-5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b.tar.zst
gsoc2013-empathy-5f638d0e0cb77b0dbc59782eb8b80b1763a4c81b.zip
Limit joining consecutive messages to 5 minutes
Fixes bug #586352
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 321d1998c..edbdbcd04 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -39,9 +39,13 @@
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyThemeAdium)
+/* "Join" consecutive messages with timestamps within five minutes */
+#define MESSAGE_JOIN_PERIOD 5*60
+
typedef struct {
EmpathySmileyManager *smiley_manager;
EmpathyContact *last_contact;
+ time_t last_timestamp;
gboolean page_loaded;
GList *message_queue;
gchar *path;
@@ -501,7 +505,12 @@ theme_adium_append_message (EmpathyChatView *view,
/* Get the right html/func to add the message */
func = "appendMessage";
- if (empathy_contact_equal (priv->last_contact, sender)) {
+ /*
+ * To mimick Adium's behavior, we only want to join messages
+ * sent within a 5 minute time frame.
+ */
+ if (empathy_contact_equal (priv->last_contact, sender) &&
+ (timestamp - priv->last_timestamp < MESSAGE_JOIN_PERIOD)) {
func = "appendNextMessage";
if (empathy_contact_is_user (sender)) {
html = priv->out_nextcontent_html;
@@ -531,6 +540,7 @@ theme_adium_append_message (EmpathyChatView *view,
g_object_unref (priv->last_contact);
}
priv->last_contact = g_object_ref (sender);
+ priv->last_timestamp = timestamp;
g_free (dup_body);
}