def do_claim_attachments(message: Message, potential_path_ids: List[str]) -> bool:
    claimed = False
    for path_id in potential_path_ids:
        user_profile = message.sender
        is_message_realm_public = False
        if message.is_stream_message():
            is_message_realm_public = Stream.objects.get(id=message.recipient.type_id).is_public()
        if (not validate_attachment_request(user_profile, path_id)):
            logging.warning('User %s tried to share upload %s in message %s, but lacks permission', user_profile.id, path_id, message.id)
            continue
        claimed = True
        attachment = claim_attachment(user_profile, path_id, message, is_message_realm_public)
        notify_attachment_update(user_profile, 'update', attachment.to_dict())
    return claimed
def do_claim_attachments(message: Message, potential_path_ids: List[str]) -> bool:
    claimed = False
    for path_id in potential_path_ids:
        user_profile = message.sender
        is_message_realm_public = False
        if message.is_stream_message():
            is_message_realm_public = Stream.objects.get(id=message.recipient.type_id).is_public()
        if (not validate_attachment_request(user_profile, path_id)):
            logging.warning('User %s tried to share upload %s in message %s, but lacks permission', user_profile.id, path_id, message.id)
            continue
        claimed = True
        attachment = claim_attachment(user_profile, path_id, message, is_message_realm_public)
        notify_attachment_update(user_profile, 'update', attachment.to_dict())
    return claimed