]> git.mxchange.org Git - friendica.git/blobdiff - mod/message.php
Fix fatal error because of unknown function "fetchUrl"
[friendica.git] / mod / message.php
index c024cbe144cd49eaaa31e80ee1f7064d6b6222c9..204b136f9bb93a5c4f92601bab5ad5e90e8ee29c 100644 (file)
@@ -68,7 +68,7 @@ function message_init(App $a)
 function message_post(App $a)
 {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.'));
                return;
        }
 
@@ -82,20 +82,18 @@ function message_post(App $a)
 
        switch ($ret) {
                case -1:
-                       notice(DI::l10n()->t('No recipient selected.') . EOL);
+                       notice(DI::l10n()->t('No recipient selected.'));
                        $norecip = true;
                        break;
                case -2:
-                       notice(DI::l10n()->t('Unable to locate contact information.') . EOL);
+                       notice(DI::l10n()->t('Unable to locate contact information.'));
                        break;
                case -3:
-                       notice(DI::l10n()->t('Message could not be sent.') . EOL);
+                       notice(DI::l10n()->t('Message could not be sent.'));
                        break;
                case -4:
-                       notice(DI::l10n()->t('Message collection failure.') . EOL);
+                       notice(DI::l10n()->t('Message collection failure.'));
                        break;
-               default:
-                       info(DI::l10n()->t('Message sent.') . EOL);
        }
 
        // fake it to go back to the input form if no recipient listed
@@ -113,7 +111,7 @@ function message_content(App $a)
        Nav::setSelected('messages');
 
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.') . EOL);
+               notice(DI::l10n()->t('Permission denied.'));
                return Login::form();
        }
 
@@ -178,17 +176,16 @@ function message_content(App $a)
                if ($cmd === 'drop') {
                        $message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]);
                        if(!DBA::isResult($message)){
-                               info(DI::l10n()->t('Conversation not found.') . EOL);
+                               notice(DI::l10n()->t('Conversation not found.'));
                                DI::baseUrl()->redirect('message');
                        }
 
-                       if (DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
-                               info(DI::l10n()->t('Message deleted.') . EOL);
+                       if (!DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
+                               notice(DI::l10n()->t('Message was not deleted.'));
                        }
 
                        $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
                        if(!DBA::isResult($conversation)){
-                               info(DI::l10n()->t('Conversation removed.') . EOL);
                                DI::baseUrl()->redirect('message');
                        }
 
@@ -201,8 +198,8 @@ function message_content(App $a)
                        if (DBA::isResult($r)) {
                                $parent = $r[0]['parent-uri'];
 
-                               if (DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
-                                       info(DI::l10n()->t('Conversation removed.') . EOL);
+                               if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
+                                       notice(DI::l10n()->t('Conversation was not removed.'));
                                }
                        }
                        DI::baseUrl()->redirect('message');
@@ -301,7 +298,7 @@ function message_content(App $a)
                $r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
 
                if (!DBA::isResult($r)) {
-                       info(DI::l10n()->t('No messages.') . EOL);
+                       notice(DI::l10n()->t('No messages.'));
                        return $o;
                }
 
@@ -358,7 +355,7 @@ function message_content(App $a)
                }
 
                if (!DBA::isResult($messages)) {
-                       notice(DI::l10n()->t('Message not available.') . EOL);
+                       notice(DI::l10n()->t('Message not available.'));
                        return $o;
                }
 
@@ -396,7 +393,7 @@ function message_content(App $a)
                        $body_e = BBCode::convert($message['body']);
                        $to_name_e = $message['name'];
 
-                       $contact = Contact::getDetailsByURL($message['from-url']);
+                       $contact = Contact::getByURL($message['from-url'], false, ['thumb', 'addr']);
                        if (isset($contact["thumb"])) {
                                $from_photo = $contact["thumb"];
                        } else {
@@ -528,7 +525,7 @@ function render_messages(array $msg, $t)
                $body_e = $rr['body'];
                $to_name_e = $rr['name'];
 
-               $contact = Contact::getDetailsByURL($rr['url']);
+               $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr']);
                if (isset($contact["thumb"])) {
                        $from_photo = $contact["thumb"];
                } else {