From 7416e50daa6f792f73e47141fa7ac3bfc843b1e0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 16 Sep 2008 15:53:46 -0400 Subject: inbox and outbox for direct messages Added an inbox and outbox for direct messages. Factored common code to mailbox.php. Factored common code with stream.php to personal.php. darcs-hash:20080916195346-84dde-b5c846f713a970c41fd1b0671cb333e91f3cb920.gz --- actions/outbox.php | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 actions/outbox.php (limited to 'actions/outbox.php') diff --git a/actions/outbox.php b/actions/outbox.php new file mode 100644 index 000000000..b09cd2032 --- /dev/null +++ b/actions/outbox.php @@ -0,0 +1,50 @@ +. + */ + +if (!defined('LACONICA')) { exit(1); } + +require_once(INSTALLDIR.'/lib/mailbox.php'); + +class OutboxAction extends MailboxAction { + + function get_title($user, $page) { + if ($page > 1) { + $title = sprintf(_("Outbox for %s - page %d"), $user->nickname, $page); + } else { + $title = sprintf(_("Outbox for %s"), $user->nickname); + } + } + + function get_messages($user, $page) { + $message = new Message(); + $message->from_profile = $user->id; + $message->orderBy('created DESC, id DESC'); + $message->limit((($page-1)*MESSAGES_PER_PAGE), MESSAGES_PER_PAGE + 1); + + if ($message->find()) { + return $message; + } else { + return NULL; + } + } + + function get_message_profile($message) { + return $message->getTo(); + } +} -- cgit v1.2.3-54-g00ecf