From 96deae43faed34878da136846257e531c3133f46 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 17 Jan 2019 11:47:55 -0800 Subject: this should fix the rest of the event stuff --- include/event.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/event.php b/include/event.php index a34250e7a..fdb9e1415 100644 --- a/include/event.php +++ b/include/event.php @@ -6,6 +6,10 @@ use Sabre\VObject; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; + + require_once('include/bbcode.php'); /** @@ -463,8 +467,13 @@ function event_store_event($arr) { $hash = $arr['external_id']; elseif(array_key_exists('event_hash',$arr)) $hash = $arr['event_hash']; - else - $hash = random_string() . '@' . App::get_hostname(); + else { + try { + $hash = Uuid::uuid4()->toString(); + } catch (UnsatisfiedDependencyException $e) { + $hash = random_string(48); + } + } $r = q("INSERT INTO event ( uid,aid,event_xchan,event_hash,created,edited,dtstart,dtend,summary,description,location,etype, adjust,nofinish, event_status, event_status_date, event_percent, event_repeat, event_sequence, event_priority, event_vdata, allow_cid,allow_gid,deny_cid,deny_gid) @@ -1126,8 +1135,8 @@ function event_store_item($arr, $event) { } if(! $arr['mid']) { - $arr['uuid'] = item_message_id(); - $arr['mid'] = z_root() . '/item/' . $arr['uuid']; + $arr['uuid'] = $event['event_hash']; + $arr['mid'] = z_root() . '/event/' . $event['event_hash']; } $item_arr['aid'] = $z[0]['channel_account_id']; -- cgit v1.2.3