diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt index 2bca297705..edc7378666 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt @@ -33,13 +33,9 @@ import android.net.Uri import android.os.Handler import android.util.Base64 import android.util.Log -import android.view.Gravity -import android.view.MenuItem import android.view.View import android.widget.ImageView -import android.widget.PopupMenu import android.widget.ProgressBar -import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat import androidx.emoji2.widget.EmojiTextView import autodagger.AutoInjector @@ -128,7 +124,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) : ) } clickView!!.setOnLongClickListener { l: View? -> - onMessageViewLongClick(message) + previewMessageInterface!!.onPreviewMessageLongClick(message) true } } else { @@ -280,33 +276,6 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) : return drawable } - private fun onMessageViewLongClick(message: ChatMessage) { - if (fileViewerUtils!!.isSupportedForInternalViewer(message.selectedIndividualHashMap!![KEY_MIMETYPE])) { - previewMessageInterface!!.onPreviewMessageLongClick(message) - return - } - val viewContext: Context? = if (itemView.context != null) { - itemView.context - } else { - context - } - val popupMenu = PopupMenu( - ContextThemeWrapper(viewContext, R.style.appActionBarPopupMenu), - itemView, - Gravity.START - ) - popupMenu.inflate(R.menu.chat_preview_message_menu) - popupMenu.setOnMenuItemClickListener { item: MenuItem -> - if (item.itemId == R.id.openInFiles) { - val keyID = message.selectedIndividualHashMap!![KEY_ID] - val link = message.selectedIndividualHashMap!!["link"] - fileViewerUtils!!.openFileInFilesApp(link!!, keyID!!) - } - true - } - popupMenu.show() - } - private fun fetchFileInformation(url: String, activeUser: User?) { Single.fromCallable { ReadFilesystemOperation(okHttpClient, activeUser, url, 0) } .observeOn(Schedulers.io()) diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index 10dbe069be..945ef3f497 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -4216,8 +4216,6 @@ class ChatActivity : isOlderThanSixHours -> false message.systemMessageType != ChatMessage.SystemMessageType.DUMMY -> false message.isDeleted -> false - message.hasFileAttachment() -> false - OBJECT_MESSAGE == message.message -> false !CapabilitiesUtilNew.hasSpreedFeatureCapability(conversationUser, "delete-messages") -> false !participantPermissions.hasChatPermission() -> false else -> true diff --git a/app/src/main/res/menu/chat_preview_message_menu.xml b/app/src/main/res/menu/chat_preview_message_menu.xml deleted file mode 100644 index 89df47bd48..0000000000 --- a/app/src/main/res/menu/chat_preview_message_menu.xml +++ /dev/null @@ -1,25 +0,0 @@ - - -