]> git.mxchange.org Git - friendica.git/commitdiff
add diaspora support to dfrn_confirm (friendship confirmation)
authorFriendika <info@friendika.com>
Sun, 14 Aug 2011 12:23:36 +0000 (05:23 -0700)
committerFriendika <info@friendika.com>
Sun, 14 Aug 2011 12:23:36 +0000 (05:23 -0700)
mod/dfrn_confirm.php

index bcc4e3438c6d1099ee44786fc844d6676794d5ab..f0c86910bd731a0e4ab218fec9c2d6bce41ab1f0 100644 (file)
@@ -124,6 +124,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                $aes_allow    = $contact['aes_allow'];
 
                $network = ((strlen($contact['issued-id'])) ? 'dfrn' : 'stat');
+               if($contact['network'])
+                       $network = $contact['network'];
 
                if($network === 'dfrn') {
 
@@ -339,16 +341,18 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                else {  
                        // $network !== 'dfrn'
 
-                       $notify = '';
-                       $poll   = '';
-
-                       $arr = lrdd($contact['url']);
-                       if(count($arr)) {
-                               foreach($arr as $link) {
-                                       if($link['@attributes']['rel'] === 'salmon')
-                                               $notify = $link['@attributes']['href'];
-                                       if($link['@attributes']['rel'] === NAMESPACE_FEED)
-                                               $poll = $link['@attributes']['href'];
+                       $notify = (($contact['notify']) ? $contact['notify'] : '');
+                       $poll   = (($contact['poll']) ? $contact['poll'] : '');
+
+                       if((! $contact['notify']) || (! $contact['poll'])) {
+                               $arr = lrdd($contact['url']);
+                               if(count($arr)) {
+                                       foreach($arr as $link) {
+                                               if($link['@attributes']['rel'] === 'salmon')
+                                                       $notify = $link['@attributes']['href'];
+                                               if($link['@attributes']['rel'] === NAMESPACE_FEED)
+                                                       $poll = $link['@attributes']['href'];
+                                       }
                                }
                        }