mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Remove deprecated SMS fields from recipient table.
This commit is contained in:
@@ -76,7 +76,6 @@ public class RemoteReplyReceiver extends BroadcastReceiver {
|
||||
long threadId;
|
||||
|
||||
Recipient recipient = Recipient.resolved(recipientId);
|
||||
int subscriptionId = recipient.getDefaultSubscriptionId().orElse(-1);
|
||||
long expiresIn = TimeUnit.SECONDS.toMillis(recipient.getExpiresInSeconds());
|
||||
ParentStoryId parentStoryId = groupStoryId != Long.MIN_VALUE ? ParentStoryId.deserialize(groupStoryId) : null;
|
||||
|
||||
@@ -86,7 +85,6 @@ public class RemoteReplyReceiver extends BroadcastReceiver {
|
||||
responseText.toString(),
|
||||
new LinkedList<>(),
|
||||
System.currentTimeMillis(),
|
||||
subscriptionId,
|
||||
expiresIn,
|
||||
false,
|
||||
0,
|
||||
@@ -112,11 +110,6 @@ public class RemoteReplyReceiver extends BroadcastReceiver {
|
||||
threadId = MessageSender.send(context, reply, -1, MessageSender.SendType.SIGNAL, null, null);
|
||||
break;
|
||||
}
|
||||
case UnsecuredSmsMessage: {
|
||||
OutgoingMessage reply = OutgoingMessage.sms(recipient, responseText.toString(), subscriptionId);
|
||||
threadId = MessageSender.send(context, reply, -1, MessageSender.SendType.SMS, null, null);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw new AssertionError("Unknown Reply method");
|
||||
}
|
||||
|
||||
@@ -1,26 +1,19 @@
|
||||
package org.thoughtcrime.securesms.notifications;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.database.RecipientTable;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
|
||||
public enum ReplyMethod {
|
||||
|
||||
GroupMessage,
|
||||
SecureMessage,
|
||||
UnsecuredSmsMessage;
|
||||
SecureMessage;
|
||||
|
||||
public static @NonNull ReplyMethod forRecipient(Context context, Recipient recipient) {
|
||||
public static @NonNull ReplyMethod forRecipient(Recipient recipient) {
|
||||
if (recipient.isGroup()) {
|
||||
return ReplyMethod.GroupMessage;
|
||||
} else if (SignalStore.account().isRegistered() && recipient.getRegistered() == RecipientTable.RegisteredState.REGISTERED && !recipient.isForceSmsSelection()) {
|
||||
return ReplyMethod.SecureMessage;
|
||||
} else {
|
||||
return ReplyMethod.UnsecuredSmsMessage;
|
||||
return ReplyMethod.SecureMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ sealed class NotificationBuilder(protected val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
addActions(ReplyMethod.forRecipient(context, conversation.recipient), conversation)
|
||||
addActions(ReplyMethod.forRecipient(conversation.recipient), conversation)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,6 +504,5 @@ private fun ReplyMethod.toLongDescription(): Int {
|
||||
return when (this) {
|
||||
ReplyMethod.GroupMessage -> R.string.MessageNotifier_reply
|
||||
ReplyMethod.SecureMessage -> R.string.MessageNotifier_signal_message
|
||||
ReplyMethod.UnsecuredSmsMessage -> R.string.MessageNotifier_unsecured_sms
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user