From 43f98bc8542867ba3b098d8c6ba498b248d83286 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 4 Jul 2015 23:49:52 +0200 Subject: [PATCH 1/5] When posting to Diaspora, now the contact names are containing the link to the user profile. --- include/bbcode.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/bbcode.php b/include/bbcode.php index 6c5a400ddc..e872d859c5 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -887,8 +887,12 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal $MAILSearchString = $URLSearchString; // Remove all hashtag addresses - if ((!$tryoembed OR $simplehtml) AND ($simplehtml != 7)) + if ((!$tryoembed OR $simplehtml) AND !in_array($simplehtml, array(3, 7))) $Text = preg_replace("/([#@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text); + elseif ($simplehtml == 3) + $Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", + '$1$3', + $Text); elseif ($simplehtml == 7) $Text = preg_replace("/([@])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', From c356da2cadc04d05c930ae0d4ec34a52a605b55d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 5 Jul 2015 02:33:28 +0200 Subject: [PATCH 2/5] Diaspora: Improved parsing of linefeeds --- include/bb2diaspora.php | 9 +++++++++ view/theme/vier/style.css | 1 + 2 files changed, 10 insertions(+) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 34c932f745..69a87b3817 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -34,6 +34,15 @@ function diaspora2bb($s) { $s = str_replace('#','#',$s); + $search = array(" \n", "\n "); + $replace = array("\n", "\n"); + do { + $oldtext = $s; + $s = str_replace($search, $replace, $s); + } while ($oldtext != $s); + + $s = str_replace("\n\n", "
", $s); + $s = html2bbcode($s); // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 64edef3012..79309e338e 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -1216,6 +1216,7 @@ section.minimal { .wall-item-container .wall-item-content img { max-width: 100%; + vertical-align: middle; /* max-width: 650px; */ /* max-width: 580px; */ } From d6d51e02592d246d6b0e4e23ebfb7b9d030670ff Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 5 Jul 2015 16:27:03 +0200 Subject: [PATCH 3/5] Don't deliver answers to OStatus messages to Diaspora --- include/notifier.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/notifier.php b/include/notifier.php index 24dc63d696..67d5cdbbd8 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -406,9 +406,13 @@ function notifier_run(&$argv, &$argc){ } } } - } - $r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0"); + // It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora + $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."')"; + } else + $sql_extra = ""; + + $r = q("SELECT * FROM `contact` WHERE `id` IN ($conversant_str) AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0".$sql_extra); if(count($r)) $contacts = $r; From d55275f211f5e03f7dc60e2c460aa9d3d34f44d9 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 11 Jul 2015 14:37:02 +0200 Subject: [PATCH 4/5] GUID should be urlencoded in template since it is urlencoded in uri as well. --- include/diaspora.php | 6 ++++++ object/Item.php | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/diaspora.php b/include/diaspora.php index b70cffdc39..86a55f473f 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1,5 +1,11 @@ $body_e, 'text' => $text_e, 'id' => $this->get_id(), - 'guid' => $item['guid'], + 'guid' => urlencode($item['guid']), 'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, ((strlen($item['author-link'])) ? $item['author-link'] : $item['url'])), 'olinktitle' => sprintf( t('View %s\'s profile @ %s'), $this->get_owner_name(), ((strlen($item['owner-link'])) ? $item['owner-link'] : $item['url'])), 'to' => t('to'), From f6352aa9c64ccfa3853d26e5668d3c2a9116975a Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 12 Jul 2015 12:17:12 +0200 Subject: [PATCH 5/5] Remove a useless comment --- include/diaspora.php | 1 - 1 file changed, 1 deletion(-) diff --git a/include/diaspora.php b/include/diaspora.php index 86a55f473f..534e2541cb 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -3,7 +3,6 @@ /* To-Do: - GET /people/9aed8882b9f64896/stream -- POST /receive/users/9aed8882b9f64896/ */ require_once('include/crypto.php');