Commit 492665a8 authored by Zot's avatar Zot Committed by Mario
Browse files

provide hook when deleting a connection - we need this to clean up dangling PuSH subscriptions

parent 55836e8c
......@@ -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
......
......@@ -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",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment