Rename classes

- Repository/Model Notification => Notify
- Factory/Object Notification => Notification
This commit is contained in:
Philipp Holzer 2020-01-26 20:30:24 +01:00
commit 0840938dff
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
12 changed files with 45 additions and 45 deletions

View file

@ -23,7 +23,7 @@ use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Item;
use Friendica\Model\Mail;
use Friendica\Model\Notification;
use Friendica\Model\Notify;
use Friendica\Model\Photo;
use Friendica\Model\Profile;
use Friendica\Model\User;
@ -5907,7 +5907,7 @@ function api_friendica_notification($type)
throw new BadRequestException("Invalid argument count");
}
$notifications = DI::notification()->select(['uid' => api_user()], ['order' => ['seen' => 'ASC', 'date' => 'DESC'], 'limit' => 50]);
$notifications = DI::notify()->select(['uid' => api_user()], ['order' => ['seen' => 'ASC', 'date' => 'DESC'], 'limit' => 50]);
if ($type == "xml") {
$xmlnotes = false;
@ -5955,10 +5955,10 @@ function api_friendica_notification_seen($type)
$id = (!empty($_REQUEST['id']) ? intval($_REQUEST['id']) : 0);
try {
$notification = DI::notification()->getByID($id);
$notification = DI::notify()->getByID($id);
$notification->setSeen();
if ($notification->otype === Notification::OTYPE_ITEM) {
if ($notification->otype === Notify::OTYPE_ITEM) {
$item = Item::selectFirstForUser(api_user(), [], ['id' => $notification->iid, 'uid' => api_user()]);
if (DBA::isResult($item)) {
// we found the item, return it to the user

View file

@ -12,7 +12,7 @@ use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
use Friendica\Model\ItemContent;
use Friendica\Model\Notification;
use Friendica\Model\Notify;
use Friendica\Model\User;
use Friendica\Model\UserItem;
use Friendica\Protocol\Activity;
@ -161,7 +161,7 @@ function notification($params)
// if it's a post figure out who's post it is.
$item = null;
if ($params['otype'] === Notification::OTYPE_ITEM && $parent_id) {
if ($params['otype'] === Notify::OTYPE_ITEM && $parent_id) {
$item = Item::selectFirstForUser($params['uid'], Item::ITEM_FIELDLIST, ['id' => $parent_id, 'deleted' => false]);
}
@ -483,7 +483,7 @@ function notification($params)
$notify_id = 0;
if ($show_in_notification_page) {
$notification = DI::notification()->insert([
$notification = DI::notify()->insert([
'name' => $params['source_name'],
'url' => $params['source_link'],
'photo' => $params['source_photo'],
@ -498,7 +498,7 @@ function notification($params)
$notification->link = DI::baseUrl() . '/notification/view/' . $notification->id;
$notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]);
DI::notification()->update($notification);
DI::notify()->update($notification);
$itemlink = $notification->link;
$notify_id = $notification->id;