aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/zot.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/zot.php b/include/zot.php
index ee3f603cd..4d4877eba 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -398,11 +398,6 @@ function zot_refresh($them, $channel = null, $force = false) {
}
}
- $r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d and abook_self = 0 limit 1",
- dbesc($x['hash']),
- intval($channel['channel_id'])
- );
-
if(array_key_exists('profile',$j) && array_key_exists('next_birthday',$j['profile'])) {
$next_birthday = datetime_convert('UTC','UTC',$j['profile']['next_birthday']);
}
@@ -410,8 +405,15 @@ function zot_refresh($them, $channel = null, $force = false) {
$next_birthday = NULL_DATE;
}
+ $r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d and abook_self = 0 limit 1",
+ dbesc($x['hash']),
+ intval($channel['channel_id'])
+ );
+
if($r) {
+ // connection exists
+
// if the dob is the same as what we have stored (disregarding the year), keep the one
// we have as we may have updated the year after sending a notification; and resetting
// to the one we just received would cause us to create duplicated events.
@@ -453,6 +455,9 @@ function zot_refresh($them, $channel = null, $force = false) {
}
}
else {
+
+ // new connection
+
$role = get_pconfig($channel['channel_id'],'system','permissions_role');
if($role) {
$xx = get_role_perms($role);
@@ -2816,6 +2821,9 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
$channel = $r[0];
+ if(intval($channel['channel_removed']))
+ return;
+
$h = q("select * from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0",
dbesc($channel['channel_hash'])
);