From cc00bcfda5fb94058057eb3d3cc39867fe86cda7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Mon, 16 Aug 2010 22:45:06 +0000 Subject: [PATCH] * GetNetConfigHash(): fix some edge cases * folder: add another pointer for the notnull, there is a 0 in that enum * SetCurrentRoomFlags(): debug output the flags before saving them * room/edit/tab_listserv: reorder list, so it doesn't look that funny with the subscription URL. --- webcit/roomlist.c | 19 ++++++++++----- webcit/roomops.c | 3 +++ webcit/roomops.h | 2 +- .../t/room/edit/digestrecp_removal.html | 2 +- .../static/t/room/edit/listrecp_removal.html | 2 +- webcit/static/t/room/edit/tab_listserv.html | 24 ++++++++++--------- 6 files changed, 32 insertions(+), 20 deletions(-) diff --git a/webcit/roomlist.c b/webcit/roomlist.c index 0a8e7fb9d..ec6ef5924 100644 --- a/webcit/roomlist.c +++ b/webcit/roomlist.c @@ -291,13 +291,13 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP) long PutTo; long State; - WantThisOne = GetTemplateTokenNumber(Target, TP, 5, 0); - if (WantThisOne == 0) + WantThisOne = GetTemplateTokenNumber(Target, TP, 5, -1); + if ((WantThisOne < 0) || (WantThisOne > maxRoomNetCfg)) return NULL; - if (WCC->CurRoom.IgnetCfgs[0] == (HashList*) StrBufNOTNULL) + if (WCC->CurRoom.IgnetCfgs[maxRoomNetCfg] == (HashList*) StrBufNOTNULL) return WCC->CurRoom.IgnetCfgs[WantThisOne]; - WCC->CurRoom.IgnetCfgs[0] = (HashList*) StrBufNOTNULL; + WCC->CurRoom.IgnetCfgs[maxRoomNetCfg] = (HashList*) StrBufNOTNULL; serv_puts("GNET"); Line = NewStrBuf(); Token = NewStrBuf(); @@ -308,7 +308,7 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP) StrBuf_ServGetln(Line); StrBufExtract_NextToken(Token, Line, &Pos, '|'); PutTo = GetTokenDefine(SKEY(Token), -1); - if ((PutTo > 0) && + if ((PutTo >= 0) && (PutTo < maxRoomNetCfg) && (Pos != StrBufNOTNULL)) { @@ -316,13 +316,20 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP) HashList *SubH; if (WCC->CurRoom.IgnetCfgs[PutTo] == NULL) + { + n = 0; WCC->CurRoom.IgnetCfgs[PutTo] = NewHash(1, NULL); + } + else + { + n = GetCount(WCC->CurRoom.IgnetCfgs[PutTo]); + } SubH = NewHash(1, NULL); - n = GetCount(WCC->CurRoom.IgnetCfgs[PutTo]) + 1; Put(WCC->CurRoom.IgnetCfgs[PutTo], IKEY(n), SubH, HDeleteHash); + n = 0; while (Pos != StrBufNOTNULL) { Content = NewStrBuf(); StrBufExtract_NextToken(Content, Line, &Pos, '|'); diff --git a/webcit/roomops.c b/webcit/roomops.c index 04e251dff..0f1e8637b 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -706,6 +706,9 @@ int SetCurrentRoomFlags(folder *Room) StrBuf *Buf; Buf = NewStrBuf(); + DBG_QR(Room->QRFlags); + DBG_QR2(Room->QRFlags2); + serv_printf("SETR %s|%s|%s|%ld|%d|%d|%ld|%ld|%ld", ChrPtr(Room->name), ChrPtr(Room->XAPass), diff --git a/webcit/roomops.h b/webcit/roomops.h index 0917a41d4..4f82fa373 100644 --- a/webcit/roomops.h +++ b/webcit/roomops.h @@ -104,7 +104,7 @@ typedef struct _folder { int BumpUsers; /* if SETR set to 1 to make all users who knew this room to forget about it. */ - HashList *IgnetCfgs[maxRoomNetCfg]; + HashList *IgnetCfgs[maxRoomNetCfg + 1]; }folder; HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP); diff --git a/webcit/static/t/room/edit/digestrecp_removal.html b/webcit/static/t/room/edit/digestrecp_removal.html index d77ee7542..45280107a 100644 --- a/webcit/static/t/room/edit/digestrecp_removal.html +++ b/webcit/static/t/room/edit/digestrecp_removal.html @@ -1 +1 @@ -">
+">
diff --git a/webcit/static/t/room/edit/listrecp_removal.html b/webcit/static/t/room/edit/listrecp_removal.html index 0072069bd..8e35a9d2a 100644 --- a/webcit/static/t/room/edit/listrecp_removal.html +++ b/webcit/static/t/room/edit/listrecp_removal.html @@ -1 +1 @@ -">
+">
diff --git a/webcit/static/t/room/edit/tab_listserv.html b/webcit/static/t/room/edit/tab_listserv.html index d76df96f9..749586551 100644 --- a/webcit/static/t/room/edit/tab_listserv.html +++ b/webcit/static/t/room/edit/tab_listserv.html @@ -42,18 +42,7 @@
- - - - - - - - @@ -65,6 +54,19 @@ + + + + + + + + + +
/>
- - :///listsub -
/>
/>
+ + :///listsub +
-- 2.30.2