garufa 1.1.0.rc.2 → 1.1.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/garufa.pid +1 -1
- data/lib/garufa/subscriptions.rb +12 -7
- data/lib/garufa/version.rb +1 -1
- metadata +1 -1
data/bin/garufa.pid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
7939
|
data/lib/garufa/subscriptions.rb
CHANGED
@@ -22,16 +22,21 @@ module Garufa
|
|
22
22
|
|
23
23
|
def notify(channels, event, options = {})
|
24
24
|
channels.each do |channel|
|
25
|
-
|
25
|
+
notify_channel(channel, event, options)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def notify_channel(channel, event, options)
|
30
|
+
return if channel_size(channel) == 0
|
26
31
|
|
27
|
-
|
28
|
-
|
32
|
+
subscriptions[channel].each do |sub|
|
33
|
+
# Skip notifying if the same socket_id is provided
|
34
|
+
next if sub.socket_id == options[:socket_id]
|
29
35
|
|
30
|
-
|
31
|
-
|
36
|
+
# Skip notifying the same member (probably from different tabs)
|
37
|
+
next if sub.presence_channel? and sub.channel_data == options[:data]
|
32
38
|
|
33
|
-
|
34
|
-
end
|
39
|
+
sub.notify Message.channel_event(channel, event, options[:data])
|
35
40
|
end
|
36
41
|
end
|
37
42
|
|
data/lib/garufa/version.rb
CHANGED