mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 00:00:10 +00:00
move routing logic to all activities
Fixes #2239 Closes #27923 // FREEBIE
This commit is contained in:
committed by
Moxie Marlinspike
parent
141ee6565d
commit
0ff99258ac
@@ -39,8 +39,8 @@ import android.text.TextUtils;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.util.Log;
|
||||
|
||||
import org.thoughtcrime.securesms.ConversationActivity;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.RoutingActivity;
|
||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.MmsSmsDatabase;
|
||||
@@ -84,7 +84,7 @@ public class MessageNotifier {
|
||||
if (visibleThread == threadId) {
|
||||
sendInThreadNotification(context);
|
||||
} else {
|
||||
Intent intent = new Intent(context, RoutingActivity.class);
|
||||
Intent intent = new Intent(context, ConversationActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
intent.putExtra("recipients", recipients.getIds());
|
||||
intent.putExtra("thread_id", threadId);
|
||||
@@ -228,7 +228,7 @@ public class MessageNotifier {
|
||||
notificationState.getMessageCount()));
|
||||
builder.setContentText(String.format(context.getString(R.string.MessageNotifier_most_recent_from_s),
|
||||
notifications.get(0).getIndividualRecipientName()));
|
||||
builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, RoutingActivity.class), 0));
|
||||
builder.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, ConversationActivity.class), 0));
|
||||
|
||||
builder.setContentInfo(String.valueOf(notificationState.getMessageCount()));
|
||||
builder.setNumber(notificationState.getMessageCount());
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.text.SpannableStringBuilder;
|
||||
|
||||
import org.thoughtcrime.securesms.RoutingActivity;
|
||||
import org.thoughtcrime.securesms.ConversationActivity;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
@@ -70,16 +70,12 @@ public class NotificationItem {
|
||||
}
|
||||
|
||||
public PendingIntent getPendingIntent(Context context) {
|
||||
Intent intent = new Intent(context, RoutingActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||
Intent intent = new Intent(context, ConversationActivity.class);
|
||||
|
||||
if (recipients != null || threadRecipients != null) {
|
||||
if (threadRecipients != null) intent.putExtra("recipients", threadRecipients.getIds());
|
||||
else intent.putExtra("recipients", recipients.getIds());
|
||||
|
||||
intent.putExtra("thread_id", threadId);
|
||||
}
|
||||
Recipients notifyRecipients = threadRecipients != null ? threadRecipients : recipients;
|
||||
if (notifyRecipients != null) intent.putExtra("recipients", notifyRecipients.getIds());
|
||||
|
||||
intent.putExtra("thread_id", threadId);
|
||||
intent.setData((Uri.parse("custom://"+System.currentTimeMillis())));
|
||||
|
||||
return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
Reference in New Issue
Block a user