mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-17 12:38:27 +00:00
Include (somehow missed) support for send/receive encrypted MMS.
This commit is contained in:
parent
e5f634ba45
commit
c86e414c5f
@ -795,11 +795,11 @@ public class ConversationActivity extends PassphraseRequiredSherlockFragmentActi
|
||||
if (attachmentManager.isAttachmentPresent()) {
|
||||
allocatedThreadId = MessageSender.sendMms(ConversationActivity.this, masterSecret, recipients,
|
||||
threadId, attachmentManager.getSlideDeck(), body,
|
||||
distributionType, forcePlaintext);
|
||||
distributionType, isEncryptedConversation && !forcePlaintext);
|
||||
} else if (recipients.isEmailRecipient() || !recipients.isSingleRecipient()) {
|
||||
allocatedThreadId = MessageSender.sendMms(ConversationActivity.this, masterSecret, recipients,
|
||||
threadId, new SlideDeck(), body, distributionType,
|
||||
forcePlaintext);
|
||||
isEncryptedConversation && !forcePlaintext);
|
||||
} else {
|
||||
OutgoingTextMessage message;
|
||||
|
||||
|
@ -46,6 +46,7 @@ import ws.com.google.android.mms.MmsException;
|
||||
import ws.com.google.android.mms.pdu.MultimediaMessagePdu;
|
||||
import ws.com.google.android.mms.pdu.PduParser;
|
||||
import ws.com.google.android.mms.pdu.RetrieveConf;
|
||||
import ws.com.google.android.mms.pdu.SendReq;
|
||||
|
||||
/**
|
||||
* A work queue for processing a number of encryption operations.
|
||||
@ -192,7 +193,9 @@ public class DecryptingQueue {
|
||||
plaintextPduBytes = cipher.decryptMessage(ciphertextPduBytes);
|
||||
}
|
||||
|
||||
RetrieveConf plaintextPdu = (RetrieveConf)new PduParser(plaintextPduBytes).parse();
|
||||
MultimediaMessagePdu plaintextGenericPdu = (MultimediaMessagePdu)new PduParser(plaintextPduBytes).parse();
|
||||
RetrieveConf plaintextPdu = new RetrieveConf(plaintextGenericPdu.getPduHeaders(),
|
||||
plaintextGenericPdu.getBody());
|
||||
Log.w("DecryptingQueue", "Successfully decrypted MMS!");
|
||||
database.insertSecureDecryptedMessageInbox(masterSecret, plaintextPdu, threadId);
|
||||
database.delete(messageId);
|
||||
|
@ -40,7 +40,7 @@ public class MessageSender {
|
||||
|
||||
public static long sendMms(Context context, MasterSecret masterSecret, Recipients recipients,
|
||||
long threadId, SlideDeck slideDeck, String message, int distributionType,
|
||||
boolean forcePlaintext)
|
||||
boolean secure)
|
||||
throws MmsException
|
||||
{
|
||||
if (threadId == -1)
|
||||
@ -68,7 +68,7 @@ public class MessageSender {
|
||||
// sendMms(context, insecureRecipients, masterSecret, sendRequest, threadId, false);
|
||||
// }
|
||||
|
||||
sendMms(context, recipients, masterSecret, sendRequest, threadId, distributionType, false);
|
||||
sendMms(context, recipients, masterSecret, sendRequest, threadId, distributionType, secure);
|
||||
|
||||
return threadId;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class RetrieveConf extends MultimediaMessagePdu {
|
||||
* @param headers Headers for this PDU.
|
||||
* @param body Body of this PDu.
|
||||
*/
|
||||
RetrieveConf(PduHeaders headers, PduBody body) {
|
||||
public RetrieveConf(PduHeaders headers, PduBody body) {
|
||||
super(headers, body);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user