]> git.mxchange.org Git - friendica.git/commitdiff
Basic forum support for Diaspora
authorMichael <heluecht@pirati.ca>
Tue, 30 Jan 2018 06:22:09 +0000 (06:22 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 30 Jan 2018 06:22:09 +0000 (06:22 +0000)
include/bbcode.php
src/Worker/Delivery.php

index fd7bcbf9b3195345dc5de9c18c44ff17b8b9abf2..20631818a2503fbe8167130edd644e1cccd6a41b 100644 (file)
@@ -997,8 +997,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
        if ((!$tryoembed || $simplehtml) && !in_array($simplehtml, [3, 7])) {
                $Text = preg_replace("/([#@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text);
        } elseif ($simplehtml == 3) {
+               // The ! is converted to @ since Diaspora only understands the @
                $Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
-                       '$1<a href="$2">$3</a>',
+                       '@<a href="$2">$3</a>',
                        $Text);
        } elseif ($simplehtml == 7) {
                $Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
index 5b03a10ec1cc266577e7a642861268c2e557f378..e8d432cc7ae01c9a7059ab7cf3a375a3171bb24d 100644 (file)
@@ -133,7 +133,8 @@ class Delivery {
                        return;
                }
 
-               $walltowall = (($top_level && ($owner['id'] != $items[0]['contact-id'])) ? true : false);
+               // We don't treat Forum posts as "wall-to-wall" to be able to post them via Diaspora
+               $walltowall = $top_level && ($owner['id'] != $items[0]['contact-id']) & ($owner['account-type'] != ACCOUNT_TYPE_COMMUNITY);
 
                $public_message = true;