aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/ConversationFragment.java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java58
1 files changed, 31 insertions, 27 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index a817b27b..445aaa47 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -452,13 +452,12 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
if (m.getStatus() != Message.STATUS_SEND_FAILED) {
sendAgain.setVisible(false);
}
- if (((m.getType() != Message.TYPE_IMAGE && m.getDownloadable() == null)
- || m.getImageParams().url == null) && !GeoHelper.isGeoUri(m.getBody())) {
+ if (!m.hasFileOnRemoteHost() && !GeoHelper.isGeoUri(m.getBody())) {
copyUrl.setVisible(false);
}
if (m.getType() != Message.TYPE_TEXT
|| m.getDownloadable() != null
- || !m.bodyContainsDownloadable()) {
+ || m.treatAsDownloadable() == Message.Decision.NO) {
downloadImage.setVisible(false);
}
if (!((m.getDownloadable() != null && !(m.getDownloadable() instanceof DownloadablePlaceholder))
@@ -544,7 +543,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
url = message.getBody();
} else {
resId = R.string.image_url;
- url = message.getImageParams().url.toString();
+ url = message.getFileParams().url.toString();
}
if (activity.copyTextToClipboard(url, resId)) {
Toast.makeText(activity, R.string.url_copied_to_clipboard,
@@ -912,7 +911,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
final SendButtonAction action;
final int status;
final boolean empty = this.mEditMessage == null || this.mEditMessage.getText().length() == 0;
- if (c.getMode() == Conversation.MODE_MULTI) {
+ final boolean conference = c.getMode() == Conversation.MODE_MULTI;
+ if (conference && !c.getAccount().httpUploadAvailable()) {
if (empty && c.getNextCounterpart() != null) {
action = SendButtonAction.CANCEL;
} else {
@@ -920,28 +920,32 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
} else {
if (empty) {
- String setting = activity.getPreferences().getString("quick_action","recent");
- if (!setting.equals("none") && UIHelper.receivedLocationQuestion(conversation.getLatestMessage())) {
- setting = "location";
- } else if (setting.equals("recent")) {
- setting = activity.getPreferences().getString("recently_used_quick_action","text");
- }
- switch (setting) {
- case "photo":
- action = SendButtonAction.TAKE_PHOTO;
- break;
- case "location":
- action = SendButtonAction.SEND_LOCATION;
- break;
- case "voice":
- action = SendButtonAction.RECORD_VOICE;
- break;
- case "picture":
- action = SendButtonAction.CHOOSE_PICTURE;
- break;
- default:
- action = SendButtonAction.TEXT;
- break;
+ if (conference && c.getNextCounterpart() != null) {
+ action = SendButtonAction.CANCEL;
+ } else {
+ String setting = activity.getPreferences().getString("quick_action", "recent");
+ if (!setting.equals("none") && UIHelper.receivedLocationQuestion(conversation.getLatestMessage())) {
+ setting = "location";
+ } else if (setting.equals("recent")) {
+ setting = activity.getPreferences().getString("recently_used_quick_action", "text");
+ }
+ switch (setting) {
+ case "photo":
+ action = SendButtonAction.TAKE_PHOTO;
+ break;
+ case "location":
+ action = SendButtonAction.SEND_LOCATION;
+ break;
+ case "voice":
+ action = SendButtonAction.RECORD_VOICE;
+ break;
+ case "picture":
+ action = SendButtonAction.CHOOSE_PICTURE;
+ break;
+ default:
+ action = SendButtonAction.TEXT;
+ break;
+ }
}
} else {
action = SendButtonAction.TEXT;