From f422734cc8ce34d34be739e4f1a0a47ccdbf9e11 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 5 Jan 2022 01:04:58 +0100 Subject: Replace invalid UTF-8 with U+FFFD XMPP is strictly UTF-8. Fixes #1172 --- libdino/src/entity/message.vala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libdino/src/entity') diff --git a/libdino/src/entity/message.vala b/libdino/src/entity/message.vala index 9c062f73..b11e2622 100644 --- a/libdino/src/entity/message.vala +++ b/libdino/src/entity/message.vala @@ -47,7 +47,11 @@ public class Message : Object { public bool direction { get; set; } public Jid? real_jid { get; set; } public Type type_ { get; set; default = Type.UNKNOWN; } - public string? body { get; set; } + private string? body_; + public string? body { + get { return body_; } + set { body_ = value != null ? value.make_valid() : null; } + } public string? stanza_id { get; set; } public string? server_id { get; set; } public DateTime? time { get; set; } -- cgit v1.2.3-70-g09d2