diff --git a/packages/status-communities/src/chat.ts b/packages/status-communities/src/chat.ts index 86ea0413..184d50dd 100644 --- a/packages/status-communities/src/chat.ts +++ b/packages/status-communities/src/chat.ts @@ -1,6 +1,6 @@ -import { ChatMessage, Content } from "./chat_message"; import { chatIdToContentTopic } from "./contentTopic"; import { createSymKeyFromPassword } from "./encryption"; +import { ChatMessage, Content } from "./wire/chat_message"; /** * Represent a chat room. Only public chats are currently supported. diff --git a/packages/status-communities/src/chat_message.spec.ts b/packages/status-communities/src/chat_message.spec.ts index 18638d4a..ebcc71ee 100644 --- a/packages/status-communities/src/chat_message.spec.ts +++ b/packages/status-communities/src/chat_message.spec.ts @@ -1,17 +1,17 @@ import { expect } from "chai"; +import { + AudioMessage_AudioType, + ChatMessage_ContentType, +} from "./proto/communities/v1/chat_message"; +import { ImageType } from "./proto/communities/v1/enums"; import { AudioContent, ChatMessage, ContentType, ImageContent, StickerContent, -} from "./chat_message"; -import { - AudioMessage_AudioType, - ChatMessage_ContentType, -} from "./proto/communities/v1/chat_message"; -import { ImageType } from "./proto/communities/v1/enums"; +} from "./wire/chat_message"; describe("Chat Message", () => { it("Encode & decode Image message", () => { diff --git a/packages/status-communities/src/index.ts b/packages/status-communities/src/index.ts index 4350c11c..5256c077 100644 --- a/packages/status-communities/src/index.ts +++ b/packages/status-communities/src/index.ts @@ -1,3 +1,6 @@ import { Identity } from "./identity"; import { Messenger } from "./messenger"; -export { Messenger, Identity }; +import { ApplicationMetadataMessage } from "./wire/application_metadata_message"; +import { ChatMessage } from "./wire/chat_message"; + +export { Messenger, Identity, ApplicationMetadataMessage, ChatMessage }; diff --git a/packages/status-communities/src/messenger.spec.ts b/packages/status-communities/src/messenger.spec.ts index cdc53966..6d10a9eb 100644 --- a/packages/status-communities/src/messenger.spec.ts +++ b/packages/status-communities/src/messenger.spec.ts @@ -2,10 +2,10 @@ import { expect } from "chai"; import debug from "debug"; import { utils } from "js-waku"; -import { ApplicationMetadataMessage } from "./application_metadata_message"; -import { ContentType } from "./chat_message"; import { Identity } from "./identity"; import { Messenger } from "./messenger"; +import { ApplicationMetadataMessage } from "./wire/application_metadata_message"; +import { ContentType } from "./wire/chat_message"; const testChatId = "test-chat-id"; diff --git a/packages/status-communities/src/messenger.ts b/packages/status-communities/src/messenger.ts index 305b77de..cab1dd78 100644 --- a/packages/status-communities/src/messenger.ts +++ b/packages/status-communities/src/messenger.ts @@ -2,11 +2,11 @@ import debug from "debug"; import { Waku, WakuMessage } from "js-waku"; import { CreateOptions as WakuCreateOptions } from "js-waku/build/main/lib/waku"; -import { ApplicationMetadataMessage } from "./application_metadata_message"; import { Chat } from "./chat"; -import { ChatMessage, Content } from "./chat_message"; import { Identity } from "./identity"; import { ApplicationMetadataMessage_Type } from "./proto/status/v1/application_metadata_message"; +import { ApplicationMetadataMessage } from "./wire/application_metadata_message"; +import { ChatMessage, Content } from "./wire/chat_message"; const dbg = debug("communities:messenger"); diff --git a/packages/status-communities/src/application_metadata_message.ts b/packages/status-communities/src/wire/application_metadata_message.ts similarity index 89% rename from packages/status-communities/src/application_metadata_message.ts rename to packages/status-communities/src/wire/application_metadata_message.ts index bfd5c954..b9ce2d0b 100644 --- a/packages/status-communities/src/application_metadata_message.ts +++ b/packages/status-communities/src/wire/application_metadata_message.ts @@ -3,10 +3,11 @@ import { utils } from "js-waku"; import { Reader } from "protobufjs"; import secp256k1 from "secp256k1"; +import { Identity } from "../identity"; +import * as proto from "../proto/status/v1/application_metadata_message"; +import { ApplicationMetadataMessage_Type } from "../proto/status/v1/application_metadata_message"; + import { ChatMessage } from "./chat_message"; -import { Identity } from "./identity"; -import * as proto from "./proto/status/v1/application_metadata_message"; -import { ApplicationMetadataMessage_Type } from "./proto/status/v1/application_metadata_message"; export class ApplicationMetadataMessage { private constructor(public proto: proto.ApplicationMetadataMessage) {} diff --git a/packages/status-communities/src/chat_message.ts b/packages/status-communities/src/wire/chat_message.ts similarity index 96% rename from packages/status-communities/src/chat_message.ts rename to packages/status-communities/src/wire/chat_message.ts index 65148a34..01c3beaf 100644 --- a/packages/status-communities/src/chat_message.ts +++ b/packages/status-communities/src/wire/chat_message.ts @@ -1,14 +1,14 @@ import { Reader } from "protobufjs"; -import * as proto from "./proto/communities/v1/chat_message"; +import * as proto from "../proto/communities/v1/chat_message"; import { AudioMessage, AudioMessage_AudioType, ChatMessage_ContentType, ImageMessage, StickerMessage, -} from "./proto/communities/v1/chat_message"; -import { ImageType, MessageType } from "./proto/communities/v1/enums"; +} from "../proto/communities/v1/chat_message"; +import { ImageType, MessageType } from "../proto/communities/v1/enums"; export type Content = | TextContent