lib/lita/adapters/campfire/callback.rb in lita-campfire-0.1.3 vs lib/lita/adapters/campfire/callback.rb in lita-campfire-0.1.4
- old
+ new
@@ -12,12 +12,12 @@
@receivers = [MessageReceiver, EnterReceiver].map do |receiver_type|
receiver_type.new(self)
end
end
- def listen
- @room.listen do |event|
+ def listen(options={})
+ @room.listen(options) do |event|
receive event
end
end
def register_users
@@ -72,11 +72,11 @@
receives 'TextMessage', 'PasteMessage'
def _receive(event)
text = event.body
user = @callback.create_user(event.user)
- source = Source.new(user, event.room_id.to_s)
+ source = Source.new(user: user, room: event.room_id.to_s)
message = Message.new(@robot, text, source)
@robot.receive message
end
end
@@ -92,6 +92,6 @@
end
end
end
end
-end
+end
\ No newline at end of file