-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMSGMENU.C
162 lines (150 loc) · 3.58 KB
/
MSGMENU.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#include <stdio.h>
#include <ctype.h>
#include <bbs.h>
#include <mail.h>
/* Message area menu. */
msg_menu(s)
char *s;
{
char ln[80];
char path[80],cmd,*p;
int n;
#define MAIL (sys-> attrib & SYSMAIL)
system(0,msgnum); /* read system file, */
if (!mail_checked[msgnum]) {
mprintf("Msg Area #%u: %s %s\r\n",
msgnum,sys-> msgpath,(MAIL ? "(FidoNet)" : ""));
chk_mail(s); /* area, check for mail, */
mail_checked[msgnum]= 1; /* dont do every time. */
}
while (1) {
abort= 0;
line= 0;
mprintf("\r\n");
stoupper(sys-> msgpath);
mprintf("Msg Area #%u: %s %s\r\n",
msgnum,sys-> msgpath,(MAIL ? "(FidoNet)" : ""));
if (user-> help > REGULAR) {
if (MAIL) prompt(&mail_priv,0);
else prompt(&msg_priv,0);
mprintf("\r\n");
}
if (user-> help > EXPERT) {
if (MAIL) {
mprintf("Mail: "); prompt(&mail_priv,1);
} else {
mprintf("Msg: "); prompt(&msg_priv,1);
}
mprintf("or ? for help: ");
} else
if (MAIL) mprintf("Mail Command: ");
else mprintf("Msg Command: ");
getstring(ln);
mprintf("\r\n\r\n");
p= skip_delim(ln);
if (num_args(p) < 1) continue;
stolower(p);
cmd= *p++;
p= skip_delim(p);
p= strip_path(path,p);
/* We test for sysop-only commands for safety. If the privelege table files
are in an accessible area, it is possible for a knowledgeable idiot to
change them. They still wont get sysop commands. Note that this assumes
that all user commands are not numeric. */
if (is_cmd(cmd,&msg_priv) || (cmd == '?') || (isdigit(cmd) && (user-> priv >= SYSOP))) {
switch(cmd) {
case 'a':
if (isdigit(*p)) n= atoi(p);
else (n= -1);
if (msgsel(n)) {
if (!mail_checked[msgnum]) {
if (*p) p= skip_delim(++p);
chk_mail(p);
mail_checked[msgnum]= 1;
}
}
break;
case 'i':
mfind(p);
break;
case 'k':
mkill(p);
break;
case 'l':
mlist(p);
break;
case 'r':
mread(p);
break;
case 'e':
msend("",0,0);
break;
case 'g':
goodbye(p);
break;
case 'm':
return;
break;
case 's':
if (MAIL) {
mprintf("----- FidoNet Stats -----\r\n");
user_credit();
mprintf("\r\n");
mprintf("Available FidoNet Systems:\r\n");
list_nodes();
mprintf("------------------------\r\n");
}
mprintf("%u messages: 1 to %u\r\n",msg_total,msg_highest);
stats();
chk_mail(p);
break;
case '?':
case 'h':
if (MAIL) hlpmsg("mail");
else hlpmsg("msg");
break;
case '1':
lprintf("PATH path= %s p=%s\r\n",path,p);
spath(p,path);
mprintf("Wait ...\r\n");
msgcount();
break;
case '2':
mtest(p);
break;
case '3':
lprintf("SETMSG =%s\r\n",p);
if (MAIL) set_m_msg(p);
else set_msg(p);
break;
case '4':
lprintf("SETMAIL path=%s p=%s\r\n",path,p);
setmail(p,path);
break;
case '5':
list_sched();
break;
case '6':
new_sched();
break;
default:
mprintf("'%c' is not a command\r\n",cmd);
break;
}
} else mprintf("'%c' is not a command\r\n",cmd);
}
}
/* Ask to check messages in this area. */
chk_mail(s)
char *s;
{
char ln[82];
while ((tolower(*s) != 'y') && (tolower(*s) != 'n')) {
if (user-> help > EXPERT) mprintf("Want to check for mail? (y,n): ");
else mprintf("Check mail (y,n): ");
getstring(ln);
mprintf("\r\n");
s= skip_delim(ln);
}
if (tolower(*s) == 'y') listmsgs();
}