aboutsummaryrefslogtreecommitdiffstats
path: root/mod/salmon.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-24 20:39:24 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-24 20:39:24 -0700
commitb41218ca303b9fd8258fd613915d3c4b9fd411c0 (patch)
treec1b08bee4f7b3737e3717d4d5eb4be9b781dc044 /mod/salmon.php
parentb8b227b32882fb511c8481a41c53637e7ce7707a (diff)
downloadvolse-hubzilla-b41218ca303b9fd8258fd613915d3c4b9fd411c0.tar.gz
volse-hubzilla-b41218ca303b9fd8258fd613915d3c4b9fd411c0.tar.bz2
volse-hubzilla-b41218ca303b9fd8258fd613915d3c4b9fd411c0.zip
workflow for federated/non-dfrn followers
Diffstat (limited to 'mod/salmon.php')
-rw-r--r--mod/salmon.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/mod/salmon.php b/mod/salmon.php
index 30e87f243..74377f9e9 100644
--- a/mod/salmon.php
+++ b/mod/salmon.php
@@ -195,14 +195,16 @@ function salmon_post(&$a) {
*
*/
- $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND `lrdd` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `lrdd` = '%s') AND `uid` = %d
+ AND `readonly` = 0 LIMIT 1",
+ dbesc($author_link),
dbesc($author_link),
intval($importer['uid'])
);
if(! count($r)) {
if($debugging)
file_put_contents('salmon.out',"\n" . 'Author unknown to us.' . "\n", FILE_APPEND);
- salmon_return(500);
+
}
require_once('include/items.php');
@@ -212,7 +214,9 @@ function salmon_post(&$a) {
$hub = '';
- consume_feed($feedxml,$importer,$r[0],$hub);
+ // consume_feed will only accept a follow activity from this person if there is no contact record.
+
+ consume_feed($feedxml,$importer,((count($r)) ? $r[0] : null),$hub);
salmon_return(200);
}