aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-01-17 11:47:55 -0800
committerzotlabs <mike@macgirvin.com>2019-01-17 11:47:55 -0800
commit96deae43faed34878da136846257e531c3133f46 (patch)
treef7558c9583fee6140f6131dbac0ce36009dc623c
parentb1b1e0eba4f1e698c5f0f4f14b0527741e5b9ffb (diff)
downloadvolse-hubzilla-96deae43faed34878da136846257e531c3133f46.tar.gz
volse-hubzilla-96deae43faed34878da136846257e531c3133f46.tar.bz2
volse-hubzilla-96deae43faed34878da136846257e531c3133f46.zip
this should fix the rest of the event stuff
-rw-r--r--include/event.php17
1 files 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'];