diff options
Diffstat (limited to 'matrix-room.c')
-rw-r--r-- | matrix-room.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/matrix-room.c b/matrix-room.c index b26d036..cd17ae7 100644 --- a/matrix-room.c +++ b/matrix-room.c @@ -1094,8 +1094,14 @@ void matrix_room_handle_timeline_event(PurpleConversation *conv, } flags = PURPLE_MESSAGE_RECV; - if (purple_strequal(matrix_json_object_get_string_member(json_content_obj, "format"), "org.matrix.custom.html")) { - escaped_body = g_strdup(matrix_json_object_get_string_member(json_content_obj, "formatted_body")); + gboolean prefer_markdown = purple_account_get_bool(conv->account, + PRPL_ACCOUNT_OPT_PREFER_MARKDOWN, FALSE); + if (!prefer_markdown) { + if (purple_strequal(matrix_json_object_get_string_member(json_content_obj, "format"), "org.matrix.custom.html")) { + escaped_body = g_strdup(matrix_json_object_get_string_member(json_content_obj, "formatted_body")); + } else { + escaped_body = purple_markup_escape_text(tmp_body ? tmp_body : msg_body, -1); + } } else { escaped_body = purple_markup_escape_text(tmp_body ? tmp_body : msg_body, -1); } |