mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Added loki message handling.
This commit is contained in:
parent
9d4509d130
commit
e19a71769f
@ -106,6 +106,7 @@ import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage
|
||||
import org.whispersystems.signalservice.api.messages.shared.SharedContact;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
import org.whispersystems.signalservice.loki.crypto.LokiServiceCipher;
|
||||
import org.whispersystems.signalservice.loki.messages.LokiServiceMessage;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.util.ArrayList;
|
||||
@ -238,6 +239,18 @@ public class PushDecryptJob extends BaseJob {
|
||||
return;
|
||||
}
|
||||
|
||||
// Loki: Handle any loki specific messages
|
||||
if (content.lokiMessage.isPresent()) {
|
||||
LokiServiceMessage lokiMessage = content.lokiMessage.get();
|
||||
if (lokiMessage.getPreKeyBundleMessage() != null) {
|
||||
// TODO: Loki - Handle pre key bundle
|
||||
}
|
||||
|
||||
if (lokiMessage.getAddressMessage() != null) {
|
||||
// TODO: Loki - Handle address message
|
||||
}
|
||||
}
|
||||
|
||||
if (content.getDataMessage().isPresent()) {
|
||||
SignalServiceDataMessage message = content.getDataMessage().get();
|
||||
boolean isMediaMessage = message.getAttachments().isPresent() || message.getQuote().isPresent() || message.getSharedContacts().isPresent() || message.getPreviews().isPresent();
|
||||
|
@ -37,7 +37,7 @@ public abstract class PushReceivedJob extends BaseJob {
|
||||
|
||||
if (envelope.isReceipt()) {
|
||||
handleReceipt(envelope);
|
||||
} else if (envelope.isPreKeySignalMessage() || envelope.isSignalMessage() || envelope.isUnidentifiedSender()) {
|
||||
} else if (envelope.isPreKeySignalMessage() || envelope.isSignalMessage() || envelope.isUnidentifiedSender() || envelope.isFriendRequest()) {
|
||||
handleMessage(envelope);
|
||||
} else {
|
||||
Log.w(TAG, "Received envelope of unknown type: " + envelope.getType());
|
||||
|
Loading…
x
Reference in New Issue
Block a user