aboutsummaryrefslogtreecommitdiffstats
path: root/include/connections.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-12-17 19:48:09 +0100
committerMario <mario@mariovavti.com>2021-12-17 19:48:09 +0100
commitbfd3da43ac9226e53188a03ff1414a18422e91b4 (patch)
treeb183e7c1c76aa8d39310fd702985bff7945e7053 /include/connections.php
parent32a9eaf3b6a68626580078a3302f8dd8e85eb165 (diff)
downloadvolse-hubzilla-bfd3da43ac9226e53188a03ff1414a18422e91b4.tar.gz
volse-hubzilla-bfd3da43ac9226e53188a03ff1414a18422e91b4.tar.bz2
volse-hubzilla-bfd3da43ac9226e53188a03ff1414a18422e91b4.zip
access token refactor
Diffstat (limited to 'include/connections.php')
-rw-r--r--include/connections.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/connections.php b/include/connections.php
index 11264e6d8..fbbf59c72 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -376,6 +376,19 @@ function contact_remove($channel_id, $abook_id) {
if(intval($abook['abook_self']))
return false;
+ // if this is an atoken, delete the atoken record
+
+ $xchan = q("select * from xchan where xchan_hash = '%s'",
+ dbesc($abook['abook_xchan'])
+ );
+
+ if (strpos($xchan['xchan_addr'],'guest:') === 0 && strpos($abook['abook_xchan'],'.')){
+ $atoken_guid = substr($abook['abook_xchan'],strrpos($abook['abook_xchan'],'.') + 1);
+ if ($atoken_guid) {
+ atoken_delete_and_sync($channel_id,$atoken_guid);
+ }
+ }
+
$r = q("select id, parent from item where (owner_xchan = '%s' or author_xchan = '%s') and uid = %d and item_retained = 0 and item_starred = 0",
dbesc($abook['abook_xchan']),
dbesc($abook['abook_xchan']),