diff options
author | Simon Bartlett <simon@securitycompass.com> | 2015-02-04 19:44:27 -0500 |
---|---|---|
committer | Simon Bartlett <simon@securitycompass.com> | 2015-02-04 19:44:27 -0500 |
commit | 366076ad858a8be93da207175deb082220208eeb (patch) | |
tree | 70065692be5915e0340a2ad43a1092a10fccce03 /app/core/files.js | |
parent | b98c950e6c5c0c0ec48fc5680089ed9b879bfae1 (diff) | |
download | lets-chat-366076ad858a8be93da207175deb082220208eeb.zip lets-chat-366076ad858a8be93da207175deb082220208eeb.tar.gz lets-chat-366076ad858a8be93da207175deb082220208eeb.tar.bz2 |
Transcripts!
Diffstat (limited to 'app/core/files.js')
-rw-r--r-- | app/core/files.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/core/files.js b/app/core/files.js index c15d04e..d7b4bae 100644 --- a/app/core/files.js +++ b/app/core/files.js @@ -68,7 +68,7 @@ FileManager.prototype.create = function(options, cb) { FileManager.prototype.list = function(options, cb) { options = options || {}; - + var File = mongoose.model('File'), User = mongoose.model('User'); @@ -78,6 +78,14 @@ FileManager.prototype.list = function(options, cb) { find.where('room', options.room); } + if (options.from) { + find.where('uploaded').gt(options.from); + } + + if (options.to) { + find.where('uploaded').lte(options.to); + } + if (options.include && _.isArray(options.include)) { var includes = options.include.split(','); |