refactor: use system timezone and harden client APIs
This commit is contained in:
@@ -313,11 +313,11 @@ impl TdClientTrait for FakeTdClient {
|
||||
// Not implemented
|
||||
}
|
||||
|
||||
fn pending_view_messages_mut(&mut self) -> &mut Vec<(ChatId, Vec<MessageId>)> {
|
||||
// WORKAROUND: Возвращаем мутабельную ссылку через leak
|
||||
// Это безопасно так как мы единственные владельцы &mut self
|
||||
let guard = self.pending_view_messages.lock().unwrap();
|
||||
unsafe { &mut *(guard.as_ptr() as *mut Vec<(ChatId, Vec<MessageId>)>) }
|
||||
fn enqueue_pending_view_messages(&mut self, chat_id: ChatId, message_ids: Vec<MessageId>) {
|
||||
self.pending_view_messages
|
||||
.lock()
|
||||
.unwrap()
|
||||
.push((chat_id, message_ids));
|
||||
}
|
||||
|
||||
fn pending_user_ids_mut(&mut self) -> &mut Vec<UserId> {
|
||||
@@ -333,6 +333,10 @@ impl TdClientTrait for FakeTdClient {
|
||||
}
|
||||
|
||||
// ============ Notification methods ============
|
||||
fn configure_notifications(&mut self, _config: &tele_tui::config::NotificationsConfig) {
|
||||
// Not implemented for fake client (notifications are not tested)
|
||||
}
|
||||
|
||||
fn sync_notification_muted_chats(&mut self) {
|
||||
// Not implemented for fake client (notifications are not tested)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user