mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-30 13:46:22 +00:00
Include incoming message body in notifications.
1) Refactor the master secret reset logic to properly interact with services. 2) Add support for "BigText" and "Inbox" style notifications. 3) Decrypt message bodies when unlocked, display 'encrypted' when locked.
This commit is contained in:
@@ -25,6 +25,7 @@ import org.thoughtcrime.securesms.database.EncryptingMmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.EncryptingSmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.SmsDatabase;
|
||||
import org.thoughtcrime.securesms.mms.TextTransport;
|
||||
import org.thoughtcrime.securesms.notifications.MessageNotifier;
|
||||
import org.thoughtcrime.securesms.protocol.Prefix;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||
@@ -145,6 +146,7 @@ public class DecryptingQueue {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
EncryptingMmsDatabase database = DatabaseFactory.getEncryptingMmsDatabase(context, masterSecret);
|
||||
|
||||
@@ -178,7 +180,6 @@ public class DecryptingQueue {
|
||||
Log.w("DecryptingQueue", "Successfully decrypted MMS!");
|
||||
database.insertSecureDecryptedMessageReceived(plaintextPdu, threadId);
|
||||
database.delete(messageId);
|
||||
|
||||
} catch (RecipientFormattingException rfe) {
|
||||
Log.w("DecryptingQueue", rfe);
|
||||
database.markAsDecryptFailed(messageId, threadId);
|
||||
@@ -240,6 +241,7 @@ public class DecryptingQueue {
|
||||
}
|
||||
|
||||
database.updateSecureMessageBody(masterSecret, messageId, plaintextBody);
|
||||
MessageNotifier.updateNotification(context, masterSecret);
|
||||
}
|
||||
|
||||
private void handleLocalAsymmetricEncrypt() {
|
||||
@@ -261,8 +263,10 @@ public class DecryptingQueue {
|
||||
}
|
||||
|
||||
database.updateMessageBody(masterSecret, messageId, plaintextBody);
|
||||
MessageNotifier.updateNotification(context, masterSecret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (body.startsWith(Prefix.ASYMMETRIC_ENCRYPT)) handleRemoteAsymmetricEncrypt();
|
||||
else if (body.startsWith(Prefix.ASYMMETRIC_LOCAL_ENCRYPT)) handleLocalAsymmetricEncrypt();
|
||||
|
||||
Reference in New Issue
Block a user