jschat 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -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
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 2
9
- version: 0.3.2
8
+ - 3
9
+ version: 0.3.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alex R. Young