예제 #1
0
        private async Task ProcessMoved(WebSocketPackage webSocketPackage)
        {
            var file = await FileRepository.FindAsync(AccountObject.Token, webSocketPackage.UploadId);

            if (file == null)
            {
                return;
            }

            if (file.Status == FileStatus.Synchronized)
            {
                file.Status = FileStatus.RemotelyMovedFrom;

                var newFile = await FileRepository.CloneAsync(file.Id);

                var newServerFile = await Connection.GetUploadInfoAsync(AccountObject.Token, webSocketPackage.UploadId);

                newFile.Name    = newServerFile.UploadList[0].Name;
                newFile.Status  = FileStatus.RemotelyMovedTo;
                newFile.MovedId = file.Id;
            }
            else
            {
                file.Status = FileStatus.Conflict;
            }
        }