def get_older_messages(room_id): room = get_room(room_id) if room and is_room_member(room_id, current_user.username): page = int(request.args.get('page', 0)) messages = get_messages(room_id, page) return dumps(messages) else: return "Room not found", 404
def view_room(room_id): room = get_room(room_id) if room and is_room_member(room_id, current_user.username): room_members = get_room_members(room_id) messages = get_messages(room_id) return render_template('view_room.html', username=current_user.username, room=room, room_members=room_members, messages=messages) else: return "Room not found", 404