diff options
author | lain <lain@soykaf.club> | 2020-05-11 12:50:25 +0200 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-05-13 00:33:38 +0300 |
commit | 3f13437a9cfc0f13cb4921ee04b7821c1b169021 (patch) | |
tree | b1a999ce4a5cad956fef0d9fef8bd10058ba4c4f /lib | |
parent | 3a63f84c45e057dbfdcedba356478f32349c737a (diff) | |
download | pleroma-3f13437a9cfc0f13cb4921ee04b7821c1b169021.tar.gz pleroma-3f13437a9cfc0f13cb4921ee04b7821c1b169021.zip |
User: Truncate bios when updating a remote user.
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( |