diff --git a/WordPressUtils/src/main/java/org/wordpress/android/util/BlogUtils.java b/WordPressUtils/src/main/java/org/wordpress/android/util/BlogUtils.java index 1da5d104384d..4944bf0a8a2d 100644 --- a/WordPressUtils/src/main/java/org/wordpress/android/util/BlogUtils.java +++ b/WordPressUtils/src/main/java/org/wordpress/android/util/BlogUtils.java @@ -26,11 +26,25 @@ public int compare(Object blog1, Object blog2) { /** * Return a blog name or blog url (host part only) if trimmed name is an empty string */ - public static String getBlogNameFromAccountMap(Map account) { - String blogName = StringUtils.unescapeHTML(MapUtils.getMapStr(account, "blogName")); + public static String getBlogNameOrHostNameFromAccountMap(Map account) { + String blogName = getBlogNameFromAccountMap(account); if (blogName.trim().length() == 0) { blogName = StringUtils.getHost(MapUtils.getMapStr(account, "url")); } return blogName; } -} \ No newline at end of file + + /** + * Return a blog name or blog url (host part only) if trimmed name is an empty string + */ + public static String getBlogNameFromAccountMap(Map account) { + return StringUtils.unescapeHTML(MapUtils.getMapStr(account, "blogName")); + } + + /** + * Return blog url (host part only) if trimmed name is an empty string + */ + public static String getHostNameFromAccountMap(Map account) { + return StringUtils.getHost(MapUtils.getMapStr(account, "url")); + } +}