Skip to content

Latest commit

 

History

History
244 lines (207 loc) · 6.28 KB

mail3.pas

File metadata and controls

244 lines (207 loc) · 6.28 KB
 
Nov 18, 2000
Nov 18, 2000
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
{$A+,B+,D-,E+,F+,I+,L+,N-,O+,R-,S+,V-}
unit mail3;
interface
uses
crt, dos,
{rcg11172000 no overlay under Linux.}
{overlay,}
common, timejunk, mail0;
function what00(b:byte; s:string):string;
procedure readmsg(style:byte; anum,mnum,tnum:longint; var abort,next:boolean);
implementation
function what00(b:byte; s:string):string;
begin
if (b=0) then
s:=caps(s)
else
case b of
0:s:=caps(s);
1,
2:s:='**Anonymous**';
3:s:='"Abby"';
4:s:='"Problemed Person"';
5:s:=caps(s);
else
s:=allcaps(s);
end;
what00:=s;
end;
{ anum=actual, mnum=M#/t#, tnum=m#/T# }
procedure readmsg(style:byte; anum,mnum,tnum:longint; var abort,next:boolean);
var mhead:mheaderrec;
mixr:msgindexrec;
pdt:packdatetime;
dt:ldatetimerec;
s,s1:string;
brdsig,lng,maxm,totload:longint;
i,numread:word;
done,pub,seeanon,usemci,usereal,isfido:boolean;
procedure getout;
begin
gotlastmheader:=TRUE;
lastmheader:=mhead;
end;
function tnn(lng:longint):string;
var s:string;
begin
if (lng>100) then lng:=lng mod 100; { ex: 1989 --> 89 }
s:=cstr(lng); while (length(s)<2) do s:='0'+s;
tnn:=s;
end;
begin
usereal:=(mbrealname in memboard.mbstat);
isfido:=(memboard.mbtype<>0);
{rcg1117 removed mixr...}
{with mhead,mixr do begin}
with mhead do begin
loadmhead(anum,mhead);
ensureloaded(anum);
mixr:=mintab[getmixnum(anum)];
usemci:=(miallowmci in mixr.msgindexstat);
loadboard(board);
wasyourmsg:=(fromi.usernum=usernum);
pub:=(bread<>-1);
if (pub) then seeanon:=aacs(systat.anonpubread)
else seeanon:=aacs(systat.anonprivread);
if (mhead.fromi.anon=2) then seeanon:=aacs(systat.csop);
abort:=FALSE;
next:=FALSE;
printacr('',abort,next);
s:='Number: '+#3#3+cstr(mnum)+'/'+cstr(tnum);
printacr(s,abort,next);
s:='';
if (not (miexist in mixr.msgindexstat)) then begin
s:='Status: '+#3#8+'Deleted';
if ((not mso) and (not wasyourmsg)) then begin
printacr(s,abort,next);
getout;
exit;
end;
end;
if (miunvalidated in mixr.msgindexstat) then begin
if (s='') then s:='Status:';
s:=s+#3#7+' Not Validated';
if ((not mso) and (not wasyourmsg)) then begin
printacr(s,abort,next);
getout;
exit;
end;
end;
{rcg1117 added mixr...}
{if ((pub) and (mipermanent in msgindexstat)) then begin}
if ((pub) and (mipermanent in mixr.msgindexstat)) then begin
if (s='') then s:='Status:';
s:=s+#3#3+' Permanent';
end;
if (s<>'') then printacr(s,abort,next);
{rcg1117 added mixr...}
{if ((fromi.anon=0) or (seeanon)) then s:=pdt2dat(@msgdate,msgdowk)}
if ((fromi.anon=0) or (seeanon)) then s:=pdt2dat(@mixr.msgdate,mixr.msgdowk)
else s:='***Unknown***';
s:='Date : '+#3#3+s;
if (style=4) then begin
s:=s+#3#1+' ('+aonoff(pub,'Posted: ','Sent: ')+#3#9;
for i:=1 to 6 do
pdt[i]:=mixr.msgdate[i];
pdt2dt(pdt,dt);
s1:=tnn(dt.month)+'/'+tnn(dt.day)+'/'+tnn(dt.year);
i:=daynum(date)-daynum(s1);
s:=s+cstr(i)+' day'+aonoff((i=1),'','s')+' ago'+#3#1+')';
end;
printacr(s,abort,next);
if (origindate<>'') then
if ((fromi.anon=0) or (seeanon)) then
printacr('Origin: '+#3#3+origindate,abort,next);
s1:=fromi.as;
if (pub) then begin
if (usereal) then begin
s1:=fromi.real;
if (not isfido) then s1:=s1+' #'+cstr(fromi.usernum);
end;
end;
s:='From : '+#3#5+caps(what00(fromi.anon,s1));
if (not abort) then sprint(s);
if ((seeanon) and (fromi.anon<>0) and (toi.anon=0) and (not isfido)) then begin
s1:='(Real : '+#3#5;
if (usereal) then s1:=s1+caps(fromi.real)
else s1:=s1+caps(fromi.alias);
s1:=s1+' #'+cstr(fromi.usernum)+#3#1+')';
printacr(s1,abort,next);
end;
if (style<>2) then begin
s1:=toi.as;
if (pub) then begin
if ((toi.as='') and (isfido)) then s1:='All' else begin
if ((usereal) and (toi.real<>'')) then begin
s1:=allcaps(toi.real);
if (not isfido) then s1:=s1+' #'+cstr(toi.usernum);
end;
end;
end;
if (s1<>'') then begin
s:='To : '+#3#5+caps(what00(toi.anon,s1));
if (not usemci) then printacr(s,abort,next) else begin
sprint(s);
wkey(abort,next);
end;
end;
if ((seeanon) and (toi.anon<>0) and (not isfido)) then begin
if (fromi.anon=0) then begin
s1:='(The user really is : '+#3#5;
if (usereal) then s1:=s1+caps(toi.real)
else s1:=s1+caps(toi.alias);
s1:=s1+' #'+cstr(toi.usernum)+#3#1+')';
printacr(s1,abort,next);
end else begin
s1:='(The user really is : '+#3#5;
if (usereal) then s1:=s1+caps(fromi.real)
else s1:=s1+caps(fromi.alias);
s1:=s1+' --> ';
if (usereal) then s1:=s1+caps(toi.real)
else s1:=s1+caps(toi.alias);
s1:=s1+#3#1+')';
printacr(s1,abort,next);
end;
end;
end;
if (not usemci) then
printacr('Subject : '+#3#3+title,abort,next)
else begin
sprint('Subject : '+#3#3+title);
wkey(abort,next);
end;
if (mixr.isreplyto<>65535) then
printacr(' >> '+#3#3+'Reply to message '+#3#5+cstr(mixr.isreplyto+1),
abort,next);
i:=mixr.numreplys;
if (i<>0) then
printacr(' >> '+#3#3+'This message has '+#3#5+cstr(i)+#3#3+' repl'+
aonoff((i=1),'y','ies'),abort,next);
printacr('',abort,next);
if ((fromi.anon=0) or (seeanon)) then
lastname:=caps(what00(fromi.anon,fromi.as))
else
lastname:='';
if (not abort) then begin
reading_a_msg:=TRUE;
{rcg1117 added mixr...}
{read_with_mci:=(miallowmci in msgindexstat);}
read_with_mci:=(miallowmci in mixr.msgindexstat);
totload:=0;
abort:=FALSE;
next:=FALSE;
seek(brdf,mhead.msgptr);
repeat
blockreadstr2(brdf,s);
inc(totload,length(s)+2);
printacr(s,abort,next);
until ((totload>=msglength) or (abort));
read_with_mci:=FALSE;
reading_a_msg:=FALSE;
printacr('',abort,next);
if (dosansion) then redrawforansi;
end;
end;
getout;
end;
end.