Skip to content

Commit 5010c0c

Browse files
committedMar 8, 2025
[FEATURE] Also support full URL to profile as account setting
1 parent dc7dc05 commit 5010c0c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed
 

‎Classes/Domain/Repository/BlueskyRepository.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(readonly protected RequestFactory $requestFactory)
2424
public function findBySettings(array $settings): array
2525
{
2626
$parameters = [
27-
'actor' => $settings['account'] ?? 'in2code.de',
27+
'actor' => $this->getActor($settings),
2828
'limit' => (int)($settings['limit'] ?? 10) ?: 10,
2929
'filter' => 'posts_and_author_threads',
3030
];
@@ -42,4 +42,19 @@ public function findBySettings(array $settings): array
4242
}
4343
return $result['feed'];
4444
}
45+
46+
/**
47+
* https://bsky.app/profile/www.helmholtz-munich.de
48+
*
49+
* @param array $settings
50+
* @return string
51+
*/
52+
private function getActor(array $settings): string
53+
{
54+
$account = $settings['account'] ?? 'in2code.de';
55+
if (stristr($account, '/')) {
56+
$account = basename($account);
57+
}
58+
return $account;
59+
}
4560
}

0 commit comments

Comments
 (0)
Please sign in to comment.