]> git.mxchange.org Git - friendica.git/blobdiff - mod/salmon.php
Merge branch 'fabrixxm-master'
[friendica.git] / mod / salmon.php
index 3a18f35f09bf696c593b1205ef02b31330ee1b7d..8c7d921c86041328549b7e299647f2aa59775937 100644 (file)
@@ -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.');
@@ -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);
 }