Initial support for notification settings

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Travis Ralston 2017-11-04 21:47:18 -07:00
parent 8351ec7e73
commit 7ce4316cc8
16 changed files with 194 additions and 105 deletions

View file

@ -17,9 +17,6 @@ limitations under the License.
import Promise from 'bluebird';
import MatrixClientPeg from './MatrixClientPeg';
import Notifier from './Notifier';
import { _t, _td } from './languageHandler';
import SdkConfig from './SdkConfig';
/*
* TODO: Make things use this. This is all WIP - see UserSettings.js for usage.
@ -48,42 +45,6 @@ export default {
// TODO
},
// TODO: {Travis} Granular setting
getEnableNotifications: function() {
return Notifier.isEnabled();
},
// TODO: {Travis} Granular setting
setEnableNotifications: function(enable) {
if (!Notifier.supportsDesktopNotifications()) {
return;
}
Notifier.setEnabled(enable);
},
// TODO: {Travis} Granular setting
getEnableNotificationBody: function() {
return Notifier.isBodyEnabled();
},
// TODO: {Travis} Granular setting
setEnableNotificationBody: function(enable) {
if (!Notifier.supportsDesktopNotifications()) {
return;
}
Notifier.setBodyEnabled(enable);
},
// TODO: {Travis} Granular setting
getEnableAudioNotifications: function() {
return Notifier.isAudioEnabled();
},
// TODO: {Travis} Granular setting
setEnableAudioNotifications: function(enable) {
Notifier.setAudioEnabled(enable);
},
changePassword: function(oldPassword, newPassword) {
const cli = MatrixClientPeg.get();