X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=ddd5d03d6667255d2d143cb5363a00d34bdc3493;hb=d643e00d33883584ff599d92a8929351c6e48503;hp=e9bfc076bb50e9ff42dcd5969a7610c1161cf48a;hpb=7acb4b04343df31c2cc78214fae5429c66d95fb2;p=friendica.git diff --git a/mod/message.php b/mod/message.php index e9bfc076bb..ddd5d03d66 100644 --- a/mod/message.php +++ b/mod/message.php @@ -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,13 +149,10 @@ function message_content(App $a) $cmd = $a->argv[1]; if ($cmd === 'drop') { - $r = q("DELETE FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1", - intval($a->argv[2]), - intval(local_user()) - ); - if ($r) { + 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 { @@ -166,22 +164,7 @@ function message_content(App $a) $parent = $r[0]['parent-uri']; $convid = $r[0]['convid']; - $r = q("DELETE FROM `mail` WHERE `parent-uri` = '%s' AND `uid` = %d ", - dbesc($parent), - intval(local_user()) - ); - - // remove diaspora conversation pointer - // Actually if we do this, we can never receive another reply to that conversation, - // as we will never again have the info we need to re-create it. - // We'll just have to orphan it. - //if ($convid) { - // q("delete from conv where id = %d limit 1", - // intval($convid) - // ); - //} - - if ($r) { + if (dba::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) { info(L10n::t('Conversation removed.') . EOL); } } @@ -360,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'; } @@ -489,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),