]> git.mxchange.org Git - friendica.git/blobdiff - mod/message.php
Merge pull request #13308 from MrPetovan/bug/13216-toggle-mobile-local
[friendica.git] / mod / message.php
index 1e8c012eeb622b5f5dfa663a3f2b6da10d4c5829..d75fb240f01025ba23a40547c2e837b222d0bd76 100644 (file)
@@ -54,11 +54,10 @@ function message_init(App $a)
                '$tabs' => $tabs,
                '$new'  => $new,
        ]);
-       $base = DI::baseUrl();
 
        $head_tpl = Renderer::getMarkupTemplate('message-head.tpl');
        DI::page()['htmlhead'] .= Renderer::replaceMacros($head_tpl, [
-               '$base'    => $base
+               '$base' => (string)DI::baseUrl()
        ]);
 }
 
@@ -69,12 +68,13 @@ function message_post(App $a)
                return;
        }
 
+       $sender_id = DI::userSession()->getLocalUserId();
        $replyto   = !empty($_REQUEST['replyto'])   ? trim($_REQUEST['replyto'])                   : '';
        $subject   = !empty($_REQUEST['subject'])   ? trim($_REQUEST['subject'])                   : '';
        $body      = !empty($_REQUEST['body'])      ? Strings::escapeHtml(trim($_REQUEST['body'])) : '';
        $recipient = !empty($_REQUEST['recipient']) ? intval($_REQUEST['recipient'])               : 0;
 
-       $ret = Mail::send($recipient, $body, $subject, $replyto);
+       $ret = Mail::send($sender_id, $recipient, $body, $subject, $replyto);
        $norecip = false;
 
        switch ($ret) {
@@ -435,7 +435,7 @@ function render_messages(array $msg, string $t): string
                $to_name_e = $rr['name'];
 
                if (is_null($rr['url'])) {
-                       // contact-id is pointing to a non existing contact
+                       // contact-id is pointing to a nonexistent contact
                        continue;
                }