Merge pull request #2 from BeaudanBrown/public-incoming

Public outgoing
pull/539/head
Ryan Tharp 6 years ago committed by GitHub
commit 0825181cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1441,7 +1441,8 @@
return handleProfileUpdate({ data, confirm, messageDescriptor });
}
const ourNumber = textsecure.storage.user.getNumber();
const primaryDeviceKey = window.storage.get('primaryDevicePubKey');
const allOurDevices = await libloki.storage.getAllDevicePubKeysForPrimaryPubKey(primaryDeviceKey);
const descriptorId = await textsecure.MessageReceiver.arrayBufferToString(
messageDescriptor.id
);
@ -1449,7 +1450,7 @@
if (
messageDescriptor.type === 'group' &&
descriptorId.match(/^publicChat:/) &&
data.source === ourNumber
allOurDevices.includes(data.source)
) {
// Public chat messages from ourselves should be outgoing
message = await createSentMessage(data);

@ -1270,7 +1270,11 @@
this.trigger('sent', this);
if (this.get('type') !== 'friend-request') {
this.sendSyncMessage();
const c = this.getConversation();
// Don't bother sending sync messages to public chats
if (!c.isPublic()) {
this.sendSyncMessage();
}
}
})
.catch(result => {

Loading…
Cancel
Save