summaryrefslogtreecommitdiff
path: root/lib/irc/client/command/account.ex
blob: c5ec1a9949e60dc91f1cbdec4a249442c7d6fc17 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
defmodule Irc.Client.Command.Account do
  alias Irc.Parser.Line

  @type t :: logout :: {:account, Irc.Mask.t} | login :: {:account, Irc.Mask.t, String.t}

  def init() do
    {"ACCOUNT", nil, "account-notify"}
  end

  def handle_line(%Line{command: "ACCOUNT", source: target, args: ["*"]}) do
    {:event, {:account, target}}
  end

  def handle_line(%Line{command: "ACCOUNT", source: target, args: [account_name]}) do
    {:event, {:account, target, account_name}}
  end

end