aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_notify.php10
-rw-r--r--mod/dfrn_poll.php18
2 files changed, 26 insertions, 2 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index dd6866b38..f6f68d348 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -80,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);
@@ -124,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.
diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php
index a2fdb9ee1..d68841d05 100644
--- a/mod/dfrn_poll.php
+++ b/mod/dfrn_poll.php
@@ -297,6 +297,7 @@ function dfrn_poll_post(&$a) {
if(! count($r))
killme();
+ $contact = $r[0];
$owner_uid = $r[0]['uid'];
$contact_id = $r[0]['id'];
@@ -330,6 +331,23 @@ function dfrn_poll_post(&$a) {
// NOTREACHED
}
else {
+
+ // Update the writable flag if it changed
+
+ if($dfrn_version >= 2.21) {
+ if($perm === 'rw')
+ $writable = 1;
+ else
+ $writable = 0;
+
+ if($writable != $contact['writable]) {
+ q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1",
+ intval($writable),
+ intval($contact_id)
+ );
+ }
+ }
+
header("Content-type: application/atom+xml");
$o = get_feed_for($a,$dfrn_id, $a->argv[1], $last_update, $direction);
echo $o;