remove (hopefully unused) code regarding GUEST and USER_FOLLOWING_LINK

I can't reproduce or think of scenarios when this code was used. because bottom dialog is replaced it wouldn't work anymore anyway.
If there appear scenarios when the code would have executed, it should be fixed similar like ConversationsListBottomDialog was implemented.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-02-15 11:49:20 +01:00
parent 59d821c211
commit eceb545589
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -803,26 +803,6 @@ public class ConversationsListController extends BaseController implements Searc
return onQueryTextChange(query);
}
// TODO check when this is executed and if handling is correct
private void prepareAndShowBottomSheetWithBundle(Bundle bundle) {
if (view == null) {
view = getActivity().getLayoutInflater().inflate(R.layout.bottom_sheet, null, false);
}
// if (shouldShowCallMenuController) {
// getChildRouter((ViewGroup) view).setRoot(
// RouterTransaction.with(new CallMenuController(bundle, this))
// .popChangeHandler(new VerticalChangeHandler())
// .pushChangeHandler(new VerticalChangeHandler()));
// } else {
getChildRouter((ViewGroup) view).setRoot(
RouterTransaction.with(new EntryMenuController(bundle))
.popChangeHandler(new VerticalChangeHandler())
.pushChangeHandler(new VerticalChangeHandler()));
// }
}
@Override
protected String getTitle() {
return getResources().getString(R.string.nc_app_product_name);
@ -1017,38 +997,14 @@ public class ConversationsListController extends BaseController implements Searc
private void openConversation(String textToPaste) {
Bundle bundle = new Bundle();
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_USER_ENTITY(), currentUser);
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(), Parcels.wrap(selectedConversation));
bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), selectedConversation.getToken());
bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_ID(), selectedConversation.getRoomId());
bundle.putString(BundleKeys.INSTANCE.getKEY_SHARED_TEXT(), textToPaste);
// TODO check when this is executed and if handling is correct
// when is hasPassword && ParticipantType.GUEST true? currently the app can't be used as guest?!
// when is USER_FOLLOWING_LINK true? --> from contactsController via enter link?
if ((selectedConversation.hasPassword
&& selectedConversation.participantType == Participant.ParticipantType.GUEST)
|| selectedConversation.participantType == Participant.ParticipantType.USER_FOLLOWING_LINK) {
bundle.putSerializable(BundleKeys.INSTANCE.getKEY_OPERATION_CODE(), ConversationOperationEnum.JOIN_ROOM);
prepareAndShowBottomSheetWithBundle(bundle);
// instead to use prepareAnd...
// use something like
//
// conversationOperationDialog = new ConversationOperationDialog(
// getActivity(),
// this,
// userUtils.getCurrentUser(),
// conversation);
// conversationOperationDialog.show();
} else {
currentUser = userUtils.getCurrentUser();
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_ACTIVE_CONVERSATION(), Parcels.wrap(selectedConversation));
ConductorRemapping.INSTANCE.remapChatController(getRouter(), currentUser.getId(),
selectedConversation.getToken(), bundle, false);
}
}
@Subscribe(sticky = true, threadMode = ThreadMode.BACKGROUND)
public void onMessageEvent(EventStatus eventStatus) {