From 59f802d3857b11dff5812f19dec521922a08e104 Mon Sep 17 00:00:00 2001 From: fmodf Date: Tue, 30 Jul 2024 11:26:30 +0200 Subject: [PATCH] wip --- .../AppCore/Database/Database+Martin.swift | 2 ++ .../AppCore/Database/Database+Migrations.swift | 12 ++++++------ ConversationsClassic/AppCore/XMPP/XMPPService.swift | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ConversationsClassic/AppCore/Database/Database+Martin.swift b/ConversationsClassic/AppCore/Database/Database+Martin.swift index 3a52e93..d463018 100644 --- a/ConversationsClassic/AppCore/Database/Database+Martin.swift +++ b/ConversationsClassic/AppCore/Database/Database+Martin.swift @@ -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) { diff --git a/ConversationsClassic/AppCore/Database/Database+Migrations.swift b/ConversationsClassic/AppCore/Database/Database+Migrations.swift index d68af45..7c8b47d 100644 --- a/ConversationsClassic/AppCore/Database/Database+Migrations.swift +++ b/ConversationsClassic/AppCore/Database/Database+Migrations.swift @@ -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() // } } diff --git a/ConversationsClassic/AppCore/XMPP/XMPPService.swift b/ConversationsClassic/AppCore/XMPP/XMPPService.swift index 4f50cf1..8e20012 100644 --- a/ConversationsClassic/AppCore/XMPP/XMPPService.swift +++ b/ConversationsClassic/AppCore/XMPP/XMPPService.swift @@ -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