This commit is contained in:
Niels Andriesse 2019-06-11 14:41:04 +10:00
parent 66010f4755
commit 021bf1b33c

View File

@ -29,16 +29,11 @@ import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage; import org.whispersystems.signalservice.api.messages.multidevice.SignalServiceSyncMessage;
import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException; import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.signalservice.internal.push.SignalServiceProtos;
import org.whispersystems.signalservice.loki.api.LokiAPI;
import org.whispersystems.signalservice.loki.messaging.SignalMessageInfo;
import java.io.IOException; import java.io.IOException;
import javax.inject.Inject; import javax.inject.Inject;
import kotlin.Unit;
public class PushTextSendJob extends PushSendJob implements InjectableType { public class PushTextSendJob extends PushSendJob implements InjectableType {
public static final String KEY = "PushTextSendJob"; public static final String KEY = "PushTextSendJob";
@ -94,11 +89,6 @@ public class PushTextSendJob extends PushSendJob implements InjectableType {
byte[] profileKey = recipient.getProfileKey(); byte[] profileKey = recipient.getProfileKey();
UnidentifiedAccessMode accessMode = recipient.getUnidentifiedAccessMode(); UnidentifiedAccessMode accessMode = recipient.getUnidentifiedAccessMode();
String hexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context);
SignalMessageInfo message = new SignalMessageInfo(SignalServiceProtos.Envelope.Type.FRIEND_REQUEST, System.currentTimeMillis(), hexEncodedPublicKey, 0, "stub", recipient.getAddress().serialize(), 4 * 24 * 60 * 60 * 1000, false);
LokiAPI api = new LokiAPI(hexEncodedPublicKey, DatabaseFactory.getLokiAPIDatabase(context));
api.sendSignalMessage(message, () -> Unit.INSTANCE);
boolean unidentified = deliver(record); boolean unidentified = deliver(record);
database.markAsSent(messageId, true); database.markAsSent(messageId, true);