From e17ba14696d6ee7532bacce6b5519594e001f13f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 4 Dec 2012 18:24:46 -0800 Subject: DB: do the mail table again. Mail almost working onsite, still needs to zot though --- mod/ping.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mod/ping.php') 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']); -- cgit v1.2.3