summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-02 01:16:40 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-02 01:16:40 +0800
commit66ee743546b6f92581c145adbc3a177d8e6308a1 (patch)
tree576cc712ae4c353ef2846ed4703ef3254b479625 /mbbsd/edit.c
parent3c09964ade10e63444315ed08a63b92496d6d46b (diff)
downloadpttbbs-66ee743546b6f92581c145adbc3a177d8e6308a1.tar
pttbbs-66ee743546b6f92581c145adbc3a177d8e6308a1.tar.gz
pttbbs-66ee743546b6f92581c145adbc3a177d8e6308a1.tar.bz2
pttbbs-66ee743546b6f92581c145adbc3a177d8e6308a1.tar.lz
pttbbs-66ee743546b6f92581c145adbc3a177d8e6308a1.tar.xz
pttbbs-66ee743546b6f92581c145adbc3a177d8e6308a1.tar.zst
pttbbs-66ee743546b6f92581c145adbc3a177d8e6308a1.zip
- angel_anon: improve auto nicks [dirty hack]
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4060 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r--mbbsd/edit.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 76915401..97121d14 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1468,6 +1468,33 @@ write_header(FILE * fp, char *mytitle) // FIXME unused
#ifdef HAVE_ANONYMOUS
if (currbrdattr & BRD_ANONYMOUS) {
int defanony = (currbrdattr & BRD_DEFAULTANONYMOUS);
+
+#if defined(PLAY_ANGEL) && defined(BN_ANGELPRAY)
+ // dirty hack here... sorry
+ if (HasUserPerm(PERM_ANGEL) && currboard
+ && strcmp(currboard, BN_ANGELPRAY) == 0)
+ {
+ FILE *fpx = NULL;
+ char xbuf[PATHLEN];
+ // try to load angel nick. sorry, dirty code again...
+ // ref: talk.c, AngelNotOnline.
+ setuserfile(xbuf, "angelmsg");
+ fpx = fopen(xbuf, "rt");
+ if (!fpx || !fgets(xbuf, sizeof(xbuf), fpx) ||
+ strncmp(xbuf, "%%[", 3))
+ {
+ strcpy(xbuf+3, "小天使");
+ }
+ else
+ {
+ chomp(xbuf);
+ strlcat(xbuf, "天使", sizeof(xbuf));
+ }
+ if (fpx) fclose(fpx);
+ getdata_str(3, 0, "請輸入想用的名字(輸入[r]為真名): ",
+ real_name, sizeof(real_name), DOECHO, xbuf+3);
+ } else
+#endif // PLAY_ANGEL && BN_ANGELPRAY
if (defanony)
getdata(3, 0, "請輸入你想用的ID,也可直接按[Enter],"
"或是按[r]用真名:", real_name, sizeof(real_name), DOECHO);