Improved checkAttachmentReference().
This commit is contained in:
parent
4366d60270
commit
bd06f59fbf
1 changed files with 11 additions and 3 deletions
|
@ -541,9 +541,17 @@ 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']
|
||||||
attachmentTranslatedRegExp = new RegExp( attachmentTranslated, 'i' )
|
for word in matchwords
|
||||||
return true if message.match( attachmentTranslatedRegExp )
|
|
||||||
|
# en
|
||||||
|
attachmentTranslatedRegExp = new RegExp(word, 'i')
|
||||||
|
return true if message.match(attachmentTranslatedRegExp)
|
||||||
|
|
||||||
|
# user locale
|
||||||
|
attachmentTranslated = App.i18n.translateContent(word)
|
||||||
|
attachmentTranslatedRegExp = new RegExp(attachmentTranslated, 'i')
|
||||||
|
return true if message.match(attachmentTranslatedRegExp)
|
||||||
false
|
false
|
||||||
|
|
||||||
# human readable file size
|
# human readable file size
|
||||||
|
|
Loading…
Reference in a new issue