projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c434c19
)
* done should be initialized...
author
Wilfried Göesgens
<willi@citadel.org>
Tue, 5 May 2009 22:03:10 +0000
(22:03 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Tue, 5 May 2009 22:03:10 +0000
(22:03 +0000)
webcit/preferences.c
patch
|
blob
|
history
diff --git
a/webcit/preferences.c
b/webcit/preferences.c
index 1ea2dac99ce3faffad773ee8285fed0d31965a44..3ee036cba47f78712059b2a23de752ad7a4ee561 100644
(file)
--- a/
webcit/preferences.c
+++ b/
webcit/preferences.c
@@
-196,6
+196,7
@@
void ParsePref(HashList **List, StrBuf *ReadBuf)
*/
void load_preferences(void)
{
*/
void load_preferences(void)
{
+ wcsession *WCC = WC;
int Done = 0;
StrBuf *ReadBuf;
long msgnum = 0L;
int Done = 0;
StrBuf *ReadBuf;
long msgnum = 0L;
@@
-231,15
+232,17
@@
void load_preferences(void)
strcmp(ChrPtr(ReadBuf), "000"))) {
}
if (!strcmp(ChrPtr(ReadBuf), "text")) {
strcmp(ChrPtr(ReadBuf), "000"))) {
}
if (!strcmp(ChrPtr(ReadBuf), "text")) {
- ParsePref(&WC->hash_prefs, ReadBuf);
+ ParsePref(&WC
C
->hash_prefs, ReadBuf);
}
}
}
/* Go back to the room we're supposed to be in */
}
}
}
/* Go back to the room we're supposed to be in */
- serv_printf("GOTO %s", ChrPtr(WC->wc_roomname));
- StrBuf_ServGetln(ReadBuf);
- GetServerStatus(ReadBuf, NULL);
+ if (StrLength(WCC->wc_roomname) > 0) {
+ serv_printf("GOTO %s", ChrPtr(WCC->wc_roomname));
+ StrBuf_ServGetln(ReadBuf);
+ GetServerStatus(ReadBuf, NULL);
+ }
FreeStrBuf(&ReadBuf);
}
FreeStrBuf(&ReadBuf);
}
@@
-266,6
+269,7
@@
int goto_config_room(StrBuf *Buf)
void WritePrefsToServer(HashList *Hash)
{
void WritePrefsToServer(HashList *Hash)
{
+ wcsession *WCC = WC;
long len;
HashPos *HashPos;
void *vPref;
long len;
HashPos *HashPos;
void *vPref;
@@
-273,7
+277,7
@@
void WritePrefsToServer(HashList *Hash)
Preference *Pref;
StrBuf *SubBuf = NULL;
Preference *Pref;
StrBuf *SubBuf = NULL;
- Hash = WC->hash_prefs;
+ Hash = WC
C
->hash_prefs;
#ifdef DBG_PREFS_HASH
dbg_PrintHash(Hash, PrintPref, NULL);
#endif
#ifdef DBG_PREFS_HASH
dbg_PrintHash(Hash, PrintPref, NULL);
#endif
@@
-324,7
+328,8
@@
void WritePrefsToServer(HashList *Hash)
*/
void save_preferences(void)
{
*/
void save_preferences(void)
{
- int Done;
+ wcsession *WCC = WC;
+ int Done = 0;
StrBuf *ReadBuf;
long msgnum = 0L;
StrBuf *ReadBuf;
long msgnum = 0L;
@@
-359,14
+364,17
@@
void save_preferences(void)
StrBuf_ServGetln(ReadBuf);
if (GetServerStatus(ReadBuf, NULL) == 4) {
StrBuf_ServGetln(ReadBuf);
if (GetServerStatus(ReadBuf, NULL) == 4) {
- WritePrefsToServer(WC->hash_prefs);
+ WritePrefsToServer(WC
C
->hash_prefs);
serv_puts("");
serv_puts("000");
}
/** Go back to the room we're supposed to be in */
serv_puts("");
serv_puts("000");
}
/** Go back to the room we're supposed to be in */
- serv_printf("GOTO %s", ChrPtr(WC->wc_roomname));
- StrBuf_ServGetln(ReadBuf);
+ if (StrLength(WCC->wc_roomname) > 0) {
+ serv_printf("GOTO %s", ChrPtr(WCC->wc_roomname));
+ StrBuf_ServGetln(ReadBuf);
+ GetServerStatus(ReadBuf, NULL);
+ }
FreeStrBuf(&ReadBuf);
}
FreeStrBuf(&ReadBuf);
}
@@
-421,6
+429,7
@@
void set_preference_backend(const char *key, size_t keylen,
int save_to_server,
PrefDef *PrefType)
{
int save_to_server,
PrefDef *PrefType)
{
+ wcsession *WCC = WC;
void *vPrefDef;
Preference *Pref;
void *vPrefDef;
Preference *Pref;
@@
-502,9
+511,9
@@
void set_preference_backend(const char *key, size_t keylen,
break;
}
}
break;
}
}
- Put(WC->hash_prefs, key, keylen, Pref, DestroyPreference);
+ Put(WC
C
->hash_prefs, key, keylen, Pref, DestroyPreference);
- if (save_to_server) WC->SavePrefsToServer = 1;
+ if (save_to_server) WC
C
->SavePrefsToServer = 1;
}
void set_PREFERENCE(const char *key, size_t keylen, StrBuf *value, int save_to_server)
}
void set_PREFERENCE(const char *key, size_t keylen, StrBuf *value, int save_to_server)