]> git.mxchange.org Git - friendica.git/commitdiff
add attachments to Diaspora posts
authorFriendika <info@friendika.com>
Wed, 2 Nov 2011 00:30:52 +0000 (17:30 -0700)
committerFriendika <info@friendika.com>
Wed, 2 Nov 2011 00:30:52 +0000 (17:30 -0700)
include/diaspora.php

index f362a34789733d36e75c301735352b9e6a642c07..ac78beb2f9e58a9d2037307d01e19e577a71a7ac 100644 (file)
@@ -1418,6 +1418,17 @@ function diaspora_send_status($item,$owner,$contact,$public_batch = false) {
 
        $body = xmlify(html_entity_decode(bb2diaspora($body)));
 
+       if($item['attach']) {
+               $cnt = preg_match_all('/href=\"(.*?)\"(.*?)title=\"(.*?)\"/ism',$item['attach'],$matches,PREG_SET_ORDER);
+               if(cnt) {
+                       $body .= "\n" . t('Attachments:') . "\n";
+                       foreach($matches as $mtch) {
+                               $body .= '[' . $mtch[3] . '](' . $mtch[1] . ')' . "\n";
+                       }
+               }
+       }       
+
+
        $public = (($item['private']) ? 'false' : 'true');
 
        require_once('include/datetime.php');