Remove labs flag for custom notif sounds

This commit is contained in:
Will Hunt 2019-06-03 17:35:15 +01:00
parent 96c20ea536
commit 300095f50f
6 changed files with 9 additions and 25 deletions

View file

@ -103,7 +103,7 @@ const Notifier = {
getSoundForRoom: async function(roomId) { getSoundForRoom: async function(roomId) {
// We do no caching here because the SDK caches setting // We do no caching here because the SDK caches setting
// and the browser will cache the sound. // and the browser will cache the sound.
let content = SettingsStore.getValue("notificationSound", roomId); const content = SettingsStore.getValue("notificationSound", roomId);
if (!content) { if (!content) {
return null; return null;
} }
@ -129,7 +129,7 @@ const Notifier = {
}, },
_playAudioNotification: async function(ev, room) { _playAudioNotification: async function(ev, room) {
const sound = SettingsStore.isFeatureEnabled("feature_notification_sounds") ? await this.getSoundForRoom(room.roomId) : null; const sound = await this.getSoundForRoom(room.roomId);
console.log(`Got sound ${sound && sound.name || "default"} for ${room.roomId}`); console.log(`Got sound ${sound && sound.name || "default"} for ${room.roomId}`);
try { try {

View file

@ -70,13 +70,11 @@ export default class RoomSettingsDialog extends React.Component {
<RolesRoomSettingsTab roomId={this.props.roomId} />, <RolesRoomSettingsTab roomId={this.props.roomId} />,
)); ));
if (SettingsStore.isFeatureEnabled("feature_notification_sounds")) { tabs.push(new Tab(
tabs.push(new Tab( _td("Notifications"),
_td("Notifications"), "mx_RoomSettingsDialog_rolesIcon",
"mx_RoomSettingsDialog_rolesIcon", <NotificationSettingsTab roomId={this.props.roomId} />,
<NotificationSettingsTab roomId={this.props.roomId} />, ));
));
}
tabs.push(new Tab( tabs.push(new Tab(
_td("Advanced"), _td("Advanced"),

View file

@ -85,7 +85,7 @@ export default class NotificationsSettingsTab extends React.Component {
if (!this.state.uploadedFile) { if (!this.state.uploadedFile) {
return; return;
} }
let type = this.state.uploadedFile.type; let type = this.state.uploadedFile.type;
if (type === "video/ogg") { if (type === "video/ogg") {
// XXX: I've observed browsers allowing users to pick a audio/ogg files, // XXX: I've observed browsers allowing users to pick a audio/ogg files,
@ -149,7 +149,7 @@ export default class NotificationsSettingsTab extends React.Component {
<div className='mx_SettingsTab_section mx_SettingsTab_subsectionText'> <div className='mx_SettingsTab_section mx_SettingsTab_subsectionText'>
<span className='mx_SettingsTab_subheading'>{_t("Sounds")}</span> <span className='mx_SettingsTab_subheading'>{_t("Sounds")}</span>
<div> <div>
<span>{_t("Notification sound")}: <code>{this.state.currentSound}</code></span><br/> <span>{_t("Notification sound")}: <code>{this.state.currentSound}</code></span><br />
<AccessibleButton className="mx_NotificationSound_resetSound" disabled={this.state.currentSound == "default"} onClick={this._clearSound.bind(this)} kind="primary"> <AccessibleButton className="mx_NotificationSound_resetSound" disabled={this.state.currentSound == "default"} onClick={this._clearSound.bind(this)} kind="primary">
{_t("Reset")} {_t("Reset")}
</AccessibleButton> </AccessibleButton>

View file

@ -126,12 +126,6 @@ export const SETTINGS = {
supportedLevels: LEVELS_FEATURE, supportedLevels: LEVELS_FEATURE,
default: false, default: false,
}, },
"feature_notification_sounds": {
isFeature: true,
displayName: _td("Custom Notification Sounds"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"feature_reactions": { "feature_reactions": {
isFeature: true, isFeature: true,
displayName: _td("React to messages with emoji (refresh to apply changes)"), displayName: _td("React to messages with emoji (refresh to apply changes)"),

View file

@ -73,10 +73,6 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
return !content['disable']; return !content['disable'];
} }
if (settingName === "notificationSound") {
return this._getSettings("uk.half-shot.notification.sound");
}
// Special case for breadcrumbs // Special case for breadcrumbs
if (settingName === "breadcrumb_rooms") { if (settingName === "breadcrumb_rooms") {
const content = this._getSettings(BREADCRUMBS_EVENT_TYPE) || {}; const content = this._getSettings(BREADCRUMBS_EVENT_TYPE) || {};

View file

@ -68,10 +68,6 @@ export default class RoomSettingsHandler extends MatrixClientBackedSettingsHandl
return !content['disable']; return !content['disable'];
} }
if (settingName === "notificationSound") {
return this._getSettings(roomId, "uk.half-shot.notification.sound");
}
const settings = this._getSettings(roomId) || {}; const settings = this._getSettings(roomId) || {};
return settings[settingName]; return settings[settingName];
} }