Receive a message using the `receive_imf()` pipeline. Panics if it's not shown in the chat as exactly one message.
(&self, msg: &SentMessage<'_>)
| 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 { |
no test coverage detected