Add max length truncation to displayed profile attributes to mitigate spam

Changelog-Fixed: Add max length truncation to displayed profile attributes to mitigate spam
Fixes: #1237
This commit is contained in:
2023-06-04 17:49:37 -04:00
parent 952d6746d5
commit 8ca377bec9
15 changed files with 71 additions and 23 deletions

View File

@@ -1112,7 +1112,7 @@ func zap_notification_body(profiles: Profiles, zap: Zap, locale: Locale = Locale
let profile = profiles.lookup(id: pk)
let sats = NSNumber(value: (Double(zap.invoice.amount) / 1000.0))
let formattedSats = format_msats_abbrev(zap.invoice.amount)
let name = Profile.displayName(profile: profile, pubkey: pk).display_name
let name = Profile.displayName(profile: profile, pubkey: pk).display_name.truncate(maxLength: 50)
if src.content.isEmpty {
let format = localizedStringFormat(key: "zap_notification_no_message", locale: locale)