aboutsummaryrefslogtreecommitdiffstats
path: root/include/message.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-12-13 20:01:38 -0800
committerzotlabs <mike@macgirvin.com>2016-12-13 20:01:38 -0800
commit0394a3e93957b5bb6574ca95e290e414ed049404 (patch)
tree64763a081485babec1a5ca98ca87cbdf758ced2f /include/message.php
parent8e400e9e40dc115d81bd03581ea6da3badec5a19 (diff)
downloadvolse-hubzilla-0394a3e93957b5bb6574ca95e290e414ed049404.tar.gz
volse-hubzilla-0394a3e93957b5bb6574ca95e290e414ed049404.tar.bz2
volse-hubzilla-0394a3e93957b5bb6574ca95e290e414ed049404.zip
tag and mention handling in private mail (which required refactoring the bbcode cleanup stuff in mod_item)
Diffstat (limited to 'include/message.php')
-rw-r--r--include/message.php54
1 files changed, 22 insertions, 32 deletions
diff --git a/include/message.php b/include/message.php
index 95d8d9720..bde07afd8 100644
--- a/include/message.php
+++ b/include/message.php
@@ -16,6 +16,28 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
$a = get_app();
$observer_hash = get_observer_hash();
+
+ if($uid) {
+ $r = q("select * from channel where channel_id = %d limit 1",
+ intval($uid)
+ );
+ if($r)
+ $channel = $r[0];
+ }
+ else {
+ $channel = App::get_channel();
+ }
+
+ if(! $channel) {
+ $ret['message'] = t('Unable to determine sender.');
+ return $ret;
+ }
+
+
+ $body = cleanup_bbcode($body);
+ $results = linkify_tags($a, $body, $uid);
+
+
if(preg_match_all("/\[attachment\](.*?)\[\/attachment\]/",((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$match))
$attaches = $match[1];
@@ -43,22 +65,6 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
$jattach = (($attachments) ? json_encode($attachments) : '');
- if($preview) {
-
-
-
-
-
-
-
-
-
-
- }
-
-
-
-
if(! $recipient) {
$ret['message'] = t('No recipient provided.');
return $ret;
@@ -67,22 +73,6 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep
if(! strlen($subject))
$subject = t('[no subject]');
- if($uid) {
- $r = q("select * from channel where channel_id = %d limit 1",
- intval($uid)
- );
- if($r)
- $channel = $r[0];
- }
- else {
- $channel = App::get_channel();
- }
-
- if(! $channel) {
- $ret['message'] = t('Unable to determine sender.');
- return $ret;
- }
-
// look for any existing conversation structure