Improved checkAttachmentReference().
This commit is contained in:
parent
4366d60270
commit
bd06f59fbf
1 changed files with 11 additions and 3 deletions
|
@ -541,7 +541,15 @@ class App.Utils
|
||||||
@checkAttachmentReference: (message) ->
|
@checkAttachmentReference: (message) ->
|
||||||
return false if !message
|
return false if !message
|
||||||
return true if message.match(/attachment/i)
|
return true if message.match(/attachment/i)
|
||||||
attachmentTranslated = App.i18n.translateContent('Attachment')
|
matchwords = ['Attachment', 'attachment', 'Attached', 'attached', 'Enclosed', 'enclosed']
|
||||||
|
for word in matchwords
|
||||||
|
|
||||||
|
# en
|
||||||
|
attachmentTranslatedRegExp = new RegExp(word, 'i')
|
||||||
|
return true if message.match(attachmentTranslatedRegExp)
|
||||||
|
|
||||||
|
# user locale
|
||||||
|
attachmentTranslated = App.i18n.translateContent(word)
|
||||||
attachmentTranslatedRegExp = new RegExp(attachmentTranslated, 'i')
|
attachmentTranslatedRegExp = new RegExp(attachmentTranslated, 'i')
|
||||||
return true if message.match(attachmentTranslatedRegExp)
|
return true if message.match(attachmentTranslatedRegExp)
|
||||||
false
|
false
|
||||||
|
|
Loading…
Reference in a new issue