aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-06-07 16:26:24 -0700
committerzotlabs <mike@macgirvin.com>2017-06-07 16:26:24 -0700
commit2e35dc648fd61ae2d39e8c46c14dbf19d31942fb (patch)
tree60d9cd3d50d3af209d321b3dbdcaa9418e06370b
parent59002cb87389159002ab8c426d475edb6d7883be (diff)
downloadvolse-hubzilla-2e35dc648fd61ae2d39e8c46c14dbf19d31942fb.tar.gz
volse-hubzilla-2e35dc648fd61ae2d39e8c46c14dbf19d31942fb.tar.bz2
volse-hubzilla-2e35dc648fd61ae2d39e8c46c14dbf19d31942fb.zip
provide hook when deleting a connection - we need this to clean up dangling PuSH subscriptions
-rw-r--r--doc/hooklist.bb3
-rw-r--r--include/connections.php5
2 files changed, 8 insertions, 0 deletions
diff --git a/doc/hooklist.bb b/doc/hooklist.bb
index 0b74a4df2..ab9c0529d 100644
--- a/doc/hooklist.bb
+++ b/doc/hooklist.bb
@@ -118,6 +118,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
[zrl=[baseurl]/help/hook/connect_premium]connect_premium[/zrl]
Called when connecting to a premium channel
+[zrl=[baseurl]/help/hook/connection_remove]connection_remove[/zrl]
+ Called when deleting/removing a connection
+
[zrl=[baseurl]/help/hook/connector_settings]connector_settings[/zrl]
Called when posting to the features/addon settings page
diff --git a/include/connections.php b/include/connections.php
index a2bc11773..c4c719ab8 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -341,6 +341,11 @@ function contact_remove($channel_id, $abook_id) {
logger('removing contact ' . $abook_id . ' for channel ' . $channel_id,LOGGER_DEBUG);
+
+ $x = [ 'channel_id' => $channel_id, 'abook_id' => $abook_id ];
+ call_hooks('connection_remove',$x);
+
+
$archive = get_pconfig($channel_id, 'system','archive_removed_contacts');
if($archive) {
q("update abook set abook_archived = 1 where abook_id = %d and abook_channel = %d",