]> git.mxchange.org Git - friendica.git/blobdiff - mod/message.php
Fix Issue 5252
[friendica.git] / mod / message.php
index 822f5aadeceaa2d34d5b77ca1057548f11600fa4..ddd5d03d6667255d2d143cb5363a00d34bdc3493 100644 (file)
@@ -141,6 +141,7 @@ function message_content(App $a)
                                '$cancel' => L10n::t('Cancel'),
                        ]);
                }
+
                // Now check how the user responded to the confirmation query
                if ($_REQUEST['canceled']) {
                        goaway($_SESSION['return_url']);
@@ -148,9 +149,10 @@ function message_content(App $a)
 
                $cmd = $a->argv[1];
                if ($cmd === 'drop') {
-                       if (dba::delete('mail', ['id' => $a->argv[2]])) {
+                       if (dba::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
                                info(L10n::t('Message deleted.') . EOL);
                        }
+
                        //goaway(System::baseUrl(true) . '/message' );
                        goaway($_SESSION['return_url']);
                } else {
@@ -341,11 +343,8 @@ function message_content(App $a)
                        if ($message['from-url'] == $myprofile) {
                                $from_url = $myprofile;
                                $sparkle = '';
-                       } elseif ($message['contact-id'] != 0) {
-                               $from_url = 'redir/' . $message['contact-id'];
-                               $sparkle = ' sparkle';
                        } else {
-                               $from_url = $message['from-url'] . "?zrl=" . urlencode($myprofile);
+                               $from_url = Contact::magicLink($message['from-url']);
                                $sparkle = ' sparkle';
                        }
 
@@ -470,7 +469,7 @@ function render_messages(array $msg, $t)
                $rslt .= replace_macros($tpl, [
                        '$id' => $rr['id'],
                        '$from_name' => $participants,
-                       '$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
+                       '$from_url' => Contact::magicLink($rr['url']),
                        '$from_addr' => $contact['addr'],
                        '$sparkle' => ' sparkle',
                        '$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),