Fix issue #11 - Report user chat history like Unity#80
Open
oobjectt wants to merge 2 commits intobillsonnn:devfrom
Open
Fix issue #11 - Report user chat history like Unity#80oobjectt wants to merge 2 commits intobillsonnn:devfrom
oobjectt wants to merge 2 commits intobillsonnn:devfrom
Conversation
s074
requested changes
Dec 12, 2022
|
|
||
| const reportMessage = (message: any) => | ||
| { | ||
| setMessengerHistory([]); // We do this because we are interested in displaying only the reported message. |
Collaborator
There was a problem hiding this comment.
Doesn't this reset all of the messenger history?
| { | ||
| setMessengerHistory([]); // We do this because we are interested in displaying only the reported message. | ||
| report(ReportType.IM, { reportedUserId: message.webId }); | ||
| addMessengerEntry({ id: message.id, webId: message.webId, entityId: message.entityId, name: message.name, timestamp: message.timestamp, type: ChatEntryType.TYPE_IM, roomId: message.roomId, message: message.message }); |
Collaborator
There was a problem hiding this comment.
why are we adding this room chat entry to messenger history ?
| return { addChatEntry, chatHistory, roomHistory, messengerHistory }; | ||
|
|
||
| return { addChatEntry, chatHistory, roomHistory, messengerHistory, setMessengerHistory, addMessengerEntry }; |
Collaborator
There was a problem hiding this comment.
do we need to export the settter for the messenger history? Is there a scenario where we would want to completely reset it?
Collaborator
|
Came back to offer some insight. I think you have the right idea but the wrong execution. Instead of clearing the messenger history to use it to store the reported message, append the reported message to the report selected chats and then set the current step to be selectCfhTopic |
Contributor
Author
|
Changes done! Thank you very much for the information. 👍 |
Contributor
|
Thanks, works perfectly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It has its functions:
If the user himself sends the message, the report does not appear (it is obvious that he will not report himself)
We have also added a functionality, in which when you click on the nickname or avatar, the user profile opens
Finally, the reported message will be updated according to which history line you report