View/Edit #12:@subscribe @unsubscribed

Switch to edit mode.

Name(s): @subscribe @unsubscribed
1:  "@subscribe *<folder/mailing_list> [with notify]"
2:  "  causes you to be notified of new mail on this list (either when you connect, or when new mail arrives)"
3:  "@subscribe"
4:  "   just lists available mailing lists."
5:  set_task_perms(player)
6:  if (!dobjstr)
7:    ml = $list_utils:slice(player.current_message[3..$])
8:    ngs = $list_utils:remove_duplicates({@$mail_agent.contents, @this.mail_lists})
9:    ngs = $newsgroups:sort_groups(ngs)
10:   for c in (ngs)
11:     $command_utils:suspend_if_needed()
12:     if (c:is_usable_by(player) || c:is_readable_by(player) && (verb != "@unsubscribed" || !(c in ml)))
13:       `c:look_self() ! ANY => "prevents nasty mailers from borking the rest"'
14:     endif
15:   endfor
16:   player:notify(tostr("-------- end of ", verb, " -------"))
17:   return
18: elseif ($mail_agent:match_failed(folder = $mail_agent:match_recipient(dobjstr), dobjstr))
19:   return
20: elseif (folder == this)
21:   player:notify("You don't need to @subscribe to yourself")
22:   return
23: elseif (!$perm_utils:controls(this, folder) && folder:isa($newsgroup) ? !folder:is_readable_by(this) | 0)
24:   player:notify("That mailing list is not readable by you.")
25:   if (!$command_utils:y_or_n("Subscribe anyways?  (mail will not be readable by you)"))
26:     return
27:   endif
28: endif
29: this:make_current_message(folder)
30: notification = iobjstr && iobjstr[1] == "n"
31: if ($object_utils:isa(folder, $newsgroup) && notification)
32:   folder:add_notify(this)
33: endif
34: make_believe_seq = folder:parse_message_seq("1..$")
35: if (typeof(make_believe_seq) == $LIST)
36:   for msg in [make_believe_seq[1][1]..make_believe_seq[1][$]]
37:     if (msg_id = `folder:get_message_id(msg) ! ANY')
38:       $mail_db:set_message_unread(msg_id, player, folder)
39:     endif
40:     $cmd_utils:suspend_if_needed(0)
41:   endfor
42: endif
43: len = folder:length_all_msgs()
44: player:tell(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."))
45: this:set_current_folder(folder)
46: "Last modified by Dax (#789) on Tue May  3 13:45:01 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]