Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bots): Fix some system messages for bots #10269

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

nickvergessen
Copy link
Member

🏚️ Before

[error] 2023-08-18T16:18:59.000 no app in contex Call to a member function isGuest() on null in file '…/lib/Chat/Parser/SystemMessage.php' line 281     

🏑 After

[debug] 2023-08-18T16:23:04.000 call_summary_bot {"type":"Activity","actor":{"type":"Person","id":"users\/admin","name":"Laura Adams"},"object":{"type":"Note","id":"2165","name":"user_added","content":"{\"message\":\"{actor} added {user}\",\"parameters\":{\"actor\":{\"type\":\"user\",\"id\":\"admin\",\"name\":\"Laura Adams\"},\"user\":{\"type\":\"usβ”‚

🏁 Checklist

@nickvergessen nickvergessen added 3. to review bug feature: api πŸ› οΈ OCS API for conversations, chats and participants feature: bots πŸ€– /commands in chat messages labels Aug 18, 2023
@nickvergessen nickvergessen self-assigned this Aug 18, 2023
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the bugfix/noid/fix-bots-on-systemmessages branch from f8179fc to 4ba00e6 Compare August 18, 2023 13:13
@nickvergessen
Copy link
Member Author

nickvergessen commented Aug 18, 2023

Force pushed with:

diff --git a/tests/php/Chat/Parser/SystemMessageTest.php b/tests/php/Chat/Parser/SystemMessageTest.php
index c7b8369c5..e615b36a3 100644
--- a/tests/php/Chat/Parser/SystemMessageTest.php
+++ b/tests/php/Chat/Parser/SystemMessageTest.php
@@ -461,7 +461,7 @@ class SystemMessageTest extends TestCase {
        public function testParseMessage(string $message, array $parameters, ?string $recipientId, string $expectedMessage, array $expectedParameters) {
                /** @var Participant|MockObject $participant */
                $participant = $this->createMock(Participant::class);
-               if ($recipientId  === null) {
+               if ($recipientId === null) {
                        $participant = null;
                } elseif ($recipientId && strpos($recipientId, 'guest::') !== false) {
                        $attendee = Attendee::fromRow([

@nickvergessen nickvergessen merged commit d1c9a63 into master Aug 18, 2023
@nickvergessen nickvergessen deleted the bugfix/noid/fix-bots-on-systemmessages branch August 18, 2023 16:38
@nickvergessen
Copy link
Member Author

/backport to stable27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug feature: api πŸ› οΈ OCS API for conversations, chats and participants feature: bots πŸ€– /commands in chat messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants