Module: Hector::Commands::Join

Included in:
Session
Defined in:
lib/hector/commands/join.rb

Instance Method Summary collapse

Instance Method Details

#on_joinObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/hector/commands/join.rb', line 4

def on_join
  request.args.first.split(/,(?=[#&+!])/).each do |channel_name|
    channel = Channel.find_or_create(channel_name)
    if channel.join(self)
      channel.broadcast(:join, :source => source, :text => channel.name)
      respond_to_topic(channel)
      respond_to_names(channel)
    end
  end
end