|
|
|
@ -118,7 +118,20 @@ function roomMaxAge(room) { |
|
|
|
|
return roomMaxAgeDefault(room.t); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const fixRoomName = (old) => { |
|
|
|
|
if (RocketChat.settings.get('UI_Allow_room_names_with_special_chars')) { |
|
|
|
|
return old; |
|
|
|
|
} |
|
|
|
|
const reg = new RegExp(`^${ RocketChat.settings.get('UTF8_Names_Validation') }$`); |
|
|
|
|
return [...old.replace(' ', '').toLocaleLowerCase()].filter((f) => reg.test(f)).join(''); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Template.channelSettingsEditing.events({ |
|
|
|
|
'input [name="name"]'(e) { |
|
|
|
|
const input = e.currentTarget; |
|
|
|
|
const modified = fixRoomName(input.value); |
|
|
|
|
input.value = modified; |
|
|
|
|
}, |
|
|
|
|
'input .js-input'(e) { |
|
|
|
|
this.value.set(e.currentTarget.value); |
|
|
|
|
}, |
|
|
|
|