aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dfrn_poll.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-04-10 19:29:21 -0700
committerFriendika <info@friendika.com>2011-04-10 19:29:21 -0700
commit3d51518a13fd44da3fa9a01b9ae1f1baa5d41848 (patch)
tree70828f278ca87308c2c3718031a53dd0c15b1b2a /mod/dfrn_poll.php
parent63030ca51e9e7f6fbd50aed6b9f6a3cf10084a3f (diff)
downloadvolse-hubzilla-3d51518a13fd44da3fa9a01b9ae1f1baa5d41848.tar.gz
volse-hubzilla-3d51518a13fd44da3fa9a01b9ae1f1baa5d41848.tar.bz2
volse-hubzilla-3d51518a13fd44da3fa9a01b9ae1f1baa5d41848.zip
set writable flag on dfrn_poll
Diffstat (limited to 'mod/dfrn_poll.php')
-rw-r--r--mod/dfrn_poll.php18
1 files changed, 18 insertions, 0 deletions
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;