Replace invalid UTF-8 with U+FFFD

XMPP is strictly UTF-8.
Fixes #1172
This commit is contained in:
Marvin W 2022-01-05 01:04:58 +01:00
parent c70201080b
commit f422734cc8
No known key found for this signature in database
GPG Key ID: 072E9235DB996F2A
1 changed files with 5 additions and 1 deletions

View File

@ -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; }