Move NeoChatConnection and NeoChatRoom to LibNeoChat
Move `NeoChatConnection` and `NeoChatRoom` to `LibNeoChat` along with any required dependencies.
This commit is contained in:
@@ -12,14 +12,6 @@ add_subdirectory(libneochat)
|
|||||||
add_library(neochat STATIC
|
add_library(neochat STATIC
|
||||||
controller.cpp
|
controller.cpp
|
||||||
controller.h
|
controller.h
|
||||||
models/emojimodel.cpp
|
|
||||||
models/emojimodel.h
|
|
||||||
emojitones.cpp
|
|
||||||
emojitones.h
|
|
||||||
models/customemojimodel.cpp
|
|
||||||
models/customemojimodel.h
|
|
||||||
clipboard.cpp
|
|
||||||
clipboard.h
|
|
||||||
models/timelinemessagemodel.cpp
|
models/timelinemessagemodel.cpp
|
||||||
models/timelinemessagemodel.h
|
models/timelinemessagemodel.h
|
||||||
models/messagefiltermodel.cpp
|
models/messagefiltermodel.cpp
|
||||||
@@ -30,12 +22,8 @@ add_library(neochat STATIC
|
|||||||
models/sortfilterspacelistmodel.h
|
models/sortfilterspacelistmodel.h
|
||||||
models/accountemoticonmodel.cpp
|
models/accountemoticonmodel.cpp
|
||||||
models/accountemoticonmodel.h
|
models/accountemoticonmodel.h
|
||||||
spacehierarchycache.cpp
|
|
||||||
spacehierarchycache.h
|
|
||||||
roommanager.cpp
|
roommanager.cpp
|
||||||
roommanager.h
|
roommanager.h
|
||||||
neochatroom.cpp
|
|
||||||
neochatroom.h
|
|
||||||
models/userlistmodel.cpp
|
models/userlistmodel.cpp
|
||||||
models/userlistmodel.h
|
models/userlistmodel.h
|
||||||
models/userfiltermodel.cpp
|
models/userfiltermodel.cpp
|
||||||
@@ -77,38 +65,26 @@ add_library(neochat STATIC
|
|||||||
blurhashimageprovider.h
|
blurhashimageprovider.h
|
||||||
models/mediamessagefiltermodel.cpp
|
models/mediamessagefiltermodel.cpp
|
||||||
models/mediamessagefiltermodel.h
|
models/mediamessagefiltermodel.h
|
||||||
urlhelper.cpp
|
|
||||||
urlhelper.h
|
|
||||||
windowcontroller.cpp
|
windowcontroller.cpp
|
||||||
windowcontroller.h
|
windowcontroller.h
|
||||||
linkpreviewer.cpp
|
|
||||||
linkpreviewer.h
|
|
||||||
models/completionmodel.cpp
|
models/completionmodel.cpp
|
||||||
models/completionmodel.h
|
models/completionmodel.h
|
||||||
models/completionproxymodel.cpp
|
models/completionproxymodel.cpp
|
||||||
models/completionproxymodel.h
|
models/completionproxymodel.h
|
||||||
models/actionsmodel.cpp
|
|
||||||
models/actionsmodel.h
|
|
||||||
models/serverlistmodel.cpp
|
models/serverlistmodel.cpp
|
||||||
models/serverlistmodel.h
|
models/serverlistmodel.h
|
||||||
models/statemodel.cpp
|
models/statemodel.cpp
|
||||||
models/statemodel.h
|
models/statemodel.h
|
||||||
models/statefiltermodel.cpp
|
models/statefiltermodel.cpp
|
||||||
models/statefiltermodel.h
|
models/statefiltermodel.h
|
||||||
filetransferpseudojob.cpp
|
|
||||||
filetransferpseudojob.h
|
|
||||||
models/searchmodel.cpp
|
models/searchmodel.cpp
|
||||||
models/searchmodel.h
|
models/searchmodel.h
|
||||||
texthandler.cpp
|
|
||||||
texthandler.h
|
|
||||||
logger.cpp
|
logger.cpp
|
||||||
logger.h
|
logger.h
|
||||||
models/stickermodel.cpp
|
models/stickermodel.cpp
|
||||||
models/stickermodel.h
|
models/stickermodel.h
|
||||||
models/imagepacksmodel.cpp
|
models/imagepacksmodel.cpp
|
||||||
models/imagepacksmodel.h
|
models/imagepacksmodel.h
|
||||||
events/imagepackevent.cpp
|
|
||||||
events/imagepackevent.h
|
|
||||||
models/reactionmodel.cpp
|
models/reactionmodel.cpp
|
||||||
models/reactionmodel.h
|
models/reactionmodel.h
|
||||||
models/livelocationsmodel.cpp
|
models/livelocationsmodel.cpp
|
||||||
@@ -117,39 +93,25 @@ add_library(neochat STATIC
|
|||||||
models/locationsmodel.h
|
models/locationsmodel.h
|
||||||
locationhelper.cpp
|
locationhelper.cpp
|
||||||
locationhelper.h
|
locationhelper.h
|
||||||
events/pollevent.cpp
|
|
||||||
pollhandler.cpp
|
pollhandler.cpp
|
||||||
utils.h
|
|
||||||
utils.cpp
|
|
||||||
registration.cpp
|
registration.cpp
|
||||||
neochatconnection.cpp
|
|
||||||
neochatconnection.h
|
|
||||||
jobs/neochatgetcommonroomsjob.cpp
|
jobs/neochatgetcommonroomsjob.cpp
|
||||||
jobs/neochatgetcommonroomsjob.h
|
jobs/neochatgetcommonroomsjob.h
|
||||||
mediasizehelper.cpp
|
mediasizehelper.cpp
|
||||||
mediasizehelper.h
|
mediasizehelper.h
|
||||||
eventhandler.cpp
|
|
||||||
enums/delegatetype.h
|
enums/delegatetype.h
|
||||||
roomlastmessageprovider.cpp
|
|
||||||
roomlastmessageprovider.h
|
|
||||||
chatbarcache.cpp
|
|
||||||
chatbarcache.h
|
|
||||||
colorschemer.cpp
|
colorschemer.cpp
|
||||||
colorschemer.h
|
colorschemer.h
|
||||||
models/notificationsmodel.cpp
|
models/notificationsmodel.cpp
|
||||||
models/notificationsmodel.h
|
models/notificationsmodel.h
|
||||||
models/timelinemodel.cpp
|
models/timelinemodel.cpp
|
||||||
models/timelinemodel.h
|
models/timelinemodel.h
|
||||||
enums/pushrule.h
|
|
||||||
models/itinerarymodel.cpp
|
models/itinerarymodel.cpp
|
||||||
models/itinerarymodel.h
|
models/itinerarymodel.h
|
||||||
proxycontroller.cpp
|
proxycontroller.cpp
|
||||||
proxycontroller.h
|
proxycontroller.h
|
||||||
models/linemodel.cpp
|
models/linemodel.cpp
|
||||||
models/linemodel.h
|
models/linemodel.h
|
||||||
events/locationbeaconevent.h
|
|
||||||
events/widgetevent.h
|
|
||||||
enums/messagecomponenttype.h
|
|
||||||
models/messagecontentmodel.cpp
|
models/messagecontentmodel.cpp
|
||||||
models/messagecontentmodel.h
|
models/messagecontentmodel.h
|
||||||
enums/neochatroomtype.h
|
enums/neochatroomtype.h
|
||||||
@@ -170,20 +132,14 @@ add_library(neochat STATIC
|
|||||||
threepidaddhelper.h
|
threepidaddhelper.h
|
||||||
identityserverhelper.cpp
|
identityserverhelper.cpp
|
||||||
identityserverhelper.h
|
identityserverhelper.h
|
||||||
enums/powerlevel.cpp
|
|
||||||
enums/powerlevel.h
|
|
||||||
models/permissionsmodel.cpp
|
models/permissionsmodel.cpp
|
||||||
models/permissionsmodel.h
|
models/permissionsmodel.h
|
||||||
threepidbindhelper.cpp
|
threepidbindhelper.cpp
|
||||||
threepidbindhelper.h
|
threepidbindhelper.h
|
||||||
models/readmarkermodel.cpp
|
models/readmarkermodel.cpp
|
||||||
models/readmarkermodel.h
|
models/readmarkermodel.h
|
||||||
neochatroommember.cpp
|
|
||||||
neochatroommember.h
|
|
||||||
models/threadmodel.cpp
|
models/threadmodel.cpp
|
||||||
models/threadmodel.h
|
models/threadmodel.h
|
||||||
enums/messagetype.h
|
|
||||||
messagecomponent.h
|
|
||||||
enums/roomsortparameter.cpp
|
enums/roomsortparameter.cpp
|
||||||
enums/roomsortparameter.h
|
enums/roomsortparameter.h
|
||||||
models/roomsortparametermodel.cpp
|
models/roomsortparametermodel.cpp
|
||||||
@@ -313,6 +269,7 @@ ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE
|
|||||||
QtCore
|
QtCore
|
||||||
QtQuick
|
QtQuick
|
||||||
IMPORTS
|
IMPORTS
|
||||||
|
org.kde.neochat.libneochat
|
||||||
org.kde.neochat.timeline
|
org.kde.neochat.timeline
|
||||||
org.kde.neochat.settings
|
org.kde.neochat.settings
|
||||||
org.kde.neochat.devtools
|
org.kde.neochat.devtools
|
||||||
@@ -360,13 +317,6 @@ ecm_qt_declare_logging_category(neochat
|
|||||||
EXPORT NEOCHAT
|
EXPORT NEOCHAT
|
||||||
)
|
)
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(neochat
|
|
||||||
HEADER "eventhandler_logging.h"
|
|
||||||
IDENTIFIER "EventHandling"
|
|
||||||
CATEGORY_NAME "org.kde.neochat.eventhandler"
|
|
||||||
DEFAULT_SEVERITY Info
|
|
||||||
)
|
|
||||||
|
|
||||||
ecm_qt_declare_logging_category(neochat
|
ecm_qt_declare_logging_category(neochat
|
||||||
HEADER "chatdocumenthandler_logging.h"
|
HEADER "chatdocumenthandler_logging.h"
|
||||||
IDENTIFIER "ChatDocumentHandling"
|
IDENTIFIER "ChatDocumentHandling"
|
||||||
@@ -400,9 +350,8 @@ if(NOT ANDROID)
|
|||||||
else()
|
else()
|
||||||
target_sources(neochat PRIVATE trayicon.cpp trayicon.h)
|
target_sources(neochat PRIVATE trayicon.cpp trayicon.h)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(neochat PUBLIC KF6::WindowSystem ICU::uc)
|
target_link_libraries(neochat PUBLIC KF6::WindowSystem)
|
||||||
target_compile_definitions(neochat PUBLIC -DHAVE_WINDOWSYSTEM)
|
target_compile_definitions(neochat PUBLIC -DHAVE_WINDOWSYSTEM)
|
||||||
target_compile_definitions(neochat PUBLIC -DHAVE_ICU)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT ANDROID AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
|
if (NOT ANDROID AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
|
||||||
@@ -439,9 +388,6 @@ target_link_libraries(neochat PUBLIC
|
|||||||
KF6::ColorScheme
|
KF6::ColorScheme
|
||||||
KF6::ItemModels
|
KF6::ItemModels
|
||||||
QuotientQt6
|
QuotientQt6
|
||||||
cmark::cmark
|
|
||||||
QCoro::Core
|
|
||||||
QCoro::Network
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (TARGET KF6::Crash)
|
if (TARGET KF6::Crash)
|
||||||
|
|||||||
@@ -4,7 +4,30 @@
|
|||||||
add_library(LibNeoChat STATIC)
|
add_library(LibNeoChat STATIC)
|
||||||
|
|
||||||
target_sources(LibNeoChat PRIVATE
|
target_sources(LibNeoChat PRIVATE
|
||||||
|
neochatconnection.cpp
|
||||||
|
neochatroom.cpp
|
||||||
|
neochatroommember.cpp
|
||||||
|
chatbarcache.cpp
|
||||||
|
clipboard.cpp
|
||||||
delegatesizehelper.cpp
|
delegatesizehelper.cpp
|
||||||
|
emojitones.cpp
|
||||||
|
eventhandler.cpp
|
||||||
|
filetransferpseudojob.cpp
|
||||||
|
linkpreviewer.cpp
|
||||||
|
roomlastmessageprovider.cpp
|
||||||
|
spacehierarchycache.cpp
|
||||||
|
texthandler.cpp
|
||||||
|
urlhelper.cpp
|
||||||
|
utils.cpp
|
||||||
|
enums/messagecomponenttype.h
|
||||||
|
enums/messagetype.h
|
||||||
|
enums/powerlevel.cpp
|
||||||
|
enums/pushrule.h
|
||||||
|
events/imagepackevent.cpp
|
||||||
|
events/pollevent.cpp
|
||||||
|
models/actionsmodel.cpp
|
||||||
|
models/customemojimodel.cpp
|
||||||
|
models/emojimodel.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
ecm_add_qml_module(LibNeoChat GENERATE_PLUGIN_SOURCE
|
ecm_add_qml_module(LibNeoChat GENERATE_PLUGIN_SOURCE
|
||||||
@@ -12,8 +35,33 @@ ecm_add_qml_module(LibNeoChat GENERATE_PLUGIN_SOURCE
|
|||||||
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/libneochat
|
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/libneochat
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ecm_qt_declare_logging_category(LibNeoChat
|
||||||
|
HEADER "eventhandler_logging.h"
|
||||||
|
IDENTIFIER "EventHandling"
|
||||||
|
CATEGORY_NAME "org.kde.neochat.eventhandler"
|
||||||
|
DEFAULT_SEVERITY Info
|
||||||
|
)
|
||||||
|
|
||||||
generate_export_header(LibNeoChat BASE_NAME LibNeoChat)
|
generate_export_header(LibNeoChat BASE_NAME LibNeoChat)
|
||||||
|
target_include_directories(LibNeoChat PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/enums ${CMAKE_CURRENT_SOURCE_DIR}/events ${CMAKE_CURRENT_SOURCE_DIR}/models)
|
||||||
target_link_libraries(LibNeoChat PUBLIC
|
target_link_libraries(LibNeoChat PUBLIC
|
||||||
Qt::Core
|
Qt::Core
|
||||||
|
Qt::Multimedia
|
||||||
Qt::Quick
|
Qt::Quick
|
||||||
|
KF6::ConfigCore
|
||||||
|
KF6::CoreAddons
|
||||||
|
KF6::I18n
|
||||||
|
KF6::Kirigami
|
||||||
|
QuotientQt6
|
||||||
|
cmark::cmark
|
||||||
|
QCoro::Core
|
||||||
|
QCoro::Network
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(NOT ANDROID)
|
||||||
|
target_link_libraries(LibNeoChat PUBLIC
|
||||||
|
KF6::KIOWidgets
|
||||||
|
ICU::uc
|
||||||
|
)
|
||||||
|
target_compile_definitions(LibNeoChat PUBLIC -DHAVE_ICU)
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <Quotient/roommember.h>
|
#include <Quotient/roommember.h>
|
||||||
|
|
||||||
#include "contentprovider.h"
|
|
||||||
#include "eventhandler.h"
|
#include "eventhandler.h"
|
||||||
#include "models/actionsmodel.h"
|
#include "models/actionsmodel.h"
|
||||||
#include "neochatroom.h"
|
#include "neochatroom.h"
|
||||||
@@ -88,7 +87,6 @@ void ChatBarCache::setReplyId(const QString &replyId)
|
|||||||
m_relationType = Reply;
|
m_relationType = Reply;
|
||||||
}
|
}
|
||||||
m_attachmentPath = QString();
|
m_attachmentPath = QString();
|
||||||
delete m_relationContentModel;
|
|
||||||
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
||||||
Q_EMIT attachmentPathChanged();
|
Q_EMIT attachmentPathChanged();
|
||||||
}
|
}
|
||||||
@@ -118,7 +116,6 @@ void ChatBarCache::setEditId(const QString &editId)
|
|||||||
m_relationType = Edit;
|
m_relationType = Edit;
|
||||||
}
|
}
|
||||||
m_attachmentPath = QString();
|
m_attachmentPath = QString();
|
||||||
delete m_relationContentModel;
|
|
||||||
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
||||||
Q_EMIT attachmentPathChanged();
|
Q_EMIT attachmentPathChanged();
|
||||||
}
|
}
|
||||||
@@ -196,7 +193,6 @@ void ChatBarCache::setAttachmentPath(const QString &attachmentPath)
|
|||||||
#if (Quotient_VERSION_MINOR < 10 && Quotient_VERSION_PATCH < 3) || Quotient_VERSION_MINOR < 9
|
#if (Quotient_VERSION_MINOR < 10 && Quotient_VERSION_PATCH < 3) || Quotient_VERSION_MINOR < 9
|
||||||
m_relationType = None;
|
m_relationType = None;
|
||||||
const auto oldEventId = std::exchange(m_relationId, QString());
|
const auto oldEventId = std::exchange(m_relationId, QString());
|
||||||
delete m_relationContentModel;
|
|
||||||
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -206,7 +202,6 @@ void ChatBarCache::clearRelations()
|
|||||||
const auto oldEventId = std::exchange(m_relationId, QString());
|
const auto oldEventId = std::exchange(m_relationId, QString());
|
||||||
const auto oldThreadId = std::exchange(m_threadId, QString());
|
const auto oldThreadId = std::exchange(m_threadId, QString());
|
||||||
m_attachmentPath = QString();
|
m_attachmentPath = QString();
|
||||||
delete m_relationContentModel;
|
|
||||||
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
Q_EMIT relationIdChanged(oldEventId, m_relationId);
|
||||||
Q_EMIT threadIdChanged(oldThreadId, m_threadId);
|
Q_EMIT threadIdChanged(oldThreadId, m_threadId);
|
||||||
Q_EMIT attachmentPathChanged();
|
Q_EMIT attachmentPathChanged();
|
||||||
@@ -8,14 +8,11 @@
|
|||||||
#include <QQuickTextDocument>
|
#include <QQuickTextDocument>
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
|
|
||||||
#include "models/messagecontentmodel.h"
|
|
||||||
|
|
||||||
namespace Quotient
|
namespace Quotient
|
||||||
{
|
{
|
||||||
class RoomMember;
|
class RoomMember;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Defines a user mention in the current chat or edit text.
|
* @brief Defines a user mention in the current chat or edit text.
|
||||||
*/
|
*/
|
||||||
@@ -210,7 +207,5 @@ private:
|
|||||||
QList<Mention> m_mentions;
|
QList<Mention> m_mentions;
|
||||||
QString m_savedText;
|
QString m_savedText;
|
||||||
|
|
||||||
QPointer<MessageContentModel> m_relationContentModel;
|
|
||||||
|
|
||||||
void clearCache();
|
void clearCache();
|
||||||
};
|
};
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
#include <Quotient/events/eventcontent.h>
|
#include <Quotient/events/eventcontent.h>
|
||||||
#include <Quotient/events/eventrelation.h>
|
#include <Quotient/events/eventrelation.h>
|
||||||
#include <Quotient/events/roommessageevent.h>
|
#include <Quotient/events/roommessageevent.h>
|
||||||
|
#include <Quotient/events/stickerevent.h>
|
||||||
#include <Quotient/jobs/basejob.h>
|
#include <Quotient/jobs/basejob.h>
|
||||||
#include <Quotient/quotient_common.h>
|
#include <Quotient/quotient_common.h>
|
||||||
#include <qcoro/qcorosignal.h>
|
#include <qcoro/qcorosignal.h>
|
||||||
@@ -4,10 +4,10 @@
|
|||||||
#include "completionmodel.h"
|
#include "completionmodel.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
#include "actionsmodel.h"
|
|
||||||
#include "completionproxymodel.h"
|
#include "completionproxymodel.h"
|
||||||
#include "customemojimodel.h"
|
#include "models/actionsmodel.h"
|
||||||
#include "emojimodel.h"
|
#include "models/customemojimodel.h"
|
||||||
|
#include "models/emojimodel.h"
|
||||||
#include "neochatroom.h"
|
#include "neochatroom.h"
|
||||||
#include "roommanager.h"
|
#include "roommanager.h"
|
||||||
#include "userlistmodel.h"
|
#include "userlistmodel.h"
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include "messagecontentmodel.h"
|
#include "messagecontentmodel.h"
|
||||||
#include "contentprovider.h"
|
#include "contentprovider.h"
|
||||||
|
#include "enums/messagecomponenttype.h"
|
||||||
#include "eventhandler.h"
|
#include "eventhandler.h"
|
||||||
#include "messagecomponenttype.h"
|
|
||||||
#include "neochatconfig.h"
|
#include "neochatconfig.h"
|
||||||
|
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <KLazyLocalizedString>
|
#include <KLazyLocalizedString>
|
||||||
|
|
||||||
#include "powerlevel.h"
|
#include "enums/powerlevel.h"
|
||||||
|
|
||||||
using namespace Qt::Literals::StringLiterals;
|
using namespace Qt::Literals::StringLiterals;
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
|
|
||||||
#include "chatbarcache.h"
|
#include "chatbarcache.h"
|
||||||
#include "contentprovider.h"
|
#include "contentprovider.h"
|
||||||
|
#include "enums/messagecomponenttype.h"
|
||||||
#include "eventhandler.h"
|
#include "eventhandler.h"
|
||||||
#include "messagecomponenttype.h"
|
|
||||||
#include "messagecontentmodel.h"
|
#include "messagecontentmodel.h"
|
||||||
#include "neochatroom.h"
|
#include "neochatroom.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user