Skip to content

Conversation

@mpivchev
Copy link
Collaborator

@mpivchev mpivchev commented Nov 5, 2025

Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the share-related code by migrating from custom constants (NCShareCommon.shareType* and NCSharePermissions.permission*Share) to using NextcloudKit's built-in NKShare.ShareType and NKShare.Permission enums. This standardizes the codebase to use the external library's type system, reducing code duplication and improving maintainability.

Key changes:

  • Removed duplicate share type and permission constants from NCShareCommon and NCSharePermissions
  • Replaced all usages with NKShare.ShareType.<type>.rawValue and NKShare.Permission.<permission>.rawValue throughout the codebase
  • Added import NextcloudKit to files that now reference NKShare types

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
iOSClient/Share/TransientShare.swift Updated to use NKShare.Permission.create and NKShare.ShareType.publicLink instead of custom constants
iOSClient/Share/NCShareUserCell.swift Migrated share type comparisons to use NKShare.ShareType enums (team, federatedCloud, federatedGroup, talkConversation, email)
iOSClient/Share/NCSharePermissions.swift Removed duplicate permission constants, replaced with NKShare.Permission enum values; retained composite permission values that don't have direct equivalents
iOSClient/Share/NCShareNetworking.swift Updated share type checks to use NKShare.ShareType.publicLink
iOSClient/Share/NCShareNavigationTitleSetting.swift Added NextcloudKit import and updated to use NKShare.ShareType.publicLink
iOSClient/Share/NCShareLinkCell.swift Added NextcloudKit import and migrated to NKShare.ShareType.email
iOSClient/Share/NCShareCommon.swift Removed duplicate share type constants and simplified getImageShareType to use NKShare.ShareType with typealias; added NextcloudKit import
iOSClient/Share/NCShare.swift Updated all share type comparisons to use NKShare.ShareType enums throughout the file
iOSClient/Share/Advanced/NCShareDateCell.swift Migrated switch statements to use NKShare.ShareType values for expiration date logic
iOSClient/Share/Advanced/NCShareCells.swift Updated permission bit flag mappings to use NKShare.Permission enum; added trailing newline
iOSClient/Share/Advanced/NCShareAdvancePermission.swift Updated share type checks and permission handling to use NKShare types
iOSClient/Menu/NCShare+Menu.swift Migrated share type comparisons and permission calculations to use NKShare enums

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Milen Pivchev <milen.pivchev@gmail.com>
@marinofaggiana marinofaggiana merged commit f38a79e into master Nov 10, 2025
5 of 7 checks passed
@marinofaggiana marinofaggiana deleted the share-refactor branch November 10, 2025 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants