mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 05:56:31 +03:00
Make ContactId::LAST_SPECIAL private
Also remove the Ord implementations, this makes ContactId more opaque by no longer letting people deal with the fact this is ordered.
This commit is contained in:
@@ -310,7 +310,7 @@ pub(crate) async fn handle_securejoin_handshake(
|
||||
mime_message: &MimeMessage,
|
||||
contact_id: ContactId,
|
||||
) -> Result<HandshakeMessage> {
|
||||
if contact_id <= ContactId::LAST_SPECIAL {
|
||||
if contact_id.is_special() {
|
||||
return Err(Error::msg("Can not be called with special contact ID"));
|
||||
}
|
||||
let step = mime_message
|
||||
@@ -573,7 +573,7 @@ pub(crate) async fn observe_securejoin_on_other_device(
|
||||
mime_message: &MimeMessage,
|
||||
contact_id: ContactId,
|
||||
) -> Result<HandshakeMessage> {
|
||||
if contact_id <= ContactId::LAST_SPECIAL {
|
||||
if contact_id.is_special() {
|
||||
return Err(Error::msg("Can not be called with special contact ID"));
|
||||
}
|
||||
let step = mime_message
|
||||
|
||||
Reference in New Issue
Block a user