]> git.mxchange.org Git - friendica.git/commitdiff
bug #148 email subscription issue
authorFriendika <info@friendika.com>
Tue, 13 Sep 2011 05:24:36 +0000 (22:24 -0700)
committerFriendika <info@friendika.com>
Tue, 13 Sep 2011 05:24:36 +0000 (22:24 -0700)
include/Scrape.php

index b80f24c22ec57a941d55e4d03c30b25abb791fb9..58468a40d021ab6de2f008bd704cffbbe1233cfa 100644 (file)
@@ -430,7 +430,8 @@ function probe_url($url, $mode = PROBE_NORMAL) {
                                                $addr = $orig_url;
                                                $network = NETWORK_MAIL;
                                                $name = substr($url,0,strpos($url,'@'));
-                                               $profile = 'http://' . substr($url,strpos($url,'@')+1);
+                                               $phost = substr($url,strpos($url,'@')+1);
+                                               $profile = 'http://' . $phost;
                                                // fix nick character range
                                                $vcard = array('fn' => $name, 'nick' => $name, 'photo' => gravatar_img($url));
                                                $notify = 'smtp ' . random_string();
@@ -441,8 +442,15 @@ function probe_url($url, $mode = PROBE_NORMAL) {
                                                        $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);
+                                               if(isset($adr)) {
+                                                       foreach($adr as $feadr) {
+                                                               if((strcasecmp($feadr->mailbox,$name) == 0) 
+                                                                       &&(strcasecmp($feadr->host,$phost) == 0) 
+                                                                       && (strlen($feadr->personal))) {
+                                                                       $vcard['fn'] = notags($feadr->personal);
+                                                               }
+                                                       }
+                                               }
                                        }
                                        imap_close($mbox);
                                }