mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 15:53:32 +00:00
Add filter that takes care of D* reshares with link preview having duplicate images
This commit is contained in:
parent
f03d8d7f52
commit
c22212df12
2 changed files with 25 additions and 0 deletions
|
@ -1,7 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../models/timeline_entry.dart';
|
import '../models/timeline_entry.dart';
|
||||||
|
import '../services/auth_service.dart';
|
||||||
import '../utils/clipboard_utils.dart';
|
import '../utils/clipboard_utils.dart';
|
||||||
import '../utils/url_opening_utils.dart';
|
import '../utils/url_opening_utils.dart';
|
||||||
import 'html_text_viewer_control.dart';
|
import 'html_text_viewer_control.dart';
|
||||||
|
@ -135,6 +137,17 @@ class _SearchResultStatusControlState extends State<SearchResultStatusControl> {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A Diaspora reshare will have an HTML-built card with a link preview image
|
||||||
|
// to the same image as what would be in the single attachment but at a
|
||||||
|
// different link. So we don't want it to render twice.
|
||||||
|
final linkPhotoBaseUrl = Uri.https(
|
||||||
|
context.read<AccountsService>().currentProfile.serverName,
|
||||||
|
'photo/link',
|
||||||
|
).toString();
|
||||||
|
if (widget.status.body.contains(linkPhotoBaseUrl) && items.length == 1) {
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 250.0,
|
height: 250.0,
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
|
|
|
@ -10,6 +10,7 @@ import '../../globals.dart';
|
||||||
import '../../models/filters/timeline_entry_filter.dart';
|
import '../../models/filters/timeline_entry_filter.dart';
|
||||||
import '../../models/flattened_tree_item.dart';
|
import '../../models/flattened_tree_item.dart';
|
||||||
import '../../models/timeline_entry.dart';
|
import '../../models/timeline_entry.dart';
|
||||||
|
import '../../services/auth_service.dart';
|
||||||
import '../../services/timeline_entry_filter_service.dart';
|
import '../../services/timeline_entry_filter_service.dart';
|
||||||
import '../../services/timeline_manager.dart';
|
import '../../services/timeline_manager.dart';
|
||||||
import '../../utils/active_profile_selector.dart';
|
import '../../utils/active_profile_selector.dart';
|
||||||
|
@ -236,6 +237,17 @@ class _StatusControlState extends State<FlattenedTreeEntryControl> {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A Diaspora reshare will have an HTML-built card with a link preview image
|
||||||
|
// to the same image as what would be in the single attachment but at a
|
||||||
|
// different link. So we don't want it to render twice.
|
||||||
|
final linkPhotoBaseUrl = Uri.https(
|
||||||
|
context.read<AccountsService>().currentProfile.serverName,
|
||||||
|
'photo/link',
|
||||||
|
).toString();
|
||||||
|
if (entry.body.contains(linkPhotoBaseUrl) && items.length == 1) {
|
||||||
|
return const SizedBox();
|
||||||
|
}
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: ResponsiveSizesCalculator(context).maxThumbnailHeight,
|
height: ResponsiveSizesCalculator(context).maxThumbnailHeight,
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
|
|
Loading…
Reference in a new issue