Skip to content

Commit e59cc43

Browse files
committed
mix format
1 parent 86a9cef commit e59cc43

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

lib/irc/handler.ex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,32 +1131,38 @@ defmodule M51.IrcConn.Handler do
11311131
{"MODE", [target]} ->
11321132
# TODO: check channel exists, and return the appropriate error if it does not
11331133
case target do
1134-
<< ?#, _::binary >> ->
1134+
<<?#, _::binary>> ->
11351135
# RPL_CHANNELMODEIS
11361136
send_numeric.("324", [target, "+nt"])
1137-
<< ?!, _::binary >> ->
1137+
1138+
<<?!, _::binary>> ->
11381139
# RPL_CHANNELMODEIS
11391140
send_numeric.("324", [target, "+nt"])
1141+
11401142
^nick ->
11411143
# RPL_UMODEIS
11421144
send_numeric.("221", ["+i"])
1145+
11431146
_ ->
11441147
# ERR_USERSDONTMATCH
11451148
send_numeric.("502", ["Can't view mode of other users"])
11461149
end
11471150

11481151
{"MODE", [target, _modestring | _]} ->
11491152
case target do
1150-
<< ?#, _::binary >> ->
1153+
<<?#, _::binary>> ->
11511154
# ERR_CHANOPRIVSNEEDED
11521155
send_numeric.("482", [target, "You're not a channel operator"])
1153-
<< ?!, _ ::binary>> ->
1156+
1157+
<<?!, _::binary>> ->
11541158
# ERR_CHANOPRIVSNEEDED
11551159
send_numeric.("482", [target, "You're not a channel operator"])
1160+
11561161
^nick ->
11571162
# ERR_UMODEUNKNOWNFLAG (kind of abusing the meaning, but it's the best I
11581163
# could find)
11591164
send_numeric.("501", ["Setting user modes are not supported"])
1165+
11601166
_ ->
11611167
# ERR_USERSDONTMATCH
11621168
send_numeric.("502", ["Can't set mode of other users"])

test/irc/handler_test.exs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -831,21 +831,15 @@ defmodule M51.IrcConn.HandlerTest do
831831

832832
send(handler, cmd("@label=l1 MODE unknown_user:example.com"))
833833

834-
assert_line(
835-
"@label=l1 :server. 502 foo:example.org :Can't view mode of other users\r\n"
836-
)
834+
assert_line("@label=l1 :server. 502 foo:example.org :Can't view mode of other users\r\n")
837835

838836
send(handler, cmd("@label=l2 MODE foo:example.org"))
839837

840-
assert_line(
841-
"@label=l2 :server. 221 foo:example.org :+i\r\n"
842-
)
838+
assert_line("@label=l2 :server. 221 foo:example.org :+i\r\n")
843839

844840
send(handler, cmd("@label=l3 MODE unknown_user:example.com +i"))
845841

846-
assert_line(
847-
"@label=l3 :server. 502 foo:example.org :Can't set mode of other users\r\n"
848-
)
842+
assert_line("@label=l3 :server. 502 foo:example.org :Can't set mode of other users\r\n")
849843

850844
send(handler, cmd("@label=l4 MODE foo:example.org +i"))
851845

@@ -859,15 +853,11 @@ defmodule M51.IrcConn.HandlerTest do
859853

860854
send(handler, cmd("@label=l1 MODE #unknown_channel:example.com"))
861855

862-
assert_line(
863-
"@label=l1 :server. 324 foo:example.org #unknown_channel:example.com :+nt\r\n"
864-
)
856+
assert_line("@label=l1 :server. 324 foo:example.org #unknown_channel:example.com :+nt\r\n")
865857

866858
send(handler, cmd("@label=l2 MODE !unknown_channel:example.com"))
867859

868-
assert_line(
869-
"@label=l2 :server. 324 foo:example.org !unknown_channel:example.com :+nt\r\n"
870-
)
860+
assert_line("@label=l2 :server. 324 foo:example.org !unknown_channel:example.com :+nt\r\n")
871861

872862
send(handler, cmd("@label=l3 MODE #unknown_channel:example.com +i"))
873863

0 commit comments

Comments
 (0)