Use status endpoint for contact connectivity check.

This commit is contained in:
akwizgran
2022-05-27 13:00:43 +01:00
parent 6b790b59fa
commit 34337486e9
2 changed files with 6 additions and 11 deletions

View File

@@ -9,8 +9,6 @@ import java.io.IOException;
import javax.annotation.concurrent.ThreadSafe;
import static org.briarproject.bramble.api.nullsafety.NullSafety.requireNonNull;
@ThreadSafe
@NotNullByDefault
class ContactMailboxConnectivityChecker extends ConnectivityCheckerImpl {
@@ -29,8 +27,9 @@ class ContactMailboxConnectivityChecker extends ConnectivityCheckerImpl {
return new SimpleApiCall() {
@Override
void tryToCallApi() throws IOException, ApiException {
mailboxApi.getFiles(properties,
requireNonNull(properties.getInboxId()));
if (!mailboxApi.checkStatus(properties)) {
throw new ApiException();
}
// Call the observers and cache the result
onConnectivityCheckSucceeded(clock.currentTimeMillis());
}