+ if (in_array($contact['network'], [Protocol::FEED, Protocol::MAIL]) || DI::config()->get('system', 'cache_contact_avatar')) {
+ if (!empty($contact['avatar']) && (empty($contact['photo']) || empty($contact['thumb']) || empty($contact['micro']))) {
+ Logger::info('Adding avatar cache', ['id' => $cid, 'contact' => $contact]);
+ self::updateAvatar($cid, $contact['avatar'], true);
+ return;
+ }
+ } elseif (!empty($contact['photo']) || !empty($contact['thumb']) || !empty($contact['micro'])) {
+ Logger::info('Removing avatar cache', ['id' => $cid, 'contact' => $contact]);
+ self::updateAvatar($cid, $contact['avatar'], true);