2022-02-22 20:34:57 +00:00
|
|
|
// Copyright 2020-2022 Signal Messenger, LLC
|
2021-07-21 20:45:41 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-09-17 18:27:53 +00:00
|
|
|
import * as log from '../logging/log';
|
2022-07-14 00:46:46 +00:00
|
|
|
import { profileService } from '../services/profiles';
|
2022-03-09 20:23:21 +00:00
|
|
|
|
2022-08-09 21:39:00 +00:00
|
|
|
export async function getProfile(uuid?: string, e164?: string): Promise<void> {
|
|
|
|
const c = window.ConversationController.lookupOrCreate({
|
|
|
|
uuid,
|
|
|
|
e164,
|
2022-12-03 01:05:27 +00:00
|
|
|
reason: 'getProfile',
|
2022-03-09 20:23:21 +00:00
|
|
|
});
|
|
|
|
if (!c) {
|
|
|
|
log.error('getProfile: failed to find conversation; doing nothing');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-07-14 00:46:46 +00:00
|
|
|
return profileService.get(c.id);
|
2022-03-09 20:23:21 +00:00
|
|
|
}
|