]> git.mxchange.org Git - friendica.git/blobdiff - mod/follow.php
Merge branch 'tobiasd-master'
[friendica.git] / mod / follow.php
index 62ba2585c28891ff90852698df3ae12628f73118..8c1dc348fa7d4addd416a48135a5e837fef758ef 100644 (file)
@@ -113,10 +113,16 @@ function follow_post(&$a) {
                                                        $vcard['nick'] = trim(substr($vcard['nick'],0,strpos($vcard['nick'],' ')));
                                                $email = $author->get_email();
                                        }
+                                       if(! $vcard['photo']) {
+                                               $rawmedia = $item->get_item_tags('http://search.yahoo.com/mrss/','thumbnail');
+                                               if($rawmedia && $rawmedia[0]['attribs']['']['url'])
+                                                       $vcard['photo'] = $rawmedia[0]['attribs']['']['url'];
+                                       }
                                }
                        }
                        if((! $vcard['photo']) && strlen($email))
                                $vcard['photo'] = gravatar_img($email);
+                       
                        $network = 'feed';
                        $priority = 2;
                }
@@ -161,7 +167,7 @@ function follow_post(&$a) {
                // create contact record 
                $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `notify`, `poll`, `name`, `nick`, `photo`, `network`, `rel`, `priority`,
                        `blocked`, `readonly`, `pending` )
-                       VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 0 ) ",
+                       VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, 0, 0, 0 ) ",
                        intval(local_user()),
                        dbesc(datetime_convert()),
                        dbesc($profile),