From 1b477a4e3137b8e1e0892b998691b71943e14da2 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Thu, 6 Sep 2018 17:09:11 -0500 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20show=20author=20name=20if=20it?= =?UTF-8?q?=E2=80=99s=20the=20same=20as=20the=20feed=20name.=20Issue=20#29?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NetNewsWire/MainWindow/Detail/ArticleRenderer.swift | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/NetNewsWire/MainWindow/Detail/ArticleRenderer.swift b/NetNewsWire/MainWindow/Detail/ArticleRenderer.swift index e07788edc..c0b41558c 100644 --- a/NetNewsWire/MainWindow/Detail/ArticleRenderer.swift +++ b/NetNewsWire/MainWindow/Detail/ArticleRenderer.swift @@ -400,7 +400,16 @@ class ArticleRenderer { return "" } - var byline = "" + // If the author's name is the same as the feed, then we don't want to display it. + // This code assumes that multiple authors would never match the feed name so that + // if there feed owner has an article co-author all authors are given the byline. + if authors.count == 1, let author = authors.first { + if author.name == article.feed?.nameForDisplay { + return "" + } + } + + var byline = "" var isFirstAuthor = true for author in authors { @@ -430,8 +439,8 @@ class ArticleRenderer { } } - return byline + } private func renderedHTML() -> String {