From 6162de142c2765c770f43bf269f0444310551705 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 6 Nov 2013 18:28:36 -0800 Subject: allow private mail sender to set an expiration on their messages. Once expired the message is destroyed at both ends (subject to the granularity of the polling interval) and is gone. Officially it takes some form of language independent string like 2013/11/22, but English speakers can use anything that strtotime() understands, like "+30 minutes" or "next Tuesday". --- mod/message.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'mod/message.php') diff --git a/mod/message.php b/mod/message.php index a4d73e6b0..e31d903a7 100644 --- a/mod/message.php +++ b/mod/message.php @@ -40,6 +40,7 @@ function message_post(&$a) { $body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : ''); $recipient = ((x($_REQUEST,'messageto')) ? notags(trim($_REQUEST['messageto'])) : ''); $rstr = ((x($_REQUEST,'messagerecip')) ? notags(trim($_REQUEST['messagerecip'])) : ''); + $expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : '0000-00-00 00:00:00'); // If we have a raw string for a recipient which hasn't been auto-filled, // it means they probably aren't in our address book, hence we don't know @@ -111,7 +112,7 @@ function message_post(&$a) { // We have a local_user, let send_message use the session channel and save a lookup - $ret = send_message(0, $recipient, $body, $subject, $replyto); + $ret = send_message(0, $recipient, $body, $subject, $replyto, $expires); if(! $ret['success']) { notice($ret['message']); @@ -322,7 +323,8 @@ function message_content(&$a) { '$attach' => t('Attach file'), '$insert' => t('Insert web link'), '$wait' => t('Please wait'), - '$submit' => t('Submit') + '$submit' => t('Submit'), + '$expires' => t('Expires: (leave blank for never)') )); return $o; @@ -463,8 +465,6 @@ function message_content(&$a) { } - logger('mails: ' . print_r($mails,true), LOGGER_DATA); - $recp = (($message['from_xchan'] === $channel['channel_hash']) ? 'to' : 'from'); // FIXME - move this HTML to template @@ -498,8 +498,8 @@ function message_content(&$a) { '$attach' => t('Attach file'), '$insert' => t('Insert web link'), '$submit' => t('Submit'), - '$wait' => t('Please wait') - + '$wait' => t('Please wait'), + '$expires' => t('Expires: (leave blank for never)') )); return $o; -- cgit v1.2.3