View/Edit #12:@unsub*scribe

Switch to edit mode.

Name(s): @unsub*scribe
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."
4:  set_task_perms(player)
5:  unsubscribed = {}
6:  current_folder = this:current_folder()
7:  for a in (args || {0})
8:    if (a ? $mail_agent:match_failed(folder = $mail_agent:match_recipient(a), a) | (folder = current_folder))
9:      "...bogus folder name, done...  No, try anyway."
10:     if (this:kill_current_message(this:my_match_object(a)))
11:       player:notify("Invalid folder, but found it subscribed anyway.  Removed.")
12:     endif
13:   elseif (folder == this)
14:     player:notify(tostr("You can't ", verb, " yourself."))
15:   else
16:     for msg in (`folder.messages ! E_PERM => {}')
17:       try
18:         $mail_db:set_message_read(msg[3], player, folder)
19:       except (E_RANGE)
20:       endtry
21:       $cmd_utils:suspend_if_needed(0)
22:     endfor
23:     if (!this:kill_current_message(folder))
24:       player:notify(tostr("You weren't subscribed to ", $mail_agent:name(folder)))
25:       if ($object_utils:isa(folder, $newsgroup))
26:         result = folder:delete_notify(this)
27:         if (typeof(result) == $LIST && result[1] == this)
28:           player:notify("Removed you from the mail notifications list.")
29:         endif
30:       endif
31:     else
32:       unsubscribed = {@unsubscribed, folder}
33:       if ($object_utils:isa(folder, $newsgroup))
34:         folder:delete_notify(this)
35:       endif
36:     endif
37:   endif
38: endfor
39: if (unsubscribed)
40:   player:notify(tostr("Unsubscribing ", $string_utils:english_list($list_utils:map_arg($mail_agent, "name", unsubscribed))))
41:   if (current_folder in unsubscribed)
42:     this:set_current_folder(this)
43:   endif
44: endif
45: "Last modified by Dax (#789) on Tue May  3 13:55:52 2005 MDT."

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

You are not logged in.

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