View/Edit #12:bonk_on_mail

Switch to edit mode.

Name(s): bonk_on_mail
1:  ":notify_mail(from,recipients[,msgnums])"
2:  " used by $mail_agent:raw_send to notify this player about mail being sent"
3:  " from <from> to <recipients>.  <msgnums> if given gives the message number(s) assigned (in the event that the corresponding recipient actually kept the mail)"
4:  if (!this:connected())
5:    return
6:  elseif (!$perm_utils:controls(caller_perms(), this))
7:    raise(E_PERM)
8:  else
9:    {from, recipients, ?msgnums = {}} = args
10:   "... msgnums may be shorter than recipients or may have some slots filled"
11:   "... with 0's if msg numbers are not available for some recipients."
12:   if ((t = this in recipients) && (length(msgnums) >= t && msgnums[t]))
13:     "... you are getting the mail and moreover your :receive_message kept it."
14:     namelist = $string_utils:english_list($list_utils:map_arg($mail_agent, "name", setremove(recipients, this)), "")
15:     this:tell("<font color=#FFFF00>The Postman arrives, hands you new mail from ", typeof(from) == $OBJ ? from:nn() | from, namelist ? " (which was also sent to " + namelist + ")" | "", ", then departs.</font>")
16:     this.location:announce_all_but({this}, "The Postman arrives, hands some new mail to ", this:title(), ", then departs.")
17:     if (!this:mail_option("expert"))
18:       this:tell("<font color=#FFFF00>Type `<A xch_cmd=\"@mail on me\">@mail on me</A>' for info on reading it.</font>")
19:     endif
20:   else
21:     "... vanilla notification; somebody got sent mail and you're finding out."
22:     namelist = $string_utils:english_list({@t ? {"You"} | {}, @$list_utils:map_arg($mail_agent, "name", setremove(recipients, this))}, "")
23:     if (from == $no_one)
24:       this:tell("<font color=#FFFF00>", namelist, length(recipients) == 1 ? " has" | " have", " just been sent new mail.</font>")
25:     else
26:       this:tell("<font color=#FFFF00>", namelist, length(recipients) == 1 ? " has" | " have", " just been sent new mail by ", typeof(from) == $OBJ ? from:nn() | from, ".</font>")
27:     endif
28:   endif
29: endif
30: "Last modified by Dax (#789) on Tue May  3 13:49:38 2005 MDT."

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

You are not logged in.

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