- (* Get the from address of the user, if available. *)
- let from =
- match user with
- | None
- | Some Anonymous -> None
- | Some (User (userid, _, _)) ->
- let sth = dbh#prepare_cached "select email from users
- where hostid = ? and id = ?" in
- sth#execute [`Int hostid; `Int userid];
-
- match sth#fetch1 () with
- | [ `Null ] -> None
- | [ `String email ] -> Some email
- | _ -> assert false in
-