send file sync packets for all known file operations

This commit is contained in:
redmatrix
2016-04-07 18:54:48 -07:00
parent 3a6187af3d
commit 279f32b13d
7 changed files with 112 additions and 47 deletions

View File

@@ -84,6 +84,20 @@ class File extends DAV\Node implements DAV\IFile {
dbesc($this->data['hash']),
intval($this->data['id'])
);
if($this->data->is_photo) {
$r = q("update photo set filename = '%s' where resource_id = '%s' and uid = %d",
dbesc($newName),
dbesc($this->data['hash']),
intval($this->auth->owner_id)
);
}
$ch = channelx_by_n($this->auth->owner_id);
if($ch) {
$sync = attach_export_data($ch,$this->data['hash']);
if($sync)
build_sync_packet($ch['channel_id'],array('file' => array($sync)));
}
}
/**
@@ -324,5 +338,12 @@ class File extends DAV\Node implements DAV\IFile {
}
attach_delete($this->auth->owner_id, $this->data['hash']);
$ch = channelx_by_n($this->auth->owner_id);
if($ch) {
$sync = attach_export_data($ch,$this->data['hash'],true);
if($sync)
build_sync_packet($ch['channel_id'],array('file' => array($sync)));
}
}
}