summaryrefslogtreecommitdiff
path: root/app/views/users/show.html.erb
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/users/show.html.erb')
-rw-r--r--app/views/users/show.html.erb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index fbf848c..db51258 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -62,10 +62,11 @@
<tr>
<td><b>Mastodon</b></td>
<td>
- <% if @user.mastodon_instance %>
- <%= link_to "@#{@user.mastodon}", "https://#{CGI.escape(@user.mastodon_instance)}/@#{CGI.escape(@user.mastodon)}", :target => "_blank" %></td>
+ <% mstdn_array = @user.mastodon.split("@") %>
+ <% if mstdn_array.length > 1 %>
+ <%= link_to "@#{mstdn_array[0]}", "https://#{CGI.escape(mstdn_array[1])}/@#{CGI.escape(mstdn_array[0])}", :target => "_blank" %></td>
<% else %>
- <%= @user.mastodon %>
+ <%= "@" + @user.mastodon %>
<% end %>
</tr>
<% end %>