X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Faddressbook_popup.c;h=c119cc18ee0b206df714070fa64cfe5367e48dcf;hb=HEAD;hp=5d90844dd49ea1a4a04d5c00f7abc8332589686c;hpb=b02aa24cf63bb5e93c710ffeff3aa5984f15f91e;p=citadel.git diff --git a/webcit/addressbook_popup.c b/webcit/addressbook_popup.c index 5d90844dd..afbf3a0c7 100644 --- a/webcit/addressbook_popup.c +++ b/webcit/addressbook_popup.c @@ -1,32 +1,84 @@ /* - * $Id: $ - *//** - * \defgroup AjaxAutoCompletion ajax-powered autocompletion... - * \ingroup ClientPower + * Dynamic HTML (formerly known as "AJAX") powered auto-completion + * + * Copyright (c) 1996-2012 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, version 3. + * + * 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. */ -/*@{*/ #include "webcit.h" -/** - * \brief Address book popup results + +/* + * Address book popup results */ -void display_address_book_inner_div(void) { - int i; +HashList* GetAddressbookList() +{ + HashList *List = NULL; + const StrBuf *WhichAddrBook; + StrBuf *saved_roomname; + StrBuf *Name; + StrBuf *Line; + long BufLen; + int IsLocalAddrBook; - begin_ajax_response(); + WhichAddrBook = sbstr("which_addr_book"); + IsLocalAddrBook = strcasecmp(ChrPtr(WhichAddrBook), "__LOCAL_USERS__") == 1; - wprintf("
" - "
\n"); + if (!IsLocalAddrBook) { + gotoroom(saved_roomname); + FreeStrBuf(&saved_roomname); + } - end_ajax_response(); + return List; } -/** @} */ + + +void +InitModule_ADDRBOOK_POPUP +(void) +{ + + RegisterIterator("ITERATE:ABNAMES", 0, NULL, GetAddressbookList, NULL, NULL, CTX_STRBUF, CTX_NONE, IT_NOFLAG); +}