From d970c69f91b96b3ef40752a95ecec8ca8b11b62a Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 28 Jan 2014 19:49:56 -0800 Subject: online indication to the directory popup --- include/identity.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index ee289495d..2db5d8ece 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1170,3 +1170,25 @@ function get_online_status($nick) { return $ret; } + + +function remote_online_status($webbie) { + + $result = false; + $r = q("select * from hubloc where hubloc_addr = '%s' limit 1", + dbesc($webbie) + ); + if(! $r) + return $result; + + $url = $r[0]['hubloc_url'] . '/online/' . substr($webbie,0,strpos($webbie,'@')); + + $x = z_fetch_url($url); + if($x['success']) { + $j = json_decode($x['body'],true); + if($j) + $result = (($j['result']) ? $j['result'] : false); + } + return $result; + +} -- cgit v1.2.3