]> code.citadel.org Git - citadel.git/blobdiff - webcit/addressbook_popup.c
* remove Dave's SYS_ users from the addressbookpopup, since you don't want to send...
[citadel.git] / webcit / addressbook_popup.c
index 5e3118b0c88b197fc9dd572bcc2b77af28aaac5d..6cfb5b5c3a8b02c918d619ac102628334d257857 100644 (file)
@@ -60,7 +60,7 @@ void display_address_book_middle_div(void) {
                }
        }
 
-       SortByHashKey(List, 0);
+       SortByHashKey(List, 1);
        it = GetNewHashPos();
        while (GetNextHashPos(List, it, &len, &Name, &Namee)) {
                wprintf("<option value=\"");
@@ -118,10 +118,14 @@ void display_address_book_inner_div() {
                if (buf[0] == '1') while(len = serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                        Name = (char*) malloc(len + 1);
                        len = extract_token(Name, buf, 0, '|', len + 1);
+                       if((len > 5) && (strncmp(Name, "SYS_", 4) == 0)) {
+                               free(Name);
+                               continue;
+                       }
                        Put(List, Name, len, Name, NULL);
 
                }
-               SortByHashKey(List, 0);
+               SortByHashKey(List, 1);
                it = GetNewHashPos();
                while (GetNextHashPos(List, it, &len, &Name, &Namee)) {
                        wprintf("<option value=\"");
@@ -145,7 +149,7 @@ void display_address_book_inner_div() {
                        Put(List, Name, len, Name, NULL);
 
                }
-               SortByHashKey(List, 0);
+               SortByHashKey(List, 1);
                it = GetNewHashPos();
                while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) {
                        wprintf("<option value=\"");
@@ -156,7 +160,7 @@ void display_address_book_inner_div() {
                }
                DeleteHashPos(&it);
                DeleteHash(&List);
-               gotoroom((char*)BSTR(saved_roomname)); /* TODO: get rid of typecast */
+               gotoroom(saved_roomname);
        }
 
        wprintf("</select>\n");
@@ -182,3 +186,14 @@ void display_address_book_inner_div() {
 
        end_ajax_response();
 }
+
+
+
+
+void 
+InitModule_ADDRBOOK_POPUP
+(void)
+{
+       WebcitAddUrlHandler(HKEY("display_address_book_middle_div"), display_address_book_middle_div, 0);
+       WebcitAddUrlHandler(HKEY("display_address_book_inner_div"), display_address_book_inner_div, 0);
+}