Browse Source

rename enum, add todo

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Marcel Hibbe 3 years ago
parent
commit
809e277855

+ 1 - 1
app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java

@@ -935,7 +935,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
     @OnClick(R.id.joinConversationViaLinkRelativeLayout)
     void joinConversationViaLink() {
         Bundle bundle = new Bundle();
-        bundle.putSerializable(BundleKeys.INSTANCE.getKEY_OPERATION_CODE(), ConversationOperationEnum.GET_JOIN_ROOM);
+        bundle.putSerializable(BundleKeys.INSTANCE.getKEY_OPERATION_CODE(), ConversationOperationEnum.GET_AND_JOIN_ROOM);
 
         prepareAndShowBottomSheetWithBundle(bundle);
     }

+ 2 - 1
app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java

@@ -803,6 +803,7 @@ 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);
@@ -1020,7 +1021,7 @@ public class ConversationsListController extends BaseController implements Searc
         bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_ID(), selectedConversation.getRoomId());
         bundle.putString(BundleKeys.INSTANCE.getKEY_SHARED_TEXT(), textToPaste);
 
-        // TODO debug & fix dialog???
+        // 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

+ 13 - 13
app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/ConversationOperationEnum.kt

@@ -1,17 +1,17 @@
 package com.nextcloud.talk.controllers.bottomsheet
 
 enum class ConversationOperationEnum {
-    RENAME_ROOM, // 2
-    MAKE_PUBLIC, // 3
-    CHANGE_PASSWORD, // 4
-    CLEAR_PASSWORD, // 5
-    SET_PASSWORD, // 6
-    SHARE_LINK, // 7
-    MAKE_PRIVATE, // 8
-    GET_JOIN_ROOM, // 10          diff to 99?!
-    INVITE_USERS, // 11
-    MARK_AS_READ, // 96
-    REMOVE_FAVORITE, // 97
-    ADD_FAVORITE, // 98
-    JOIN_ROOM, // 99             diff to 10?!
+    RENAME_ROOM,
+    MAKE_PUBLIC,
+    CHANGE_PASSWORD,
+    CLEAR_PASSWORD,
+    SET_PASSWORD,
+    SHARE_LINK,
+    MAKE_PRIVATE,
+    GET_AND_JOIN_ROOM,
+    INVITE_USERS,
+    MARK_AS_READ,
+    REMOVE_FAVORITE,
+    ADD_FAVORITE,
+    JOIN_ROOM
 }

+ 3 - 4
app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.java

@@ -155,7 +155,7 @@ public class EntryMenuController extends BaseController {
             getRouter().pushController(RouterTransaction.with(new OperationsMenuController(bundle))
                     .pushChangeHandler(new HorizontalChangeHandler())
                     .popChangeHandler(new HorizontalChangeHandler()));
-        } else if (operation != ConversationOperationEnum.SHARE_LINK && operation != ConversationOperationEnum.GET_JOIN_ROOM && operation != ConversationOperationEnum.INVITE_USERS) {
+        } else if (operation != ConversationOperationEnum.SHARE_LINK && operation != ConversationOperationEnum.GET_AND_JOIN_ROOM && operation != ConversationOperationEnum.INVITE_USERS) {
             bundle = new Bundle();
             if (operation == ConversationOperationEnum.CHANGE_PASSWORD || operation == ConversationOperationEnum.SET_PASSWORD) {
                 conversation.setPassword(editText.getText().toString());
@@ -238,7 +238,7 @@ public class EntryMenuController extends BaseController {
                             }
                             textInputLayout.setError(getResources().getString(R.string.nc_call_name_is_same));
                         }
-                    } else if (operation != ConversationOperationEnum.GET_JOIN_ROOM) {
+                    } else if (operation != ConversationOperationEnum.GET_AND_JOIN_ROOM) {
                         if (!proceedButton.isEnabled()) {
                             proceedButton.setEnabled(true);
                             proceedButton.setAlpha(1.0f);
@@ -247,7 +247,6 @@ public class EntryMenuController extends BaseController {
                     } else if ((editText.getText().toString().startsWith("http://") ||
                             editText.getText().toString().startsWith("https://")) &&
                                     editText.getText().toString().contains("/call/")) {
-                        // operation code 10
                         if (!proceedButton.isEnabled()) {
                             proceedButton.setEnabled(true);
                             proceedButton.setAlpha(1.0f);
@@ -312,7 +311,7 @@ public class EntryMenuController extends BaseController {
                 labelText = getResources().getString(R.string.nc_password);
                 editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
                 break;
-            case GET_JOIN_ROOM:
+            case GET_AND_JOIN_ROOM:
                 labelText = getResources().getString(R.string.nc_conversation_link);
                 editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
                 break;

+ 1 - 1
app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java

@@ -322,7 +322,7 @@ public class OperationsMenuController extends BaseController {
                         .retry(1)
                         .subscribe(genericOperationsObserver);
                 break;
-            case GET_JOIN_ROOM:
+            case GET_AND_JOIN_ROOM:
                 ncApi.getRoom(credentials, ApiUtils.getUrlForRoom(apiVersion, baseUrl, conversationToken))
                         .subscribeOn(Schedulers.io())
                         .observeOn(AndroidSchedulers.mainThread())