mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-03 05:03:04 +00:00
Merge pull request #1472 from nextcloud/remove-obsolete-setting-link-preview
Remove obsolete setting link preview
This commit is contained in:
commit
0799945016
@ -4,6 +4,8 @@
|
|||||||
* @author Mario Danic
|
* @author Mario Danic
|
||||||
* @author Marcel Hibbe
|
* @author Marcel Hibbe
|
||||||
* @author Andy Scherzinger
|
* @author Andy Scherzinger
|
||||||
|
* @author Tim Krüger
|
||||||
|
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
|
||||||
* Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
* Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
||||||
* Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
|
* Copyright (C) 2021 Marcel Hibbe <dev@mhibbe.de>
|
||||||
* Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
|
* Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
|
||||||
@ -229,7 +231,6 @@ class ChatController(args: Bundle) :
|
|||||||
val voiceOnly: Boolean
|
val voiceOnly: Boolean
|
||||||
var isFirstMessagesProcessing = true
|
var isFirstMessagesProcessing = true
|
||||||
var isLeavingForConversation: Boolean = false
|
var isLeavingForConversation: Boolean = false
|
||||||
var isLinkPreviewAllowed: Boolean = false
|
|
||||||
var wasDetached: Boolean = false
|
var wasDetached: Boolean = false
|
||||||
var emojiPopup: EmojiPopup? = null
|
var emojiPopup: EmojiPopup? = null
|
||||||
|
|
||||||
@ -1363,8 +1364,6 @@ class ChatController(args: Bundle) :
|
|||||||
ApplicationWideCurrentRoomHolder.getInstance().isInCall = false
|
ApplicationWideCurrentRoomHolder.getInstance().isInCall = false
|
||||||
ApplicationWideCurrentRoomHolder.getInstance().userInRoom = conversationUser
|
ApplicationWideCurrentRoomHolder.getInstance().userInRoom = conversationUser
|
||||||
|
|
||||||
isLinkPreviewAllowed = appPreferences?.areLinkPreviewsAllowed ?: false
|
|
||||||
|
|
||||||
val smileyButton = binding.messageInputView.findViewById<ImageButton>(R.id.smileyButton)
|
val smileyButton = binding.messageInputView.findViewById<ImageButton>(R.id.smileyButton)
|
||||||
|
|
||||||
emojiPopup = binding.messageInputView.inputEditText?.let {
|
emojiPopup = binding.messageInputView.inputEditText?.let {
|
||||||
@ -1908,7 +1907,6 @@ class ChatController(args: Bundle) :
|
|||||||
val chatMessage = chatMessageList[i]
|
val chatMessage = chatMessageList[i]
|
||||||
chatMessage.isOneToOneConversation =
|
chatMessage.isOneToOneConversation =
|
||||||
currentConversation?.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
currentConversation?.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
||||||
chatMessage.isLinkPreviewAllowed = isLinkPreviewAllowed
|
|
||||||
chatMessage.activeUser = conversationUser
|
chatMessage.activeUser = conversationUser
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1937,7 +1935,6 @@ class ChatController(args: Bundle) :
|
|||||||
chatMessage = chatMessageList[i]
|
chatMessage = chatMessageList[i]
|
||||||
|
|
||||||
chatMessage.activeUser = conversationUser
|
chatMessage.activeUser = conversationUser
|
||||||
chatMessage.isLinkPreviewAllowed = isLinkPreviewAllowed
|
|
||||||
|
|
||||||
val shouldScroll =
|
val shouldScroll =
|
||||||
!isThereANewNotice &&
|
!isThereANewNotice &&
|
||||||
@ -2377,7 +2374,6 @@ class ChatController(args: Bundle) :
|
|||||||
|
|
||||||
messageTemp.isOneToOneConversation =
|
messageTemp.isOneToOneConversation =
|
||||||
currentConversation?.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
currentConversation?.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL
|
||||||
messageTemp.isLinkPreviewAllowed = isLinkPreviewAllowed
|
|
||||||
messageTemp.activeUser = conversationUser
|
messageTemp.activeUser = conversationUser
|
||||||
|
|
||||||
adapter?.update(messageTemp)
|
adapter?.update(messageTemp)
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
*
|
*
|
||||||
* @author Andy Scherzinger
|
* @author Andy Scherzinger
|
||||||
* @author Mario Danic
|
* @author Mario Danic
|
||||||
|
* @author Tim Krüger
|
||||||
|
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
|
||||||
|
* Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
||||||
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
* Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -173,8 +176,6 @@ public class SettingsController extends BaseController {
|
|||||||
MaterialSwitchPreference incognitoKeyboardSwitchPreference;
|
MaterialSwitchPreference incognitoKeyboardSwitchPreference;
|
||||||
@BindView(R.id.settings_screen_security)
|
@BindView(R.id.settings_screen_security)
|
||||||
MaterialSwitchPreference screenSecuritySwitchPreference;
|
MaterialSwitchPreference screenSecuritySwitchPreference;
|
||||||
@BindView(R.id.settings_link_previews)
|
|
||||||
MaterialSwitchPreference linkPreviewsSwitchPreference;
|
|
||||||
@BindView(R.id.settings_screen_lock)
|
@BindView(R.id.settings_screen_lock)
|
||||||
MaterialSwitchPreference screenLockSwitchPreference;
|
MaterialSwitchPreference screenLockSwitchPreference;
|
||||||
@BindView(R.id.settings_screen_lock_timeout)
|
@BindView(R.id.settings_screen_lock_timeout)
|
||||||
@ -463,7 +464,6 @@ public class SettingsController extends BaseController {
|
|||||||
readPrivacyPreference.setVisibility(View.GONE);
|
readPrivacyPreference.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
((Checkable) linkPreviewsSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getAreLinkPreviewsAllowed());
|
|
||||||
((Checkable) phoneBookIntegrationPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.isPhoneBookIntegrationEnabled());
|
((Checkable) phoneBookIntegrationPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.isPhoneBookIntegrationEnabled());
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
@ -59,6 +59,8 @@ public class DatabaseModule {
|
|||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
public AppPreferences providePreferences(@NonNull final Context poContext) {
|
public AppPreferences providePreferences(@NonNull final Context poContext) {
|
||||||
return StoreBox.create(poContext, AppPreferences.class);
|
AppPreferences p = StoreBox.create(poContext, AppPreferences.class);
|
||||||
|
p.removeLinkPreviews();
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication;
|
|||||||
import com.nextcloud.talk.models.database.UserEntity;
|
import com.nextcloud.talk.models.database.UserEntity;
|
||||||
import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter;
|
import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter;
|
||||||
import com.nextcloud.talk.utils.ApiUtils;
|
import com.nextcloud.talk.utils.ApiUtils;
|
||||||
import com.nextcloud.talk.utils.TextMatchers;
|
|
||||||
import com.stfalcon.chatkit.commons.models.IUser;
|
import com.stfalcon.chatkit.commons.models.IUser;
|
||||||
import com.stfalcon.chatkit.commons.models.MessageContentType;
|
import com.stfalcon.chatkit.commons.models.MessageContentType;
|
||||||
|
|
||||||
@ -60,8 +59,6 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image
|
|||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Map<String, String> selectedIndividualHashMap;
|
public Map<String, String> selectedIndividualHashMap;
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public boolean isLinkPreviewAllowed;
|
|
||||||
@JsonIgnore
|
|
||||||
public boolean isDeleted;
|
public boolean isDeleted;
|
||||||
@JsonField(name = "id")
|
@JsonField(name = "id")
|
||||||
public int jsonMessageId;
|
public int jsonMessageId;
|
||||||
@ -157,7 +154,7 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!messageTypesToIgnore.contains(getMessageType()) && isLinkPreviewAllowed) {
|
if (!messageTypesToIgnore.contains(getMessageType())) {
|
||||||
return getMessage().trim();
|
return getMessage().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,10 +327,6 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image
|
|||||||
return this.activeUser;
|
return this.activeUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLinkPreviewAllowed() {
|
|
||||||
return this.isLinkPreviewAllowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDeleted() {
|
public boolean isDeleted() {
|
||||||
return this.isDeleted;
|
return this.isDeleted;
|
||||||
}
|
}
|
||||||
@ -402,10 +395,6 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image
|
|||||||
this.activeUser = activeUser;
|
this.activeUser = activeUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLinkPreviewAllowed(boolean isLinkPreviewAllowed) {
|
|
||||||
this.isLinkPreviewAllowed = isLinkPreviewAllowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeleted(boolean isDeleted) {
|
public void setDeleted(boolean isDeleted) {
|
||||||
this.isDeleted = isDeleted;
|
this.isDeleted = isDeleted;
|
||||||
}
|
}
|
||||||
@ -493,9 +482,6 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image
|
|||||||
if (this$selectedIndividualHashMap == null ? other$selectedIndividualHashMap != null : !this$selectedIndividualHashMap.equals(other$selectedIndividualHashMap)) {
|
if (this$selectedIndividualHashMap == null ? other$selectedIndividualHashMap != null : !this$selectedIndividualHashMap.equals(other$selectedIndividualHashMap)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isLinkPreviewAllowed() != other.isLinkPreviewAllowed()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (this.isDeleted() != other.isDeleted()) {
|
if (this.isDeleted() != other.isDeleted()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -572,7 +558,6 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image
|
|||||||
result = result * PRIME + ($activeUser == null ? 43 : $activeUser.hashCode());
|
result = result * PRIME + ($activeUser == null ? 43 : $activeUser.hashCode());
|
||||||
final Object $selectedIndividualHashMap = this.getSelectedIndividualHashMap();
|
final Object $selectedIndividualHashMap = this.getSelectedIndividualHashMap();
|
||||||
result = result * PRIME + ($selectedIndividualHashMap == null ? 43 : $selectedIndividualHashMap.hashCode());
|
result = result * PRIME + ($selectedIndividualHashMap == null ? 43 : $selectedIndividualHashMap.hashCode());
|
||||||
result = result * PRIME + (this.isLinkPreviewAllowed() ? 79 : 97);
|
|
||||||
result = result * PRIME + (this.isDeleted() ? 79 : 97);
|
result = result * PRIME + (this.isDeleted() ? 79 : 97);
|
||||||
result = result * PRIME + this.getJsonMessageId();
|
result = result * PRIME + this.getJsonMessageId();
|
||||||
final Object $token = this.getToken();
|
final Object $token = this.getToken();
|
||||||
@ -602,7 +587,7 @@ public class ChatMessage implements MessageContentType, MessageContentType.Image
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "ChatMessage(isGrouped=" + this.isGrouped() + ", isOneToOneConversation=" + this.isOneToOneConversation() + ", activeUser=" + this.getActiveUser() + ", selectedIndividualHashMap=" + this.getSelectedIndividualHashMap() + ", isLinkPreviewAllowed=" + this.isLinkPreviewAllowed() + ", isDeleted=" + this.isDeleted() + ", jsonMessageId=" + this.getJsonMessageId() + ", token=" + this.getToken() + ", actorType=" + this.getActorType() + ", actorId=" + this.getActorId() + ", actorDisplayName=" + this.getActorDisplayName() + ", timestamp=" + this.getTimestamp() + ", message=" + this.getMessage() + ", messageParameters=" + this.getMessageParameters() + ", systemMessageType=" + this.getSystemMessageType() + ", replyable=" + this.isReplyable() + ", parentMessage=" + this.getParentMessage() + ", readStatus=" + this.getReadStatus() + ", messageTypesToIgnore=" + this.getMessageTypesToIgnore() + ")";
|
return "ChatMessage(isGrouped=" + this.isGrouped() + ", isOneToOneConversation=" + this.isOneToOneConversation() + ", activeUser=" + this.getActiveUser() + ", selectedIndividualHashMap=" + this.getSelectedIndividualHashMap() + ", isDeleted=" + this.isDeleted() + ", jsonMessageId=" + this.getJsonMessageId() + ", token=" + this.getToken() + ", actorType=" + this.getActorType() + ", actorId=" + this.getActorId() + ", actorDisplayName=" + this.getActorDisplayName() + ", timestamp=" + this.getTimestamp() + ", message=" + this.getMessage() + ", messageParameters=" + this.getMessageParameters() + ", systemMessageType=" + this.getSystemMessageType() + ", replyable=" + this.isReplyable() + ", parentMessage=" + this.getParentMessage() + ", readStatus=" + this.getReadStatus() + ", messageTypesToIgnore=" + this.getMessageTypesToIgnore() + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVoiceMessage(){
|
public boolean isVoiceMessage(){
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
* Nextcloud Talk application
|
* Nextcloud Talk application
|
||||||
*
|
*
|
||||||
* @author Mario Danic
|
* @author Mario Danic
|
||||||
|
* @author Tim Krüger
|
||||||
|
* Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
|
||||||
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
* Copyright (C) 2017 Mario Danic <mario@lovelyhq.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
@ -241,10 +243,6 @@ public interface AppPreferences {
|
|||||||
@KeyByString("incognito_keyboard")
|
@KeyByString("incognito_keyboard")
|
||||||
@RemoveMethod
|
@RemoveMethod
|
||||||
void removeIncognitoKeyboard();
|
void removeIncognitoKeyboard();
|
||||||
|
|
||||||
@KeyByString("link_previews")
|
|
||||||
@DefaultValue(R.bool.value_true)
|
|
||||||
boolean getAreLinkPreviewsAllowed();
|
|
||||||
|
|
||||||
@KeyByString("phone_book_integration")
|
@KeyByString("phone_book_integration")
|
||||||
@DefaultValue(R.bool.value_false)
|
@DefaultValue(R.bool.value_false)
|
||||||
@ -253,9 +251,7 @@ public interface AppPreferences {
|
|||||||
@KeyByString("phone_book_integration")
|
@KeyByString("phone_book_integration")
|
||||||
void setPhoneBookIntegration(boolean value);
|
void setPhoneBookIntegration(boolean value);
|
||||||
|
|
||||||
@KeyByString("link_previews")
|
// TODO: Remove in 13.0.0
|
||||||
void setLinkPreviewsAllowed(boolean value);
|
|
||||||
|
|
||||||
@KeyByString("link_previews")
|
@KeyByString("link_previews")
|
||||||
@RemoveMethod
|
@RemoveMethod
|
||||||
void removeLinkPreviews();
|
void removeLinkPreviews();
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
~
|
~
|
||||||
~ @author Mario Danic
|
~ @author Mario Danic
|
||||||
~ @author Andy Scherzinger
|
~ @author Andy Scherzinger
|
||||||
|
~ @author Tim Krüger
|
||||||
|
~ Copyright (C) 2021 Tim Krüger <t@timkrueger.me>
|
||||||
~ Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
~ Copyright (C) 2021 Andy Scherzinger <info@andy-scherzinger.de>
|
||||||
~ Copyright (C) 2017 Mario Danic
|
~ Copyright (C) 2017 Mario Danic
|
||||||
~
|
~
|
||||||
@ -235,15 +237,6 @@
|
|||||||
apc:mp_summary="@string/nc_settings_incognito_keyboard_desc"
|
apc:mp_summary="@string/nc_settings_incognito_keyboard_desc"
|
||||||
apc:mp_title="@string/nc_settings_incognito_keyboard_title" />
|
apc:mp_title="@string/nc_settings_incognito_keyboard_title" />
|
||||||
|
|
||||||
<com.yarolegovich.mp.MaterialSwitchPreference
|
|
||||||
android:id="@+id/settings_link_previews"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
apc:mp_default_value="@bool/value_true"
|
|
||||||
apc:mp_key="@string/nc_settings_link_previews_key"
|
|
||||||
apc:mp_summary="@string/nc_settings_link_previews_desc"
|
|
||||||
apc:mp_title="@string/nc_settings_link_previews_title" />
|
|
||||||
|
|
||||||
<com.yarolegovich.mp.MaterialSwitchPreference
|
<com.yarolegovich.mp.MaterialSwitchPreference
|
||||||
android:id="@+id/settings_phone_book_integration"
|
android:id="@+id/settings_phone_book_integration"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -128,9 +128,6 @@
|
|||||||
<string name="nc_settings_incognito_keyboard_title">Incognito keyboard</string>
|
<string name="nc_settings_incognito_keyboard_title">Incognito keyboard</string>
|
||||||
<string name="nc_settings_incognito_keyboard_desc">Instructs keyboard to disable personalized learning (without guarantees)</string>
|
<string name="nc_settings_incognito_keyboard_desc">Instructs keyboard to disable personalized learning (without guarantees)</string>
|
||||||
<string name="nc_settings_incognito_keyboard_key" translatable="false">incognito_keyboard</string>
|
<string name="nc_settings_incognito_keyboard_key" translatable="false">incognito_keyboard</string>
|
||||||
<string name="nc_settings_link_previews_title">Show link previews</string>
|
|
||||||
<string name="nc_settings_link_previews_desc">Allows previews of content from received links for supported services</string>
|
|
||||||
<string name="nc_settings_link_previews_key" translatable="false">link_previews</string>
|
|
||||||
<string name="nc_settings_read_privacy_key" translatable="false">read_privacy</string>
|
<string name="nc_settings_read_privacy_key" translatable="false">read_privacy</string>
|
||||||
<string name="nc_locked_tap_to_unlock">Tap to unlock</string>
|
<string name="nc_locked_tap_to_unlock">Tap to unlock</string>
|
||||||
<string name="nc_locked">Locked</string>
|
<string name="nc_locked">Locked</string>
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
DO NOT TOUCH; GENERATED BY DRONE
|
DO NOT TOUCH; GENERATED BY DRONE
|
||||||
<span class="mdl-layout-title">Lint Report: 3 errors and 272 warnings</span>
|
<span class="mdl-layout-title">Lint Report: 3 errors and 270 warnings</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user