aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-30 19:01:03 -0800
committerfriendica <info@friendica.com>2014-01-30 19:01:03 -0800
commit49f07bd90f7304e76c2b06d0a9616d680df6ab47 (patch)
tree9c72d3515975e1bf3747fa390054191d34133cb4
parentf69bf5e5987dafa9be3a1b278f68a9d0e48aa06a (diff)
downloadvolse-hubzilla-49f07bd90f7304e76c2b06d0a9616d680df6ab47.tar.gz
volse-hubzilla-49f07bd90f7304e76c2b06d0a9616d680df6ab47.tar.bz2
volse-hubzilla-49f07bd90f7304e76c2b06d0a9616d680df6ab47.zip
mod/ping should only update basic_presence - and clearing stale entries. otherwise let rooms handle presence for themselves.
-rw-r--r--mod/ping.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/mod/ping.php b/mod/ping.php
index 2d5deb9ad..4b07fee7a 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -44,20 +44,17 @@ function ping_init(&$a) {
}
if(get_observer_hash() && (! $result['invalid'])) {
- $r = q("select cp_id, cp_room from chatpresence where cp_xchan = '%s' and cp_client = '%s'",
+ $r = q("select cp_id, cp_room from chatpresence where cp_xchan = '%s' and cp_client = '%s' and cp_room = 0 limit 1",
dbesc(get_observer_hash()),
dbesc($_SERVER['REMOTE_ADDR'])
);
$basic_presence = false;
if($r) {
- foreach($r as $rr) {
- if($rr['cp_room'] == 0)
- $basic_presence = true;
- q("update chatpresence set cp_last = '%s' where cp_id = %d limit 1",
- dbesc(datetime_convert()),
- intval($rr['cp_id'])
- );
- }
+ $basic_presence = true;
+ q("update chatpresence set cp_last = '%s' where cp_id = %d limit 1",
+ dbesc(datetime_convert()),
+ intval($r[0]['cp_id'])
+ );
}
if(! $basic_presence) {
q("insert into chatpresence ( cp_xchan, cp_last, cp_status, cp_client)