aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2022-01-05 01:04:58 +0100
committerMarvin W <git@larma.de>2022-01-05 01:04:58 +0100
commitf422734cc8ce34d34be739e4f1a0a47ccdbf9e11 (patch)
tree329d8768d175b96057e4ab5e0625327e2bfe9226
parentc70201080b9bf432b9b7be2a88fd3cb6efa781b8 (diff)
downloaddino-f422734cc8ce34d34be739e4f1a0a47ccdbf9e11.tar.gz
dino-f422734cc8ce34d34be739e4f1a0a47ccdbf9e11.zip
Replace invalid UTF-8 with U+FFFD
XMPP is strictly UTF-8. Fixes #1172
-rw-r--r--libdino/src/entity/message.vala6
1 files changed, 5 insertions, 1 deletions
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; }