Expose leave chat to iOS bridge
This commit is contained in:
@@ -12,6 +12,7 @@ public protocol SessionBridge: Sendable {
|
||||
func loadHistory(chatId: Int64) async throws -> [Message]
|
||||
func searchMessages(chatId: Int64, query: String) async throws -> [Message]
|
||||
func openProfile(chatId: Int64) async throws -> Profile
|
||||
func leaveChat(chatId: Int64) async throws
|
||||
func sendMessage(chatId: Int64, text: String, replyToMessageId: Int64?) async throws -> Message
|
||||
func editMessage(chatId: Int64, messageId: Int64, text: String) async throws -> Message
|
||||
func deleteMessages(chatId: Int64, messageIds: [Int64]) async throws
|
||||
@@ -132,6 +133,12 @@ public actor FakeSessionBridge: SessionBridge {
|
||||
return profile
|
||||
}
|
||||
|
||||
public func leaveChat(chatId: Int64) async throws {
|
||||
chats.removeAll { $0.id == chatId }
|
||||
messages.removeValue(forKey: chatId)
|
||||
events.append(.chatListChanged(chats))
|
||||
}
|
||||
|
||||
public func sendMessage(chatId: Int64, text: String, replyToMessageId: Int64?) async throws -> Message {
|
||||
let message = Message(
|
||||
id: nextMessageId,
|
||||
|
||||
Reference in New Issue
Block a user