Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Chat/ChatManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ public function clearHistory(Room $chat, string $actorType, string $actorId): IC

$this->participantService->resetChatDetails($chat);

$this->pollService->deleteByRoomId($chat->getId());

return $this->addSystemMessage(
$chat,
$actorType,
Expand Down
18 changes: 18 additions & 0 deletions tests/integration/features/chat-2/poll.feature
Original file line number Diff line number Diff line change
Expand Up @@ -715,3 +715,21 @@ Feature: chat-2/poll
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| room | users | participant2 | participant2-displayname | Message deleted by you | "IGNORE" |
| room | users | participant2 | participant2-displayname | Message deleted by you | "IGNORE" |

Scenario: Deleting the chat history also deletes polls
Given user "participant1" creates room "room" (v4)
| roomType | 2 |
| roomName | room |
And user "participant1" adds user "participant2" to room "room" with 200 (v4)
And user "participant2" creates a poll in room "room" with 201
| question | What is the question? |
| options | ["Where are you?","How much is the fish?"] |
| resultMode | public |
| maxVotes | unlimited |
And user "participant1" sees the following messages in room "room" with 200 (v1)
| room | actorType | actorId | actorDisplayName | message | messageParameters |
| room | users | participant2 | participant2-displayname | {object} | "IGNORE" |
And user "participant1" deletes chat history for room "room" with 200
Then user "participant1" sees poll "What is the question?" in room "room" with 404
Then user "participant2" sees poll "What is the question?" in room "room" with 404
And user "participant1" sees the following messages in room "room" with 200 (v1)