aboutsummaryrefslogtreecommitdiffstats
path: root/mod/message.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-06 18:28:36 -0800
committerfriendica <info@friendica.com>2013-11-06 18:28:36 -0800
commit6162de142c2765c770f43bf269f0444310551705 (patch)
tree6a3052455f58f8d3c9afe38ef993ca126757fe25 /mod/message.php
parent8b9633e46b7cdd4241e369d8f9cf10cec14956d2 (diff)
downloadvolse-hubzilla-6162de142c2765c770f43bf269f0444310551705.tar.gz
volse-hubzilla-6162de142c2765c770f43bf269f0444310551705.tar.bz2
volse-hubzilla-6162de142c2765c770f43bf269f0444310551705.zip
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".
Diffstat (limited to 'mod/message.php')
-rw-r--r--mod/message.php12
1 files changed, 6 insertions, 6 deletions
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;