From 7684f63ecdfce560f24475630144f6058df15ca9 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 15 Mar 2012 16:38:26 -0700 Subject: track whether contact is a community page or not --- mod/dfrn_notify.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mod/dfrn_notify.php') diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 3dbdc5b32..71860ac3b 100755 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -15,6 +15,7 @@ function dfrn_notify_post(&$a) { $dissolve = ((x($_POST,'dissolve')) ? intval($_POST['dissolve']) : 0); $perm = ((x($_POST,'perm')) ? notags(trim($_POST['perm'])) : 'r'); $ssl_policy = ((x($_POST,'ssl_policy')) ? notags(trim($_POST['ssl_policy'])): 'none'); + $page = ((x($_POST,'page')) ? intval($_POST['page']) : 0); $writable = (-1); if($dfrn_version >= 2.21) { @@ -87,12 +88,15 @@ 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), + if((($writable != (-1)) && ($writable != $importer['writable'])) || ($importer['forum'] != $page)) { + q("UPDATE `contact` SET `writable` = %d, forum = %d WHERE `id` = %d LIMIT 1", + intval(($writable == (-1)) ? $importer['writable'] : $writable), + intval($page), intval($importer['id']) ); - $importer['writable'] = $writable; + if($writable != (-1)) + $importer['writable'] = $writable; + $importer['forum'] = $page; } // if contact's ssl policy changed, update our links -- cgit v1.2.3