* upgrade hash retriever function, it now takes the usual cloud of parameters as...
authorWilfried Göesgens <willi@citadel.org>
Thu, 6 Nov 2008 19:28:19 +0000 (19:28 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 6 Nov 2008 19:28:19 +0000 (19:28 +0000)
webcit/inetconf.c
webcit/messages.c
webcit/netconf.c
webcit/subst.c
webcit/useredit.c
webcit/webcit.h
webcit/who.c

index b19fc242a6beb39defff7b2f7478532d49e14872..126e4afae5c1cb509da866506d24cff7b3973d1d 100644 (file)
@@ -396,7 +396,7 @@ void DeleteInetConfHash(StrBuf *Target, int nArgs, WCTemplateToken *Token, void
 }
 
 
-HashList *GetInetConfHash(WCTemplateToken *Token)
+HashList *GetInetConfHash(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
 {
        struct wcsession *WCC = WC;
        void *vHash;
@@ -404,10 +404,10 @@ HashList *GetInetConfHash(WCTemplateToken *Token)
        if (WCC->InetCfg == NULL)
                load_inetconf();
        GetHash(WCC->InetCfg, 
-               Token->Params[2]->Start, 
-               Token->Params[2]->len,
+               Tokens->Params[2]->Start, 
+               Tokens->Params[2]->len,
                &vHash);
-       svprintf(HKEY("SERVCFG:INET:TYPE"), WCS_STRING, Token->Params[2]->Start);
+       svprintf(HKEY("SERVCFG:INET:TYPE"), WCS_STRING, Tokens->Params[2]->Start);
        return vHash;
 }
 
index e83f9649c48773fb09c40233c895b26cc781d83b..8480ce618560119d267293cab8807a3dc841d360 100644 (file)
@@ -811,6 +811,19 @@ void render_MAIL_UNKNOWN(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *Foun
 
 
 
+HashList *iterate_get_mime(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
+{
+       return NULL;
+}
+
+
+void tmplput_MIME_ATTACH(StrBuf *TemplBuffer, void *Context, WCTemplateToken *Token)
+{
+}
+
+
+
+
 
 /*
  * Look for URL's embedded in a buffer and make them linkable.  We use a
@@ -3878,6 +3891,12 @@ InitModule_MSG
        RegisterNamespace("MAIL:BODY", 0, 2, tmplput_MAIL_BODY,  CTX_MAILSUM);
 
 
+       RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
+       RegisterConditional(HKEY("COND:MAIL:SUMM:H_NODE"), 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
+       RegisterConditional(HKEY("COND:MAIL:SUMM:OTHERNODE"), 0, Conditional_MAIL_SUMM_OTHERNODE, CTX_MAILSUM);
+
+
+       RegisterIterator("MAIL:MIME:ATTACH", 0, NULL, iterate_get_mime, tmplput_MIME_ATTACH, NULL, CTX_MAILSUM);
 
        RegisterMimeRenderer(HKEY("text/x-citadel-variformat"), render_MAIL_variformat);
        RegisterMimeRenderer(HKEY("text/plain"), render_MAIL_text_plain);
@@ -3885,11 +3904,6 @@ InitModule_MSG
        RegisterMimeRenderer(HKEY("text/html"), render_MAIL_html);
        RegisterMimeRenderer(HKEY(""), render_MAIL_UNKNOWN);
 
-
-       RegisterConditional(HKEY("COND:MAIL:SUMM:UNREAD"), 0, Conditional_MAIL_SUMM_UNREAD, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:H_NODE"), 0, Conditional_MAIL_SUMM_H_NODE, CTX_MAILSUM);
-       RegisterConditional(HKEY("COND:MAIL:SUMM:OTHERNODE"), 0, Conditional_MAIL_SUMM_OTHERNODE, CTX_MAILSUM);
-
        RegisterMsgHdr(HKEY("nhdr"), examine_nhdr, 0);
        RegisterMsgHdr(HKEY("type"), examine_type, 0);
        RegisterMsgHdr(HKEY("from"), examine_from, 0);
index 521c765a78ed0dadd892d9e8ea222d4476d9132a..dcdfe4316b7165c8f882ac3f2047853fb93a4970 100644 (file)
@@ -81,7 +81,7 @@ void SerializeNode(NodeConf *Node, StrBuf *Buf)
 }
 
 
-HashList *load_netconf(WCTemplateToken *Token)
+HashList *load_netconf(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
 {
        StrBuf *Buf;
        HashList *Hash;
@@ -183,7 +183,7 @@ void edit_node(void) {
                        return;
                }
                        
-               NodeConfig = load_netconf(NULL);
+               NodeConfig = load_netconf(NULL, 0, NULL, NULL, CTX_NONE);
                Put(NodeConfig, ChrPtr(Index), StrLength(Index), NewNode, DeleteNodeConf);
                save_net_conf(NodeConfig);
                DeleteHash(&NodeConfig);
@@ -282,7 +282,7 @@ void display_edit_node(void)
                return;
        }
 
-       NodeConfig = load_netconf(NULL);
+       NodeConfig = load_netconf(NULL, 0, NULL, NULL, CTX_NONE);
        if (!GetHash(NodeConfig, ChrPtr(Index), StrLength(Index), &vNode) || 
            (vNode == NULL)) {
                sprintf(WC->ImportantMessage, _("Invalid Parameter"));
@@ -477,7 +477,7 @@ void delete_node(void)
                return;
        }
 
-       NodeConfig = load_netconf(NULL);
+       NodeConfig = load_netconf(NULL, 0, NULL, NULL, CTX_NONE);
        if (!GetHash(NodeConfig, ChrPtr(Index), StrLength(Index), &vNode) || 
            (vNode == NULL)) {
                sprintf(WC->ImportantMessage, _("Invalid Parameter"));
index 6ede4a74cbc9c9c93d713df2c268caef8d4c6417..cca998a4014eae990d10473cb20ce374f3edc390 100644 (file)
@@ -1369,7 +1369,7 @@ void tmpl_iterate_subtmpl(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, vo
        }
 
        if (It->StaticList == NULL)
-               List = It->GetHash(Tokens);
+               List = It->GetHash(Target, nArgs, Tokens, Context, ContextType);
        else
                List = It->StaticList;
 
index 1f6093bd572a4b463d0e0266c9f70d1e299c1d6d..77c98e66772445d25df2629f89cf2a147347765d 100644 (file)
@@ -273,7 +273,7 @@ int ComparenPostsRev(const void *vUser1, const void *vUser2)
 }
 
 
-HashList *iterate_load_userlist(WCTemplateToken *Token)
+HashList *iterate_load_userlist(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
 {
        HashList *Hash;
        char buf[SIZ];
index a479f5f4c9676fbcbe8ecb06747a3d2641c70c08..59a361e8ebfe5022fd157ac6af20ae7c31467b57 100644 (file)
@@ -334,7 +334,7 @@ void RegisterConditional(const char *Name, long len,
 
 
 typedef void (*SubTemplFunc)(StrBuf *TemplBuffer, void *Context, WCTemplateToken *Token);
-typedef HashList *(*RetrieveHashlistFunc)(WCTemplateToken *Token);
+typedef HashList *(*RetrieveHashlistFunc)(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType);
 typedef void (*HashDestructorFunc) (HashList **KillMe);
 void RegisterITERATOR(const char *Name, long len,
                      int AdditionalParams, 
index a2ecd9a3ce09074a8cdb38a132db5d4ef45d270e..5b011690d1d73f80f078322b9b0758574a180009 100644 (file)
@@ -447,7 +447,7 @@ void _terminate_session(void) {
        terminate_session();
 }
 
-HashList *GetWholistHash(WCTemplateToken *Token)
+HashList *GetWholistHash(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
 {
        HashList *List;
        char buf[SIZ];