]> git.mxchange.org Git - friendica-addons.git/commitdiff
Rearranged order for the "updateAvatar" function
authorMichael <heluecht@pirati.ca>
Sat, 25 Jul 2020 11:49:44 +0000 (11:49 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 25 Jul 2020 11:49:44 +0000 (11:49 +0000)
discourse/discourse.php
pumpio/pumpio.php
twitter/twitter.php

index b3f95bbb46615ec08af83ac0fa7252fa6d627725..3ee980ceb39a6aa857f996cb09640f7f329799ae 100644 (file)
@@ -203,7 +203,7 @@ function discourse_get_user($post, $hostaddr)
                $avatar = $contact['photo'];
                unset($contact['photo']);
                DBA::update('contact', $contact, ['id' => $contact['id']]);
-               Contact::updateAvatar($avatar, 0, $contact['id']);
+               Contact::updateAvatar($contact['id'], $avatar);
                $contact['photo'] = $avatar;
        }
 
index 2144257dbda0a0cc59f34e88f0a2c6d822d986f9..6b61a5946438cb1794f9b66ec4e86dd387c7df63 100644 (file)
@@ -1068,7 +1068,7 @@ function pumpio_get_contact($uid, $contact, $no_insert = false)
        }
 
        if (!empty($contact->image->url)) {
-               Contact::updateAvatar($contact->image->url, $uid, $contact_id);
+               Contact::updateAvatar($contact_id, $contact->image->url);
        }
 
        return $contact_id;
index a44bb05ed8a4ebddccd7b9a2523bb39f0446c61d..375e264cd4cb3c4e7159271088c532a4a596cb6c 100644 (file)
@@ -1128,7 +1128,7 @@ function twitter_fetch_contact($uid, $data, $create_user)
 
        if (!empty($cid)) {
                DBA::update('contact', $fields, ['id' => $cid]);
-               Contact::updateAvatar($avatar, 0, $cid);
+               Contact::updateAvatar($cid, $avatar);
        }
 
        $contact = DBA::selectFirst('contact', [], ['uid' => $uid, 'alias' => "twitter::" . $data->id_str]);
@@ -1160,7 +1160,7 @@ function twitter_fetch_contact($uid, $data, $create_user)
 
                Group::addMember(User::getDefaultGroup($uid), $contact_id);
 
-               Contact::updateAvatar($avatar, $uid, $contact_id);
+               Contact::updateAvatar($contact_id, $avatar);
        } else {
                if ($contact["readonly"] || $contact["blocked"]) {
                        Logger::log("twitter_fetch_contact: Contact '" . $contact["nick"] . "' is blocked or readonly.", Logger::DEBUG);
@@ -1176,7 +1176,7 @@ function twitter_fetch_contact($uid, $data, $create_user)
                        $update = true;
                }
 
-               Contact::updateAvatar($avatar, $uid, $contact['id']);
+               Contact::updateAvatar($contact['id'], $avatar);
 
                if ($contact['name'] != $data->name) {
                        $fields['name-date'] = $fields['uri-date'] = DateTimeFormat::utcNow();