X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fautocompletion.c;h=e1bf1ab979d90ba5a1ec1bad38aa3a10127135f7;hb=bb8396949b1fd2c8f96b3d4bc12fd4048b87c6cf;hp=e9c87ab0d6e2509d1fdd38479831207750527677;hpb=f9467b1e78c8a16ebb6bcf3087731b9684d6cff0;p=citadel.git
diff --git a/webcit/autocompletion.c b/webcit/autocompletion.c
index e9c87ab0d..e1bf1ab97 100644
--- a/webcit/autocompletion.c
+++ b/webcit/autocompletion.c
@@ -1,16 +1,26 @@
/*
- * $Id$
- *//**
- * \defgroup AjaxAutoCompletion ajax-powered autocompletion...
- * \ingroup ClientPower
+ * ajax-powered autocompletion...
+ *
+ * Copyright (c) 1996-2011 by the citadel.org team
+ *
+ * This program is open source software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
*/
-/*@{*/
#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,7 +28,7 @@ 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"
@@ -28,24 +38,36 @@ void recp_autocomplete(char *partial) {
PACKAGE_STRING);
begin_burst();
- wprintf("
");
+ wc_printf("");
serv_printf("AUTO %s", partial);
serv_getln(buf, sizeof buf);
if (buf[0] == '1') {
while(serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
extract_token(name, buf, 0, '|', sizeof name);
- wprintf("- ");
+ wc_printf("
- ");
escputs(name);
- wprintf("
");
+ wc_printf("");
}
}
- wprintf("
");
+ wc_printf("
");
- wprintf("\r\n\r\n");
+ wc_printf("\r\n\r\n");
wDumpContent(0);
}
-/** @} */
+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"), "", 0, _recp_autocomplete, 0);
+ WebcitAddUrlHandler(HKEY("cc_autocomplete"), "", 0, _cc_autocomplete, 0);
+ WebcitAddUrlHandler(HKEY("bcc_autocomplete"), "", 0, _bcc_autocomplete, 0);
+}