View/Edit #12:@rn check_mail_lists @subscribed

Switch to edit mode.

Name(s): @rn check_mail_lists @subscribed
1:  set_task_perms(caller == this ? this.owner | caller_perms())
2:  $mail_agent:mailread_semaphore_enter(this)
3:  which = {}
4:  cm = this.current_message
5:  cm[1..2] = verb == "@rn" ? {{this, @cm[1..2]}} | {}
6:  all = verb == "@subscribed"
7:  for n in (cm)
8:    rcpt = n[1]
9:    if ($mail_agent:is_recipient(rcpt))
10:     if (`msgs = n[1]:unread_messages(this) ! E_PERM => {}' || all)
11:       msgs == E_PERM && (msgs = {})
12:       which = {@which, {n[1], length(msgs)}}
13:     endif
14:     "    if (`(nmsgs = n[1]:length_date_gt(n[3])) || all ! E_PERM => 0')"
15:     "      which = {@which, {n[1], nmsgs}};"
16:     "    endif"
17:   else
18:     player:notify(tostr("Bogus recipient ", rcpt, " removed from .current_message."))
19:     this.current_message = setremove(this.current_message, n)
20:   endif
21:   $command_utils:suspend_if_needed()
22: endfor
23: if (which)
24:   suspend(0)
25:   player:notify(verb == "@subscribed" ? "You are subscribed to the following lists:" | "There is new activity on the following lists:")
26:   for w in (which)
27:     name = $mail_agent:name(w[1])
28:     player:tell($string_utils:left("    " + name, 40), " ", w[2], " new message", w[2] == 1 ? "" | "s")
29:   endfor
30:   $cmd_utils:suspend_if_needed(0)
31: elseif (verb == "@rn")
32:   player:notify("No new activity on any of your lists.")
33: elseif (verb == "@subscribed")
34:   player:notify("You aren't subscribed to any mailing lists.")
35: endif
36: $mail_agent:mailread_semaphore_exit(this)
37: return which
38: "Last modified by Lao-Tzu (#8084) on Wed Jul 24 19:01:55 2002 MDT."

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

You are not logged in.

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