Generic Mail Receiving Player #40
Aliases: Generic Mail Receiving Player
56 verbs · 70 properties · 3 children
Verbs
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
_mail_task | #40 | rc | #36 | 0 |
messages_going | #40 | c | #36 | {} |
mail_lists | #40 | rc | #36 | {} |
mail_notify | #40 | r | #2 | {{}, {}} |
mail_forward | #40 | rc | #36 | {} |
mail_options | #40 | rc | #36 | {} |
message_keep_date | #40 | rc | #36 | 0 |
messages_kept | #40 | rc | #36 | {} |
current_message | #40 | c | #36 | {0, 0} |
messages | #40 | c | #36 | {} |
ansi_options | #95 | r | #36 | <clear> |
replace_codes | #95 | r | #36 | <clear> |
features | #6 | r | #36 | <clear> |
previous_connection | #6 | | #2 | <clear> |
email_address | #6 | | #2 | <clear> |
last_disconnect_time | #6 | r | #2 | <clear> |
help | #6 | rc | #36 | #86 |
more_msg | #6 | rc | #36 | <clear> |
linetask | #6 | r | #36 | <clear> |
linesleft | #6 | r | #36 | <clear> |
linebuffer | #6 | | #36 | <clear> |
pagelen | #6 | r | #36 | <clear> |
owned_objects | #6 | r | #2 | <clear> |
linelen | #6 | r | #36 | <clear> |
current_folder | #6 | c | #36 | <clear> |
all_connect_places | #6 | | #2 | <clear> |
last_connect_place | #6 | | #2 | <clear> |
brief | #6 | rc | #36 | <clear> |
lines | #6 | c | #36 | <clear> |
page_absent_msg | #6 | rc | #36 | <clear> |
pq | #6 | rc | #36 | <clear> |
pqc | #6 | rc | #36 | <clear> |
page_origin_msg | #6 | rc | #36 | <clear> |
page_echo_msg | #6 | rc | #36 | <clear> |
edit_options | #6 | rc | #36 | <clear> |
last_connect_time | #6 | r | #2 | <clear> |
ownership_quota | #6 | | #36 | <clear> |
gender | #6 | rc | #36 | <clear> |
prc | #6 | rc | #36 | <clear> |
ppc | #6 | rc | #36 | <clear> |
poc | #6 | rc | #36 | <clear> |
psc | #6 | rc | #36 | <clear> |
pr | #6 | rc | #36 | <clear> |
pp | #6 | rc | #36 | <clear> |
po | #6 | rc | #36 | <clear> |
ps | #6 | rc | #36 | <clear> |
home | #6 | rc | #36 | #62 |
password | #6 | | #2 | <clear> |
gaglist | #6 | rc | #36 | <clear> |
paranoid | #6 | rc | #36 | <clear> |
display_options | #6 | rc | #36 | <clear> |
verb_subs | #6 | rc | #36 | <clear> |
first_connect_time | #6 | r | #2 | <clear> |
size_quota | #6 | | #36 | <clear> |
last_password_time | #6 | | #2 | <clear> |
last_connect_attempt | #6 | | #2 | <clear> |
page_count_start_time | #6 | r | #2 | <clear> |
ping_task | #6 | r | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #36 | <clear> |
key | #1 | c | #36 | 0 |
aliases | #1 | r | #2 | {"Generic Mail Receiving Player"} |
description | #1 | rc | #36 | <clear> |
object_size | #1 | r | #36 | {74896, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #95 ANSI PC → #6 generic player → #102 subthing → #1 Root Class
Children: #31 Generic Guest, #38 Everyman, #91 generic gamer
Call graph
Showing 48 of 112 verbs; 64 not shown.
Source
mail_forward
Referenced by
none
Source
1if (typeof(mf = this.(verb)) == STR) 2return $string_utils:pronoun_sub(mf, @args); 3else 4return mf; 5endif
receive_message
Referenced by
- #90:receive_message line 7:
pass(
Source
1":receive_message(msg,from)"; 2if ((!$perm_utils:controls(caller_perms(), this)) && (caller != this)) 3return E_PERM; 4endif 5if (this:mail_option("no_dupcc", args[1][1], args[1][2])) 6"pass to :mail_option the TEXT versions of who the message is from and to"; 7recipients = setremove($mail_agent:parse_address_field(args[1][3]), this); 8for x in (recipients) 9if (this:get_current_message(x)) 10return 0; 11endif 12endfor 13endif 14if (this:mail_option("netmail")) 15msg = args[1]; 16message = {"Forwarded: " + msg[4], "Original-date: " + ctime(msg[1]), "Original-From: " + msg[2], "Original-To: " + msg[3], ((("Reply-To: " + $string_utils:substitute(args[2].name, {{"@", "%"}})) + "@") + $network.moo_name) + ".moo.mud.org"}; 17for x in (msg[5..$]) 18message = {@message, @$generic_editor:fill_string(x, this:linelen())}; 19endfor 20if (this:send_self_netmail(message, @listdelete(args, 1)) == 0) 21return 0; 22endif 23endif 24set_task_perms(this.owner); 25new = this:new_message_num(); 26ncur = (new <= 1) ? 0 | min(this:current_message(this), new); 27this:set_current_message(this, ncur); 28new = max(new, ncur + 1); 29this.messages = {@this.messages, {new, args[1]}}; 30"... new-mail notification is now done directly by $mail_agent:raw_send"; 31"... see :notify_mail..."; 32return new;
display_message
Referenced by
none
Source
1":display_message(preamble,msg) --- prints msg to player."; 2vb = ((this._mail_task == task_id()) || (caller == $mail_editor)) ? "notify_lines" | "tell_lines"; 3preamble = args[1]; 4player:(vb)({@(typeof(preamble) == LIST) ? preamble | {preamble}, @args[2], "--------------------------"});
parse_message_seq from_msg_seq %from_msg_seq to_msg_seq %to_msg_seq subject_msg_seq body_msg_seq kept_msg_seq unkept_msg_seq display_seq_headers display_seq_full messages_in_seq list_rmm new_message_num length_num_le length_date_le length_date_gt length_all_msgs exists_num_eq msg_seq_to_msg_num_list msg_seq_to_msg_num_string rm_message_seq undo_rmm expunge_rmm renumber keep_message_seq
Referenced by
- #40:receive_message line 25:
this:new_message_num - #40:expire_old_messages line 7:
this:rm_message_seq - #40:expire_old_messages line 8:
this:expunge_rmm - #40:expirable_msg_seq line 12:
this:unkept_msg_seq - #40:expirable_msg_seq line 12:
this:length_date_le - #40:confunc line 4:
this:length_all_msgs - #40:confunc line 4:
this:length_date_le
Source
1"parse_message_seq(strings,cur) => msg_seq"; 2"messages_in_seq(msg_seq); => text of messages in msg_seq"; 3"display_seq_headers(msg_seq[,current]) :displays summary lines of those msgs"; 4"rmm_message_seq(msg_seq) => string giving msg numbers removed"; 5"undo_rmm() => msg_seq of restored messages"; 6"expunge_rmm() => number of messages expunged"; 7"list_rmm() => number of messages awaiting expunge"; 8"renumber(cur) => {number of messages in folder, new_cur}"; 9""; 10"See the corresponding routines on $mail_agent."; 11if ((caller == $mail_agent) || $perm_utils:controls(caller_perms(), this)) 12set_task_perms(this.owner); 13return $mail_agent:(verb)(@args); 14else 15return E_PERM; 16endif
msg_summary_line
Referenced by
none
Source
1return $mail_agent:msg_summary_line(@args);
msg_text
Referenced by
none
Source
1":msg_text(@msg) => list of strings."; 2"msg is a mail message (in the usual transmission format) being read BY this player."; 3"The default version of recipient:msg_full_text calls this to obtain the actual list of strings to display. (this is a badly named verb)."; 4"returns the actual list of strings to display."; 5return $mail_agent:to_text(@args);
notify_mail
Referenced by
none
Source
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)"; 4if (!$object_utils:connected(this)) 5return; 6elseif (!((caller in {this, $mail_agent}) || $perm_utils:controls(caller_perms(), this))) 7return E_PERM; 8else 9{from, recipients, ?msgnums = {}} = args; 10from_name = $mail_agent:name(from); 11"... msgnums may be shorter than recipients or may have some slots filled"; 12"... with 0's if msg numbers are not available for some recipients."; 13if ((t = this in recipients) && ((length(msgnums) >= t) && msgnums[t])) 14"... you are getting the mail and moreover your :receive_message kept it."; 15namelist = $string_utils:english_list($list_utils:map_arg($mail_agent, "name", setremove(recipients, this)), ""); 16this:notify(tostr("You have new mail (", msgnums[t], ") from ", from_name, namelist ? " which was also sent to " + namelist | "", ".")); 17if (!this:mail_option("expert")) 18this:notify(tostr("Type `help mail' for info on reading it.")); 19endif 20else 21"... vanilla notification; somebody got sent mail and you're finding out."; 22namelist = $string_utils:english_list({@t ? {"You"} | {}, @$list_utils:map_arg($mail_agent, "name", setremove(recipients, this))}, ""); 23this:tell(tostr(namelist, (length(recipients) == 1) ? " has" | " have", " just been sent new mail by ", from_name, ".")); 24endif 25endif
current_message
Referenced by
- #40:receive_message line 26:
this:current_message - #40:@renumber line 7:
this:current_message - #57:@rn line 8:
pass(
Source
1":current_message([recipient])"; 2" => current message number for the given recipient (defaults to this)."; 3" => 0 if we have no record of that recipient"; 4" or current message happens to be 0."; 5"This verb is mostly obsolete; consider using :get_current_message()"; 6if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 7raise(E_PERM); 8elseif ((!args) || (args[1] == this)) 9return this.current_message[1]; 10elseif (a = $list_utils:assoc(args[1], this.current_message)) 11return a[2]; 12else 13return 0; 14endif
get_current_message
Referenced by
- #40:receive_message line 9:
this:get_current_message - #40:parse_mailread_cmd line 13:
this:get_current_message - #40:@skip line 14:
this:get_current_message - #40:expirable_msg_seq line 5:
this:get_current_message - #40:@unread line 7:
this:get_current_message - #40:confunc line 4:
this:get_current_message
Source
1":get_current_message([recipient])"; 2" => {msg_num, last_read_date} for the given recipient."; 3" => 0 if we have no record of that recipient."; 4if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 5raise(E_PERM); 6elseif ((!args) || (args[1] == this)) 7if (length(this.current_message) < 2) 8"Whoops, this got trashed---fix it up!"; 9this.current_message = {0, time(), @this.current_message}; 10endif 11return this.current_message[1..2]; 12elseif (a = $list_utils:assoc(args[1], this.current_message)) 13return a[2..3]; 14else 15return 0; 16endif
set_current_message
Referenced by
- #40:receive_message line 27:
this:set_current_message - #40:@read line 15:
this:set_current_message - #40:@renumber line 17:
this:set_current_message - #40:@skip line 15:
this:set_current_message - #40:@nn line 15:
this:set_current_message - #40:@unread line 14:
this:set_current_message - #40:@read-all-new*-mail line 25:
this:set_current_message - #40:@read-all-new*-mail line 40:
this:set_current_message
Source
1":set_current_message(recipient[,number[,date]])"; 2"Returns the new {number,last-read-date} pair for recipient."; 3if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 4raise(E_PERM); 5endif 6{recip, ?number = E_NONE, ?date = 0} = args; 7cm = this.current_message; 8if (recip == this) 9this.current_message[2] = max(date, cm[2]); 10if (number != E_NONE) 11this.current_message[1] = number; 12endif 13return this.current_message[1..2]; 14elseif (i = $list_utils:iassoc(recip, cm)) 15return (this.current_message[i] = {recip, (number == E_NONE) ? cm[i][2] | number, max(date, cm[i][3])})[2..3]; 16else 17entry = {recip, (number != E_NONE) && number, date}; 18this.current_message = {@cm, entry}; 19return entry[2..3]; 20endif
make_current_message
Referenced by
- #40:@subscribe*-quick line 84:
this:make_current_message
Source
1":make_current_message(recipient[,index])"; 2"starts a new current_message record for recipient."; 3"index, if given, indicates where recipient is to be"; 4" placed (n = at or after nth entry in .current_message)."; 5recip = args[1]; 6cm = this.current_message; 7if (length(args) > 1) 8i = max(2, min(args[2], length(cm))); 9else 10i = 0; 11endif 12if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 13raise(E_PERM); 14elseif (recip == this) 15"...self..."; 16elseif (j = $list_utils:iassoc(recip, cm)) 17"...already present..."; 18if (i) 19if (j < i) 20this.current_message = {@cm[1..j - 1], @cm[j + 1..i], cm[j], @cm[i + 1..$]}; 21elseif (j > (i + 1)) 22this.current_message = {@cm[1..i], cm[j], @cm[i + 1..j - 1], @cm[j + 1..$]}; 23endif 24endif 25else 26date = `$server_options.is_mac ! ANY => 0' ? -2085978496 | 0; 27this.current_message = listappend(cm, {recip, 0, date}, @i ? {i} | {}); 28endif
kill_current_message
Referenced by
- #40:@skip line 9:
this:kill_current_message - #40:@unsub*scribe line 18:
this:kill_current_message - #40:@unsub*scribe line 26:
this:kill_current_message - #40:@unread line 13:
this:kill_current_message
Source
1":kill_current_message(recipient)"; 2"entirely forgets current message for this recipient..."; 3"Returns true iff successful."; 4if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 5raise(E_PERM); 6else 7return ((recip = args[1]) != this) && ((i = $list_utils:iassoc(recip, cm = this.current_message)) && (this.current_message = listdelete(cm, i))); 8endif
current_folder
Referenced by
- #40:parse_folder_spec line 4:
this:current_folder - #40:@renumber line 3:
this:current_folder - #40:@skip line 5:
this:current_folder - #40:@skip line 7:
this:current_folder - #40:@unsub*scribe line 6:
this:current_folder
Source
1":current_folder() => default folder to use, always an object, usually `this'"; 2set_task_perms(caller_perms()); 3return ((!this:mail_option("sticky")) || this.current_folder) && this;
set_current_folder
Referenced by
- #31:set_current_folder line 1:
pass( - #40:@mail line 5:
this:set_current_folder - #40:@read line 6:
this:set_current_folder - #40:@rmm*ail line 10:
this:set_current_folder - #40:@renumber line 16:
this:set_current_folder - #40:@unrmm*ail line 18:
this:set_current_folder - #40:@answer line 9:
this:set_current_folder - #40:@forward line 20:
this:set_current_folder - #40:@skip line 18:
this:set_current_folder - #40:@subscribe*-quick line 87:
this:set_current_folder - #40:mail_catch_up line 2:
this:set_current_folder - #40:@unsub*scribe line 45:
this:set_current_folder - #40:@keep-m*ail line 14:
this:set_current_folder - #40:@keep-m*ail line 27:
this:set_current_folder - #40:@resend line 23:
this:set_current_folder - #40:@nn line 12:
this:set_current_folder - #40:@unread line 4:
this:set_current_folder - #40:@quickr*eply line 14:
this:set_current_folder - #40:@read-all-new*-mail line 26:
this:set_current_folder - #40:@read-all-new*-mail line 41:
this:set_current_folder
Source
1set_task_perms(caller_perms()); 2return this.current_folder = args[1];
parse_folder_spec
Referenced by
- #40:parse_mailread_cmd line 8:
this:parse_folder_spec - #40:@unrmm*ail line 3:
this:parse_folder_spec - #40:@keep-m*ail line 8:
this:parse_folder_spec
Source
1":parse_folder_spec(verb,args,expected_preposition[,allow_trailing_args_p])"; 2" => {folder, msg_seq_args, trailing_args}"; 3set_task_perms(caller_perms()); 4folder = this:current_folder(); 5if (!prepstr) 6return {folder, args[2], {}}; 7endif 8{verb, args, prep, ?extra = 0} = args; 9p = prepstr in args; 10if (prepstr != prep) 11"...unexpected preposition..."; 12if (extra && (!index(prepstr, " "))) 13return {folder, args[1..p - 1], args[p..$]}; 14else 15player:tell("Usage: ", verb, " [<message numbers>] [", prep, " <folder/list-name>]"); 16endif 17elseif (!((p < length(args)) && (fname = args[p + 1]))) 18"...preposition but no iobj..."; 19player:tell(verb, " ", $string_utils:from_list(args, " "), " WHAT?"); 20elseif ($mail_agent:match_failed(folder = $mail_agent:match_recipient(fname, this), fname)) 21"...bogus mail folder..."; 22else 23return {folder, args[1..p - 1], args[p + 2..$]}; 24endif 25return 0;
parse_mailread_cmd
Referenced by
- #40:@mail line 4:
this:parse_mailread_cmd - #40:@read line 5:
this:parse_mailread_cmd - #40:@rmm*ail line 4:
this:parse_mailread_cmd - #40:@answer line 3:
this:parse_mailread_cmd - #40:@forward line 3:
this:parse_mailread_cmd - #40:@keep-m*ail line 21:
this:parse_mailread_cmd - #40:@resend line 6:
this:parse_mailread_cmd - #40:@unread line 3:
this:parse_mailread_cmd - #40:@refile line 5:
this:parse_mailread_cmd - #40:@quickr*eply line 5:
this:parse_mailread_cmd
Source
1":parse_mailread_cmd(verb,args,default,prep[,trailer])"; 2" handles anything of the form `VERB message_seq [PREP folder ...]'"; 3" default is the default msg-seq to use if none given"; 4" prep is the expected prepstr (assumes prepstr is set), usually `on'"; 5" trailer, if present and true, indicates trailing args are permitted."; 6" returns {recipient object, message_seq, current_msg,\"...\"} or 0"; 7set_task_perms(caller_perms()); 8if (!(pfs = this:parse_folder_spec(@listdelete(args, 3)))) 9return 0; 10endif 11{verb, args, default, prep, ?extra = 0} = args; 12folder = pfs[1]; 13cur = this:get_current_message(folder) || {0}; 14if (typeof(pms = folder:parse_message_seq(pfs[2], @cur)) == LIST) 15rest = {@listdelete(pms, 1), @pfs[3]}; 16if ((!extra) && rest) 17"...everything should have been gobbled by :parse_message_seq..."; 18player:tell("I don't understand `", rest[1], "'"); 19return 0; 20elseif (pms[1]) 21"...we have a nonempty message sequence..."; 22return {folder, pms[1], cur, rest}; 23elseif (used = (length(pfs[2]) + 1) - length(pms)) 24"...:parse_message_seq used some words, but didn't get anything out of it"; 25pms = ("%f %<has> no `" + $string_utils:from_list(pfs[2][1..used], " ")) + "' messages."; 26elseif (typeof(pms = folder:parse_message_seq(default, @cur)) == LIST) 27"...:parse_message_seq used nothing, try the default; wow it worked"; 28return {folder, pms[1], cur, rest}; 29endif 30elseif (typeof(pms) == ERR) 31player:tell($mail_agent:name(folder), " is not readable by you."); 32if (!$object_utils:isa(folder, $mail_recipient)) 33player:tell("Use * to indicate a non-player mail recipient."); 34endif 35return 0; 36endif 37if (folder == this) 38subst = {{"%f's", "Your"}, {"%f", "You"}, {"%<has>", "have"}}; 39elseif (is_player(folder)) 40subst = {{"%f", folder.name}, {"%<has>", $gender_utils:get_conj("has", folder)}}; 41else 42subst = {{"%f", $mail_agent:name(folder)}, {"%<has>", "has"}}; 43endif 44player:tell($string_utils:substitute(pms, {@subst, {"%%", "%"}})); 45return 0;
@mail
Referenced by
none
Source
1"@mail <msg-sequence> --- as in help @mail"; 2"@mail <msg-sequence> on <recipient> --- shows mail on mailing list or player."; 3set_task_perms(valid(cp = caller_perms()) ? cp | player); 4if (p = this:parse_mailread_cmd("@mail", args, this:mail_option("@mail") || $mail_agent.("player_default_@mail"), "on")) 5this:set_current_folder(folder = p[1]); 6msg_seq = p[2]; 7seq_size = $seq_utils:size(msg_seq); 8if ((lim = player:mail_option("manymsgs")) && ((lim <= seq_size) && (!$command_utils:yes_or_no(tostr("You are about to see ", seq_size, " message headers. Continue?"))))) 9player:notify(tostr("Aborted. @mailoption manymsgs=", lim)); 10return; 11endif 12if (1 != seq_size) 13player:notify(tostr(seq_size, " messages", (folder == this) ? "" | (" on " + $mail_agent:name(folder)), ":")); 14endif 15folder:display_seq_headers(msg_seq, @p[3]); 16endif
@read @peek
Referenced by
- #31:@read line 1:
pass(
Source
1"@read <msg>... -- as in help @read"; 2"@read <msg>... on *<recipient> -- reads messages on recipient."; 3"@peek ... -- like @read, but don't set current message"; 4set_task_perms(valid(cp = caller_perms()) ? cp | player); 5if (p = this:parse_mailread_cmd("@read", args, "", "on")) 6this:set_current_folder(folder = p[1]); 7msg_seq = p[2]; 8if ((lim = player:mail_option("manymsgs")) && ((lim <= (seq_size = $seq_utils:size(msg_seq))) && (!$command_utils:yes_or_no(tostr("You are about to see ", seq_size, " messages. Continue?"))))) 9player:notify(tostr("Aborted. @mailoption manymsgs=", lim)); 10return; 11endif 12this._mail_task = task_id(); 13if (cur = folder:display_seq_full(msg_seq, tostr("Message %d", (folder == this) ? "" | (" on " + $mail_agent:name(folder)), ":"))) 14if (verb != "@peek") 15this:set_current_message(folder, @cur); 16endif 17endif 18endif
@next @prev
Referenced by
none
Source
1set_task_perms(player.owner); 2if (dobjstr && (!(n = toint(dobjstr)))) 3player:notify(tostr("Usage: ", verb, "[<number>] [on <recipient>]")); 4elseif (dobjstr) 5this:("@read")(tostr(verb[2..5], n), @listdelete(args, 1)); 6else 7this:("@read")(verb[2..5], @args); 8endif
@rmm*ail
Referenced by
none
Source
1"@rmm <message-sequence> [from <recipient>]. Use @unrmm if you screw up."; 2" Beware, though. @unrmm can only undo the most recent @rmm."; 3set_task_perms(player); 4if (!(p = this:parse_mailread_cmd("@rmm", args, "cur", "from"))) 5"...parse failed, we've already complained..."; 6elseif ((!prepstr) && ((p[1] != this) && (!$command_utils:yes_or_no(("@rmmail from " + $mail_agent:name(p[1])) + ". Continue?")))) 7"...wasn't the folder player was expecting..."; 8player:notify("@rmmail aborted."); 9else 10this:set_current_folder(folder = p[1]); 11e = folder:rm_message_seq(p[2]); 12if (typeof(e) == ERR) 13player:notify(tostr($mail_agent:name(folder), ": ", e)); 14else 15count = ((n = $seq_utils:size(p[2])) == 1) ? "." | tostr(" (", n, " messages)."); 16fname = (folder == this) ? "" | (" from " + $mail_agent:name(folder)); 17player:notify(tostr("Deleted ", e, fname, count)); 18endif 19endif
@renumber
Referenced by
none
Source
1set_task_perms(player); 2if (!dobjstr) 3folder = this:current_folder(); 4elseif ($mail_agent:match_failed(folder = $mail_agent:match_recipient(dobjstr), dobjstr)) 5return; 6endif 7cur = this:current_message(folder); 8fname = $mail_agent:name(folder); 9if (typeof(h = folder:renumber(cur)) == ERR) 10player:notify(tostr(h)); 11else 12if (!h[1]) 13player:notify(tostr("No messages on ", fname, ".")); 14else 15player:notify(tostr("Messages on ", fname, " renumbered 1-", h[1], ".")); 16this:set_current_folder(folder); 17if (h[2] && this:set_current_message(folder, h[2])) 18player:notify(tostr("Current message is now ", h[2], ".")); 19endif 20endif 21endif
@unrmm*ail
Referenced by
none
Source
1"@unrmm [on <recipient>] -- undoes the previous @rmm on that recipient."; 2set_task_perms(player); 3if (!(p = this:parse_folder_spec("@unrmm", args, "on"))) 4return; 5endif 6dobjstr = $string_utils:from_list(p[2], " "); 7keep = 0; 8if ((!dobjstr) || (keep = index("keep", dobjstr) == 1)) 9do = "undo_rmm"; 10elseif (index("expunge", dobjstr) == 1) 11do = "expunge_rmm"; 12elseif (index("list", dobjstr) == 1) 13do = "list_rmm"; 14else 15player:notify(tostr("Usage: ", verb, " [expunge|list] [on <recipient>]")); 16return; 17endif 18this:set_current_folder(folder = p[1]); 19if (msg_seq = folder:(do)(@keep ? {keep} | {})) 20if (do == "undo_rmm") 21player:notify(tostr($seq_utils:size(msg_seq), " messages restored to ", $mail_agent:name(folder), ".")); 22folder:display_seq_headers(msg_seq, 0); 23else 24player:notify(tostr(msg_seq, " zombie message", (msg_seq == 1) ? " " | "s ", (do == "expunge_rmm") ? "expunged from " | "on ", $mail_agent:name(folder), ".")); 25endif 26elseif (typeof(msg_seq) == ERR) 27player:notify(tostr($mail_agent:name(folder), ": ", msg_seq)); 28else 29player:notify(tostr("No messages to ", (do == "expunge_rmm") ? "expunge from " | "restore to ", $mail_agent:name(folder))); 30endif
@send
Referenced by
Source
1if (args && (args[1] == "to")) 2args = listdelete(args, 1); 3endif 4subject = {}; 5for a in (args) 6if (((i = index(a, "=")) > 3) && (index("subject", a[1..i - 1]) == 1)) 7args = setremove(args, a); 8a[1..i] = ""; 9subject = {a}; 10endif 11endfor 12$mail_editor:invoke(args, verb, @subject);
@answer @repl*y
Referenced by
none
Source
1"@answer <msg> [on *<recipient>] [<flags>...]"; 2set_task_perms(who = valid(caller_perms()) ? caller_perms() | player); 3if (p = this:parse_mailread_cmd(verb, args, "cur", "on", 1)) 4if ($seq_utils:size(p[2]) != 1) 5player:notify("You can only answer *one* message at a time."); 6elseif (LIST != typeof(flags_replytos = $mail_editor:check_answer_flags(@p[4]))) 7player:notify_lines({tostr("Usage: ", verb, " [message-# [on <recipient>]] [flags...]"), "where flags include any of:", " all reply to everyone", " sender reply to sender only", " include include the original message in your reply", " noinclude don't include the original in your reply"}); 8else 9this:set_current_folder(p[1]); 10$mail_editor:invoke(2, verb, p[1]:messages_in_seq(p[2])[1][2], @flags_replytos); 11endif 12endif
@forward
Referenced by
none
Source
1"@forward <msg> [on *<recipient>] to <recipient> [<recipient>...]"; 2set_task_perms(valid(cp = caller_perms()) ? cp | player); 3if (!(p = this:parse_mailread_cmd(verb, args, "", "on", 1))) 4"...lose..."; 5return; 6elseif ($seq_utils:size(sequence = p[2]) != 1) 7player:notify("You can only forward *one* message at a time."); 8return; 9elseif ((length(p[4]) < 2) || (p[4][1] != "to")) 10player:notify(tostr("Usage: ", verb, " [<message>] [on <folder>] to <recip>...")); 11return; 12endif 13recips = {}; 14for rs in (listdelete(p[4], 1)) 15if ($mail_agent:match_failed(r = $mail_agent:match_recipient(rs), rs)) 16return; 17endif 18recips = {@recips, r}; 19endfor 20this:set_current_folder(folder = p[1]); 21m = folder:messages_in_seq(sequence)[1]; 22msgnum = m[1]; 23msgtxt = m[2]; 24from = msgtxt[2]; 25if (msgtxt[4] != " ") 26subject = tostr("[", from, ": ", msgtxt[4], "]"); 27elseif ((h = "" in msgtxt) && (h < length(msgtxt))) 28subject = tostr("[", from, ": `", msgtxt[h + 1][1..min(20, $)], "']"); 29else 30subject = tostr("[", from, "]"); 31endif 32result = $mail_agent:send_message(player, recips, subject, $mail_agent:to_text(@msgtxt)); 33if (!result) 34player:notify(tostr(result)); 35elseif (result[1]) 36player:notify(tostr("Message ", msgnum, @(folder == this) ? {} | {" on ", $mail_agent:name(folder)}, " @forwarded to ", $mail_agent:name_list(@listdelete(result, 1)), ".")); 37else 38player:notify("Message not sent."); 39endif
@gripe
Referenced by
none
Source
1$mail_editor:invoke($gripe_recipients, "@gripe", "@gripe: " + argstr);
@typo @bug @suggest*ion @idea @comment
Referenced by
none
Source
1subject = tostr($string_utils:capitalize(verb[2..$]), ": ", (loc = this.location).name, "(", loc, ")"); 2if (this != player) 3return E_PERM; 4elseif (argstr) 5result = $mail_agent:send_message(this, {loc.owner}, subject, argstr); 6if (result && result[1]) 7player:notify(tostr("Your ", verb, " sent to ", $mail_agent:name_list(@listdelete(result, 1)), ". Input is appreciated, as always.")); 8else 9player:notify(tostr("Huh? This room's owner (", loc.owner, ") is invalid? Tell a wizard...")); 10endif 11return; 12elseif (!($object_utils:isa(loc, $room) && loc.free_entry)) 13player:notify_lines({tostr("You need to make it a one-liner, i.e., `", verb, " something or other'."), "This room may not let you back in if you go to the Mail Room."}); 14elseif ($object_utils:isa(loc, $generic_editor)) 15player:notify_lines({tostr("You need to make it a one-liner, i.e., `", verb, " something or other'."), "Sending you to the Mail Room from an editor is usually a bad idea."}); 16else 17$mail_editor:invoke({tostr(loc.owner)}, verb, subject); 18endif 19if (verb == "@bug") 20player:notify("For a @bug report, be sure to mention exactly what it was you typed to trigger the error..."); 21endif
@skip
Referenced by
none
Source
1"@skip [*<folder/mailing_list>...]"; 2" sets your last-read time for the given lists to now, indicating your"; 3" disinterest in any new messages that might have appeared recently."; 4set_task_perms(player); 5current_folder = this:current_folder(); 6for a in (args || {0}) 7if (a ? $mail_agent:match_failed(folder = $mail_agent:match_recipient(a), a) | (folder = this:current_folder())) 8"...bogus folder name, done... No, try anyway."; 9if (this:kill_current_message(this:my_match_object(a))) 10player:notify("Invalid folder, but found it subscribed anyway. Removed."); 11endif 12else 13lseq = folder:length_all_msgs(); 14unread = (n = this:get_current_message(folder)) ? folder:length_date_gt(n[2]) | lseq; 15this:set_current_message(folder, lseq && folder:messages_in_seq({lseq, lseq + 1})[1][1], time()); 16player:notify(tostr(unread ? tostr("Ignoring ", unread) | "No", " unread message", (unread != 1) ? "s" | "", " on ", $mail_agent:name(folder))); 17if (current_folder == folder) 18this:set_current_folder(this); 19endif 20endif 21endfor
@subscribe*-quick @unsubscribed*-quick
Referenced by
none
Source
1"@subscribe *<folder/mailing_list> [with notification] [before|after *<folder>]"; 2" causes you to be notified when new mail arrives on this list"; 3"@subscribe"; 4" just lists available mailing lists."; 5"@unsubscribed"; 6" prints out available mailing lists you aren't already subscribed to."; 7"@subscribe-quick and @unsubscribed-quick"; 8" prints out same as above except without mail list descriptions, just names."; 9set_task_perms((player.owner != player) ? player.owner | player); 10quick = 0; 11if (qi = index(verb, "-q")) 12verb = verb[1..qi - 1]; 13quick = 1; 14endif 15fname = {@args, 0}[1]; 16if (!fname) 17ml = $list_utils:slice(this.current_message[3..$]); 18for c in ({@$mail_agent.contents, @this.mail_lists}) 19$command_utils:suspend_if_needed(0); 20if ((c:is_usable_by(this) || c:is_readable_by(this)) && ((verb != "@unsubscribed") || (!(c in ml)))) 21c:look_self(quick); 22endif 23endfor 24player:notify(tostr("-------- end of ", verb, " -------")); 25return; 26elseif (verb == "@unsubscribed") 27player:notify("@unsubscribed does not take arguments."); 28return; 29elseif ($mail_agent:match_failed(folder = $mail_agent:match_recipient(fname), fname)) 30return; 31elseif (folder == this) 32player:notify("You don't need to @subscribe to yourself"); 33return; 34elseif ($object_utils:isa(folder, $mail_recipient) ? !folder:is_readable_by(this) | (!$perm_utils:controls(this, folder))) 35player:notify("That mailing list is not readable by you."); 36return; 37endif 38notification = this in folder.mail_notify; 39i = 0; 40beforeafter = 0; 41while (length(args) >= 2) 42if (length(args) < 3) 43player:notify(args[2] + " what?"); 44return; 45elseif (args[2] in {"with", "without"}) 46with = args[2] == "with"; 47if (index("notification", args[3]) != 1) 48player:notify(tostr("with ", args[3], "?")); 49return; 50elseif (!$object_utils:isa(folder, $mail_recipient)) 51player:notify(tostr("You cannot use ", verb, " to change mail notification from a non-$mail_recipient.")); 52elseif ((!with) == (!notification)) 53"... nothing to do..."; 54elseif (with) 55if (this in folder:add_notify(this)) 56notification = 1; 57else 58player:notify("This mail recipient does not allow immediate notification."); 59endif 60else 61folder:delete_notify(this); 62notification = 0; 63endif 64elseif (args[2] in {"before", "after"}) 65if (beforeafter) 66player:notify((args[2] == beforeafter) ? tostr("two `", beforeafter, "'s?") | "Only use one of `before' or `after'"); 67return; 68elseif ($mail_agent:match_failed(other = $mail_agent:match_recipient(args[3]), args[3])) 69return; 70elseif (other == this) 71i = 2; 72elseif (!(i = $list_utils:iassoc(other, this.current_message))) 73player:notify(tostr("You aren't subscribed to ", $mail_agent:name(other), ".")); 74return; 75endif 76beforeafter = args[2]; 77i = i - (beforeafter == "before"); 78if (this:mail_option("rn_order") != "fixed") 79player:notify("Warning: Do `@mail-option rn_order=fixed' if you do not want your @rn listing reordered when you next login."); 80endif 81endif 82args[2..3] = {}; 83endwhile 84this:make_current_message(folder, @i ? {i} | {}); 85len = folder:length_all_msgs(); 86player:notify(tostr($mail_agent:name(folder), " has ", len, " message", (len == 1) ? "" | "s", ".", notification ? " You will be notified immediately when new messages are posted." | " Notification of new messages will be printed when you connect.")); 87this:set_current_folder(folder);
mail_catch_up
Referenced by
- #40:confunc line 8:
this:mail_catch_up
Source
1set_task_perms((caller == this) ? this.owner | caller_perms()); 2this:set_current_folder(this); 3dates = new_cm = head = {}; 4sort = this:mail_option("rn_order") || "read"; 5for n in (this.current_message) 6(ticks_left() < 4000) && suspend(0); 7if (typeof(n) != LIST) 8head = {@head, n}; 9elseif ($object_utils:isa(folder = n[1], $mail_recipient) && folder:is_readable_by(this)) 10"...set current msg to be the last one you could possibly have read."; 11if (n[3] < folder.last_msg_date) 12i = folder:length_date_le(n[3]); 13n[2] = i && folder:messages_in_seq(i)[1]; 14endif 15if (sort == "fixed") 16new_cm = {n, @new_cm}; 17elseif (sort == "send") 18j = $list_utils:find_insert(dates, folder.last_msg_date - 1); 19dates = listinsert(dates, folder.last_msg_date, j); 20new_cm = listinsert(new_cm, n, j); 21else 22new_cm = listappend(new_cm, n, $list_utils:iassoc_sorted(n[3] - 1, new_cm, 3)); 23endif 24endif 25endfor 26this.current_message = {@head, @$list_utils:reverse(new_cm)};
@rn check_mail_lists @subscribed
Referenced by
- #40:confunc line 9:
this:check_mail_lists
Source
1set_task_perms((caller == this) ? this.owner | caller_perms()); 2which = {}; 3cm = this.current_message; 4cm[1..2] = (verb == "@rn") ? {{this, @cm[1..2]}} | {}; 5all = verb == "@subscribed"; 6for n in (cm) 7rcpt = n[1]; 8if (n == $news) 9"... $news is handled separately ..."; 10elseif ($mail_agent:is_recipient(rcpt)) 11if ((nmsgs = n[1]:length_date_gt(n[3])) || all) 12which = {@which, {n[1], nmsgs}}; 13endif 14else 15player:notify(tostr("Bogus recipient ", rcpt, " removed from .current_message.")); 16this.current_message = setremove(this.current_message, n); 17endif 18$command_utils:suspend_if_needed(0); 19endfor 20if (which) 21player:notify(tostr((verb == "@subscribed") ? "You are subscribed to the following" | "There is new activity on the following", (length(which) > 1) ? " lists:" | " list:")); 22for w in (which) 23name = (w[1] == this) ? " me" | $mail_agent:name(w[1]); 24player:notify(tostr($string_utils:left(" " + name, 40), " ", w[2], " new message", (w[2] == 1) ? "" | "s")); 25$command_utils:suspend_if_needed(0); 26endfor 27if (verb != "check_mail_lists") 28player:notify("-- End of listing"); 29endif 30elseif (verb == "@rn") 31player:notify("No new activity on any of your lists."); 32elseif (verb == "@subscribed") 33player:notify("You aren't subscribed to any mailing lists."); 34endif 35return which;
mail_option
Referenced by
- #40:receive_message line 5:
this:mail_option - #40:receive_message line 14:
this:mail_option - #40:notify_mail line 17:
this:mail_option - #40:current_folder line 3:
this:mail_option - #40:@mail line 4:
this:mail_option - #40:@subscribe*-quick line 78:
this:mail_option - #40:mail_catch_up line 4:
this:mail_option - #40:@netforw*ard line 15:
this:mail_option - #40:@resend line 28:
this:mail_option - #40:expirable_msg_seq line 8:
this:mail_option - #40:confunc line 6:
this:mail_option
Source
1":mail_option(name)"; 2"Returns the value of the specified mail option"; 3if ((caller in {this, $mail_editor, $mail_agent}) || $perm_utils:controls(caller_perms(), this)) 4return $mail_options:get(this.mail_options, args[1]); 5else 6return E_PERM; 7endif
@unsub*scribe
Referenced by
none
Source
1"@unsubscribe [*<folder/mailing_list> ...]"; 2"entirely removes the record of your current message for the named folders,"; 3"indicating your disinterest in anything that might appear there in the future."; 4set_task_perms(player); 5unsubscribed = {}; 6current_folder = this:current_folder(); 7for a in (args || {0}) 8if (a != 0) 9folder = $mail_agent:match_recipient(a); 10if (folder == $failed_match) 11folder = this:my_match_object(a); 12endif 13else 14folder = current_folder; 15endif 16if (!valid(folder)) 17"...bogus folder name... try removing it anyway."; 18if (this:kill_current_message(folder)) 19player:notify("Invalid folder, but found it subscribed anyway. Removed."); 20else 21$mail_agent:match_failed(folder, a); 22endif 23elseif (folder == this) 24player:notify(tostr("You can't ", verb, " yourself.")); 25else 26if (!this:kill_current_message(folder)) 27player:notify(tostr("You weren't subscribed to ", $mail_agent:name(folder))); 28if ($object_utils:isa(folder, $mail_recipient)) 29result = folder:delete_notify(this); 30if ((typeof(result) == LIST) && (result[1] == this)) 31player:notify("Removed you from the mail notifications list."); 32endif 33endif 34else 35unsubscribed = {@unsubscribed, folder}; 36if ($object_utils:isa(folder, $mail_recipient)) 37folder:delete_notify(this); 38endif 39endif 40endif 41endfor 42if (unsubscribed) 43player:notify(tostr("Forgetting about ", $string_utils:english_list($list_utils:map_arg($mail_agent, "name", unsubscribed)))); 44if (current_folder in unsubscribed) 45this:set_current_folder(this); 46endif 47endif
send_self_netmail
Referenced by
- #40:receive_message line 20:
this:send_self_netmail
Source
1":send_self_netmail(msg [ ,from ])"; 2"return 0 if successful, otherwise error."; 3if (!$perm_utils:controls(caller_perms(), this)) 4return E_PERM; 5elseif (error = $network:invalid_email_address(this.email_address)) 6return "Invalid email address: " + error; 7else 8msg = args[1]; 9if (length(args) > 1) 10from = args[2]; 11this:notify(tostr("Receiving mail from ", from:title(), " (", from, ") and forwarding it to your .email_address.")); 12endif 13oplayer = player; 14player = this; 15error = $network:sendmail(this.email_address, @msg); 16if (error && (length(args) > 1)) 17this:notify(tostr("Mail sending failed: ", error)); 18endif 19player = oplayer; 20return error; 21endif
@netforw*ard
Referenced by
none
Source
1"@netforward <msg>... -- as in help on @netforward"; 2"@netforward <msg>... on *<recipient> -- netforwards messages on recipient."; 3"This command forwards mail-messages to your registered email-address."; 4if (player != this) 5return player:tell(E_PERM); 6endif 7if (reason = $network:email_will_fail(email = player.email_address)) 8return player:notify(tostr("Cannot forward mail to your email address: ", reason)); 9endif 10set_task_perms(valid(cp = caller_perms()) ? cp | player); 11if (p = player:parse_mailread_cmd(verb, args, "", "on")) 12player:set_current_folder(folder = p[1]); 13msg_seq = p[2]; 14folderstr = (folder == player) ? "" | tostr(" from ", $mail_agent:name(folder)); 15if ((!this:mail_option("expert_netfwd")) && (!$command_utils:yes_or_no(tostr("You are about to forward ", seq_size = $seq_utils:size(msg_seq), " message(s)", folderstr, " to your registered email-address, ", email, ". Continue?")))) 16player:notify(tostr("@Netforward cancelled.")); 17return; 18endif 19player:notify("Attempting to send network mail..."); 20player._mail_task = task_id(); 21multiple_vals = this:format_for_netforward(folder:messages_in_seq(msg_seq), folderstr); 22netmail = multiple_vals[1]; 23header = multiple_vals[2]; 24reason = player:send_self_netmail({header, @netmail}); 25player:notify((reason == 0) ? tostr("@netforward of ", header, " completed.") | tostr("@netforward failed: ", reason, ".")); 26endif
@@sendmail
Referenced by
none
Source
1"Syntax: @@sendmail"; 2"This is intended for use with client editors. You probably don't want to try using this command manually."; 3"Reads a formatted mail message, extracts recipients, subject line and/or reply-to header and sends message without going to the mailroom. Example:"; 4""; 5"@@send"; 6"To: Rog (#4292)"; 7"Subject: random"; 8""; 9"first line"; 10"second line"; 11"."; 12""; 13"Currently, header lines must have the same format as in an actual message."; 14set_task_perms(player); 15if (args) 16player:notify(tostr("The ", verb, " command takes no arguments.")); 17$command_utils:read_lines(); 18return; 19elseif (this != player) 20player:notify(tostr("You can't use ", this.pp, " ", verb, " verb.")); 21$command_utils:read_lines(); 22return; 23endif 24msg = $command_utils:read_lines(); 25end_head = ("" in msg) || (length(msg) + 1); 26from = this; 27subject = ""; 28replyto = ""; 29rcpts = {}; 30body = msg[end_head + 1..$]; 31for i in [1..end_head - 1] 32line = msg[i]; 33if (index(line, "Subject:") == 1) 34subject = $string_utils:trim(line[9..$]); 35elseif (index(line, "To:") == 1) 36if (!(rcpts = $mail_agent:parse_address_field(line))) 37player:notify("No recipients found in To: line"); 38return; 39endif 40elseif (index(line, "Reply-to:") == 1) 41if ((!(replyto = $mail_agent:parse_address_field(line))) && $string_utils:trim(line[10..$])) 42player:notify("No address found in Reply-to: line"); 43return; 44endif 45elseif (index(line, "From:") == 1) 46"... :send_message() bombs if designated sender != player ..."; 47if (!(from = $mail_agent:parse_address_field(line))) 48player:notify("No sender found in From: line"); 49return; 50elseif (length(from) > 1) 51player:notify("Multiple senders?"); 52return; 53endif 54from = from[1]; 55elseif (i = index(line, ":")) 56player:notify(tostr("Unknown header \"", line[1..i], "\"")); 57return; 58else 59player:notify("Blank line must separate headers from body."); 60return; 61endif 62endfor 63if (!rcpts) 64player:notify("No To: line found."); 65elseif (!(subject || body)) 66player:notify("Blank message not sent."); 67else 68player:notify("Sending..."); 69result = $mail_agent:send_message(from, rcpts, replyto ? subject | {subject, replyto}, body); 70if (e = result && result[1]) 71if (length(result) == 1) 72player:notify("Mail actually went to no one."); 73else 74player:notify(tostr("Mail actually went to ", $mail_agent:name_list(@listdelete(result, 1)), ".")); 75endif 76else 77player:notify(tostr((typeof(e) == ERR) ? e | ("Bogus recipients: " + $string_utils:from_list(result[2])))); 78player:notify("Mail not sent."); 79endif 80endif
@keep-m*ail @keepm*ail
Referenced by
none
Source
1"@keep-mail [<msg-sequence>|none] [on <recipient>]"; 2"marks the indicated messages as `kept'."; 3set_task_perms(valid(cp = caller_perms()) ? cp | player); 4if (!args) 5return player:notify("Usage: @keep-mail [<msg-sequence>|none] [on <recipient>]"); 6elseif (args[1] == "none") 7args[1..1] = {}; 8if (!(pfs = this:parse_folder_spec(verb, args, "on", 0))) 9return; 10elseif (pfs[2]) 11player:notify(tostr(verb, " <message-sequence> or `none', but not both.")); 12return; 13endif 14this:set_current_folder(folder = pfs[1]); 15if (e = folder:keep_message_seq({})) 16player:notify(tostr("Messages on ", $mail_agent:name(folder), " are no longer marked as kept.")); 17else 18player:notify(tostr(e)); 19endif 20return; 21elseif (p = this:parse_mailread_cmd(verb, args, "", "on")) 22if ((folder = p[1]) != this) 23"... maybe I'll take this clause out some day..."; 24player:notify(tostr(verb, " can only be used on your own mail collection.")); 25return; 26endif 27this:set_current_folder(folder); 28if (e = folder:keep_message_seq(msg_seq = p[2])) 29player:notify(tostr("Message", match(e, "[.,]") ? "s " | " ", e, " now marked as kept.")); 30elseif (typeof(e) == ERR) 31player:notify(tostr(e)); 32else 33player:notify(tostr(((seq_size = $seq_utils:size(msg_seq)) == 1) ? "That message is" | "Those messages are", " already marked as kept.")); 34endif 35endif
my_match_recipient
Referenced by
none
Source
1":my_match_recipient(string) => matches string against player's private mailing lists."; 2if (!(string = args[1])) 3return $nothing; 4elseif (string[1] == "*") 5string = string[2..$]; 6endif 7return $string_utils:match(string, this.mail_lists, "aliases");
expire_old_messages
Referenced by
none
Source
1set_task_perms(caller_perms()); 2if (!$perm_utils:controls(caller_perms(), this)) 3return E_PERM; 4else 5seq = this:expirable_msg_seq(); 6if (seq) 7this:rm_message_seq(seq); 8return this:expunge_rmm(); 9else 10return 0; 11endif 12endif
msg_full_text
Referenced by
none
Source
1":msg_full_text(@msg) => list of strings."; 2"msg is a mail message (in the usual transmission format)."; 3"display_seq_full calls this to obtain the actual list of strings to display."; 4return player:msg_text(@args); 5"default is to leave it up to the player how s/he wants it to be displayed.";
@resend
Referenced by
none
Source
1"@resend <msg> [on *<recipient>] to <recipient> [<recipient>...]"; 2set_task_perms(valid(caller_perms()) ? caller_perms() | player); 3"..."; 4"... parse command..."; 5"..."; 6if (!(p = this:parse_mailread_cmd(verb, args, "", "on", 1))) 7"...lose..."; 8return; 9elseif ($seq_utils:size(sequence = p[2]) != 1) 10player:notify("You can only resend *one* message at a time."); 11return; 12elseif ((length(p[4]) < 2) || (p[4][1] != "to")) 13player:notify(tostr("Usage: ", verb, " [<message>] [on <folder>] to <recip>...")); 14return; 15endif 16recips = {}; 17for rs in (listdelete(p[4], 1)) 18if ($mail_agent:match_failed(r = $mail_agent:match_recipient(rs), rs)) 19return; 20endif 21recips = {@recips, r}; 22endfor 23this:set_current_folder(folder = p[1]); 24"..."; 25"... retrieve original message..."; 26"..."; 27{msgnum, msgtxt} = folder:messages_in_seq(sequence)[1]; 28if (forward_style = this:mail_option("resend_forw")) 29"...message will be from player..."; 30pmh = $mail_agent:parse_misc_headers(msgtxt, "Reply-To", "Original-Date", "Original-From"); 31orig_from = pmh[3][3] || msgtxt[2]; 32else 33"...message will be from author..."; 34pmh = $mail_agent:parse_misc_headers(msgtxt, "Reply-To", "Original-Date", "Original-From", "Resent-By", "Resent-To"); 35orig_from = pmh[3][3]; 36from = $mail_agent:parse_address_field(msgtxt[2])[1]; 37to = $mail_agent:parse_address_field(msgtxt[3]); 38endif 39"..."; 40"... report bogus headers..."; 41"..."; 42if (bogus = pmh[2]) 43player:notify("Bogus headers stripped from original message:"); 44for b in (bogus) 45player:notify(" " + b); 46endfor 47if (!$command_utils:yes_or_no("Continue?")) 48player:notify("Message not resent."); 49return; 50endif 51endif 52"..."; 53"... subject, replyto, original-date, original-from ..."; 54"..."; 55hdrs = {msgtxt[4], pmh[3][1], {"Original-Date", pmh[3][2] || ctime(msgtxt[1])}, @orig_from ? {{"Original-From", orig_from}} | {}, @pmh[1]}; 56"..."; 57"... send it ..."; 58"..."; 59if (forward_style) 60result = $mail_agent:send_message(player, recips, hdrs, pmh[4]); 61else 62"... resend inserts resent-to and resent-by..."; 63result = $mail_agent:resend_message(player, recips, from, to, hdrs, pmh[4]); 64endif 65"..."; 66"... report outcome..."; 67"..."; 68if (!result) 69player:notify(tostr(result)); 70elseif (result[1]) 71player:notify(tostr("Message ", msgnum, @(folder == this) ? {} | {" on ", $mail_agent:name(folder)}, " @resent to ", $mail_agent:name_list(@listdelete(result, 1)), ".")); 72else 73player:notify("Message not resent."); 74endif
make_current_message_new
Referenced by
none
Source
1":make_current_message(recipient[,index])"; 2"starts a new current_message record for recipient."; 3"index, if given, indicates where recipient is to be"; 4" placed (n = at or after nth entry in .current_message)."; 5recip = args[1]; 6cm = this.current_message; 7if (length(args) > 1) 8i = max(2, min(args[2], length(cm))); 9else 10i = 0; 11endif 12if ((caller != this) && (!$perm_utils:controls(caller_perms(), this))) 13raise(E_PERM); 14elseif (recip == this) 15"...self..."; 16elseif (j = $list_utils:iassoc(recip, cm)) 17"...already present..."; 18if (i) 19if (j < i) 20this.current_message = {@cm[1..j - 1], @cm[j + 1..i], cm[j], @cm[i + 1..$]}; 21elseif (j > (i + 1)) 22this.current_message = {@cm[1..i], cm[j], @cm[i + 1..j - 1], @cm[j + 1..$]}; 23endif 24endif 25else 26this.current_message = listappend(cm, {recip, 0, 0}, @i ? {i} | {}); 27endif
expirable_msg_seq
Referenced by
- #40:expire_old_messages line 5:
this:expirable_msg_seq
Source
1"Return a sequence indicating the expirable messages for this player."; 2set_task_perms(caller_perms()); 3if (!$perm_utils:controls(caller_perms(), this)) 4return E_PERM; 5elseif (!(curmsg = this:get_current_message(this))) 6"No messages! Don't even try."; 7return {}; 8elseif (0 >= (period = this:mail_option("expire") || $mail_agent.player_expire_time)) 9"...no expiration allowed here..."; 10return {}; 11else 12return $seq_utils:remove(this:unkept_msg_seq(), 1 + this:length_date_le(min(time() - period, curmsg[2] - 86400))); 13"... the 86400 is pure fudge..."; 14endif
format_for_netforward
Referenced by
- #40:@netforw*ard line 21:
this:format_for_netforward
Source
1"Takes a message sequence (the actual messages, not just the sequence describing it) and grovels over it filling text etc. Returns a two valued list: {formatted message, header for same}"; 2set_task_perms(caller_perms()); 3{message_seq, folderstr} = args; 4netmail = {}; 5linelen = this:linelen(); 6maxmsg = minmsg = 0; 7for msg in (message_seq) 8minmsg = minmsg ? min(msg[1], minmsg) | msg[1]; 9maxmsg = maxmsg ? max(msg[1], maxmsg) | msg[1]; 10lines = {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} | {}}; 11for line in (msg[2][5..$]) 12if (typeof(line) != STR) 13"I don't know how this can happen, but apparently non-strings can end up in the mail message. So, cope."; 14line = tostr(line); 15endif 16lines = {@lines, @$generic_editor:fill_string(line, linelen)}; 17$command_utils:suspend_if_needed(0); 18endfor 19netmail = {@netmail, @lines, "", "--------------------------", "", ""}; 20endfor 21header = tostr($network.MOO_name, " Message(s) ", minmsg, @(minmsg != maxmsg) ? {" - ", maxmsg} | {}, folderstr); 22return {netmail, header};
format_for_netforward_debug
Referenced by
none
Source
1"Takes a message sequence (the actual messages, not just the sequence describing it) and grovels over it filling text etc. Returns a two valued list: {formatted message, header for same}"; 2set_task_perms(caller_perms()); 3{message_seq, folderstr} = args; 4netmail = {}; 5linelen = this:linelen(); 6maxmsg = minmsg = 0; 7for msg in (message_seq) 8minmsg = minmsg ? min(msg[1], minmsg) | msg[1]; 9maxmsg = maxmsg ? max(msg[1], maxmsg) | msg[1]; 10lines = {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} | {}}; 11for line in (msg[2][5..$]) 12if (typeof(line) != STR) 13"I don't know how this can happen, but apparently non-strings can end up in the mail message. So, cope."; 14line = tostr(line); 15endif 16lines = {@lines, @$generic_editor:fill_string(line, linelen)}; 17$command_utils:suspend_if_needed(0); 18endfor 19netmail = {@netmail, @lines, "", "--------------------------", "", ""}; 20endfor 21header = tostr($network.MOO_name, " Message(s) ", minmsg, @(minmsg != maxmsg) ? {" - ", maxmsg} | {}, folderstr); 22return {netmail, header};
@nn
Referenced by
none
Source
1"@nn -- reads the first new message on the first mail_recipient (in .current_message) where new mail exists."; 2if ((parent(player) == $guest) || `parent(player) == $local.guest ! E_PROPNF => 0') 3set_task_perms($hacker); 4else 5set_task_perms(valid(cp = caller_perms()) ? cp | player); 6endif 7cm = this.current_message; 8cm[1..2] = {{this, @cm[1..2]}}; 9for n in (cm) 10if (new = n[1]:length_date_gt(n[3])) 11next = (n[1]:length_all_msgs() - new) + 1; 12this:set_current_folder(folder = n[1]); 13this._mail_task = task_id(); 14cur = folder:display_seq_full({next, next + 1}, tostr("Message %d", " on ", $mail_agent:name(folder), ":")); 15this:set_current_message(folder, @cur); 16return; 17endif 18endfor 19player:tell("No News (is good news)");
@unread
Referenced by
none
Source
1"@unread <msg> [on *<recipient>] -- resets last-read-date for recipient to just before the first of the indicated messages."; 2set_task_perms(player); 3if (p = this:parse_mailread_cmd("@unread", args, "cur", "on")) 4this:set_current_folder(folder = p[1]); 5msg_ord = $seq_utils:first(msg_seq = p[2]); 6msgdate = folder:messages_in_seq(msg_ord)[2][1] - 1; 7if ((!(cm = this:get_current_message(folder))) || (cm[2] < msgdate)) 8player:notify("Already unread."); 9else 10if (folder == this) 11this.current_message[2] = msgdate - 1; 12else 13this:kill_current_message(folder); 14this:set_current_message(folder, cm[1], min(cm[2], msgdate)); 15endif 16folder:display_seq_headers({msg_ord, msg_ord + 1}, cm[1], msgdate); 17endif 18endif
@refile @copym*ail
Referenced by
none
Source
1"@refile/@copym*ail <msg-sequence> [on <recipient>] to <recipient>"; 2"@refile will delete the messages from the source folder. @copym does not."; 3"I'm not happy with this one, yet..."; 4set_task_perms(player); 5if (!(p = this:parse_mailread_cmd("@refile", args, "cur", "on", 1))) 6"...lose..."; 7elseif ((length(p[4]) != 2) || (p[4][1] != "to")) 8player:notify(tostr("Usage: ", verb, " [<message numbers>] [on <folder>] to <folder>")); 9elseif ($mail_agent:match_failed(dest = $mail_agent:match_recipient(p[4][2]), p[4][2])) 10"...bogus destination folder..."; 11else 12source = p[1]; 13msg_seq = p[2]; 14for m in (source:messages_in_seq(msg_seq)) 15if (!(e = dest:receive_message(m[2], source))) 16player:notify(tostr("Copying msg. ", m[1], ": ", e)); 17return; 18endif 19$command_utils:suspend_if_needed(0); 20endfor 21if (refile = verb == "@refile") 22if (typeof(e = source:rm_message_seq(msg_seq)) == ERR) 23player:notify(tostr("Deleting from ", source, ": ", e)); 24endif 25endif 26count = tostr(n = $seq_utils:size(msg_seq), " message", (n == 1) ? "" | "s"); 27fname = (source == this) ? "" | tostr(is_player(source) ? " from " | " from *", source.name, "(", source, ")"); 28suffix = tostr(is_player(dest) ? " to " | " to *", dest.name, "(", dest, ")."); 29player:notify(tostr(refile ? "Refiled " | "Copied ", count, fname, suffix)); 30endif
@quickr*eply @qreply
Referenced by
none
Source
1"@qreply <msg> [on *<recipient>] [<flags>...]"; 2"like @reply only, as in @qsend, we prompt for the message text using "; 3"$command_utils:read_lines() rather than invoking the $mail_editor."; 4set_task_perms(who = valid(cp = caller_perms()) ? cp | player); 5if (!(p = this:parse_mailread_cmd(verb, args, "cur", "on", 1))) 6"...garbled..."; 7elseif ($seq_utils:size(p[2]) != 1) 8player:notify("You can only answer *one* message at a time."); 9elseif (LIST != typeof(flags_replytos = $mail_editor:check_answer_flags("noinclude", @p[4]))) 10player:notify_lines({tostr("Usage: ", verb, " [message-# [on <recipient>]] [flags...]"), "where flags include any of:", " all reply to everyone", " sender reply to sender only", tostr(" include include the original message in reply (can't do this for ", verb, ")"), " noinclude don't include the original in your reply"}); 11elseif ("include" in flags_replytos[1]) 12player:notify(tostr("Can't include message on a ", verb)); 13else 14this:set_current_folder(p[1]); 15if (to_subj = $mail_editor:parse_msg_headers(p[1]:messages_in_seq(p[2])[1][2], flags_replytos[1])) 16player:notify(tostr("To: ", $mail_agent:name_list(@to_subj[1]))); 17if (to_subj[2]) 18player:notify(tostr("Subject: ", to_subj[2])); 19endif 20if (replytos = flags_replytos[2]) 21player:notify(tostr("Reply-to: ", $mail_agent:name_list(@replytos))); 22endif 23hdrs = {to_subj[2], replytos || {}}; 24player:notify("Enter lines of message:"); 25message = $command_utils:read_lines_escape((active = player in $mail_editor.active) ? {} | {"@edit"}, {tostr("You are composing mail to ", $mail_agent:name_list(@to_subj[1]), "."), @active ? {} | {"Type `@edit' to take this into the mail editor."}}); 26if (typeof(message) == ERR) 27player:notify(tostr(message)); 28elseif (message[1] == "@edit") 29$mail_editor:invoke(1, verb, to_subj[1], @hdrs, message[2]); 30elseif (!message[2]) 31player:notify("Blank message not sent."); 32else 33result = $mail_agent:send_message(this, to_subj[1], hdrs, message[2]); 34if (result && result[1]) 35player:notify(tostr("Message sent to ", $mail_agent:name_list(@listdelete(result, 1)), ".")); 36else 37player:notify("Message not sent."); 38endif 39endif 40endif 41endif
@mail-all-new*-mail
Referenced by
none
Source
1"@mail-all-new-mail"; 2" Prints headers for all new mail on every mail-recipient mentioned in .current_message."; 3set_task_perms(valid(cp = caller_perms()) ? cp | player); 4cm = this.current_message; 5cm[1..2] = {{this, @cm[1..2]}}; 6this._mail_task = task_id(); 7nomail = 1; 8new_cms = {}; 9for f in (cm) 10if (!($object_utils:isa(folder = f[1], $player) || $object_utils:isa(folder, $mail_recipient))) 11player:notify(tostr(folder, " is neither a $player nor a $mail_recipient")); 12elseif (typeof(flen = folder:length_all_msgs()) == ERR) 13player:notify(tostr($mail_agent:name(folder), " ", flen)); 14elseif (msg_seq = $seq_utils:range(folder:length_date_le(f[3]) + 1, flen)) 15nomail = 0; 16player:notify("===== " + $string_utils:left(tostr($mail_agent:name(folder), " (", s = $seq_utils:size(msg_seq), " message", (s == 1) ? ") " | "s) "), 40, "=")); 17folder:display_seq_headers(msg_seq, @f[2..3]); 18player:notify(""); 19$command_utils:suspend_if_needed(2); 20endif 21endfor 22if (nomail) 23player:notify("You don't have any new mail anywhere."); 24else 25player:notify("===== " + $string_utils:left("End of new mail ", 40, "=")); 26endif
@read-all-new*-mail @ranm
Referenced by
none
Source
1"@read-all-new-mail [yes]"; 2" Prints all new mail on every mail-recipient mentioned in .current_message"; 3" Generally this will spam you into next Tuesday."; 4" You will be queried for whether you want your last-read dates updated"; 5" but you can specify \"yes\" on the command line to suppress this."; 6" If you do so, last-read dates will be updated after each folder read."; 7set_task_perms(valid(cp = caller_perms()) ? cp | player); 8noconfirm = args && ("yes" in args); 9cm = this.current_message; 10cm[1..2] = {{this, @cm[1..2]}}; 11this._mail_task = task_id(); 12nomail = 1; 13new_cms = {}; 14for f in (cm) 15if (!($object_utils:isa(folder = f[1], $player) || $object_utils:isa(folder, $mail_recipient))) 16player:notify(tostr(folder, " is neither a $player nor a $mail_recipient")); 17elseif (typeof(flen = folder:length_all_msgs()) == ERR) 18player:notify(tostr($mail_agent:name(folder), " ", flen)); 19elseif (msg_seq = $seq_utils:range(folder:length_date_le(f[3]) + 1, flen)) 20nomail = 0; 21player:notify("===== " + $string_utils:left(tostr($mail_agent:name(folder), " (", s = $seq_utils:size(msg_seq), " message", (s == 1) ? ") " | "s) "), 40, "=")); 22player:notify(""); 23if (cur = folder:display_seq_full(msg_seq, tostr("Message %d", (folder == this) ? "" | (" on " + $mail_agent:name(folder)), ":"))) 24if (noconfirm) 25this:set_current_message(folder, @cur); 26this:set_current_folder(folder); 27else 28new_cms = {@new_cms, {folder, @cur}}; 29endif 30player:notify(""); 31endif 32endif 33$command_utils:suspend_if_needed(1); 34this._mail_task = task_id(); 35endfor 36if (nomail) 37player:notify("You don't have any new mail anywhere."); 38elseif (player:notify("===== " + $string_utils:left("End of new mail ", 40, "=")) || (noconfirm || $command_utils:yes_or_no("Did you get all of that?"))) 39for n in (new_cms) 40this:set_current_message(@n); 41this:set_current_folder(n[1]); 42endfor 43player:notify("Last-read-dates updated"); 44else 45player:notify("Last-read-dates not updated"); 46endif
@quick*send @qsend
Referenced by
none
Source
1"Syntax: @quicksend <recipients(s)> [subj=<text>] [<message>]"; 2"Sends the recipients(s) a quick message, wit{out having to go to the mailroom. If there is more than one recipients, place them all in quotes. If the subj contains spaces, place it in quotes."; 3"To put line breaks in the message, use a caret (^)."; 4"If no message is given, prompt for lines of message."; 5"Examples:"; 6"@quicksend Alice subj=\"Wonderland is neat!\" Have you checked out the Wonderland scenario yet? I think you'd like it!"; 7"@quicksend \"Ethel Fred\" Have you seen Lucy around?^--Ricky"; 8set_task_perms(player); 9if (!args) 10player:notify(tostr("Usage: ", verb, " <recipients(s)> [subj=<text>] [<message>]")); 11return E_INVARG; 12elseif (this != player) 13player:notify(tostr("You can't use ", this.pp, " @quicksend verb.")); 14return E_PERM; 15elseif (!(recipients = $mail_editor:parse_recipients({}, $string_utils:explode(args[1])))) 16return; 17else 18if ((length(args) > 1) && ((eq = index(args[2], "=")) && (index("subject", args[2][1..eq - 1]) == 1))) 19subject = $string_utils:trim(args[2][eq + 1..$]); 20ws = $string_utils:word_start(argstr); 21argstr = argstr[1..ws[1][2]] + argstr[ws[2][2] + 1..$]; 22args = listdelete(args, 2); 23else 24subject = ""; 25endif 26if (length(args) > 1) 27unbroken = argstr[(argstr[1] == "\"") ? length(args[1]) + 4 | (length(args[1]) + 2)..$] + "^"; 28message = {}; 29while (unbroken) 30if (i = index(unbroken, "^")) 31message = {@message, unbroken[1..i - 1]}; 32endif 33unbroken = unbroken[i + 1..$]; 34endwhile 35else 36if (!(subject || player:mail_option("nosubject"))) 37player:notify("Subject:"); 38subject = $command_utils:read(); 39endif 40player:notify("Enter lines of message:"); 41message = $command_utils:read_lines_escape((active = player in $mail_editor.active) ? {} | {"@edit"}, {tostr("You are composing mail to ", $mail_agent:name_list(@recipients), "."), @active ? {} | {"Type `@edit' to take this into the mail editor."}}); 42if (typeof(message) == ERR) 43player:notify(tostr(message)); 44return; 45elseif (message[1] == "@edit") 46$mail_editor:invoke(1, verb, recipients, subject, {}, message[2]); 47return; 48elseif (!(message[2] || subject)) 49player:notify("Blank message not sent."); 50return; 51endif 52message = message[2]; 53endif 54result = $mail_agent:send_message(this, recipients, subject, message); 55if (result && result[1]) 56player:notify(tostr("Message sent to ", $mail_agent:name_list(@listdelete(result, 1)), ".")); 57else 58player:notify("Message not sent."); 59endif 60endif
init_for_core
Referenced by
- #91:init_for_core line 42:
pass(
Source
1if (caller_perms().wizard) 2pass(); 3this.mail_options = {}; 4endif
confunc
Referenced by
- #31:confunc line 5:
pass( - #90:confunc line 5:
pass(
Source
1if (((valid(cp = caller_perms()) && (caller != this)) && (!$perm_utils:controls(cp, this))) && (caller != #0)) 2return E_PERM; 3endif 4nm = this:length_all_msgs() - this:length_date_le(this:get_current_message()[2]); 5if (nm) 6this:notify(tostr("You have new mail (", nm, " message", (nm == 1) ? "" | "s", ").", this:mail_option("expert") ? "" | " Type 'help mail' for info on reading it.")); 7endif 8this:mail_catch_up(); 9this:check_mail_lists(); 10pass(@args);
@add-notify
Referenced by
none
Source
1"Ideally, in order for one person to be notified that another person has new mail, both the mail recipient and the notification recipient should agree that this is an OK transfer of information."; 2"Usage: @add-notify me to player"; 3" Sends mail to player saying that I want to be added to their mail notification property."; 4"Usage: @add-notify player to me"; 5" Makes sure that player wants to be notified, if so, adds them to my .mail_notify property. (Deletes from temporary record.)"; 6if (this == dobj) 7target = $string_utils:match_player(iobjstr); 8if ($command_utils:player_match_failed(target, iobjstr)) 9return; 10elseif (this in target.mail_notify[1]) 11player:tell("You already receive notifications when ", target.name, " receives mail."); 12elseif (this in target.mail_notify[2]) 13player:tell("You already asked to be notified when ", target.name, " receives mail."); 14else 15$mail_agent:send_message(player, {target}, "mail notification request", {tostr($string_utils:nn(this), " would like to receive mail notifications when you get mail."), "Please type:", tostr(" @add-notify ", this.name, " to me"), "if you wish to allow this action."}); 16player:tell("Notifying ", $string_utils:nn(target), " that you would like to be notified when ", target.ps, " receives mail."); 17target.mail_notify[2] = setadd(target.mail_notify[2], this); 18endif 19elseif (this == iobj) 20target = $string_utils:match_player(dobjstr); 21if ($command_utils:player_match_failed(target, dobjstr)) 22return; 23elseif (target in this.mail_notify[2]) 24this.mail_notify[1] = setadd(this.mail_notify[1], target); 25this.mail_notify[2] = setremove(this.mail_notify[2], target); 26player:tell(target.name, " will be notified when you receive mail."); 27else 28player:tell("It doesn't look like ", target.name, " wants to be notified when you receive mail."); 29endif 30else 31player:tell("Usage: @add-notify me to player"); 32player:tell(" @add-notify player to me"); 33endif
mail_notify
Referenced by
none
Source
1if ((length(this.mail_notify) > 0) && (typeof(this.mail_notify[1]) == LIST)) 2return this.mail_notify[1]; 3else 4return this.mail_notify; 5endif