X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsalmon.php;h=885ba470c8458e64a8456f9015e52c2cbfd2da82;hb=9d9176f87e6db2f34c85ee098cede766d0744e9b;hp=3a18f35f09bf696c593b1205ef02b31330ee1b7d;hpb=42e6b6cfe4f0b2bd6a2e8361479cb813857ca0e6;p=friendica.git diff --git a/mod/salmon.php b/mod/salmon.php index 3a18f35f09..885ba470c8 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -158,8 +158,10 @@ function salmon_post(&$a) { $verify = $rsa->verify($signed_data,$signature); - if(! $verify) + if(! $verify) { + logger('mod-salmon: message did not verify using protocol. Trying statusnet hack.'); $verify = $rsa->verify($stnet_signed_data,$signature); + } if(! $verify) { logger('mod-salmon: Message did not verify. Discarding.'); @@ -175,7 +177,7 @@ function salmon_post(&$a) { * */ - $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `lrdd` = '%s') + $r = q("SELECT * FROM `contact` WHERE `network` = 'stat' AND ( `url` = '%s' OR `alias` = '%s') AND `uid` = %d LIMIT 1", dbesc($author_link), dbesc($author_link), @@ -197,9 +199,16 @@ function salmon_post(&$a) { $hub = ''; - // consume_feed will only accept a follow activity from this person if there is no contact record. + /** + * + * anti-spam measure: consume_feed will accept a follow activity from + * this person (and nothing else) if there is no existing contact record. + * + */ + + $contact_rec = ((count($r)) ? $r[0] : null); - consume_feed($feedxml,$importer,((count($r)) ? $r[0] : null),$hub); + consume_feed($feedxml,$importer,$contact_rec,$hub); salmon_return(200); }