Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for mentioning RTL names #1639

Merged
merged 1 commit into from
Dec 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@
"Users" : "Users",
"UTF8_Names_Slugify" : "UTF8 Names Slugify",
"UTF8_Names_Validation" : "UTF8 Names Validation",
"UTF8_Names_Validation_Description" : "Do not allow special characters and spaces. You can use - _ and . but not at the end of the name",
"View_All" : "View All",
"Wait_activation_warning" : "Before you can login, your account must be manually activated by an administrator.",
"We_have_sent_password_email" : "We have sent you an e-mail with password reset instructions. If you do not receive an e-mail shortly, please come back and try again.",
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-lib/server/startup/settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RocketChat.settings.add 'Disable_Favorite_Rooms', false, { type: 'boolean', grou
RocketChat.settings.add 'CDN_PREFIX', '', { type: 'string', group: 'General' }
RocketChat.settings.add 'Restart', 'restart_server', { type: 'action', group: 'General', actionText: 'Restart_the_server' }

RocketChat.settings.add 'UTF8_Names_Validation', '[0-9a-zA-Z-_.]+', { type: 'string', group: 'General', section: 'UTF8', public: true }
RocketChat.settings.add 'UTF8_Names_Validation', '[0-9a-zA-Z-_.]+', { type: 'string', group: 'General', section: 'UTF8', public: true ,i18nDescription: 'UTF8_Names_Validation_Description'}
RocketChat.settings.add 'UTF8_Names_Slugify', true, { type: 'boolean', group: 'General', section: 'UTF8', public: true }

RocketChat.settings.addGroup 'API'
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-mentions/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MentionsClient
if mentions.length isnt 0
mentions = _.unique mentions
mentions = mentions.join('|')
msg = msg.replace new RegExp("(?:^|\\s|\\n)(@(#{mentions}):?)\\b", 'g'), (match, mention, username) ->
msg = msg.replace new RegExp("(?:^|\\s|\\n)(@(#{mentions}):?)[:.,\s]?", 'g'), (match, mention, username) ->
if username is 'all'
return match.replace mention, "<a href=\"\" class=\"mention-link mention-link-me\">#{mention}</a>"

Expand All @@ -41,7 +41,7 @@ class MentionsClient
if channels.length isnt 0
channels = _.unique channels
channels = channels.join('|')
msg = msg.replace new RegExp("(?:^|\\s|\\n)(#(#{channels}))\\b", 'g'), (match, mention, channel) ->
msg = msg.replace new RegExp("(?:^|\\s|\\n)(#(#{channels}))[:.,\s]?", 'g'), (match, mention, channel) ->
if not message.temp?
if not _.findWhere(message.channels, {name: channel})?
return match
Expand Down