Skip to content

Commit

Permalink
adapted twitter uri
Browse files Browse the repository at this point in the history
Signed-off-by: call-me-matt <nextcloud@matthiasheinisch.de>
  • Loading branch information
call-me-matt committed Feb 22, 2021
1 parent ea5e5ff commit b4b7ad6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/Service/Social/TwitterProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public function getImageUrls(array $contact):array {
$profileIds = $this->getProfileIds($contact);
$urls = [];
foreach ($profileIds as $profileId) {
$recipe = 'https://mobile.twitter.com/{socialId}';
$recipe = 'https://twitter.com/{socialId}';
$connector = str_replace("{socialId}", $profileId, $recipe);
$connector = $this->getFromHtml($connector, '_normal');
$connector = $this->getFromHtml($connector, 'profile_image');
$urls[] = $connector;
}
return $urls;
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/Service/Social/TwitterProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,16 @@ public function dataProviderGetImageUrls() {
]
];
$contactWithSocialUrls = [
"https://mobile.twitter.com/username1",
"https://mobile.twitter.com/username2",
"https://twitter.com/username1",
"https://twitter.com/username2",
];
$contactWithSocialHtml = [
'<html><img src="username1_normal.jpg" /></html>',
'<html><img src="username2_normal.jpg" /></html>',
'<html><img src="./profile_images/username1_normal.jpg" /></html>',
'<html><img src="./profile_images/username2_normal.jpg" /></html>',
];
$contactWithSocialImgs = [
"username1_400x400.jpg",
"username2_400x400.jpg"
"./profile_images/username1_400x400.jpg",
"./profile_images/username2_400x400.jpg"
];

$contactWithoutSocial = [
Expand Down

0 comments on commit b4b7ad6

Please sign in to comment.