Since we store 'favorite' verbs as notices now too, they caused a lot of
"null" notices that might not be interesting before we handle them better
in the UIs.
$notice->limit($offset, $limit);
}
$notice->limit($offset, $limit);
}
+ if (!$this->allVerbs) {
+ $notice->whereAdd(sprintf('verb="%s" OR verb="%s"',
+ ActivityVerb::POST,
+ ActivityUtils::resolveUri(ActivityVerb::POST, true)));
+ }
+
// ORDER BY
// currently imitates the previously used "_reverseChron" sorting
$notice->orderBy('notice.created DESC');
// ORDER BY
// currently imitates the previously used "_reverseChron" sorting
$notice->orderBy('notice.created DESC');
*/
abstract class NoticeStream
{
*/
abstract class NoticeStream
{
+ protected $allVerbs = false; // Will only get 'post' activityverbs by default.
+
abstract function getNoticeIds($offset, $limit, $since_id, $max_id);
function getNotices($offset, $limit, $sinceId = null, $maxId = null)
abstract function getNoticeIds($offset, $limit, $since_id, $max_id);
function getNotices($offset, $limit, $sinceId = null, $maxId = null)
Notice::addWhereSinceId($notice, $since_id);
Notice::addWhereMaxId($notice, $max_id);
Notice::addWhereSinceId($notice, $since_id);
Notice::addWhereMaxId($notice, $max_id);
+ if (!$this->allVerbs) {
+ $notice->whereAdd(sprintf('verb="%s" OR verb="%s"',
+ ActivityVerb::POST,
+ ActivityUtils::resolveUri(ActivityVerb::POST, true)));
+ }
+
$notice->orderBy('created DESC, id DESC');
if (!is_null($offset)) {
$notice->orderBy('created DESC, id DESC');
if (!is_null($offset)) {
Notice::addWhereSinceId($notice, $since_id);
Notice::addWhereMaxId($notice, $max_id);
Notice::addWhereSinceId($notice, $since_id);
Notice::addWhereMaxId($notice, $max_id);
+ if (!$this->allVerbs) {
+ $notice->whereAdd(sprintf('verb="%s" OR verb="%s"',
+ ActivityVerb::POST,
+ ActivityUtils::resolveUri(ActivityVerb::POST, true)));
+ }
+
$ids = array();
if ($notice->find()) {
$ids = array();
if ($notice->find()) {
-}
\ No newline at end of file
Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'modified');
Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'modified');
Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'modified');
Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'modified');
+ if (!$this->allVerbs) {
+ $notice->whereAdd(sprintf('verb="%s" OR verb="%s"',
+ ActivityVerb::POST,
+ ActivityUtils::resolveUri(ActivityVerb::POST, true)));
+ }
+
$reply->orderBy('modified DESC, notice_id DESC');
if (!is_null($offset)) {
$reply->orderBy('modified DESC, notice_id DESC');
if (!is_null($offset)) {
-}
\ No newline at end of file