MCPcopy Create free account
hub / github.com/chatmail/core / recv_msg

Method recv_msg

src/test_utils.rs:803–820  ·  view source on GitHub ↗

Receive a message using the `receive_imf()` pipeline. Panics if it's not shown in the chat as exactly one message.

(&self, msg: &SentMessage<'_>)

Source from the content-addressed store, hash-verified

801 /// Receive a message using the `receive_imf()` pipeline. Panics if it's not shown
802 /// in the chat as exactly one message.
803 pub async fn recv_msg(&self, msg: &SentMessage<'_>) -> Message {
804 let received = self
805 .recv_msg_opt(msg)
806 .await
807 .expect("receive_imf() seems not to have added a new message to the db");
808
809 let msg = Message::load_from_db(self, *received.msg_ids.last().unwrap())
810 .await
811 .unwrap();
812
813 let chat_msgs = chat::get_chat_msgs(self, received.chat_id).await.unwrap();
814 assert!(
815 chat_msgs.contains(&ChatItem::Message { msg_id: msg.id }),
816 "received message is not shown in chat, maybe it's hidden"
817 );
818
819 msg
820 }
821
822 /// Receive a message using the `receive_imf()` pipeline. Panics if it's not hidden.
823 pub async fn recv_msg_hidden(&self, msg: &SentMessage<'_>) -> Message {

Callers 15

test_pqcFunction · 0.80
check_receiverFunction · 0.80
test_set_htmlFunction · 0.80
test_try_loadFunction · 0.80
try_send_recvMethod · 0.80
test_id_offsetFunction · 0.80
test_send_reactionFunction · 0.80

Calls 2

get_chat_msgsFunction · 0.85
recv_msg_optMethod · 0.80

Tested by

no test coverage detected