Skip to content

Commit 4649770

Browse files
committed
Ignore AWAY command
1 parent baa4d45 commit 4649770

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/irc/handler.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,10 @@ defmodule M51.IrcConn.Handler do
12851285
{"BATCH", _} ->
12861286
send_needmoreparams.()
12871287

1288+
{"AWAY", _} ->
1289+
send_ack.()
1290+
nil
1291+
12881292
_ ->
12891293
send_numeric.("421", [command.command, "Unknown command"])
12901294
end

test/irc/handler_test.exs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,4 +1128,14 @@ defmodule M51.IrcConn.HandlerTest do
11281128

11291129
assert_message({:send_redact, "#existing_room:example.org", nil, "$event1", "spam"})
11301130
end
1131+
1132+
test "sending AWAY", %{handler: handler} do
1133+
do_connection_registration(handler)
1134+
1135+
send(handler, cmd("@label=abcd AWAY :foo"))
1136+
assert_line("@label=abcd ACK\r\n")
1137+
1138+
send(handler, cmd("@label=abcd AWAY"))
1139+
assert_line("@label=abcd ACK\r\n")
1140+
end
11311141
end

0 commit comments

Comments
 (0)