From ac64841d0bc3cbff764d317e76dd038062a09a89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Mon, 16 Nov 1998 23:26:41 +0100
Subject: [PATCH] New class imap_atom_options, used for FETCH responses.

Rev: lib/modules/Protocols.pmod/IMAP.pmod/types.pmod:1.4
---
 .../Protocols.pmod/IMAP.pmod/types.pmod       | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/lib/modules/Protocols.pmod/IMAP.pmod/types.pmod b/lib/modules/Protocols.pmod/IMAP.pmod/types.pmod
index 30dd60e261..56c13e7c6c 100644
--- a/lib/modules/Protocols.pmod/IMAP.pmod/types.pmod
+++ b/lib/modules/Protocols.pmod/IMAP.pmod/types.pmod
@@ -26,6 +26,27 @@ class imap_atom
   string format() { return name; }
 }
 
+class imap_atom_options
+{
+  string name;
+  array options;
+  array range;
+
+  void create(string s, array o, array r)
+    {
+      name = s;
+      options = o;
+      range = r;
+    }
+
+  string format()
+    {
+      return name + "[" + Array.map(options, imap_format) + "]"
+	// NOTE: Only the start index is sent
+	+ (range ? sprintf("<%d>", range[0]) : "");
+    }
+}
+
 class imap_string
 {
   string data;
-- 
GitLab