Add sendSyncRequest command

This commit is contained in:
AsamK 2021-05-03 20:37:13 +02:00
parent 36475bb632
commit 9e3c9db5c0
4 changed files with 42 additions and 10 deletions

View file

@ -1192,7 +1192,15 @@ public class Manager implements Closeable {
}
}
void requestSyncGroups() throws IOException {
public void requestAllSyncData() throws IOException {
requestSyncGroups();
requestSyncContacts();
requestSyncBlocked();
requestSyncConfiguration();
requestSyncKeys();
}
private void requestSyncGroups() throws IOException {
var r = SignalServiceProtos.SyncMessage.Request.newBuilder()
.setType(SignalServiceProtos.SyncMessage.Request.Type.GROUPS)
.build();
@ -1204,7 +1212,7 @@ public class Manager implements Closeable {
}
}
void requestSyncContacts() throws IOException {
private void requestSyncContacts() throws IOException {
var r = SignalServiceProtos.SyncMessage.Request.newBuilder()
.setType(SignalServiceProtos.SyncMessage.Request.Type.CONTACTS)
.build();
@ -1216,7 +1224,7 @@ public class Manager implements Closeable {
}
}
void requestSyncBlocked() throws IOException {
private void requestSyncBlocked() throws IOException {
var r = SignalServiceProtos.SyncMessage.Request.newBuilder()
.setType(SignalServiceProtos.SyncMessage.Request.Type.BLOCKED)
.build();
@ -1228,7 +1236,7 @@ public class Manager implements Closeable {
}
}
void requestSyncConfiguration() throws IOException {
private void requestSyncConfiguration() throws IOException {
var r = SignalServiceProtos.SyncMessage.Request.newBuilder()
.setType(SignalServiceProtos.SyncMessage.Request.Type.CONFIGURATION)
.build();
@ -1240,7 +1248,7 @@ public class Manager implements Closeable {
}
}
void requestSyncKeys() throws IOException {
private void requestSyncKeys() throws IOException {
var r = SignalServiceProtos.SyncMessage.Request.newBuilder()
.setType(SignalServiceProtos.SyncMessage.Request.Type.KEYS)
.build();

View file

@ -138,11 +138,7 @@ public class ProvisioningManager {
}
try {
m.requestSyncGroups();
m.requestSyncContacts();
m.requestSyncBlocked();
m.requestSyncConfiguration();
m.requestSyncKeys();
m.requestAllSyncData();
} catch (Exception e) {
logger.error("Failed to request sync messages from linked device.");
throw e;