mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 05:15:16 +00:00
collection sync issue
This commit is contained in:
parent
5d5dde174e
commit
437b0cb16e
1 changed files with 25 additions and 0 deletions
|
@ -2337,6 +2337,31 @@ function process_channel_sync_delivery($sender,$arr,$deliveries) {
|
|||
dbesc($cl['name'])
|
||||
);
|
||||
}
|
||||
|
||||
// now look for any collections locally which weren't in the list we just received.
|
||||
// They need to be removed by marking deleted and removing the members.
|
||||
// This shouldn't happen except for clones created before this function was written.
|
||||
|
||||
if($x) {
|
||||
$found_local = false;
|
||||
foreach($x as $y) {
|
||||
foreach($arr['collections'] as $cl) {
|
||||
if($cl['collection'] == $y['hash']) {
|
||||
$found_local = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(! $found_local) {
|
||||
q("delete from group_member where gid = %d",
|
||||
intval($y['id'])
|
||||
);
|
||||
q("update groups set deleted = 1 where id = %d and uid = %d limit 1",
|
||||
intval($y['id']),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// reload the group list with any updates
|
||||
|
|
Loading…
Reference in a new issue