]> git.mxchange.org Git - friendica.git/commitdiff
guid creation: Take the hostname from mail addresses for mail posts
authorMichael <heluecht@pirati.ca>
Mon, 26 Feb 2018 11:48:05 +0000 (11:48 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 26 Feb 2018 11:48:05 +0000 (11:48 +0000)
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'])) {