The picker now offers only a photo; with none, the generated DiceBear avatar is used. Removes the seedks-ttf illustration row (and the now-dead avatarGlyphNames/avatarGlyphToken). tane:seed:<glyph> values set before this still render (avatarGlyphChar kept) for backward compatibility.
27 lines
1.2 KiB
Dart
27 lines
1.2 KiB
Dart
import 'seed_glyph.dart';
|
|
|
|
/// A profile avatar is carried in one string (stored locally and published as
|
|
/// the NIP-01 kind:0 `picture`), in one of two shapes:
|
|
/// - `data:image/jpeg;base64,…` — a tiny photo thumbnail (rides inline, no
|
|
/// media server, like offer photos);
|
|
/// - empty — a DiceBear "thumbs" face generated deterministically from the pubkey.
|
|
///
|
|
/// A legacy `tane:seed:<name>` value (a seed illustration, no longer offered in
|
|
/// the picker) is still rendered for anyone who set one before; see
|
|
/// [avatarGlyphChar].
|
|
const avatarGlyphPrefix = 'tane:seed:';
|
|
|
|
/// The glyph char for a legacy seed-illustration [name], or null if unknown.
|
|
/// Retained only to render `tane:seed:` avatars stored before the picker dropped
|
|
/// them; new avatars are photos or the generated default.
|
|
String? avatarGlyphChar(String name) => switch (name) {
|
|
'jars' => SeedGlyphs.jars,
|
|
'sack' => SeedGlyphs.sack,
|
|
'jar' => SeedGlyphs.jar,
|
|
'scattered' => SeedGlyphs.scattered,
|
|
'pouring' => SeedGlyphs.pouring,
|
|
'mug' => SeedGlyphs.mug,
|
|
'bigSpoon' => SeedGlyphs.bigSpoon,
|
|
'smallSpoon' => SeedGlyphs.smallSpoon,
|
|
_ => null,
|
|
};
|