]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Notify replies and repeats
authorStephen Paul Weber <singpolyma@singpolyma.net>
Wed, 14 Oct 2015 20:47:00 +0000 (15:47 -0500)
committerStephen Paul Weber <singpolyma@singpolyma.net>
Wed, 14 Oct 2015 20:47:00 +0000 (15:47 -0500)
This is especially useful for partial federation with remote accounts
that are not fully OStatus-enabled but support a pingback protocol.
Such accounts will still be notified of replies and repeats of their
content even without OStatus support, thus adding to the federated
universe.

plugins/Linkback/LinkbackPlugin.php

index 67e9dea7c66f64520cf095cf836e627aec56db06..85dcf502c7d37205e1279ac10faaa09a86c7effd 100644 (file)
@@ -68,6 +68,14 @@ class LinkbackPlugin extends Plugin
             // Ignoring results
             common_replace_urls_callback($c,
                                          array($this, 'linkbackUrl'));
+
+            if($notice->isRepeat()) {
+                $repeat = Notice::getByID($notice->repeat_of);
+                $this->linkbackUrl($repeat->getUrl());
+            } else if(!empty($notice->reply_to)) {
+                $parent = $notice->getParent();
+                $this->linkbackUrl($parent->getUrl());
+            }
         }
         return true;
     }