cinch 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -186,7 +186,7 @@ module Cinch
186
186
  #
187
187
  # @return [Handler] The handlers that have been registered
188
188
  def on(event, regexp = //, *args, &block)
189
- event = event.to_sym
189
+ event = event.to_s.to_sym
190
190
 
191
191
  pattern = case regexp
192
192
  when Pattern
@@ -95,6 +95,10 @@ module Cinch
95
95
  timer = Cinch::Timer.new(bot, options, &block)
96
96
  timer.start
97
97
 
98
+ if self.respond_to?(:timers)
99
+ timers << timer
100
+ end
101
+
98
102
  timer
99
103
  end
100
104
 
@@ -230,6 +230,7 @@ module Cinch
230
230
  if registered?
231
231
  events << [:connect]
232
232
  @bot.last_connection_was_successful = true
233
+ on_connect(msg, events)
233
234
  end
234
235
  end
235
236
 
@@ -389,6 +390,11 @@ module Cinch
389
390
  end
390
391
  end
391
392
 
393
+ # @since 2.0.0
394
+ def on_connect(msg, events)
395
+ @bot.modes = @bot.config.modes
396
+ end
397
+
392
398
  def on_join(msg, events)
393
399
  if msg.user == @bot
394
400
  @bot.channels << msg.channel
@@ -517,7 +523,7 @@ module Cinch
517
523
  channel.remove_user(msg.user)
518
524
  end
519
525
  msg.user.unsync_all
520
- msg.user.online = true
526
+ msg.user.online = false
521
527
 
522
528
  set_leaving_user(msg, msg.user, events)
523
529
 
@@ -1,4 +1,4 @@
1
1
  module Cinch
2
2
  # Version of the library
3
- VERSION = '2.0.0'
3
+ VERSION = '2.0.2'
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.1
4
+ version: 2.0.2
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-03-24 00:00:00.000000000 Z
12
+ date: 2012-04-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple, friendly DSL for creating IRC bots
15
15
  email: