Merge branch 'release/2.0.0' into 'stable'
[akkoma] / lib / pleroma / formatter.ex
index 931b9af2b4cbbf6735cf25be43739e7533221b26..e2a658cb3c8ee7a76a47473929746f2ed51a2169 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Formatter do
@@ -13,7 +13,8 @@ defmodule Pleroma.Formatter do
   @auto_linker_config hashtag: true,
                       hashtag_handler: &Pleroma.Formatter.hashtag_handler/4,
                       mention: true,
-                      mention_handler: &Pleroma.Formatter.mention_handler/4
+                      mention_handler: &Pleroma.Formatter.mention_handler/4,
+                      scheme: true
 
   def escape_mention_handler("@" <> nickname = mention, buffer, _, _) do
     case User.get_cached_by_nickname(nickname) do
@@ -127,7 +128,7 @@ defmodule Pleroma.Formatter do
     end
   end
 
-  defp get_ap_id(%User{info: %{source_data: %{"url" => url}}}) when is_binary(url), do: url
+  defp get_ap_id(%User{source_data: %{"url" => url}}) when is_binary(url), do: url
   defp get_ap_id(%User{ap_id: ap_id}), do: ap_id
 
   defp get_nickname_text(nickname, %{mentions_format: :full}), do: User.full_nickname(nickname)