From b033597ada02ef045bc9fbdb2237f81935b73e47 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 11 Nov 2019 21:30:38 +0100 Subject: sse notifications --- include/channel.php | 5 +++++ include/event.php | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/channel.php b/include/channel.php index 29835eac6..32bd596fc 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2953,3 +2953,8 @@ function pchan_to_chan($pchan) { function channel_url($channel) { return (($channel) ? z_root() . '/channel/' . $channel['channel_address'] : z_root()); } + +function get_channel_hashes() { + $r = q("SELECT channel_hash FROM channel WHERE channel_removed = 0"); + return flatten_array_recursive($r); +} diff --git a/include/event.php b/include/event.php index 6be1b6705..9d76aabd6 100644 --- a/include/event.php +++ b/include/event.php @@ -553,9 +553,19 @@ function event_store_event($arr) { dbesc($hash), intval($arr['uid']) ); - if($r) + if($r) { + + /** + * @hooks event_store_event_end + * Called after an event record was stored. + * * \e array \b event + */ + call_hooks('event_store_event_end', $r[0]); + return $r[0]; + } + return false; } -- cgit v1.2.3