mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 04:15:12 +00:00
the sending side of clone syncing of collection/privacy_group information. The receiving side is not yet implemented.
This commit is contained in:
parent
233e4e1363
commit
5ad76c4d0c
2 changed files with 26 additions and 1 deletions
|
@ -46,6 +46,9 @@ function group_add($uid,$name,$public = 0) {
|
|||
);
|
||||
$ret = $r;
|
||||
}
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
@ -113,6 +116,8 @@ function group_rmv($uid,$name) {
|
|||
|
||||
}
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
@ -152,6 +157,9 @@ function group_rmv_member($uid,$name,$member) {
|
|||
intval($gid),
|
||||
dbesc($member)
|
||||
);
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
|
||||
return $r;
|
||||
|
||||
|
||||
|
@ -180,6 +188,9 @@ function group_add_member($uid,$name,$member,$gid = 0) {
|
|||
intval($gid),
|
||||
dbesc($member)
|
||||
);
|
||||
|
||||
build_sync_packet($uid,null,true);
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
|
|
|
@ -2041,7 +2041,7 @@ function import_site($arr,$pubkey) {
|
|||
* such things as personal settings, channel permissions, address book updates, etc.
|
||||
*/
|
||||
|
||||
function build_sync_packet($uid = 0, $packet = null) {
|
||||
function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
|
||||
|
||||
$a = get_app();
|
||||
|
||||
|
@ -2118,6 +2118,20 @@ function build_sync_packet($uid = 0, $packet = null) {
|
|||
}
|
||||
}
|
||||
|
||||
if($groups_changed) {
|
||||
$r = q("select * from groups where uid = %d",
|
||||
intval($uid)
|
||||
);
|
||||
if($r)
|
||||
$info['collections'] = $r;
|
||||
$r = q("select * from group_member where uid = %d",
|
||||
intval($uid)
|
||||
);
|
||||
if($r)
|
||||
$info['collection_members'] = $r;
|
||||
|
||||
}
|
||||
|
||||
$interval = ((get_config('system','delivery_interval') !== false)
|
||||
? intval(get_config('system','delivery_interval')) : 2 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue