jschat 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jschat/storage/mongo.rb +1 -1
- data/lib/jschat/storage/null.rb +1 -1
- metadata +2 -2
data/lib/jschat/storage/mongo.rb
CHANGED
@@ -29,7 +29,7 @@ module JsChat::Storage
|
|
29
29
|
|
30
30
|
def self.search(query, room, limit)
|
31
31
|
query = /\b#{query}\b/i
|
32
|
-
@db['events'].find({ 'message.message' => query },
|
32
|
+
@db['events'].find({ 'message.message' => query, 'room' => room },
|
33
33
|
{ :limit => limit, :sort => ['time', Mongo::DESCENDING] }
|
34
34
|
).to_a.reverse
|
35
35
|
end
|
data/lib/jschat/storage/null.rb
CHANGED
@@ -17,7 +17,7 @@ module JsChat::Storage
|
|
17
17
|
def self.search(query, room, limit)
|
18
18
|
@messages ||= []
|
19
19
|
@messages.select do |m|
|
20
|
-
m['message'] and m['message']['message'].match(query)
|
20
|
+
m['message'] and m['message']['message'].match(query) and m['room'] == room
|
21
21
|
end.reverse[0..limit].reverse
|
22
22
|
end
|
23
23
|
|