From d5fdd4287dec00adcb08e389385b1ecbc23cca6a Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 13 Jun 2011 19:06:49 -0700 Subject: event sharing, cont. --- include/items.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index db500fda2..514bd1efa 100644 --- a/include/items.php +++ b/include/items.php @@ -1337,14 +1337,20 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_fee if((x($datarray,'object-type')) && ($datarray['object-type'] === ACTIVITY_OBJ_EVENT)) { $ev = bbtoevent($datarray['body']); if(x($ev,'desc') && x($ev,'start')) { + $ev['uid'] = $importer['uid']; + if(is_array($contact)) + $ev['cid'] = $contact['id']; $r = q("SELECT * FROM `event` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), intval($importer['uid']) ); - // import/update event - + if(count($r)) + $ev['id'] = $r[0]['id']; + $xyz = event_store($ev); + continue; } } + $r = q("SELECT `uid`, `last-child`, `edited`, `body` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1", dbesc($item_id), intval($importer['uid']) -- cgit v1.2.3