Expose leave chat to iOS bridge
This commit is contained in:
@@ -249,6 +249,10 @@ impl<C: TdClientTrait> CoreSession<C> {
|
||||
Ok(profile)
|
||||
}
|
||||
|
||||
pub async fn leave_chat(&mut self, chat_id: ChatId) -> Result<(), String> {
|
||||
self.client.leave_chat(chat_id).await
|
||||
}
|
||||
|
||||
pub async fn set_draft(&mut self, chat_id: ChatId, text: String) -> Result<(), String> {
|
||||
self.client.set_draft_message(chat_id, text.clone()).await?;
|
||||
self.enqueue_event(CoreEvent::DraftChanged(CoreDraft { chat_id, text }));
|
||||
@@ -851,6 +855,7 @@ mod tests {
|
||||
session.emit_auth_state();
|
||||
session.emit_network_state();
|
||||
let loaded_profile = session.open_profile(ChatId::new(42)).await.unwrap();
|
||||
session.leave_chat(ChatId::new(42)).await.unwrap();
|
||||
session
|
||||
.set_draft(ChatId::new(42), "Later".to_string())
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user