]> git.mxchange.org Git - friendica.git/commitdiff
transport for email contacts phase II
authorfriendica <info@friendica.com>
Wed, 1 Feb 2012 04:03:46 +0000 (20:03 -0800)
committerfriendica <info@friendica.com>
Wed, 1 Feb 2012 04:03:46 +0000 (20:03 -0800)
boot.php
include/delivery.php
include/notifier.php
include/poller.php

index 0a21e78f869f8c64ef132e8d20c1680f78544da6..05df15b9c8d530ad4b385464468ed55db00f31ff 100755 (executable)
--- a/boot.php
+++ b/boot.php
@@ -101,10 +101,12 @@ define ( 'NETWORK_OSTATUS',          'stat');    // status.net, identi.ca, GNU-s
 define ( 'NETWORK_FEED',             'feed');    // RSS/Atom feeds with no known "post/notify" protocol
 define ( 'NETWORK_DIASPORA',         'dspr');    // Diaspora
 define ( 'NETWORK_MAIL',             'mail');    // IMAP/POP
+define ( 'NETWORK_MAIL2',            'mai2');    // extended IMAP/POP
 define ( 'NETWORK_FACEBOOK',         'face');    // Facebook API     
 define ( 'NETWORK_LINKEDIN',         'lnkd');    // LinkedIn
 define ( 'NETWORK_XMPP',             'xmpp');    // XMPP     
 define ( 'NETWORK_MYSPACE',          'mysp');    // MySpace
+define ( 'NETWORK_GPLUS',            'goog');    // Google+
 
 /**
  * Maximum number of "people who like (or don't like) this"  that we will list by name
index c05358868a9c037a1dad1b05f95b50fa9dbf0276..71ce300235e04a1d2c3c53dd3e5e3380f0299046 100755 (executable)
@@ -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";
index ead7aebad484e0478e79002cc635867f2557ae3d..53178ce53a4bcd62d29b74becd2ecb814fff8916 100755 (executable)
@@ -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)
                );
index 89e4488b92c2239ae09ddb68a3f5c5563fead479..7d42c63b5f8d1731ce57e6c280d9ab67cbd58376 100755 (executable)
@@ -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'] . '>';
                                                        }