aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php2
-rw-r--r--doc/To-Do-Code.md4
-rw-r--r--install/database.sql1
-rw-r--r--install/update.php8
-rw-r--r--mod/ping.php25
-rw-r--r--mod/settings.php7
-rw-r--r--version.inc2
-rwxr-xr-xview/tpl/settings.tpl3
8 files changed, 47 insertions, 5 deletions
diff --git a/boot.php b/boot.php
index 73525b4b5..7be74e64a 100755
--- a/boot.php
+++ b/boot.php
@@ -46,7 +46,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1093 );
+define ( 'DB_UPDATE_VERSION', 1094 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/doc/To-Do-Code.md b/doc/To-Do-Code.md
index 3baf08d40..5804801b4 100644
--- a/doc/To-Do-Code.md
+++ b/doc/To-Do-Code.md
@@ -17,7 +17,7 @@ We need much more than this, but here are areas where developers can help. Pleas
* (Advanced) create a UI for building Comanche pages
-* Help with WebDAV and file storage implementation, especially replacing the fugly Sabre web UI.
+* templatise and translate the Web interface to webDAV
* Extend WebDAV to provide desktop access to photo albums
@@ -25,7 +25,7 @@ We need much more than this, but here are areas where developers can help. Pleas
* service classes - account overview page showing resources consumed by channel. With special consideration this page can also be accessed at a meta level by the site admin to drill down on problematic accounts/channels.
-* Events module - bring back birthday reminders for friends, fix permissions on events, and provide JS translation support for the calendar overview
+* Events module - bring back birthday reminders for friends, fix permissions on events, and provide JS translation support for the calendar overview; integrate with calDAV
* Events module - event followups and RSVP
diff --git a/install/database.sql b/install/database.sql
index 1c87b725b..dba03da65 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -232,6 +232,7 @@ CREATE TABLE IF NOT EXISTS `chatpresence` (
`cp_xchan` char(255) NOT NULL DEFAULT '',
`cp_last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`cp_status` char(255) NOT NULL,
+ `cp_client` char(128) NOT NULL DEFAULT '',
PRIMARY KEY (`cp_id`),
KEY `cp_room` (`cp_room`),
KEY `cp_xchan` (`cp_xchan`),
diff --git a/install/update.php b/install/update.php
index 9ab5db8c6..180b8d5a0 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1093 );
+define( 'UPDATE_VERSION' , 1094 );
/**
*
@@ -1054,3 +1054,9 @@ function update_r1092() {
+function update_r1093() {
+ $r = q("ALTER TABLE `chatpresence` ADD `cp_client` CHAR( 128 ) NOT NULL DEFAULT ''");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
diff --git a/mod/ping.php b/mod/ping.php
index dda87dec2..f067091da 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -43,6 +43,31 @@ function ping_init(&$a) {
unset($_SESSION['sysmsg_info']);
}
+ if(get_observer_hash() && (! $result['invalid'])) {
+ $r = q("select cp_id from chatpresence where cp_xchan = '%s'",
+ dbesc(get_observer_hash())
+ );
+ if($r) {
+ foreach($r as $rr) {
+ q("update chatpresence set cp_last = '%s' where cp_id = %d limit 1",
+ dbesc(datetime_convert()),
+ intval($rr['cp_id'])
+ );
+ }
+ }
+ else {
+ q("insert into chatpresence ( cp_xchan, cp_last, cp_status, cp_client)
+ values( '%s', '%s', '%s', '%s' ) ",
+ dbesc(get_observer_hash()),
+ dbesc(datetime_convert()),
+ dbesc('online'),
+ dbesc($_SERVER['REMOTE_ADDR'])
+ );
+ }
+ }
+
+ q("delete from chatpresence where cp_last < UTC_TIMESTAMP() - INTERVAL 2 MINUTE");
+
if((! local_user()) || ($result['invalid'])) {
echo json_encode($result);
killme();
diff --git a/mod/settings.php b/mod/settings.php
index ee6ef45de..7ff76cd3e 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -266,6 +266,7 @@ function settings_post(&$a) {
$expire_network_only = ((x($_POST,'expire_network_only'))? intval($_POST['expire_network_only']) : 0);
$allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
+ $hide_presence = (((x($_POST,'hide_presence')) && (intval($_POST['hide_presence']) == 1)) ? 1: 0);
$publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
$page_flags = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
@@ -395,6 +396,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
set_pconfig(local_user(),'system','blocktags',$blocktags);
+ set_pconfig(local_user(),'system','hide_online_status',$hide_presence);
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_default_group = '%s', channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d, channel_a_republish = %d, channel_allow_cid = '%s', channel_allow_gid = '%s', channel_deny_cid = '%s', channel_deny_gid = '%s' where channel_id = %d limit 1",
@@ -821,6 +823,9 @@ function settings_content(&$a) {
$unkmail = $a->user['unkmail'];
$cntunkmail = $a->user['cntunkmail'];
+ $hide_presence = intval(get_pconfig(local_user(), 'system','hide_online_status'));
+
+
$expire_items = get_pconfig(local_user(), 'expire','items');
$expire_items = (($expire_items===false)? '1' : $expire_items); // default if not set: 1
@@ -918,6 +923,8 @@ function settings_content(&$a) {
'$h_prv' => t('Security and Privacy Settings'),
+ '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents showing if you are available for chat')),
+
'$lbl_pmacro' => t('Quick Privacy Settings:'),
'$pmacro3' => t('Very Public - extremely permissive'),
'$pmacro2' => t('Typical - default public, privacy when desired'),
diff --git a/version.inc b/version.inc
index d1638dd7d..3c79f0c43 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-01-27.570
+2014-01-28.571
diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl
index 7b6add231..b1a4f956d 100755
--- a/view/tpl/settings.tpl
+++ b/view/tpl/settings.tpl
@@ -22,6 +22,9 @@
<h3 class="settings-heading">{{$h_prv}}</h3>
+{{include file="field_checkbox.tpl" field=$hide_presence}}
+
+
<div id="settings-privacy-macros">{{$lbl_pmacro}}</div>
<ul>
<li><a href="#" onclick="channel_privacy_macro(3); return false" id="settings_pmacro3">{{$pmacro3}}</a></li>