From 4e17e6c9dbac8991ee8b302cb2581241247dc8bc Mon Sep 17 00:00:00 2001 From: thomascube Date: Sun, 25 Sep 2005 14:18:03 +0000 Subject: Initial revision --- program/steps/mail/mark.inc | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 program/steps/mail/mark.inc (limited to 'program/steps/mail/mark.inc') diff --git a/program/steps/mail/mark.inc b/program/steps/mail/mark.inc new file mode 100644 index 000000000..2dadb53eb --- /dev/null +++ b/program/steps/mail/mark.inc @@ -0,0 +1,41 @@ + | + +-----------------------------------------------------------------------+ + + $Id$ + +*/ + +$REMOTE_REQUEST = TRUE; + +$a_flags_map = array('read' => 'SEEN', + 'unread' => 'UNSEEN'); + +if ($_GET['_uid'] && $_GET['_flag']) + { + $flag = $a_flags_map[$_GET['_flag']] ? $a_flags_map[$_GET['_flag']] : strtoupper($_GET['_flag']); + $marked = $IMAP->set_flag($_GET['_uid'], $flag); + + if ($marked) + { + $mbox = $IMAP->get_mailbox_name(); + $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN')); + rcube_remote_response($commands); + } + } + +exit; +?> \ No newline at end of file -- cgit v1.2.3