aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-02-01 10:17:27 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-02-01 10:17:27 +0100
commit042aa2e169310bc23398d0558455a61fe1e86a92 (patch)
tree50ae4d8845bc16e2edfbaa916e80d8709ee3fe86 /mod
parent1151124feed13ebe1bf87bdcebf9692a5ce6233e (diff)
parent89313235d26569df5cbdabb1f85871f10056e41f (diff)
downloadvolse-hubzilla-042aa2e169310bc23398d0558455a61fe1e86a92.tar.gz
volse-hubzilla-042aa2e169310bc23398d0558455a61fe1e86a92.tar.bz2
volse-hubzilla-042aa2e169310bc23398d0558455a61fe1e86a92.zip
Merge remote branch 'friendika-master/master'
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php31
-rw-r--r--mod/network.php2
-rw-r--r--mod/profile.php2
3 files changed, 33 insertions, 2 deletions
diff --git a/mod/item.php b/mod/item.php
index cc1886c17..7125ae1f4 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -422,12 +422,39 @@ function item_post(&$a) {
logger('mod_item: notifier invoked: ' . "\"$php_path\" \"include/notifier.php\" \"$notify_type\" \"$post_id\" &");
- proc_run($php_path, "include/notifier.php", $notify_type, "$post_id");
+ proc_run($php_path, "include/notifier.php", $notify_type, "$post_id");
$datarray['id'] = $post_id;
call_hooks('post_local_end', $datarray);
-
+
+ if(strlen($emailcc) && $profile_uid == local_user()) {
+ $erecips = explode(',', $emailcc);
+ if(count($erecips)) {
+ foreach($erecips as $recip) {
+ $addr = trim($recip);
+ if(! strlen($addr))
+ continue;
+ $disclaimer = '<hr />' . t('This message was sent to you by ') . $a->user['username']
+ . t(', a member of the Friendika social network.') . '<br />';
+ $disclaimer .= t('You may visit them online at') . ' '
+ . $a->get_baseurl() . '/profile/' . $a->user['nickname'] . '<br />';
+ $disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . '<br />';
+
+ $subject = '[Friendika]' . ' ' . $a->user['username'] . ' ' . t('posted an update.');
+ $headers = 'From: ' . $a->user['username'] . ' <' . $a->user['email'] . '>' . "\n";
+ $headers .= 'MIME-Version: 1.0' . "\n";
+ $headers .= 'Content-Type: text/html; charset=UTF-8' . "\n";
+ $headers .= 'Content-Transfer-Encoding: 8bit' . "\n\n";
+ $link = '<a href="' . $a->get_baseurl() . '/profile/' . $a->user['nickname'] . '"><img src="' . $author['thumb'] . '" alt="' . $a->user['username'] . '" /></a><br /><br />';
+ $html = prepare_body($datarray);
+ $message = '<html><body>' . $link . $html . $disclaimer . '</body></html>';
+ @mail($addr, $subject, $message, $headers);
+ }
+ }
+ }
+
+
goaway($a->get_baseurl() . "/" . $_POST['return'] );
return; // NOTREACHED
diff --git a/mod/network.php b/mod/network.php
index 50d7134c1..80edca1d0 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -87,6 +87,8 @@ function network_content(&$a, $update = 0) {
'$baseurl' => $a->get_baseurl(),
'$defloc' => $a->user['default-location'],
'$visitor' => 'block',
+ '$emailcc' => t('CC: email addresses'),
+ '$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$lockstate' => $lockstate,
'$acl' => populate_acl((($group) ? $group_acl : $a->user), $celeb),
'$bang' => (($group) ? '!' : ''),
diff --git a/mod/profile.php b/mod/profile.php
index c84b493c5..91c1ba6d8 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -144,6 +144,8 @@ function profile_content(&$a, $update = 0) {
'$return_path' => $a->cmd,
'$visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'),
'$lockstate' => $lockstate,
+ '$emailcc' => t('CC: email addresses'),
+ '$emtitle' => t('Example: bob@example.com, mary@example.com'),
'$bang' => '',
'$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''),
'$profile_uid' => $a->profile['profile_uid'],