Skip to content

Commit abd54b8

Browse files
MDL-88360 message: fix cannot send error shown in group conversations
1 parent bf96e85 commit abd54b8

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

public/message/amd/build/message_drawer_view_conversation_patcher.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/message/amd/build/message_drawer_view_conversation_patcher.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/message/amd/src/message_drawer_view_conversation_patcher.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,12 @@ function(
11341134
return false;
11351135
}
11361136

1137+
if (newState.type == Constants.CONVERSATION_TYPES.PUBLIC) {
1138+
// For group conversations, use the conversation-level send permission
1139+
// rather than per-member private messaging flags.
1140+
return newState.canSendMessageToConversation === false;
1141+
}
1142+
11371143
const oldOtherUser = getOtherUserFromState(state);
11381144
const newOtherUser = getOtherUserFromState(newState);
11391145

public/message/tests/behat/message_send_messages.feature

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Feature: Message send messages
3535
And I open the "Group" conversations list
3636
And "Group 1" "core_message > Message" should exist
3737
And I select "Group 1" conversation in messaging
38+
And I should not see "Cannot send messages"
3839
When I send "Hi!" message in the message area
3940
Then I should see "Hi!" in the "Group 1" "core_message > Message conversation"
4041
And I should see "##today##%d %B##" in the "Group 1" "core_message > Message conversation"
@@ -43,6 +44,7 @@ Feature: Message send messages
4344
And I open messaging
4445
And "Group 1" "core_message > Message" should exist
4546
And I select "Group 1" conversation in messaging
47+
And I should not see "Cannot send messages"
4648
And I should see "Hi!" in the "Group 1" "core_message > Message conversation"
4749

4850
Scenario: Send a message to a starred conversation

0 commit comments

Comments
 (0)