Module: Hector::Commands::Mode

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

Instance Method Summary collapse

Instance Method Details

#on_modeObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/hector/commands/mode.rb', line 4

def on_mode
  subject = find(request.args.first)

  if subject.channel?
    if requesting_modes?
      respond_with("324", nickname, subject.name, "+", :source => Hector.server_name)
      respond_with("329", nickname, subject.name, subject.created_at.to_i, :source => Hector.server_name)
    elsif requesting_bans?
      respond_with("368", nickname, subject.name, :text => "End of Channel Ban List", :source => Hector.server_name)
    end
  else
    if requesting_modes?
      respond_with("221", nickname, "+", :source => Hector.server_name)
    end
  end
end