show toast when correction fails

This commit is contained in:
Daniel Gultsch 2020-07-26 17:03:51 +02:00
parent 6941d5edd1
commit 9cd4e1d581
2 changed files with 7 additions and 4 deletions

View File

@ -2753,9 +2753,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (lastEditableMessage != null) { if (lastEditableMessage != null) {
correctMessage(lastEditableMessage); correctMessage(lastEditableMessage);
return true; return true;
} } else {
Toast.makeText(getActivity(),R.string.could_not_correct_message, Toast.LENGTH_LONG).show();
return false; return false;
} }
}
@Override @Override
public void onTypingStarted() { public void onTypingStarted() {
@ -2763,7 +2765,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (service == null) { if (service == null) {
return; return;
} }
Account.State status = conversation.getAccount().getStatus(); final Account.State status = conversation.getAccount().getStatus();
if (status == Account.State.ONLINE && conversation.setOutgoingChatState(ChatState.COMPOSING)) { if (status == Account.State.ONLINE && conversation.setOutgoingChatState(ChatState.COMPOSING)) {
service.sendChatState(conversation); service.sendChatState(conversation);
} }
@ -2776,7 +2778,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (service == null) { if (service == null) {
return; return;
} }
Account.State status = conversation.getAccount().getStatus(); final Account.State status = conversation.getAccount().getStatus();
if (status == Account.State.ONLINE && conversation.setOutgoingChatState(ChatState.PAUSED)) { if (status == Account.State.ONLINE && conversation.setOutgoingChatState(ChatState.PAUSED)) {
service.sendChatState(conversation); service.sendChatState(conversation);
} }
@ -2788,7 +2790,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
if (service == null) { if (service == null) {
return; return;
} }
Account.State status = conversation.getAccount().getStatus(); final Account.State status = conversation.getAccount().getStatus();
if (status == Account.State.ONLINE && conversation.setOutgoingChatState(Config.DEFAULT_CHAT_STATE)) { if (status == Account.State.ONLINE && conversation.setOutgoingChatState(Config.DEFAULT_CHAT_STATE)) {
service.sendChatState(conversation); service.sendChatState(conversation);
} }

View File

@ -926,6 +926,7 @@
<string name="add_to_favorites">Add to favorites</string> <string name="add_to_favorites">Add to favorites</string>
<string name="remove_from_favorites">Remove from favorites</string> <string name="remove_from_favorites">Remove from favorites</string>
<string name="gpx_track">GPX track</string> <string name="gpx_track">GPX track</string>
<string name="could_not_correct_message">Could not correct message</string>
<plurals name="view_users"> <plurals name="view_users">
<item quantity="one">View %1$d Participant</item> <item quantity="one">View %1$d Participant</item>
<item quantity="other">View %1$d Participants</item> <item quantity="other">View %1$d Participants</item>