aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
committerPaolo T <tuscanhobbit@users.noreply.github.com>2014-10-12 09:15:39 +0200
commit56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41 (patch)
treec1376be525c85ab799f213ed79648d8c478da3d0 /include/diaspora.php
parent9edaa2843b9982f52fb1ed93b1c6e3d9e53921d7 (diff)
parent44c4c9c5c271a5ad163a089b1dc271d108a59700 (diff)
downloadvolse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.gz
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.tar.bz2
volse-hubzilla-56f6f696bd5dd5b8120d562d9f43fe94d8e6dd41.zip
Merge pull request #6 from tuscanhobbit/master
Fast forward local hub
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index f0687e51e..fb321a813 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -821,7 +821,7 @@ function diaspora_post($importer,$xml,$msg) {
foreach($tags as $tag) {
if(strpos($tag,'#') === 0) {
- if(strpos($tag,'[url='))
+ if((strpos($tag,'[url=')) || (strpos($tag,'[zrl')))
continue;
// don't link tags that are already embedded in links
@@ -1050,7 +1050,7 @@ function diaspora_reshare($importer,$xml,$msg) {
foreach($tags as $tag) {
if(strpos($tag,'#') === 0) {
- if(strpos($tag,'[url='))
+ if((strpos($tag,'[url=')) || (strpos($tag,'[zrl')))
continue;
// don't link tags that are already embedded in links
@@ -1087,7 +1087,7 @@ function diaspora_reshare($importer,$xml,$msg) {
}
}
- // This won't work
+ // This won't work on redmatrix
$plink = 'https://'.substr($diaspora_handle,strpos($diaspora_handle,'@')+1).'/posts/'.$guid;
$datarray['uid'] = $importer['channel_id'];
@@ -1337,7 +1337,7 @@ function diaspora_comment($importer,$xml,$msg) {
foreach($tags as $tag) {
if(strpos($tag,'#') === 0) {
- if(strpos($tag,'[url='))
+ if((strpos($tag,'[url=')) || (strpos($tag,'[zrl')))
continue;
// don't link tags that are already embedded in links
@@ -1379,6 +1379,8 @@ function diaspora_comment($importer,$xml,$msg) {
$datarray['mid'] = $guid;
$datarray['parent_mid'] = $parent_item['mid'];
+ // set the route to that of the parent so downstream hubs won't reject it.
+ $datarray['route'] = $parent_item['route'];
// No timestamps for comments? OK, we'll the use current time.
$datarray['changed'] = $datarray['created'] = $datarray['edited'] = datetime_convert();
@@ -1404,13 +1406,6 @@ function diaspora_comment($importer,$xml,$msg) {
$message_id = $result['item_id'];
if(($parent_item['item_flags'] & ITEM_ORIGIN) && (! $parent_author_signature)) {
- q("insert into sign (`iid`,`signed_text`,`signature`,`signer`) values (%d,'%s','%s','%s') ",
- intval($message_id),
- dbesc($signed_data),
- dbesc(base64_encode($author_signature)),
- dbesc($diaspora_handle)
- );
-
// if the message isn't already being relayed, notify others
// the existence of parent_author_signature means the parent_author or owner
// is already relaying.
@@ -1968,6 +1963,9 @@ function diaspora_like($importer,$xml,$msg) {
$arr['app'] = 'Diaspora';
+ // set the route to that of the parent so downstream hubs won't reject it.
+ $arr['route'] = $parent_item['route'];
+
$arr['item_private'] = $parent_item['item_private'];
$arr['verb'] = $activity;
$arr['obj_type'] = $objtype;
@@ -2446,6 +2444,7 @@ function diaspora_send_followup($item,$owner,$contact,$public_batch = false) {
else
return;
+
if(($item['verb'] === ACTIVITY_LIKE) && ($parent['mid'] === $parent['parent_mid'])) {
$tpl = get_markup_template('diaspora_like.tpl');
$like = true;