mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
Don’t try to set notification level if we can’t do it
This commit is contained in:
parent
d492e8040b
commit
238cab78b1
@ -70,45 +70,47 @@ public class DatabaseStorageModule implements StorageModule {
|
|||||||
if (!key.equals("message_notification_level")) {
|
if (!key.equals("message_notification_level")) {
|
||||||
arbitraryStorageUtils.storeStorageSetting(accountIdentifier, key, value, conversationToken);
|
arbitraryStorageUtils.storeStorageSetting(accountIdentifier, key, value, conversationToken);
|
||||||
} else {
|
} else {
|
||||||
int intValue;
|
if (conversationUser.hasSpreedCapabilityWithName("notification-levels")) {
|
||||||
switch (value) {
|
int intValue;
|
||||||
case "never":
|
switch (value) {
|
||||||
intValue = 3;
|
case "never":
|
||||||
break;
|
intValue = 3;
|
||||||
case "mention":
|
break;
|
||||||
intValue = 2;
|
case "mention":
|
||||||
break;
|
intValue = 2;
|
||||||
case "always":
|
break;
|
||||||
intValue = 1;
|
case "always":
|
||||||
break;
|
intValue = 1;
|
||||||
default:
|
break;
|
||||||
intValue = 0;
|
default:
|
||||||
|
intValue = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ncApi.setNotificationLevel(ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken()),
|
||||||
|
ApiUtils.getUrlForSettingNotificationlevel(conversationUser.getBaseUrl(), conversationToken),
|
||||||
|
intValue)
|
||||||
|
.subscribeOn(Schedulers.newThread())
|
||||||
|
.subscribe(new Observer<GenericOverall>() {
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(GenericOverall genericOverall) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ncApi.setNotificationLevel(ApiUtils.getCredentials(conversationUser.getUsername(), conversationUser.getToken()),
|
|
||||||
ApiUtils.getUrlForSettingNotificationlevel(conversationUser.getBaseUrl(), conversationToken),
|
|
||||||
intValue)
|
|
||||||
.subscribeOn(Schedulers.newThread())
|
|
||||||
.subscribe(new Observer<GenericOverall>() {
|
|
||||||
@Override
|
|
||||||
public void onSubscribe(Disposable d) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNext(GenericOverall genericOverall) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Throwable e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onComplete() {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user