Favorite the MessageThread.

@return void
350913
public function favorite() : void
    {
        $data = (object)[
            'favoriteDetail' => (object)[
                'favoriteFlag' => true
            ]
        ];

        $this->putJson(sprintf(self::MESSAGE_THREAD_ENDPOINT . 'users/me/threads/%s/favorites', $this->messageThreadId), $data);
    }
981210
public function poll()
    {
        $latest = $this->eye->api()->composer();

        if (is_null($latest)) {
            return;
        }

        History::where('type', 'composer')->delete();

        History::create([
            'type' => 'composer',
            'meta' => 'composer',
            'record' => $latest
        ]);

        if ($latest === []) {
            if ($this->eye->status()->isSick('composer')) {
                $this->eye->notifier()->alert(new Safe);
            }

            $this->eye->status()->setHealthy('composer');
        } else {
            if ($this->eye->status()->isHealthy('composer')) {
                $this->eye->notifier()->alert(new Risk);
            }

            $this->eye->status()->setSick('composer');
        }
    }
1020914
def get_thread(self):
        """"""
        url = (self._imgur._base_url + "/3/message/{0}/thread".format(
               self.first_message.id))
        resp = self._imgur._send_request(url)
        return [Message(msg, self._imgur) for msg in resp]
1096999
private function welcomeMessage()
    {
        $this->block(' -- Welcome to CMS -- ', 'fg=white;bg=green;options=bold');
        $this->line('');
        $this->line('Please answer the following questions:');
        $this->line('');

        return $this;
    }
1250963
public function poll()
    {
        foreach($this->getDatabases() as $db)
        {
            $this->handleStatusAlerts($db);

            if ($db['status']) {
                $this->handleSizeAlerts($db);

                History::create(['type' => 'database',
                                 'meta' => $db['connection'],
                                 'record' => [],
                                 'value' => $db['size']]);
            }
        }
    }
129400
protected function run()
    {
        $slug = $this->get('slug');

        $category = $this->categories->findBySlug($slug);

        $creator = User::current();
        $now = Carbon::now();

        $conversation = (object) [
            'poster'        => $creator->username,
            'title'         => $this->get('subject'),
            'posted'        => $now,
            'last_post'     => $now,
            'last_poster'   => $creator->username,
            'category_slug' => $category->slug,
        ];

        $post = (new Post([
            'poster'	=> $creator->username,
            'poster_id'	=> $creator->id,
            'message'	=> $this->get('message'),
            'posted'	=> $now,
        ]));

        $this->categories->addNewTopic($category, $conversation, $post->toArray());

        $this->raise(new UserHasPosted($creator, $post));
    }
422448
public function indexNew()
    {
        $threads = $this->api('thread.index-new')->get();

        event(new UserViewingNew($threads));

        return view('forum::thread.index-new', compact('threads'));
    }
681381
def setDefaultThread(self, thread_id, thread_type):
        
        self._default_thread_id = thread_id
        self._default_thread_type = thread_type
250241
def add_thread t
    raise "duplicate" if @threads.values.member? t
    t.each { |m, *o| add_message m }
  end
1110759
public function run(): self
    {
        $this->displayComment();
        $this->launched = true;
        if ($this->onStart) {
            ($this->onStart)();
        }
        $this->execute();
        if ($this->onFinish) {
            ($this->onFinish)();
        }
        $this->doneIterationsCombined += $this->doneIterations;
        return $this;
    }
985344
public function actionMarkSeen()
    {
        if (Thread::podiumMarkAllSeen()) {
            $this->success(Yii::t('podium/flash', 'All unread threads have been marked as seen.'));
            return $this->redirect(['forum/index']);
        }
        $this->error(Yii::t('podium/flash', 'Sorry! There was an error while marking threads as seen. Contact administrator about this problem.'));
        return $this->redirect(['forum/unread-posts']);
    }
1153550
protected function ack()
    {
        $this->queue->ack($this->lastDeliveryTag, Constants::AMQP_MULTIPLE);
        $this->lastDeliveryTag = null;
        $delta = $this->timestampLastMessage - $this->timestampLastAck;

        $this->logger->info(sprintf(
            'Acknowledged %d messages at %.0f msg/s',
            $this->countMessagesUnacked,
            $delta ? $this->countMessagesUnacked / $delta : 0
        ));

        $this->timestampLastAck = microtime(true);
        $this->countMessagesUnacked = 0;
    }
515347
public static function notify($thread)
    {
        if (is_numeric($thread) && $thread > 0) {
            $forum = Podium::getInstance()->podiumConfig->get('name');
            $email = Content::fill(Content::EMAIL_SUBSCRIPTION);
            $subs = static::find()->where(['thread_id' => $thread, 'post_seen' => self::POST_SEEN]);
            foreach ($subs->each() as $sub) {
                $sub->post_seen = self::POST_NEW;
                if ($sub->save()) {
                    if ($email !== false && !empty($sub->user->email)) {
                        if (Email::queue(
                                $sub->user->email,
                                str_replace('{forum}', $forum, $email->topic),
                                str_replace('{forum}', $forum, str_replace('{link}', Html::a(
                                        Url::to(['forum/last', 'id' => $sub->thread_id], true),
                                        Url::to(['forum/last', 'id' => $sub->thread_id], true)
                                    ), $email->content)),
                                $sub->user_id
                            )) {
                            Log::info('Subscription notice link queued', $sub->user_id, __METHOD__);
                        } else {
                            Log::error('Error while queuing subscription notice link', $sub->user_id, __METHOD__);
                        }
                    } else {
                        Log::warning('Error while queuing subscription notice link - no email set', $sub->user_id, __METHOD__);
                    }
                }
            }
        }
    }
1316419
public function handleRequests(): void
    {
        $tail_call = false;
        do {
            $this->arg = $this->simpleArg;
            $this->stack = [$this->arg];
            $this->idx = 0;
            $this->parser->parse();
            if (count($this->stack) > 1) {
                $arg = array_pop($this->stack);
                if ($arg instanceof ApplyArg) {
                    $this->apply($arg);
                } else {
                    $msg = 'Error: $arg should be of type ApplyArg, error in client';
                    $this->logger->critical($msg);
                    throw new Exception\RuntimeException($msg);
                }
                $tail_call = true;
            }
            $this->stack = null;
        } while ($tail_call);
    }
782630
public function selectAndProcess(): void
    {
        $read = $this->resources;
        $unused_write = null;
        $unsued_exception = null;

        stream_select(
            $read,
            $unused_write,
            $unused_exception,
            $this->options['timeout_select'],
            $this->options['timeout_select_microsec']
        );

        foreach ($read as $socket) {
            if ($socket == $this->socket->getResource()) {
                $this->processMasterSocket();
            } else {
                $this->processClientSocket($socket);
            }
        }
    }
543049
public function threadsWithNewMessages()
    {
        return $this->threads()
            ->where(function (Builder $q) {
                $q->whereIn(Models::table('threads') . '.id', $this->unreadMessages()->pluck('thread_id'));
            })
            ->get();
    }
841689
private function getFavorite()
    {
        $favorite = $this->_parser->find('div[data-id=info2]', 0)->next_sibling()->next_sibling()->next_sibling();
        $favorite_title = $favorite->find('span', 0)->plaintext;
        $favorite = $favorite->plaintext;
        $favorite = trim(str_replace($favorite_title, '', $favorite));
        $favorite = str_replace(',', '', $favorite);

        return preg_replace("/([\s])+/", ' ', $favorite);
    }