Conversation
mruac
commented
Dec 15, 2024
- Used human readable terms
- Include quote and reply post
- Added video support
- Replaced Youtube embed with thumbnail preview
- Added link embed preview
- Included visible alt text to images
* Used human readable terms * Include quote and reply post * Added video support * Replaced Youtube embed with thumbnail preview * Added link embed preview * Included visible alt text to images
Pull request artifacts
last change: Friday 2024-12-20 11:11:32 |
| $facets = $record['facets']; | ||
| foreach ($facets as $facet) { | ||
| if ($facet['features'][0]['$type'] === 'app.bsky.richtext.facet#link') { | ||
| $substring = substr($text_copy, $facet['index']['byteStart'], $facet['index']['byteEnd'] - $facet['index']['byteStart']); |
There was a problem hiding this comment.
Careful... does it break for unicode text?
There was a problem hiding this comment.
I don't think so. Testing with urls that have emojis and international characters in them are either converted to punycode or percent coded when published. When using rich text via third party clients, PHP was able to get the right string from the byte indexes alone.
| $description .= $this->parseExternal($post['post']['record']['embed']['external'], $authorDid); | ||
| if (Debug::isEnabled()) { | ||
| $url = explode('/', $post['post']['uri']); | ||
| error_log('https://bsky.app/profile/' . $url[2] . '/post/' . $url[4]); |
There was a problem hiding this comment.
Please dont use error_log directly. Use $this->logger->warning() or $this->logger->error()
There was a problem hiding this comment.
noted, this should probably be mentioned in the documentation.
|
I merged despite my nit picks. Good work @mruac ! |
|
Thank you! Being nit picky to an extent is good to keep coding styles uniform and readable. |
* Update BlueskyBridge.php * Used human readable terms * Include quote and reply post * Added video support * Replaced Youtube embed with thumbnail preview * Added link embed preview * Included visible alt text to images * appease the lint * remove unused test code * fix unset displayName * appease the lint