Page MenuHomePhabricator

[CommCoreModule] Simplify `matchesInboundSession` return logic
ClosedPublic

Authored by atul on Feb 23 2022, 9:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 22, 1:20 AM
Unknown Object (File)
Tue, Oct 22, 1:20 AM
Unknown Object (File)
Tue, Oct 22, 1:16 AM
Unknown Object (File)
Tue, Oct 22, 12:20 AM
Unknown Object (File)
Sep 20 2024, 1:47 AM
Unknown Object (File)
Sep 20 2024, 1:47 AM
Unknown Object (File)
Sep 14 2024, 4:50 PM
Unknown Object (File)
Sep 13 2024, 8:35 AM

Details

Summary

Minor thing I noticed when working in CryptoModule.cpp

Test Plan

Close reading.. logic should be identical

Diff Detail

Repository
rCOMM Comm
Branch
february23 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

atul published this revision for review.Feb 23 2022, 9:51 AM
tomek added inline comments.
native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp
180–185

I was wondering if we can just return the result of this function, but it looks https://matrix-client.dpldocs.info/matrix.olm.olm_matches_inbound_session_from.html like value > 1 mean error.

Returns 1 if the session matches. Returns 0 if the session * does not match. Returns olm_error() on failure.

This revision is now accepted and ready to land.Feb 23 2022, 10:25 AM
This revision now requires review to proceed.Feb 23 2022, 10:25 AM
ashoat added inline comments.
native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp
180–185

Thanks for sharing your research, @palys-swm – I had the same thought

This revision is now accepted and ready to land.Feb 23 2022, 11:44 AM