From 6d9d07bdde4284906c1e0f1d2d7a05c87ed3d6e1 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 5 Jan 2013 23:24:15 -0800 Subject: fix notification uid --- include/enotify.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'include/enotify.php') diff --git a/include/enotify.php b/include/enotify.php index d26c6a2f6..140baf104 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -22,8 +22,12 @@ function notification($params) { $sender = $x[0]; $recip = $y[0]; } - else + else { + logger('notification: no sender or recipient.'); + logger('sender: ' . $params['from_xchan']); + logger('recip: ' . $params['to_xchan']); return; + } // from here on everything is in the recipients language @@ -58,7 +62,7 @@ function notification($params) { $possess_desc = t('%s '); if($params['type'] == NOTIFY_MAIL) { - + logger('notification: mail'); $subject = sprintf( t('[Red:Notify] New mail received at %s'),$sitename); $preamble = sprintf( t('%1$s sent you a new private message at %2$s.'),$sender['xchan_name'],$sitename); @@ -83,7 +87,8 @@ function notification($params) { dbesc($params['link']), intval($params['uid']) ); - if($p and count($p)) { + if($p) { + logger('notification comment already notified'); pop_lang(); return; } @@ -308,11 +313,12 @@ function notification($params) { $r = q("select id from notify where hash = '%s' and uid = %d limit 1", dbesc($hash), - intval($params['uid']) + intval($recip['channel_id']) ); if($r) $notify_id = $r[0]['id']; else { + logger('notification not found.'); pop_lang(); return; } @@ -517,4 +523,4 @@ class enotify { logger("notification: enotify::send returns " . $res, LOGGER_DEBUG); } } -?> + -- cgit v1.2.3