Class: Net::IRC::AsyncSession

Inherits:
Server::Session
  • Object
show all
Defined in:
lib/net/irc/mala.rb

Direct Known Subclasses

Mala, MalaFav

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ AsyncSession

Returns a new instance of AsyncSession.



9
10
11
# File 'lib/net/irc/mala.rb', line 9

def initialize(*args)
  super
end

Instance Method Details

#on_disconnectedObject



26
27
28
# File 'lib/net/irc/mala.rb', line 26

def on_disconnected
  @streaming_thread.kill rescue nil
end

#on_new_threadObject



30
31
32
# File 'lib/net/irc/mala.rb', line 30

def on_new_thread
  raise "not implemented error"
end

#on_user(m) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/net/irc/mala.rb', line 13

def on_user(m)
  super

  post server_name, MODE, @nick, "+o"
  post @prefix, JOIN, main_channel
  post server_name, MODE, main_channel, "+mto", @nick
  post server_name, MODE, main_channel, "+q", @nick

  @streaming_thread = Thread.start do
    on_new_thread
  end
end