mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
Adding conditional to prevent adding multiple approval sync messages for the acceptor of the request.
This commit is contained in:
parent
2b84a53959
commit
ba30dc57c2
|
@ -141,18 +141,20 @@ const handleContactReceived = async (
|
|||
}
|
||||
|
||||
if (contactReceived.isApproved === true) {
|
||||
// checking for existence of field on protobuf
|
||||
await contactConvo.setIsApproved(Boolean(contactReceived.isApproved));
|
||||
// TODO: add message search in convo for pre-existing msgRequestResponse msg only happens once per convo
|
||||
await contactConvo.addSingleOutgoingMessage({
|
||||
sent_at: _.toNumber(envelope.timestamp),
|
||||
messageRequestResponse: {
|
||||
isApproved: 1,
|
||||
},
|
||||
unread: 1, // 1 means unread
|
||||
expireTimer: 0,
|
||||
});
|
||||
contactConvo.updateLastMessage();
|
||||
if (!contactConvo.isApproved()) {
|
||||
// checking for existence of field on protobuf
|
||||
await contactConvo.setIsApproved(Boolean(contactReceived.isApproved));
|
||||
// TODO: add message search in convo for pre-existing msgRequestResponse msg only happens once per convo
|
||||
await contactConvo.addSingleOutgoingMessage({
|
||||
sent_at: _.toNumber(envelope.timestamp),
|
||||
messageRequestResponse: {
|
||||
isApproved: 1,
|
||||
},
|
||||
unread: 1, // 1 means unread
|
||||
expireTimer: 0,
|
||||
});
|
||||
contactConvo.updateLastMessage();
|
||||
}
|
||||
|
||||
if (contactReceived.didApproveMe === true) {
|
||||
// checking for existence of field on message
|
||||
|
|
Loading…
Reference in a new issue