2008-03-19 16:19:24 -06:00
|
|
|
module String_map =
|
|
|
|
Map.Make (struct
|
|
|
|
type t = string
|
|
|
|
let compare = compare
|
|
|
|
end)
|
2008-02-28 22:00:24 -07:00
|
|
|
|
2008-03-19 16:19:24 -06:00
|
|
|
type client = Iobuf.t * Irc.nuhost
|
2008-03-02 21:30:37 -07:00
|
|
|
|
2008-03-19 16:19:24 -06:00
|
|
|
type t = {name: string;
|
|
|
|
modes: string ref;
|
|
|
|
clients: client String_map.t}
|
2008-02-28 22:00:24 -07:00
|
|
|
|
2008-03-19 16:19:24 -06:00
|
|
|
let modes = "aimnqpsrtklb"
|
2008-02-28 22:00:24 -07:00
|
|
|
|
2008-03-19 16:19:24 -06:00
|
|
|
let channels = String_map.empty
|
2008-03-07 12:00:40 -07:00
|
|
|
|
|
|
|
let is_channel_name name =
|
|
|
|
match name.[0] with
|
|
|
|
| '#' | '&' | '!' | '+' ->
|
|
|
|
true
|
|
|
|
| _ ->
|
|
|
|
false
|
2008-03-19 16:19:24 -06:00
|
|
|
|
|
|
|
let has_mode chan mode =
|
|
|
|
String.contains !(chan.modes) mode
|
|
|
|
|
|
|
|
let handle_command iobuf (nick, username, hostname) cmd =
|
|
|
|
match (Command.as_tuple cmd) with
|
|
|
|
| _ ->
|
|
|
|
()
|