char buf[256];
long len;
char *Name;
+ const char *VCName;
void *Namee;
+ StrBuf *DefAddrBook;
HashList *List;
HashPos *it;
begin_ajax_response();
+ DefAddrBook = get_room_pref("defaddrbook");
+
wprintf("<table border=0 width=100%%><tr valign=middle>");
wprintf("<td align=left><img src=\"static/viewcontacts_32x.gif\"></td>");
wprintf("<td align=center>");
bstr("target_input")
);
- wprintf("<option value=\"__LOCAL_USERS__\">");
+ wprintf("<option value=\"__LOCAL_USERS__\" %s>",
+ (strcmp(ChrPtr(DefAddrBook), "__LOCAL_USERS__") == 0)?
+ "selected=\"selected\" ":"");
escputs(serv_info.serv_humannode);
wprintf("</option>\n");
}
SortByHashKey(List, 1);
- it = GetNewHashPos();
- while (GetNextHashPos(List, it, &len, &Name, &Namee)) {
+ it = GetNewHashPos(List, 0);
+ while (GetNextHashPos(List, it, &len, &VCName, &Namee)) {
wprintf("<option value=\"");
urlescputs((char*)Namee);
- wprintf("\">");
+ if (strcmp(ChrPtr(DefAddrBook), Namee) == 0)
+ wprintf("\" selected=\"selected\" >");
+ else
+ wprintf("\">");
escputs((char*)Namee);
wprintf("</option>\n");
}
"><img src=\"static/closewindow.gif\">");
wprintf("</td></tr></table>");
- wprintf("<script type=\"text/javascript\">"
- "PopulateAddressBookInnerDiv($('which_addr_book').value,'%s');"
- "</script>\n",
+ StrBufAppendPrintf(WC->trailing_javascript,
+ "PopulateAddressBookInnerDiv($('which_addr_book').value,'%s');",
bstr("target_input")
);
char target_label[64];
long len;
char *Name;
+ const char *VCName;
void *Namee;
HashList *List;
HashPos *it;
}
SortByHashKey(List, 1);
- it = GetNewHashPos();
- while (GetNextHashPos(List, it, &len, &Name, &Namee)) {
+ it = GetNewHashPos(List, 0);
+ while (GetNextHashPos(List, it, &len, &VCName, &Namee)) {
wprintf("<option value=\"");
escputs((char*)Namee);
wprintf("\">");
}
else {
+ set_room_pref("defaddrbook",NewStrBufDup(sbstr("which_addr_book")), 0);
safestrncpy(saved_roomname, WC->wc_roomname, sizeof saved_roomname);
gotoroom(bstr("which_addr_book"));
serv_puts("DVCA");
}
SortByHashKey(List, 1);
- it = GetNewHashPos();
- while (GetNextHashPos(List, it, &len, &Name, (void**)&Namee)) {
+ it = GetNewHashPos(List, 0);
+ while (GetNextHashPos(List, it, &len, &VCName, (void**)&Namee)) {
wprintf("<option value=\"");
escputs((char*)Namee);
wprintf("\">");