diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-09-17 03:10:19 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-09-17 03:10:19 -0700 |
commit | a50947a4bc3f779df8fa4e6777bc025fcefc8d21 (patch) | |
tree | 2196406c0c64494f5a4b604c695db6bbcd81897d /mod/dfrn_notify.php | |
parent | c5031139ebb46ce4994d3bd62059ae4eaba71359 (diff) | |
download | volse-hubzilla-a50947a4bc3f779df8fa4e6777bc025fcefc8d21.tar.gz volse-hubzilla-a50947a4bc3f779df8fa4e6777bc025fcefc8d21.tar.bz2 volse-hubzilla-a50947a4bc3f779df8fa4e6777bc025fcefc8d21.zip |
like, dislike, activity streams, etc.
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r-- | mod/dfrn_notify.php | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 80cd1a2fd..61ea77c29 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -208,6 +208,10 @@ function dfrn_notify_post(&$a) { $datarray['parent-uri'] = $parent_uri; $datarray['uid'] = $importer['importer_uid']; $datarray['contact-id'] = $importer['id']; + if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) { + $datarray['type'] = 'activity'; + $datarray['gravity'] = GRAVITY_LIKE; + } $posted_id = item_store($datarray); if($posted_id) { @@ -228,26 +232,28 @@ function dfrn_notify_post(&$a) { intval($posted_id) ); - $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); - - proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"comment-import\" \"$posted_id\" &", - array(),$foo)); - - if(($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) { - require_once('bbcode.php'); - $from = stripslashes($datarray['author-name']); - $tpl = file_get_contents('view/cmnt_received_eml.tpl'); - $email_tpl = replace_macros($tpl, array( - '$sitename' => $a->config['sitename'], - '$siteurl' => $a->get_baseurl(), - '$username' => $importer['username'], - '$email' => $importer['email'], - '$from' => $from, - '$body' => strip_tags(bbcode(stripslashes($datarray['body']))) - )); - - $res = mail($importer['email'], $from . t(" commented on your item at ") . $a->config['sitename'], - $email_tpl,t("From: Administrator@") . $a->get_hostname() ); + if($datarray['type'] == 'remote-comment') { + $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php'); + + proc_close(proc_open("\"$php_path\" \"include/notifier.php\" \"comment-import\" \"$posted_id\" &", + array(),$foo)); + + if(($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) { + require_once('bbcode.php'); + $from = stripslashes($datarray['author-name']); + $tpl = file_get_contents('view/cmnt_received_eml.tpl'); + $email_tpl = replace_macros($tpl, array( + '$sitename' => $a->config['sitename'], + '$siteurl' => $a->get_baseurl(), + '$username' => $importer['username'], + '$email' => $importer['email'], + '$from' => $from, + '$body' => strip_tags(bbcode(stripslashes($datarray['body']))) + )); + + $res = mail($importer['email'], $from . t(" commented on your item at ") . $a->config['sitename'], + $email_tpl,t("From: Administrator@") . $a->get_hostname() ); + } } } xml_status(0); @@ -280,11 +286,16 @@ function dfrn_notify_post(&$a) { $datarray['parent-uri'] = $parent_uri; $datarray['uid'] = $importer['importer_uid']; $datarray['contact-id'] = $importer['id']; + if(($datarray['verb'] == ACTIVITY_LIKE) || ($datarray['verb'] == ACTIVITY_DISLIKE)) { + $datarray['type'] = 'activity'; + $datarray['gravity'] = GRAVITY_LIKE; + } + $r = item_store($datarray); // find out if our user is involved in this conversation and wants to be notified. - if($importer['notify-flags'] & NOTIFY_COMMENT) { + if(($datarray['type'] != 'activity') && ($importer['notify-flags'] & NOTIFY_COMMENT)) { $myconv = q("SELECT `author-link` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d", dbesc($parent_uri), |