This commit is contained in:
fmodf 2024-07-30 11:26:30 +02:00
parent 77b9aa8d3a
commit 59f802d385
3 changed files with 12 additions and 10 deletions

View file

@ -2,6 +2,8 @@ import Foundation
import GRDB
import Martin
extension Database: MartinsManager {}
// MARK: - Martin's roster manager
extension Database: Martin.RosterManager {
func clear(for context: Martin.Context) {

View file

@ -68,16 +68,16 @@ extension Database {
// 2nd migration - channels/rooms
migrator.registerMigration("Add channels/rooms") { db in
// channels
try db.create(table: "channels", options: [.ifNotExists]) { table in
// rooms
try db.create(table: "rooms", options: [.ifNotExists]) { table in
table.column("id", .text).notNull().primaryKey().unique(onConflict: .replace)
table.column("account", .text).notNull()
table.column("channel", .text).notNull()
}
// rooms
// try db.create(table: "rooms", options: [.ifNotExists]) { table in
// channels
// try db.create(table: "channels", options: [.ifNotExists]) { table in
// table.column("id", .text).notNull().primaryKey().unique(onConflict: .replace)
// table.column("account", .text).notNull()
// table.column("channel", .text).notNull()
// }
}

View file

@ -133,11 +133,11 @@ final class XMPPService: ObservableObject {
client.connectionConfiguration.userJid = .init(account.bareJid)
client.connectionConfiguration.credentials = .password(password: account.pass)
// channels
client.modulesManager.register(MixModule(channelManager: manager))
// group chats
// client.modulesManager.register(MucModule(roomManager: manager))
client.modulesManager.register(MucModule(roomManager: manager))
// channels
// client.modulesManager.register(MixModule(channelManager: manager))
// add client to clients
return client