diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-07 20:28:02 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-07 20:28:02 -0700 |
commit | c39e3613a8facf0ef626fbd671f21f822ff25096 (patch) | |
tree | e39477b1a0d08e8631515bb4a973d3ccf151fc98 /mod | |
parent | 5751437c93d43c07726cf122c87a39ac522032c6 (diff) | |
download | volse-hubzilla-c39e3613a8facf0ef626fbd671f21f822ff25096.tar.gz volse-hubzilla-c39e3613a8facf0ef626fbd671f21f822ff25096.tar.bz2 volse-hubzilla-c39e3613a8facf0ef626fbd671f21f822ff25096.zip |
create event sync packets
Diffstat (limited to 'mod')
-rwxr-xr-x | mod/events.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mod/events.php b/mod/events.php index 9c94d433d..1e4fef73c 100755 --- a/mod/events.php +++ b/mod/events.php @@ -219,6 +219,19 @@ function events_post(&$a) { $item_id = event_store_item($datarray,$event); + if($r) { + xchan_query($r); + $sync_item = fetch_post_tags($r); + $z = q("select * from event where event_hash = '%s' and uid = %d limit 1", + dbesc($r[0]['resource_id']), + intval($channel['channel_id']) + ); + if($z) { + build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z)); + } + } + + if($share) proc_run('php',"include/notifier.php","event","$item_id"); @@ -505,6 +518,9 @@ function events_content(&$a) { dbesc($event_id), intval(local_channel()) ); + + $sync_event = $r[0]; + if($r) { $r = q("delete from event where event_hash = '%s' and uid = %d limit 1", dbesc($event_id), @@ -515,6 +531,9 @@ function events_content(&$a) { dbesc($event_id), intval(local_channel()) ); + $sync_event['event_deleted'] = 1; + build_sync_packet(0,array('event' => array($sync_event))); + info( t('Event removed') . EOL); } else { |