Clean up conversations with UUID as E164
This commit is contained in:
parent
a22dcc986f
commit
8951665554
4 changed files with 23 additions and 11 deletions
|
@ -13,6 +13,7 @@ import { SendOptionsType, CallbackResultType } from './textsecure/SendMessage';
|
|||
import { ConversationModel } from './models/conversations';
|
||||
import { maybeDeriveGroupV2Id } from './groups';
|
||||
import { assert } from './util/assert';
|
||||
import { isValidGuid } from './util/isValidGuid';
|
||||
import { map, reduce } from './util/iterables';
|
||||
import { isGroupV1, isGroupV2 } from './util/whatTypeOfConversation';
|
||||
import { deprecated } from './util/deprecated';
|
||||
|
@ -843,6 +844,18 @@ export class ConversationController {
|
|||
});
|
||||
updateConversation(conversation.attributes);
|
||||
}
|
||||
|
||||
// Clean up the conversations that have UUID as their e164.
|
||||
const e164 = conversation.get('e164');
|
||||
const uuid = conversation.get('uuid');
|
||||
if (isValidGuid(e164) && uuid) {
|
||||
conversation.set({ e164: undefined });
|
||||
updateConversation(conversation.attributes);
|
||||
|
||||
window.log.info(
|
||||
`Cleaning up conversation(${uuid}) with invalid e164`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
window.log.error(
|
||||
'ConversationController.load/map: Failed to prepare a conversation',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue