Fix crash when reacting to release note channel messages.

This commit is contained in:
Cody Henthorne 2022-02-10 16:26:13 -05:00
parent c547553770
commit 233ba03f73
2 changed files with 6 additions and 1 deletions

View file

@ -654,7 +654,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
}
private void handleUpEvent() {
if (selected != -1 && onReactionSelectedListener != null) {
if (selected != -1 && onReactionSelectedListener != null && backgroundView.getVisibility() == View.VISIBLE) {
if (selected == customEmojiIndex) {
onReactionSelectedListener.onCustomReactionSelected(messageRecord, emojiViews[selected].getTag() != null);
} else {

View file

@ -17,6 +17,7 @@ import org.thoughtcrime.securesms.groups.GroupId;
import org.thoughtcrime.securesms.jobmanager.Data;
import org.thoughtcrime.securesms.jobmanager.Job;
import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.messages.GroupSendUtil;
import org.thoughtcrime.securesms.net.NotPushRegisteredException;
import org.thoughtcrime.securesms.recipients.Recipient;
@ -150,6 +151,10 @@ public class ReactionSendJob extends BaseJob {
Recipient targetAuthor = message.isOutgoing() ? Recipient.self() : message.getIndividualRecipient();
long targetSentTimestamp = message.getDateSent();
if (targetAuthor.getId().equals(SignalStore.releaseChannelValues().getReleaseChannelRecipientId())) {
return;
}
if (!remove && !reactionDatabase.hasReaction(messageId, reaction)) {
Log.w(TAG, "Went to add a reaction, but it's no longer present on the message!");
return;