mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
@@ -24,6 +24,7 @@
|
||||
<TextView android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/chat_share_with_title"
|
||||
android:id="@+id/title"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp"
|
||||
android:layout_alignParentStart="true"
|
||||
|
||||
@@ -274,6 +274,8 @@
|
||||
<!-- Translators: %1$s will be replaced by the server name (eg. imap.somewhere.org) and %2$s will be replaced by the human-readable response from the server. this response may be a single word or some sentences and may or may not be localized. -->
|
||||
<string name="login_error_server_response">Response from %1$s: %2$s\n\nSome providers place additional information in your inbox; you can check them it eg. in the web frontend. Consult your provider or friends if you run into problems.</string>
|
||||
|
||||
<!-- share and forward messages -->
|
||||
<string name="forward_messages">Forward messages</string>
|
||||
|
||||
<!-- preferences -->
|
||||
<string name="pref_summary_privacy">Screen lock %1$s, Read receipts %2$s</string>
|
||||
|
||||
@@ -80,6 +80,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.thoughtcrime.securesms.ShareActivity.EXTRA_FORWARD;
|
||||
import static org.thoughtcrime.securesms.ShareActivity.EXTRA_MSG_IDS;
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
@@ -418,6 +419,7 @@ public class ConversationFragment extends Fragment
|
||||
Intent composeIntent = new Intent(getActivity(), ShareActivity.class);
|
||||
int[] msgIds = DcMsg.msgSetToIds(messageRecords);
|
||||
composeIntent.putExtra(EXTRA_MSG_IDS, msgIds);
|
||||
composeIntent.putExtra(EXTRA_FORWARD, true);
|
||||
// composeIntent.putExtra(Intent.EXTRA_TEXT, messageRecords.getDisplayBody().toString());
|
||||
/* TODO: handle fowarding media
|
||||
if (message.isMms()) {
|
||||
|
||||
@@ -42,6 +42,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.DcChatlist;
|
||||
import com.b44t.messenger.DcContext;
|
||||
@@ -87,6 +88,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
||||
public static final String EXTRA_ADDRESS_MARSHALLED = "address_marshalled";
|
||||
public static final String EXTRA_DISTRIBUTION_TYPE = "distribution_type";
|
||||
public static final String EXTRA_MSG_IDS = "message_ids";
|
||||
public static final String EXTRA_FORWARD = "forward";
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
@@ -97,6 +99,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
||||
private String mimeType;
|
||||
private boolean isPassingAlongMedia;
|
||||
private ApplicationDcContext dcContext;
|
||||
private boolean isForward;
|
||||
|
||||
@Override
|
||||
protected void onPreCreate() {
|
||||
@@ -110,11 +113,16 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
setContentView(R.layout.share_activity);
|
||||
|
||||
initializeActivityContext();
|
||||
initializeToolbar();
|
||||
initializeResources();
|
||||
initializeMedia();
|
||||
}
|
||||
|
||||
private void initializeActivityContext() {
|
||||
isForward = getIntent().getBooleanExtra(EXTRA_FORWARD, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
Log.w(TAG, "onNewIntent()");
|
||||
@@ -145,6 +153,10 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
||||
private void initializeToolbar() {
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
if(isForward) {
|
||||
TextView title = toolbar.findViewById(R.id.title);
|
||||
title.setText(R.string.forward_messages);
|
||||
}
|
||||
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
|
||||
@@ -162,11 +174,19 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
private void onConversationClick(int chatId) {
|
||||
String name = dcContext.getChat(chatId).getName();
|
||||
Dialogs.showResponseDialog(this, getString(R.string.ask_forward, name), (dialogInterface, i) -> {
|
||||
int[] value = getIntent().getIntArrayExtra(EXTRA_MSG_IDS);
|
||||
dcContext.forwardMsgs(value, chatId);
|
||||
createConversation(chatId);
|
||||
});
|
||||
if (isForward) {
|
||||
Dialogs.showResponseDialog(this, getString(R.string.ask_forward, name), (dialogInterface, i) -> {
|
||||
delegateMessage(chatId);
|
||||
});
|
||||
} else {
|
||||
delegateMessage(chatId);;
|
||||
}
|
||||
}
|
||||
|
||||
private void delegateMessage(int chatId) {
|
||||
int[] value = getIntent().getIntArrayExtra(EXTRA_MSG_IDS);
|
||||
dcContext.forwardMsgs(value, chatId);
|
||||
createConversation(chatId);
|
||||
}
|
||||
|
||||
private void initializeMedia() {
|
||||
|
||||
Reference in New Issue
Block a user