Fix tests.
[akkoma] / lib / pleroma / user.ex
index 5da146014717f54da80ff68558bf0e3ba8d9d370..e92b85f52c2baea89ecc9c96f4bf8f4064e07d5a 100644 (file)
@@ -458,4 +458,12 @@ defmodule Pleroma.User do
 
   def ap_enabled?(%User{info: info}), do: info["ap_enabled"]
   def ap_enabled?(_), do: false
+
+  def get_or_fetch(uri_or_nickname) do
+    if String.starts_with?(uri_or_nickname, "http") do
+      get_or_fetch_by_ap_id(uri_or_nickname)
+    else
+      get_or_fetch_by_nickname(uri_or_nickname)
+    end
+  end
 end