]> code.citadel.org Git - citadel.git/blobdiff - webcit/autocompletion.c
* use strbuffer as wprintf backend
[citadel.git] / webcit / autocompletion.c
index 0b9373ea2a8a5fea8b940fd831c9a7fb8285cf32..4cf4ccd6f659ff139fe84df68da623d681c6282e 100644 (file)
@@ -1,16 +1,13 @@
 /*
  * $Id$
- *//**
- * \defgroup AjaxAutoCompletion ajax-powered autocompletion...
- * \ingroup ClientPower
+ *
+ * ajax-powered autocompletion...
  */
 
-/*@{*/
 #include "webcit.h"
 
-/**
- * \brief Recipient autocompletion results
- * \param partial the account to search for ??????
+/*
+ * Recipient autocompletion results
  */
 void recp_autocomplete(char *partial) {
        char buf[1024];
@@ -18,12 +15,14 @@ void recp_autocomplete(char *partial) {
 
        output_headers(0, 0, 0, 0, 0, 0);
 
-       wprintf("Content-type: text/html\r\n"
+       hprintf("Content-type: text/html\r\n"
                "Server: %s\r\n"
                "Connection: close\r\n"
                "Pragma: no-cache\r\n"
-               "Cache-Control: no-store\r\n",
-               SERVER);
+               "Cache-Control: no-store\r\n"
+               "Expires: -1\r\n"
+               ,
+               PACKAGE_STRING);
        begin_burst();
 
        wprintf("<ul>");
@@ -46,4 +45,16 @@ void recp_autocomplete(char *partial) {
 }
 
 
-/** @} */
+void _recp_autocomplete(void) {recp_autocomplete(bstr("recp"));}
+void _cc_autocomplete(void)   {recp_autocomplete(bstr("cc"));} 
+void _bcc_autocomplete(void)  {recp_autocomplete(bstr("bcc"));}
+
+
+void 
+InitModule_AUTO_COMPLETE
+(void)
+{
+       WebcitAddUrlHandler(HKEY("recp_autocomplete"), _recp_autocomplete, 0);
+       WebcitAddUrlHandler(HKEY("cc_autocomplete"),   _cc_autocomplete, 0);
+       WebcitAddUrlHandler(HKEY("bcc_autocomplete"),  _bcc_autocomplete, 0);
+}