Loosen requirement to have occupant id to send reaction
(cherry picked from commit d35ebbae226b99a239e3da7f4a70685cfaad6c43)
This commit is contained in:
parent
3b52d2b118
commit
841a0ed909
2 changed files with 17 additions and 5 deletions
|
@ -92,6 +92,22 @@ public class Reaction {
|
|||
}
|
||||
}
|
||||
|
||||
public static Collection<Reaction> withMine(
|
||||
final Collection<Reaction> existing,
|
||||
final Collection<String> reactions,
|
||||
final boolean received,
|
||||
final Jid from,
|
||||
final Jid trueJid,
|
||||
final String occupantId,
|
||||
final String envelopeId) {
|
||||
final ImmutableSet.Builder<Reaction> builder = new ImmutableSet.Builder<>();
|
||||
builder.addAll(Collections2.filter(existing, e -> e.received));
|
||||
builder.addAll(
|
||||
Collections2.transform(
|
||||
reactions, r -> new Reaction(r, null, received, from, trueJid, occupantId, envelopeId)));
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
public static Collection<Reaction> withOccupantId(
|
||||
final Collection<Reaction> existing,
|
||||
final Collection<String> reactions,
|
||||
|
|
|
@ -5381,13 +5381,9 @@ public class XmppConnectionService extends Service {
|
|||
if (conversation.getMode() == Conversational.MODE_MULTI) {
|
||||
final var self = conversation.getMucOptions().getSelf();
|
||||
final String occupantId = self.getOccupantId();
|
||||
if (Strings.isNullOrEmpty(occupantId)) {
|
||||
Log.d(Config.LOGTAG, "occupant id not found for reaction in MUC");
|
||||
return false;
|
||||
}
|
||||
reactToId = message.getServerMsgId();
|
||||
combinedReactions =
|
||||
Reaction.withOccupantId(
|
||||
Reaction.withMine(
|
||||
message.getReactions(),
|
||||
reactions,
|
||||
false,
|
||||
|
|
Loading…
Reference in a new issue