Rename subscribe to add_{message,request}_handler in Client

This makes it easier to distinguish between messages and requests.
This commit is contained in:
Antonio Scandurra 2022-02-14 09:25:31 +01:00
parent 6a6cd68df4
commit 1aff42302c
4 changed files with 52 additions and 39 deletions

View file

@ -58,7 +58,7 @@ impl UserStore {
let (mut current_user_tx, current_user_rx) = watch::channel();
let (mut update_contacts_tx, mut update_contacts_rx) =
watch::channel::<Option<proto::UpdateContacts>>();
let update_contacts_subscription = client.subscribe(
let update_contacts_subscription = client.add_message_handler(
cx,
move |_: ModelHandle<Self>, msg: TypedEnvelope<proto::UpdateContacts>, _, _| {
*update_contacts_tx.borrow_mut() = Some(msg.payload);