(* * Copyright (c) 2014, OCaml.org project * Copyright (c) 2015 KC Sivaramakrishnan * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *) (** River user composed from Sortal contact data + sync state. User data is stored in Sortal and read on-demand. River only persists sync timestamps and optional per-user overrides. *) type t (** A River user composed from Sortal.Contact + sync metadata. *) val of_contact : Sortal.Contact.t -> ?last_synced:string -> unit -> t (** [of_contact contact ()] creates a River user from a Sortal contact. @param contact The Sortal contact to base this user on @param last_synced Optional ISO 8601 timestamp of last sync *) val username : t -> string (** [username user] returns the username (from Sortal.Contact.handle). *) val fullname : t -> string (** [fullname user] returns the full name (from Sortal.Contact.primary_name). *) val email : t -> string option (** [email user] returns the email address (from Sortal.Contact). *) val feeds : t -> Source.t list (** [feeds user] returns the list of subscribed feeds (from Sortal.Contact). *) val last_synced : t -> string option (** [last_synced user] returns the last sync timestamp if set. *) val contact : t -> Sortal.Contact.t (** [contact user] returns the underlying Sortal contact. *) val set_last_synced : t -> string -> t (** [set_last_synced user timestamp] returns a new user with updated sync time. *)