]> git.mxchange.org Git - friendica.git/commitdiff
Follow/Unfollow now works from OStatus.
authorMichael Vogel <icarus@dabo.de>
Mon, 13 Jul 2015 21:50:33 +0000 (23:50 +0200)
committerMichael Vogel <icarus@dabo.de>
Mon, 13 Jul 2015 21:50:33 +0000 (23:50 +0200)
include/items.php
include/ostatus.php
mod/wall_upload.php

index 45d25e379f84713931de7ba41653b6a2c826a681..cba1ae236c9929e7aa6d8e6f3b475f8ca7a321da 100644 (file)
@@ -4159,9 +4159,12 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) {
        $name = notags(trim($datarray['author-name']));
        $photo = notags(trim($datarray['author-avatar']));
 
-       $rawtag = $item->get_item_tags(NAMESPACE_ACTIVITY,'actor');
-       if($rawtag && $rawtag[0]['child'][NAMESPACE_POCO]['preferredUsername'][0]['data'])
-               $nick = $rawtag[0]['child'][NAMESPACE_POCO]['preferredUsername'][0]['data'];
+       if (is_object($item)) {
+               $rawtag = $item->get_item_tags(NAMESPACE_ACTIVITY,'actor');
+               if($rawtag && $rawtag[0]['child'][NAMESPACE_POCO]['preferredUsername'][0]['data'])
+                       $nick = $rawtag[0]['child'][NAMESPACE_POCO]['preferredUsername'][0]['data'];
+       } else
+               $nick = $item;
 
        if(is_array($contact)) {
                if(($contact['network'] == NETWORK_OSTATUS && $contact['rel'] == CONTACT_IS_SHARING)
index 901ae95f7df1c70ac3b532c5ce9d4f348d29ed15..53887d535b1b5d3f8bcfdc55b176b19c8a2878d8 100644 (file)
@@ -205,6 +205,12 @@ function ostatus_import($xml,$importer,&$contact, &$hub) {
                else
                        $author = ostatus_fetchauthor($xpath, $entry, $importer, $contact, false);
 
+               $value = $xpath->evaluate('atom:author/poco:preferredUsername/text()', $context)->item(0)->nodeValue;
+               if ($value != "")
+                       $nickname = $value;
+               else
+                       $nickname = $author["author-name"];
+
                $item = array_merge($header, $author);
 
                // Now get the item
@@ -242,14 +248,12 @@ function ostatus_import($xml,$importer,&$contact, &$hub) {
                }
 
                if ($item["verb"] == ACTIVITY_FOLLOW) {
-                       // ignore "Follow" messages
-                       // new_follower($importer,$contact,$datarray,$item);
+                       new_follower($importer, $contact, $item, $nickname);
                        continue;
                }
 
                if ($item["verb"] == NAMESPACE_OSTATUS."/unfollow") {
-                       // ignore "Unfollow" messages
-                       // lose_follower($importer,$contact,$datarray,$item);
+                       lose_follower($importer, $contact, $item, $dummy);
                        continue;
                }
 
index 44cfa015678d77d33a78516da2a867e0de687a3d..9abc1dd9f72d696866b64fa83db48916649a338e 100644 (file)
@@ -119,6 +119,7 @@ function wall_upload_post(&$a, $desktopmode = true) {
        $maximagesize = get_config('system','maximagesize');
 
        if(($maximagesize) && ($filesize > $maximagesize)) {
+               logger("Image exceeds size limit of ".$maximagesize);
                echo  sprintf( t('Image exceeds size limit of %s'), formatBytes($maximagesize)) . EOL;
                @unlink($src);
                killme();