]> git.mxchange.org Git - friendica.git/commitdiff
New functionality to display media posted by a contact
authorMichael <heluecht@pirati.ca>
Sat, 2 Oct 2021 11:55:22 +0000 (11:55 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 2 Oct 2021 11:55:22 +0000 (11:55 +0000)
src/Module/Contact.php

index ca895c5f4bd119616bf024697033dc3392a9b895..1bfcee7c9708ca45cced8df06e9d42aa51269d32 100644 (file)
@@ -280,7 +280,7 @@ class Contact extends BaseModule
                $contact = null;
                // @TODO: Replace with parameter from router
                if (DI::args()->getArgc() == 2 && intval(DI::args()->getArgv()[1])
-                       || DI::args()->getArgc() == 3 && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations'])
+                       || DI::args()->getArgc() == 3 && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations', 'media'])
                ) {
                        $contact_id = intval(DI::args()->getArgv()[1]);
 
@@ -307,7 +307,7 @@ class Contact extends BaseModule
                if (DBA::isResult($contact)) {
                        if ($contact['self']) {
                                // @TODO: Replace with parameter from router
-                               if ((DI::args()->getArgc() == 3) && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations'])) {
+                               if ((DI::args()->getArgc() == 3) && intval(DI::args()->getArgv()[1]) && in_array(DI::args()->getArgv()[2], ['posts', 'conversations', 'media'])) {
                                        DI::baseUrl()->redirect('profile/' . $contact['nick']);
                                } else {
                                        DI::baseUrl()->redirect('profile/' . $contact['nick'] . '/profile');
@@ -375,6 +375,10 @@ class Contact extends BaseModule
                                return self::getPostsHTML($a, $contact_id);
                        }
 
+                       if ($cmd === 'media') {
+                               return self::getPostsHTML($a, $contact_id); // TODO
+                       }
+
                        if ($cmd === 'conversations') {
                                return self::getConversationsHMTL($a, $contact_id, $update);
                        }