diff options
author | fiaxh <git@lightrise.org> | 2023-05-01 19:15:36 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2023-05-01 19:21:05 +0200 |
commit | 0bddf9f3dacc0945429979787348f41571f27518 (patch) | |
tree | 3259f07b59f081fac31fe62df3bfa7e13e78dd4c /libdino/src/service/replies.vala | |
parent | ec6c24c2b41fc9de704323ce895b2dc81549ca5e (diff) | |
download | dino-0bddf9f3dacc0945429979787348f41571f27518.tar.gz dino-0bddf9f3dacc0945429979787348f41571f27518.zip |
Fix character counting for fallbacks
fixes #1420
Diffstat (limited to 'libdino/src/service/replies.vala')
-rw-r--r-- | libdino/src/service/replies.vala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libdino/src/service/replies.vala b/libdino/src/service/replies.vala index 2bb10e0b..58d44b37 100644 --- a/libdino/src/service/replies.vala +++ b/libdino/src/service/replies.vala @@ -105,7 +105,8 @@ namespace Dino { string body = message.body; foreach (var fallback in message.get_fallbacks()) { if (fallback.ns_uri == Xep.Replies.NS_URI && message.quoted_item_id > 0) { - body = body[0:fallback.locations[0].from_char] + body[fallback.locations[0].to_char:body.length]; + body = body[0:body.index_of_nth_char(fallback.locations[0].from_char)] + + body[body.index_of_nth_char(fallback.locations[0].to_char):body.length]; } } return body; |