remove getSendOptions and getNumberInfo()

pull/1197/head
Audric Ackermann 5 years ago
parent cae608fd01
commit cfd76587f6
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -206,12 +206,10 @@
);
});
},
prepareForSend(id, options) {
prepareForSend(id) {
// id is either a group id or an individual user's id
const conversation = this.get(id);
const sendOptions = conversation
? conversation.getSendOptions(options)
: null;
const sendOptions = {};
const wrap = conversation
? conversation.wrapSend.bind(conversation)
: promise => promise;

@ -1531,78 +1531,6 @@
);
},
getSendOptions(options = {}) {
const senderCertificate = storage.get('senderCertificate');
const numberInfo = this.getNumberInfo(options);
return {
senderCertificate,
numberInfo,
};
},
getNumberInfo(options = {}) {
const { syncMessage, disableMeCheck } = options;
if (!this.ourNumber) {
return null;
}
// START: this code has an Expiration date of ~2018/11/21
// We don't want to enable unidentified delivery for send unless it is
// also enabled for our own account.
const me = ConversationController.getOrCreate(this.ourNumber, 'private');
if (
!disableMeCheck &&
me.get('sealedSender') === SEALED_SENDER.DISABLED
) {
return null;
}
// END
if (!this.isPrivate()) {
const infoArray = this.contactCollection.map(conversation =>
conversation.getNumberInfo(options)
);
return Object.assign({}, ...infoArray);
}
const accessKey = this.get('accessKey');
const sealedSender = this.get('sealedSender');
// We never send sync messages as sealed sender
if (syncMessage && this.id === this.ourNumber) {
return null;
}
// If we've never fetched user's profile, we default to what we have
if (sealedSender === SEALED_SENDER.UNKNOWN) {
return {
[this.id]: {
accessKey:
accessKey ||
window.Signal.Crypto.arrayBufferToBase64(
window.Signal.Crypto.getRandomBytes(16)
),
},
};
}
if (sealedSender === SEALED_SENDER.DISABLED) {
return null;
}
return {
[this.id]: {
accessKey:
accessKey && sealedSender === SEALED_SENDER.ENABLED
? accessKey
: window.Signal.Crypto.arrayBufferToBase64(
window.Signal.Crypto.getRandomBytes(16)
),
},
};
},
async updateSwarmNodes(swarmNodes) {
this.set({ swarmNodes });
await window.Signal.Data.updateConversation(this.id, this.attributes, {

Loading…
Cancel
Save