Fix messages from secondary device not being mapped correctly to their primary device.

Fix creating closed groups from secondary device.
Fix primary device showing up in create group dialog.
pull/834/head
Mikunj Varsani 5 years ago
parent 746456200a
commit e1d06fc9be

@ -763,9 +763,10 @@
const ev = new Event('group');
const ourKey = textsecure.storage.user.getNumber();
const allMembers = [ourKey, ...members];
const primaryDeviceKey =
window.storage.get('primaryDevicePubKey') ||
textsecure.storage.user.getNumber();
const allMembers = [primaryDeviceKey, ...members];
ev.groupDetails = {
id: groupId,
@ -794,7 +795,7 @@
window.friends.friendRequestStatusEnum.friends
);
convo.updateGroupAdmins([ourKey]);
convo.updateGroupAdmins([primaryDeviceKey]);
appView.openConversation(groupId, {});
};

@ -2361,6 +2361,12 @@
await sendingDeviceConversation.onFriendRequestAccepted();
}
}
// We need to map the original message source to the primary device
if (source !== ourNumber) {
message.set({ source: primarySource });
}
const id = await window.Signal.Data.saveMessage(message.attributes, {
Message: Whisper.Message,
});

@ -55,8 +55,10 @@ export class SessionClosableOverlay extends React.Component<Props, State> {
const conversations = window.getConversations() || [];
const conversationList = conversations.filter((conversation: any) => {
// TODO: We need to handle the case with > 1 secondary device
const isOurDevice = conversation.isMe() || conversation.isOurConversation();
return (
!conversation.isOurConversation() &&
!isOurDevice&&
conversation.isPrivate() &&
!conversation.isSecondaryDevice() &&
conversation.isFriend()

Loading…
Cancel
Save