Allow adding to a group by phone number

This commit is contained in:
Fedor Indutny 2022-04-04 17:38:22 -07:00 committed by GitHub
parent 76a1a805ef
commit 9568d5792e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 1842 additions and 693 deletions

View file

@ -5,6 +5,7 @@ import * as Backbone from 'backbone';
import * as log from '../logging/log';
import type { ConversationModel } from '../models/conversations';
import { showToast } from '../util/showToast';
import { strictAssert } from '../util/assert';
import { ToastStickerPackInstallFailed } from '../components/ToastStickerPackInstallFailed';
window.Whisper = window.Whisper || {};
@ -115,26 +116,19 @@ Whisper.InboxView = Whisper.View.extend({
this.conversation_stack.unload();
});
window.Whisper.events.on(
'showConversation',
async (id, messageId, username) => {
const conversation =
await window.ConversationController.getOrCreateAndWait(
id,
'private',
{ username }
);
window.Whisper.events.on('showConversation', (id, messageId) => {
const conversation = window.ConversationController.get(id);
strictAssert(conversation, 'Conversation must be found');
conversation.setMarkedUnread(false);
conversation.setMarkedUnread(false);
const { openConversationExternal } = window.reduxActions.conversations;
if (openConversationExternal) {
openConversationExternal(conversation.id, messageId);
}
this.conversation_stack.open(conversation, messageId);
const { openConversationExternal } = window.reduxActions.conversations;
if (openConversationExternal) {
openConversationExternal(conversation.id, messageId);
}
);
this.conversation_stack.open(conversation, messageId);
});
window.Whisper.events.on('loadingProgress', count => {
const view = this.appLoadingScreen;