Verified Commit 439220d8 authored by Phobos D'thorga's avatar Phobos D'thorga 🐲
Browse files

Merge branch 'develop'

parents 48336deb 25ee8500
Pipeline #996 passed with stages
in 39 minutes and 19 seconds
......@@ -699,6 +699,7 @@ set(GALAXY_UI_CPP
src/models/tableview/gk_callsign_msgs_model.cpp
src/models/tableview/gk_xmpp_recv_msgs_model.cpp
src/models/tableview/gk_xmpp_roster_presence_model.cpp
src/models/tableview/gk_qdatetime_filter_proxy_model.cpp
src/models/tableview/gk_xmpp_roster_pending_model.cpp
src/models/tableview/gk_xmpp_roster_blocked_model.cpp
src/models/treeview/xmpp/gk_xmpp_roster_model.cpp)
......@@ -800,6 +801,7 @@ set(GALAXY_OBJ_HEADERS
src/models/tableview/gk_callsign_msgs_model.hpp
src/models/tableview/gk_xmpp_recv_msgs_model.hpp
src/models/tableview/gk_xmpp_roster_presence_model.hpp
src/models/tableview/gk_qdatetime_filter_proxy_model.hpp
src/models/tableview/gk_xmpp_roster_pending_model.hpp
src/models/tableview/gk_xmpp_roster_blocked_model.hpp
src/models/treeview/xmpp/gk_xmpp_roster_model.hpp)
......
......@@ -446,7 +446,7 @@ namespace Network {
struct GkXmppArchiveMsg {
bool presented = false;
QXmppArchiveMessage message;
QXmppArchiveMessage message; // TODO: Implement proper functionality for this or remove it completely!
};
struct GkClientSettings {
......
......@@ -246,69 +246,6 @@ std::string StringFuncs::csvOutputString(const std::deque<std::string> &csv_elem
return std::string();
}
/**
* @brief StringFuncs::calcMinTimestampForXmppMsgHistory calculates the most minimum timestamp applicable to a QList of
* XMPP messages for use in message history archive retrieval functions and so on.
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param messages The given list of XMPP messages to calculate the most minimum QDateTime timestamp from.
* @return The most mimimum QDateTime timestamp applicable to the given list of XMPP messages.
*/
QDateTime StringFuncs::calcMinTimestampForXmppMsgHistory(const QList<QXmppMessage> &messages)
{
try {
if (!messages.isEmpty()) {
QDateTime min_timestamp = QDateTime::currentDateTimeUtc();
for (const auto &message: messages) {
if (message.isXmppStanza() && !message.body().isEmpty()) {
min_timestamp = messages.at(0).stamp();
if (messages.size() > 1) {
if (min_timestamp < message.stamp()) {
min_timestamp = message.stamp();
}
} else {
break;
}
}
}
return min_timestamp;
}
} catch (const std::exception &e) {
std::throw_with_nested(std::runtime_error(tr("An error has occurred whilst calculating timestamp information from XMPP message history data.\n\n%1").arg(QString::fromStdString(e.what())).toStdString()));
}
return QDateTime::currentDateTimeUtc();
}
/**
* @brief StringFuncs::calcMaxTimestampForXmppMsgHistory calculates the most maximum timestamp applicable to a QList of
* XMPP messages for use in message history archive retrieval functions and so on.
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param messages The given list of XMPP messages to calculate the most maxmimum QDateTime timestamp from.
* @return The most maximum QDateTime timestamp applicable to the given list of XMPP messages.
*/
QDateTime StringFuncs::calcMaxTimestampForXmppMsgHistory(const QList<QXmppMessage> &messages)
{
try {
if (!messages.isEmpty()) {
QDateTime max_timestamp = messages.at(0).stamp();
if (messages.size() > 1) {
for (const auto &message: messages) {
if (max_timestamp > message.stamp()) {
max_timestamp = message.stamp();
}
}
}
return max_timestamp;
}
} catch (const std::exception &e) {
std::throw_with_nested(std::runtime_error(tr("An error has occurred whilst calculating timestamp information from XMPP message history data.\n\n%1").arg(QString::fromStdString(e.what())).toStdString()));
}
return QDateTime::currentDateTimeUtc();
}
/**
* @brief StringFuncs::htmlSpecialCharEncoding
* @author wysota <https://www.qtcentre.org/threads/52456-HTML-Unicode-ampersand-encoding?p=234858#post234858>,
......
......@@ -92,9 +92,6 @@ public:
std::deque<std::string> csvRemoveElement(const std::deque<std::string> &csv_elements, const std::string &val_to_remove);
std::string csvOutputString(const std::deque<std::string> &csv_elements);
[[nodiscard]] QDateTime calcMinTimestampForXmppMsgHistory(const QList<QXmppMessage> &messages);
[[nodiscard]] QDateTime calcMaxTimestampForXmppMsgHistory(const QList<QXmppMessage> &messages);
static QString htmlSpecialCharEncoding(const QString &string);
QList<int> extractNumbersFromStr(const QString &str);
......
......@@ -90,6 +90,7 @@ GkXmppClient::GkXmppClient(const GkUserConn &connection_details, QPointer<GekkoF
m_vCardManager(findExtension<QXmppVCardManager>()),
m_xmppArchiveMgr(findExtension<QXmppArchiveManager>()),
m_xmppMamMgr(findExtension<QXmppMamManager>()),
m_xmppCarbonMgr(findExtension<QXmppCarbonManager>()),
m_xmppLogger(QXmppLogger::getLogger()),
m_discoMgr(findExtension<QXmppDiscoveryManager>()),
QXmppClient(parent)
......@@ -108,6 +109,7 @@ GkXmppClient::GkXmppClient(const GkUserConn &connection_details, QPointer<GekkoF
m_transferManager = std::make_unique<QXmppTransferManager>();
m_xmppArchiveMgr = std::make_unique<QXmppArchiveManager>();
m_xmppMamMgr = std::make_unique<QXmppMamManager>();
m_xmppCarbonMgr = std::make_unique<QXmppCarbonManager>();
addExtension(m_rosterManager.get());
addExtension(m_versionMgr.get());
......@@ -137,10 +139,16 @@ GkXmppClient::GkXmppClient(const GkUserConn &connection_details, QPointer<GekkoF
addExtension(m_xmppMamMgr.get());
}
if (m_xmppCarbonMgr) {
addExtension(m_xmppCarbonMgr.get());
m_xmppCarbonMgr->setCarbonsEnabled(true);
}
//
// Booleans and other variables
m_askToReconnectAuto = false;
m_sslIsEnabled = false;
m_isMuc = false;
sys::error_code ec;
fs::path slash = "/";
native_slash = slash.make_preferred().native();
......@@ -293,6 +301,11 @@ GkXmppClient::GkXmppClient(const GkUserConn &connection_details, QPointer<GekkoF
// the most minimal of in-band user registration is supported by said server!
//
QObject::connect(this, SIGNAL(messageReceived(const QXmppMessage &)), this, SLOT(recvXmppMsgUpdate(const QXmppMessage &)));
if (m_xmppCarbonMgr->carbonsEnabled()) {
QObject::connect(m_xmppCarbonMgr.get(), SIGNAL(messageSent(const QXmppMessage &)), this, SLOT(recvXmppMsgUpdate(const QXmppMessage &)));
QObject::connect(m_xmppCarbonMgr.get(), SIGNAL(messageReceived(const QXmppMessage &)), this, SLOT(recvXmppMsgUpdate(const QXmppMessage &)));
}
QObject::connect(m_registerManager.get(), SIGNAL(registrationFormReceived(const QXmppRegisterIq &)),
this, SLOT(handleRegistrationForm(const QXmppRegisterIq &)));
......@@ -378,38 +391,6 @@ GkXmppClient::GkXmppClient(const GkUserConn &connection_details, QPointer<GekkoF
});
QObject::connect(this, &QXmppClient::disconnected, this, [=]() {
if (!m_connDetails.server.settings_client.auto_reconnect && !m_connDetails.server.url.isEmpty() &&
!m_connDetails.jid.isEmpty()) {
if (!this->isConnected() && m_askToReconnectAuto) { // We have been disconnected from the given XMPP server!
QMessageBox msgBoxPolicy;
msgBoxPolicy.setParent(nullptr);
msgBoxPolicy.setWindowTitle(tr("Disconnected!"));
msgBoxPolicy.setText(tr("You have been disconnected from the XMPP server, \"%1\"! Do you wish to enable a automatic reconnect policy?").arg(m_connDetails.server.url));
msgBoxPolicy.setStandardButtons(QMessageBox::Apply | QMessageBox::Ignore | QMessageBox::Cancel);
msgBoxPolicy.setDefaultButton(QMessageBox::Apply);
msgBoxPolicy.setIcon(QMessageBox::Icon::Information);
qint32 ret = msgBoxPolicy.exec();
switch (ret) {
case QMessageBox::Apply:
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(true)), GkXmppCfg::XmppAutoReconnect);
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(false)), GkXmppCfg::XmppAutoReconnectIgnore);
return;
case QMessageBox::Ignore:
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(true)), GkXmppCfg::XmppAutoReconnectIgnore);
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(false)), GkXmppCfg::XmppAutoReconnect);
return;
case QMessageBox::Cancel:
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(false)), GkXmppCfg::XmppAutoReconnect);
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(false)), GkXmppCfg::XmppAutoReconnectIgnore);
return;
default:
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(false)), GkXmppCfg::XmppAutoReconnect);
gkDb->write_xmpp_settings(QString::fromStdString(gkDb->boolEnum(false)), GkXmppCfg::XmppAutoReconnectIgnore);
return;
}
}
}
m_rosterList.clear(); // Clear the roster-list upon disconnection from given XMPP server!
});
} catch (const std::exception &e) {
......@@ -685,6 +666,102 @@ bool GkXmppClient::isJidOnline(const QString &bareJid)
return false;
}
/**
* @brief GkXmppClient::calcMinTimestampForXmppMsgHistory calculates the most minimum timestamp applicable to a QList of
* XMPP messages for use in message history archive retrieval functions and so on.
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param bareJid The user we are in communiqué with!
* @param msg_history The given list of XMPP messages to calculate the most minimum QDateTime timestamp from.
* @return The most mimimum QDateTime timestamp applicable to the given list of XMPP messages.
*/
QDateTime GkXmppClient::calcMinTimestampForXmppMsgHistory(const QString &bareJid, const QList<GkXmppCallsign> &msg_history)
{
try {
if (!msg_history.isEmpty()) {
QDateTime min_timestamp = QDateTime::currentDateTimeUtc();
for (const auto &stanza: msg_history) {
if (stanza.bareJid == bareJid) {
for (const auto &mam: stanza.messages) {
if (mam.message.isXmppStanza() && !mam.message.body().isEmpty()) {
min_timestamp = stanza.messages.at(0).message.stamp();
if (msg_history.size() > 1) {
if (min_timestamp < mam.message.stamp()) {
min_timestamp = mam.message.stamp();
}
} else {
break;
}
}
}
break;
}
}
return min_timestamp;
}
} catch (const std::exception &e) {
std::throw_with_nested(std::runtime_error(tr("An error has occurred whilst calculating timestamp information from XMPP message history data.\n\n%1").arg(QString::fromStdString(e.what())).toStdString()));
}
return QDateTime::currentDateTimeUtc();
}
/**
* @brief GkXmppClient::calcMaxTimestampForXmppMsgHistory calculates the most maximum timestamp applicable to a QList of
* XMPP messages for use in message history archive retrieval functions and so on.
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param bareJid The user we are in communiqué with!
* @param msg_history The given list of XMPP messages to calculate the most maxmimum QDateTime timestamp from.
* @return The most maximum QDateTime timestamp applicable to the given list of XMPP messages.
*/
QDateTime GkXmppClient::calcMaxTimestampForXmppMsgHistory(const QString &bareJid, const QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> &msg_history)
{
try {
if (!msg_history.isEmpty()) {
if (msg_history.size() > 1) {
for (const auto &stanza: msg_history) {
if (stanza.bareJid == bareJid) {
QDateTime max_timestamp = stanza.messages.at(0).message.stamp();
for (const auto &mam: stanza.messages) {
if (max_timestamp > mam.message.stamp()) {
max_timestamp = mam.message.stamp();
}
}
return max_timestamp;
}
}
}
}
} catch (const std::exception &e) {
std::throw_with_nested(std::runtime_error(tr("An error has occurred whilst calculating timestamp information from XMPP message history data.\n\n%1").arg(QString::fromStdString(e.what())).toStdString()));
}
return QDateTime::currentDateTimeUtc();
}
/**
* @brief GkXmppClient::compareTimestamps compares a given QList() of timestamps and returns the closet
* matching value to the given input reference.
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param data The QList of data for making comparisons.
* @param value The reference value in which to make the comparison against.
* @return The closest, compared, value which has been found.
*/
qint64 GkXmppClient::compareTimestamps(const std::vector<GekkoFyre::Network::GkXmpp::GkRecvMsgsTableViewModel> &data,
const qint64 &value)
{
std::vector<qint64> timestamps;
for (const auto &stanza: data) {
timestamps.push_back(stanza.timestamp.toMSecsSinceEpoch());
}
auto const it = std::lower_bound(timestamps.begin(), timestamps.end(), value);
if (it == timestamps.end()) { return -1; }
return *it;
}
/**
* @brief GkXmppClient::getRegistrationMgr
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
......@@ -700,13 +777,13 @@ std::shared_ptr<QXmppRegistrationManager> GkXmppClient::getRegistrationMgr()
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @return
*/
QVector<GekkoFyre::Network::GkXmpp::GkXmppCallsign> GkXmppClient::getRosterMap()
QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> GkXmppClient::getRosterMap()
{
if (!m_rosterList.isEmpty()) {
return m_rosterList;
}
return QVector<GekkoFyre::Network::GkXmpp::GkXmppCallsign>();
return QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign>();
}
/**
......@@ -714,12 +791,11 @@ QVector<GekkoFyre::Network::GkXmpp::GkXmppCallsign> GkXmppClient::getRosterMap()
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param rosterList
*/
void GkXmppClient::updateRosterMap(const QVector<GekkoFyre::Network::GkXmpp::GkXmppCallsign> &rosterList)
void GkXmppClient::updateRosterMap(const QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> &rosterList)
{
if (!rosterList.isEmpty()) {
std::lock_guard<std::mutex> lock_guard(m_updateRosterMapMtx);
m_rosterList.clear();
m_rosterList.shrink_to_fit();
std::copy(rosterList.begin(), rosterList.end(), std::back_inserter(m_rosterList));
}
......@@ -906,34 +982,32 @@ void GkXmppClient::getArchivedMessages(const QString &to, const QString &node, c
Q_UNUSED(node);
Q_UNUSED(end);
if (!m_rosterList.isEmpty()) {
for (const auto &roster: m_rosterList) {
updateRecordedMsgHistory(roster.bareJid);
if (!start.isValid()) {
if (to == roster.bareJid && jid != m_connDetails.jid) {
if (!roster.messages.isEmpty()) {
QList<QXmppMessage> msg_history;
for (const auto &message: roster.messages) {
msg_history.push_back(message.message);
}
if (!msg_history.isEmpty()) {
const auto min_timestamp = gkStringFuncs->calcMinTimestampForXmppMsgHistory(msg_history);
try {
if (!m_rosterList.isEmpty()) {
for (const auto &roster: m_rosterList) {
updateRecordedMsgHistory(roster.bareJid);
if (!start.isValid()) {
if (to == roster.bareJid && jid != m_connDetails.jid) {
if (!roster.messages.isEmpty()) {
const auto min_timestamp = calcMinTimestampForXmppMsgHistory(to, m_rosterList);
gkEventLogger->publishEvent(tr("Minimum date required for message archive retrieval is: %1").arg(QDateTime(min_timestamp).toString("dd MMM yyyy @ hh:mm:ss.zzz")),
GkSeverity::Debug, "", false, true, false, false);
m_xmppMamMgr->retrieveArchivedMessages(roster.bareJid, "", m_connDetails.jid, min_timestamp, QDateTime(), resultSetQuery);
return;
}
}
break;
break;
}
}
}
}
m_xmppMamMgr->retrieveArchivedMessages(to, "", jid, QDateTime::currentDateTime().addDays(-28), QDateTime::currentDateTime(), resultSetQuery);
} catch (const std::exception &e) {
gkEventLogger->publishEvent(QString::fromStdString(e.what()), GkSeverity::Fatal, "", false, true, false, true, false);
}
m_xmppMamMgr->retrieveArchivedMessages(to, "", jid, start, QDateTime(), resultSetQuery);
return;
}
......@@ -1081,7 +1155,7 @@ void GkXmppClient::vCardReceived(const QXmppVCardIq &vCard)
}
}
} catch (const std::exception &e) {
gkEventLogger->publishEvent(QString::fromStdString(e.what()), GkSeverity::Fatal, "", false, true, false, true);
gkEventLogger->publishEvent(QString::fromStdString(e.what()), GkSeverity::Fatal, "", false, true, false, true, false);
}
return;
......@@ -1131,7 +1205,7 @@ void GkXmppClient::clientVCardReceived()
}
}
} catch (const std::exception &e) {
gkEventLogger->publishEvent(QString::fromStdString(e.what()), GkSeverity::Fatal, "", false, true, false, true);
gkEventLogger->publishEvent(QString::fromStdString(e.what()), GkSeverity::Fatal, "", false, true, false, true, false);
}
return;
......@@ -1420,15 +1494,9 @@ void GkXmppClient::updateClientVCardForm(const QString &first_name, const QStrin
* @brief GkXmppClient::sendXmppMsg is a utility function to send messages to all the resources associated with the specified
* bareJid(s) within the contained QXmppMessage stanza.
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param bareJid The identity of the user in question, for the message archive with which we are processing for.
* @param msg The QXmppMessage to process and ultimately, transmit.
* @param beginTimestamp The beginning timestamp, from which to filter the search results beginning at in obtaining the
* message history for a given bareJid. This is a Internet bandwidth/data saving measure.
* @param endTimestamp The end timestamp, from which to filter the search results up towards in obtaining the message
* history for a given bareJid. This is a Internet bandwidth/data saving measure.
*/
void GkXmppClient::sendXmppMsg(const QString &bareJid, const QXmppMessage &msg, const QDateTime &beginTimestamp,
const QDateTime &endTimestamp)
void GkXmppClient::sendXmppMsg(const QXmppMessage &msg)
{
if (msg.isXmppStanza()) {
sendPacket(msg);
......@@ -2013,7 +2081,7 @@ void GkXmppClient::recvXmppMsgUpdate(const QXmppMessage &message)
return;
}
} catch (const std::exception &e) {
gkEventLogger->publishEvent(QString::fromStdString(e.what()), GkSeverity::Fatal, "", false, true, false, true);
gkEventLogger->publishEvent(QString::fromStdString(e.what()), GkSeverity::Fatal, "", false, true, false, true, false);
}
return;
......
......@@ -65,6 +65,7 @@
#include <qxmpp/QXmppRegisterIq.h>
#include <qxmpp/QXmppMucManager.h>
#include <qxmpp/QXmppVCardManager.h>
#include <qxmpp/QXmppCarbonManager.h>
#include <qxmpp/QXmppRosterManager.h>
#include <qxmpp/QXmppArchiveManager.h>
#include <qxmpp/QXmppVersionManager.h>
......@@ -127,11 +128,17 @@ public:
[[nodiscard]] bool isJidExist(const QString &bareJid);
[[nodiscard]] bool isJidOnline(const QString &bareJid);
//
// Date & Time Management
[[nodiscard]] QDateTime calcMinTimestampForXmppMsgHistory(const QString &bareJid, const QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> &msg_history);
[[nodiscard]] QDateTime calcMaxTimestampForXmppMsgHistory(const QString &bareJid, const QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> &msg_history);
[[nodiscard]] qint64 compareTimestamps(const std::vector<GekkoFyre::Network::GkXmpp::GkRecvMsgsTableViewModel> &data, const qint64 &value);
//
// User, roster and presence details
std::shared_ptr<QXmppRegistrationManager> getRegistrationMgr();
QVector<GekkoFyre::Network::GkXmpp::GkXmppCallsign> getRosterMap();
void updateRosterMap(const QVector<GekkoFyre::Network::GkXmpp::GkXmppCallsign> &rosterList);
QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> getRosterMap();
void updateRosterMap(const QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> &rosterList);
QXmppPresence statusToPresence(const Network::GkXmpp::GkOnlineStatus &status);
Network::GkXmpp::GkOnlineStatus presenceToStatus(const QXmppPresence::AvailableStatusType &xmppPresence);
QString presenceToString(const QXmppPresence::AvailableStatusType &xmppPresence);
......@@ -139,12 +146,6 @@ public:
bool deleteUserAccount();
QString obtainAvatarFilePath();
//
// QXmppMamManager handling
void getArchivedMessages(const QString &to = QString(), const QString &node = QString(), const QString &jid = QString(),
const QDateTime &start = QDateTime(), const QDateTime &end = QDateTime(),
const QXmppResultSetQuery &resultSetQuery = QXmppResultSetQuery());
//
// vCard management
QByteArray processImgToByteArray(const QString &filePath);
......@@ -176,10 +177,15 @@ public slots:
void updateClientVCardForm(const QString &first_name, const QString &last_name, const QString &email,
const QString &callsign, const QByteArray &avatar_pic, const QString &img_type);
//
// QXmppMamManager handling
void getArchivedMessages(const QString &to = QString(), const QString &node = QString(), const QString &jid = QString(),
const QDateTime &start = QDateTime(), const QDateTime &end = QDateTime(),
const QXmppResultSetQuery &resultSetQuery = QXmppResultSetQuery());
//
// Message handling
void sendXmppMsg(const QString &bareJid, const QXmppMessage &msg, const QDateTime &beginTimestamp,
const QDateTime &endTimestamp);
void sendXmppMsg(const QXmppMessage &msg);
private slots:
//
......@@ -294,7 +300,7 @@ private:
std::shared_ptr<QXmppRosterManager> m_rosterManager;
QStringList rosterGroups;
QVector<QString> m_blockList;
QVector<GekkoFyre::Network::GkXmpp::GkXmppCallsign> m_rosterList; // A list of all the bareJids, including the client themselves!
QList<GekkoFyre::Network::GkXmpp::GkXmppCallsign> m_rosterList; // A list of all the bareJids, including the client themselves!
//
// Filesystem & Directories
......@@ -328,6 +334,7 @@ private:
QXmppConfiguration config;
bool m_askToReconnectAuto;
bool m_sslIsEnabled;
bool m_isMuc;
std::shared_ptr<QXmppRegistrationManager> m_registerManager;
std::unique_ptr<QXmppMucManager> m_mucManager;
std::unique_ptr<QXmppMucRoom> m_pRoom;
......@@ -335,6 +342,7 @@ private:
std::unique_ptr<QXmppMamManager> m_xmppMamMgr;
std::unique_ptr<QXmppTransferManager> m_transferManager;
std::unique_ptr<QXmppVCardManager> m_vCardManager;
std::unique_ptr<QXmppCarbonManager> m_xmppCarbonMgr;
QScopedPointer<QXmppLogger> m_xmppLogger;
GekkoFyre::Network::GkXmpp::GkNetworkState m_netState;
......
/**
** __ _ _ __ __ _ _
** / _\_ __ ___ __ _| | | / / /\ \ \___ _ __| | __| |
** \ \| '_ ` _ \ / _` | | | \ \/ \/ / _ \| '__| |/ _` |
** _\ \ | | | | | (_| | | | \ /\ / (_) | | | | (_| |
** \__/_| |_| |_|\__,_|_|_| \/ \/ \___/|_| |_|\__,_|
**
** ___ _
** / \___| |_ ___ _____
** / /\ / _ \ | | | \ \/ / _ \
** / /_// __/ | |_| |> < __/
** /___,' \___|_|\__,_/_/\_\___|
**
**
** If you have downloaded the source code for "Small World Deluxe" and are reading this,
** then thank you from the bottom of our hearts for making use of our hard work, sweat
** and tears in whatever you are implementing this into!
**
** Copyright (C) 2020 - 2021. GekkoFyre.
**
** Small World Deluxe is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Small world is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Small World Deluxe. If not, see <http://www.gnu.org/licenses/>.
**
**
** The latest source code updates can be obtained from [ 1 ] below at your
** discretion. A web-browser or the 'git' application may be required.
**
** [ 1 ] - https://code.gekkofyre.io/amateur-radio/small-world-deluxe
**
****************************************************************************************************/
#include "src/models/tableview/gk_qdatetime_filter_proxy_model.hpp"
using namespace GekkoFyre;
using namespace GkAudioFramework;
using namespace Database;
using namespace Settings;
using namespace Audio;
using namespace AmateurRadio;
using namespace Control;
using namespace Spectrograph;
using namespace System;
using namespace Events;
using namespace Logging;
using namespace Network;
using namespace GkXmpp;
using namespace Security;
/**
* @brief GkQDateTimeFilterProxyModel::GkQDateTimeFilterProxyModel
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param parent
*/
GkQDateTimeFilterProxyModel::GkQDateTimeFilterProxyModel(QObject *parent) : QSortFilterProxyModel(parent)
{
setParent(parent);
return;
}
/**
* @brief GkQDateTimeFilterProxyModel::~GkQDateTimeFilterProxyModel
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
*/
GkQDateTimeFilterProxyModel::~GkQDateTimeFilterProxyModel()
{
return;
}
/**
* @brief GkQDateTimeFilterProxyModel::setFilterMinimumDateTime
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param timestamp
*/
void GkQDateTimeFilterProxyModel::setFilterMinimumDateTime(QDateTime timestamp)
{
if (timestamp.isValid()) {
minTimestamp = timestamp;
invalidateFilter();
}
return;
}
/**
* @brief GkQDateTimeFilterProxyModel::setFilterMaximumDateTime
* @author Phobos A. D'thorga <phobos.gekko@gekkofyre.io>
* @param timestamp
*/
void GkQDateTimeFilterProxyModel::setFilterMaximumDateTime(QDateTime timestamp)
{
if (timestamp.isValid()) {
maxTimestamp = timestamp;