summaryrefslogtreecommitdiffstats
path: root/app/core/files.js
diff options
context:
space:
mode:
authorSimon Bartlett <simon@securitycompass.com>2015-02-04 19:44:27 -0500
committerSimon Bartlett <simon@securitycompass.com>2015-02-04 19:44:27 -0500
commit366076ad858a8be93da207175deb082220208eeb (patch)
tree70065692be5915e0340a2ad43a1092a10fccce03 /app/core/files.js
parentb98c950e6c5c0c0ec48fc5680089ed9b879bfae1 (diff)
downloadlets-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.js10
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(',');