private function message_has_flag($messageid, $flag) {
        // Get the current mailbox.
        $mailbox = $this->get_mailbox();

        // Grab messagedata including flags.
        $query = new \Horde_Imap_Client_Fetch_Query();
        $query->flags();
        $query->structure();
        $messagedata = $this->client->fetch($mailbox, $query, array(
            'ids' => $messageid,
        ))->first();
        $flags = $messagedata->getFlags();

        return in_array($flag, $flags);
    }
private function message_has_flag($messageid, $flag) {
        // Get the current mailbox.
        $mailbox = $this->get_mailbox();

        // Grab messagedata including flags.
        $query = new \Horde_Imap_Client_Fetch_Query();
        $query->flags();
        $query->structure();
        $messagedata = $this->client->fetch($mailbox, $query, array(
            'ids' => $messageid,
        ))->first();
        $flags = $messagedata->getFlags();

        return in_array($flag, $flags);
    }
private function message_has_flag ( $ messageid , $ flag ) { // Get the current mailbox. $ mailbox = $ this -> get_mailbox ( ) ; // Grab messagedata including flags. $ query = new \ Horde_Imap_Client_Fetch_Query ( ) ; $ query -> flags ( ) ; $ query -> structure ( ) ; $ messagedata = $ this -> client -> fetch ( $ mailbox , $ query , array ( 'ids' => $ messageid , ) ) -> first ( ) ; $ flags = $ messagedata -> getFlags ( ) ; return in_array ( $ flag , $ flags ) ; }
Check whether the message has the specified flag

@param mixed $messageid
@param string $flag The flag to check
@return bool
Check whether the message has the specified flag