mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-21 15:08:42 +00:00
Move API around.
This commit is contained in:
@@ -39,17 +39,17 @@ import android.util.Log;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.RoutingActivity;
|
||||
import org.thoughtcrime.securesms.database.PushDatabase;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFormattingException;
|
||||
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.MmsSmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.PushDatabase;
|
||||
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFormattingException;
|
||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.textsecure.push.IncomingPushMessage;
|
||||
import org.whispersystems.textsecure.api.messages.TextSecureEnvelope;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
@@ -285,24 +285,24 @@ public class MessageNotifier {
|
||||
if (masterSecret != null) return;
|
||||
|
||||
PushDatabase.Reader reader = null;
|
||||
IncomingPushMessage message;
|
||||
TextSecureEnvelope envelope;
|
||||
|
||||
try {
|
||||
reader = DatabaseFactory.getPushDatabase(context).readerFor(cursor);
|
||||
|
||||
while ((message = reader.getNext()) != null) {
|
||||
Recipient recipient;
|
||||
while ((envelope = reader.getNext()) != null) {
|
||||
Recipients recipients;
|
||||
|
||||
try {
|
||||
recipient = RecipientFactory.getRecipientsFromString(context, message.getSource(), false).getPrimaryRecipient();
|
||||
recipients = RecipientFactory.getRecipientsFromString(context, envelope.getSource(), false);
|
||||
} catch (RecipientFormattingException e) {
|
||||
Log.w("MessageNotifier", e);
|
||||
recipient = Recipient.getUnknownRecipient(context);
|
||||
recipients = new Recipients(Recipient.getUnknownRecipient(context));
|
||||
}
|
||||
|
||||
Recipients recipients = RecipientFactory.getRecipientsFromMessage(context, message, false);
|
||||
long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipients);
|
||||
SpannableString body = new SpannableString(context.getString(R.string.MessageNotifier_encrypted_message));
|
||||
Recipient recipient = recipients.getPrimaryRecipient();
|
||||
long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipients);
|
||||
SpannableString body = new SpannableString(context.getString(R.string.MessageNotifier_encrypted_message));
|
||||
body.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), 0, body.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
notificationState.addNotification(new NotificationItem(recipient, recipients, null, threadId, body, null));
|
||||
|
Reference in New Issue
Block a user