Skip to content

Commit

Permalink
Simplify flow chart
Browse files Browse the repository at this point in the history
  • Loading branch information
andybalaam committed Dec 13, 2024
1 parent 0542c05 commit 68cc73e
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions crates/matrix-sdk-crypto/src/types/events/utd_cause.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,24 +196,22 @@ impl UtdCause {
* Below is the flow chart we follow for deciding whether historical
* UTDs are expected. This function starts at position `B`.
*
* ```mermaid
* flowchart TD
* A{Is the message newer than the device?}
* A -- No --> B
* A -- Yes --> X
* B{Is there a backup on the server?}
* B -- No --> Y
* B -- Yes --> C
* C{Is backup working on this device?}
* C -- No --> D
* C -- Yes --> X
* D{Is this device verified?}
* D -- No --> Z
* D -- Yes --> X
* ```text
* A: Is the message newer than the device?
* No -> B
* Yes - Normal UTD error
*
* X([Normal UTD error])
* Y([History is not available on this device])
* Z([You need to verify this device])
* B: Is there a backup on the server?
* No -> History is not available on this device
* Yes -> C
*
* C: Is backup working on this device?
* No -> D
* Yes -> Normal UTD error
*
* D: Is this device verified?
* No -> You need to verify this device
* Yes -> Normal UTD error
* ```
*/
fn determine_historical(crypto_context_info: CryptoContextInfo) -> UtdCause {
Expand Down

0 comments on commit 68cc73e

Please sign in to comment.