123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
- if (!defined('STATUSNET')) {
-
-
- exit(1);
- }
- class SpamNoticeStream extends ScopingNoticeStream
- {
- function __construct($tag, $profile = -1)
- {
- if (is_int($profile) && $profile == -1) {
- $profile = Profile::current();
- }
- parent::__construct(new CachingNoticeStream(new RawSpamNoticeStream(),
- 'spam_score:notice_ids'));
- }
- }
- class RawSpamNoticeStream extends NoticeStream
- {
- function getNoticeIds($offset, $limit, $since_id, $max_id)
- {
- $ss = new Spam_score();
- $ss->is_spam = 1;
- $ss->selectAdd();
- $ss->selectAdd('notice_id');
- Notice::addWhereSinceId($ss, $since_id, 'notice_id');
- Notice::addWhereMaxId($ss, $max_id, 'notice_id');
- $ss->orderBy('notice_created DESC, notice_id DESC');
- if (!is_null($offset)) {
- $ss->limit($offset, $limit);
- }
- $ids = array();
- if ($ss->find()) {
- while ($ss->fetch()) {
- $ids[] = $ss->notice_id;
- }
- }
- return $ids;
- }
- }
|