Group Blocking: Allow group metadata messages from own devices

This commit is contained in:
Scott Nonnenberg 2018-09-17 12:18:18 -07:00
parent 9c399624cc
commit c2e0ec5636
1 changed files with 10 additions and 2 deletions

View File

@ -728,7 +728,11 @@ MessageReceiver.prototype.extend({
return p.then(() =>
this.processDecrypted(envelope, msg, this.number).then(message => {
const groupId = message.group && message.group.id;
if (groupId && this.isGroupBlocked(groupId)) {
const isBlocked = this.isGroupBlocked(groupId);
const isMe = envelope.source === textsecure.storage.user.getNumber();
const hasGroupMetadata = Boolean(message.group);
if (groupId && isBlocked && !(isMe && hasGroupMetadata)) {
window.log.warn(
`Message ${this.getEnvelopeId(
envelope
@ -762,7 +766,11 @@ MessageReceiver.prototype.extend({
return p.then(() =>
this.processDecrypted(envelope, msg, envelope.source).then(message => {
const groupId = message.group && message.group.id;
if (groupId && this.isGroupBlocked(groupId)) {
const isBlocked = this.isGroupBlocked(groupId);
const isMe = envelope.source === textsecure.storage.user.getNumber();
const hasGroupMetadata = Boolean(message.group);
if (groupId && isBlocked && !(isMe && hasGroupMetadata)) {
window.log.warn(
`Message ${this.getEnvelopeId(
envelope