aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-10 00:08:23 -0800
committerfriendica <info@friendica.com>2012-02-10 00:08:23 -0800
commitb346f4464c230af4636c61397decd03eadb18e9a (patch)
tree44029e4c4e723e46f7c1ed372b96549742851483 /include/items.php
parent2f2e331c33535d8ae1a8c9d95d03a39b5c8a5885 (diff)
downloadvolse-hubzilla-b346f4464c230af4636c61397decd03eadb18e9a.tar.gz
volse-hubzilla-b346f4464c230af4636c61397decd03eadb18e9a.tar.bz2
volse-hubzilla-b346f4464c230af4636c61397decd03eadb18e9a.zip
send notify emails to community pages as well as people
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php62
1 files changed, 32 insertions, 30 deletions
diff --git a/include/items.php b/include/items.php
index fd90494b1..3c30e99aa 100755
--- a/include/items.php
+++ b/include/items.php
@@ -968,40 +968,42 @@ function tag_deliver($uid,$item_id) {
if(! $mention)
return;
- if(! $community_page) {
- require_once('include/enotify.php');
- notification(array(
- 'type' => NOTIFY_TAGSELF,
- 'notify_flags' => $u[0]['notify-flags'],
- 'language' => $u[0]['language'],
- 'to_name' => $u[0]['username'],
- 'to_email' => $u[0]['email'],
- 'item' => $item,
- 'link' => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'],
- 'source_name' => $item['author-name'],
- 'source_link' => $item['author-link'],
- 'source_photo' => $item['author-avatar'],
- 'verb' => ACTIVITY_TAG,
- 'otype' => 'item'
- ));
+ // send a notification
+
+ require_once('include/enotify.php');
+ notification(array(
+ 'type' => NOTIFY_TAGSELF,
+ 'notify_flags' => $u[0]['notify-flags'],
+ 'language' => $u[0]['language'],
+ 'to_name' => $u[0]['username'],
+ 'to_email' => $u[0]['email'],
+ 'item' => $item,
+ 'link' => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'],
+ 'source_name' => $item['author-name'],
+ 'source_link' => $item['author-link'],
+ 'source_photo' => $item['author-avatar'],
+ 'verb' => ACTIVITY_TAG,
+ 'otype' => 'item'
+ ));
+ if(! $community_page)
return;
- }
- else {
- // prevent delivery looping - only proceed
- // if the message originated elsewhere and is a top-level post
- if(($item['wall']) || ($item['origin']) || ($item['id'] != $item['parent']))
- return;
+ // tgroup delivery - setup a second delivery chain
+ // prevent delivery looping - only proceed
+ // if the message originated elsewhere and is a top-level post
- // now change this copy of the post to a forum head message and deliver to all the tgroup members
+ if(($item['wall']) || ($item['origin']) || ($item['id'] != $item['parent']))
+ return;
+ // now change this copy of the post to a forum head message and deliver to all the tgroup members
- q("update item set wall = 1, origin = 1, forum_mode = 1 where id = %d limit 1",
- intval($item_id)
- );
- proc_run('php','include/notifier.php','tgroup',$item_id);
- }
+ q("update item set wall = 1, origin = 1, forum_mode = 1 where id = %d limit 1",
+ intval($item_id)
+ );
+
+ proc_run('php','include/notifier.php','tgroup',$item_id);
+
}
@@ -1065,7 +1067,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
$final_dfrn_id = '';
- if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY)) {
+ if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))) {
openssl_public_decrypt($sent_dfrn_id,$final_dfrn_id,$contact['pubkey']);
openssl_public_decrypt($challenge,$postvars['challenge'],$contact['pubkey']);
}
@@ -1108,7 +1110,7 @@ function dfrn_deliver($owner,$contact,$atom, $dissolve = false) {
if($dfrn_version >= 2.1) {
- if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY)) {
+ if(($contact['duplex'] && strlen($contact['pubkey'])) || ($owner['page-flags'] == PAGE_COMMUNITY && strlen($contact['pubkey']))) {
openssl_public_encrypt($key,$postvars['key'],$contact['pubkey']);
}
else {