cinch_channel_list 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cinch_channel_list.rb +4 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2ba7a5a6e5288dacf366a42a68714995017fd84
|
4
|
+
data.tar.gz: 344edffeab5f8e48ae6be6c452bb4b45c38bbcda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfe7cb5960c5103dc7e3099130f4caf7b72ed673566653e725b60809e6892d041d944bdebfe2007eee6e5dd20b2330f6edfa05420f5a3e1db50ffb4bf3c9bcc9
|
7
|
+
data.tar.gz: 82ef4cf11c104a7cf2b60d5de4d8832d3754d8a12710c078d20b4e8faf012f1e74fdfe7612ab56e4129823db2ba6cce23ba98a9e35c71b0f2eae811afbd52951
|
data/lib/cinch_channel_list.rb
CHANGED
@@ -6,7 +6,6 @@ class ChannelList
|
|
6
6
|
attr_accessor :channels
|
7
7
|
|
8
8
|
listen_to :get_channel_list, :method => :send_list
|
9
|
-
listen_to Cinch::Constants::RPL_LISTSTART, :method => :clear_channels
|
10
9
|
listen_to Cinch::Constants::RPL_LIST, :method => :add_channel
|
11
10
|
listen_to Cinch::Constants::RPL_LISTEND, :method => :send_channel_list
|
12
11
|
|
@@ -19,16 +18,14 @@ class ChannelList
|
|
19
18
|
bot.irc.send "LIST"
|
20
19
|
end
|
21
20
|
|
22
|
-
def clear_channels(message)
|
23
|
-
@channels = {}
|
24
|
-
end
|
25
|
-
|
26
21
|
def add_channel(message)
|
27
|
-
|
22
|
+
synchronize(:channel_list) do
|
23
|
+
channels[message.params[1]] = { :user_count => message.params[2], :topic => message.params[3].sub(/\[.*\] /, '') }
|
24
|
+
end
|
28
25
|
end
|
29
26
|
|
30
27
|
def send_channel_list(message)
|
31
|
-
@bot.handlers.dispatch(:channel_list_received, nil, @channels)
|
28
|
+
synchronize(:channel_list) { @bot.handlers.dispatch(:channel_list_received, nil, @channels) }
|
32
29
|
end
|
33
30
|
end
|
34
31
|
|