XEP-0461: fix char counting

I think this time I got it right, confirmed
against client implementations (dino and movim)
This commit is contained in:
nicoco
2023-02-24 00:11:06 +01:00
parent 79ffa1668f
commit 40a857de65
2 changed files with 4 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ class FeatureFallBack(ElementBase):
end = self["fallback_body"]["end"]
body = self.parent()["body"]
if start <= end:
return body[start:end+1]
return body[start:end]
else:
return ""
@@ -44,7 +44,7 @@ class FeatureFallBack(ElementBase):
msg["body"] = quoted + msg["body"]
msg["feature_fallback"]["for"] = NS
msg["feature_fallback"]["fallback_body"]["start"] = 0
msg["feature_fallback"]["fallback_body"]["end"] = len(quoted) - 1
msg["feature_fallback"]["fallback_body"]["end"] = len(quoted)
class FallBackBody(ElementBase):