View/Edit #12:set_current_message

Switch to edit mode.

Name(s): set_current_message
1:  ":set_current_message(recipient[,number[,date]])"
2:  "Returns the new {number,last-read-date} pair for recipient."
3:  if (caller != this && !$perm_utils:controls(caller_perms(), this))
4:    raise(E_PERM)
5:  endif
6:  {recip, ?number = E_NONE, ?date = 0} = args
7:  cm = this.current_message
8:  if (number != E_NONE)
9:    $mail_db:set_message_read(recip:get_message_id(number), this, recip)
10: endif
11: if (recip == this)
12:   this.current_message[2] = max(date, cm[2])
13:   if (number != E_NONE)
14:     this.current_message[1] = number
15:   endif
16:   return this.current_message[1..2]
17: elseif (i = $list_utils:iassoc(recip, cm))
18:   this.current_message[i] = {recip, number == E_NONE ? cm[i][2] | number, max(date, cm[i][3])}
19:   return this.current_message[i][2..3]
20: else
21:   entry = {recip, number != E_NONE && number, date}
22:   this.current_message = {@cm, entry}
23:   return entry[2..3]
24: endif
25: "Last modified by whiz (#3135) on Thu Jan 24 00:03:02 2008 EST."

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

You are not logged in.

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