Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Module Forum_sql

module Forum_sql : sig..end

Author(s): Piero Furiesi, Jaap Boender, Vincent Balat, Boris Yakobowski


val new_forum : 
  title:string ->
  descr:string ->
  ?arborescent:bool ->
  title_syntax:'res Wiki_types.content_type ->
  messages_wiki:Wiki_types.wiki ->
  comments_wiki:Wiki_types.wiki -> unit -> Forum_types.forum Lwt.t

create a new forum. ?arborescent is true by default. Setting it to false will prevent to comment comments.

val update_forum : 
  ?title:string ->
  ?descr:string ->
  ?arborescent:bool ->
  ?title_syntax:'res Wiki_types.content_type ->
  ?messages_wiki:Wiki_types.wiki ->
  ?comments_wiki:Wiki_types.wiki -> Forum_types.forum -> unit Lwt.t

Update the information of a forum. All arguments not passed are left unchanged

val new_message : 
  forum:Forum_types.forum ->
  wiki:Wiki_types.wiki ->
  creator_id:User_sql.Types.userid ->
  title_syntax:'res Wiki_types.content_type ->
  ?subject:string ->
  ?parent_id:Forum_types.message ->
  ?moderated:bool -> text:string -> Forum_types.message Lwt.t

inserts a message in a forum. ?moderated is false by default.

val set_moderated : 
  message_id:Forum_types.message -> moderated:bool -> unit Lwt.t

set or unset moderated flag on a message

val get_forum : 
  ?not_deleted_only:bool ->
  forum:Forum_types.forum -> unit -> Forum_types.forum_info Lwt.t

Get forum information, given its id or title. Information is: (forum id, title, description, arborescent, deleted)

val forum_exists : title:string -> unit -> bool Lwt.t

Return if a forum title is already used

val get_forums_list : 
  ?not_deleted_only:bool -> unit -> Forum_types.forum_info list Lwt.t

returns the list of forums

val get_message : 
  message_id:Forum_types.message ->
  unit -> Forum_types.message_info Lwt.t

returns a message

val get_thread : 
  message_id:Forum_types.message ->
  unit -> Forum_types.message_info list Lwt.t

returns a list of messages containing the message of id ~message_id and all its children, ordered according depth first traversal of the tree. For each message, the information retrieved is: (id, subject, author, datetime, parent_id, root_id, forum_id, wikibox, moderated, tree_min, tree_max). The list is not filtered and also contains deleted messages. The result is ordered according to tree_min.

val get_childs : 
  message_id:Forum_types.message ->
  unit -> Forum_types.message_info list Lwt.t

returns a list of all the direct childs of messages ~message_id. The list is not filtered and also contains deleted messages. The result is ordered according to tree_min.

val get_message_list : 
  forum:Forum_types.forum ->
  first:int64 ->
  number:int64 ->
  moderated_only:bool -> unit -> Forum_types.message_info list Lwt.t

returns the list of messages (without comments) in a forum. If moderated_only is true, will return:

  • moderated messages
  • all messages with special rights (without looking at rights)
val get_wikibox_creator : 
  wb:Wiki_types.wikibox -> User_sql.Types.userid option Lwt.t

returns the creator of a wikibox containing a forum message or forum message title. None if not a forum wikibox.

val wikibox_is_moderated : wb:Wiki_types.wikibox -> bool Lwt.t

returns whether the message has been moderated or not. The argument is either the wikibox containing the message or the message title. The result is false if it is not a forum wikibox.

val get_forums_id : 
  unit ->
  < id : < get : unit; nul : Sql.non_nullable; t : Sql.int32_t > Sql.t;
   title : < get : unit; nul : Sql.nullable; t : Sql.string_t > Sql.t >
  list Lwt.t
val get_forums_wiki_id : 
  unit ->
  < id : < get : unit; nul : Sql.non_nullable; t : Sql.int32_t > Sql.t;
   title : < get : unit; nul : Sql.nullable; t : Sql.string_t > Sql.t >
  list Lwt.t
val get_forum_messages_id : 
  unit ->
  < id : < get : unit; nul : Sql.non_nullable; t : Sql.int32_t > Sql.t;
   title : < get : unit; nul : Sql.nullable; t : Sql.string_t > Sql.t >
  list Lwt.t