|
@@ -45,11 +45,11 @@ class NCShareNetworking: NSObject {
|
|
|
|
|
|
func readShare() {
|
|
|
NCUtility.shared.startActivityIndicator(view: view)
|
|
|
- let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase)!
|
|
|
+ let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase, account: metadata.account)!
|
|
|
NCCommunication.shared.readShares(path: filenamePath) { (account, shares, errorCode, errorDescription) in
|
|
|
NCUtility.shared.stopActivityIndicator()
|
|
|
if errorCode == 0 && shares != nil {
|
|
|
- NCManageDatabase.sharedInstance.addShare(account: self.metadata.account, urlBase: self.urlBase, shares: shares!)
|
|
|
+ NCManageDatabase.sharedInstance.addShare(urlBase: self.urlBase, account: self.metadata.account, shares: shares!)
|
|
|
self.appDelegate.shares = NCManageDatabase.sharedInstance.getTableShares(account: self.metadata.account)
|
|
|
} else {
|
|
|
NCContentPresenter.shared.messageNotification("_share_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: Int(k_CCErrorInternalError), forced: true)
|
|
@@ -60,11 +60,11 @@ class NCShareNetworking: NSObject {
|
|
|
|
|
|
func createShareLink(password: String?) {
|
|
|
NCUtility.shared.startActivityIndicator(view: view)
|
|
|
- let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase)!
|
|
|
+ let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase, account: metadata.account)!
|
|
|
NCCommunication.shared.createShareLink(path: filenamePath, password: password) { (account, share, errorCode, errorDescription) in
|
|
|
NCUtility.shared.stopActivityIndicator()
|
|
|
if errorCode == 0 && share != nil {
|
|
|
- NCManageDatabase.sharedInstance.addShare(account: self.metadata.account, urlBase: self.urlBase, shares: [share!])
|
|
|
+ NCManageDatabase.sharedInstance.addShare(urlBase: self.urlBase, account: self.metadata.account, shares: [share!])
|
|
|
self.appDelegate.shares = NCManageDatabase.sharedInstance.getTableShares(account: self.metadata.account)
|
|
|
} else if errorCode != 0 {
|
|
|
NCContentPresenter.shared.messageNotification("_share_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: Int(k_CCErrorInternalError), forced: true)
|
|
@@ -75,13 +75,13 @@ class NCShareNetworking: NSObject {
|
|
|
|
|
|
func createShare(shareWith: String, shareType: Int, metadata: tableMetadata) {
|
|
|
NCUtility.shared.startActivityIndicator(view: view)
|
|
|
- let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase)!
|
|
|
+ let filenamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: metadata.serverUrl, urlBase: urlBase, account: metadata.account)!
|
|
|
var permission: Int = 1
|
|
|
if metadata.directory { permission = Int(k_max_folder_share_permission) } else { permission = Int(k_max_file_share_permission) }
|
|
|
NCCommunication.shared.createShare(path: filenamePath, shareType: shareType, shareWith: shareWith, permissions: permission) { (account, share, errorCode, errorDescription) in
|
|
|
NCUtility.shared.stopActivityIndicator()
|
|
|
if errorCode == 0 && share != nil {
|
|
|
- NCManageDatabase.sharedInstance.addShare(account: self.metadata.account, urlBase: self.urlBase, shares: [share!])
|
|
|
+ NCManageDatabase.sharedInstance.addShare(urlBase: self.urlBase, account: self.metadata.account, shares: [share!])
|
|
|
self.appDelegate.shares = NCManageDatabase.sharedInstance.getTableShares(account: self.metadata.account)
|
|
|
} else {
|
|
|
NCContentPresenter.shared.messageNotification("_share_", description: errorDescription, delay: TimeInterval(k_dismissAfterSecond), type: NCContentPresenter.messageType.error, errorCode: Int(k_CCErrorInternalError), forced: true)
|
|
@@ -108,7 +108,7 @@ class NCShareNetworking: NSObject {
|
|
|
NCCommunication.shared.updateShare(idShare: idShare, password: password, expireDate: expirationDate, permissions: permission, note: note, hideDownload: hideDownload) { (account, share, errorCode, errorDescription) in
|
|
|
NCUtility.shared.stopActivityIndicator()
|
|
|
if errorCode == 0 && share != nil {
|
|
|
- NCManageDatabase.sharedInstance.addShare(account: self.metadata.account, urlBase: self.urlBase, shares: [share!])
|
|
|
+ NCManageDatabase.sharedInstance.addShare(urlBase: self.urlBase, account: self.metadata.account, shares: [share!])
|
|
|
self.appDelegate.shares = NCManageDatabase.sharedInstance.getTableShares(account: self.metadata.account)
|
|
|
self.delegate?.readShareCompleted()
|
|
|
} else {
|