From 8cd12bafdff1bc683dda7906c66a5b716734459a Mon Sep 17 00:00:00 2001 From: piaip Date: Fri, 8 Feb 2008 02:17:08 +0000 Subject: - bbs: isolate edflags determination git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3905 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 24173cac..91eaa393 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -729,6 +729,24 @@ delete_allpost(const char *userid) /* ----------------------------------------------------- */ /* 發表、回應、編輯、轉錄文章 */ /* ----------------------------------------------------- */ +static int +solveEdFlagByBoard(const char *bn, int flags) +{ + if ( +#ifdef GLOBAL_BBSMOVIE + strcmp(bn, GLOBAL_BBSMOVIE) == 0 || +#endif +#ifdef GLOBAL_TEST + strcmp(bn, GLOBAL_TEST) == 0 || +#endif + 0 + ) + { + flags |= EDITFLAG_UPLOAD | EDITFLAG_ALLOWLARGE; + } + return flags; +} + void do_reply_title(int row, const char *title) { @@ -972,13 +990,7 @@ do_general(int isbid) Copy(genbuf, fpath); } -# ifdef GLOBAL_BBSMOVIE - if (strcmp(currboard, GLOBAL_BBSMOVIE) == 0) - { - edflags |= EDITFLAG_UPLOAD; - edflags |= EDITFLAG_ALLOWLARGE; - } -# endif // GLOBAL_BBSMOVIE + edflags = solveEdFlagByBoard(currboard, edflags); aborted = vedit2(fpath, YEA, &islocal, edflags); if (aborted == -1) { @@ -1409,13 +1421,7 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct) (int)now, ctime4(&now), getpid(), cuser.userid, fpath); } -# ifdef GLOBAL_BBSMOVIE - if (strcmp(bp->brdname, GLOBAL_BBSMOVIE) == 0) - { - edflags |= EDITFLAG_UPLOAD; - edflags |= EDITFLAG_ALLOWLARGE; - } -# endif // GLOBAL_BBSMOVIE + edflags = solveEdFlagByBoard(bp->brdname, edflags); setutmpmode(REEDIT); -- cgit v1.2.3