aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-07-14 02:37:41 -0700
committerfriendica <info@friendica.com>2014-07-14 02:37:41 -0700
commit5ad76c4d0c2227e8e241a52b75abedc7503523ac (patch)
tree41d486094dd05c2ef32a6ee031701f08a63e31df /include
parent233e4e13636edd857ded7393555feb4bf198eed3 (diff)
downloadvolse-hubzilla-5ad76c4d0c2227e8e241a52b75abedc7503523ac.tar.gz
volse-hubzilla-5ad76c4d0c2227e8e241a52b75abedc7503523ac.tar.bz2
volse-hubzilla-5ad76c4d0c2227e8e241a52b75abedc7503523ac.zip
the sending side of clone syncing of collection/privacy_group information. The receiving side is not yet implemented.
Diffstat (limited to 'include')
-rw-r--r--include/group.php11
-rw-r--r--include/zot.php16
2 files changed, 26 insertions, 1 deletions
diff --git a/include/group.php b/include/group.php
index 56f177ab0..acb65df28 100644
--- a/include/group.php
+++ b/include/group.php
@@ -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;
}
diff --git a/include/zot.php b/include/zot.php
index 798ebc0af..4442bd748 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -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 );