X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Ffsuggest.php;h=f7c1930cca7db2a2b63df548a79ee8310cf292d3;hb=5dfee31108fc92a7abca5f99b8fdf1b34aec5dd5;hp=2cede5685215abe6ad0bbf8bbddaa90b42efd86e;hpb=a6cf036db26f9a7f399f7440c574c12d03821fa7;p=friendica.git diff --git a/mod/fsuggest.php b/mod/fsuggest.php index 2cede56852..f7c1930cca 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -10,6 +10,7 @@ use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Util\DateTimeFormat; use Friendica\Util\Strings; +use Friendica\Worker\Delivery; function fsuggest_post(App $a) { @@ -28,7 +29,7 @@ function fsuggest_post(App $a) // We do query the "uid" as well to ensure that it is our contact if (!DBA::exists('contact', ['id' => $contact_id, 'uid' => local_user()])) { - notice(L10n::t('Contact not found.') . EOL); + notice(DI::l10n()->t('Contact not found.') . EOL); return; } @@ -40,26 +41,26 @@ function fsuggest_post(App $a) // We do query the "uid" as well to ensure that it is our contact $contact = DBA::selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]); if (!DBA::isResult($contact)) { - notice(L10n::t('Suggested contact not found.') . EOL); + notice(DI::l10n()->t('Suggested contact not found.') . EOL); return; } - $note = Strings::escapeHtml(trim(defaults($_POST, 'note', ''))); + $note = Strings::escapeHtml(trim($_POST['note'] ?? '')); $fields = ['uid' => local_user(),'cid' => $contact_id, 'name' => $contact['name'], 'url' => $contact['url'], 'request' => $contact['request'], 'photo' => $contact['avatar'], 'note' => $note, 'created' => DateTimeFormat::utcNow()]; DBA::insert('fsuggest', $fields); - Worker::add(PRIORITY_HIGH, 'Notifier', 'suggest', DBA::lastInsertId()); + Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::SUGGESTION, DBA::lastInsertId()); - info(L10n::t('Friend suggestion sent.') . EOL); + info(DI::l10n()->t('Friend suggestion sent.') . EOL); } function fsuggest_content(App $a) { if (! local_user()) { - notice(L10n::t('Permission denied.') . EOL); + notice(DI::l10n()->t('Permission denied.') . EOL); return; } @@ -71,13 +72,13 @@ function fsuggest_content(App $a) $contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => local_user()]); if (! DBA::isResult($contact)) { - notice(L10n::t('Contact not found.') . EOL); + notice(DI::l10n()->t('Contact not found.') . EOL); return; } - $o = '

' . L10n::t('Suggest Friends') . '

'; + $o = '

' . DI::l10n()->t('Suggest Friends') . '

'; - $o .= '
' . L10n::t('Suggest a friend for %s', $contact['name']) . '
'; + $o .= '
' . DI::l10n()->t('Suggest a friend for %s', $contact['name']) . '
'; $o .= '
'; @@ -88,7 +89,7 @@ function fsuggest_content(App $a) ); - $o .= '
'; + $o .= '
'; $o .= '
'; return $o;