diff options
author | zotlabs <mike@macgirvin.com> | 2018-04-23 18:15:18 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-04-23 18:15:18 -0700 |
commit | 59ac3d04eb7739e995a1d7392c4ef8ca0b6c5f86 (patch) | |
tree | 441eaf27002043e6efec5c8935ae6faaca7d57eb /include/zot.php | |
parent | 97308ad2fbb31ec90644e6145ec6e17bc9663c22 (diff) | |
parent | 2dff10564c66ceb9f199d4edc936a542c28f5104 (diff) | |
download | volse-hubzilla-59ac3d04eb7739e995a1d7392c4ef8ca0b6c5f86.tar.gz volse-hubzilla-59ac3d04eb7739e995a1d7392c4ef8ca0b6c5f86.tar.bz2 volse-hubzilla-59ac3d04eb7739e995a1d7392c4ef8ca0b6c5f86.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/include/zot.php b/include/zot.php index c2b622277..0343f4464 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3811,25 +3811,27 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { foreach($x as $y) { // for each group, loop on members list we just received - foreach($members[$y['hash']] as $member) { - $found = false; - $z = q("select xchan from group_member where gid = %d and uid = %d and xchan = '%s' limit 1", - intval($y['id']), - intval($channel['channel_id']), - dbesc($member) - ); - if($z) - $found = true; - - // if somebody is in the group that wasn't before - add them - - if(! $found) { - q("INSERT INTO group_member (uid, gid, xchan) - VALUES( %d, %d, '%s' ) ", - intval($channel['channel_id']), + if(isset($y['hash']) && isset($members[$y['hash']])) { + foreach($members[$y['hash']] as $member) { + $found = false; + $z = q("select xchan from group_member where gid = %d and uid = %d and xchan = '%s' limit 1", intval($y['id']), + intval($channel['channel_id']), dbesc($member) ); + if($z) + $found = true; + + // if somebody is in the group that wasn't before - add them + + if(! $found) { + q("INSERT INTO group_member (uid, gid, xchan) + VALUES( %d, %d, '%s' ) ", + intval($channel['channel_id']), + intval($y['id']), + dbesc($member) + ); + } } } |