def fetch(self):
try:<EOL><INDENT>if not self._last_message_id:<EOL><INDENT>messages = self._connection.get("<STR_LIT>" % self._room_id, key="<STR_LIT>", parameters={<EOL>"<STR_LIT>": <NUM_LIT:1><EOL>})<EOL>self._last_message_id = messages[-<NUM_LIT:1>]["<STR_LIT:id>"]<EOL><DEDENT>messages = self._connection.get("<STR_LIT>" % self._room_id, key="<STR_LIT>", parameters={<EOL>"<STR_LIT>": self._last_message_id<EOL>})<EOL><DEDENT>except:<EOL><INDENT>messages = []<EOL><DEDENT>if messages:<EOL><INDENT>self._last_message_id = messages[-<NUM_LIT:1>]["<STR_LIT:id>"]<EOL><DEDENT>self.received(messages)<EOL>
Fetch new messages.