]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Mail.php
Merge pull request #4312 from zeroadam/feature/L10n
[friendica.git] / src / Model / Mail.php
index d5105ac21ce118a05bdb752dcf14b686020172f1..be68f515f1c20c92dc75e844774c6a86f7063626 100644 (file)
@@ -5,6 +5,7 @@
 namespace Friendica\Model;
 
 use Friendica\App;
+use Friendica\Core\L10n;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
@@ -35,7 +36,7 @@ class Mail
                }
 
                if (!strlen($subject)) {
-                       $subject = t('[no subject]');
+                       $subject = L10n::t('[no subject]');
                }
 
                $me = dba::selectFirst('contact', [], ['uid' => local_user(), 'self' => true]);
@@ -67,10 +68,10 @@ class Mail
 
                if (!$convid) {
                        // create a new conversation
-                       $recip_host = substr($contact[0]['url'], strpos($contact[0]['url'], '://') + 3);
+                       $recip_host = substr($contact['url'], strpos($contact['url'], '://') + 3);
                        $recip_host = substr($recip_host, 0, strpos($recip_host, '/'));
 
-                       $recip_handle = (($contact[0]['addr']) ? $contact[0]['addr'] : $contact[0]['nick'] . '@' . $recip_host);
+                       $recip_handle = (($contact['addr']) ? $contact['addr'] : $contact['nick'] . '@' . $recip_host);
                        $sender_handle = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
 
                        $conv_guid = get_guid(32);
@@ -102,15 +103,15 @@ class Mail
                                'uid' => local_user(),
                                'guid' => $guid,
                                'convid' => $convid,
-                               'from-name' => $me[0]['name'],
-                               'from-photo' => $me[0]['thumb'],
-                               'from-url' => $me[0]['url'],
+                               'from-name' => $me['name'],
+                               'from-photo' => $me['thumb'],
+                               'from-url' => $me['url'],
                                'contact-id' => $recipient,
                                'title' => $subject,
                                'body' => $body,
-                               'seen' => true,
+                               'seen' => 1,
                                'reply' => $reply,
-                               'replied' => false,
+                               'replied' => 0,
                                'uri' => $uri,
                                'parent-uri' => $replyto,
                                'created' => datetime_convert()
@@ -168,7 +169,7 @@ class Mail
                }
 
                if (!strlen($subject)) {
-                       $subject = t('[no subject]');
+                       $subject = L10n::t('[no subject]');
                }
 
                $guid = get_guid(32);
@@ -216,13 +217,13 @@ class Mail
                                'contact-id' => 0,
                                'title' => $subject,
                                'body' => $body,
-                               'seen' => false,
-                               'reply' => false,
-                               'replied' => false,
+                               'seen' => 0,
+                               'reply' => 0,
+                               'replied' => 0,
                                'uri' => $uri,
                                'parent-uri' => $replyto,
                                'created' => datetime_convert(),
-                               'unknown' => true
+                               'unknown' => 1
                        ]
                );