]> git.mxchange.org Git - friendica.git/commitdiff
better mailing list support, email addr can be either 'from' or 'to'
authorFriendika <info@friendika.com>
Fri, 20 May 2011 00:25:41 +0000 (17:25 -0700)
committerFriendika <info@friendika.com>
Fri, 20 May 2011 00:25:41 +0000 (17:25 -0700)
boot.php
include/Scrape.php
include/email.php

index 0eb1a36c8cf06a8464f75d2023f1d1132d6c0103..66a76f49d22980726950344e1ce8c40e9c7e0f46 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -4,7 +4,7 @@ set_time_limit(0);
 ini_set('pcre.backtrack_limit', 250000);
 
 
-define ( 'FRIENDIKA_VERSION',      '2.2.984' );
+define ( 'FRIENDIKA_VERSION',      '2.2.985' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1054      );
 
index a6bb5f728c6d659be732ca65b7ab66439b552671..21e6bd01ff368fa3ad31ce6ff761c64acb56739c 100644 (file)
@@ -278,6 +278,7 @@ function probe_url($url) {
                $links = lrdd($url);
 
                if(count($links)) {
+                       logger('probe_url: found lrdd links: ' . print_r($links,true), LOGGER_DATA);
                        foreach($links as $link) {
                                if($link['@attributes']['rel'] === NAMESPACE_DFRN)
                                        $dfrn = unamp($link['@attributes']['href']);
@@ -345,8 +346,11 @@ function probe_url($url) {
                                                $poll = 'email ' . random_string();
                                                $priority = 0;
                                                $x = email_msg_meta($mbox,$msgs[0]);
-                                               $adr = imap_rfc822_parse_adrlist($x->from,'');
-                                               if(strlen($adr[0]->personal))
+                                               if(stristr($x->from,$orig_url))
+                                                       $adr = imap_rfc822_parse_adrlist($x->from,'');
+                                               elseif(stristr($x->to,$orig_url))
+                                                       $adr = imap_rfc822_parse_adrlist($x->to,'');
+                                               if(isset($adr) && strlen($adr[0]->personal))
                                                        $vcard['fn'] = notags($adr[0]->personal);
                                        }
                                        imap_close($mbox);
index db10af2ee620ec9c8357b03e22a31b61727ae932..7e0351e94690ce8ee19fe8d56d56f0e4277fb4b8 100644 (file)
@@ -15,7 +15,17 @@ function email_poll($mbox,$email_addr) {
                return array();;
 
        $search = imap_search($mbox,'FROM "' . $email_addr . '"', SE_UID);
-       return (($search) ? $search : array());
+
+       $search2 = imap_search($mbox,'TO "' . $email_addr . '"', SE_UID);
+
+       if($search && $search2)
+               $res = array_merge($search,$search2);
+       elseif($search)
+               $res = $search;
+       else
+               $res = $search2;
+
+       return (($res) ? $res : array());
 }