Skip to content

Commit

Permalink
fix bug of links shared without http not being able to be unfurled
Browse files Browse the repository at this point in the history
  • Loading branch information
Blundell committed Dec 4, 2017
1 parent 042cceb commit b6b7e86
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ private String generateText(ChannelHistory.Message message) {

private String generateTitle(ChannelHistory.Message message) {
try {
return linkUnfurler.unfurl(message.getPageLink()).getTitle();
String pageLink = message.getPageLink();
if (pageLink.startsWith("www")) {
pageLink = "http:// " + pageLink;
}
return linkUnfurler.unfurl(pageLink).getTitle();
} catch (IOException e) {
return "#eNews link";
}
Expand Down

0 comments on commit b6b7e86

Please sign in to comment.