]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Photo.php
Add license
[friendica.git] / src / Module / Photo.php
index 076dc8107afc7dee4e68221207dc03a688597fd2..1847b4f707e0ebe6432c62a5b134456409ca552b 100644 (file)
@@ -258,7 +258,7 @@ class Photo extends BaseModule
                                        return MPhoto::getPhoto($matches[1], $matches[2]);
                                }
 
-                               return MPhoto::createPhotoForExternalResource($url, (int)local_user(), $media['mimetype'] ?? '');
+                               return MPhoto::createPhotoForExternalResource($url, (int)DI::userSession()->getLocalUserId(), $media['mimetype'] ?? '');
                        case 'media':
                                $media = DBA::selectFirst('post-media', ['url', 'mimetype', 'uri-id'], ['id' => $id, 'type' => Post\Media::IMAGE]);
                                if (empty($media)) {
@@ -269,14 +269,14 @@ class Photo extends BaseModule
                                        return MPhoto::getPhoto($matches[1], $matches[2]);
                                }
 
-                               return MPhoto::createPhotoForExternalResource($media['url'], (int)local_user(), $media['mimetype']);
+                               return MPhoto::createPhotoForExternalResource($media['url'], (int)DI::userSession()->getLocalUserId(), $media['mimetype']);
                        case 'link':
                                $link = DBA::selectFirst('post-link', ['url', 'mimetype'], ['id' => $id]);
                                if (empty($link)) {
                                        return false;
                                }
 
-                               return MPhoto::createPhotoForExternalResource($link['url'], (int)local_user(), $link['mimetype'] ?? '');
+                               return MPhoto::createPhotoForExternalResource($link['url'], (int)DI::userSession()->getLocalUserId(), $link['mimetype'] ?? '');
                        case 'contact':
                                $fields = ['uid', 'uri-id', 'url', 'nurl', 'avatar', 'photo', 'xmpp', 'addr', 'network', 'failed', 'updated'];
                                $contact = Contact::getById($id, $fields);
@@ -338,7 +338,7 @@ class Photo extends BaseModule
                                                }
                                                if ($update) {
                                                        Logger::info('Invalid file, contact update initiated', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
-                                                       Worker::add(PRIORITY_LOW, 'UpdateContact', $id);
+                                                       Worker::add(Worker::PRIORITY_LOW, 'UpdateContact', $id);
                                                } else {
                                                        Logger::info('Invalid file', ['cid' => $id, 'url' => $contact['url'], 'avatar' => $url]);
                                                }