diff options
author | zotlabs <mike@macgirvin.com> | 2018-10-04 19:20:10 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-10-04 19:20:10 -0700 |
commit | 3a0a611f15f2789099acf57c6ca93828f5edae46 (patch) | |
tree | d928cd86bc856ae80a95a9738fc8a96b8fa23e5b /include/zot.php | |
parent | d33c331abd3ae500fc7cdac206ea647c4c71905e (diff) | |
parent | 1eaf6df842184743ee20ec69931be1ff7136f34e (diff) | |
download | volse-hubzilla-3a0a611f15f2789099acf57c6ca93828f5edae46.tar.gz volse-hubzilla-3a0a611f15f2789099acf57c6ca93828f5edae46.tar.bz2 volse-hubzilla-3a0a611f15f2789099acf57c6ca93828f5edae46.zip |
Merge branch 'dev'
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/include/zot.php b/include/zot.php index e31d650d2..1a632cf87 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3320,13 +3320,13 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { } if($groups_changed) { - $r = q("select hash as collection, visible, deleted, gname as name from groups where uid = %d", + $r = q("select hash as collection, visible, deleted, gname as name from pgrp where uid = %d", intval($uid) ); if($r) $info['collections'] = $r; - $r = q("select groups.hash as collection, group_member.xchan as member from groups left join group_member on groups.id = group_member.gid where group_member.uid = %d", + $r = q("select pgrp.hash as collection, pgrp_member.xchan as member from pgrp left join pgrp_member on pgrp.id = pgrp_member.gid where pgrp_member.uid = %d", intval($uid) ); if($r) @@ -3734,7 +3734,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { // sync collections (privacy groups) oh joy... if(array_key_exists('collections',$arr) && is_array($arr['collections']) && count($arr['collections'])) { - $x = q("select * from groups where uid = %d", + $x = q("select * from pgrp where uid = %d", intval($channel['channel_id']) ); foreach($arr['collections'] as $cl) { @@ -3750,7 +3750,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(($y['gname'] != $cl['name']) || ($y['visible'] != $cl['visible']) || ($y['deleted'] != $cl['deleted'])) { - q("update groups set gname = '%s', visible = %d, deleted = %d where hash = '%s' and uid = %d", + q("update pgrp set gname = '%s', visible = %d, deleted = %d where hash = '%s' and uid = %d", dbesc($cl['name']), intval($cl['visible']), intval($cl['deleted']), @@ -3759,14 +3759,14 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { ); } if(intval($cl['deleted']) && (! intval($y['deleted']))) { - q("delete from group_member where gid = %d", + q("delete from pgrp_member where gid = %d", intval($y['id']) ); } } } if(! $found) { - $r = q("INSERT INTO groups ( hash, uid, visible, deleted, gname ) + $r = q("INSERT INTO pgrp ( hash, uid, visible, deleted, gname ) VALUES( '%s', %d, %d, %d, '%s' ) ", dbesc($cl['collection']), intval($channel['channel_id']), @@ -3790,10 +3790,10 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } } if(! $found_local) { - q("delete from group_member where gid = %d", + q("delete from pgrp_member where gid = %d", intval($y['id']) ); - q("update groups set deleted = 1 where id = %d and uid = %d", + q("update pgrp set deleted = 1 where id = %d and uid = %d", intval($y['id']), intval($channel['channel_id']) ); @@ -3803,7 +3803,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } // reload the group list with any updates - $x = q("select * from groups where uid = %d", + $x = q("select * from pgrp where uid = %d", intval($channel['channel_id']) ); @@ -3830,7 +3830,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { 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", + $z = q("select xchan from pgrp_member where gid = %d and uid = %d and xchan = '%s' limit 1", intval($y['id']), intval($channel['channel_id']), dbesc($member) @@ -3841,7 +3841,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { // if somebody is in the group that wasn't before - add them if(! $found) { - q("INSERT INTO group_member (uid, gid, xchan) + q("INSERT INTO pgrp_member (uid, gid, xchan) VALUES( %d, %d, '%s' ) ", intval($channel['channel_id']), intval($y['id']), @@ -3852,7 +3852,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } // now retrieve a list of members we have on this site - $m = q("select xchan from group_member where gid = %d and uid = %d", + $m = q("select xchan from pgrp_member where gid = %d and uid = %d", intval($y['id']), intval($channel['channel_id']) ); @@ -3860,7 +3860,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { foreach($m as $mm) { // if the local existing member isn't in the list we just received - remove them if(! in_array($mm['xchan'],$members[$y['hash']])) { - q("delete from group_member where xchan = '%s' and gid = %d and uid = %d", + q("delete from pgrp_member where xchan = '%s' and gid = %d and uid = %d", dbesc($mm['xchan']), intval($y['id']), intval($channel['channel_id']) |