View/Edit #12:@forward

Switch to edit mode.

Name(s): @forward
1:  "@forward <msg> [on *<recipient>] to <recipient> [<recipient>...]"
2:  set_task_perms(valid(caller_perms()) ? caller_perms() | player)
3:  if (!(p = this:parse_mailread_cmd(verb, args, "", "on", 1)))
4:    "...lose..."
5:    return
6:  elseif (length(p[4]) < 2 || p[4][1] != "to")
7:    player:tell("Usage:  ", verb, " [&lt;message&gt;] [on &lt;folder&gt;] to &lt;recip&gt;...")
8:    return
9:  endif
10: sequence = p[2]
11: recips = {}
12: for rs in (listdelete(p[4], 1))
13:   if ($mail_agent:match_failed(r = typeof(m = $mail_agent:match_recipient(rs)) == $LIST ? m[1] | m, rs))
14:     return
15:   endif
16:   recips = {@recips, r}
17: endfor
18: this:set_current_folder(folder = p[1])
19: for m in (folder:messages_in_seq(sequence))
20:   {msgnum, msgtxt} = m
21:   from = msgtxt[2]
22:   subject = tostr("[Fwd: ", msgtxt[4], "]")
23:   result = $mail_agent:send_message(player, recips, subject, $mail_agent:to_text(@msgtxt))
24:   if (!result)
25:     player:notify(tostr(result))
26:   elseif (result[1])
27:     player:notify(tostr("Message ", msgnum, @folder == this ? {} | {" on ", $mail_agent:name(folder)}, " @forwarded to ", $mail_agent:name_list(@listdelete(result, 1)), "."))
28:   else
29:     player:notify(tostr("Message ", msgnum, @folder == this ? {} | {" on ", $mail_agent:name(folder)}, " NOT @forwarded to ", $mail_agent:name_list(@listdelete(result, 1)), "."))
30:   endif
31: endfor
32: "Last modified by Dax (#789) on Tue May  3 13:55:52 2005 MDT."

Verb arguments: any any any
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

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