cinch 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -258,7 +258,7 @@ module Cinch
258
258
  @join_handler = join_handler = on(@config.delay_joins) {
259
259
  join_handler.unregister
260
260
  join_lambda.call
261
- }.first
261
+ }
262
262
  else
263
263
  @join_timer = Timer.new(self, interval: @config.delay_joins, shots: 1) {
264
264
  join_lambda.call
@@ -8,7 +8,7 @@ module Cinch
8
8
  :realname, :user, :messages_per_second, :server_queue_size,
9
9
  :strictness, :message_split_start, :message_split_end,
10
10
  :max_messages, :plugins, :channels, :encoding, :reconnect, :max_reconnect_delay,
11
- :local_host, :timeouts, :ping_interval, :dcc, :shared, :sasl]
11
+ :local_host, :timeouts, :ping_interval, :delay_joins, :dcc, :shared, :sasl]
12
12
 
13
13
  # (see Configuration.default_config)
14
14
  def self.default_config
@@ -244,8 +244,6 @@ module Cinch
244
244
 
245
245
  if msg.command == "PRIVMSG"
246
246
  events << [:message]
247
- else
248
- events << [:notice]
249
247
  end
250
248
 
251
249
  if msg.action?
@@ -492,11 +490,14 @@ module Cinch
492
490
 
493
491
  def on_nick(msg, events)
494
492
  if msg.user == @bot
495
- @bot.set_nick msg.params.last
493
+ # @bot.set_nick msg.params.last
494
+ target = @bot
495
+ else
496
+ target = msg.user
496
497
  end
497
498
 
498
- msg.user.update_nick(msg.params.last)
499
- msg.user.online = true
499
+ target.update_nick(msg.params.last)
500
+ target.online = true
500
501
  end
501
502
 
502
503
  def on_part(msg, events)
@@ -228,9 +228,10 @@ module Cinch
228
228
  when Constants::RPL_NAMEREPLY.to_s
229
229
  @bot.channel_list.find_ensured(@params[2])
230
230
  else
231
- if @params.first.start_with?("#")
231
+ chantypes = @bot.irc.isupport["CHANTYPES"]
232
+ if chantypes.include?(@params.first[0])
232
233
  @bot.channel_list.find_ensured(@params.first)
233
- elsif numeric_reply? and @params[1].start_with?("#")
234
+ elsif numeric_reply? and chantypes.include?(@params[1][0])
234
235
  @bot.channel_list.find_ensured(@params[1])
235
236
  end
236
237
  end
@@ -134,6 +134,11 @@ module Cinch
134
134
  !attr(:authname).nil?
135
135
  end
136
136
 
137
+ # @see Syncable#attr
138
+ def attr(attribute, data = true, unsync = false)
139
+ super
140
+ end
141
+
137
142
  # Queries the IRC server for information on the user. This will
138
143
  # set the User's state to not synced. After all information are
139
144
  # received, the object will be set back to synced.
@@ -194,6 +199,7 @@ module Cinch
194
199
  :authname => nil,
195
200
  :idle => 0,
196
201
  :secure? => false,
202
+ :channels => [],
197
203
  }.merge(values).each do |attr, value|
198
204
  sync(attr, value, true)
199
205
  end
@@ -272,7 +278,8 @@ module Cinch
272
278
  refresh
273
279
  @monitored_timer = Timer.new(@bot, interval: 30) {
274
280
  refresh
275
- }.start
281
+ }
282
+ @monitored_timer.start
276
283
  end
277
284
 
278
285
  @monitored = true
@@ -1,4 +1,4 @@
1
1
  module Cinch
2
2
  # Version of the library
3
- VERSION = '2.0.2'
3
+ VERSION = '2.0.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000 Z
12
+ date: 2012-06-27 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple, friendly DSL for creating IRC bots
15
15
  email: