Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: f428a3d08d
...
compare: 2788566844
  • 3 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 02, 2013
@johnelse Add send_user
Signed-off-by: John Else <john.else@citrix.com>
23e4b95
@johnelse remove auth_t
Signed-off-by: John Else <john.else@citrix.com>
db642d9
@johnelse Add labelled args
Signed-off-by: John Else <john.else@citrix.com>
2788566
Showing with 17 additions and 18 deletions.
  1. +17 −18 lib/irc_client.ml
View
35 lib/irc_client.ml
@@ -1,33 +1,32 @@
module Make(Io: Irc_transport.IO) = struct
- type auth_t = {
- username: string;
- password: string;
- }
-
type connection_t = {
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 ~data:(Printf.sprintf "NICK %s" nick)
- let send_nick connection nick =
- send_raw connection (Printf.sprintf "NICK %s" nick)
+ let send_pass ~connection ~password =
+ send_raw ~connection ~data:(Printf.sprintf "PASS %s" password)
- let send_pass connection password =
- send_raw connection (Printf.sprintf "PASS %s" password)
+ let send_pong connection ~message =
+ send_raw ~connection ~data:(Printf.sprintf "PONG %s" message)
- let send_pong connection message =
- send_raw connection (Printf.sprintf "PONG %s" message)
+ let send_privmsg ~connection ~target ~message =
+ send_raw ~connection ~data:(Printf.sprintf "PRIVMSG %s %s" target message)
- let send_privmsg connection target message =
- send_raw connection (Printf.sprintf "PRIVMSG %s %s" target message)
+ let send_quit ~connection =
+ send_raw ~connection ~data:"QUIT"
- let send_quit connection =
- send_raw connection "QUIT"
+ let send_user ~connection ~username ~mode ~realname =
+ send_raw ~connection
+ ~data:(Printf.sprintf "USER %s %i * :%s" username mode realname)
end

No commit comments for this range

Something went wrong with that request. Please try again.