diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-19 16:50:32 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-19 16:50:32 -0700 |
commit | a4caaefd32ca68f45f7526dde61d17e8ca3dc3af (patch) | |
tree | 6d428adcffc2956b0a2e5688bbbb33ec7917ce23 /include/zot.php | |
parent | 4e3d295c909405da61d7ccd6c7bd99bd35c9feec (diff) | |
download | volse-hubzilla-a4caaefd32ca68f45f7526dde61d17e8ca3dc3af.tar.gz volse-hubzilla-a4caaefd32ca68f45f7526dde61d17e8ca3dc3af.tar.bz2 volse-hubzilla-a4caaefd32ca68f45f7526dde61d17e8ca3dc3af.zip |
event integration improvements
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/zot.php b/include/zot.php index bae20b4f0..17330838b 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1688,7 +1688,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $ $result[] = array($d['hash'],'update ignored',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); } else { - update_imported_item($sender,$arr,$channel['channel_id']); + update_imported_item($sender,$arr,$r[0],$channel['channel_id']); $result[] = array($d['hash'],'updated',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>',$arr['mid']); if(! $relay) add_source_route($item_id,$sender['hash']); @@ -1825,9 +1825,20 @@ function remove_community_tag($sender, $arr, $uid) { * @param array $item * @param int $uid (unused) */ -function update_imported_item($sender, $item, $uid) { +function update_imported_item($sender, $item, $orig, $uid) { + $x = item_store_update($item); + + // If we're updating an event that we've saved locally, we store the item info first + // because event_addtocal will parse the body to get the 'new' event details + + if($orig['resource_type'] === 'event') { + $res = event_addtocal($orig['id'],$uid); + if(! $res) + logger('update event: failed'); + } + if(! $x['item_id']) logger('update_imported_item: failed: ' . $x['message']); else |