From b7e61f16d1ed1e822a5e52ed39857d5c2a4918ee Mon Sep 17 00:00:00 2001 From: Felicio Mununga Date: Mon, 13 Jun 2022 20:07:00 +0200 Subject: [PATCH] Emit to self on send (#272) * fix chat references in status-react * emit to self on send --- packages/status-js/src/client.ts | 1 + .../src/routes/chat/components/chat-message/index.tsx | 4 ++-- packages/status-react/src/routes/chat/index.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/status-js/src/client.ts b/packages/status-js/src/client.ts index 4f25c1ae..aee6ae62 100644 --- a/packages/status-js/src/client.ts +++ b/packages/status-js/src/client.ts @@ -42,6 +42,7 @@ class Client { // '/dns4/node-01.do-ams3.wakuv2.test.statusim.net/tcp/8000/wss/p2p/16Uiu2HAmPLe7Mzm8TsYUubgCAW1aJoeFScxrLj8ppHFivPo97bUZ', ], }, + libp2p: { config: { pubsub: { enabled: true, emitSelf: true } } }, }) await waku.waitForRemotePeer() diff --git a/packages/status-react/src/routes/chat/components/chat-message/index.tsx b/packages/status-react/src/routes/chat/components/chat-message/index.tsx index 3b451a47..c084a137 100644 --- a/packages/status-react/src/routes/chat/components/chat-message/index.tsx +++ b/packages/status-react/src/routes/chat/components/chat-message/index.tsx @@ -77,14 +77,14 @@ export const ChatMessage = (props: Props) => { const userProfileDialog = useDialog(UserProfileDialog) const handleMessageSubmit = (message: string) => { - client.community.get(chatId).sendTextMessage( + client.community.chats.get(chatId).sendTextMessage( message, '0x0fa999097568d1fdcc39108a08d75340bd2cee5ec59c36799007150d0a9fc896' ) } const handleReaction = (reaction: Reaction) => { - client.community.get(chatId).sendReaction(chatId, messageId, reaction) + client.community.chats.get(chatId).sendReaction(chatId, messageId, reaction) } const handleReplyClick = () => { diff --git a/packages/status-react/src/routes/chat/index.tsx b/packages/status-react/src/routes/chat/index.tsx index 0aae6be3..d402a252 100644 --- a/packages/status-react/src/routes/chat/index.tsx +++ b/packages/status-react/src/routes/chat/index.tsx @@ -82,7 +82,7 @@ export const Chat = () => { const showMembers = enableMembers && state.showMembers const handleMessageSubmit = (message: string) => { - client.community.get(chatId).sendTextMessage( + client.community.chats.get(chatId).sendTextMessage( message // '0x0fa999097568d1fdcc39108a08d75340bd2cee5ec59c36799007150d0a9fc896' )