Module: Hector::Commands::Names

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

Instance Method Summary collapse

Instance Method Details

#on_namesObject



4
5
6
7
# File 'lib/hector/commands/names.rb', line 4

def on_names
  channel = Channel.find(request.args.first)
  respond_to_names(channel)
end

#respond_to_names(channel) ⇒ Object



9
10
11
12
13
# File 'lib/hector/commands/names.rb', line 9

def respond_to_names(channel)
  responses = Response.apportion_text(channel.nicknames, "353", nickname, "=", channel.name, :source => Hector.server_name)
  responses.each { |response| respond_with(response) }
  respond_with("366", nickname, channel.name, :source => Hector.server_name, :text => "End of /NAMES list.")
end