]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/helper/IncomingMessageHandler.java
Update libsignal-service
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / helper / IncomingMessageHandler.java
index f7b978ab588d4f1f8dd610b4f4bfa73d76e6b65c..fbd719b9b86c7b038096286b7a231996ccf3fd26 100644 (file)
@@ -22,7 +22,6 @@ import org.asamk.signal.manager.api.GroupId;
 import org.asamk.signal.manager.api.GroupNotFoundException;
 import org.asamk.signal.manager.api.MessageEnvelope;
 import org.asamk.signal.manager.api.Pair;
-import org.asamk.signal.manager.api.Profile;
 import org.asamk.signal.manager.api.ReceiveConfig;
 import org.asamk.signal.manager.api.StickerPackId;
 import org.asamk.signal.manager.api.TrustLevel;
@@ -161,24 +160,11 @@ public final class IncomingMessageHandler {
                 if (context.getContactHelper().isContactBlocked(sender)) {
                     logger.debug("Received invalid message from blocked contact, ignoring.");
                 } else {
-                    final var senderProfile = context.getProfileHelper().getRecipientProfile(sender);
-                    final var selfProfile = context.getProfileHelper().getSelfProfile();
                     var serviceId = ServiceId.parseOrNull(e.getSender());
-                    if (serviceId == null) {
-                        // Workaround for libsignal-client issue #492
-                        serviceId = account.getRecipientAddressResolver()
-                                .resolveRecipientAddress(sender)
-                                .serviceId()
-                                .orElse(null);
-                    }
                     if (serviceId != null) {
                         final var isSelf = sender.equals(account.getSelfRecipientId())
                                 && e.getSenderDevice() == account.getDeviceId();
-                        final var isSenderSenderKeyCapable = senderProfile != null && senderProfile.getCapabilities()
-                                .contains(Profile.Capability.senderKey);
-                        final var isSelfSenderKeyCapable = selfProfile != null && selfProfile.getCapabilities()
-                                .contains(Profile.Capability.senderKey);
-                        if (!isSelf && isSenderSenderKeyCapable && isSelfSenderKeyCapable) {
+                        if (!isSelf) {
                             logger.debug("Received invalid message, requesting message resend.");
                             actions.add(new SendRetryMessageRequestAction(sender, serviceId, e, envelope, destination));
                         } else {