wip
This commit is contained in:
parent
77b9aa8d3a
commit
59f802d385
|
@ -2,6 +2,8 @@ import Foundation
|
||||||
import GRDB
|
import GRDB
|
||||||
import Martin
|
import Martin
|
||||||
|
|
||||||
|
extension Database: MartinsManager {}
|
||||||
|
|
||||||
// MARK: - Martin's roster manager
|
// MARK: - Martin's roster manager
|
||||||
extension Database: Martin.RosterManager {
|
extension Database: Martin.RosterManager {
|
||||||
func clear(for context: Martin.Context) {
|
func clear(for context: Martin.Context) {
|
||||||
|
|
|
@ -68,16 +68,16 @@ extension Database {
|
||||||
|
|
||||||
// 2nd migration - channels/rooms
|
// 2nd migration - channels/rooms
|
||||||
migrator.registerMigration("Add channels/rooms") { db in
|
migrator.registerMigration("Add channels/rooms") { db in
|
||||||
// channels
|
// rooms
|
||||||
try db.create(table: "channels", options: [.ifNotExists]) { table in
|
try db.create(table: "rooms", options: [.ifNotExists]) { table in
|
||||||
table.column("id", .text).notNull().primaryKey().unique(onConflict: .replace)
|
table.column("id", .text).notNull().primaryKey().unique(onConflict: .replace)
|
||||||
table.column("account", .text).notNull()
|
|
||||||
table.column("channel", .text).notNull()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// rooms
|
// channels
|
||||||
// try db.create(table: "rooms", options: [.ifNotExists]) { table in
|
// try db.create(table: "channels", options: [.ifNotExists]) { table in
|
||||||
// table.column("id", .text).notNull().primaryKey().unique(onConflict: .replace)
|
// table.column("id", .text).notNull().primaryKey().unique(onConflict: .replace)
|
||||||
|
// table.column("account", .text).notNull()
|
||||||
|
// table.column("channel", .text).notNull()
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,11 +133,11 @@ final class XMPPService: ObservableObject {
|
||||||
client.connectionConfiguration.userJid = .init(account.bareJid)
|
client.connectionConfiguration.userJid = .init(account.bareJid)
|
||||||
client.connectionConfiguration.credentials = .password(password: account.pass)
|
client.connectionConfiguration.credentials = .password(password: account.pass)
|
||||||
|
|
||||||
// channels
|
|
||||||
client.modulesManager.register(MixModule(channelManager: manager))
|
|
||||||
|
|
||||||
// group chats
|
// 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
|
// add client to clients
|
||||||
return client
|
return client
|
||||||
|
|
Loading…
Reference in a new issue