Do not create -conflict if versions are enabled

pull/1/head
Victor Dubiniuk 11 years ago
parent 3830de9dda
commit 99818f98ea

@ -101,7 +101,7 @@ class SessionController extends Controller{
if ($view->file_exists($path)){
$currentHash = sha1($view->file_get_contents($path));
if ($currentHash !== $sessionData['genesis_hash']){
if (!Helper::isVersionsEnabled() && $currentHash !== $sessionData['genesis_hash']){
// Original file was modified externally. Save to a new one
$path = Helper::getNewFileName($view, $path, '-conflict');
}

@ -26,6 +26,10 @@ class Helper{
return $path;
}
public static function isVersionsEnabled(){
return \OCP\App::isEnabled('files_versions');
}
public static function getRandomColor(){
$str = dechex(floor(rand(0, 16777215)));
return '#' . str_pad($str, 6, "0", STR_PAD_LEFT);

Loading…
Cancel
Save