mirror of
https://gitlab.com/mysocialportal/relatica
synced 2024-10-18 12:23:31 +00:00
Build threads.net profile links from data since not in JSON
Fixes Issue #89
This commit is contained in:
parent
199262c469
commit
8b8451fbc8
2 changed files with 15 additions and 3 deletions
|
@ -7,8 +7,12 @@
|
|||
* Fixes Unlisted posts are showing as and sharing as
|
||||
private ([Issue #78](https://gitlab.com/mysocialportal/relatica/-/issues/78))
|
||||
* Fixes trailing CW type ([Issue #90](https://gitlab.com/mysocialportal/relatica/-/issues/90))
|
||||
* Fix Threads and Bluesky link errors ([Issue #79](https://gitlab.com/mysocialportal/relatica/-/issues/90)
|
||||
and [Issuen #87](https://gitlab.com/mysocialportal/relatica/-/issues/87))
|
||||
* Fix Threads open in browser
|
||||
errors ([Issue #87](https://gitlab.com/mysocialportal/relatica/-/issues/87))
|
||||
* Fix Bluesky open in browser
|
||||
errors ([Issue #79](https://gitlab.com/mysocialportal/relatica/-/issues/79))
|
||||
*Fix Threads profiles don't open in browser
|
||||
properly ([Issue #89](https://gitlab.com/mysocialportal/relatica/-/issues/89))
|
||||
* New Features
|
||||
* Shows the network of the post/comment ([Feature #82](https://gitlab.com/mysocialportal/relatica/-/issues/82))
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ extension ConnectionMastodonExtensions on Connection {
|
|||
{String defaultServerName = ''}) {
|
||||
final name = json['display_name'] ?? '';
|
||||
final id = json['id']?.toString() ?? '';
|
||||
final profileUrl = Uri.parse(json['url'] ?? '');
|
||||
var profileUrl = Uri.parse(json['url'] ?? '');
|
||||
const network = 'Unknown';
|
||||
final avatar = Uri.tryParse(json['avatar_static'] ?? '') ?? Uri();
|
||||
final String handleFromJson = json['acct'];
|
||||
|
@ -20,11 +20,19 @@ extension ConnectionMastodonExtensions on Connection {
|
|||
late final String handle;
|
||||
if (handleFromJson.contains('@')) {
|
||||
handle = handleFromJson;
|
||||
final handleElements = handleFromJson.split('@');
|
||||
if (handleElements.last == 'threads.net') {
|
||||
profileUrl =
|
||||
Uri.parse('https://www.threads.net/@${handleElements.first}');
|
||||
}
|
||||
} else {
|
||||
final server = defaultServerName.isNotEmpty
|
||||
? defaultServerName
|
||||
: getIt<AccountsService>().currentProfile.serverName;
|
||||
handle = '$handleFromJson@$server';
|
||||
if (server == 'threads.net') {
|
||||
profileUrl = Uri.parse('https://www.threads.net/@$handleFromJson');
|
||||
}
|
||||
}
|
||||
|
||||
return Connection(
|
||||
|
|
Loading…
Reference in a new issue