Skip to content
Snippets Groups Projects
Commit 15bf0c96 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Fix the setting UTF8_Names_Slugify

parent 82c5ac02
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ Meteor.methods ...@@ -8,7 +8,7 @@ Meteor.methods
if room.u._id isnt Meteor.userId() or room.t not in ['c', 'p'] if room.u._id isnt Meteor.userId() or room.t not in ['c', 'p']
throw new Meteor.Error 403, t('Not allowed') throw new Meteor.Error 403, t('Not allowed')
if RocketChat.settings.get 'UTF8_Names_slugify' if RocketChat.settings.get 'UTF8_Names_Slugify'
name = _.slugify name name = _.slugify name
if name is room.name if name is room.name
......
...@@ -15,7 +15,7 @@ usernameIsAvaliable = (username) -> ...@@ -15,7 +15,7 @@ usernameIsAvaliable = (username) ->
usernames = [] usernames = []
username = undefined username = undefined
if RocketChat.settings.get 'UTF8_Names_slugify' if RocketChat.settings.get 'UTF8_Names_Slugify'
usernames.push slug user.name usernames.push slug user.name
else else
usernames.push user.name usernames.push user.name
...@@ -25,7 +25,7 @@ usernameIsAvaliable = (username) -> ...@@ -25,7 +25,7 @@ usernameIsAvaliable = (username) ->
first = nameParts[0] first = nameParts[0]
last = nameParts[nameParts.length - 1] last = nameParts[nameParts.length - 1]
if RocketChat.settings.get 'UTF8_Names_slugify' if RocketChat.settings.get 'UTF8_Names_Slugify'
usernames.push slug first[0] + last usernames.push slug first[0] + last
usernames.push slug first + last[0] usernames.push slug first + last[0]
else else
...@@ -33,7 +33,7 @@ usernameIsAvaliable = (username) -> ...@@ -33,7 +33,7 @@ usernameIsAvaliable = (username) ->
usernames.push first + last[0] usernames.push first + last[0]
if user.profile?.name? if user.profile?.name?
if RocketChat.settings.get 'UTF8_Names_slugify' if RocketChat.settings.get 'UTF8_Names_Slugify'
usernames.push slug user.profile.name usernames.push slug user.profile.name
else else
usernames.push user.profile.name usernames.push user.profile.name
...@@ -41,12 +41,12 @@ usernameIsAvaliable = (username) -> ...@@ -41,12 +41,12 @@ usernameIsAvaliable = (username) ->
if user.services? if user.services?
for serviceName, service of user.services for serviceName, service of user.services
if service.name? if service.name?
if RocketChat.settings.get 'UTF8_Names_slugify' if RocketChat.settings.get 'UTF8_Names_Slugify'
usernames.push slug service.name usernames.push slug service.name
else else
usernames.push service.name usernames.push service.name
else if service.username? else if service.username?
if RocketChat.settings.get 'UTF8_Names_slugify' if RocketChat.settings.get 'UTF8_Names_Slugify'
usernames.push slug service.username usernames.push slug service.username
else else
usernames.push service.username usernames.push service.username
......
...@@ -20,7 +20,7 @@ Meteor.methods ...@@ -20,7 +20,7 @@ Meteor.methods
if not nameValidation.test name if not nameValidation.test name
throw new Meteor.Error 'name-invalid' throw new Meteor.Error 'name-invalid'
if RocketChat.settings.get 'UTF8_Names_slugify' if RocketChat.settings.get 'UTF8_Names_Slugify'
name = _.slugify name name = _.slugify name
if name is room.name if name is room.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment