]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Widget.php
Some more avatar function replacements
[friendica.git] / src / Content / Widget.php
index c3ec88fc914e576345d57d95eea964b6dac79726..e8e70c0e11cf097fee20a05757e92f4e75674be2 100644 (file)
@@ -1,7 +1,24 @@
 <?php
 /**
- * @file src/Content/Widget.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
+
 namespace Friendica\Content;
 
 use Friendica\Core\Addon;
@@ -17,7 +34,6 @@ use Friendica\Model\Group;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
 use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Proxy as ProxyUtils;
 use Friendica\Util\Strings;
 use Friendica\Util\Temporal;
 
@@ -252,10 +268,6 @@ class Widget
                        return '';
                }
 
-               if (!Feature::isEnabled(local_user(), 'networks')) {
-                       return '';
-               }
-
                $extra_sql = self::unavailableNetworks();
 
                $r = DBA::p("SELECT DISTINCT(`network`) FROM `contact` WHERE `uid` = ? AND NOT `deleted` AND `network` != '' $extra_sql ORDER BY `network`",
@@ -419,10 +431,11 @@ class Widget
 
                $entries = [];
                foreach ($r as $rr) {
+                       $contact = Contact::getByURL($rr['url']);
                        $entry = [
                                'url'   => Contact::magicLink($rr['url']),
-                               'name'  => $rr['name'],
-                               'photo' => ProxyUtils::proxifyUrl($rr['photo'], false, ProxyUtils::SIZE_THUMB),
+                               'name'  => $contact['name'] ?? $rr['name'],
+                               'photo' => Contact::getThumb($contact, $rr['photo']),
                        ];
                        $entries[] = $entry;
                }
@@ -458,7 +471,7 @@ class Widget
                }
 
                if (Feature::isEnabled($uid, 'tagadelic')) {
-                       $owner_id = Contact::getIdForURL($a->profile['url'], 0, true);
+                       $owner_id = Contact::getIdForURL($a->profile['url'], 0, false);
 
                        if (!$owner_id) {
                                return '';
@@ -480,10 +493,6 @@ class Widget
        {
                $o = '';
 
-               if (!Feature::isEnabled($uid, 'archives')) {
-                       return $o;
-               }
-
                $visible_years = DI::pConfig()->get($uid, 'system', 'archive_visible_years', 5);
 
                /* arrange the list in years */