"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ts/ConversationController.ts" between
Signal-Desktop-1.35.2.tar.gz and Signal-Desktop-1.36.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

ConversationController.ts  (Signal-Desktop-1.35.2):ConversationController.ts  (Signal-Desktop-1.36.1)
skipping to change at line 220 skipping to change at line 220
const [id] = window.textsecure.utils.unencodeNumber(address); const [id] = window.textsecure.utils.unencodeNumber(address);
const conv = this.get(id); const conv = this.get(id);
if (conv) { if (conv) {
return conv.get('id'); return conv.get('id');
} }
return null; return null;
} }
getOurConversationId() { getOurConversationId(): string | undefined {
const e164 = window.textsecure.storage.user.getNumber(); const e164 = window.textsecure.storage.user.getNumber();
const uuid = window.textsecure.storage.user.getUuid(); const uuid = window.textsecure.storage.user.getUuid();
return this.ensureContactIds({ e164, uuid, highTrust: true }); return this.ensureContactIds({ e164, uuid, highTrust: true });
} }
/** /**
* Given a UUID and/or an E164, resolves to a string representing the local * Given a UUID and/or an E164, resolves to a string representing the local
* database id of the given contact. In high trust mode, it may create new con tacts, * database id of the given contact. In high trust mode, it may create new con tacts,
* and it may merge contacts. * and it may merge contacts.
* *
* highTrust = uuid/e164 pairing came from CDS, the server, or your own device * highTrust = uuid/e164 pairing came from CDS, the server, or your own device
*/ */
// tslint:disable-next-line cyclomatic-complexity max-func-body-length // tslint:disable-next-line cyclomatic-complexity max-func-body-length
ensureContactIds({ ensureContactIds({
e164, e164,
uuid, uuid,
highTrust, highTrust,
}: { }: {
e164?: string; e164?: string;
uuid?: string; uuid?: string;
highTrust?: boolean; highTrust?: boolean;
}) { }): string | undefined {
// Check for at least one parameter being provided. This is necessary // Check for at least one parameter being provided. This is necessary
// because this path can be called on startup to resolve our own ID before // because this path can be called on startup to resolve our own ID before
// our phone number or UUID are known. The existing behavior in these // our phone number or UUID are known. The existing behavior in these
// cases can handle a returned `undefined` id, so we do that. // cases can handle a returned `undefined` id, so we do that.
const normalizedUuid = uuid ? uuid.toLowerCase() : undefined; const normalizedUuid = uuid ? uuid.toLowerCase() : undefined;
const identifier = normalizedUuid || e164; const identifier = normalizedUuid || e164;
if ((!e164 && !uuid) || !identifier) { if ((!e164 && !uuid) || !identifier) {
return undefined; return undefined;
} }
skipping to change at line 549 skipping to change at line 549
window.log.warn('combineContacts: Complete!', { window.log.warn('combineContacts: Complete!', {
obsolete: obsoleteId, obsolete: obsoleteId,
current: currentId, current: currentId,
}); });
} }
/** /**
* Given a groupId and optional additional initialization properties, * Given a groupId and optional additional initialization properties,
* ensures the existence of a group conversation and returns a string * ensures the existence of a group conversation and returns a string
* representing the local database ID of the group conversation. * representing the local database ID of the group conversation.
*/ */
ensureGroup(groupId: string, additionalInitProps = {}) { ensureGroup(groupId: string, additionalInitProps = {}): string {
return this.getOrCreate(groupId, 'group', additionalInitProps).get('id'); return this.getOrCreate(groupId, 'group', additionalInitProps).get('id');
} }
/** /**
* Given certain metadata about a message (an identifier of who wrote the * Given certain metadata about a message (an identifier of who wrote the
* message and the sent_at timestamp of the message) returns the * message and the sent_at timestamp of the message) returns the
* conversation the message belongs to OR null if a conversation isn't * conversation the message belongs to OR null if a conversation isn't
* found. * found.
*/ */
async getConversationForTargetMessage( async getConversationForTargetMessage(
targetFromId: string, targetFromId: string,
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)