diff options
author | Fabio Comuni <fabrix.xm@gmail.com> | 2011-06-14 10:37:54 +0200 |
---|---|---|
committer | Fabio Comuni <fabrix.xm@gmail.com> | 2011-06-14 10:37:54 +0200 |
commit | b1184f3fdeb4dcc6126b7ea8d7ac1a2980c9cbac (patch) | |
tree | 07165e07f3c2e57e4719310195f1f2fd0a211c8d /mod/dfrn_notify.php | |
parent | 5882d8d022c14a12ba7b314c96289061bd195ed4 (diff) | |
parent | 9b9bd35cba293b86c871c2cfbe15e6d9c4673a7d (diff) | |
download | volse-hubzilla-b1184f3fdeb4dcc6126b7ea8d7ac1a2980c9cbac.tar.gz volse-hubzilla-b1184f3fdeb4dcc6126b7ea8d7ac1a2980c9cbac.tar.bz2 volse-hubzilla-b1184f3fdeb4dcc6126b7ea8d7ac1a2980c9cbac.zip |
Merge remote-tracking branch 'friendika-master/master' into admin
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r-- | mod/dfrn_notify.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 12e7ff7ce..6ca3f9fc2 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,24 @@ 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']; + $ev['uri'] = $item_id; + + $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']) |