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

  @type t :: {:chghost, old_mask :: Irc.Mask.t, new_mask :: Irc.Mask.t}

  def init() do
    {"CHGHOST", nil, "chghost"}
  end

  def handle_line(%Line{source: old_mask, args: [new_user, new_host]}, _) do
    new_mask = %Irc.Mask{old_mask | user: new_user, host: new_host}
    {:event, {:chghost, old_mask, new_mask}}
  end

end