Posted By: Tuttle (MamPoLetechJinyUsername!) on 'CZbbs'
Title: Re: CZHardware full!
Date: Tue May 16 23:38:21 2006
> a nepodarilo se mi postnout takovou dlouhou reply :(
Neni to poprve, kdy lidi diky blbosti BBSky, kdy se zaplnenost boardu
kontroluje po a ne PRED postovanim, prisli o (nezridka dlouhy text).
Odhledneme od zastaraleho blbeho navrhu s omezenim poctu prispevku na 2048.
Pred lety jsem chtel temto neprijemnostem zabranit a dolepil jsem do
Piskoviste ochranu. Doporucuji ji spravcum nasadit na Liane. Lidi nebudou tak
nastvani.
Patch nepujde zrejme aplikovat primo, zdrojaky jsou trochu jine. Gro v tom
vsak je videt.
diff -bB -U15 -r 20031102/c_post.c 20031218/c_post.c
--- 20031102/c_post.c 2002-12-07 19:03:17.000000000 +0100
+++ 20031218/c_post.c 2003-12-18 13:04:51.000000000 +0100
@@ -99,30 +99,43 @@
+//tuttle: Dec 2003
+int board_is_full(char *boardname)
+{
+ BOARD board;
+ READINFO rinfo;
+
+ strcpy(board.name, boardname);
+ get_bitfile_ent(board.name, &rinfo);
+ if (!do_cache_count(&board, &rinfo)) _board_count(&board, &rinfo);
+
+ return (board.totalposts >= BBS_MAX_FILES);
+}
+
@@ -200,30 +213,38 @@
GenericPost(docheck)
int docheck;
{
int rc;
LONG retcode = FULLUPDATE;
TITLE subject;
char scrtitle[85];
sprintf(scrtitle, " Posting on board %s", currboard);
clear();
+
+ if (board_is_full(currboard)) {
+ prints("Board %s is currently full, no further posting possible.nn
+Please contact sysops or room aides.n", currboard);
+ pressreturn();
+ return FULLUPDATE;
+ }
+
if (docheck) {
SHORT flags;
if (currboard[0] == ' prints("Use (S)elect to select a board first.n");
pressreturn();
return FULLUPDATE;
}
if (bbs_test_board(currboard, &flags) != S_OK) {
prints("Can't access the '%s' board!n", currboard);
pressreturn();
return FULLUPDATE;
}
if (!BITISSET(flags, OPEN_POST)) {
prints("Posting on the '%s' board is restricted.n", currboard);
pressreturn();
@@ -325,30 +346,37 @@
GenericPostReply(hptr, msgsrc)
HEADER *hptr;
char *msgsrc;
{
TITLE subject;
char ans[4];
int rc, retcode = FULLUPDATE;
PATH msgfile;
char scrtitle[85];
sprintf(scrtitle, " Posting followup on board %s", currboard);
clear();
+ if (board_is_full(currboard)) {
+ prints("Board %s is currently full, no further posting possible.nn
+Please contact sysops or room aides.n", currboard);
+ pressreturn();
+ return FULLUPDATE;
+ }
+
if (msgsrc == NULL) {
if (bbs_read_message(hptr->fileid, msgfile) != S_OK) {
prints("Can't get the message to followup to!n");
return retcode;
}
}
else strcpy(msgfile, msgsrc);
bbs_set_mode(M_POSTING);
// subj block taken from here (moved to after edit)
if (strncasecmp (hptr->title, "Re:", 3))
{
strcpy (subject, "Re: ");
---
T.