Remove old profile sharing UI.

This commit is contained in:
Greyson Parrelli
2020-11-12 12:01:43 -05:00
committed by GitHub
parent 3fc4b098e8
commit 3b2a5f1ce3
14 changed files with 7 additions and 372 deletions

View File

@@ -99,10 +99,8 @@ final class MessageRequestRepository {
}
return MessageRequestState.REQUIRED;
} else if (FeatureFlags.modernProfileSharing() && !RecipientUtil.isLegacyProfileSharingAccepted(recipient) && threadId > 0) {
} else if (!RecipientUtil.isLegacyProfileSharingAccepted(recipient) && threadId > 0) {
return MessageRequestState.REQUIRED;
} else if (RecipientUtil.isPreMessageRequestThread(context, threadId) && !RecipientUtil.isLegacyProfileSharingAccepted(recipient)) {
return MessageRequestState.PRE_MESSAGE_REQUEST;
} else {
return MessageRequestState.NOT_REQUIRED;
}
@@ -261,9 +259,6 @@ final class MessageRequestRepository {
NOT_REQUIRED,
/** Explicit message request permission is required. */
REQUIRED,
/** This conversation existed before message requests and needs the old UI */
PRE_MESSAGE_REQUEST
REQUIRED
}
}

View File

@@ -225,9 +225,6 @@ public class MessageRequestViewModel extends ViewModel {
case REQUIRED:
displayState.postValue(DisplayState.DISPLAY_MESSAGE_REQUEST);
break;
case PRE_MESSAGE_REQUEST:
displayState.postValue(DisplayState.DISPLAY_PRE_MESSAGE_REQUEST);
break;
}
});
}
@@ -237,8 +234,7 @@ public class MessageRequestViewModel extends ViewModel {
Context context = ApplicationDependencies.getApplication();
Long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipient.getId());
return FeatureFlags.modernProfileSharing() &&
threadId != null &&
return threadId != null &&
(RecipientUtil.hasSentMessageInThread(context, threadId) || RecipientUtil.isPreMessageRequestThread(context, threadId));
}
@@ -283,7 +279,7 @@ public class MessageRequestViewModel extends ViewModel {
}
public enum DisplayState {
DISPLAY_MESSAGE_REQUEST, DISPLAY_PRE_MESSAGE_REQUEST, DISPLAY_NONE
DISPLAY_MESSAGE_REQUEST, DISPLAY_NONE
}
public enum MessageClass {