Permalink
Browse files

Don't deliver client events to the originator of the event.

  • Loading branch information...
twalpole authored and tristandunn committed Dec 13, 2012
1 parent 9065e05 commit 91086be557dc48d94220e13055a182f389e61922
View
@@ -3,6 +3,7 @@
## 0.4.0 — Unreleased
* Support excluding recipients. (Tristan Dunn)
+* Don't deliver client events to the originator of the event. (Thomas Walpole)
* Update dependencies. (Tristan Dunn)
## 0.3.0 — December 12, 2012
@@ -49,7 +49,7 @@ Feature: Triggering events on a channel
Given I am subscribed to the "private-chat" channel
And Bob is subscribed to the "private-chat" channel
When I trigger the "client-message" event on the "private-chat" channel
- Then I should receive a "client-message" event on the "private-chat" channel
+ Then I should not receive a "client-message" event on the "private-chat" channel
And Bob should receive a "client-message" event on the "private-chat" channel
Scenario: Client triggers a client event on a previously subscribed private channel
@@ -47,7 +47,7 @@ def process(data)
return unless channel.is_a?(Channel::Private)
return unless channel.includes?(self)
- channel.emit(event, data)
+ channel.emit(event, data, socket_id: socket.object_id)
end
end
end
@@ -145,7 +145,7 @@
it "emits the event to the channel when the connection is in the channel" do
channel.stubs(includes?: true)
subject.process(json)
- channel.should have_received(:emit).with(event, data)
+ channel.should have_received(:emit).with(event, data, socket_id: subject.socket.object_id)
end
it "does not emit the event to the channel when the channel is not private" do

0 comments on commit 91086be

Please sign in to comment.