aboutsummaryrefslogtreecommitdiffstats
path: root/include/channel.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/channel.php')
-rw-r--r--include/channel.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/channel.php b/include/channel.php
index 00d973738..c80a35385 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -21,6 +21,7 @@ require_once('include/crypto.php');
require_once('include/menu.php');
require_once('include/perm_upgrade.php');
require_once('include/photo/photo_driver.php');
+require_once('include/security.php');
/**
* @brief Called when creating a new channel.
@@ -878,6 +879,14 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
}
if(in_array('connections',$sections)) {
+ $r = q("select * from atoken where atoken_uid = %d",
+ intval($channel_id)
+ );
+
+ if ($r) {
+ $ret['atoken'] = $r;
+ }
+
$xchans = array();
$r = q("select * from abook where abook_channel = %d ",
intval($channel_id)
@@ -1963,11 +1972,24 @@ function zat_init() {
);
if($r) {
$xchan = atoken_xchan($r[0]);
- atoken_create_xchan($xchan);
+ //atoken_create_xchan($xchan);
atoken_login($xchan);
}
}
+function atoken_delete_and_sync($channel_id, $atoken_guid) {
+ $r = q("select * from atoken where atoken_guid = '%s' and atoken_uid = %d",
+ dbesc($atoken_guid),
+ intval($channel_id)
+ );
+
+ if ($r) {
+ $atok = $r[0];
+ $atok['deleted'] = true;
+ atoken_delete($atok['atoken_id']);
+ Libsync::build_sync_packet($channel_id, ['atoken' => [ $atok ]]);
+ }
+}
/**
* @brief Used from within PCSS themes to set theme parameters.