make quick actions available in conferences when file attachment is available

This commit is contained in:
Daniel Gultsch 2015-06-29 00:14:37 +02:00
parent 7e11570f2c
commit 82714dedfe
1 changed files with 28 additions and 23 deletions

View File

@ -912,7 +912,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
final SendButtonAction action; final SendButtonAction action;
final int status; final int status;
final boolean empty = this.mEditMessage == null || this.mEditMessage.getText().length() == 0; 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) { if (empty && c.getNextCounterpart() != null) {
action = SendButtonAction.CANCEL; action = SendButtonAction.CANCEL;
} else { } else {
@ -920,28 +921,32 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
} }
} else { } else {
if (empty) { if (empty) {
String setting = activity.getPreferences().getString("quick_action","recent"); if (conference && c.getNextCounterpart() != null) {
if (!setting.equals("none") && UIHelper.receivedLocationQuestion(conversation.getLatestMessage())) { action = SendButtonAction.CANCEL;
setting = "location"; } else {
} else if (setting.equals("recent")) { String setting = activity.getPreferences().getString("quick_action", "recent");
setting = activity.getPreferences().getString("recently_used_quick_action","text"); if (!setting.equals("none") && UIHelper.receivedLocationQuestion(conversation.getLatestMessage())) {
} setting = "location";
switch (setting) { } else if (setting.equals("recent")) {
case "photo": setting = activity.getPreferences().getString("recently_used_quick_action", "text");
action = SendButtonAction.TAKE_PHOTO; }
break; switch (setting) {
case "location": case "photo":
action = SendButtonAction.SEND_LOCATION; action = SendButtonAction.TAKE_PHOTO;
break; break;
case "voice": case "location":
action = SendButtonAction.RECORD_VOICE; action = SendButtonAction.SEND_LOCATION;
break; break;
case "picture": case "voice":
action = SendButtonAction.CHOOSE_PICTURE; action = SendButtonAction.RECORD_VOICE;
break; break;
default: case "picture":
action = SendButtonAction.TEXT; action = SendButtonAction.CHOOSE_PICTURE;
break; break;
default:
action = SendButtonAction.TEXT;
break;
}
} }
} else { } else {
action = SendButtonAction.TEXT; action = SendButtonAction.TEXT;