aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Connedit.php20
-rw-r--r--Zotlabs/Module/Follow.php2
2 files changed, 14 insertions, 8 deletions
diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php
index f9b1336a8..260952b4e 100644
--- a/Zotlabs/Module/Connedit.php
+++ b/Zotlabs/Module/Connedit.php
@@ -205,20 +205,26 @@ class Connedit extends \Zotlabs\Web\Controller {
if($role) {
$x = get_role_perms($role);
if($x['perms_connect']) {
- foreach($x['perms_connect'] as $p) {
- set_abconfig(local_channel(),$orig_record[0]['abook_xchan'],'my_perms',$p,1);
- }
+ $abook_my_perms = $x['perms_connect'];
+ }
+ }
+
+ if($all_perms) {
+ foreach($all_perms as $perm => $desc) {
+ if(array_key_exists($perm, $abook_my_perms))
+ set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,1);
+ else
+ set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'my_perms',$perm,0);
}
}
}
-
+
$abook_pending = (($new_friend) ? 0 : $orig_record[0]['abook_pending']);
- $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_pending = %d,
+ $r = q("UPDATE abook SET abook_profile = '%s', abook_closeness = %d, abook_pending = %d,
abook_incl = '%s', abook_excl = '%s'
where abook_id = %d AND abook_channel = %d",
dbesc($profile_id),
- intval($abook_my_perms),
intval($closeness),
intval($abook_pending),
dbesc($abook_incl),
@@ -239,7 +245,7 @@ class Connedit extends \Zotlabs\Web\Controller {
info( t('Connection updated.') . EOL);
else
notice( t('Failed to update connection record.') . EOL);
-
+//@fixme perms
if(\App::$poi && \App::$poi['abook_my_perms'] != $abook_my_perms
&& (! intval(\App::$poi['abook_self']))) {
\Zotlabs\Daemon\Master::Summon(array('Notifier', (($new_friend) ? 'permission_create' : 'permission_update'), $contact_id));
diff --git a/Zotlabs/Module/Follow.php b/Zotlabs/Module/Follow.php
index 5de89ef41..da9ab3670 100644
--- a/Zotlabs/Module/Follow.php
+++ b/Zotlabs/Module/Follow.php
@@ -47,7 +47,7 @@ class Follow extends \Zotlabs\Web\Controller {
if($abconfig)
$clone['abconfig'] = $abconfig;
- build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
+ build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)), true);
$can_view_stream = intval(get_abconfig($channel['channel_id'],$clone['abook_xchan'],'their_perms','view_stream'));