From dda5a9e3da7fe3130988c68b2b7080531fe600d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Kr=C3=BCger?= Date: Wed, 21 Sep 2022 10:49:48 +0200 Subject: [PATCH] Define 'BundleKeys' as 'const' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During the migration from Java to Kotlin this was not done and resulted in BundleKeys.INSTANCE.getKEY_CALL_VOICE_ONLY() instead of BundleKeys.KEY_CALL_VOICE_ONLY Signed-off-by: Tim Krüger --- .../talk/activities/CallActivity.java | 32 ++++-- .../activities/CallNotificationActivity.java | 14 +-- .../jobs/AddParticipantsToConversation.java | 12 +- .../talk/jobs/CapabilitiesWorker.java | 2 +- .../talk/jobs/DeleteConversationWorker.java | 4 +- .../talk/jobs/LeaveConversationWorker.java | 4 +- .../talk/jobs/NotificationWorker.java | 34 +++--- .../talk/jobs/SignalingSettingsWorker.java | 2 +- .../nextcloud/talk/utils/bundle/BundleKeys.kt | 104 +++++++++--------- .../talk/webrtc/MagicWebSocketInstance.java | 4 +- 10 files changed, 111 insertions(+), 101 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index f0a1ddeb2..2518c10bd 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -2,6 +2,8 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Tim Krüger + * Copyright (C) 2022 Tim Krüger * Copyright (C) 2017-2018 Mario Danic * * This program is free software: you can redistribute it and/or modify @@ -90,7 +92,6 @@ import com.nextcloud.talk.utils.ApiUtils; import com.nextcloud.talk.utils.DisplayUtils; import com.nextcloud.talk.utils.NotificationUtils; import com.nextcloud.talk.utils.animations.PulseAnimation; -import com.nextcloud.talk.utils.bundle.BundleKeys; import com.nextcloud.talk.utils.permissions.PlatformPermissionUtil; import com.nextcloud.talk.utils.power.PowerManagerUtils; import com.nextcloud.talk.utils.preferences.AppPreferences; @@ -163,6 +164,15 @@ import okhttp3.Cache; import pub.devrel.easypermissions.AfterPermissionGranted; import static android.app.PendingIntent.FLAG_IMMUTABLE; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_VOICE_ONLY; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CALL_WITHOUT_NOTIFICATION; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CONVERSATION_NAME; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CONVERSATION_PASSWORD; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_FROM_NOTIFICATION_START_CALL; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_MODIFIED_BASE_URL; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_ID; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN; +import static com.nextcloud.talk.utils.bundle.BundleKeys.KEY_USER_ENTITY; import static com.nextcloud.talk.webrtc.Globals.JOB_ID; import static com.nextcloud.talk.webrtc.Globals.PARTICIPANTS_UPDATE; import static com.nextcloud.talk.webrtc.Globals.ROOM_TOKEN; @@ -297,21 +307,21 @@ public class CallActivity extends CallBaseActivity { hideNavigationIfNoPipAvailable(); Bundle extras = getIntent().getExtras(); - roomId = extras.getString(BundleKeys.INSTANCE.getKEY_ROOM_ID(), ""); - roomToken = extras.getString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), ""); - conversationUser = extras.getParcelable(BundleKeys.INSTANCE.getKEY_USER_ENTITY()); - conversationPassword = extras.getString(BundleKeys.INSTANCE.getKEY_CONVERSATION_PASSWORD(), ""); - conversationName = extras.getString(BundleKeys.INSTANCE.getKEY_CONVERSATION_NAME(), ""); - isVoiceOnlyCall = extras.getBoolean(BundleKeys.INSTANCE.getKEY_CALL_VOICE_ONLY(), false); - isCallWithoutNotification = extras.getBoolean(BundleKeys.INSTANCE.getKEY_CALL_WITHOUT_NOTIFICATION(), false); + roomId = extras.getString(KEY_ROOM_ID, ""); + roomToken = extras.getString(KEY_ROOM_TOKEN, ""); + conversationUser = extras.getParcelable(KEY_USER_ENTITY); + conversationPassword = extras.getString(KEY_CONVERSATION_PASSWORD, ""); + conversationName = extras.getString(KEY_CONVERSATION_NAME, ""); + isVoiceOnlyCall = extras.getBoolean(KEY_CALL_VOICE_ONLY, false); + isCallWithoutNotification = extras.getBoolean(KEY_CALL_WITHOUT_NOTIFICATION, false); - if (extras.containsKey(BundleKeys.INSTANCE.getKEY_FROM_NOTIFICATION_START_CALL())) { - isIncomingCallFromNotification = extras.getBoolean(BundleKeys.INSTANCE.getKEY_FROM_NOTIFICATION_START_CALL()); + if (extras.containsKey(KEY_FROM_NOTIFICATION_START_CALL)) { + isIncomingCallFromNotification = extras.getBoolean(KEY_FROM_NOTIFICATION_START_CALL); } credentials = ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken()); - baseUrl = extras.getString(BundleKeys.INSTANCE.getKEY_MODIFIED_BASE_URL(), ""); + baseUrl = extras.getString(KEY_MODIFIED_BASE_URL, ""); if (TextUtils.isEmpty(baseUrl)) { baseUrl = conversationUser.getBaseUrl(); } diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java index acaa16e64..f0d3c6303 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallNotificationActivity.java @@ -129,9 +129,9 @@ public class CallNotificationActivity extends CallBaseActivity { eventBus.post(new CallNotificationClick()); Bundle extras = getIntent().getExtras(); - this.roomId = extras.getString(BundleKeys.INSTANCE.getKEY_ROOM_ID(), ""); - this.currentConversation = Parcels.unwrap(extras.getParcelable(BundleKeys.INSTANCE.getKEY_ROOM())); - this.userBeingCalled = extras.getParcelable(BundleKeys.INSTANCE.getKEY_USER_ENTITY()); + this.roomId = extras.getString(BundleKeys.KEY_ROOM_ID, ""); + this.currentConversation = Parcels.unwrap(extras.getParcelable(BundleKeys.KEY_ROOM)); + this.userBeingCalled = extras.getParcelable(BundleKeys.KEY_USER_ENTITY); this.originalBundle = extras; credentials = ApiUtils.getCredentials(userBeingCalled.getUsername(), userBeingCalled.getToken()); @@ -169,13 +169,13 @@ public class CallNotificationActivity extends CallBaseActivity { private void initClickListeners() { binding.callAnswerVoiceOnlyView.setOnClickListener(l -> { Log.d(TAG, "accept call (voice only)"); - originalBundle.putBoolean(BundleKeys.INSTANCE.getKEY_CALL_VOICE_ONLY(), true); + originalBundle.putBoolean(BundleKeys.KEY_CALL_VOICE_ONLY, true); proceedToCall(); }); binding.callAnswerCameraView.setOnClickListener(l -> { Log.d(TAG, "accept call (with video)"); - originalBundle.putBoolean(BundleKeys.INSTANCE.getKEY_CALL_VOICE_ONLY(), false); + originalBundle.putBoolean(BundleKeys.KEY_CALL_VOICE_ONLY, false); proceedToCall(); }); @@ -202,8 +202,8 @@ public class CallNotificationActivity extends CallBaseActivity { } private void proceedToCall() { - originalBundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), currentConversation.getToken()); - originalBundle.putString(BundleKeys.INSTANCE.getKEY_CONVERSATION_NAME(), currentConversation.getDisplayName()); + originalBundle.putString(BundleKeys.KEY_ROOM_TOKEN, currentConversation.getToken()); + originalBundle.putString(BundleKeys.KEY_CONVERSATION_NAME, currentConversation.getDisplayName()); Intent intent = new Intent(this, CallActivity.class); intent.putExtras(originalBundle); diff --git a/app/src/main/java/com/nextcloud/talk/jobs/AddParticipantsToConversation.java b/app/src/main/java/com/nextcloud/talk/jobs/AddParticipantsToConversation.java index 6fe0a7330..4417b096c 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/AddParticipantsToConversation.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/AddParticipantsToConversation.java @@ -63,18 +63,18 @@ public class AddParticipantsToConversation extends Worker { @Override public Result doWork() { Data data = getInputData(); - String[] selectedUserIds = data.getStringArray(BundleKeys.INSTANCE.getKEY_SELECTED_USERS()); - String[] selectedGroupIds = data.getStringArray(BundleKeys.INSTANCE.getKEY_SELECTED_GROUPS()); - String[] selectedCircleIds = data.getStringArray(BundleKeys.INSTANCE.getKEY_SELECTED_CIRCLES()); - String[] selectedEmails = data.getStringArray(BundleKeys.INSTANCE.getKEY_SELECTED_EMAILS()); + String[] selectedUserIds = data.getStringArray(BundleKeys.KEY_SELECTED_USERS); + String[] selectedGroupIds = data.getStringArray(BundleKeys.KEY_SELECTED_GROUPS); + String[] selectedCircleIds = data.getStringArray(BundleKeys.KEY_SELECTED_CIRCLES); + String[] selectedEmails = data.getStringArray(BundleKeys.KEY_SELECTED_EMAILS); User user = userManager.getUserWithInternalId( - data.getLong(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), -1)) + data.getLong(BundleKeys.KEY_INTERNAL_USER_ID, -1)) .blockingGet(); int apiVersion = ApiUtils.getConversationApiVersion(user, new int[] {ApiUtils.APIv4, 1}); - String conversationToken = data.getString(BundleKeys.INSTANCE.getKEY_TOKEN()); + String conversationToken = data.getString(BundleKeys.KEY_TOKEN); String credentials = ApiUtils.getCredentials(user.getUsername(), user.getToken()); RetrofitBucket retrofitBucket; diff --git a/app/src/main/java/com/nextcloud/talk/jobs/CapabilitiesWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/CapabilitiesWorker.java index 3c8b20115..ba20aab32 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/CapabilitiesWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/CapabilitiesWorker.java @@ -109,7 +109,7 @@ public class CapabilitiesWorker extends Worker { Data data = getInputData(); - long internalUserId = data.getLong(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), -1); + long internalUserId = data.getLong(BundleKeys.KEY_INTERNAL_USER_ID, -1); List userEntityObjectList = new ArrayList<>(); boolean userExists = userManager.getUserWithInternalId(internalUserId).isEmpty().blockingGet(); diff --git a/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java index 0f888b3d0..16e5851b6 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/DeleteConversationWorker.java @@ -75,8 +75,8 @@ public class DeleteConversationWorker extends Worker { @Override public Result doWork() { Data data = getInputData(); - long operationUserId = data.getLong(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), -1); - String conversationToken = data.getString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN()); + long operationUserId = data.getLong(BundleKeys.KEY_INTERNAL_USER_ID, -1); + String conversationToken = data.getString(BundleKeys.KEY_ROOM_TOKEN); User operationUser = userManager.getUserWithId(operationUserId).blockingGet(); if (operationUser != null) { diff --git a/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java index fcf633c02..87b15e690 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/LeaveConversationWorker.java @@ -79,8 +79,8 @@ public class LeaveConversationWorker extends Worker { @Override public Result doWork() { Data data = getInputData(); - long operationUserId = data.getLong(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), -1); - String conversationToken = data.getString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN()); + long operationUserId = data.getLong(BundleKeys.KEY_INTERNAL_USER_ID, -1); + String conversationToken = data.getString(BundleKeys.KEY_ROOM_TOKEN); User operationUser = userManager.getUserWithId(operationUserId).blockingGet(); if (operationUser != null) { diff --git a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java index 3f7288fae..efcb75dc7 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java @@ -138,7 +138,7 @@ public class NotificationWorker extends Worker { importantConversation = arbitraryStorageManager.getStorageSetting( UserIdUtils.INSTANCE.getIdForUser(user), "important_conversation", - intent.getExtras().getString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN())) + intent.getExtras().getString(BundleKeys.KEY_ROOM_TOKEN)) .map(arbitraryStorage -> { if (arbitraryStorage != null && arbitraryStorage.getValue() != null) { return Boolean.parseBoolean(arbitraryStorage.getValue()); @@ -154,7 +154,7 @@ public class NotificationWorker extends Worker { int apiVersion = ApiUtils.getConversationApiVersion(user, new int[] {ApiUtils.APIv4, 1}); ncApi.getRoom(credentials, ApiUtils.getUrlForRoom(apiVersion, user.getBaseUrl(), - intent.getExtras().getString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN()))) + intent.getExtras().getString(BundleKeys.KEY_ROOM_TOKEN))) .blockingSubscribe(new Observer() { @Override public void onSubscribe(Disposable d) { @@ -165,7 +165,7 @@ public class NotificationWorker extends Worker { public void onNext(RoomOverall roomOverall) { Conversation conversation = roomOverall.getOcs().getData(); - intent.putExtra(BundleKeys.INSTANCE.getKEY_ROOM(), Parcels.wrap(conversation)); + intent.putExtra(BundleKeys.KEY_ROOM, Parcels.wrap(conversation)); if (conversation.getType().equals(Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) || (!TextUtils.isEmpty(conversation.getObjectType()) && "share:password".equals (conversation.getObjectType()))) { @@ -351,12 +351,12 @@ public class NotificationWorker extends Worker { } Bundle notificationInfo = new Bundle(); - notificationInfo.putLong(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), + notificationInfo.putLong(BundleKeys.KEY_INTERNAL_USER_ID, signatureVerification.getUser().getId()); // could be an ID or a TOKEN - notificationInfo.putString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), + notificationInfo.putString(BundleKeys.KEY_ROOM_TOKEN, decryptedPushMessage.getId()); - notificationInfo.putLong(BundleKeys.INSTANCE.getKEY_NOTIFICATION_ID(), + notificationInfo.putLong(BundleKeys.KEY_NOTIFICATION_ID, decryptedPushMessage.getNotificationId()); notificationBuilder.setExtras(notificationInfo); @@ -442,10 +442,10 @@ public class NotificationWorker extends Worker { // NOTE - systemNotificationId is an internal ID used on the device only. // It is NOT the same as the notification ID used in communication with the server. - actualIntent.putExtra(BundleKeys.INSTANCE.getKEY_SYSTEM_NOTIFICATION_ID(), systemNotificationId); - actualIntent.putExtra(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), + actualIntent.putExtra(BundleKeys.KEY_SYSTEM_NOTIFICATION_ID, systemNotificationId); + actualIntent.putExtra(BundleKeys.KEY_INTERNAL_USER_ID, Objects.requireNonNull(signatureVerification.getUser()).getId()); - actualIntent.putExtra(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), decryptedPushMessage.getId()); + actualIntent.putExtra(BundleKeys.KEY_ROOM_TOKEN, decryptedPushMessage.getId()); actualIntent.putExtra(BundleKeys.KEY_MESSAGE_ID, messageId); int intentFlag; @@ -583,8 +583,8 @@ public class NotificationWorker extends Worker { context = getApplicationContext(); Data data = getInputData(); - String subject = data.getString(BundleKeys.INSTANCE.getKEY_NOTIFICATION_SUBJECT()); - String signature = data.getString(BundleKeys.INSTANCE.getKEY_NOTIFICATION_SIGNATURE()); + String subject = data.getString(BundleKeys.KEY_NOTIFICATION_SUBJECT); + String signature = data.getString(BundleKeys.KEY_NOTIFICATION_SIGNATURE); try { byte[] base64DecodedSubject = Base64.decode(subject, Base64.DEFAULT); @@ -643,13 +643,13 @@ public class NotificationWorker extends Worker { intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); - bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), decryptedPushMessage.getId()); + bundle.putString(BundleKeys.KEY_ROOM_TOKEN, decryptedPushMessage.getId()); - bundle.putParcelable(BundleKeys.INSTANCE.getKEY_USER_ENTITY(), + bundle.putParcelable(BundleKeys.KEY_USER_ENTITY, signatureVerification.getUser()); - bundle.putBoolean(BundleKeys.INSTANCE.getKEY_FROM_NOTIFICATION_START_CALL(), - startACall); + bundle.putBoolean(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL, + startACall); intent.putExtras(bundle); @@ -657,12 +657,12 @@ public class NotificationWorker extends Worker { switch (decryptedPushMessage.getType()) { case "call": - if (bundle.containsKey(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN())) { + if (bundle.containsKey(BundleKeys.KEY_ROOM_TOKEN)) { showNotificationForCallWithNoPing(intent); } break; case "room": - if (bundle.containsKey(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN())) { + if (bundle.containsKey(BundleKeys.KEY_ROOM_TOKEN)) { showNotificationWithObjectData(intent); } break; diff --git a/app/src/main/java/com/nextcloud/talk/jobs/SignalingSettingsWorker.java b/app/src/main/java/com/nextcloud/talk/jobs/SignalingSettingsWorker.java index 77017637e..cdaf5a92f 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/SignalingSettingsWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/SignalingSettingsWorker.java @@ -74,7 +74,7 @@ public class SignalingSettingsWorker extends Worker { Data data = getInputData(); - long internalUserId = data.getLong(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), -1); + long internalUserId = data.getLong(BundleKeys.KEY_INTERNAL_USER_ID, -1); List userEntityObjectList = new ArrayList<>(); boolean userExists = userManager.getUserWithInternalId(internalUserId).isEmpty().blockingGet(); diff --git a/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt b/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt index 75ca6b9d3..683428bea 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt +++ b/app/src/main/java/com/nextcloud/talk/utils/bundle/BundleKeys.kt @@ -2,6 +2,8 @@ * Nextcloud Talk application * * @author Mario Danic + * @author Tim Krüger + * Copyright (C) 2022 Tim Krüger * Copyright (C) 2017 Mario Danic * * This program is free software: you can redistribute it and/or modify @@ -21,58 +23,56 @@ package com.nextcloud.talk.utils.bundle object BundleKeys { - val KEY_SELECTED_USERS = "KEY_SELECTED_USERS" - val KEY_SELECTED_GROUPS = "KEY_SELECTED_GROUPS" - val KEY_SELECTED_CIRCLES = "KEY_SELECTED_CIRCLES" - val KEY_SELECTED_EMAILS = "KEY_SELECTED_EMAILS" - val KEY_USERNAME = "KEY_USERNAME" - val KEY_TOKEN = "KEY_TOKEN" - val KEY_BASE_URL = "KEY_BASE_URL" - val KEY_IS_ACCOUNT_IMPORT = "KEY_IS_ACCOUNT_IMPORT" - val KEY_ORIGINAL_PROTOCOL = "KEY_ORIGINAL_PROTOCOL" - val KEY_ROOM = "KEY_CONVERSATION" - val KEY_OPERATION_CODE = "KEY_OPERATION_CODE" - val KEY_MENU_TYPE = "KEY_MENU_TYPE" - val KEY_SHARE_INTENT = "KEY_SHARE_INTENT" - val KEY_APP_ITEM_PACKAGE_NAME = "KEY_APP_ITEM_PACKAGE_NAME" - val KEY_APP_ITEM_NAME = "KEY_APP_ITEM_NAME" - val KEY_CONVERSATION_PASSWORD = "KEY_CONVERSATION_PASSWORD" - val KEY_ROOM_TOKEN = "KEY_ROOM_TOKEN" - val KEY_ROOM_ONE_TO_ONE = "KEY_ROOM_ONE_TO_ONE" - val KEY_USER_ENTITY = "KEY_USER_ENTITY" - val KEY_NEW_CONVERSATION = "KEY_NEW_CONVERSATION" - val KEY_ADD_PARTICIPANTS = "KEY_ADD_PARTICIPANTS" - val KEY_EXISTING_PARTICIPANTS = "KEY_EXISTING_PARTICIPANTS" - val KEY_CALL_URL = "KEY_CALL_URL" - val KEY_MODIFIED_BASE_URL = "KEY_MODIFIED_BASE_URL" - val KEY_NOTIFICATION_SUBJECT = "KEY_NOTIFICATION_SUBJECT" - val KEY_NOTIFICATION_SIGNATURE = "KEY_NOTIFICATION_SIGNATURE" - val KEY_INTERNAL_USER_ID = "KEY_INTERNAL_USER_ID" - val KEY_CONVERSATION_TYPE = "KEY_CONVERSATION_TYPE" - val KEY_INVITED_PARTICIPANTS = "KEY_INVITED_PARTICIPANTS" - val KEY_INVITED_CIRCLE = "KEY_INVITED_CIRCLE" - val KEY_INVITED_GROUP = "KEY_INVITED_GROUP" - val KEY_INVITED_EMAIL = "KEY_INVITED_EMAIL" - val KEY_CONVERSATION_NAME = "KEY_CONVERSATION_NAME" - val KEY_CALL_VOICE_ONLY = "KEY_CALL_VOICE_ONLY" - val KEY_CALL_WITHOUT_NOTIFICATION = "KEY_CALL_WITHOUT_NOTIFICATION" - val KEY_ACTIVE_CONVERSATION = "KEY_ACTIVE_CONVERSATION" - val KEY_SERVER_CAPABILITIES = "KEY_SERVER_CAPABILITIES" - val KEY_FROM_NOTIFICATION_START_CALL = "KEY_FROM_NOTIFICATION_START_CALL" - val KEY_ROOM_ID = "KEY_ROOM_ID" - val KEY_ARE_CALL_SOUNDS = "KEY_ARE_CALL_SOUNDS" - val KEY_BROWSER_TYPE = "KEY_BROWSER_TYPE" - val KEY_FILE_PATHS = "KEY_FILE_PATHS" - val KEY_ACCOUNT = "KEY_ACCOUNT" - val KEY_FILE_ID = "KEY_FILE_ID" - val KEY_NOTIFICATION_ID = "KEY_NOTIFICATION_ID" - val KEY_SHARED_TEXT = "KEY_SHARED_TEXT" - val KEY_GEOCODING_QUERY = "KEY_GEOCODING_QUERY" - val KEY_META_DATA = "KEY_META_DATA" - val KEY_FORWARD_MSG_FLAG = "KEY_FORWARD_MSG_FLAG" - val KEY_FORWARD_MSG_TEXT = "KEY_FORWARD_MSG_TEXT" - val KEY_FORWARD_HIDE_SOURCE_ROOM = "KEY_FORWARD_HIDE_SOURCE_ROOM" - val KEY_SYSTEM_NOTIFICATION_ID = "KEY_SYSTEM_NOTIFICATION_ID" + const val KEY_SELECTED_USERS = "KEY_SELECTED_USERS" + const val KEY_SELECTED_GROUPS = "KEY_SELECTED_GROUPS" + const val KEY_SELECTED_CIRCLES = "KEY_SELECTED_CIRCLES" + const val KEY_SELECTED_EMAILS = "KEY_SELECTED_EMAILS" + const val KEY_USERNAME = "KEY_USERNAME" + const val KEY_TOKEN = "KEY_TOKEN" + const val KEY_BASE_URL = "KEY_BASE_URL" + const val KEY_IS_ACCOUNT_IMPORT = "KEY_IS_ACCOUNT_IMPORT" + const val KEY_ORIGINAL_PROTOCOL = "KEY_ORIGINAL_PROTOCOL" + const val KEY_ROOM = "KEY_CONVERSATION" + const val KEY_OPERATION_CODE = "KEY_OPERATION_CODE" + const val KEY_SHARE_INTENT = "KEY_SHARE_INTENT" + const val KEY_APP_ITEM_PACKAGE_NAME = "KEY_APP_ITEM_PACKAGE_NAME" + const val KEY_APP_ITEM_NAME = "KEY_APP_ITEM_NAME" + const val KEY_CONVERSATION_PASSWORD = "KEY_CONVERSATION_PASSWORD" + const val KEY_ROOM_TOKEN = "KEY_ROOM_TOKEN" + const val KEY_ROOM_ONE_TO_ONE = "KEY_ROOM_ONE_TO_ONE" + const val KEY_USER_ENTITY = "KEY_USER_ENTITY" + const val KEY_NEW_CONVERSATION = "KEY_NEW_CONVERSATION" + const val KEY_ADD_PARTICIPANTS = "KEY_ADD_PARTICIPANTS" + const val KEY_EXISTING_PARTICIPANTS = "KEY_EXISTING_PARTICIPANTS" + const val KEY_CALL_URL = "KEY_CALL_URL" + const val KEY_MODIFIED_BASE_URL = "KEY_MODIFIED_BASE_URL" + const val KEY_NOTIFICATION_SUBJECT = "KEY_NOTIFICATION_SUBJECT" + const val KEY_NOTIFICATION_SIGNATURE = "KEY_NOTIFICATION_SIGNATURE" + const val KEY_INTERNAL_USER_ID = "KEY_INTERNAL_USER_ID" + const val KEY_CONVERSATION_TYPE = "KEY_CONVERSATION_TYPE" + const val KEY_INVITED_PARTICIPANTS = "KEY_INVITED_PARTICIPANTS" + const val KEY_INVITED_CIRCLE = "KEY_INVITED_CIRCLE" + const val KEY_INVITED_GROUP = "KEY_INVITED_GROUP" + const val KEY_INVITED_EMAIL = "KEY_INVITED_EMAIL" + const val KEY_CONVERSATION_NAME = "KEY_CONVERSATION_NAME" + const val KEY_CALL_VOICE_ONLY = "KEY_CALL_VOICE_ONLY" + const val KEY_CALL_WITHOUT_NOTIFICATION = "KEY_CALL_WITHOUT_NOTIFICATION" + const val KEY_ACTIVE_CONVERSATION = "KEY_ACTIVE_CONVERSATION" + const val KEY_SERVER_CAPABILITIES = "KEY_SERVER_CAPABILITIES" + const val KEY_FROM_NOTIFICATION_START_CALL = "KEY_FROM_NOTIFICATION_START_CALL" + const val KEY_ROOM_ID = "KEY_ROOM_ID" + const val KEY_ARE_CALL_SOUNDS = "KEY_ARE_CALL_SOUNDS" + const val KEY_FILE_PATHS = "KEY_FILE_PATHS" + const val KEY_ACCOUNT = "KEY_ACCOUNT" + const val KEY_FILE_ID = "KEY_FILE_ID" + const val KEY_NOTIFICATION_ID = "KEY_NOTIFICATION_ID" + const val KEY_SHARED_TEXT = "KEY_SHARED_TEXT" + const val KEY_GEOCODING_QUERY = "KEY_GEOCODING_QUERY" + const val KEY_META_DATA = "KEY_META_DATA" + const val KEY_FORWARD_MSG_FLAG = "KEY_FORWARD_MSG_FLAG" + const val KEY_FORWARD_MSG_TEXT = "KEY_FORWARD_MSG_TEXT" + const val KEY_FORWARD_HIDE_SOURCE_ROOM = "KEY_FORWARD_HIDE_SOURCE_ROOM" + const val KEY_SYSTEM_NOTIFICATION_ID = "KEY_SYSTEM_NOTIFICATION_ID" const val KEY_MESSAGE_ID = "KEY_MESSAGE_ID" const val KEY_MIME_TYPE_FILTER = "KEY_MIME_TYPE_FILTER" } diff --git a/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java b/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java index a97b638bc..f8e1ef422 100644 --- a/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java +++ b/app/src/main/java/com/nextcloud/talk/webrtc/MagicWebSocketInstance.java @@ -244,8 +244,8 @@ public class MagicWebSocketInstance extends WebSocketListener { shouldRefreshChat = (boolean) chatMap.get("refresh"); if (shouldRefreshChat) { HashMap refreshChatHashMap = new HashMap<>(); - refreshChatHashMap.put(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), (String) messageHashMap.get("roomid")); - refreshChatHashMap.put(BundleKeys.INSTANCE.getKEY_INTERNAL_USER_ID(), Long.toString(conversationUser.getId())); + refreshChatHashMap.put(BundleKeys.KEY_ROOM_TOKEN, (String) messageHashMap.get("roomid")); + refreshChatHashMap.put(BundleKeys.KEY_INTERNAL_USER_ID, Long.toString(conversationUser.getId())); eventBus.post(new WebSocketCommunicationEvent("refreshChat", refreshChatHashMap)); } }