mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 08:53:41 +08:00
FIX: users should be allowed to add @ to the to field of a PM
This commit is contained in:
parent
8cfd14120c
commit
d0fe1725c8
|
@ -25,6 +25,7 @@ export default TextField.extend({
|
|||
allowAny: this.get('allowAny'),
|
||||
|
||||
dataSource: function(term) {
|
||||
term = term.replace(/[^a-zA-Z0-9_]/, '');
|
||||
return userSearch({
|
||||
term: term,
|
||||
topicId: self.get('topicId'),
|
||||
|
|
|
@ -231,8 +231,8 @@ en:
|
|||
base:
|
||||
warning_requires_pm: "You can only attach warnings to private messages."
|
||||
too_many_users: "You can only send warnings to one user at a time."
|
||||
archetype:
|
||||
cant_send_pm: "Sorry, you cannot send a private message to that user."
|
||||
no_user_selected: "You must select a valid user."
|
||||
user:
|
||||
attributes:
|
||||
password:
|
||||
|
|
|
@ -114,7 +114,7 @@ class TopicCreator
|
|||
@topic.subtype = TopicSubtype.user_to_user unless @topic.subtype
|
||||
|
||||
unless @opts[:target_usernames].present? || @opts[:target_group_names].present?
|
||||
@topic.errors.add(:archetype, :cant_send_pm)
|
||||
@topic.errors.add(:base, :no_user_selected)
|
||||
@errors = @topic.errors
|
||||
raise ActiveRecord::Rollback.new
|
||||
end
|
||||
|
@ -150,7 +150,7 @@ class TopicCreator
|
|||
|
||||
def check_can_send_permission!(topic,item)
|
||||
unless @guardian.can_send_private_message?(item)
|
||||
topic.errors.add(:archetype, :cant_send_pm)
|
||||
topic.errors.add(:base, :cant_send_pm)
|
||||
@errors = topic.errors
|
||||
raise ActiveRecord::Rollback.new
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user