Function
onThreadMessage
(
threadId: string,
message: SerializedMessage,
messageId: string,
imitationId: string
)
Source from the content-addressed store, hash-verified
| 723 | }; |
| 724 | |
| 725 | function onThreadMessage( |
| 726 | threadId: string, |
| 727 | message: SerializedMessage, |
| 728 | messageId: string, |
| 729 | imitationId: string |
| 730 | ) { |
| 731 | setThreads((threads) => { |
| 732 | return threads.map((thread) => { |
| 733 | if (thread.id === threadId) { |
| 734 | return { |
| 735 | ...thread, |
| 736 | messages: [ |
| 737 | ...thread.messages.filter( |
| 738 | ({ id }: any) => id !== imitationId && id !== messageId |
| 739 | ), |
| 740 | message, |
| 741 | ], |
| 742 | }; |
| 743 | } |
| 744 | return thread; |
| 745 | }); |
| 746 | }); |
| 747 | } |
| 748 | |
| 749 | function onThreadDrop({ |
| 750 | source, |
Callers
nothing calls this directly
Tested by
no test coverage detected