Browse Source

Fix a bug with unpacking&packing user

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 years ago
parent
commit
5498ad6990

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

@@ -153,7 +153,7 @@ public class CallNotificationController extends BaseController {
 
 
         this.roomId = args.getString(BundleKeys.KEY_ROOM_ID, "");
         this.roomId = args.getString(BundleKeys.KEY_ROOM_ID, "");
         this.currentConversation = Parcels.unwrap(args.getParcelable(BundleKeys.KEY_ROOM));
         this.currentConversation = Parcels.unwrap(args.getParcelable(BundleKeys.KEY_ROOM));
-        this.userBeingCalled = Parcels.unwrap(args.getParcelable(BundleKeys.KEY_USER_ENTITY));
+        this.userBeingCalled = args.getParcelable(BundleKeys.KEY_USER_ENTITY);
 
 
         this.originalBundle = args;
         this.originalBundle = args;
 
 

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

@@ -407,7 +407,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
 
 
     private void showConversationInfoScreen() {
     private void showConversationInfoScreen() {
         Bundle bundle = new Bundle();
         Bundle bundle = new Bundle();
-        bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(conversationUser));
+        bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, conversationUser);
         bundle.putString(BundleKeys.KEY_BASE_URL, conversationUser.getBaseUrl());
         bundle.putString(BundleKeys.KEY_BASE_URL, conversationUser.getBaseUrl());
         bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken);
         bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken);
         getRouter().pushController((RouterTransaction.with(new ConversationInfoController(bundle))
         getRouter().pushController((RouterTransaction.with(new ConversationInfoController(bundle))
@@ -1012,7 +1012,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
             Bundle bundle = new Bundle();
             Bundle bundle = new Bundle();
             bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken);
             bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomToken);
             bundle.putString(BundleKeys.KEY_ROOM_ID, roomId);
             bundle.putString(BundleKeys.KEY_ROOM_ID, roomId);
-            bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(conversationUser));
+            bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, conversationUser);
             bundle.putString(BundleKeys.KEY_CONVERSATION_PASSWORD, roomPassword);
             bundle.putString(BundleKeys.KEY_CONVERSATION_PASSWORD, roomPassword);
             bundle.putString(BundleKeys.KEY_MODIFIED_BASE_URL, conversationUser.getBaseUrl());
             bundle.putString(BundleKeys.KEY_MODIFIED_BASE_URL, conversationUser.getBaseUrl());
 
 

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

@@ -281,7 +281,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
                             public void onNext(RoomOverall roomOverall) {
                             public void onNext(RoomOverall roomOverall) {
                                 Intent conversationIntent = new Intent(getActivity(), MagicCallActivity.class);
                                 Intent conversationIntent = new Intent(getActivity(), MagicCallActivity.class);
                                 Bundle bundle = new Bundle();
                                 Bundle bundle = new Bundle();
-                                bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(currentUser));
+                                bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, currentUser);
                                 bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
                                 bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
                                 bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId());
                                 bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId());
 
 
@@ -889,7 +889,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
                                 if (getActivity() != null) {
                                 if (getActivity() != null) {
                                     Intent conversationIntent = new Intent(getActivity(), MagicCallActivity.class);
                                     Intent conversationIntent = new Intent(getActivity(), MagicCallActivity.class);
                                     Bundle bundle = new Bundle();
                                     Bundle bundle = new Bundle();
-                                    bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(currentUser));
+                                    bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, currentUser);
                                     bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
                                     bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken());
                                     bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId());
                                     bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId());
                                     conversationIntent.putExtras(bundle);
                                     conversationIntent.putExtras(bundle);

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

@@ -119,7 +119,7 @@ public class ConversationInfoController extends BaseController {
         super(args);
         super(args);
         setHasOptionsMenu(true);
         setHasOptionsMenu(true);
         NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
         NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
-        conversationUser = Parcels.unwrap(args.getParcelable(BundleKeys.KEY_USER_ENTITY));
+        conversationUser = args.getParcelable(BundleKeys.KEY_USER_ENTITY);
         conversationToken = args.getString(BundleKeys.KEY_ROOM_TOKEN);
         conversationToken = args.getString(BundleKeys.KEY_ROOM_TOKEN);
         baseUrl = args.getString(BundleKeys.KEY_BASE_URL);
         baseUrl = args.getString(BundleKeys.KEY_BASE_URL);
         credentials = ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken());
         credentials = ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken());

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

@@ -663,7 +663,7 @@ public class OperationsMenuController extends BaseController {
         eventBus.post(new BottomSheetLockEvent(true, 0, true, true));
         eventBus.post(new BottomSheetLockEvent(true, 0, true, true));
         Bundle bundle = new Bundle();
         Bundle bundle = new Bundle();
         bundle.putString(BundleKeys.KEY_ROOM_TOKEN, conversation.getToken());
         bundle.putString(BundleKeys.KEY_ROOM_TOKEN, conversation.getToken());
-        bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(currentUser));
+        bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, currentUser);
         if (baseUrl != null && !baseUrl.equals(currentUser.getBaseUrl())) {
         if (baseUrl != null && !baseUrl.equals(currentUser.getBaseUrl())) {
             bundle.putString(BundleKeys.KEY_MODIFIED_BASE_URL, baseUrl);
             bundle.putString(BundleKeys.KEY_MODIFIED_BASE_URL, baseUrl);
         }
         }

+ 1 - 2
app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java

@@ -467,8 +467,7 @@ public class NotificationWorker extends Worker {
                             bundle.putString(BundleKeys.KEY_ROOM_TOKEN, decryptedPushMessage.getId());
                             bundle.putString(BundleKeys.KEY_ROOM_TOKEN, decryptedPushMessage.getId());
                         }
                         }
 
 
-                        bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, Parcels.wrap(signatureVerification
-                                .getUserEntity()));
+                        bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, signatureVerification.getUserEntity());
 
 
                         bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL,
                         bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL,
                                 startACall);
                                 startACall);