diff options
author | lain <lain@soykaf.club> | 2020-05-11 12:50:25 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-05-11 12:50:25 +0200 |
commit | f01abaff3751f0e76de0f126b41efe801768c3f8 (patch) | |
tree | ef96b382256ff02145b0a03a534d45c8d6440198 /lib | |
parent | a6283bbae13a873af969336bd4e62011777a1a70 (diff) | |
download | pleroma-f01abaff3751f0e76de0f126b41efe801768c3f8.tar.gz |
User: Truncate bios when updating a remote user.1754-bio-length-stable
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/user.ex | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 2f0333da0..3e8f19e30 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -501,7 +501,15 @@ defmodule Pleroma.User do params = Map.put(params, :last_refreshed_at, NaiveDateTime.utc_now()) - params = if remote?, do: truncate_fields_param(params), else: params + params = + if remote? do + params + |> truncate_fields_param() + |> truncate_if_exists(:name, name_limit) + |> truncate_if_exists(:bio, bio_limit) + else + params + end struct |> cast( |