4 * Manage user preferences with a little help from the Citadel server.
12 HashList *PreferenceHooks;
14 typedef struct _PrefDef {
22 typedef struct _Preference {
32 void DestroyPrefDef(void *vPrefDef)
34 PrefDef *Prefdef = (PrefDef*) vPrefDef;
35 FreeStrBuf(&Prefdef->Setting);
36 FreeStrBuf(&Prefdef->OnLoadName);
40 void DestroyPreference(void *vPref)
42 Preference *Pref = (Preference*) vPref;
43 FreeStrBuf(&Pref->Key);
44 FreeStrBuf(&Pref->Val);
45 FreeStrBuf(&Pref->DeQPed);
49 void _RegisterPreference(const char *Setting, long SettingLen,
53 const char *OnLoadName)
55 PrefDef *Newpref = (PrefDef*) malloc(sizeof(PrefDef));
56 Newpref->Setting = NewStrBufPlain(Setting, SettingLen);
57 Newpref->PrefStr = PrefStr;
59 Newpref->OnLoad = OnLoad;
60 if (Newpref->OnLoad != NULL) {
61 Newpref->OnLoadName = NewStrBufPlain(OnLoadName, -1);
64 Newpref->OnLoadName = NULL;
65 Put(PreferenceHooks, Setting, SettingLen, Newpref, DestroyPrefDef);
68 const char *PrefGetLocalStr(const char *Setting, long len)
71 if (GetHash(PreferenceHooks, Setting, len, &hash_value) != 0) {
72 PrefDef *Newpref = (PrefDef*) hash_value;
73 return _(Newpref->PrefStr);
80 inline const char *PrintPref(void *vPref)
82 Preference *Pref = (Preference*) vPref;
83 if (Pref->DeQPed != NULL)
84 return ChrPtr(Pref->DeQPed);
86 return ChrPtr(Pref->Val);
90 void GetPrefTypes(HashList *List)
100 It = GetNewHashPos(List, 0);
101 while (GetNextHashPos(List, It, &len, &Key, &vSetting))
103 Pref = (Preference*) vSetting;
104 if (GetHash(PreferenceHooks, SKEY(Pref->Key), &vPrefDef) &&
107 PrefType = (PrefDef*) vPrefDef;
108 Pref->Type = PrefType;
110 lprintf(1, "Loading [%s]with type [%ld] [\"%s\"]\n",
115 switch (Pref->Type->Type)
121 Pref->lval = StrTol(Pref->Val);
125 Pref->DeQPed = NewStrBufPlain(NULL, StrLength(Pref->Val));
126 StrBufEUid_unescapize(Pref->DeQPed, Pref->Val);
130 Pref->lval = strcmp(ChrPtr(Pref->Val), "yes") == 0;
135 if (PrefType->OnLoad != NULL){
137 lprintf(1, "Loading with: -> %s(\"%s\", %ld)\n",
138 ChrPtr(PrefType->OnLoadName),
141 PrefType->OnLoad(Pref->Val, Pref->lval);
148 void ParsePref(HashList **List, StrBuf *ReadBuf)
151 Preference *Data = NULL;
152 Preference *LastData = NULL;
155 StrBuf_ServGetln(ReadBuf);
156 if ( (StrLength(ReadBuf)==3) &&
157 !strcmp(ChrPtr(ReadBuf), "000")) {
162 if ((ChrPtr(ReadBuf)[0] == ' ') &&
163 (LastData != NULL)) {
164 StrBufAppendBuf(LastData->Val, ReadBuf, 1);
167 LastData = Data = malloc(sizeof(Preference));
168 memset(Data, 0, sizeof(Preference));
169 Data->Key = NewStrBuf();
170 Data->Val = NewStrBuf();
171 StrBufExtract_token(Data->Key, ReadBuf, 0, '|');
172 StrBufExtract_token(Data->Val, ReadBuf, 1, '|');
173 if (!IsEmptyStr(ChrPtr(Data->Key)))
183 lprintf(1, "ignoring spurious preference line: [%s]\n",
185 DestroyPreference(Data);
196 * display preferences dialog
198 void load_preferences(void)
206 memset(&Room, 0, sizeof(folder));
207 ReadBuf = NewStrBufPlain(NULL, SIZ * 4);
208 if (goto_config_room(ReadBuf, &Room) != 0) {
209 FreeStrBuf(&ReadBuf);
212 return; /* oh well. */
215 serv_puts("MSGS ALL|0|1");
216 StrBuf_ServGetln(ReadBuf);
217 if (GetServerStatus(ReadBuf, NULL) == 8) {
218 serv_puts("subj|__ WebCit Preferences __");
222 StrBuf_ServGetln(ReadBuf)) {
223 if ( (StrLength(ReadBuf)==3) &&
224 !strcmp(ChrPtr(ReadBuf), "000")) {
228 msgnum = StrTol(ReadBuf);
232 serv_printf("MSG0 %ld", msgnum);
233 StrBuf_ServGetln(ReadBuf);
234 if (GetServerStatus(ReadBuf, NULL) == 1) {
235 while (StrBuf_ServGetln(ReadBuf),
236 (strcmp(ChrPtr(ReadBuf), "text") &&
237 strcmp(ChrPtr(ReadBuf), "000"))) {
239 if (!strcmp(ChrPtr(ReadBuf), "text")) {
240 ParsePref(&WCC->hash_prefs, ReadBuf);
245 /* Go back to the room we're supposed to be in */
246 if (StrLength(WCC->CurRoom.name) > 0) {
247 serv_printf("GOTO %s", ChrPtr(WCC->CurRoom.name));
248 StrBuf_ServGetln(ReadBuf);
249 GetServerStatus(ReadBuf, NULL);
251 FreeStrBuf(&ReadBuf);
256 * Goto the user's configuration room, creating it if necessary.
257 * returns 0 on success or nonzero upon failure.
259 int goto_config_room(StrBuf *Buf, folder *Room)
261 serv_printf("GOTO %s", USERCONFIGROOM);
262 StrBuf_ServGetln(Buf);
263 if (GetServerStatus(Buf, NULL) != 2) { /* try to create the config room if not there */
264 serv_printf("CRE8 1|%s|4|0", USERCONFIGROOM);
265 StrBuf_ServGetln(Buf);
266 GetServerStatus(Buf, NULL);
268 serv_printf("GOTO %s", USERCONFIGROOM);
269 StrBuf_ServGetln(Buf);
270 if (GetServerStatus(Buf, NULL) != 2) {
274 ParseGoto(Room, Buf);
278 void WritePrefsToServer(HashList *Hash)
286 StrBuf *SubBuf = NULL;
288 Hash = WCC->hash_prefs;
289 #ifdef DBG_PREFS_HASH
290 dbg_PrintHash(Hash, PrintPref, NULL);
292 HashPos = GetNewHashPos(Hash, 0);
293 while (GetNextHashPos(Hash, HashPos, &len, &Key, &vPref)!=0)
298 Pref = (Preference*) vPref;
299 nchars = StrLength(Pref->Val);
302 size_t offset, nchars;
304 SubBuf = NewStrBufPlain(NULL, SIZ);
313 nchars = StrBufSub(SubBuf, Pref->Val, offset, nchars);
316 serv_printf("%s|%s", ChrPtr(Pref->Key), ChrPtr(SubBuf));
318 serv_printf(" %s", ChrPtr(SubBuf));
321 nchars = StrLength(Pref->Val) - offset;
327 serv_printf("%s|%s", ChrPtr(Pref->Key), ChrPtr(Pref->Val));
331 DeleteHashPos(&HashPos);
335 * \brief save the modifications
337 void save_preferences(void)
345 ReadBuf = NewStrBuf();
346 memset(&Room, 0, sizeof(folder));
347 if (goto_config_room(ReadBuf, &Room) != 0) {
348 FreeStrBuf(&ReadBuf);
351 return; /* oh well. */
353 //void do_change_view(int newview) {
356 serv_puts("MSGS ALL|0|1");
357 StrBuf_ServGetln(ReadBuf);
358 if (GetServerStatus(ReadBuf, NULL) == 8) {
359 serv_puts("subj|__ WebCit Preferences __");
363 StrBuf_ServGetln(ReadBuf)) {
364 if ( (StrLength(ReadBuf)==3) &&
365 !strcmp(ChrPtr(ReadBuf), "000")) {
369 msgnum = StrTol(ReadBuf);
373 serv_printf("DELE %ld", msgnum);
374 StrBuf_ServGetln(ReadBuf);
375 GetServerStatus(ReadBuf, NULL);
378 serv_printf("ENT0 1||0|1|__ WebCit Preferences __|");
379 StrBuf_ServGetln(ReadBuf);
380 if (GetServerStatus(ReadBuf, NULL) == 4) {
382 WritePrefsToServer(WCC->hash_prefs);
387 /** Go back to the room we're supposed to be in */
388 if (StrLength(WCC->CurRoom.name) > 0) {
389 serv_printf("GOTO %s", ChrPtr(WCC->CurRoom.name));
390 StrBuf_ServGetln(ReadBuf);
391 GetServerStatus(ReadBuf, NULL);
393 FreeStrBuf(&ReadBuf);
398 * \brief query the actual setting of key in the citadel database
399 * \param key config key to query
400 * \param keylen length of the key string
401 * \param value StrBuf-value to the key to get
404 int get_pref_backend(const char *key, size_t keylen, Preference **Pref)
406 void *hash_value = NULL;
407 #ifdef DBG_PREFS_HASH
408 dbg_PrintHash(WC->hash_prefs, PrintPref, NULL);
410 if (GetHash(WC->hash_prefs, key, keylen, &hash_value) == 0) {
415 *Pref = (Preference*) hash_value;
420 int get_PREFERENCE(const char *key, size_t keylen, StrBuf **value)
425 Ret = get_pref_backend(key, keylen, &Pref);
434 * \brief Write a key into the webcit preferences database for this user
436 * \params key key whichs value is to be modified
437 * \param keylen length of the key string
438 * \param value value to set
439 * \param save_to_server 1 = flush all data to the server, 0 = cache it for now
441 void set_preference_backend(const char *key, size_t keylen,
452 Pref = (Preference*) malloc(sizeof(Preference));
453 memset(Pref, 0, sizeof(Preference));
454 Pref->Key = NewStrBufPlain(key, keylen);
456 if ((PrefType == NULL) &&
457 GetHash(PreferenceHooks, SKEY(Pref->Key), &vPrefDef) &&
459 PrefType = (PrefDef*) vPrefDef;
461 if (PrefType != NULL)
463 Pref->Type = PrefType;
464 if (Pref->Type->Type != lPrefType)
465 lprintf(1, "warning: saving preference with wrong type [%s] %ld != %ld \n",
466 key, Pref->Type->Type, lPrefType);
467 switch (Pref->Type->Type)
476 if (Pref->Val == NULL)
477 Pref->Val = NewStrBufPlain(NULL, 64);
478 StrBufPrintf(Pref->Val, "%ld", lvalue);
482 Pref->DeQPed = value;
483 Pref->Val = NewStrBufPlain(NULL, StrLength(Pref->DeQPed) * 3);
484 StrBufEUid_escapize(Pref->Val, Pref->DeQPed);
490 Pref->Val = NewStrBufPlain(HKEY("yes"));
492 Pref->Val = NewStrBufPlain(HKEY("no"));
496 if (Pref->Type->OnLoad != NULL)
497 Pref->Type->OnLoad(Pref->Val, Pref->lval);
509 if (Pref->Val == NULL)
510 Pref->Val = NewStrBufPlain(NULL, 64);
511 StrBufPrintf(Pref->Val, "%ld", lvalue);
515 Pref->DeQPed = value;
516 Pref->Val = NewStrBufPlain(NULL, StrLength(Pref->DeQPed) * 3);
517 StrBufEUid_escapize(Pref->Val, Pref->DeQPed);
523 Pref->Val = NewStrBufPlain(HKEY("yes"));
525 Pref->Val = NewStrBufPlain(HKEY("no"));
530 Put(WCC->hash_prefs, key, keylen, Pref, DestroyPreference);
532 if (save_to_server) WCC->SavePrefsToServer = 1;
535 void set_PREFERENCE(const char *key, size_t keylen, StrBuf *value, int save_to_server)
537 set_preference_backend(key, keylen, 0, value, PRF_STRING, save_to_server, NULL);
540 int get_PREF_LONG(const char *key, size_t keylen, long *value, long Default)
545 Ret = get_pref_backend(key, keylen, &Pref);
554 *value = Pref->lval = atol(ChrPtr(Pref->Val));
561 void set_PREF_LONG(const char *key, size_t keylen, long value, int save_to_server)
563 set_preference_backend(key, keylen, value, NULL, PRF_INT, save_to_server, NULL);
566 int get_PREF_YESNO(const char *key, size_t keylen, int *value, int Default)
571 Ret = get_pref_backend(key, keylen, &Pref);
580 *value = Pref->lval = strcmp(ChrPtr(Pref->Val), "yes") == 0;
586 void set_PREF_YESNO(const char *key, size_t keylen, long value, int save_to_server)
588 set_preference_backend(key, keylen, value, NULL, PRF_YESNO, save_to_server, NULL);
591 int get_room_prefs_backend(const char *key, size_t keylen,
597 pref_name = NewStrBufPlain (HKEY("ROOM:"));
598 StrBufAppendBuf(pref_name, WC->CurRoom.name, 0);
599 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
600 StrBufAppendBufPlain(pref_name, key, keylen, 0);
601 Ret = get_pref_backend(SKEY(pref_name), Pref);
602 FreeStrBuf(&pref_name);
607 const StrBuf *get_X_PREFS(const char *key, size_t keylen,
608 const char *xkey, size_t xkeylen)
614 pref_name = NewStrBufPlain (HKEY("XPREF:"));
615 StrBufAppendBufPlain(pref_name, xkey, xkeylen, 0);
616 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
617 StrBufAppendBufPlain(pref_name, key, keylen, 0);
619 ret = get_pref_backend(SKEY(pref_name), &Prf);
620 FreeStrBuf(&pref_name);
627 void set_X_PREFS(const char *key, size_t keylen, const char *xkey, size_t xkeylen, StrBuf *value, int save_to_server)
631 pref_name = NewStrBufPlain (HKEY("XPREF:"));
632 StrBufAppendBufPlain(pref_name, xkey, xkeylen, 0);
633 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
634 StrBufAppendBufPlain(pref_name, key, keylen, 0);
636 set_preference_backend(SKEY(pref_name), 0, value, PRF_STRING, save_to_server, NULL);
637 FreeStrBuf(&pref_name);
641 long get_ROOM_PREFS_LONG(const char *key, size_t keylen, long *value, long Default)
646 Ret = get_room_prefs_backend(key, keylen, &Pref);
656 *value = Pref->lval = atol(ChrPtr(Pref->Val));
663 StrBuf *get_ROOM_PREFS(const char *key, size_t keylen)
668 Ret = get_room_prefs_backend(key, keylen, &Pref);
677 void set_ROOM_PREFS(const char *key, size_t keylen, StrBuf *value, int save_to_server)
681 pref_name = NewStrBufPlain (HKEY("ROOM:"));
682 StrBufAppendBuf(pref_name, WC->CurRoom.name, 0);
683 StrBufAppendBufPlain(pref_name, HKEY(":"), 0);
684 StrBufAppendBufPlain(pref_name, key, keylen, 0);
685 set_preference_backend(SKEY(pref_name), 0, value, PRF_STRING, save_to_server, NULL);
686 FreeStrBuf(&pref_name);
690 void GetPreferences(HashList *Setting)
702 Tmp = WCC->hash_prefs;
703 WCC->hash_prefs = Setting;
705 It = GetNewHashPos(PreferenceHooks, 0);
706 while (GetNextHashPos(PreferenceHooks, It, &len, &Key, &vSetting)) {
707 PrefType = (PrefDef*) vSetting;
709 if (!HaveBstr(SKEY(PrefType->Setting)))
711 switch (PrefType->Type) {
713 Buf = NewStrBufDup(SBstr(SKEY(PrefType->Setting)));
714 set_preference_backend(SKEY(PrefType->Setting),
722 lval = LBstr(SKEY(PrefType->Setting));
723 set_preference_backend(SKEY(PrefType->Setting),
731 Buf = NewStrBufDup(SBstr(SKEY(PrefType->Setting)));
732 set_preference_backend(SKEY(PrefType->Setting),
740 lval = YesBstr(SKEY(PrefType->Setting));
741 set_preference_backend(SKEY(PrefType->Setting),
750 WCC->hash_prefs = Tmp;
756 * \brief Commit new preferences and settings
758 void set_preferences(void)
760 if (!havebstr("change_button")) {
761 safestrncpy(WC->ImportantMessage,
762 _("Cancelled. No settings were changed."),
763 sizeof WC->ImportantMessage);
767 GetPreferences(WC->hash_prefs);
772 void tmplput_CFG_Value(StrBuf *Target, WCTemplputParams *TP)
775 if (get_pref_backend(TKEY(0), &Pref))
777 if (Pref->Type == NULL) {
778 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
780 switch (Pref->Type->Type)
783 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
786 if (Pref->decoded != 1) {
787 if (Pref->Val == NULL)
788 Pref->Val = NewStrBufPlain(NULL, 64);
789 StrBufPrintf(Pref->Val, "%ld", Pref->lval);
792 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
795 if (Pref->decoded != 1) {
796 if (Pref->DeQPed == NULL)
797 Pref->DeQPed = NewStrBufPlain(NULL, StrLength(Pref->Val));
799 StrBufEUid_unescapize(Pref->DeQPed, Pref->Val);
802 StrBufAppendTemplate(Target, TP, Pref->DeQPed, 1);
805 if (Pref->decoded != 1) {
806 Pref->lval = strcmp(ChrPtr(Pref->Val), "yes") == 0;
809 StrBufAppendTemplate(Target, TP, Pref->Val, 1);
815 void tmplput_CFG_Descr(StrBuf *Target, WCTemplputParams *TP)
817 const char *SettingStr;
818 SettingStr = PrefGetLocalStr(TKEY(0));
819 if (SettingStr != NULL)
820 StrBufAppendBufPlain(Target, SettingStr, -1, 0);
822 void tmplput_CFG_RoomValueLong(StrBuf *Target, WCTemplputParams *TP)
828 defval = GetTemplateTokenNumber(Target, TP, 1, 0);
829 get_ROOM_PREFS_LONG(TKEY(0), &lvalue, defval);
830 StrBufAppendPrintf(Target, "%ld", lvalue);
832 void tmplput_CFG_RoomValue(StrBuf *Target, WCTemplputParams *TP)
834 StrBuf *pref = get_ROOM_PREFS(TKEY(0));
836 StrBufAppendBuf(Target, pref, 0);
838 int ConditionalHasRoomPreference(StrBuf *Target, WCTemplputParams *TP)
840 if (get_ROOM_PREFS(TP->Tokens->Params[0]->Start,
841 TP->Tokens->Params[0]->len) != NULL)
847 int ConditionalPreference(StrBuf *Target, WCTemplputParams *TP)
851 if (!get_PREFERENCE(TKEY(2), &Pref))
854 if (!HAVE_PARAM(3)) {
857 else if (TP->Tokens->Params[3]->Type == TYPE_STR)
858 return ((TP->Tokens->Params[3]->len == StrLength(Pref)) &&
859 (strcmp(TP->Tokens->Params[3]->Start, ChrPtr(Pref)) == 0));
861 return (StrTol(Pref) == TP->Tokens->Params[3]->lvalue);
864 int ConditionalHasPreference(StrBuf *Target, WCTemplputParams *TP)
868 if (!get_PREFERENCE(TKEY(2), &Pref) ||
876 /********************************************************************************
877 * preferences stored discrete in citserver
878 ********************************************************************************/
879 HashList *GetGVEAHash(StrBuf *Target, WCTemplputParams *TP)
882 HashList *List = NULL;
889 StrBuf_ServGetln(Rcp);
890 if (GetServerStatus(Rcp, NULL) == 1) {
892 List = NewHash(1, NULL);
893 while (!Done && (StrBuf_ServGetln(Rcp)>=0)) {
894 if ( (StrLength(Rcp)==3) &&
895 !strcmp(ChrPtr(Rcp), "000"))
900 i = snprintf(N, sizeof(N), "%d", n);
902 Put(List, N, i, Rcp, HFreeStrBuf);
911 void DeleteGVEAHash(HashList **KillMe)
916 HashList *GetGVSNHash(StrBuf *Target, WCTemplputParams *TP)
919 HashList *List = NULL;
926 StrBuf_ServGetln(Rcp);
927 if (GetServerStatus(Rcp, NULL) == 1) {
929 List = NewHash(1, NULL);
930 while (!Done && (StrBuf_ServGetln(Rcp)>=0)) {
931 if ( (StrLength(Rcp)==3) &&
932 !strcmp(ChrPtr(Rcp), "000"))
937 i = snprintf(N, sizeof(N), "%d", n);
939 Put(List, N, i, Rcp, HFreeStrBuf);
948 void DeleteGVSNHash(HashList **KillMe)
957 * Offer to make any page the user's "start page."
959 void offer_start_page(StrBuf *Target, WCTemplputParams *TP)
961 wc_printf("<a href=\"change_start_page?startpage=");
962 urlescputs(ChrPtr(WC->Hdr->this_page));
964 wc_printf(_("Make this my start page"));
970 * Change the user's start page
972 void change_start_page(void)
974 if (!havebstr("startpage")) {
975 set_preference_backend(HKEY("startpage"),
977 NewStrBufPlain(HKEY("")),
981 safestrncpy(WC->ImportantMessage,
982 _("You no longer have a start page selected."),
983 sizeof( WC->ImportantMessage));
988 set_preference_backend(HKEY("startpage"),
990 NewStrBufDup(sbstr("startpage")),
995 output_headers(1, 1, 0, 0, 0, 0);
996 do_template("newstartpage", NULL);
1001 void LoadStartpage(StrBuf *URL, long lvalue)
1004 pch = strchr(ChrPtr(URL), '?');
1006 /* purge the sins of the past... */
1007 pch = strchr(ChrPtr(URL), '&');
1009 StrBufPeek(URL, pch, -1, '?');
1010 WC->SavePrefsToServer = 1;
1017 InitModule_PREFERENCES
1020 WebcitAddUrlHandler(HKEY("set_preferences"), "", 0, set_preferences, 0);
1021 WebcitAddUrlHandler(HKEY("change_start_page"), "", 0, change_start_page, 0);
1023 RegisterPreference("startpage", _("Prefered startpage"), PRF_STRING, LoadStartpage);
1025 RegisterNamespace("OFFERSTARTPAGE", 0, 0, offer_start_page, NULL, CTX_NONE);
1026 RegisterNamespace("PREF:ROOM:VALUE", 1, 2, tmplput_CFG_RoomValue, NULL, CTX_NONE);
1027 RegisterNamespace("PREF:ROOM:VALUE:INT", 1, 2, tmplput_CFG_RoomValueLong, NULL, CTX_NONE);
1028 RegisterNamespace("PREF:VALUE", 1, 2, tmplput_CFG_Value, NULL, CTX_NONE);
1030 RegisterNamespace("PREF:DESCR", 1, 1, tmplput_CFG_Descr, NULL, CTX_NONE);
1032 RegisterConditional(HKEY("COND:PREF"), 4, ConditionalPreference, CTX_NONE);
1033 RegisterConditional(HKEY("COND:PREF:SET"), 4, ConditionalHasPreference, CTX_NONE);
1034 RegisterConditional(HKEY("COND:ROOM:SET"), 4, ConditionalHasRoomPreference, CTX_NONE);
1036 RegisterIterator("PREF:VALID:EMAIL:ADDR", 0, NULL,
1037 GetGVEAHash, NULL, DeleteGVEAHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
1038 RegisterIterator("PREF:VALID:EMAIL:NAME", 0, NULL,
1039 GetGVSNHash, NULL, DeleteGVSNHash, CTX_STRBUF, CTX_NONE, IT_NOFLAG);
1045 ServerStartModule_PREFERENCES
1048 PreferenceHooks = NewHash(1, NULL);
1054 ServerShutdownModule_PREFERENCES
1057 DeleteHash(&PreferenceHooks);
1061 SessionDetachModule__PREFERENCES
1064 if (sess->SavePrefsToServer) {
1066 sess->SavePrefsToServer = 0;
1071 SessionNewModule_PREFERENCES
1074 sess->hash_prefs = NewHash(1,NULL);
1078 SessionDestroyModule_PREFERENCES
1081 DeleteHash(&sess->hash_prefs);