const gchar *message_classes,
gint64 timestamp,
gboolean is_backlog,
- gboolean outgoing)
+ gboolean outgoing,
+ PangoDirection direction)
{
GString *string;
const gchar *cur = NULL;
}
else if (theme_adium_match (&cur, "%messageDirection%"))
{
- /* FIXME: The text direction of the message
- * (either rtl or ltr)
- */
+ switch (direction)
+ {
+ case PANGO_DIRECTION_LTR:
+ case PANGO_DIRECTION_TTB_LTR:
+ case PANGO_DIRECTION_WEAK_LTR:
+ replace = "ltr";
+ break;
+ case PANGO_DIRECTION_RTL:
+ case PANGO_DIRECTION_TTB_RTL:
+ case PANGO_DIRECTION_WEAK_RTL:
+ replace = "rtl";
+ break;
+ case PANGO_DIRECTION_NEUTRAL:
+ default:
+ break;
+ }
}
else if (theme_adium_match (&cur, "%senderDisplayName%"))
{
static void
theme_adium_append_event_escaped (EmpathyThemeAdium *self,
- const gchar *escaped)
+ const gchar *escaped,
+ PangoDirection direction)
{
theme_adium_append_html (self, "appendMessage",
self->priv->data->status_html, escaped, NULL, NULL, NULL,
- NULL, "event", empathy_time_get_current (), FALSE, FALSE);
+ NULL, "event", empathy_time_get_current (), FALSE, FALSE, direction);
/* There is no last contact */
if (self->priv->last_contact)
gboolean is_backlog;
gboolean consecutive;
gboolean action;
+ PangoDirection direction;
if (self->priv->pages_loading != 0)
{
self->priv->data->in_content_html;
}
+ direction = pango_find_base_dir (empathy_message_get_body (msg), -1);
+
theme_adium_append_html (self, func, html, body_escaped,
avatar_filename, name_escaped, contact_id,
service_name, message_classes->str,
- timestamp, is_backlog, empathy_contact_is_user (sender));
+ timestamp, is_backlog, empathy_contact_is_user (sender), direction);
/* Keep the sender of the last displayed message */
if (self->priv->last_contact)
const gchar *str)
{
gchar *str_escaped;
+ PangoDirection direction;
if (self->priv->pages_loading != 0)
{
return;
}
+ direction = pango_find_base_dir (str, -1);
str_escaped = g_markup_escape_text (str, -1);
- theme_adium_append_event_escaped (self, str_escaped);
+ theme_adium_append_event_escaped (self, str_escaped, direction);
g_free (str_escaped);
}
const gchar *markup_text,
const gchar *fallback_text)
{
- theme_adium_append_event_escaped (self, markup_text);
+ PangoDirection direction;
+
+ direction = pango_find_base_dir (fallback_text, -1);
+ theme_adium_append_event_escaped (self, markup_text, direction);
}
void