aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ping.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-12-04 18:24:46 -0800
committerfriendica <info@friendica.com>2012-12-04 18:24:46 -0800
commite17ba14696d6ee7532bacce6b5519594e001f13f (patch)
tree490c90c8ec7cebc3fec94a7ad4c1eab4e9bacab3 /mod/ping.php
parent707397580c1c4547c0e308f90df61bc68e91b219 (diff)
downloadvolse-hubzilla-e17ba14696d6ee7532bacce6b5519594e001f13f.tar.gz
volse-hubzilla-e17ba14696d6ee7532bacce6b5519594e001f13f.tar.bz2
volse-hubzilla-e17ba14696d6ee7532bacce6b5519594e001f13f.zip
DB: do the mail table again. Mail almost working onsite, still needs to zot though
Diffstat (limited to 'mod/ping.php')
-rw-r--r--mod/ping.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/mod/ping.php b/mod/ping.php
index 9650f2aec..f32384952 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -200,12 +200,13 @@ function ping_init(&$a) {
$result['intros'] = intval($intros);
$t4 = dba_timer();
+ $channel = get_app()->get_channel();
- $myurl = $a->get_baseurl() . '/channel/' . $a->user['nickname'] ;
- $mails = q("SELECT *, COUNT(*) AS `total` FROM `mail`
- WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
+ $mails = q("SELECT count(id) as total from mail
+ WHERE channel_id = %d AND not (mail_flags & %d) and from_xchan != '%s' ",
intval(local_user()),
- dbesc($myurl)
+ intval(MAIL_SEEN),
+ dbesc($channel['channel_hash'])
);
if($mails)
$result['mail'] = intval($mails[0]['total']);