aboutsummaryrefslogtreecommitdiffstats
path: root/include/message.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-04-26 23:05:30 -0700
committerMario Vavti <mario@mariovavti.com>2017-06-09 23:54:35 +0200
commit97732f70063325ac875498a413e9ac1b6fca51f5 (patch)
tree700b0416d6605e1634333895c869e73401a5348d /include/message.php
parent8f2457855c89d0bac57694348608d9dad396dd36 (diff)
downloadvolse-hubzilla-97732f70063325ac875498a413e9ac1b6fca51f5.tar.gz
volse-hubzilla-97732f70063325ac875498a413e9ac1b6fca51f5.tar.bz2
volse-hubzilla-97732f70063325ac875498a413e9ac1b6fca51f5.zip
more client-side mail privacy work
Diffstat (limited to 'include/message.php')
-rw-r--r--include/message.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/include/message.php b/include/message.php
index 609ceb354..5458eeb0e 100644
--- a/include/message.php
+++ b/include/message.php
@@ -5,10 +5,20 @@
require_once('include/crypto.php');
require_once('include/attach.php');
+
+function mail_prepare_binary($item) {
+
+ return replace_macros(get_markup_template('item_binary.tpl'), [
+ '$download' => t('Download binary/encrypted content'),
+ '$url' => z_root() . '/mail/' . $item['id'] . '/download'
+ ]);
+}
+
+
// send a private message
-function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $replyto = '', $expires = NULL_DATE) {
+function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $replyto = '', $expires = NULL_DATE, $mimetype = 'text/bbcode', $raw = false) {
$ret = array('success' => false);
$is_reply = false;
@@ -192,8 +202,8 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
$sig = ''; // placeholder
$mimetype = ''; //placeholder
- $r = q("INSERT INTO mail ( account_id, conv_guid, mail_obscured, channel_id, from_xchan, to_xchan, mail_mimetype, title, body, sig, attach, mid, parent_mid, created, expires, mail_isreply )
- VALUES ( %d, '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )",
+ $r = q("INSERT INTO mail ( account_id, conv_guid, mail_obscured, channel_id, from_xchan, to_xchan, mail_mimetype, title, body, sig, attach, mid, parent_mid, created, expires, mail_isreply, mail_raw )
+ VALUES ( %d, '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
intval($channel['channel_account_id']),
dbesc($conv_guid),
intval(1),
@@ -209,7 +219,8 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
dbesc($replyto),
dbesc(datetime_convert()),
dbescdate($expires),
- intval($is_reply)
+ intval($is_reply),
+ intval($raw)
);
// verify the save