Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add labelled args

Signed-off-by: John Else <john.else@citrix.com>
  • Loading branch information...
commit 27885668446153ba44f401efaa1383d325b9a790 1 parent db642d9
@johnelse authored
Showing with 16 additions and 15 deletions.
  1. +16 −15 lib/irc_client.ml
View
31 lib/irc_client.ml
@@ -3,29 +3,30 @@ module Make(Io: Irc_transport.IO) = struct
sock: Io.file_descr;
}
- let send_raw connection data =
+ let send_raw ~connection ~data =
let formatted_data = Printf.sprintf "%s\r\n" data in
let len = String.length formatted_data in
Io.buffered_write connection.sock formatted_data 0 len
- let send_join connection channel =
- send_raw connection (Printf.sprintf "JOIN %s" channel)
+ let send_join ~connection ~channel =
+ send_raw ~connection ~data:(Printf.sprintf "JOIN %s" channel)
- let send_nick connection nick =
- send_raw connection (Printf.sprintf "NICK %s" nick)
+ let send_nick ~connection ~nick =
+ send_raw ~connection ~data:(Printf.sprintf "NICK %s" nick)
- let send_pass connection password =
- send_raw connection (Printf.sprintf "PASS %s" password)
+ let send_pass ~connection ~password =
+ send_raw ~connection ~data:(Printf.sprintf "PASS %s" password)
- let send_pong connection message =
- send_raw connection (Printf.sprintf "PONG %s" message)
+ let send_pong connection ~message =
+ send_raw ~connection ~data:(Printf.sprintf "PONG %s" message)
- let send_privmsg connection target message =
- send_raw connection (Printf.sprintf "PRIVMSG %s %s" target message)
+ let send_privmsg ~connection ~target ~message =
+ send_raw ~connection ~data:(Printf.sprintf "PRIVMSG %s %s" target message)
- let send_quit connection =
- send_raw connection "QUIT"
+ let send_quit ~connection =
+ send_raw ~connection ~data:"QUIT"
- let send_user connection username mode realname =
- send_raw connection (Printf.sprintf "USER %s %i * :%s" username mode realname)
+ let send_user ~connection ~username ~mode ~realname =
+ send_raw ~connection
+ ~data:(Printf.sprintf "USER %s %i * :%s" username mode realname)
end
Please sign in to comment.
Something went wrong with that request. Please try again.