Skip to content

Commit

Permalink
[FIX] Rooms' names turn lower case on CSV import (#24612)
Browse files Browse the repository at this point in the history
* feat: change channel name 'rule' when importing

* feat: add maintainCase in limax

* fix: update special characters rule

* fix: regression of settings use for import rules
  • Loading branch information
guijun13 committed May 18, 2022
1 parent 3ab9d8a commit d170c48
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions apps/meteor/app/importer/server/classes/ImporterBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ export class Base {

this.oldSettings.FileUpload_MediaTypeBlackList = Settings.findOneById('FileUpload_MediaTypeBlackList').value;
Settings.updateValueById('FileUpload_MediaTypeBlackList', '');

this.oldSettings.UI_Allow_room_names_with_special_chars = Settings.findOneById('UI_Allow_room_names_with_special_chars').value;
Settings.updateValueById('UI_Allow_room_names_with_special_chars', true);
break;
case ProgressStep.DONE:
case ProgressStep.ERROR:
Expand All @@ -277,7 +274,6 @@ export class Base {
Settings.updateValueById('FileUpload_MaxFileSize', this.oldSettings.FileUpload_MaxFileSize);
Settings.updateValueById('FileUpload_MediaTypeWhiteList', this.oldSettings.FileUpload_MediaTypeWhiteList);
Settings.updateValueById('FileUpload_MediaTypeBlackList', this.oldSettings.FileUpload_MediaTypeBlackList);
Settings.updateValueById('UI_Allow_room_names_with_special_chars', this.oldSettings.UI_Allow_room_names_with_special_chars);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/utils/lib/getValidRoomName.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const getValidRoomName = (displayName, rid = '', options = {}) => {
let slugifiedName = displayName;

if (settings.get('UI_Allow_room_names_with_special_chars')) {
const cleanName = limax(displayName);
const cleanName = limax(displayName, { maintainCase: true });
if (options.allowDuplicates !== true) {
const room = Rooms.findOneByDisplayName(displayName);
if (room && room._id !== rid) {
Expand Down

0 comments on commit d170c48

Please sign in to comment.