]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #4502 from annando/guid-from-mail
authorHypolite Petovan <mrpetovan@gmail.com>
Mon, 26 Feb 2018 14:36:56 +0000 (09:36 -0500)
committerGitHub <noreply@github.com>
Mon, 26 Feb 2018 14:36:56 +0000 (09:36 -0500)
guid creation: Take the hostname from mail addresses for mail posts

src/Model/Item.php

index 8747f9fee3ac33a4cf0abd03d4a7c10405f9e17e..696860e16cffd4f5075e66a964645f2fa7346d59 100644 (file)
@@ -260,6 +260,12 @@ class Item extends BaseObject
                                        $prefix_host = $parsed['host'];
                                }
                        }
+
+                       // Is it in the format data@host.tld? - Used for mail contacts
+                       if (empty($prefix_host) && !empty($item['author-link']) && strstr($item['author-link'], '@')) {
+                               $mailparts = explode('@', $item['author-link']);
+                               $prefix_host = array_pop($mailparts);
+                       }
                }
 
                if (!empty($item['plink'])) {