mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
OpenGrop joining
This commit is contained in:
parent
54209e98a8
commit
ab966e600a
1 changed files with 6 additions and 2 deletions
|
@ -83,6 +83,7 @@ export class OpenGroup {
|
|||
}
|
||||
|
||||
public static async join(server: string): Promise<OpenGroup | undefined> {
|
||||
const prefixedServer = OpenGroup.prefixify(server);
|
||||
if (!OpenGroup.validate(server)) {
|
||||
return;
|
||||
}
|
||||
|
@ -90,17 +91,20 @@ export class OpenGroup {
|
|||
// Make this not hard coded
|
||||
const channel = 1;
|
||||
let conversation;
|
||||
let conversationId;
|
||||
try {
|
||||
conversation = await window.attemptConnection(server, channel);
|
||||
conversation = await window.attemptConnection(prefixedServer, channel);
|
||||
conversationId = conversation?.cid;
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
return;
|
||||
}
|
||||
|
||||
// Do we want to add conversation as a property of OpenGroup?
|
||||
return new OpenGroup({
|
||||
server,
|
||||
channel,
|
||||
conversationId: conversation?.cid,
|
||||
conversationId,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue