~singpolyma/cheogram-android

cdec63d96b6c7262a28fd03a322e524527e33261 — Stephen Paul Weber 8 months ago 1a02bcb
Do not include fallback quote on direct reply

It may be too close to the preceeding message and confusing looking on clients
that use the fallback.
M src/main/java/eu/siacs/conversations/entities/Message.java => src/main/java/eu/siacs/conversations/entities/Message.java +4 -0
@@ 514,6 514,10 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable 
        }
    }

    public synchronized void clearFallbacks() {
        this.payloads.removeAll(getFallbacks());
    }

    public synchronized void setBody(String body) {
        if (body == null) {
            throw new Error("You should not set the message body to null");

M src/main/java/eu/siacs/conversations/services/XmppConnectionService.java => src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +8 -2
@@ 139,6 139,7 @@ import eu.siacs.conversations.utils.Compatibility;
import eu.siacs.conversations.utils.Consumer;
import eu.siacs.conversations.utils.ConversationsFileObserver;
import eu.siacs.conversations.utils.CryptoHelper;
import eu.siacs.conversations.utils.Emoticons;
import eu.siacs.conversations.utils.EasyOnboardingInvite;
import eu.siacs.conversations.utils.ExceptionHelper;
import eu.siacs.conversations.utils.MimeUtils;


@@ 1040,8 1041,13 @@ public class XmppConnectionService extends Service {
        final Message inReplyTo = lastMessageUuid == null ? null : conversation.findMessageWithUuid(lastMessageUuid);
        Message message = new Message(conversation, body, conversation.getNextEncryption());
        if (inReplyTo != null) {
            message = inReplyTo.reply();
            message.appendBody(body);
            if (Emoticons.isEmoji(body)) {
                message = inReplyTo.react(body);
            } else {
                message = inReplyTo.reply();
            }
            message.clearFallbacks();
            message.setBody(body);
            message.setEncryption(conversation.getNextEncryption());
        }
        if (inReplyTo != null && inReplyTo.isPrivateMessage()) {