aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2019-10-27 20:15:26 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2019-10-27 20:15:26 +0100
commit1f7259407fcacb0574f3bc80517d5e3be2befbac (patch)
tree1fe34a0aa23aa659c700a262df6967d66abcbbec /src
parentccc12548967f1637730634da7135c0319f415ea2 (diff)
show attachment button in private muc messages
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java9
-rw-r--r--src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java1
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java
index 39fc09241..fd5a5c441 100644
--- a/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java
+++ b/src/main/java/de/pixart/messenger/ui/util/ConversationMenuConfigurator.java
@@ -31,10 +31,11 @@ package de.pixart.messenger.ui.util;
import android.content.Context;
import android.content.pm.PackageManager;
-import androidx.annotation.NonNull;
import android.view.Menu;
import android.view.MenuItem;
+import androidx.annotation.NonNull;
+
import de.pixart.messenger.Config;
import de.pixart.messenger.R;
import de.pixart.messenger.crypto.OmemoSetting;
@@ -69,14 +70,16 @@ public class ConversationMenuConfigurator {
return;
}
final MenuItem menuAttach = menu.findItem(R.id.action_attach_file);
- if (Quick_share_attachment_choice && !hasAttachments) {
+ final boolean isPM = conversation.getMode() == Conversation.MODE_MULTI && conversation.getNextCounterpart() != null;
+ if (Quick_share_attachment_choice && !hasAttachments && !isPM) {
menuAttach.setVisible(false);
return;
}
final boolean visible;
if (conversation.getMode() == Conversation.MODE_MULTI) {
- visible = conversation.getAccount().httpUploadAvailable() && conversation.getMucOptions().participating();
+ visible = conversation.getAccount().httpUploadAvailable() && conversation.getMucOptions().participating()
+ || conversation.getAccount().httpUploadAvailable() && isPM;
} else {
visible = true;
}
diff --git a/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java b/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java
index d6f5c0f2b..a58f683d3 100644
--- a/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java
+++ b/src/main/java/de/pixart/messenger/ui/util/MucDetailsContextMenuHelper.java
@@ -204,6 +204,7 @@ public final class MucDetailsContextMenuHelper {
if (activity instanceof ConversationsActivity) {
ConversationFragment conversationFragment = ConversationFragment.get(activity);
if (conversationFragment != null) {
+ activity.invalidateOptionsMenu();
conversationFragment.privateMessageWith(user.getFullJid());
return true;
}