use crate::data::{Message, MsgId};
use identity::Identity;
use netmod::Recipient;
use serde::{Deserialize, Serialize};
const ASSOCIATOR: &'static str = ".internal";
#[derive(Serialize, Deserialize)]
pub(crate) enum ProtoPayload {
Announce { id: Identity, no_sync: bool },
Sync { id: Identity, table: Vec<Identity> },
}
pub struct Protocol;
impl Protocol {
pub fn announce(sender: Identity) -> Message {
Message::build_signed(
MsgId([0; 16]),
sender,
Recipient::Flood,
vec![0],
)
}
pub fn sync_rt(sender: Identity, recipient: Identity, _known: Vec<Identity>) -> Message {
Message::build_signed(
MsgId([0; 16]),
sender.clone(),
Recipient::User(recipient),
vec![0],
)
}
}