get channel symbol correct in NAMES reply
This commit is contained in:
parent
04ad9c6ed7
commit
f057eb1648
|
@ -235,14 +235,18 @@ let on_msg_privmsg t name txt =
|
||||||
Ok ()
|
Ok ()
|
||||||
|
|
||||||
let list_names t chan =
|
let list_names t chan =
|
||||||
|
let name = Chan.name chan in
|
||||||
|
let sym =
|
||||||
|
if Mode.Set.mem `s (Chan.mode chan)
|
||||||
|
then "@"
|
||||||
|
else "="
|
||||||
|
in
|
||||||
|
(* TODO: dont list users who are +i if you are not a member w/ them *)
|
||||||
|
(* TODO: user membership prefix (@/+) *)
|
||||||
|
let mems = List.map User.nick (Chan.members chan) in
|
||||||
begin
|
begin
|
||||||
List.iter
|
(* TODO: concat member names until message becomes too long *)
|
||||||
(fun user ->
|
List.iter (fun nick -> reply t ("353", [sym; name; nick])) mems;
|
||||||
(* TODO: check if user is +i and not in channel with them *)
|
|
||||||
(* ("=", 0x3D) - Public channel. *)
|
|
||||||
(* ("@", 0x40) - Secret channel (secret channel mode "+s"). *)
|
|
||||||
reply t ("353", ["@"; Chan.name chan; User.nick user]))
|
|
||||||
(Chan.members chan);
|
|
||||||
reply t ("366", [Chan.name chan; "End of NAMES list"])
|
reply t ("366", [Chan.name chan; "End of NAMES list"])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -252,7 +256,7 @@ let on_msg_names t name =
|
||||||
try
|
try
|
||||||
match name_type name with
|
match name_type name with
|
||||||
| `chan -> Ok (Router.find_chan t.router name)
|
| `chan -> Ok (Router.find_chan t.router name)
|
||||||
| _ -> Error (nosuchchannel name)
|
| `nick | `invalid -> raise Not_found
|
||||||
with Not_found ->
|
with Not_found ->
|
||||||
Error (nosuchchannel name)
|
Error (nosuchchannel name)
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in New Issue