summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-05-22 14:52:11 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2010-05-22 14:52:11 +0800
commit64257dad0e1775b281e6d2086c58ab92256de536 (patch)
tree99ea7cc2bab48ee084cc71b5a4aff612daf740f5
parent16877444d0a1a2106159aab31a089ebc5e54cf39 (diff)
downloadpttbbs-64257dad0e1775b281e6d2086c58ab92256de536.tar
pttbbs-64257dad0e1775b281e6d2086c58ab92256de536.tar.gz
pttbbs-64257dad0e1775b281e6d2086c58ab92256de536.tar.bz2
pttbbs-64257dad0e1775b281e6d2086c58ab92256de536.tar.lz
pttbbs-64257dad0e1775b281e6d2086c58ab92256de536.tar.xz
pttbbs-64257dad0e1775b281e6d2086c58ab92256de536.tar.zst
pttbbs-64257dad0e1775b281e6d2086c58ab92256de536.zip
* add AID to cross-post articles (idea by sunev@PttSuggest)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5048 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/mbbsd/bbs.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c
index c0228392..7fe3f5fe 100644
--- a/pttbbs/mbbsd/bbs.c
+++ b/pttbbs/mbbsd/bbs.c
@@ -1885,7 +1885,20 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct)
b_suckinfile_invis(xptr, fname, currboard);
} else {
/* public board */
- fprintf(xptr, "※ [本文轉錄自 %s 看板]\n\n", currboard);
+ // XXX we should add some string length checks here.
+ // maybe someday we will define the standard aidc length
+ // and helper functions to create aidc string with prefixes.
+ aidu_t aidu = 0;
+ char aidc[32] = {0};
+
+ aidu = fn2aidu((char *)fhdr->filename);
+ if (aidu > 0) {
+ aidc[0] = ' '; aidc[1] = '#';
+ aidu2aidc(aidc + strlen(aidc), aidu);
+ // add trailing space
+ strcat(aidc, " ");
+ }
+ fprintf(xptr, "※ [本文轉錄自 %s 看板%s]\n\n", currboard, aidc);
b_suckinfile(xptr, fname);
}