|
|
@ -929,33 +929,34 @@ MessageReceiver.prototype.extend({
|
|
|
|
await this.handleEndSession(destination);
|
|
|
|
await this.handleEndSession(destination);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (msg.mediumGroupUpdate) {
|
|
|
|
// if (msg.mediumGroupUpdate) {
|
|
|
|
await this.handleMediumGroupUpdate(envelope, msg.mediumGroupUpdate);
|
|
|
|
// await this.handleMediumGroupUpdate(envelope, msg.mediumGroupUpdate);
|
|
|
|
return;
|
|
|
|
// return;
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
const message = await this.processDecrypted(envelope, msg);
|
|
|
|
const message = await this.processDecrypted(envelope, msg);
|
|
|
|
|
|
|
|
|
|
|
|
const groupId = message.group && message.group.id;
|
|
|
|
|
|
|
|
const isBlocked = this.isGroupBlocked(groupId);
|
|
|
|
|
|
|
|
const primaryDevicePubKey = window.storage.get('primaryDevicePubKey');
|
|
|
|
const primaryDevicePubKey = window.storage.get('primaryDevicePubKey');
|
|
|
|
const isMe =
|
|
|
|
// const groupId = message.group && message.group.id;
|
|
|
|
envelope.source === textsecure.storage.user.getNumber() ||
|
|
|
|
// const isBlocked = this.isGroupBlocked(groupId);
|
|
|
|
envelope.source === primaryDevicePubKey;
|
|
|
|
//
|
|
|
|
const isLeavingGroup = Boolean(
|
|
|
|
// const isMe =
|
|
|
|
message.group &&
|
|
|
|
// envelope.source === textsecure.storage.user.getNumber() ||
|
|
|
|
message.group.type === textsecure.protobuf.GroupContext.Type.QUIT
|
|
|
|
// envelope.source === primaryDevicePubKey;
|
|
|
|
);
|
|
|
|
// const isLeavingGroup = Boolean(
|
|
|
|
|
|
|
|
// message.group &&
|
|
|
|
if (groupId && isBlocked && !(isMe && isLeavingGroup)) {
|
|
|
|
// message.group.type === textsecure.protobuf.GroupContext.Type.QUIT
|
|
|
|
window.log.warn(
|
|
|
|
// );
|
|
|
|
`Message ${this.getEnvelopeId(
|
|
|
|
|
|
|
|
envelope
|
|
|
|
// if (groupId && isBlocked && !(isMe && isLeavingGroup)) {
|
|
|
|
)} ignored; destined for blocked group`
|
|
|
|
// window.log.warn(
|
|
|
|
);
|
|
|
|
// `Message ${this.getEnvelopeId(
|
|
|
|
this.removeFromCache(envelope);
|
|
|
|
// envelope
|
|
|
|
return;
|
|
|
|
// )} ignored; destined for blocked group`
|
|
|
|
}
|
|
|
|
// );
|
|
|
|
|
|
|
|
// this.removeFromCache(envelope);
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// handle profileKey and avatar updates
|
|
|
|
// handle profileKey and avatar updates
|
|
|
|
if (envelope.source === primaryDevicePubKey) {
|
|
|
|
if (envelope.source === primaryDevicePubKey) {
|
|
|
|