| 112 |
112 |
| 113 cur = strstr(mime, "RL="); |
113 cur = strstr(mime, "RL="); |
| 114 |
114 |
| 115 if (cur && (*(cur = cur + 3) != ';')) |
115 if (cur && (*(cur = cur + 3) != ';')) |
| 116 { |
116 { |
| 117 if(*cur == '1') { |
117 if (*cur == '1') |
| |
118 { |
| 118 /* RTL text was received */ |
119 /* RTL text was received */ |
| 119 pre = g_string_append(pre, "<SPAN style=\"direction:rtl;text-align:right;\">"); |
120 pre = g_string_append(pre, "<SPAN style=\"direction:rtl;text-align:right;\">"); |
| 120 post = g_string_prepend(post, "</SPAN>"); |
121 post = g_string_prepend(post, "</SPAN>"); |
| 121 } |
122 } |
| 122 } |
123 } |
| 283 direction = '1'; |
284 direction = '1'; |
| 284 } |
285 } |
| 285 else if (!g_ascii_strncasecmp(c, "style=\"", 7)) |
286 else if (!g_ascii_strncasecmp(c, "style=\"", 7)) |
| 286 { |
287 { |
| 287 /* Parse inline CSS attributes */ |
288 /* Parse inline CSS attributes */ |
| 288 char* attributes; |
289 char *attributes; |
| 289 int attr_len = 0; |
290 int attr_len = 0; |
| 290 c += 7; |
291 c += 7; |
| 291 while (*(c + attr_len) != '\0' && *(c + attr_len) != '"') |
292 while (*(c + attr_len) != '\0' && *(c + attr_len) != '"') |
| 292 attr_len++; |
293 attr_len++; |
| 293 if(*(c + attr_len) == '"') |
294 if (*(c + attr_len) == '"') |
| 294 { |
295 { |
| 295 char *attr_dir; |
296 char *attr_dir; |
| 296 attributes = g_strndup(c, attr_len); |
297 attributes = g_strndup(c, attr_len); |
| 297 attr_dir = purple_markup_get_css_property(attributes, "direction"); |
298 attr_dir = purple_markup_get_css_property(attributes, "direction"); |
| 298 if(attr_dir && (!strncasecmp(attr_dir, "RTL", 3))) |
299 if (attr_dir && (!strncasecmp(attr_dir, "RTL", 3))) |
| 299 direction = '1'; |
300 direction = '1'; |
| 300 if(attr_dir) |
301 g_free(attr_dir); |
| 301 g_free(attr_dir); |
302 g_free(attributes); |
| 302 if(attributes) |
|
| 303 g_free(attributes); |
|
| 304 } |
303 } |
| 305 |
304 |
| 306 } |
305 } |
| 307 else |
306 else |
| 308 { |
307 { |