mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-15 08:45:04 +01:00
parent
010850b67a
commit
48a011bbdb
@ -1120,7 +1120,7 @@ public class CallController extends BaseController {
|
|||||||
urlToken = roomToken;
|
urlToken = roomToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conversationUser.hasSpreedCapabilityWithName("no-ping") && !TextUtils.isEmpty(roomId)) {
|
if (!conversationUser.hasSpreedFeatureCapability("no-ping") && !TextUtils.isEmpty(roomId)) {
|
||||||
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomId);
|
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomId);
|
||||||
} else if (!TextUtils.isEmpty(roomToken)) {
|
} else if (!TextUtils.isEmpty(roomToken)) {
|
||||||
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomToken);
|
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomToken);
|
||||||
|
@ -26,7 +26,6 @@ import android.graphics.Bitmap;
|
|||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.media.AudioAttributes;
|
import android.media.AudioAttributes;
|
||||||
import android.media.MediaPlayer;
|
import android.media.MediaPlayer;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -57,7 +56,6 @@ import com.facebook.imagepipeline.core.ImagePipeline;
|
|||||||
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
||||||
import com.facebook.imagepipeline.image.CloseableImage;
|
import com.facebook.imagepipeline.image.CloseableImage;
|
||||||
import com.facebook.imagepipeline.postprocessors.BlurPostProcessor;
|
import com.facebook.imagepipeline.postprocessors.BlurPostProcessor;
|
||||||
import com.facebook.imagepipeline.postprocessors.RoundAsCirclePostprocessor;
|
|
||||||
import com.facebook.imagepipeline.request.ImageRequest;
|
import com.facebook.imagepipeline.request.ImageRequest;
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
import com.nextcloud.talk.api.NcApi;
|
import com.nextcloud.talk.api.NcApi;
|
||||||
@ -428,7 +426,7 @@ public class CallNotificationController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((AvatarStatusCodeHolder.getInstance().getStatusCode() == 200 || AvatarStatusCodeHolder.getInstance().getStatusCode() == 0) &&
|
if ((AvatarStatusCodeHolder.getInstance().getStatusCode() == 200 || AvatarStatusCodeHolder.getInstance().getStatusCode() == 0) &&
|
||||||
userBeingCalled.hasSpreedCapabilityWithName("no-ping")) {
|
userBeingCalled.hasSpreedFeatureCapability("no-ping")) {
|
||||||
if (getActivity() != null) {
|
if (getActivity() != null) {
|
||||||
Bitmap backgroundBitmap = bitmap.copy(bitmap.getConfig(), true);
|
Bitmap backgroundBitmap = bitmap.copy(bitmap.getConfig(), true);
|
||||||
new BlurPostProcessor(5, getActivity()).process(backgroundBitmap);
|
new BlurPostProcessor(5, getActivity()).process(backgroundBitmap);
|
||||||
|
@ -368,7 +368,10 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
|
|
||||||
InputFilter[] filters = new InputFilter[1];
|
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.setFilters(filters);
|
||||||
|
|
||||||
messageInput.addTextChangedListener(new TextWatcher() {
|
messageInput.addTextChangedListener(new TextWatcher() {
|
||||||
@ -379,8 +382,8 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
if (s.length() == 1000) {
|
if (s.length() >= lenghtFilter) {
|
||||||
messageInput.setError(Objects.requireNonNull(getResources()).getString(R.string.nc_limit_hit));
|
messageInput.setError(String.format(Objects.requireNonNull(getResources()).getString(R.string.nc_limit_hit), Integer.toString(lenghtFilter)));
|
||||||
} else {
|
} else {
|
||||||
messageInput.setError(null);
|
messageInput.setError(null);
|
||||||
}
|
}
|
||||||
@ -417,7 +420,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
messageInputView.getButton().setContentDescription(getResources()
|
messageInputView.getButton().setContentDescription(getResources()
|
||||||
.getString(R.string.nc_description_send_message_button));
|
.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());
|
getActivity().findViewById(R.id.toolbar).setOnClickListener(v -> showConversationInfoScreen());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,7 +560,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
cancelNotificationsForCurrentConversation();
|
cancelNotificationsForCurrentConversation();
|
||||||
|
|
||||||
if (inChat) {
|
if (inChat) {
|
||||||
if (wasDetached && conversationUser.hasSpreedCapabilityWithName("no-ping")) {
|
if (wasDetached && conversationUser.hasSpreedFeatureCapability("no-ping")) {
|
||||||
wasDetached = false;
|
wasDetached = false;
|
||||||
joinRoomWithPassword();
|
joinRoomWithPassword();
|
||||||
}
|
}
|
||||||
@ -565,7 +568,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void cancelNotificationsForCurrentConversation() {
|
private void cancelNotificationsForCurrentConversation() {
|
||||||
if (!conversationUser.hasSpreedCapabilityWithName("no-ping") && !TextUtils.isEmpty(roomId)) {
|
if (!conversationUser.hasSpreedFeatureCapability("no-ping") && !TextUtils.isEmpty(roomId)) {
|
||||||
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomId);
|
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomId);
|
||||||
} else if (!TextUtils.isEmpty(roomToken)){
|
} else if (!TextUtils.isEmpty(roomToken)){
|
||||||
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomToken);
|
NotificationUtils.cancelExistingNotificationsForRoom(getApplicationContext(), conversationUser, roomToken);
|
||||||
@ -578,7 +581,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
ApplicationWideCurrentRoomHolder.getInstance().clear();
|
ApplicationWideCurrentRoomHolder.getInstance().clear();
|
||||||
eventBus.unregister(this);
|
eventBus.unregister(this);
|
||||||
|
|
||||||
if (conversationUser.hasSpreedCapabilityWithName("no-ping")
|
if (conversationUser.hasSpreedFeatureCapability("no-ping")
|
||||||
&& getActivity() != null && !getActivity().isChangingConfigurations() && !isLeavingForConversation) {
|
&& getActivity() != null && !getActivity().isChangingConfigurations() && !isLeavingForConversation) {
|
||||||
wasDetached = true;
|
wasDetached = true;
|
||||||
leaveRoom();
|
leaveRoom();
|
||||||
@ -616,7 +619,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startPing() {
|
private void startPing() {
|
||||||
if (!conversationUser.hasSpreedCapabilityWithName("no-ping")) {
|
if (!conversationUser.hasSpreedFeatureCapability("no-ping")) {
|
||||||
ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(conversationUser.getBaseUrl(), roomToken))
|
ncApi.pingCall(credentials, ApiUtils.getUrlForCallPing(conversationUser.getBaseUrl(), roomToken))
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
@ -1058,7 +1061,7 @@ public class ChatController extends BaseController implements MessagesListAdapte
|
|||||||
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
||||||
super.onPrepareOptionsMenu(menu);
|
super.onPrepareOptionsMenu(menu);
|
||||||
|
|
||||||
if (conversationUser.hasSpreedCapabilityWithName("read-only-rooms")) {
|
if (conversationUser.hasSpreedFeatureCapability("read-only-rooms")) {
|
||||||
checkReadOnlyState();
|
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_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());
|
||||||
|
|
||||||
if (conversationUser.hasSpreedCapabilityWithName("chat-v2")) {
|
if (conversationUser.hasSpreedFeatureCapability("chat-v2")) {
|
||||||
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION,
|
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION,
|
||||||
Parcels.wrap(roomOverall.getOcs().getData()));
|
Parcels.wrap(roomOverall.getOcs().getData()));
|
||||||
conversationIntent.putExtras(bundle);
|
conversationIntent.putExtras(bundle);
|
||||||
|
@ -45,7 +45,6 @@ import butterknife.BindView;
|
|||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import butterknife.Optional;
|
import butterknife.Optional;
|
||||||
import com.bluelinelabs.conductor.RouterTransaction;
|
import com.bluelinelabs.conductor.RouterTransaction;
|
||||||
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
|
||||||
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
|
import com.bluelinelabs.conductor.changehandler.VerticalChangeHandler;
|
||||||
import com.bluelinelabs.logansquare.LoganSquare;
|
import com.bluelinelabs.logansquare.LoganSquare;
|
||||||
import com.kennyc.bottomsheet.BottomSheet;
|
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_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());
|
||||||
|
|
||||||
if (currentUser.hasSpreedCapabilityWithName("chat-v2")) {
|
if (currentUser.hasSpreedFeatureCapability("chat-v2")) {
|
||||||
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION,
|
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION,
|
||||||
Parcels.wrap(roomOverall.getOcs().getData()));
|
Parcels.wrap(roomOverall.getOcs().getData()));
|
||||||
|
|
||||||
@ -383,7 +382,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
|
|
||||||
RetrofitBucket retrofitBucket;
|
RetrofitBucket retrofitBucket;
|
||||||
boolean serverIs14OrUp = false;
|
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
|
// a hack to see if we're on 14 or not
|
||||||
retrofitBucket = ApiUtils.getRetrofitBucketForContactsSearchFor14(currentUser.getBaseUrl(), query);
|
retrofitBucket = ApiUtils.getRetrofitBucketForContactsSearchFor14(currentUser.getBaseUrl(), query);
|
||||||
serverIs14OrUp = true;
|
serverIs14OrUp = true;
|
||||||
@ -845,7 +844,7 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
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);
|
||||||
|
|
||||||
if (currentUser.hasSpreedCapabilityWithName("chat-v2")) {
|
if (currentUser.hasSpreedFeatureCapability("chat-v2")) {
|
||||||
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION,
|
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION,
|
||||||
Parcels.wrap(roomOverall.getOcs().getData()));
|
Parcels.wrap(roomOverall.getOcs().getData()));
|
||||||
|
|
||||||
@ -886,8 +885,8 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentUser.hasSpreedCapabilityWithName("last-room-activity")
|
if (currentUser.hasSpreedFeatureCapability("last-room-activity")
|
||||||
&& !currentUser.hasSpreedCapabilityWithName("invite-groups-and-mails") &&
|
&& !currentUser.hasSpreedFeatureCapability("invite-groups-and-mails") &&
|
||||||
"groups".equals(((UserItem) adapter.getItem(position)).getModel().getSource()) &&
|
"groups".equals(((UserItem) adapter.getItem(position)).getModel().getSource()) &&
|
||||||
participant.isSelected() &&
|
participant.isSelected() &&
|
||||||
adapter.getSelectedItemCount() > 1) {
|
adapter.getSelectedItemCount() > 1) {
|
||||||
|
@ -400,7 +400,7 @@ public class ConversationInfoController extends BaseController {
|
|||||||
|
|
||||||
loadConversationAvatar();
|
loadConversationAvatar();
|
||||||
|
|
||||||
if (conversationUser.hasSpreedCapabilityWithName("notification-levels")) {
|
if (conversationUser.hasSpreedFeatureCapability("notification-levels")) {
|
||||||
if (messageNotificationLevel != null) {
|
if (messageNotificationLevel != null) {
|
||||||
messageNotificationLevel.setEnabled(true);
|
messageNotificationLevel.setEnabled(true);
|
||||||
messageNotificationLevel.setAlpha(1.0f);
|
messageNotificationLevel.setAlpha(1.0f);
|
||||||
@ -457,7 +457,7 @@ public class ConversationInfoController extends BaseController {
|
|||||||
if (messageNotificationLevel != null) {
|
if (messageNotificationLevel != null) {
|
||||||
if (conversation.getType().equals(Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL)) {
|
if (conversation.getType().equals(Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL)) {
|
||||||
// hack to see if we get mentioned always or just on mention
|
// 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");
|
messageNotificationLevel.setValue("always");
|
||||||
} else {
|
} else {
|
||||||
messageNotificationLevel.setValue("mention");
|
messageNotificationLevel.setValue("mention");
|
||||||
|
@ -24,7 +24,6 @@ import android.app.SearchManager;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
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.core.ImagePipeline;
|
||||||
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
||||||
import com.facebook.imagepipeline.image.CloseableImage;
|
import com.facebook.imagepipeline.image.CloseableImage;
|
||||||
import com.facebook.imagepipeline.postprocessors.RoundAsCirclePostprocessor;
|
|
||||||
import com.facebook.imagepipeline.request.ImageRequest;
|
import com.facebook.imagepipeline.request.ImageRequest;
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.kennyc.bottomsheet.BottomSheet;
|
import com.kennyc.bottomsheet.BottomSheet;
|
||||||
@ -246,7 +244,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
|
|
||||||
if (currentUser != null) {
|
if (currentUser != null) {
|
||||||
credentials = ApiUtils.getCredentials(currentUser.getUsername(), currentUser.getToken());
|
credentials = ApiUtils.getCredentials(currentUser.getUsername(), currentUser.getToken());
|
||||||
shouldUseLastMessageLayout = currentUser.hasSpreedCapabilityWithName("last-room-activity");
|
shouldUseLastMessageLayout = currentUser.hasSpreedFeatureCapability("last-room-activity");
|
||||||
fetchData(false);
|
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) -> {
|
Collections.sort(callItems, (o1, o2) -> {
|
||||||
Conversation conversation1 = ((ConversationItem) o1).getModel();
|
Conversation conversation1 = ((ConversationItem) o1).getModel();
|
||||||
Conversation conversation2 = ((ConversationItem) o2).getModel();
|
Conversation conversation2 = ((ConversationItem) o2).getModel();
|
||||||
@ -637,7 +635,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
} else {
|
} else {
|
||||||
currentUser = userUtils.getCurrentUser();
|
currentUser = userUtils.getCurrentUser();
|
||||||
|
|
||||||
if (currentUser.hasSpreedCapabilityWithName("chat-v2")) {
|
if (currentUser.hasSpreedFeatureCapability("chat-v2")) {
|
||||||
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(conversation));
|
bundle.putParcelable(BundleKeys.KEY_ACTIVE_CONVERSATION, Parcels.wrap(conversation));
|
||||||
ConductorRemapping.remapChatController(getRouter(), currentUser.getId(),
|
ConductorRemapping.remapChatController(getRouter(), currentUser.getId(),
|
||||||
conversation.getToken(), bundle, false);
|
conversation.getToken(), bundle, false);
|
||||||
@ -656,7 +654,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemLongClick(int position) {
|
public void onItemLongClick(int position) {
|
||||||
if (currentUser.hasSpreedCapabilityWithName("last-room-activity")) {
|
if (currentUser.hasSpreedFeatureCapability("last-room-activity")) {
|
||||||
Object clickedItem = adapter.getItem(position);
|
Object clickedItem = adapter.getItem(position);
|
||||||
if (clickedItem != null) {
|
if (clickedItem != null) {
|
||||||
Conversation conversation;
|
Conversation conversation;
|
||||||
|
@ -151,7 +151,7 @@ public class CallMenuController extends BaseController implements FlexibleAdapte
|
|||||||
|
|
||||||
if (conversation.isFavorite()) {
|
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)));
|
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)
|
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)));
|
, 98, DisplayUtils.getTintedDrawable(getResources(), R.drawable.ic_star_black_24dp, R.color.grey_600)));
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ import com.nextcloud.talk.R;
|
|||||||
import com.nextcloud.talk.activities.MagicCallActivity;
|
import com.nextcloud.talk.activities.MagicCallActivity;
|
||||||
import com.nextcloud.talk.api.NcApi;
|
import com.nextcloud.talk.api.NcApi;
|
||||||
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
import com.nextcloud.talk.application.NextcloudTalkApplication;
|
||||||
import com.nextcloud.talk.controllers.ChatController;
|
|
||||||
import com.nextcloud.talk.controllers.base.BaseController;
|
import com.nextcloud.talk.controllers.base.BaseController;
|
||||||
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
import com.nextcloud.talk.events.BottomSheetLockEvent;
|
||||||
import com.nextcloud.talk.models.RetrofitBucket;
|
import com.nextcloud.talk.models.RetrofitBucket;
|
||||||
@ -269,12 +268,12 @@ public class OperationsMenuController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (conversationType.equals(Conversation.ConversationType.ROOM_PUBLIC_CALL) ||
|
if (conversationType.equals(Conversation.ConversationType.ROOM_PUBLIC_CALL) ||
|
||||||
!currentUser.hasSpreedCapabilityWithName("empty-group-room")) {
|
!currentUser.hasSpreedFeatureCapability("empty-group-room")) {
|
||||||
retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(currentUser.getBaseUrl(),
|
retrofitBucket = ApiUtils.getRetrofitBucketForCreateRoom(currentUser.getBaseUrl(),
|
||||||
"3", invite, conversationName);
|
"3", invite, conversationName);
|
||||||
} else {
|
} else {
|
||||||
String roomType = "2";
|
String roomType = "2";
|
||||||
if (!currentUser.hasSpreedCapabilityWithName("empty-group-room")) {
|
if (!currentUser.hasSpreedFeatureCapability("empty-group-room")) {
|
||||||
isGroupCallWorkaround = true;
|
isGroupCallWorkaround = true;
|
||||||
roomType = "3";
|
roomType = "3";
|
||||||
}
|
}
|
||||||
@ -505,8 +504,8 @@ public class OperationsMenuController extends BaseController {
|
|||||||
localInvitedGroups.remove(0);
|
localInvitedGroups.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (localInvitedUsers.size() > 0 || (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.hasSpreedCapabilityWithName("invite-groups-and-mails"))) {
|
if ((localInvitedGroups.size() > 0 && currentUser.hasSpreedFeatureCapability("invite-groups-and-mails"))) {
|
||||||
for (int i = 0; i < localInvitedGroups.size(); i++) {
|
for (int i = 0; i < localInvitedGroups.size(); i++) {
|
||||||
final String groupId = localInvitedGroups.get(i);
|
final String groupId = localInvitedGroups.get(i);
|
||||||
retrofitBucket = ApiUtils.getRetrofitBucketForAddGroupParticipant(currentUser.getBaseUrl(), conversation.getToken(),
|
retrofitBucket = ApiUtils.getRetrofitBucketForAddGroupParticipant(currentUser.getBaseUrl(), conversation.getToken(),
|
||||||
@ -585,7 +584,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!currentUser.hasSpreedCapabilityWithName("chat-v2")) {
|
if (!currentUser.hasSpreedFeatureCapability("chat-v2")) {
|
||||||
showResultImage(true, false);
|
showResultImage(true, false);
|
||||||
} else {
|
} else {
|
||||||
initiateConversation(true, null);
|
initiateConversation(true, null);
|
||||||
@ -602,7 +601,7 @@ public class OperationsMenuController extends BaseController {
|
|||||||
isGuestUser = true;
|
isGuestUser = true;
|
||||||
hasChatCapability = capabilities != null && capabilities.getSpreedCapability() != null && capabilities.getSpreedCapability().getFeatures() != null && capabilities.getSpreedCapability().getFeatures().contains("chat-v2");
|
hasChatCapability = capabilities != null && capabilities.getSpreedCapability() != null && capabilities.getSpreedCapability().getFeatures() != null && capabilities.getSpreedCapability().getFeatures().contains("chat-v2");
|
||||||
} else {
|
} else {
|
||||||
hasChatCapability = currentUser.hasSpreedCapabilityWithName("chat-v2");
|
hasChatCapability = currentUser.hasSpreedFeatureCapability("chat-v2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ public class NotificationWorker extends Worker {
|
|||||||
JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class);
|
JavaNetCookieJar(new CookieManager())).build()).build().create(NcApi.class);
|
||||||
|
|
||||||
boolean hasChatSupport = signatureVerification.getUserEntity().
|
boolean hasChatSupport = signatureVerification.getUserEntity().
|
||||||
hasSpreedCapabilityWithName("chat-v2");
|
hasSpreedFeatureCapability("chat-v2");
|
||||||
|
|
||||||
boolean shouldShowNotification = decryptedPushMessage.getApp().equals("spreed");
|
boolean shouldShowNotification = decryptedPushMessage.getApp().equals("spreed");
|
||||||
|
|
||||||
@ -460,7 +460,7 @@ public class NotificationWorker extends Worker {
|
|||||||
|
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
|
||||||
if (!signatureVerification.getUserEntity().hasSpreedCapabilityWithName
|
if (!signatureVerification.getUserEntity().hasSpreedFeatureCapability
|
||||||
("no-ping")) {
|
("no-ping")) {
|
||||||
bundle.putString(BundleKeys.KEY_ROOM_ID, decryptedPushMessage.getId());
|
bundle.putString(BundleKeys.KEY_ROOM_ID, decryptedPushMessage.getId());
|
||||||
} else {
|
} else {
|
||||||
|
@ -30,6 +30,7 @@ import io.requery.Persistable;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public interface User extends Parcelable, Persistable, Serializable {
|
public interface User extends Parcelable, Persistable, Serializable {
|
||||||
@ -89,7 +90,7 @@ public interface User extends Parcelable, Persistable, Serializable {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean hasSpreedCapabilityWithName(String capabilityName) {
|
default boolean hasSpreedFeatureCapability(String capabilityName) {
|
||||||
if (getCapabilities() != null) {
|
if (getCapabilities() != null) {
|
||||||
try {
|
try {
|
||||||
Capabilities capabilities = LoganSquare.parse(getCapabilities(), Capabilities.class);
|
Capabilities capabilities = LoganSquare.parse(getCapabilities(), Capabilities.class);
|
||||||
@ -103,4 +104,28 @@ public interface User extends Parcelable, Persistable, Serializable {
|
|||||||
}
|
}
|
||||||
return false;
|
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<String, String> 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.parceler.Parcel;
|
import org.parceler.Parcel;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Parcel
|
@Parcel
|
||||||
@ -33,4 +34,7 @@ import java.util.List;
|
|||||||
public class SpreedCapability {
|
public class SpreedCapability {
|
||||||
@JsonField(name = "features")
|
@JsonField(name = "features")
|
||||||
List<String> features;
|
List<String> features;
|
||||||
|
|
||||||
|
@JsonField(name = "config")
|
||||||
|
HashMap<String, HashMap<String, String>> config;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ public class Conversation {
|
|||||||
|
|
||||||
|
|
||||||
private boolean isLockedOneToOne(UserEntity conversationUser) {
|
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) {
|
public boolean canModerate(UserEntity conversationUser) {
|
||||||
|
@ -69,7 +69,7 @@ public class DatabaseStorageModule implements StorageModule {
|
|||||||
if (!key.equals("message_notification_level")) {
|
if (!key.equals("message_notification_level")) {
|
||||||
arbitraryStorageUtils.storeStorageSetting(accountIdentifier, key, value, conversationToken);
|
arbitraryStorageUtils.storeStorageSetting(accountIdentifier, key, value, conversationToken);
|
||||||
} else {
|
} else {
|
||||||
if (conversationUser.hasSpreedCapabilityWithName("notification-levels")) {
|
if (conversationUser.hasSpreedFeatureCapability("notification-levels")) {
|
||||||
if (!TextUtils.isEmpty(messageNotificationLevel) && !messageNotificationLevel.equals(value)) {
|
if (!TextUtils.isEmpty(messageNotificationLevel) && !messageNotificationLevel.equals(value)) {
|
||||||
int intValue;
|
int intValue;
|
||||||
switch (value) {
|
switch (value) {
|
||||||
|
@ -253,7 +253,7 @@
|
|||||||
<string name="nc_hello">Hello</string>
|
<string name="nc_hello">Hello</string>
|
||||||
|
|
||||||
<!-- Other -->
|
<!-- Other -->
|
||||||
<string name="nc_limit_hit">1000 characters limit has been hit</string>
|
<string name="nc_limit_hit">%s characters limit has been hit</string>
|
||||||
<string name="nc_groups">Groups</string>
|
<string name="nc_groups">Groups</string>
|
||||||
<string name="nc_participants">Participants</string>
|
<string name="nc_participants">Participants</string>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user