mirror of
https://codeberg.org/monocles/monocles_chat.git
synced 2025-01-29 00:14:12 +01:00
Remove reactions fallback
This commit is contained in:
parent
f5daf84f44
commit
085f1e9b67
2 changed files with 2 additions and 24 deletions
|
@ -236,7 +236,7 @@ public class MessageGenerator extends AbstractGenerator {
|
|||
return packet;
|
||||
}
|
||||
|
||||
public im.conversations.android.xmpp.model.stanza.Message reaction(final Conversational conversation, final Message inReplyTo, final String reactingTo, final Collection<String> ourReactions, final Collection<String> newReactions) {
|
||||
public im.conversations.android.xmpp.model.stanza.Message reaction(final Conversational conversation, final String reactingTo, final Collection<String> ourReactions) {
|
||||
final boolean groupChat = conversation.getMode() == Conversational.MODE_MULTI;
|
||||
final Jid to = conversation.getJid().asBareJid();
|
||||
final im.conversations.android.xmpp.model.stanza.Message packet = new im.conversations.android.xmpp.model.stanza.Message();
|
||||
|
@ -248,26 +248,6 @@ public class MessageGenerator extends AbstractGenerator {
|
|||
reactions.addExtension(new Reaction(ourReaction));
|
||||
}
|
||||
|
||||
if (newReactions.size() > 0) {
|
||||
final var quote = QuoteHelper.quote(MessageUtils.prepareQuote(inReplyTo)) + "\n";
|
||||
packet.setBody(quote + String.join(" ", newReactions));
|
||||
|
||||
packet.addChild("reply", "urn:xmpp:reply:0")
|
||||
.setAttribute("to", inReplyTo.getCounterpart())
|
||||
.setAttribute("id", reactingTo);
|
||||
final var replyFallback = packet.addChild("fallback", "urn:xmpp:fallback:0").setAttribute("for", "urn:xmpp:reply:0");
|
||||
replyFallback.addChild("body", "urn:xmpp:fallback:0")
|
||||
.setAttribute("start", "0")
|
||||
.setAttribute("end", "" + quote.codePointCount(0, quote.length()));
|
||||
|
||||
|
||||
final var fallback = packet.addChild("fallback", "urn:xmpp:fallback:0").setAttribute("for", "urn:xmpp:reactions:0");
|
||||
fallback.addChild("body", "urn:xmpp:fallback:0");
|
||||
}
|
||||
|
||||
final var thread = inReplyTo.getThread();
|
||||
if (thread != null) packet.addChild(thread);
|
||||
|
||||
packet.addChild("store", "urn:xmpp:hints");
|
||||
return packet;
|
||||
}
|
||||
|
|
|
@ -5412,8 +5412,6 @@ public class XmppConnectionService extends Service {
|
|||
if (message.getConversation() instanceof Conversation conversation) {
|
||||
final String reactToId;
|
||||
final Collection<Reaction> combinedReactions;
|
||||
final var newReactions = new HashSet<>(reactions);
|
||||
newReactions.removeAll(message.getAggregatedReactions().ourReactions);
|
||||
if (conversation.getMode() == Conversational.MODE_MULTI) {
|
||||
final var self = conversation.getMucOptions().getSelf();
|
||||
final String occupantId = self.getOccupantId();
|
||||
|
@ -5445,7 +5443,7 @@ public class XmppConnectionService extends Service {
|
|||
return false;
|
||||
}
|
||||
final var reactionMessage =
|
||||
mMessageGenerator.reaction(conversation, message, reactToId, reactions, newReactions);
|
||||
mMessageGenerator.reaction(conversation, reactToId, reactions);
|
||||
sendMessagePacket(conversation.getAccount(), reactionMessage);
|
||||
message.setReactions(combinedReactions);
|
||||
updateMessage(message, false);
|
||||
|
|
Loading…
Add table
Reference in a new issue