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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user