public ChatPacket[] getRoomMessages(LongInteger room) {
        // TODO: Fix this
        if (!store.messages.containsKey(room)) {
            return new ChatPacket[0];
        }

        ArrayList<Integer> sorted = new ArrayList<Integer>();
        for (LongInteger src : store.messages.keySet()) {
            for (ChatPacket p : store.messages.get(src).values()) {
                if (p.getType() == PacketType.CHAT_MESSAGE) {
                    ChatMessage msg = (ChatMessage) p.getPayload();
                    if (msg.getParam(MessageField.TO_ROOM) && msg.getDest().equals(room)) {
                        sorted.add(msg.getPersistenceId());
                    }
                }
            }
        }

        Collections.sort(sorted);
        ChatPacket[] ret = new ChatPacket[sorted.size()];
        for (int i = 0; i < sorted.size(); i++) {
            ret[i] = store.messages.get(room).get(sorted.get(i));
        }
        return ret;
    }