Esempio n. 1
0
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     if (common_config('public', 'localonly')) {
         $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
     } else {
         // -1 == blacklisted, -2 == gateway (i.e. Twitter)
         $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
         $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     }
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     // This feed always gives only local activities.
     $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     if (!empty($this->selectVerbs)) {
         $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     if (common_config('public', 'localonly')) {
         $notice->whereAdd('is_local = ' . Notice::LOCAL_PUBLIC);
     } else {
         // -1 == blacklisted, -2 == gateway (i.e. Twitter)
         $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
         $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     }
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $strSql = sprintf('(content_type=%d or content_type=%d)', NOTICE::CONTENT_TYPE_POST, NOTICE::CONTENT_TYPE_REPEAT);
     $strSql = sprintf('(content_type in (%d,%d,%d,%d))', NOTICE::CONTENT_TYPE_REPEAT, NOTICE::CONTENT_TYPE_REPEAT | NOTICE::CONTENT_TYPE_MENTIONS, NOTICE::CONTENT_TYPE_POST, NOTICE::CONTENT_TYPE_POST | NOTICE::CONTENT_TYPE_MENTIONS);
     $notice->whereAdd($strSql);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $notice->whereAdd('is_local =' . Notice::REMOTE);
     // -1 == blacklisted, -2 == gateway (i.e. Twitter)
     $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
     $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     if (!empty($this->selectVerbs)) {
         $notice->whereAddIn('verb', $this->selectVerbs, $notice->columnType('verb'));
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
Esempio n. 5
0
 function _streamDirect($user_id, $offset = 0, $limit = NOTICES_PER_PAGE, $since_id = 0, $max_id = 0)
 {
     $reply = new Reply();
     $reply->profile_id = $user_id;
     Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'modified');
     Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'modified');
     $reply->orderBy('modified DESC, notice_id DESC');
     if (!is_null($offset)) {
         $reply->limit($offset, $limit);
     }
     $ids = array();
     if ($reply->find()) {
         while ($reply->fetch()) {
             $ids[] = $reply->notice_id;
         }
     }
     return $ids;
 }
Esempio n. 6
0
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $reply = new Reply();
     $reply->profile_id = $this->userId;
     Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'modified');
     Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'modified');
     $reply->orderBy('modified DESC, notice_id DESC');
     if (!is_null($offset)) {
         $reply->limit($offset, $limit);
     }
     $ids = array();
     if ($reply->find()) {
         while ($reply->fetch()) {
             $ids[] = $reply->notice_id;
         }
     }
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->profile_id = $this->userId;
     $notice->content_type = Notice::CONTENT_TYPE_COMMENT;
     Notice::addWhereSinceId($notice, $since_id, 'id', 'modified');
     Notice::addWhereMaxId($notice, $max_id, 'id', 'modified');
     $notice->orderBy('modified DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->profile_id = $this->profile->id;
     $notice->selectAdd();
     $notice->selectAdd('id');
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $notice->find();
     $ids = array();
     while ($notice->fetch()) {
         $ids[] = $notice->id;
     }
     return $ids;
 }
Esempio n. 9
0
 function _streamDirect($tag, $offset, $limit, $since_id, $max_id)
 {
     $nt = new Notice_tag();
     $nt->tag = $tag;
     $nt->selectAdd();
     $nt->selectAdd('notice_id');
     Notice::addWhereSinceId($nt, $since_id, 'notice_id');
     Notice::addWhereMaxId($nt, $max_id, 'notice_id');
     $nt->orderBy('created DESC, notice_id DESC');
     if (!is_null($offset)) {
         $nt->limit($offset, $limit);
     }
     $ids = array();
     if ($nt->find()) {
         while ($nt->fetch()) {
             $ids[] = $nt->notice_id;
         }
     }
     return $ids;
 }
Esempio n. 10
0
 /**
  * Stream of notices linking to this URL
  *
  * @param integer $offset   Offset to show; default is 0
  * @param integer $limit    Limit of notices to show
  * @param integer $since_id Since this notice
  * @param integer $max_id   Before this notice
  *
  * @return array ids of notices that link to this file
  */
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $f2p = new File_to_post();
     $f2p->selectAdd();
     $f2p->selectAdd('post_id');
     $f2p->file_id = $this->file->id;
     Notice::addWhereSinceId($f2p, $since_id, 'post_id', 'modified');
     Notice::addWhereMaxId($f2p, $max_id, 'post_id', 'modified');
     $f2p->orderBy('modified DESC, post_id DESC');
     if (!is_null($offset)) {
         $f2p->limit($offset, $limit);
     }
     $ids = array();
     if ($f2p->find()) {
         while ($f2p->fetch()) {
             $ids[] = $f2p->post_id;
         }
     }
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $inbox = new Group_inbox();
     $inbox->group_id = $this->group->id;
     $inbox->selectAdd();
     $inbox->selectAdd('notice_id');
     Notice::addWhereSinceId($inbox, $since_id, 'notice_id');
     Notice::addWhereMaxId($inbox, $max_id, 'notice_id');
     $inbox->orderBy('created DESC, notice_id DESC');
     if (!is_null($offset)) {
         $inbox->limit($offset, $limit);
     }
     $ids = array();
     if ($inbox->find()) {
         while ($inbox->fetch()) {
             $ids[] = $inbox->notice_id;
         }
     }
     return $ids;
 }
Esempio n. 12
0
 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;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $reply = new Reply();
     $reply->selectAdd();
     $reply->selectAdd('notice_id');
     $reply->whereAdd(sprintf('reply.profile_id = %u', $this->userId));
     Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'reply.modified');
     Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'reply.modified');
     if (!empty($this->selectVerbs)) {
         $reply->joinAdd(array('notice_id', 'notice:id'));
         $reply->whereAddIn('notice.verb', $this->selectVerbs, 'string');
     }
     $reply->orderBy('reply.modified DESC, reply.notice_id DESC');
     if (!is_null($offset)) {
         $reply->limit($offset, $limit);
     }
     $ids = array();
     if ($reply->find()) {
         while ($reply->fetch()) {
             $ids[] = $reply->notice_id;
         }
     }
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     $notice->selectAdd('id');
     $notice->orderBy('id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $notice->whereAdd('is_local !=' . Notice::LOCAL_NONPUBLIC);
     $notice->whereAdd('is_local !=' . Notice::GATEWAY);
     $notice->whereAdd('repeat_of IS NULL');
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
 function getNoticeIds($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->profile_id = $this->profile->id;
     $notice->selectAdd();
     $notice->selectAdd('id');
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $strSql = sprintf('(content_type in (%d,%d,%d,%d))', NOTICE::CONTENT_TYPE_REPEAT, NOTICE::CONTENT_TYPE_REPEAT | NOTICE::CONTENT_TYPE_MENTIONS, NOTICE::CONTENT_TYPE_POST, NOTICE::CONTENT_TYPE_POST | NOTICE::CONTENT_TYPE_MENTIONS);
     $notice->whereAdd($strSql);
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     $notice->find();
     $ids = array();
     while ($notice->fetch()) {
         $ids[] = $notice->id;
     }
     return $ids;
 }
Esempio n. 16
0
 function _conversationStreamDirect($id, $offset = 0, $limit = 20, $since_id = 0, $max_id = 0)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->conversation = $id;
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }
Esempio n. 17
0
 function _repeatedByMeDirect($offset, $limit, $since_id, $max_id)
 {
     $notice = new Notice();
     $notice->selectAdd();
     // clears it
     $notice->selectAdd('id');
     $notice->profile_id = $this->id;
     $notice->whereAdd('repeat_of IS NOT NULL');
     $notice->orderBy('created DESC, id DESC');
     if (!is_null($offset)) {
         $notice->limit($offset, $limit);
     }
     Notice::addWhereSinceId($notice, $since_id);
     Notice::addWhereMaxId($notice, $max_id);
     $ids = array();
     if ($notice->find()) {
         while ($notice->fetch()) {
             $ids[] = $notice->id;
         }
     }
     $notice->free();
     $notice = NULL;
     return $ids;
 }