avatar_filename = priv->data->default_avatar_filename;
}
}
-
+
is_backlog = empathy_message_is_backlog (msg);
/* Get the right html/func to add the message */
func = "appendMessage";
-
+
message_classes = g_string_new ("message");
-
+
/* eventually append the "history" class */
if (is_backlog) {
g_string_append (message_classes, " history");
}
-
+
/* check the sender of the message and append the appropriate class */
if (empathy_contact_is_user (sender)) {
g_string_append (message_classes, " outgoing");
else {
g_string_append (message_classes, " incoming");
}
-
+
/*
* To mimick Adium's behavior, we only want to join messages
* sent by the same contact within a 5 minute time frame.
*/
if (empathy_contact_equal (priv->last_contact, sender) &&
- (timestamp - priv->last_timestamp < MESSAGE_JOIN_PERIOD) &&
+ (timestamp - priv->last_timestamp < MESSAGE_JOIN_PERIOD) &&
(is_backlog == priv->last_is_backlog)) {
/* the messages can be appended */
func = "appendNextMessage";
g_string_append (message_classes, " consecutive");
-
+
/* check who is the sender of the message to use the correct html file */
if (empathy_contact_is_user (sender)) {
/* check if this is a backlog message and use NextContext.html */
html = priv->data->out_nextcontext_html;
len = priv->data->out_nextcontext_len;
}
-
+
/*
* html is null if this is not a backlog message or
* if we have to fallback (NextContext.html missing).
html = priv->data->in_nextcontext_html;
len = priv->data->in_nextcontext_len;
}
-
+
if (html == NULL) {
html = priv->data->in_nextcontent_html;
len = priv->data->in_nextcontent_len;
}
}
}
-
+
/*
* we have html == NULL here if:
* 1. the message didn't have to be appended because
html = priv->data->out_context_html;
len = priv->data->out_context_len;
}
-
+
if (html == NULL) {
html = priv->data->out_content_html;
len = priv->data->out_content_len;
html = priv->data->in_context_html;
len = priv->data->in_context_len;
}
-
+
if (html == NULL) {
html = priv->data->in_content_html;
len = priv->data->in_content_len;
file = g_build_filename (data->basedir, "Incoming", "NextContent.html", NULL);
g_file_get_contents (file, &data->in_nextcontent_html, &data->in_nextcontent_len, NULL);
g_free (file);
-
+
file = g_build_filename (data->basedir, "Incoming", "Context.html", NULL);
g_file_get_contents (file, &data->in_context_html, &data->in_context_len, NULL);
g_free (file);