aboutsummaryrefslogtreecommitdiff
path: root/src/utils/messages.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/messages.ts')
-rw-r--r--src/utils/messages.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/utils/messages.ts b/src/utils/messages.ts
index 49033226..dd29f317 100644
--- a/src/utils/messages.ts
+++ b/src/utils/messages.ts
@@ -123,3 +123,20 @@ export const getChatToken = async () => {
console.log(err);
}
};
+
+export const createChannel = async (
+ loggedInUser: string,
+ id: string,
+ chatClient: any,
+) => {
+ try {
+ const channel = chatClient.channel('messaging', {
+ members: [loggedInUser, id],
+ });
+ await channel.watch();
+ return channel;
+ } catch (error) {
+ console.log(error);
+ throw error;
+ }
+};