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) ->
|
||||
return false if !message
|
||||
return true if message.match(/attachment/i)
|
||||
attachmentTranslated = App.i18n.translateContent('Attachment')
|
||||
attachmentTranslatedRegExp = new RegExp( attachmentTranslated, 'i' )
|
||||
return true if message.match( attachmentTranslatedRegExp )
|
||||
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')
|
||||
return true if message.match(attachmentTranslatedRegExp)
|
||||
false
|
||||
|
||||
# human readable file size
|
||||
|
|
Loading…
Reference in a new issue