Switch to edit mode.
Name(s): get_head1: caller:isa(#120) || caller:isa(this) || raise(E_PERM)
2: "Display the HEADer"
3: "Used in conjunction with ARTICLE/HEAD"
4: if (!valid(caller.group))
5: return player:tell("412 No group selected")
6: endif
7: {NUM, rnum, headers, ret} = {toint(args[1]), caller.group:get_num(toint(args[1])), caller.group:headers_in_seq(caller.group:get_num(toint(args[1]))), {}}
8: "ret = {@ret, \"Path: moo.ca!moo.other.ca\"};"
9: ret = {@ret, tostr("From: \"", sender = $su:explode(headers[2][2])[1], "\" ", sender, "@moo.ca")}
10: news = ""
11: to = headers[2][3]
12: to = strsub(to, "and", "")
13: to = $su:explode(to)
14: for x in (to)
15: if (x[1..1] == "*")
16: ng = $mail_agent:match_recipient(x)
17: if (valid(ng))
18: news = tostr(news, this:ngname(ng), " ")
19: endif
20: endif
21: endfor
22: ret = {@ret, tostr("Newsgroups: ", strsub($su:trimr(news), " ", " "))}
23: ret = {@ret, tostr("Subject" + tostr(random(1000)) + ": ", strsub(headers[2][4], " ", "") ? headers[2][4] | "[no subject]")}
24: ret = {@ret, tostr("Date: ", $time_utils:rfc1123_time(headers[2][1]))}
25: ret = {@ret, tostr("Lines: 2")}
26: "FIXME: shouldn't actually read the whole file."
27: ret = {@ret, tostr("Message-ID: ", this:msgid(caller.group, NUM, headers[2][1]))}
28: return ret
29: "Last modified by Dax (#789) on Tue May 3 14:13:04 2005 MDT."