diff --git a/lib/modules/Protocols.pmod/LysKOM.pmod/Session.pike b/lib/modules/Protocols.pmod/LysKOM.pmod/Session.pike index 797387f3ea1f7a34a7ec974ff7f6ebcb114b00a4..303b97aa29418c22b295d7e2bcd0f5ae9e627e76 100644 --- a/lib/modules/Protocols.pmod/LysKOM.pmod/Session.pike +++ b/lib/modules/Protocols.pmod/LysKOM.pmod/Session.pike @@ -1,6 +1,6 @@ #pike __REAL_VERSION__ -// $Id: Session.pike,v 1.22 2000/11/11 03:07:54 jhs Exp $ +// $Id: Session.pike,v 1.23 2000/11/11 03:45:34 jhs Exp $ //! module Protocols //! submodule LysKOM //! class Session @@ -418,6 +418,62 @@ class MiscInfo if(objectp(res) && res->iserror) err=res; else VAR=CONV; \ } +constant itemname_to_tag = ([ "content-type": 1, + "fast-reply": 2, + "cross-reference": 3, + "no-comments": 4, + "personal-comment": 5, + "request-confirmation": 6, + "read-confirm": 7, + "redirect": 8, + "x-face": 9, + "alternate-name": 10, + "pgp-signature": 11, + "pgp-public-key": 12, + "e-mail-address": 13, + "faq-text": 14, + "creating-software": 15, + "mx-author": 16, + "mx-from": 17, + "mx-reply-to": 18, + "mx-to": 19, + "mx-cc": 20, + "mx-date": 21, + "mx-message-id": 22, + "mx-in-reply-to": 23, + "mx-misc": 24, + "mx-allow-filter": 25, + "mx-reject-forward": 26, + "notify-comments": 27, + "faq-for-conf": 28, + "recommended-conf": 29, + "mx-mime-belongs-to": 10100, + "mx-mime-part-in": 10101, + "mx-mime-misc": 10102, + "mx-envelope-sender": 10103, + "mx-mime-file-name": 10104, ]); + +class AuxItemInput +{ + inherit ProtocolTypes.AuxItemInput; + + void create(string|int tag_type, multiset _flags, + int _inherit_limit, string _data) + { + if(intp(tag_type)) + tag = tag_type; + else + tag = itemname_to_tag[replace(tag_type, "_", "-")]; + flags = _flags; + inherit_limit = _inherit_limit; + data = _data; + } + + string _sprintf() + { + return sprintf("AuxItemInput(%s)", search(itemname_to_tag, tag)); + } +} class AuxItems { @@ -425,48 +481,12 @@ class AuxItems { array desc = ({}); foreach((array)tag_to_items, [int tag, mixed item]) - desc += ({ search(name_to_tag, tag) }); + desc += ({ search(itemname_to_tag, tag) }); return sprintf("AuxItems(%s)", sizeof(desc) ? String.implode_nicely(desc) : "none present"); } - mapping(string:int) name_to_tag= ([ "content-type": 1, - "fast-reply": 2, - "cross-reference": 3, - "no-comments": 4, - "personal-comment": 5, - "request-confirmation": 6, - "read-confirm": 7, - "redirect": 8, - "x-face": 9, - "alternate-name": 10, - "pgp-signature": 11, - "pgp-public-key": 12, - "e-mail-address": 13, - "faq-text": 14, - "creating-software": 15, - "mx-author": 16, - "mx-from": 17, - "mx-reply-to": 18, - "mx-to": 19, - "mx-cc": 20, - "mx-date": 21, - "mx-message-id": 22, - "mx-in-reply-to": 23, - "mx-misc": 24, - "mx-allow-filter": 25, - "mx-reject-forward": 26, - "notify-comments": 27, - "faq-for-conf": 28, - "recommended-conf": 29, - "mx-mime-belongs-to": 10100, - "mx-mime-part-in": 10101, - "mx-mime-misc": 10102, - "mx-envelope-sender": 10103, - "mx-mime-file-name": 10104, - ]); - - mapping(int:array(ProtocolTypes.AuxItem)) tag_to_items=([]); + mapping(int:array(ProtocolTypes.AuxItem)) tag_to_items = ([]); array(ProtocolTypes.AuxItem) aux_items; @@ -490,13 +510,13 @@ class AuxItems return create; default: - return tag_to_items[name_to_tag[replace(what,"_","-")]] || ({ }); + return tag_to_items[itemname_to_tag[replace(what,"_","-")]] || ({ }); } } array(string) _indices() { - return ({ "create" }) + indices(name_to_tag); + return ({ "create" }) + indices(itemname_to_tag); } mixed `->(string what) { return `[](what); } @@ -1049,7 +1069,7 @@ object|void create_text(string subject,string body, object|void _create_text(string textstring, MiscInfo misc, - void|array(ProtocolTypes.AuxItemInput) aux_items, + void|array(AuxItemInput) aux_items, int anonymous, void|function callback, void|mixed ...extra) @@ -1117,4 +1137,3 @@ string _sprintf() { return sprintf("Session(%s)", server); } -