From 06998f13b61fcd50588f425703793bacc2e55cab Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 22 May 2016 18:05:01 +0200 Subject: [PATCH 1/3] Events: Now with guid. --- include/notifier.php | 3 +++ mod/events.php | 1 + 2 files changed, 4 insertions(+) diff --git a/include/notifier.php b/include/notifier.php index 6c90629bd8..a922dba346 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -376,6 +376,7 @@ function notifier_run(&$argv, &$argc){ $conversants = array_unique($conversants); + logger('Allow data for '.$target_item["guid"].". People: ".implode(', ', $allow_people)." - Groups: ".implode(', ', $allow_groups), LOGGER_DEBUG); $recipients = array_unique(array_merge($recipients,$allow_people,$allow_groups)); $deny = array_unique(array_merge($deny_people,$deny_groups)); @@ -455,6 +456,8 @@ function notifier_run(&$argv, &$argc){ else $recip_str = implode(', ', $recipients); + logger('Recipients for '.$target_item["guid"]." (Followup: ".$followup."): ".$recip_str, LOGGER_DEBUG); + if ($relocate) $r = $recipients_relocate; else diff --git a/mod/events.php b/mod/events.php index 653ae489b8..633aaf0c1d 100644 --- a/mod/events.php +++ b/mod/events.php @@ -124,6 +124,7 @@ function events_post(&$a) { $datarray = array(); + $datarray['guid'] = get_guid(32); $datarray['start'] = $start; $datarray['finish'] = $finish; $datarray['summary'] = $summary; From b7f2858486de9bb20a4e16451590b1657760eb02 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 22 May 2016 18:16:47 +0200 Subject: [PATCH 2/3] Issue 2277: changes to events are now distributed. --- include/event.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/include/event.php b/include/event.php index a9f054fc2e..c5e5ff18d7 100644 --- a/include/event.php +++ b/include/event.php @@ -291,10 +291,6 @@ function event_store($arr) { `type` = '%s', `adjust` = %d, `nofinish` = %d, - `allow_cid` = '%s', - `allow_gid` = '%s', - `deny_cid` = '%s', - `deny_gid` = '%s' WHERE `id` = %d AND `uid` = %d", dbesc($arr['edited']), @@ -306,10 +302,6 @@ function event_store($arr) { dbesc($arr['type']), intval($arr['adjust']), intval($arr['nofinish']), - dbesc($arr['allow_cid']), - dbesc($arr['allow_gid']), - dbesc($arr['deny_cid']), - dbesc($arr['deny_gid']), intval($arr['id']), intval($arr['uid']) ); @@ -323,22 +315,16 @@ function event_store($arr) { $object .= '' . "\n"; - q("UPDATE `item` SET `body` = '%s', `object` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `edited` = '%s', `private` = %d WHERE `id` = %d AND `uid` = %d", + q("UPDATE `item` SET `body` = '%s', `object` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d", dbesc(format_event_bbcode($arr)), dbesc($object), - dbesc($arr['allow_cid']), - dbesc($arr['allow_gid']), - dbesc($arr['deny_cid']), - dbesc($arr['deny_gid']), dbesc($arr['edited']), - intval($arr['private']), intval($r[0]['id']), intval($arr['uid']) ); $item_id = $r[0]['id']; - } - else + } else $item_id = 0; call_hooks("event_updated", $arr['id']); From b9e702742cd192a5cbdd378eca6a67603df4d037 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 22 May 2016 18:22:05 +0200 Subject: [PATCH 3/3] Remove some test logging --- include/notifier.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/notifier.php b/include/notifier.php index a922dba346..6c90629bd8 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -376,7 +376,6 @@ function notifier_run(&$argv, &$argc){ $conversants = array_unique($conversants); - logger('Allow data for '.$target_item["guid"].". People: ".implode(', ', $allow_people)." - Groups: ".implode(', ', $allow_groups), LOGGER_DEBUG); $recipients = array_unique(array_merge($recipients,$allow_people,$allow_groups)); $deny = array_unique(array_merge($deny_people,$deny_groups)); @@ -456,8 +455,6 @@ function notifier_run(&$argv, &$argc){ else $recip_str = implode(', ', $recipients); - logger('Recipients for '.$target_item["guid"]." (Followup: ".$followup."): ".$recip_str, LOGGER_DEBUG); - if ($relocate) $r = $recipients_relocate; else