aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_notify.php
diff options
context:
space:
mode:
authorOlivier Migeot <olivier@migeot.org>2011-04-12 13:55:43 +0200
committerOlivier Migeot <olivier@migeot.org>2011-04-12 13:55:43 +0200
commit85f709320b588f3231875d097217bd9abd223c9f (patch)
tree988f92ae345657ece74dbcc9dd0d8f17d41f20a5 /mod/dfrn_notify.php
parent294577a48b2d6356dd7695716ea0379bf3a087df (diff)
parent6da84027afa18633ac5d5dacce99bb244be2aa7b (diff)
downloadvolse-hubzilla-85f709320b588f3231875d097217bd9abd223c9f.tar.gz
volse-hubzilla-85f709320b588f3231875d097217bd9abd223c9f.tar.bz2
volse-hubzilla-85f709320b588f3231875d097217bd9abd223c9f.zip
Merge remote branch 'mike/master'
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r--mod/dfrn_notify.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index cd67df1d7..f6f68d348 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -10,6 +10,12 @@ function dfrn_notify_post(&$a) {
$data = ((x($_POST,'data')) ? $_POST['data'] : '');
$key = ((x($_POST,'key')) ? $_POST['key'] : '');
$dissolve = ((x($_POST,'dissolve')) ? intval($_POST['dissolve']) : 0);
+ $perm = ((x($_POST,'perm')) ? notags(trim($_POST['perm'])) : 'r');
+
+ $writable = (-1);
+ if($dfrn_version >= 2.21) {
+ $writable = (($perm === 'rw') ? 1 : 0);
+ }
$direction = (-1);
if(strpos($dfrn_id,':') == 1) {
@@ -74,6 +80,14 @@ function dfrn_notify_post(&$a) {
$importer = $r[0];
+ if(($writable != (-1)) && ($writable != $importer['writable'])) {
+ q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1",
+ intval($writable),
+ intval($importer['id'])
+ );
+ $importer['writable'] = $writable;
+ }
+
logger('dfrn_notify: received notify from ' . $importer['name'] . ' for ' . $importer['username']);
logger('dfrn_notify: data: ' . $data, LOGGER_DATA);
@@ -118,8 +132,6 @@ function dfrn_notify_post(&$a) {
}
-
-
if($importer['readonly']) {
// We aren't receiving stuff from this person. But we will quietly ignore them
// rather than a blatant "go away" message.