diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/jid.ml | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -30,6 +30,17 @@ let uchars_of_string s : uchars = loop ((u, i) :: acc) (i + k) in loop [] 0 +(** Convert a [string] to a [Jid.t]. + + This function traverses the JID until an '/' char (or the end of the string) occurs. + + Anything before is the "bare" JID, and anything eventually after is the resource. + + Then, the function goes backward until an '@' char (or the start of the string) + occurs. + + Anything after is the domain, and anything eventually before is the localpart + (username). *) let of_string (jid : string) : t = let open List in let open String in |