direct forward to "saved messages"

when forwarding to "saved messages",
the ui goes back to the chat and the position in the original chat
and shows a short "saved" hint.

this saves at least one tap,
and makes saving multiple messages easier
as you stay in context.
btw, this is also how telegram handles things
and makes the saving as easy to use as starring eg. in whatsapp.

forwarding messasges to other chats is not changed.
This commit is contained in:
B. Petersen
2020-10-08 01:23:27 +02:00
parent cedccccb9a
commit 57210a2137
2 changed files with 21 additions and 10 deletions
+2
View File
@@ -287,6 +287,8 @@
<string name="chat_self_talk_subtitle">Messages I sent to myself</string>
<string name="saved_messages">Saved messages</string>
<string name="saved_messages_explain">• Forward messages here for easy access\n\n• Take notes or voice memos\n\n• Attach media to save them</string>
<!-- this "Saved" should match the "Saved" from "Saved messages" -->
<string name="saved">Saved</string>
<string name="chat_contact_request">Contact request</string>
<string name="chat_no_contact_requests">No contact requests.\n\nIf you want classic emails to appear here as contact requests, you can change the corresponding setting in the app settings.</string>
<string name="retry_send">Retry to send message</string>
@@ -25,12 +25,12 @@ import android.view.MenuItem;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.widget.Toolbar;
import androidx.appcompat.widget.TooltipCompat;
import com.b44t.messenger.DcChat;
import com.b44t.messenger.DcMsg;
import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;
@@ -46,6 +46,7 @@ import org.thoughtcrime.securesms.util.DynamicLanguage;
import org.thoughtcrime.securesms.util.DynamicNoActionBarTheme;
import org.thoughtcrime.securesms.util.DynamicTheme;
import org.thoughtcrime.securesms.util.Prefs;
import org.thoughtcrime.securesms.util.SendRelayedMessageUtil;
import static org.thoughtcrime.securesms.ConversationActivity.CHAT_ID_EXTRA;
import static org.thoughtcrime.securesms.ConversationActivity.STARTING_POSITION_EXTRA;
@@ -280,17 +281,25 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
public void openConversation(int chatId, int startingPosition) {
searchToolbar.clearFocus();
Intent intent = new Intent(this, ConversationActivity.class);
intent.putExtra(CHAT_ID_EXTRA, chatId);
intent.putExtra(STARTING_POSITION_EXTRA, startingPosition);
if (isRelayingMessageContent(this)) {
acquireRelayMessageContent(this, intent);
startActivityForResult(intent, REQUEST_RELAY);
final ApplicationDcContext dcContext = DcHelper.getContext(this);
if (isForwarding(this) && dcContext.getChat(chatId).isSelfTalk()) {
SendRelayedMessageUtil.immediatelyRelay(this, chatId);
Toast.makeText(this, "✔️ " + getString(R.string.saved), Toast.LENGTH_SHORT).show();
handleResetRelaying();
finish();
} else {
startActivity(intent);
}
Intent intent = new Intent(this, ConversationActivity.class);
intent.putExtra(CHAT_ID_EXTRA, chatId);
intent.putExtra(STARTING_POSITION_EXTRA, startingPosition);
if (isRelayingMessageContent(this)) {
acquireRelayMessageContent(this, intent);
startActivityForResult(intent, REQUEST_RELAY);
} else {
startActivity(intent);
}
overridePendingTransition(R.anim.slide_from_right, R.anim.fade_scale_out);
overridePendingTransition(R.anim.slide_from_right, R.anim.fade_scale_out);
}
}
@Override