mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Make signaling db updates use a subscribing consumer
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
7593efd43f
commit
285b9cff03
@ -48,6 +48,7 @@ import androidx.work.Worker;
|
|||||||
import androidx.work.WorkerParameters;
|
import androidx.work.WorkerParameters;
|
||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
import io.reactivex.Observer;
|
import io.reactivex.Observer;
|
||||||
|
import io.reactivex.SingleObserver;
|
||||||
import io.reactivex.disposables.Disposable;
|
import io.reactivex.disposables.Disposable;
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
@ -114,8 +115,14 @@ public class SignalingSettingsWorker extends Worker {
|
|||||||
.getExternalSignalingTicket());
|
.getExternalSignalingTicket());
|
||||||
}
|
}
|
||||||
|
|
||||||
int rows = userManager.saveUser(user).blockingGet();
|
userManager.saveUser(user).subscribe(new SingleObserver<Integer>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
// unused atm
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Integer rows) {
|
||||||
if (rows > 0) {
|
if (rows > 0) {
|
||||||
eventBus.post(new EventStatus(UserIdUtils.INSTANCE.getIdForUser(user),
|
eventBus.post(new EventStatus(UserIdUtils.INSTANCE.getIdForUser(user),
|
||||||
EventStatus.EventType.SIGNALING_SETTINGS,
|
EventStatus.EventType.SIGNALING_SETTINGS,
|
||||||
@ -133,6 +140,15 @@ public class SignalingSettingsWorker extends Worker {
|
|||||||
EventStatus.EventType.SIGNALING_SETTINGS,
|
EventStatus.EventType.SIGNALING_SETTINGS,
|
||||||
false));
|
false));
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
eventBus.post(new EventStatus(UserIdUtils.INSTANCE.getIdForUser(user),
|
||||||
|
EventStatus.EventType.SIGNALING_SETTINGS,
|
||||||
|
false));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
|
Loading…
Reference in New Issue
Block a user