defmodule Irc.Client.Command.Account do alias Irc.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