summaryrefslogtreecommitdiff
path: root/lib/irc/client/command/account.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/irc/client/command/account.ex')
-rw-r--r--lib/irc/client/command/account.ex18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/irc/client/command/account.ex b/lib/irc/client/command/account.ex
new file mode 100644
index 0000000..c5ec1a9
--- /dev/null
+++ b/lib/irc/client/command/account.ex
@@ -0,0 +1,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