aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-12-14 21:38:49 +0000
committerMario <mario@mariovavti.com>2020-12-14 21:38:49 +0000
commite58e27ce2256ce4192c6ac7670ccb301fb40e60a (patch)
tree03119ad1f20407856bb32c9474af1889074aa4bb /include/import.php
parent78c0926a64dcb40656a979178f9332b0845def18 (diff)
downloadvolse-hubzilla-e58e27ce2256ce4192c6ac7670ccb301fb40e60a.tar.gz
volse-hubzilla-e58e27ce2256ce4192c6ac7670ccb301fb40e60a.tar.bz2
volse-hubzilla-e58e27ce2256ce4192c6ac7670ccb301fb40e60a.zip
sync categories
Diffstat (limited to 'include/import.php')
-rw-r--r--include/import.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/import.php b/include/import.php
index 8f7c28f93..eb3125a8e 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1352,7 +1352,6 @@ function sync_files($channel, $files) {
}
$redirects = 0;
-
$headers = [];
$headers['Accept'] = 'application/x-zot+json' ;
$headers['Sigtoken'] = random_string();
@@ -1363,6 +1362,25 @@ function sync_files($channel, $files) {
if($x['success']) {
$attachment_stored = true;
+
+ $a = q("SELECT id FROM attach WHERE hash = '%s' AND uid = %d LIMIT 1",
+ dbesc($att['hash']),
+ intval($channel['channel_id'])
+ );
+ if($a) {
+ q("DELETE FROM term WHERE uid = %d AND oid = %d AND otype = %d",
+ intval($channel['channel_id']),
+ intval($a[0]['id']),
+ intval(TERM_OBJ_FILE)
+ );
+ if($att['term']) {
+ foreach($att['term'] as $t) {
+ if(array_key_exists('type',$t))
+ $t['ttype'] = $t['type'];
+ store_item_tag($channel['channel_id'], $a[0]['id'], TERM_OBJ_FILE, $t['ttype'], escape_tags($t['term']), escape_tags($t['url']));
+ }
+ }
+ }
}
continue;
}