<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Model\Mail;
use Friendica\Model\Profile;
use Friendica\Model\User;
+use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
function wallmessage_post(App $a) {
return;
}
- $total = DBA::count('mail', ["`uid` = ? AND `created` > UTC_TIMESTAMP() - INTERVAL 1 DAY AND `unknown`", $user['uid']]);
+ $total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;
return;
}
- $total = DBA::count('mail', ["`uid` = ? AND `created` > UTC_TIMESTAMP() - INTERVAL 1 DAY AND `unknown`", $user['uid']]);
+ $total = DBA::count('mail', ["`uid` = ? AND `created` > ? AND `unknown`", $user['uid'], DateTimeFormat::utc('now - 1 day')]);
if ($total > $user['cntunkmail']) {
notice(DI::l10n()->t('Number of daily wall messages for %s exceeded. Message failed.', $user['username']));
return;