View/Edit #12:netforward

Switch to edit mode.

Name(s): netforward
1:  "args[1] is folder, args[2] is msg_seq"
2:  caller_perms():controls(this) || raise(E_PERM)
3:  $network:email_will_fail(email = player.email_address) && raise(E_NACC)
4:  {folder, msg_seq} = args
5:  player:set_current_folder(folder)
6:  if (folder:isa($newsgroup) ? !folder:is_readable_by(this) | !this:controls(folder))
7:    raise(E_PERM, "folder not readable.")
8:  endif
9:  folderstr = folder == player ? "" | tostr(" from *", folder.name, "(", folder, ")")
10: msg_seq = $seq_utils:intersection(msg_seq, {folder.messages[1][1], 100000})
11: seq_size = $seq_utils:size(msg_seq)
12: player._mail_task = task_id()
13: netmail = {}
14: linelength = player:linelength()
15: maxmsg = minmsg = 0
16: gotone = 0
17: for msg in (folder:messages_in_seq(msg_seq))
18:   gotone = 1
19:   $command_utils:suspend_if_needed()
20:   minmsg = minmsg ? min(msg[1], minmsg) | msg[1]
21:   maxmsg = maxmsg ? max(msg[1], maxmsg) | msg[1]
22:   lines = {tostr("Message ", msg[1], folderstr, ":"), tostr("Date:     ", ctime(msg[2][1])), "From:     " + msg[2][2], "To:       " + msg[2][3], @length(subj = msg[2][4]) > 1 ? {"Subject:  " + subj} | {}}
23:   for line in (msg[2][5..length(msg[2])])
24:     lines = {@lines, @$editor:fill_string(line, linelength)}
25:     $command_utils:suspend_if_needed()
26:   endfor
27:   netmail = {@netmail, @lines, "", "--------------------------", "", ""}
28: endfor
29: if (gotone)
30:   return player:send_self_netmail({tostr($name, " Message(s) ", minmsg, @minmsg != maxmsg ? {" - ", maxmsg} | {}, folderstr), @netmail})
31: endif
32: "Last modified by Lao-Tzu (#8084) on Mon Dec 10 19:28:25 2001 MST."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Dax (#789)

You are not logged in.

[home | help | who | search | setup | code]