(* COCANWIKI - a wiki written in Objective CAML.
* Written by Richard W.M. Jones <rich@merjis.com>.
* Copyright (C) 2004 Merjis Ltd.
- * $Id: mail_import.ml,v 1.12 2006/03/28 16:24:07 rich Exp $
+ * $Id: mail_import.ml,v 1.15 2006/08/16 15:27:02 rich Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
(* Choose a suitable URL. *)
let url =
- match Wikilib.generate_url_of_title dbh hostid title with
+ match Wikilib.generate_url_of_title r dbh hostid title with
(* Duplicate URL is OK - eg. in the case where we are overwriting
* an already imported message.
*)
hdr_template#to_string
in
- None, Some "mail_header", content in
+ None, Some "mail_header", None, content in
(* Create the second section (mail body).
* XXX Very simple. Should be extended to understand attachments and
(fun line ->
let find str sub_lc =
try
- String.find (String.lowercase str) sub_lc
+ String.find (lowercase str) sub_lc
with
Invalid_string -> -1
in
with
Not_found ->
"No plain text message body found" in
- Some "Message", Some "mail_body", content in
+ Some "Message", Some "mail_body", None, content in
(* Overwrite the first two sections of the current page, regardless of
* what they contain.
* them because we want to script to fail abruptly if any of these
* unexpected conditions arises.
*)
- ignore (save_page dbh hostid ~user ~r model);
+ ignore (save_page r dbh hostid ~user model);
(* Rebuild threads? *)
if rebuild then
- thread_mail dbh hostid ~user ~r
+ thread_mail r dbh hostid ~user
(Calendar.year (fst message_date))
(Date.int_of_month (Calendar.month (fst message_date)));