diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-04-23 11:52:32 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-04-23 11:52:32 +0200 |
commit | 5bd1ea0b959494bb981335c992783b69f9a9de6d (patch) | |
tree | c5130ae2b01ca204cdc44370476fbfc2c49ca1d9 /include/zot.php | |
parent | 689ced2ac007f086ba72151c94f4d4975e3ed9de (diff) | |
parent | 9ac67b44e42f433e34f60556e631b7573a83eb50 (diff) | |
download | volse-hubzilla-5bd1ea0b959494bb981335c992783b69f9a9de6d.tar.gz volse-hubzilla-5bd1ea0b959494bb981335c992783b69f9a9de6d.tar.bz2 volse-hubzilla-5bd1ea0b959494bb981335c992783b69f9a9de6d.zip |
Merge branch 'dev' into 3.4RC
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) + ); + } } } |