]> git.mxchange.org Git - friendica.git/blobdiff - include/enotify.php
Updated main translation file after adding strings
[friendica.git] / include / enotify.php
index f09cbf29ad8b8fffd2e140ef8497d23c95611755..9e59f63259b5ebaaab58e20a56f55247b526556c 100644 (file)
@@ -30,6 +30,7 @@ use Friendica\Model\Contact;
 use Friendica\Model\Item;
 use Friendica\Model\ItemContent;
 use Friendica\Model\Notify;
+use Friendica\Model\Post;
 use Friendica\Model\User;
 use Friendica\Model\UserItem;
 use Friendica\Protocol\Activity;
@@ -148,7 +149,7 @@ function notification($params)
        }
 
        if ($params['type'] == Notify\Type::COMMENT || $params['type'] == Notify\Type::TAG_SELF) {
-               $thread = Item::selectFirstThreadForUser($params['uid'], ['ignored'], ['iid' => $parent_id, 'deleted' => false]);
+               $thread = Post::selectFirstThreadForUser($params['uid'], ['ignored'], ['iid' => $parent_id, 'deleted' => false]);
                if (DBA::isResult($thread) && $thread['ignored']) {
                        Logger::log('Thread ' . $parent_id . ' will be ignored', Logger::DEBUG);
                        return false;
@@ -166,7 +167,7 @@ function notification($params)
                // if it's a post figure out who's post it is.
                $item = null;
                if ($params['otype'] === Notify\ObjectType::ITEM && $parent_id) {
-                       $item = Item::selectFirstForUser($params['uid'], Item::ITEM_FIELDLIST, ['id' => $parent_id, 'deleted' => false]);
+                       $item = Post::selectFirstForUser($params['uid'], Item::ITEM_FIELDLIST, ['id' => $parent_id, 'deleted' => false]);
                }
 
                if (empty($item)) {
@@ -518,7 +519,7 @@ function notification($params)
                Logger::log('sending notification email');
 
                if (isset($params['parent']) && (intval($params['parent']) != 0)) {
-                       $parent = Item::selectFirst(['guid'], ['id' => $params['parent']]);
+                       $parent = Post::selectFirst(['guid'], ['id' => $params['parent']]);
                        $message_id = "<" . $parent['guid'] . "@" . gethostname() . ">";
 
                        // Is this the first email notification for this parent item and user?
@@ -618,7 +619,7 @@ function check_item_notification($itemid, $uid, $notification_type) {
                'title', 'body', 'author-link', 'author-name', 'author-avatar', 'author-id',
                'gravity', 'guid', 'parent-uri', 'uri', 'contact-id', 'network'];
        $condition = ['id' => $itemid, 'deleted' => false];
-       $item = Item::selectFirstForUser($uid, $fields, $condition);
+       $item = Post::selectFirstForUser($uid, $fields, $condition);
        if (!DBA::isResult($item)) {
                return false;
        }
@@ -650,7 +651,7 @@ function check_item_notification($itemid, $uid, $notification_type) {
 
                // Special treatment for posts that had been shared via "announce"
                if ($item['gravity'] == GRAVITY_ACTIVITY) {
-                       $parent_item = Item::selectFirst($fields, ['uri-id' => $item['thr-parent-id'], 'uid' => [$uid, 0]]);
+                       $parent_item = Post::selectFirst($fields, ['uri-id' => $item['thr-parent-id'], 'uid' => [$uid, 0]]);
                        if (DBA::isResult($parent_item)) {
                                // Don't notify on own entries
                                if (User::getIdForURL($parent_item['author-link']) == $uid) {