feat(market): embed offer photos inline instead of a media server
Replace the Blossom media-server approach with a fully decentralized one: generate a small (~320px) JPEG thumbnail from the lot's cover photo and embed it in the offer event as a data: URI, so photos ride the relays with no server and no IP leak. The full photo stays in the encrypted inventory. - offer_thumbnail.dart: downscale-until-it-fits data-URI builder + decoder - market_widgets: render data: URIs from memory, http(s) URLs from network - offers_cubit: publish a thumbnail (best-effort) in place of an upload - drop MediaTransport/Blossom from commons_core (http/crypto deps) and the media-server setting; parked on branch parked/offer-photos-blossom Relay event-size limits cap the image to a thumbnail; higher-res sharing would need the parked Blossom path.
This commit is contained in:
parent
5017ea51e0
commit
2b419e6516
24 changed files with 230 additions and 411 deletions
|
|
@ -603,7 +603,6 @@ class _ConfigSheet extends StatefulWidget {
|
|||
class _ConfigSheetState extends State<_ConfigSheet> {
|
||||
final _area = TextEditingController();
|
||||
final _servers = TextEditingController();
|
||||
final _mediaServer = TextEditingController();
|
||||
bool _loading = true;
|
||||
bool _locationBusy = false;
|
||||
String? _locationError;
|
||||
|
|
@ -618,7 +617,6 @@ class _ConfigSheetState extends State<_ConfigSheet> {
|
|||
Future<void> _load() async {
|
||||
_area.text = await widget.settings.areaGeohash();
|
||||
_servers.text = (await widget.settings.relayUrls()).join('\n');
|
||||
_mediaServer.text = await widget.settings.mediaServerUrl();
|
||||
_precision = await widget.settings.searchPrecision();
|
||||
if (mounted) setState(() => _loading = false);
|
||||
}
|
||||
|
|
@ -626,7 +624,6 @@ class _ConfigSheetState extends State<_ConfigSheet> {
|
|||
Future<void> _save() async {
|
||||
await widget.settings.setAreaGeohash(_area.text);
|
||||
await widget.settings.setRelayUrls(_servers.text.split('\n'));
|
||||
await widget.settings.setMediaServerUrl(_mediaServer.text);
|
||||
await widget.settings.setSearchPrecision(_precision);
|
||||
if (mounted) Navigator.of(context).pop(true);
|
||||
}
|
||||
|
|
@ -656,7 +653,6 @@ class _ConfigSheetState extends State<_ConfigSheet> {
|
|||
void dispose() {
|
||||
_area.dispose();
|
||||
_servers.dispose();
|
||||
_mediaServer.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
@ -796,16 +792,6 @@ class _ConfigSheetState extends State<_ConfigSheet> {
|
|||
helperMaxLines: 2,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
TextField(
|
||||
key: const Key('market.mediaServer'),
|
||||
controller: _mediaServer,
|
||||
decoration: InputDecoration(
|
||||
labelText: t.market.mediaServerLabel,
|
||||
helperText: t.market.mediaServerHelp,
|
||||
helperMaxLines: 2,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue