mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 05:29:17 -06:00
FIX: Bring email username logic in line with front end
This commit is contained in:
parent
5c7d6e0a3c
commit
388f51eed7
@ -54,11 +54,15 @@ module UserNotificationsHelper
|
|||||||
raw format_for_email(html)
|
raw format_for_email(html)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def sanitized_name(name)
|
||||||
|
name.downcase.gsub(/[\s_-]/, '')
|
||||||
|
end
|
||||||
|
|
||||||
def show_name_on_post(post)
|
def show_name_on_post(post)
|
||||||
SiteSetting.enable_names? &&
|
SiteSetting.enable_names? &&
|
||||||
SiteSetting.display_name_on_posts? &&
|
SiteSetting.display_name_on_posts? &&
|
||||||
post.user.name.present? &&
|
post.user.name.present? &&
|
||||||
post.user.name != post.user.username
|
sanitized_name(post.user.name) != sanitized_name(post.user.username)
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_for_email(html)
|
def format_for_email(html)
|
||||||
|
Loading…
Reference in New Issue
Block a user