diff options
author | lain <lain@soykaf.club> | 2018-02-25 16:14:25 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-02-25 16:14:25 +0100 |
commit | e3629af4daaa8ea44d8fea53d426db6527cdc358 (patch) | |
tree | 63ae43c7bf78052878648385a0ef002563dfbda7 /lib/pleroma/user.ex | |
parent | dd97193311fec3c1fc44f9b503cdf5d4aa7da376 (diff) | |
download | pleroma-e3629af4daaa8ea44d8fea53d426db6527cdc358.tar.gz |
Handle remote update activities.
Diffstat (limited to 'lib/pleroma/user.ex')
-rw-r--r-- | lib/pleroma/user.ex | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 8c1c524ff..2ae01c2cc 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -99,7 +99,7 @@ defmodule Pleroma.User do |> cast(params, [:bio, :name]) |> unique_constraint(:nickname) |> validate_format(:nickname, ~r/^[a-zA-Z\d]+$/) - |> validate_length(:bio, min: 1, max: 1000) + |> validate_length(:bio, min: 1, max: 5000) |> validate_length(:name, min: 1, max: 100) end @@ -108,8 +108,8 @@ defmodule Pleroma.User do |> cast(params, [:bio, :name, :info, :follower_address, :avatar]) |> unique_constraint(:nickname) |> validate_format(:nickname, ~r/^[a-zA-Z\d]+$/) - |> validate_length(:bio, min: 1, max: 1000) - |> validate_length(:name, min: 1, max: 100) + |> validate_length(:bio, max: 5000) + |> validate_length(:name, max: 100) end def password_update_changeset(struct, params) do @@ -218,6 +218,11 @@ defmodule Pleroma.User do end end + def invalidate_cache(user) do + Cachex.del(:user_cache, "ap_id:#{user.ap_id}") + Cachex.del(:user_cache, "nickname:#{user.nickname}") + end + def get_cached_by_ap_id(ap_id) do key = "ap_id:#{ap_id}" Cachex.get!(:user_cache, key, fallback: fn(_) -> get_by_ap_id(ap_id) end) |