diff options
author | zotlabs <mike@macgirvin.com> | 2017-07-19 20:31:11 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-07-19 20:31:11 -0700 |
commit | ceeb9836b98c8a854fe6501fd51c3de7c4c91655 (patch) | |
tree | 848d2999910efb9b11ac311052a8ed3b899bd2b1 /include | |
parent | df7f0eb9a4eb42aebd94cbdf8288f0fa8c9b3782 (diff) | |
download | volse-hubzilla-ceeb9836b98c8a854fe6501fd51c3de7c4c91655.tar.gz volse-hubzilla-ceeb9836b98c8a854fe6501fd51c3de7c4c91655.tar.bz2 volse-hubzilla-ceeb9836b98c8a854fe6501fd51c3de7c4c91655.zip |
implement update_feed_item
Diffstat (limited to 'include')
-rw-r--r-- | include/feedutils.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/feedutils.php b/include/feedutils.php index 5d537553f..9a70fdae4 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -1073,7 +1073,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $datarray['owner_xchan'] = $contact['xchan_hash']; - $r = q("SELECT edited FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", + $r = q("SELECT id, edited FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", dbesc($datarray['mid']), intval($importer['channel_id']) ); @@ -1089,7 +1089,12 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { if(datetime_convert('UTC','UTC',$datarray['edited']) < $r[0]['edited']) continue; + $datarray['uid'] = $importer['channel_id']; + $datarray['aid'] = $importer['channel_account_id']; + $datarray['id'] = $r[0]['id']; + update_feed_item($importer['channel_id'],$datarray); + } continue; } @@ -1300,7 +1305,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { } - $r = q("SELECT edited FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", + $r = q("SELECT id, edited FROM item WHERE mid = '%s' AND uid = %d LIMIT 1", dbesc($datarray['mid']), intval($importer['channel_id']) ); @@ -1315,6 +1320,10 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { if(datetime_convert('UTC','UTC',$datarray['edited']) < $r[0]['edited']) continue; + $datarray['uid'] = $importer['channel_id']; + $datarray['aid'] = $importer['channel_account_id']; + $datarray['id'] = $r[0]['id']; + update_feed_item($importer['channel_id'],$datarray); } @@ -1555,7 +1564,7 @@ function feed_meta($xml) { * @param array $datarray */ function update_feed_item($uid, $datarray) { - logger('Not implemented! ' . $uid . ' ' . print_r($datarray, true), LOGGER_DATA); + item_store_update($datarray); } /** |