public function search(array $criterias = array(), $limit = null)
    {
        $messages = array();

        foreach ($this->request('GET') as $message) {
            if (isset($this->messages[$message['id']])) {
                $messages[] = $this->messages[$message['id']];
            } else {
                $messages[] = $this->messages[$message['id']] = new Message($this, $message);
            }
        }

        $result = array();
        foreach ($messages as $message) {
            if (null !== $limit && count($result) >= $limit) {
                break;
            }
            if ($message->match($criterias)) {
                $result[] = $message;
            }
        }

        return $result;
    }