From aeda628a22fb92342e3b4d87253fbf184792025a Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Thu, 3 Feb 2022 08:16:59 -0500 Subject: [PATCH] PR comments --- src/messaging/ExchangeContext.cpp | 4 ++-- src/messaging/ExchangeMessageDispatch.cpp | 4 ++-- src/messaging/ExchangeMessageDispatch.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 22436a62f3d195..a47ac0be1ce465 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -437,8 +437,8 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload MessageHandled(); }); - ReturnErrorOnFailure(mDispatch.OnMessageReceived(messageCounter, payloadHeader, peerAddress, msgFlags, - GetReliableMessageContext(), IsGroupExchangeContext())); + ReturnErrorOnFailure( + mDispatch.OnMessageReceived(messageCounter, payloadHeader, peerAddress, msgFlags, GetReliableMessageContext())); if (IsAckPending() && !mDelegate) { diff --git a/src/messaging/ExchangeMessageDispatch.cpp b/src/messaging/ExchangeMessageDispatch.cpp index 67612acc78c6b6..7ca2e5b59901c9 100644 --- a/src/messaging/ExchangeMessageDispatch.cpp +++ b/src/messaging/ExchangeMessageDispatch.cpp @@ -115,12 +115,12 @@ CHIP_ERROR ExchangeMessageDispatch::SendMessage(SessionManager * sessionManager, CHIP_ERROR ExchangeMessageDispatch::OnMessageReceived(uint32_t messageCounter, const PayloadHeader & payloadHeader, const Transport::PeerAddress & peerAddress, MessageFlags msgFlags, - ReliableMessageContext * reliableMessageContext, bool isGroupMessage) + ReliableMessageContext * reliableMessageContext) { ReturnErrorCodeIf(!MessagePermitted(payloadHeader.GetProtocolID().GetProtocolId(), payloadHeader.GetMessageType()), CHIP_ERROR_INVALID_ARGUMENT); - if (IsReliableTransmissionAllowed() && !isGroupMessage) + if (IsReliableTransmissionAllowed() && !reliableMessageContext->GetExchangeContext()->IsGroupExchangeContext()) { if (!msgFlags.Has(MessageFlagValues::kDuplicateMessage) && payloadHeader.IsAckMsg() && payloadHeader.GetAckMessageCounter().HasValue()) diff --git a/src/messaging/ExchangeMessageDispatch.h b/src/messaging/ExchangeMessageDispatch.h index 085263f64808bf..464387f4e05ff9 100644 --- a/src/messaging/ExchangeMessageDispatch.h +++ b/src/messaging/ExchangeMessageDispatch.h @@ -44,7 +44,7 @@ class ExchangeMessageDispatch uint8_t type, System::PacketBufferHandle && message); CHIP_ERROR OnMessageReceived(uint32_t messageCounter, const PayloadHeader & payloadHeader, const Transport::PeerAddress & peerAddress, MessageFlags msgFlags, - ReliableMessageContext * reliableMessageContext, bool isGroupMessage); + ReliableMessageContext * reliableMessageContext); protected: virtual bool MessagePermitted(uint16_t protocol, uint8_t type) = 0;