X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FPost%2FThreadUser.php;h=b0a30c486e66987b5243f2fa42405a22e050f71f;hb=2e05dac7dae0a3d028b442a2d5afbd4176a32e99;hp=c824b44c89dfcc9e67677ece41b6b07dc8835ccb;hpb=15162b4027c7726a325cc1907aa269bc7b45aeea;p=friendica.git diff --git a/src/Model/Post/ThreadUser.php b/src/Model/Post/ThreadUser.php index c824b44c89..b0a30c486e 100644 --- a/src/Model/Post/ThreadUser.php +++ b/src/Model/Post/ThreadUser.php @@ -1,6 +1,6 @@ $uri_id, 'uid' => $uid]); + if (empty($threaduser)) { + return false; + } + return (bool)$threaduser['ignored']; + } + + /** + * @param int $uri_id + * @param int $uid + * @param int $ignored + * @return void + * @throws Exception + */ + public static function setIgnored(int $uri_id, int $uid, int $ignored) + { + DBA::update('post-thread-user', ['ignored' => $ignored], ['uri-id' => $uri_id, 'uid' => $uid], true); + } + + /** + * @param int $uri_id + * @param int $uid + * @return bool + * @throws Exception + */ + public static function getPinned(int $uri_id, int $uid) + { + $threaduser = DBA::selectFirst('post-thread-user', ['pinned'], ['uri-id' => $uri_id, 'uid' => $uid]); + if (empty($threaduser)) { + return false; + } + return (bool)$threaduser['pinned']; + } + + /** + * @param int $uri_id + * @param int $uid + * @param int $pinned + * @return void + * @throws Exception + */ + public static function setPinned(int $uri_id, int $uid, int $pinned) + { + DBA::update('post-thread-user', ['pinned' => $pinned], ['uri-id' => $uri_id, 'uid' => $uid], true); + } }