X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fenotify.php;h=e02c61383136f5350b01af64928883c5715e924c;hb=51d392b97f144a7487deb35d8cb7d0946fe9fbc9;hp=4327e75b837d5c25fb36fbad03c7f123e861b5eb;hpb=8490bedefe14400c0b7175a3775e3bb18139479a;p=friendica.git diff --git a/include/enotify.php b/include/enotify.php index 4327e75b83..e02c613831 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -20,14 +20,18 @@ function notification($params) { $siteurl = $a->get_baseurl(true); $thanks = t('Thank You,'); $sitename = $a->config['sitename']; - $site_admin = sprintf( t('%s Administrator'), $sitename); + if (!x($a->config['admin_name'])) { + $site_admin = sprintf( t('%s Administrator'), $sitename); + } else { + $site_admin = sprintf( t('%1$s, %2$s Administrator'), $a->config['admin_name'], $sitename); + } $nickname = ""; $sender_name = $sitename; $hostname = $a->get_hostname(); if(strpos($hostname,':')) $hostname = substr($hostname,0,strpos($hostname,':')); - + $sender_email = $a->config['sender_email']; if (empty($sender_email)) { $sender_email = t('noreply') . '@' . $hostname; @@ -63,6 +67,16 @@ function notification($params) { // e.g. "your post", "David's photo", etc. $possess_desc = t('%s '); + if (isset($params['item']['id'])) + $item_id = $params['item']['id']; + else + $item_id = 0; + + if (isset($params['parent'])) + $parent_id = $params['parent']; + else + $parent_id = 0; + if($params['type'] == NOTIFY_MAIL) { $subject = sprintf( t('[Friendica:Notify] New mail received at %s'),$sitename); @@ -78,7 +92,7 @@ function notification($params) { if($params['type'] == NOTIFY_COMMENT) { // logger("notification: params = " . print_r($params, true), LOGGER_DEBUG); - $parent_id = $params['parent']; + //$parent_id = $params['parent']; $p = q("SELECT `ignored` FROM `thread` WHERE `iid` = %d AND `uid` = %d LIMIT 1", intval($parent_id), @@ -287,7 +301,7 @@ function notification($params) { if($params['type'] == NOTIFY_CONFIRM) { if ($params['verb'] == ACTIVITY_FRIEND ){ // mutual connection $subject = sprintf( t('[Friendica:Notify] Connection accepted')); - $preamble = sprintf( t('\'%1$s\' has acepted your connection request at %2$s'), $params['source_name'], $sitename); + $preamble = sprintf( t('\'%1$s\' has accepted your connection request at %2$s'), $params['source_name'], $sitename); $epreamble = sprintf( t('%2$s has accepted your [url=%1$s]connection request[/url].'), $itemlink, '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); @@ -300,7 +314,7 @@ function notification($params) { $itemlink = $params['link']; } else { // ACTIVITY_FOLLOW $subject = sprintf( t('[Friendica:Notify] Connection accepted')); - $preamble = sprintf( t('\'%1$s\' has acepted your connection request at %2$s'), $params['source_name'], $sitename); + $preamble = sprintf( t('\'%1$s\' has accepted your connection request at %2$s'), $params['source_name'], $sitename); $epreamble = sprintf( t('%2$s has accepted your [url=%1$s]connection request[/url].'), $itemlink, '[url=' . $params['source_link'] . ']' . $params['source_name'] . '[/url]'); @@ -400,6 +414,7 @@ function notification($params) { $datarray['date'] = datetime_convert(); $datarray['uid'] = $params['uid']; $datarray['link'] = $itemlink; + $datarray['iid'] = $item_id; $datarray['parent'] = $parent_id; $datarray['type'] = $params['type']; $datarray['verb'] = $params['verb']; @@ -415,8 +430,8 @@ function notification($params) { // create notification entry in DB - $r = q("insert into notify (hash,name,url,photo,date,uid,link,parent,type,verb,otype) - values('%s','%s','%s','%s','%s',%d,'%s',%d,%d,'%s','%s')", + $r = q("insert into notify (hash,name,url,photo,date,uid,link,iid,parent,type,verb,otype) + values('%s','%s','%s','%s','%s',%d,'%s',%d,%d,%d,'%s','%s')", dbesc($datarray['hash']), dbesc($datarray['name']), dbesc($datarray['url']), @@ -424,6 +439,7 @@ function notification($params) { dbesc($datarray['date']), intval($datarray['uid']), dbesc($datarray['link']), + intval($datarray['iid']), intval($datarray['parent']), intval($datarray['type']), dbesc($datarray['verb']),