aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_notify.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-06-13 19:06:49 -0700
committerFriendika <info@friendika.com>2011-06-13 19:06:49 -0700
commitd5fdd4287dec00adcb08e389385b1ecbc23cca6a (patch)
tree87aa51b8d37d153701e077e9f090ffe6c6579ab0 /mod/dfrn_notify.php
parentd66056af9d56d86fdb57061c83c9187ea9f51403 (diff)
downloadvolse-hubzilla-d5fdd4287dec00adcb08e389385b1ecbc23cca6a.tar.gz
volse-hubzilla-d5fdd4287dec00adcb08e389385b1ecbc23cca6a.tar.bz2
volse-hubzilla-d5fdd4287dec00adcb08e389385b1ecbc23cca6a.zip
event sharing, cont.
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r--mod/dfrn_notify.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index 12e7ff7ce..949d9f9ab 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -2,6 +2,9 @@
require_once('simplepie/simplepie.inc');
require_once('include/items.php');
+require_once('include/event.php');
+
+
function dfrn_notify_post(&$a) {
$dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : '');
@@ -591,6 +594,23 @@ function dfrn_notify_post(&$a) {
$item_id = $item->get_id();
$datarray = get_atom_elements($feed,$item);
+ if((x($datarray,'object-type')) && ($datarray['object-type'] === ACTIVITY_OBJ_EVENT)) {
+ $ev = bbtoevent($datarray['body']);
+ if(x($ev,'desc') && x($ev,'start')) {
+ $ev['cid'] = $importer['id'];
+ $ev['uid'] = $importer['uid'];
+
+ $r = q("SELECT * FROM `event` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($item_id),
+ intval($importer['uid'])
+ );
+ 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['importer_uid'])