mirror of
https://github.com/Safe-Support-Chat/ocrcc-chatbox
synced 2024-12-23 17:47:43 +00:00
don't show bot messages unless the user initiated them
This commit is contained in:
parent
3935287c3f
commit
792a994ef5
@ -343,6 +343,14 @@ class ChatBox extends React.Component {
|
||||
content: event.getContent(),
|
||||
}
|
||||
|
||||
if (message.content.showToUser && message.content.showToUser !== this.state.userId) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.content.body.startsWith('!bot') && message.sender !== this.state.userId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const messages = [...this.state.messages]
|
||||
messages.push(message)
|
||||
this.setState({ messages })
|
||||
|
Loading…
Reference in New Issue
Block a user