mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-23 08:27:30 +00:00
26 lines
851 B
Java
26 lines
851 B
Java
|
package org.thoughtcrime.securesms.notifications;
|
||
|
|
||
|
import android.content.Context;
|
||
|
import android.support.annotation.NonNull;
|
||
|
|
||
|
import org.thoughtcrime.securesms.database.RecipientDatabase;
|
||
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||
|
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||
|
|
||
|
public enum ReplyMethod {
|
||
|
|
||
|
GroupMessage,
|
||
|
SecureMessage,
|
||
|
UnsecuredSmsMessage;
|
||
|
|
||
|
public static @NonNull ReplyMethod forRecipient(Context context, Recipient recipient) {
|
||
|
if (recipient.isGroupRecipient()) {
|
||
|
return ReplyMethod.GroupMessage;
|
||
|
} else if (TextSecurePreferences.isPushRegistered(context) && recipient.getRegistered() == RecipientDatabase.RegisteredState.REGISTERED && !recipient.isForceSmsSelection()) {
|
||
|
return ReplyMethod.SecureMessage;
|
||
|
} else {
|
||
|
return ReplyMethod.UnsecuredSmsMessage;
|
||
|
}
|
||
|
}
|
||
|
}
|