Permalink
Browse files

Updated for changed interfaces erm_xml and xmpp

  • Loading branch information...
ermine committed Nov 14, 2012
1 parent 135114b commit 8dcdc30d71b1f1eac723d288fac1394450382477
Showing with 17 additions and 10 deletions.
  1. +4 −3 conv_xml.ml
  2. +2 −1 plugin_userinfo.ml
  3. +11 −6 sulci.ml
View
@@ -47,14 +47,15 @@ end
open Xmllexer
+module LS = LocatedStream (UnitMonad) (StringStream)
module M = Xmllexer_generic.Make
- (LocatedStream (UnitMonad) (StringStream))
+ (LS)
(Encoding)
(XmlStanza (UnitMonad))
-
+
let parse_document content =
let strm = StringStream.of_string content in
- let strm = M.S.make_stream strm in
+ let strm = LS.make_stream strm in
let next_token = M.make_lexer strm in
Light_xml.parse next_token
View
@@ -105,7 +105,8 @@ let time =
minute = min;
second = sec;
zone = 0;
- week_day = 0
+ week_day = 0;
+ nanos = 0
}) in
let f = Netdate.since_epoch netdate in
Netdate.mk_mail_date f
View
@@ -35,7 +35,7 @@ struct
output_string s.outc str;
flush s.outc
- let close s = close_in s.inc; close_out s.outc
+ let close s = close_in s.inc
end
@@ -67,6 +67,8 @@ struct
output_string L.logfile "\n";
flush L.logfile;
T.write s str
+
+ let close = T.close
end
open XMPPClient
@@ -136,22 +138,25 @@ let run account =
let socket_module =
if account.rawxml_log = "" then
(module Socket_module : XMPPClient.Socket)
- else (
+ else
let module Socket_module =
struct
include LogTraffic(Socket_module)
(struct let logfile = open_out account.rawxml_log end)
end in
(module Socket_module : XMPPClient.Socket)
- )
in
try
- print_endline "here";
- XMPPClient.open_stream
+ XMPPClient.setup_session
~user_data
~myjid
~plain_socket:socket_module
- ~password:account.password session;
+ ~password:account.password session >>= fun session_data ->
+ XMPPClient.parse session_data >>=
+ (fun () ->
+ let module S = (val session_data.socket : Socket) in
+ S.close S.socket
+ )
with
(*

0 comments on commit 8dcdc30

Please sign in to comment.