aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-07-02 20:03:15 +0200
committerClombrong <cromblong@egregore.fun>2025-07-26 21:55:50 +0200
commitce38fa913c3b450f1177a2d8e431dbbb8e31af66 (patch)
tree199b25217ee3d996081ab781ddaf5df46dde882b
parent9ec1d14b1478cda9ee730e01b084249d1d1e4a54 (diff)
docs(jid): document of_string function
-rw-r--r--lib/jid.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/jid.ml b/lib/jid.ml
index bbcd2a6..3564c5d 100644
--- a/lib/jid.ml
+++ b/lib/jid.ml
@@ -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