diff options
Diffstat (limited to 'lib/irc/client/command/chghost.ex')
-rw-r--r-- | lib/irc/client/command/chghost.ex | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/irc/client/command/chghost.ex b/lib/irc/client/command/chghost.ex new file mode 100644 index 0000000..2b4adab --- /dev/null +++ b/lib/irc/client/command/chghost.ex @@ -0,0 +1,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 |