fix replies without callback handling
This commit is contained in:
parent
162b0bf928
commit
ead327d30a
|
@ -875,14 +875,14 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
|
||||||
private StringBuilder removeReplyFallback(Message message, Message replyMessage) {
|
private StringBuilder removeReplyFallback(Message message, Message replyMessage) {
|
||||||
StringBuilder sb = new StringBuilder(message.body);
|
StringBuilder sb = new StringBuilder(message.body);
|
||||||
|
|
||||||
if (replyMessage != null && replyMessage.edits.isEmpty()) {
|
|
||||||
sb.replace(0, replyMessage.body.codePointCount(0, replyMessage.body.length()) + 3, "");
|
|
||||||
} else {
|
|
||||||
List<Element> replyFallback = message.getFallbacks("urn:xmpp:reply:0");
|
List<Element> replyFallback = message.getFallbacks("urn:xmpp:reply:0");
|
||||||
if (replyFallback.isEmpty()) {
|
if (replyFallback.isEmpty()) {
|
||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (replyMessage != null && replyMessage.edits.isEmpty()) {
|
||||||
|
sb.replace(0, replyMessage.body.codePointCount(0, replyMessage.body.length()) + 3, "");
|
||||||
|
} else {
|
||||||
Element bodyFallback = replyFallback.get(0).findChild("body");
|
Element bodyFallback = replyFallback.get(0).findChild("body");
|
||||||
int startCodePoint = Integer.parseInt(bodyFallback.getAttribute("start"));
|
int startCodePoint = Integer.parseInt(bodyFallback.getAttribute("start"));
|
||||||
int endCodePoint = Integer.parseInt(bodyFallback.getAttribute("end"));
|
int endCodePoint = Integer.parseInt(bodyFallback.getAttribute("end"));
|
||||||
|
|
Loading…
Reference in a new issue