Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ef4f4e

Browse files
feature #59789 [Notifier] [Bluesky] Return the record CID as additional info (javiereguiluz)
This PR was squashed before being merged into the 7.3 branch. Discussion ---------- [Notifier] [Bluesky] Return the record CID as additional info | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | - | License | MIT Some Bluesky API operations (like replies and quotes) require "strong references", which is the combination of the `uri` and the `cid` (See https://docs.bsky.app/docs/advanced-guides/posts#replies-quote-posts-and-embeds). After the changes made in #59742, we should also return the `cid` as additional info. Commits ------- 85a073e [Notifier] [Bluesky] Return the record CID as additional info
2 parents e93b82f + 85a073e commit 3ef4f4e

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

src/Symfony/Component/Notifier/Bridge/Bluesky/BlueskyTransport.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ protected function doSend(MessageInterface $message): SentMessage
124124

125125
if (200 === $statusCode) {
126126
$content = $response->toArray();
127-
$sentMessage = new SentMessage($message, (string) $this);
127+
128+
$sentMessage = new SentMessage($message, (string) $this, ['cid' => $content['cid']]);
128129
$sentMessage->setMessageId($content['uri']);
129130

130131
return $sentMessage;

src/Symfony/Component/Notifier/Bridge/Bluesky/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGELOG
55
---
66

77
* Add option to attach a website preview card
8+
* Add `cid` info into returned `SentMessage`
89

910
7.2
1011
---

src/Symfony/Component/Notifier/Bridge/Bluesky/Tests/BlueskyTransportTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ public function testReturnedMessageId()
338338
$message = $transport->send(new ChatMessage('Hello!'));
339339

340340
$this->assertSame($recordUri, $message->getMessageId());
341+
$this->assertSame($recordCid, $message->getInfo('cid'));
341342
}
342343

343344
public static function sendMessageWithEmbedDataProvider(): iterable

src/Symfony/Component/Notifier/Bridge/Bluesky/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"psr/log": "^1|^2|^3",
2525
"symfony/clock": "^6.4|^7.0",
2626
"symfony/http-client": "^6.4|^7.0",
27-
"symfony/notifier": "^7.2",
27+
"symfony/notifier": "^7.3",
2828
"symfony/string": "^6.4|^7.0"
2929
},
3030
"require-dev": {

0 commit comments

Comments
 (0)