summaryrefslogtreecommitdiffstats
path: root/mbbsd/friend.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-06 02:49:35 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-04-06 02:49:35 +0800
commit310876bcfc1e4ce6fd184db2136ea746f63961df (patch)
treecd4de4cad09d8d79e7afc1122c26dfb1d17a9c40 /mbbsd/friend.c
parentdda46228c07f8721077adb4c1df845b01190087c (diff)
downloadpttbbs-310876bcfc1e4ce6fd184db2136ea746f63961df.tar
pttbbs-310876bcfc1e4ce6fd184db2136ea746f63961df.tar.gz
pttbbs-310876bcfc1e4ce6fd184db2136ea746f63961df.tar.bz2
pttbbs-310876bcfc1e4ce6fd184db2136ea746f63961df.tar.lz
pttbbs-310876bcfc1e4ce6fd184db2136ea746f63961df.tar.xz
pttbbs-310876bcfc1e4ce6fd184db2136ea746f63961df.tar.zst
pttbbs-310876bcfc1e4ce6fd184db2136ea746f63961df.zip
SYSOP/BM could export board-friend list
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@84 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/friend.c')
-rw-r--r--mbbsd/friend.c41
1 files changed, 25 insertions, 16 deletions
diff --git a/mbbsd/friend.c b/mbbsd/friend.c
index a51d3000..d87c4bc9 100644
--- a/mbbsd/friend.c
+++ b/mbbsd/friend.c
@@ -1,4 +1,4 @@
-/* $Id: friend.c,v 1.2 2002/03/09 10:34:58 in2 Exp $ */
+/* $Id: friend.c,v 1.3 2002/04/05 18:49:35 in2 Exp $ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -10,7 +10,10 @@
#include "common.h"
#include "perm.h"
#include "proto.h"
+#include "modes.h"
+extern userec_t cuser;
+extern int currmode;
extern char currboard[]; /* name of currently selected board */
extern char *fn_overrides;
extern userinfo_t *currutmp;
@@ -178,30 +181,36 @@ static void friend_append(int type, int count) {
move(2, 0);
clrtobot();
outs("要引入哪一個名單?\n");
- for (i = 0, j = 0; i <= 7; i++)
- {
- if (i == type)
- continue;
- j++;
- if (i <= 4)
- sprintf(buf, " (%d) %-s\n", j, friend_list[(int) i]);
- else
- sprintf(buf, " (%d) %s 版的 %s\n", j, currboard,
- friend_list[(int) i]);
- outs(buf);
- }
+ for (j = i = 0; i <= 4; i++)
+ if( i != type ){
+ ++j;
+ sprintf(buf, " (%d) %-s\n", i + 1, friend_list[(int) i]);
+ outs(buf);
+ }
+
+ if( HAVE_PERM(PERM_SYSOP) || currmode & MODE_BOARD )
+ for( ; i < 8 ; ++i )
+ if( i != type ){
+ ++j;
+ sprintf(buf, " (%d) %s 版的 %s\n", j, currboard,
+ friend_list[(int) i]);
+ outs(buf);
+ }
+
outs(" (S) 選擇其他看板的特別名單");
getdata(11, 0, "請選擇 或 直接[Enter] 放棄:", buf, 3, LCECHO);
if (!buf[0])
return;
if (buf[0] == 's')
Select();
+ j = buf[0] - '1';
+ if (j >= type)
+ j++;
+ if( !(HAVE_PERM(PERM_SYSOP) || currmode & MODE_BOARD) && j >= 4 )
+ return;
}
while (buf[0] < '1' || buf[0] > '9');
- j = buf[0] - '1';
- if (j >= type)
- j++;
if (j == FRIEND_SPECIAL)
friend_special();