From 48a011bbdb42eb70c9f5cf747a38368ff5b12089 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Fri, 5 Jul 2019 09:40:16 +0200 Subject: [PATCH] Fix #576 Signed-off-by: Mario Danic --- .../talk/controllers/CallController.java | 2 +- .../CallNotificationController.java | 4 +-- .../talk/controllers/ChatController.java | 23 +++++++++------- .../talk/controllers/ContactsController.java | 11 ++++---- .../ConversationInfoController.java | 4 +-- .../ConversationsListController.java | 10 +++---- .../bottomsheet/CallMenuController.java | 2 +- .../bottomsheet/OperationsMenuController.java | 13 +++++---- .../talk/jobs/NotificationWorker.java | 4 +-- .../nextcloud/talk/models/database/User.java | 27 ++++++++++++++++++- .../json/capabilities/SpreedCapability.java | 4 +++ .../talk/models/json/rooms/Conversation.java | 2 +- .../DatabaseStorageModule.java | 2 +- app/src/main/res/values/strings.xml | 2 +- 14 files changed, 68 insertions(+), 42 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallController.java index 83277f709..869a76a50 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallController.java @@ -1120,7 +1120,7 @@ public class CallController extends BaseController { urlToken = roomToken; } - if (!conversationUser.hasSpreedCapabilityWithName("no-ping") && !TextUtils.isEmpty(roomId)) { + if (!conversationUser.hasSpreedFeatureCapability("no-ping") && !TextUtils.isEmpty(roomId)) { NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomId); } else if (!TextUtils.isEmpty(roomToken)) { NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomToken); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java index 3ccbab63b..98cb91938 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallNotificationController.java @@ -26,7 +26,6 @@ import android.graphics.Bitmap; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.ColorDrawable; -import android.graphics.drawable.Drawable; import android.media.AudioAttributes; import android.media.MediaPlayer; import android.net.Uri; @@ -57,7 +56,6 @@ import com.facebook.imagepipeline.core.ImagePipeline; import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber; import com.facebook.imagepipeline.image.CloseableImage; import com.facebook.imagepipeline.postprocessors.BlurPostProcessor; -import com.facebook.imagepipeline.postprocessors.RoundAsCirclePostprocessor; import com.facebook.imagepipeline.request.ImageRequest; import com.nextcloud.talk.R; import com.nextcloud.talk.api.NcApi; @@ -428,7 +426,7 @@ public class CallNotificationController extends BaseController { } if ((AvatarStatusCodeHolder.getInstance().getStatusCode() == 200 || AvatarStatusCodeHolder.getInstance().getStatusCode() == 0) && - userBeingCalled.hasSpreedCapabilityWithName("no-ping")) { + userBeingCalled.hasSpreedFeatureCapability("no-ping")) { if (getActivity() != null) { Bitmap backgroundBitmap = bitmap.copy(bitmap.getConfig(), true); new BlurPostProcessor(5, getActivity()).process(backgroundBitmap); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java index ed114223a..c3d638df5 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ChatController.java @@ -368,7 +368,10 @@ public class ChatController extends BaseController implements MessagesListAdapte InputFilter[] filters = new InputFilter[1]; - filters[0] = new InputFilter.LengthFilter(1000); + int lenghtFilter = conversationUser.getMessageMaxLength(); + + + filters[0] = new InputFilter.LengthFilter(lenghtFilter); messageInput.setFilters(filters); messageInput.addTextChangedListener(new TextWatcher() { @@ -379,8 +382,8 @@ public class ChatController extends BaseController implements MessagesListAdapte @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - if (s.length() == 1000) { - messageInput.setError(Objects.requireNonNull(getResources()).getString(R.string.nc_limit_hit)); + if (s.length() >= lenghtFilter) { + messageInput.setError(String.format(Objects.requireNonNull(getResources()).getString(R.string.nc_limit_hit), Integer.toString(lenghtFilter))); } else { messageInput.setError(null); } @@ -417,7 +420,7 @@ public class ChatController extends BaseController implements MessagesListAdapte messageInputView.getButton().setContentDescription(getResources() .getString(R.string.nc_description_send_message_button)); - if (!conversationUser.getUserId().equals("?") && conversationUser.hasSpreedCapabilityWithName("mention-flag") && getActivity() != null) { + if (!conversationUser.getUserId().equals("?") && conversationUser.hasSpreedFeatureCapability("mention-flag") && getActivity() != null) { getActivity().findViewById(R.id.toolbar).setOnClickListener(v -> showConversationInfoScreen()); } @@ -557,7 +560,7 @@ public class ChatController extends BaseController implements MessagesListAdapte cancelNotificationsForCurrentConversation(); if (inChat) { - if (wasDetached && conversationUser.hasSpreedCapabilityWithName("no-ping")) { + if (wasDetached && conversationUser.hasSpreedFeatureCapability("no-ping")) { wasDetached = false; joinRoomWithPassword(); } @@ -565,7 +568,7 @@ public class ChatController extends BaseController implements MessagesListAdapte } private void cancelNotificationsForCurrentConversation() { - if (!conversationUser.hasSpreedCapabilityWithName("no-ping") && !TextUtils.isEmpty(roomId)) { + if (!conversationUser.hasSpreedFeatureCapability("no-ping") && !TextUtils.isEmpty(roomId)) { NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomId); } else if (!TextUtils.isEmpty(roomToken)){ NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomToken); @@ -578,7 +581,7 @@ public class ChatController extends BaseController implements MessagesListAdapte ApplicationWideCurrentRoomHolder.getInstance().clear(); eventBus.unregister(this); - if (conversationUser.hasSpreedCapabilityWithName("no-ping") + if (conversationUser.hasSpreedFeatureCapability("no-ping") && getActivity() != null && !getActivity().isChangingConfigurations() && !isLeavingForConversation) { wasDetached = true; leaveRoom(); @@ -616,7 +619,7 @@ public class ChatController extends BaseController implements MessagesListAdapte } private void startPing() { - if (!conversationUser.hasSpreedCapabilityWithName("no-ping")) { + if (!conversationUser.hasSpreedFeatureCapability("no-ping")) { ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(conversationUser.getBaseUrl(), roomToken)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) @@ -1058,7 +1061,7 @@ public class ChatController extends BaseController implements MessagesListAdapte public void onPrepareOptionsMenu(@NonNull Menu menu) { super.onPrepareOptionsMenu(menu); - if (conversationUser.hasSpreedCapabilityWithName("read-only-rooms")) { + if (conversationUser.hasSpreedFeatureCapability("read-only-rooms")) { checkReadOnlyState(); } } @@ -1179,7 +1182,7 @@ public class ChatController extends BaseController implements MessagesListAdapte bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken()); bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId()); - if (conversationUser.hasSpreedCapabilityWithName("chat-v2")) { + if (conversationUser.hasSpreedFeatureCapability("chat-v2")) { bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(roomOverall.getOcs().getData())); conversationIntent.putExtras(bundle); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index b2af4c596..ca85ba3a0 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -45,7 +45,6 @@ import butterknife.BindView; import butterknife.OnClick; import butterknife.Optional; import com.bluelinelabs.conductor.RouterTransaction; -import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler; import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler; import com.bluelinelabs.logansquare.LoganSquare; import com.kennyc.bottomsheet.BottomSheet; @@ -264,7 +263,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ bundle.putString(BundleKeys.KEY_ROOM_TOKEN, roomOverall.getOcs().getData().getToken()); bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId()); - if (currentUser.hasSpreedCapabilityWithName("chat-v2")) { + if (currentUser.hasSpreedFeatureCapability("chat-v2")) { bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(roomOverall.getOcs().getData())); @@ -383,7 +382,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ RetrofitBucket retrofitBucket; boolean serverIs14OrUp = false; - if (currentUser.hasSpreedCapabilityWithName("last-room-activity")) { + if (currentUser.hasSpreedFeatureCapability("last-room-activity")) { // a hack to see if we're on 14 or not retrofitBucket = ApiUtils.getRetrofitBucketForContactsSearchFor14(currentUser.getBaseUrl(), query); serverIs14OrUp = true; @@ -845,7 +844,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ bundle.putString(BundleKeys.KEY_ROOM_ID, roomOverall.getOcs().getData().getRoomId()); conversationIntent.putExtras(bundle); - if (currentUser.hasSpreedCapabilityWithName("chat-v2")) { + if (currentUser.hasSpreedFeatureCapability("chat-v2")) { bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(roomOverall.getOcs().getData())); @@ -886,8 +885,8 @@ public class ContactsController extends BaseController implements SearchView.OnQ } } - if (currentUser.hasSpreedCapabilityWithName("last-room-activity") - && !currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails") && + if (currentUser.hasSpreedFeatureCapability("last-room-activity") + && !currentUser.hasSpreedFeatureCapability("invite-groups-and-mails") && "groups".equals(((UserItem) adapter.getItem(position)).getModel().getSource()) && participant.isSelected() && adapter.getSelectedItemCount() > 1) { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java index bd5f8d77f..2d80fad5f 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationInfoController.java @@ -400,7 +400,7 @@ public class ConversationInfoController extends BaseController { loadConversationAvatar(); - if (conversationUser.hasSpreedCapabilityWithName("notification-levels")) { + if (conversationUser.hasSpreedFeatureCapability("notification-levels")) { if (messageNotificationLevel != null) { messageNotificationLevel.setEnabled(true); messageNotificationLevel.setAlpha(1.0f); @@ -457,7 +457,7 @@ public class ConversationInfoController extends BaseController { if (messageNotificationLevel != null) { if (conversation.getType().equals(Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL)) { // hack to see if we get mentioned always or just on mention - if (conversationUser.hasSpreedCapabilityWithName("mention-flag")) { + if (conversationUser.hasSpreedFeatureCapability("mention-flag")) { messageNotificationLevel.setValue("always"); } else { messageNotificationLevel.setValue("mention"); diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java index 61158664f..19d60a4f6 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ConversationsListController.java @@ -24,7 +24,6 @@ import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; -import android.graphics.drawable.BitmapDrawable; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -60,7 +59,6 @@ import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.imagepipeline.core.ImagePipeline; import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber; import com.facebook.imagepipeline.image.CloseableImage; -import com.facebook.imagepipeline.postprocessors.RoundAsCirclePostprocessor; import com.facebook.imagepipeline.request.ImageRequest; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.kennyc.bottomsheet.BottomSheet; @@ -246,7 +244,7 @@ public class ConversationsListController extends BaseController implements Searc if (currentUser != null) { credentials = ApiUtils.getCredentials(currentUser.getUsername(), currentUser.getToken()); - shouldUseLastMessageLayout = currentUser.hasSpreedCapabilityWithName("last-room-activity"); + shouldUseLastMessageLayout = currentUser.hasSpreedFeatureCapability("last-room-activity"); fetchData(false); } } @@ -361,7 +359,7 @@ public class ConversationsListController extends BaseController implements Searc } } - if (currentUser.hasSpreedCapabilityWithName("last-room-activity")) { + if (currentUser.hasSpreedFeatureCapability("last-room-activity")) { Collections.sort(callItems, (o1, o2) -> { Conversation conversation1 = ((ConversationItem) o1).getModel(); Conversation conversation2 = ((ConversationItem) o2).getModel(); @@ -637,7 +635,7 @@ public class ConversationsListController extends BaseController implements Searc } else { currentUser = userUtils.getCurrentUser(); - if (currentUser.hasSpreedCapabilityWithName("chat-v2")) { + if (currentUser.hasSpreedFeatureCapability("chat-v2")) { bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(conversation)); ConductorRemapping.remapChatController(getRouter(), currentUser.getId(), conversation.getToken(), bundle, false); @@ -656,7 +654,7 @@ public class ConversationsListController extends BaseController implements Searc @Override public void onItemLongClick(int position) { - if (currentUser.hasSpreedCapabilityWithName("last-room-activity")) { + if (currentUser.hasSpreedFeatureCapability("last-room-activity")) { Object clickedItem = adapter.getItem(position); if (clickedItem != null) { Conversation conversation; diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java index 7e9efb92a..69a53e3f7 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/CallMenuController.java @@ -151,7 +151,7 @@ public class CallMenuController extends BaseController implements FlexibleAdapte if (conversation.isFavorite()) { menuItems.add(new MenuItem(getResources().getString(R.string.nc_remove_from_favorites), 97, DisplayUtils.getTintedDrawable(getResources(), R.drawable.ic_star_border_black_24dp, R.color.grey_600))); - } else if (currentUser.hasSpreedCapabilityWithName("favorites")) { + } else if (currentUser.hasSpreedFeatureCapability("favorites")) { menuItems.add(new MenuItem(getResources().getString(R.string.nc_add_to_favorites) , 98, DisplayUtils.getTintedDrawable(getResources(), R.drawable.ic_star_black_24dp, R.color.grey_600))); } diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java index 293a42890..78c7975e8 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.java @@ -46,7 +46,6 @@ import com.nextcloud.talk.R; import com.nextcloud.talk.activities.MagicCallActivity; import com.nextcloud.talk.api.NcApi; import com.nextcloud.talk.application.NextcloudTalkApplication; -import com.nextcloud.talk.controllers.ChatController; import com.nextcloud.talk.controllers.base.BaseController; import com.nextcloud.talk.events.BottomSheetLockEvent; import com.nextcloud.talk.models.RetrofitBucket; @@ -269,12 +268,12 @@ public class OperationsMenuController extends BaseController { } if (conversationType.equals(Conversation.ConversationType.ROOM_PUBLIC_CALL) || - !currentUser.hasSpreedCapabilityWithName("empty-group-room")) { + !currentUser.hasSpreedFeatureCapability("empty-group-room")) { retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(currentUser.getBaseUrl(), "3", invite, conversationName); } else { String roomType = "2"; - if (!currentUser.hasSpreedCapabilityWithName("empty-group-room")) { + if (!currentUser.hasSpreedFeatureCapability("empty-group-room")) { isGroupCallWorkaround = true; roomType = "3"; } @@ -505,8 +504,8 @@ public class OperationsMenuController extends BaseController { localInvitedGroups.remove(0); } - if (localInvitedUsers.size() > 0 || (localInvitedGroups.size() > 0 && currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails"))) { - if ((localInvitedGroups.size() > 0 && currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails"))) { + if (localInvitedUsers.size() > 0 || (localInvitedGroups.size() > 0 && currentUser.hasSpreedFeatureCapability("invite-groups-and-mails"))) { + if ((localInvitedGroups.size() > 0 && currentUser.hasSpreedFeatureCapability("invite-groups-and-mails"))) { for (int i = 0; i < localInvitedGroups.size(); i++) { final String groupId = localInvitedGroups.get(i); retrofitBucket = ApiUtils.getRetrofitBucketForAddGroupParticipant(currentUser.getBaseUrl(), conversation.getToken(), @@ -585,7 +584,7 @@ public class OperationsMenuController extends BaseController { }); } } else { - if (!currentUser.hasSpreedCapabilityWithName("chat-v2")) { + if (!currentUser.hasSpreedFeatureCapability("chat-v2")) { showResultImage(true, false); } else { initiateConversation(true, null); @@ -602,7 +601,7 @@ public class OperationsMenuController extends BaseController { isGuestUser = true; hasChatCapability = capabilities != null && capabilities.getSpreedCapability() != null && capabilities.getSpreedCapability().getFeatures() != null && capabilities.getSpreedCapability().getFeatures().contains("chat-v2"); } else { - hasChatCapability = currentUser.hasSpreedCapabilityWithName("chat-v2"); + hasChatCapability = currentUser.hasSpreedFeatureCapability("chat-v2"); } 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 2d51b79eb..5afc5db53 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.java @@ -442,7 +442,7 @@ public class NotificationWorker extends Worker { JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class); boolean hasChatSupport = signatureVerification.getUserEntity(). - hasSpreedCapabilityWithName("chat-v2"); + hasSpreedFeatureCapability("chat-v2"); boolean shouldShowNotification = decryptedPushMessage.getApp().equals("spreed"); @@ -460,7 +460,7 @@ public class NotificationWorker extends Worker { intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); - if (!signatureVerification.getUserEntity().hasSpreedCapabilityWithName + if (!signatureVerification.getUserEntity().hasSpreedFeatureCapability ("no-ping")) { bundle.putString(BundleKeys.KEY_ROOM_ID, decryptedPushMessage.getId()); } else { diff --git a/app/src/main/java/com/nextcloud/talk/models/database/User.java b/app/src/main/java/com/nextcloud/talk/models/database/User.java index ce8610236..2bd028c8f 100644 --- a/app/src/main/java/com/nextcloud/talk/models/database/User.java +++ b/app/src/main/java/com/nextcloud/talk/models/database/User.java @@ -30,6 +30,7 @@ import io.requery.Persistable; import java.io.IOException; import java.io.Serializable; +import java.util.HashMap; @Entity public interface User extends Parcelable, Persistable, Serializable { @@ -89,7 +90,7 @@ public interface User extends Parcelable, Persistable, Serializable { return false; } - default boolean hasSpreedCapabilityWithName(String capabilityName) { + default boolean hasSpreedFeatureCapability(String capabilityName) { if (getCapabilities() != null) { try { Capabilities capabilities = LoganSquare.parse(getCapabilities(), Capabilities.class); @@ -103,4 +104,28 @@ public interface User extends Parcelable, Persistable, Serializable { } return false; } + + default int getMessageMaxLength() { + if (getCapabilities() != null) { + Capabilities capabilities = null; + try { + capabilities = LoganSquare.parse(getCapabilities(), Capabilities.class); + if (capabilities != null && capabilities.getSpreedCapability() != null && capabilities.getSpreedCapability().getConfig() != null + && capabilities.getSpreedCapability().getConfig().containsKey("chat")) { + HashMap chatConfigHashMap = capabilities.getSpreedCapability().getConfig().get("chat"); + if (chatConfigHashMap != null && chatConfigHashMap.containsKey("max-length")) { + int chatSize = Integer.parseInt(chatConfigHashMap.get("max-length")); + if (chatSize > 0) { + return chatSize; + } else { + return 1000; + } + } + } + } catch (IOException e) { + e.printStackTrace(); + } + } + return 1000; + } } diff --git a/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.java b/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.java index b1d548d00..8a15515f6 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/capabilities/SpreedCapability.java @@ -25,6 +25,7 @@ import com.bluelinelabs.logansquare.annotation.JsonObject; import lombok.Data; import org.parceler.Parcel; +import java.util.HashMap; import java.util.List; @Parcel @@ -33,4 +34,7 @@ import java.util.List; public class SpreedCapability { @JsonField(name = "features") List features; + + @JsonField(name = "config") + HashMap> config; } diff --git a/app/src/main/java/com/nextcloud/talk/models/json/rooms/Conversation.java b/app/src/main/java/com/nextcloud/talk/models/json/rooms/Conversation.java index 1371d49fb..ad7e49ce4 100644 --- a/app/src/main/java/com/nextcloud/talk/models/json/rooms/Conversation.java +++ b/app/src/main/java/com/nextcloud/talk/models/json/rooms/Conversation.java @@ -97,7 +97,7 @@ public class Conversation { private boolean isLockedOneToOne(UserEntity conversationUser) { - return (getType() == ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL && conversationUser.hasSpreedCapabilityWithName("locked-one-to-one-rooms")); + return (getType() == ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL && conversationUser.hasSpreedFeatureCapability("locked-one-to-one-rooms")); } public boolean canModerate(UserEntity conversationUser) { diff --git a/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java b/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java index 2b926138f..ed770d686 100644 --- a/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java +++ b/app/src/main/java/com/nextcloud/talk/utils/preferencestorage/DatabaseStorageModule.java @@ -69,7 +69,7 @@ public class DatabaseStorageModule implements StorageModule { if (!key.equals("message_notification_level")) { arbitraryStorageUtils.storeStorageSetting(accountIdentifier, key, value, conversationToken); } else { - if (conversationUser.hasSpreedCapabilityWithName("notification-levels")) { + if (conversationUser.hasSpreedFeatureCapability("notification-levels")) { if (!TextUtils.isEmpty(messageNotificationLevel) && !messageNotificationLevel.equals(value)) { int intValue; switch (value) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index fa91bf4cc..dd5d70683 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -253,7 +253,7 @@ Hello - 1000 characters limit has been hit + %s characters limit has been hit Groups Participants