mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
redirect correctly
This commit is contained in:
parent
1e1b0054d0
commit
84bba9062b
1 changed files with 10 additions and 1 deletions
|
@ -25,6 +25,15 @@ defmodule PhilomenaWeb.ChannelController do
|
|||
|
||||
if user, do: Channels.clear_notification(channel, user)
|
||||
|
||||
redirect(conn, external: channel.url)
|
||||
redirect(conn, external: url(channel))
|
||||
end
|
||||
|
||||
defp url(%{type: "LivestreamChannel", short_name: short_name}),
|
||||
do: "http://www.livestream.com/#{short_name}"
|
||||
defp url(%{type: "PicartoChannel", short_name: short_name}),
|
||||
do: "https://picarto.tv/#{short_name}"
|
||||
defp url(%{type: "PiczelChannel", short_name: short_name}),
|
||||
do: "https://piczel.tv/watch/#{short_name}"
|
||||
defp url(%{type: "TwitchChannel", short_name: short_name}),
|
||||
do: "https://www.twitch.tv/#{short_name}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue