Files
chatmail-core/src
Floris Bruynooghe c82fdb9fa1 Refactor return values from secure-join message handling
This return value was very complicated to understand.  Some failure
returns were returned as Err and some as Ok with no consistency, but
resulting in the same behaviour.

This refactor makes the handle_securejoin_handshake the sole place
responsible for maintaining the state of the secure join
process (context.bob) and also in charge of terminating the ongoing
process.  This is none of receive_imf's business.

The remaining returns are now cleanly classified in application-errors
and protocol errors:

Applications errors result in an Err and mean there is a bug or
something else serious went wrong, like database access suddenly
failed or so.  In this case receive_imf is still responsible for
clearing the state and resetting ongoing-process.  It may be possible
this should still be moved back to securejoin.rs so that recieve_imf
doesn't need to know anything about this either.

Protocol errors are not failures for receive_imf, it just means the
received message didn't follow the protocol.  Receive_imf in this case
is told to ignore the message: that is hide it but not delete it.

Other Ok returns also only say what needs to happen to the message:

- It's fully processed and needs no further processing, instead should
  be removed

- It should still be processed as a normal received message.

This changes some behaviour: if the chat creation/lookup for the
contact fails this is treated as an application error.  Previously
this was silently ignored and send_msg() would be called with a 0
chat_id without checking the response.  This resulted in the protocol
quitely being blocked.

This all shhould now make it easier to resultify more of the functions
called by this function, instead of having to deal with very
complicated application logic hidden in the return code.
2020-01-13 20:46:58 +01:00
..
2020-01-09 12:17:17 +03:00
2019-12-07 21:35:42 +01:00
2020-01-12 09:12:24 +01:00
2019-12-19 12:06:01 +01:00
2020-01-01 20:53:31 +00:00
2019-12-29 18:58:49 +00:00
2019-12-28 14:35:14 +00:00
2019-12-13 01:17:48 +01:00
2020-01-08 19:00:45 +03:00
2019-12-06 10:35:02 +01:00
2020-01-12 09:02:30 +00:00
2019-12-28 14:35:14 +00:00
2019-12-13 11:03:46 +01:00
2020-01-13 01:43:27 +01:00
2019-12-14 22:00:38 +01:00
2019-12-20 12:55:57 +01:00
2019-12-15 19:55:49 +01:00
2019-11-16 13:53:47 +01:00