We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 97f61110 authored by Evan Prodromou's avatar Evan Prodromou

More configuration options for location sharing

parent 6a6d88f0
......@@ -999,17 +999,25 @@ class User extends Memcached_DataObject
function shareLocation()
{
$share = true;
$cfg = common_config('location', 'share');
$prefs = User_location_prefs::staticGet('user_id', $this->id);
if ($cfg == 'always') {
return true;
} else if ($cfg == 'never') {
return false;
} else { // user
$share = true;
if (empty($prefs)) {
$share = common_config('location', 'share');
} else {
$share = $prefs->share_location;
$prefs->free();
}
$prefs = User_location_prefs::staticGet('user_id', $this->id);
return $share;
if (empty($prefs)) {
$share = common_config('location', 'sharedefault');
} else {
$share = $prefs->share_location;
$prefs->free();
}
return $share;
}
}
}
......@@ -226,7 +226,8 @@ $default =
'message' =>
array('contentlimit' => null),
'location' =>
array(),
array('share' => 'user', // whether to share location; 'always', 'user', 'never'
'sharedefault' => true),
'omb' =>
array('timeout' => 5), // HTTP request timeout in seconds when contacting remote hosts for OMB updates
'logincommand' =>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment