mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-29 03:06:52 +00:00
Basic support for encrypted push-based attachments.
1) Move the attachment structures into the encrypted message body.
2) Encrypt attachments with symmetric keys transmitted in the
encryptd attachment pointer structure.
3) Correctly handle asynchronous decryption and categorization of
encrypted push messages.
TODO: Correct notification process and network/interruption
retries.
This commit is contained in:
@@ -41,6 +41,16 @@ public class PduBody {
|
||||
mPartMapByFileName = new HashMap<String, PduPart>();
|
||||
}
|
||||
|
||||
public boolean containsPushInProgress() {
|
||||
for (int i=0;i<getPartsNum();i++) {
|
||||
if (getPart(i).isPendingPush()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void putPartToMaps(PduPart part) {
|
||||
// Put part to mPartMapByContentId.
|
||||
byte[] contentId = part.getContentId();
|
||||
|
||||
@@ -122,6 +122,7 @@ public class PduPart {
|
||||
private static final String TAG = "PduPart";
|
||||
|
||||
private boolean isEncrypted;
|
||||
private boolean isPendingPush;
|
||||
|
||||
/**
|
||||
* Empty Constructor.
|
||||
@@ -137,6 +138,14 @@ public class PduPart {
|
||||
public boolean getEncrypted() {
|
||||
return isEncrypted;
|
||||
}
|
||||
|
||||
public void setPendingPush(boolean isPendingPush) {
|
||||
this.isPendingPush = isPendingPush;
|
||||
}
|
||||
|
||||
public boolean isPendingPush() {
|
||||
return isPendingPush;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set part data. The data are stored as byte array.
|
||||
|
||||
Reference in New Issue
Block a user