aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/bb2diaspora.php13
-rwxr-xr-xinclude/delivery.php12
-rwxr-xr-xinclude/notifier.php6
-rwxr-xr-xinclude/poller.php4
4 files changed, 24 insertions, 11 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index d367b6716..9a29b05a2 100755
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -14,9 +14,17 @@ require_once('include/html2bbcode.php');
function diaspora2bb($s) {
$s = html_entity_decode($s,ENT_COMPAT,'UTF-8');
+ $s = str_replace("\r","\n",$s);
$s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
+
+ $s = preg_replace('/\#([^\s\#])/','\\#$1',$s);
+
$s = Markdown($s);
+
+ $s = str_replace('#','#',$s);
+ $s = str_replace("\n",'<br />',$s);
+
$s = html2bbcode($s);
// $s = str_replace('&#42;','*',$s);
@@ -30,11 +38,6 @@ function diaspora2bb($s) {
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
$s = scale_diaspora_images($s);
- // we seem to get a lot of text smushed together with links from Diaspora.
-
- $s = preg_replace('/[^ ]\[url\=(.*?)\]/',' [url=$1]' ,$s);
- $s = preg_replace('/\[\/url\][^ ]/','[/url] ',$s);
-
return $s;
}
diff --git a/include/delivery.php b/include/delivery.php
index c05358868..71ce30023 100755
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -373,7 +373,8 @@ function delivery_run($argv, $argc){
break;
case NETWORK_MAIL :
-
+ case NETWORK_MAIL2:
+
if(get_config('system','dfrn_only'))
break;
// WARNING: does not currently convert to RFC2047 header encodings, etc.
@@ -413,7 +414,14 @@ function delivery_run($argv, $argc){
$reply_to = $r1[0]['reply_to'];
$subject = (($it['title']) ? $it['title'] : t("\x28no subject\x29")) ;
- $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n";
+
+ // only expose our real email address to true friends
+
+ if(($contact['rel'] == CONTACT_IS_FRIEND) && (! $contact['blocked']))
+ $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n";
+ else
+ $headers = 'From: ' . $local_user[0]['username'] . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n";
+
if($reply_to)
$headers .= 'Reply-to: ' . $reply_to . "\n";
$headers .= 'Message-id: <' . $it['uri'] . '>' . "\n";
diff --git a/include/notifier.php b/include/notifier.php
index ead7aebad..53178ce53 100755
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -584,6 +584,7 @@ function notifier_run($argv, $argc){
break;
case NETWORK_MAIL:
+ case NETWORK_MAIL2:
if(get_config('system','dfrn_only'))
break;
@@ -629,7 +630,7 @@ function notifier_run($argv, $argc){
// only expose our real email address to true friends
- if($contact['rel'] == CONTACT_IS_FRIEND)
+ if(($contact['rel'] == CONTACT_IS_FRIEND) && (! $contact['blocked']))
$headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n";
else
$headers = 'From: ' . $local_user[0]['username'] . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n";
@@ -754,9 +755,10 @@ function notifier_run($argv, $argc){
);
$r2 = q("SELECT `id`, `name`,`network` FROM `contact`
- WHERE `network` = '%s' AND `uid` = %d AND `blocked` = 0 AND `pending` = 0
+ WHERE `network` in ( '%s', '%s') AND `uid` = %d AND `blocked` = 0 AND `pending` = 0
AND `rel` != %d order by rand() ",
dbesc(NETWORK_DFRN),
+ dbesc(NETWORK_MAIL2),
intval($owner['uid']),
intval(CONTACT_IS_SHARING)
);
diff --git a/include/poller.php b/include/poller.php
index 89e4488b9..7d42c63b5 100755
--- a/include/poller.php
+++ b/include/poller.php
@@ -369,7 +369,7 @@ function poller_run($argv, $argc){
$xml = fetch_url($contact['poll']);
}
- elseif($contact['network'] === NETWORK_MAIL) {
+ elseif($contact['network'] === NETWORK_MAIL || $contact['network'] === NETWORK_MAIL2) {
$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
if($mail_disabled)
@@ -462,7 +462,7 @@ function poller_run($argv, $argc){
$datarray['contact-id'] = $contact['id'];
if($datarray['parent-uri'] === $datarray['uri'])
$datarray['private'] = 1;
- if(! get_pconfig($importer_uid,'system','allow_public_email_replies')) {
+ if(($contact['network'] === NETWORK_MAIL) && (! get_pconfig($importer_uid,'system','allow_public_email_replies'))) {
$datarray['private'] = 1;
$datarray['allow_cid'] = '<' . $contact['id'] . '>';
}