aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-27 17:00:41 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-27 17:00:41 -0700
commit55b530f0fdaeaee8dc8cb8be627e5418b8b0489a (patch)
treef051f5eb3941be66bdd6440a01256a798453ca84 /include
parentcd2b8115554e44c31867b4f1fdb4b2c0a3464097 (diff)
parent3a2c3ea8fa27024e483e43dabb22be81c173ae10 (diff)
downloadvolse-hubzilla-55b530f0fdaeaee8dc8cb8be627e5418b8b0489a.tar.gz
volse-hubzilla-55b530f0fdaeaee8dc8cb8be627e5418b8b0489a.tar.bz2
volse-hubzilla-55b530f0fdaeaee8dc8cb8be627e5418b8b0489a.zip
Merge https://github.com/redmatrix/redmatrix into pending_merge
Conflicts: include/zot.php util/messages.po
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'])
);