@GET('^/api/v1/get_chat_messages')
    @authenticated
    def get_chat_messages(self, request):
        start = request.args["start"][0] if "start" in request.args else None
        messages = self.db.messages.get_messages(request.args["guid"][0], "CHAT", start)
        message_list = []
        for m in messages[::-1]:
            message_json = {
                "id": m[11],
                "guid": m[0],
                "handle": m[1],
                "message": m[5],
                "timestamp": m[6],
                "avatar_hash": m[7].encode("hex"),
                "outgoing": False if m[9] == 0 else True,
                "read": False if m[10] == 0 else True
            }
            message_list.append(message_json)
        request.setHeader('content-type', "application/json")
        request.write(json.dumps(sanitize_html(message_list), indent=4))
        request.finish()
        return server.NOT_DONE_YET
dataset/ETHPy150Open OpenBazaar/OpenBazaar-Server/api/restapi.py/OpenBazaarAPI.get_chat_messages/original