summaryrefslogtreecommitdiffstats
path: root/mbbsd/bbs.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-24 18:30:13 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2009-08-24 18:30:13 +0800
commit0e040b10e38aee0c0136732f74a3e8bd988b50e5 (patch)
treeefc7069498d36a7421ac182744b7fa37c25bfc9d /mbbsd/bbs.c
parentcf48cef8c049e57e529981d0b6ad7a811f7ded37 (diff)
downloadpttbbs-0e040b10e38aee0c0136732f74a3e8bd988b50e5.tar
pttbbs-0e040b10e38aee0c0136732f74a3e8bd988b50e5.tar.gz
pttbbs-0e040b10e38aee0c0136732f74a3e8bd988b50e5.tar.bz2
pttbbs-0e040b10e38aee0c0136732f74a3e8bd988b50e5.tar.lz
pttbbs-0e040b10e38aee0c0136732f74a3e8bd988b50e5.tar.xz
pttbbs-0e040b10e38aee0c0136732f74a3e8bd988b50e5.tar.zst
pttbbs-0e040b10e38aee0c0136732f74a3e8bd988b50e5.zip
* simplify the delete message input ui
* seems leaving whole string for user editing is more flexible. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4769 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/bbs.c')
-rw-r--r--mbbsd/bbs.c48
1 files changed, 10 insertions, 38 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 07d46c86..852ccde3 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -2962,57 +2962,29 @@ del_post(int ent, fileheader_t * fhdr, char *direct)
{
// manager (bm, sysop, police)
do {
- char oreason[PROPER_TITLE_LEN];
- int keep_cuserid = 0;
- const char *pat_withuid = "(已被%s刪除: %s) <%s>",
- *pat_anon = "(已被刪除: %s) <%s>";
- int pat_withuid_modlen = 2*3, // length caused by %s
- pat_anon_modlen = 2*2;
-
getdata(1, 0, "請確定刪除(Y/N/R加註理由)?[N]", genbuf, 3, LCECHO);
// for y/n, skip.
if (genbuf[0] != 'r')
break;
- // query anonymous
- // XXX allow only if HasUserPerm(PERM_POLICE | PERM_POLICE_MAN | PERM_SYSOP) ?
- move(3,0); clrtoeol();
- getdata(2, 0, "要留下您的 ID 嗎(Y/N)?[N]", genbuf, 3, LCECHO);
- if (genbuf[0] == 'y')
- keep_cuserid = 1;
-
- // input reason
- move(4,0); clrtoeol();
- getdata(3, 0, "理由: ", oreason,
- sizeof(oreason) - strlen(fhdr->owner) -
- (keep_cuserid ? strlen(pat_withuid)-pat_withuid_modlen:
- strlen(pat_anon) -pat_anon_modlen) -
- (keep_cuserid ? strlen(cuser.userid) : 0),
- DOECHO);
-
- if (!oreason[0])
+ // build reason string (based on STR_SAFEDEL_TITLE)
+ snprintf(reason, sizeof(reason), "(已被%s刪除) <%s>",
+ cuser.userid, fhdr->owner);
+ move(3, 0); clrtoeol();
+ getdata_str(2, 0, " >> 請輸入刪除後要顯示的標題: ■ ",
+ reason, sizeof(reason), DOECHO, reason);
+
+ if (!reason[0])
{
vmsg("未輸入理由,放棄刪除。");
genbuf[0] = 'n';
break;
}
- // build reason string (based on STR_SAFEDEL_TITLE)
- if (keep_cuserid)
- {
- snprintf(reason, sizeof(reason),
- pat_withuid, cuser.userid, oreason, fhdr->owner);
- } else {
- snprintf(reason, sizeof(reason),
- pat_anon, oreason, fhdr->owner);
- }
-
// confirm again!
- move(3, 0); clrtoeol(); prints("將會顯示為: " ANSI_COLOR(1)
- "%s" ANSI_RESET "\n", reason);
- move(5, 0); clrtoeol();
- getdata(4, 0, "請再次確定是否要用上述理由刪除(Y/N)?[N]",
+ move(4, 0); clrtoeol();
+ getdata(3, 0, "請再次確定是否要用上述理由刪除(Y/N)?[N]",
genbuf, 3, LCECHO);
// since the default y/n is same to msg_del_ny, we reuse the genbuf[0] here.