fixed file server holding up message sender init.

fix joining closed groups.
This commit is contained in:
Mikunj Varsani 2020-02-06 14:36:58 +11:00
parent 38745b2537
commit 75660c7269
2 changed files with 19 additions and 3 deletions

View file

@ -238,6 +238,18 @@
specialConvInited = true;
};
const initLokiMessageAPIs = () => {
const ourKey = textsecure.storage.user.getNumber();
if (!window.lokiMessageAPI) {
window.lokiMessageAPI = new window.LokiMessageAPI(ourKey);
}
if (!window.lokiPublicChatAPI) {
// singleton to relay events to libtextsecure/message_receiver
window.lokiPublicChatAPI = new window.LokiPublicChatAPI(ourKey);
}
};
const initAPIs = async () => {
if (window.initialisedAPI) {
return;
@ -1488,8 +1500,8 @@
return;
}
await initAPIs();
await initSpecialConversations();
initLokiMessageAPIs();
messageReceiver = new textsecure.MessageReceiver(
USERNAME,
PASSWORD,
@ -1525,6 +1537,9 @@
PASSWORD
);
await initAPIs();
await initSpecialConversations();
// On startup after upgrading to a new version, request a contact sync
// (but only if we're not the primary device)
if (

View file

@ -406,7 +406,8 @@ export class LeftPaneChannelSection extends React.Component<Props, State> {
return;
}
await window.doCreateGroup(groupName, groupMembers);
const groupMemberIds = groupMembers.map(m => m.id);
await window.doCreateGroup(groupName, groupMemberIds);
this.handleToggleOverlay(undefined);
window.pushToast({