View/Edit #12:@skip

Switch to edit mode.

Name(s): @skip
1:  "Copied from Plarf (#9682):@skip Aug 13 16:16:42 2002"
2:  "@skip [number of messages to skip [on]] [*<folder/mailing_list>...]"
3:  "  marks the appropriate number of messages as read, or if no"
4:  "  number is given, all messages."
5:  current_folder = this:current_folder()
6:  total = $maxint
7:  if (argstr && dobjstr && toint(dobjstr) != 0 && !index(dobjstr, "#"))
8:    total = toint(dobjstr)
9:    args[0..1] = {}
10:   args[1] == "on" && (args[0..1] = {})
11: endif
12: if (argstr == "all")
13:   args = $list_utils:slice(this.current_message[3..$], 1)
14:   for x in (args)
15:     args[x in args] = tostr(x)
16:   endfor
17: endif
18: for a in (args || {0})
19:   if (a ? $mail_agent:match_failed(folder = $mail_agent:match_recipient(a), a) | (folder = this:current_folder()))
20:     "...bogus folder name, done...  No, try anyway."
21:     if (this:kill_current_message(this:my_match_object(a)))
22:       player:notify("Invalid folder, but found it subscribed anyway.  Removed.")
23:     endif
24:   else
25:     if (folder:isa($player) ? !$perm_utils:controls(this, folder) | !folder:is_readable_by(player))
26:       player:tell("Hey, you can't read " + folder:title() + "!  Nice try...")
27:       continue
28:     endif
29:     count = 0
30:     for msg in (folder:unread_messages(player))
31:       if (msgid = `folder:get_message_id(msg) ! ANY')
32:         $mail_Db:set_message_read(msgid, player, folder)
33:         count = count + 1
34:         if (count >= total)
35:           break
36:         endif
37:       endif
38:       $cmd_utils:suspend_if_needed(0)
39:     endfor
40:     player:tell(tostr(count ? tostr("Ignoring ", count) | "No", " unread message", count != 1 ? "s" | "", " on ", $mail_agent:name(folder)))
41:     if (current_folder == folder)
42:       this:set_current_folder(this)
43:     endif
44:   endif
45: endfor
46: "Last modified by Dax (#789) on Tue May  3 14:09:29 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]