better replies fallback

This commit is contained in:
kosyak 2024-08-05 22:54:41 +02:00
parent 42d59adc78
commit 9892ff8d77

View file

@ -356,7 +356,15 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
}
public Message reply() {
Message m = new Message(conversation, QuoteHelper.quote(MessageUtils.prepareQuote(this)) + "\n", ENCRYPTION_NONE);
Message m;
String name = getAvatarName();
if (name != null && !name.isEmpty()) {
m = new Message(conversation, QuoteHelper.quote("<" + name + ">" + "\n" + MessageUtils.prepareQuote(this)) + "\n", ENCRYPTION_NONE);
} else {
m = new Message(conversation, QuoteHelper.quote(MessageUtils.prepareQuote(this)) + "\n", ENCRYPTION_NONE);
}
m.addPayload(
new Element("reply", "urn:xmpp:reply:0")
.setAttribute("to", getCounterpart())