summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-11-17 08:12:33 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-11-17 08:12:33 +0800
commita9931c0e255ef0e37c4f2149b65c09636d56ec2b (patch)
treef841a284e9880d46acb85c7610cde6fbb1c5de81 /mbbsd
parent97b26dd92cdd0f51051dd2762c2584db77273191 (diff)
downloadpttbbs-a9931c0e255ef0e37c4f2149b65c09636d56ec2b.tar
pttbbs-a9931c0e255ef0e37c4f2149b65c09636d56ec2b.tar.gz
pttbbs-a9931c0e255ef0e37c4f2149b65c09636d56ec2b.tar.bz2
pttbbs-a9931c0e255ef0e37c4f2149b65c09636d56ec2b.tar.lz
pttbbs-a9931c0e255ef0e37c4f2149b65c09636d56ec2b.tar.xz
pttbbs-a9931c0e255ef0e37c4f2149b65c09636d56ec2b.tar.zst
pttbbs-a9931c0e255ef0e37c4f2149b65c09636d56ec2b.zip
love paper is still mailing, follow friend/reject rules
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4421 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/lovepaper.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/mbbsd/lovepaper.c b/mbbsd/lovepaper.c
index 3003cdb2..93b3a4db 100644
--- a/mbbsd/lovepaper.c
+++ b/mbbsd/lovepaper.c
@@ -6,6 +6,7 @@ int
x_love(void)
{
char buf1[200], title[TTLEN + 1];
+ char fpath[PATHLEN];
char receiver[61], path[STRLEN] = "home/";
int x, y = 0, tline = 0, poem = 0;
FILE *fp, *fpo;
@@ -96,15 +97,22 @@ x_love(void)
return -2;
}
curredit &= ~EDIT_MAIL;
- sethomepath(buf1, receiver);
- stampfile(buf1, &mhdr);
- Rename(path, buf1);
- strlcpy(mhdr.title, save_title, sizeof(mhdr.title));
- strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner));
- sethomedir(path, receiver);
- if (append_record(path, &mhdr, sizeof(mhdr)) == -1)
- return -1;
- sendalert(receiver, ALERT_NEW_MAIL);
+
+ sethomefile(fpath, receiver, FN_OVERRIDES);
+ x = file_exist_record(fpath, cuser.userid);
+ sethomefile(fpath, receiver, FN_REJECT);
+
+ if (x || !file_exist_record(fpath, cuser.userid)) {/* if friend or not rejected */
+ sethomepath(buf1, receiver);
+ stampfile(buf1, &mhdr);
+ Rename(path, buf1);
+ strlcpy(mhdr.title, save_title, sizeof(mhdr.title));
+ strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner));
+ sethomedir(path, receiver);
+ if (append_record(path, &mhdr, sizeof(mhdr)) == -1)
+ return -1;
+ sendalert(receiver, ALERT_NEW_MAIL);
+ }
hold_mail(buf1, receiver);
return 1;
} else {