]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_poll.php
multi-user, do not cache open mbox
[friendica.git] / mod / dfrn_poll.php
index a2fdb9ee13c532e0d85b0dc1ed944fde7e841cdc..2da1a30faea838710005f6b460becd76f9251cf7 100644 (file)
@@ -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               
+               logger('dfrn_poll: post request feed: ' . print_r($_POST,true),LOGGER_DATA);
+               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;