diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2011-08-22 13:56:08 +0200 |
---|---|---|
committer | fabrixxm <fabrix.xm@gmail.com> | 2011-08-22 13:56:08 +0200 |
commit | d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75 (patch) | |
tree | dbdc1dbffe5c56dcff18669e957f679b5ae37bb3 /mod/dfrn_notify.php | |
parent | afdc639f17f0f5e12f291b512ccc12b3df6b2acf (diff) | |
parent | 564ade0685470158ac487d9a9f18a21079c729bb (diff) | |
download | volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.tar.gz volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.tar.bz2 volse-hubzilla-d8bd4fbb3e38bf0ff9c7b61dba58e20c0d097d75.zip |
Merge branch 'master' into newui
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r-- | mod/dfrn_notify.php | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index f284b8b38..84cb2fc16 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -58,6 +58,9 @@ function dfrn_notify_post(&$a) { break; // NOTREACHED } + // be careful - $importer will contain both the contact information for the contact + // sending us the post, and also the user information for the person receiving it. + // since they are mixed together, it is easy to get them confused. $r = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`, `contact`.`pubkey` AS `cpubkey`, @@ -512,17 +515,19 @@ function dfrn_notify_post(&$a) { $msg['htmlversion'] = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "<br />\n",$datarray['body'])))); + $imgtouse = ((link_compare($datarray['author-link'],$importer['url'])) ? $importer['thumb'] : $datarray['author-avatar']); + // load the template for private message notifications $tpl = get_intltext_template('cmnt_received_html_body_eml.tpl'); $email_html_body_tpl = replace_macros($tpl,array( '$username' => $importer['username'], '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon + '$thumb' => $imgtouse, // thumbnail url for sender icon '$email' => $importer['email'], // email address to send to - '$url' => $datarray['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message - '$body' => $msg['htmlversion'], // html version of the message + '$url' => $datarray['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['htmlversion'], // html version of the message '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, )); @@ -532,10 +537,10 @@ function dfrn_notify_post(&$a) { '$username' => $importer['username'], '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon + '$thumb' => $imgtouse, // thumbnail url for sender icon '$email' => $importer['email'], // email address to send to - '$url' => $datarray['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$url' => $datarray['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message '$body' => $msg['textversion'], // text version of the message '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, )); @@ -643,15 +648,18 @@ function dfrn_notify_post(&$a) { $msg['htmlversion'] = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "<br />\n",$datarray['body'])))); + $imgtouse = ((link_compare($datarray['author-link'],$importer['url'])) ? $importer['thumb'] : $datarray['author-avatar']); + + // load the template for private message notifications $tpl = get_intltext_template('cmnt_received_html_body_eml.tpl'); $email_html_body_tpl = replace_macros($tpl,array( '$username' => $importer['username'], '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon - '$url' => $datarray['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$thumb' => $imgtouse, // thumbnail url for sender icon + '$url' => $datarray['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message '$body' => $msg['htmlversion'], // html version of the message '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, )); @@ -662,9 +670,9 @@ function dfrn_notify_post(&$a) { '$username' => $importer['username'], '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon - '$url' => $datarray['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$thumb' => $imgtouse, // thumbnail url for sender icon + '$url' => $datarray['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message '$body' => $msg['textversion'], // text version of the message '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, )); |