-
Notifications
You must be signed in to change notification settings - Fork 52
Fix issue #11 - Report user chat history like Unity #80
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
base: dev
Are you sure you want to change the base?
Conversation
|
|
||
| const reportMessage = (message: any) => | ||
| { | ||
| setMessengerHistory([]); // We do this because we are interested in displaying only the reported message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we adding this room chat entry to messenger history ?
| return { addChatEntry, chatHistory, roomHistory, messengerHistory }; | ||
|
|
||
| return { addChatEntry, chatHistory, roomHistory, messengerHistory, setMessengerHistory, addMessengerEntry }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to export the settter for the messenger history? Is there a scenario where we would want to completely reset it?
|
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 |
|
Changes done! Thank you very much for the information. 👍 |
|
Thanks, works perfectly |
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