diff options
author | friendica <info@friendica.com> | 2012-03-28 17:21:56 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-03-28 17:21:56 -0700 |
commit | 7956c2d08e209635c40ca62e2a37d46fd41869af (patch) | |
tree | edb271bb2f113f1686ae0c502163f01fc38d5e84 /include | |
parent | a2b1aca27c936991d02ab10d97f1f7980500c460 (diff) | |
download | volse-hubzilla-7956c2d08e209635c40ca62e2a37d46fd41869af.tar.gz volse-hubzilla-7956c2d08e209635c40ca62e2a37d46fd41869af.tar.bz2 volse-hubzilla-7956c2d08e209635c40ca62e2a37d46fd41869af.zip |
improved rw notifications
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index 2eecadad1..9f7eb84d9 100755 --- a/include/items.php +++ b/include/items.php @@ -1090,12 +1090,23 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) { $postvars = array(); $sent_dfrn_id = hex2bin((string) $res->dfrn_id); $challenge = hex2bin((string) $res->challenge); + $perm = (($res->perm) ? $res->perm : null); $dfrn_version = (float) (($res->dfrn_version) ? $res->dfrn_version : 2.0); $rino_allowed = ((intval($res->rino) === 1) ? 1 : 0); $page = (($owner['page-flags'] == PAGE_COMMUNITY) ? 1 : 0); $final_dfrn_id = ''; + if($perm) { + if((($perm == 'rw') && (! intval($contact['writable']))) + || (($perm == 'r') && (intval($contact['writable'])))) { + q("update contact set writable = %d where id = %d limit 1", + intval(($perm == 'rw') ? 1 : 0), + intval($contact['id']) + ); + $contact['writable'] = (string) 1 - intval($contact['writable']); + } + } if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey'])) |