mirror of
https://github.com/friendica/friendica
synced 2025-04-28 19:44:23 +02:00
Refactor datetime_convert into Temporal::convert
- Changed parameter order to save space - Refactor select_timezone into Temporal::getTimezoneSelect - Refactor field_timezone into Temporal::getTimezoneField
This commit is contained in:
parent
d478ef6c6d
commit
dc366bf1f7
62 changed files with 512 additions and 432 deletions
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file src/Model/Mail.php
|
||||
*/
|
||||
namespace Friendica\Model;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Util\Temporal;
|
||||
use dba;
|
||||
|
||||
require_once 'include/dba.php';
|
||||
|
@ -80,7 +82,7 @@ class Mail
|
|||
$handles = $recip_handle . ';' . $sender_handle;
|
||||
|
||||
$fields = ['uid' => local_user(), 'guid' => $conv_guid, 'creator' => $sender_handle,
|
||||
'created' => datetime_convert(), 'updated' => datetime_convert(),
|
||||
'created' => Temporal::convert(), 'updated' => Temporal::convert(),
|
||||
'subject' => $subject, 'recips' => $handles];
|
||||
if (dba::insert('conv', $fields)) {
|
||||
$convid = dba::lastInsertId();
|
||||
|
@ -114,7 +116,7 @@ class Mail
|
|||
'replied' => 0,
|
||||
'uri' => $uri,
|
||||
'parent-uri' => $replyto,
|
||||
'created' => datetime_convert()
|
||||
'created' => Temporal::convert()
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -194,12 +196,12 @@ class Mail
|
|||
|
||||
$convid = null;
|
||||
$fields = ['uid' => $recipient['uid'], 'guid' => $conv_guid, 'creator' => $sender_handle,
|
||||
'created' => datetime_convert(), 'updated' => datetime_convert(),
|
||||
'created' => Temporal::convert(), 'updated' => Temporal::convert(),
|
||||
'subject' => $subject, 'recips' => $handles];
|
||||
if (dba::insert('conv', $fields)) {
|
||||
$convid = dba::lastInsertId();
|
||||
}
|
||||
|
||||
|
||||
if (!$convid) {
|
||||
logger('send message: conversation not found.');
|
||||
return -4;
|
||||
|
@ -222,7 +224,7 @@ class Mail
|
|||
'replied' => 0,
|
||||
'uri' => $uri,
|
||||
'parent-uri' => $replyto,
|
||||
'created' => datetime_convert(),
|
||||
'created' => Temporal::convert(),
|
||||
'unknown' => 1
|
||||
]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue