Skip to content

Commit

Permalink
compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Sep 11, 2024
1 parent 5ab9c31 commit 35cd90c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
36 changes: 18 additions & 18 deletions src/xmpp/xmpp-im/xmpp_mammanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,45 +44,45 @@ MAMManager::MAMManager(Client *client, int mamPageSize, int mamMaxMessages, bool
MAMManager::~MAMManager() { delete d; }

// TODO: review the safety of these methods/object lifetimes
MAMTask MAMManager::getFullArchive(const Jid &j, const bool allowMUCArchives)
MAMTask *MAMManager::getFullArchive(const Jid &j, const bool allowMUCArchives)
{
MAMTask task = new MAMTask(d->client->rootTask());
auto task = new MAMTask(d->client->rootTask());

task.get(j, QString(), QString(), allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards);
task->get(j, QString(), QString(), allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards);
return task;
}

MAMTask MAMManager::getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID,
const bool allowMUCArchives)
MAMTask *MAMManager::getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID,
const bool allowMUCArchives)
{
MAMTask task = new MAMTask(d->client->rootTask());
auto task = new MAMTask(d->client->rootTask());

task.get(j, fromID, toID, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards);
task->get(j, fromID, toID, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards);
return task;
}

MAMTask MAMManager::getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to,
const bool allowMUCArchives)
MAMTask *MAMManager::getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to,
const bool allowMUCArchives)
{
MAMTask task = new MAMTask(d->client->rootTask());
auto task = new MAMTask(d->client->rootTask());

task.get(j, from, to, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards);
task->get(j, from, to, allowMUCArchives, d->mamPageSize, d->mamMaxMessages, d->flipPages, d->backwards);
return task;
}

MAMTask MAMManager::getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives,
int amount)
MAMTask *MAMManager::getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives,
int amount)
{
MAMTask task = new MAMTask(d->client->rootTask());
auto task = new MAMTask(d->client->rootTask());

task.get(j, fromID, QString(), allowMUCArchives, d->mamPageSize, amount, true, true);
task->get(j, fromID, QString(), allowMUCArchives, d->mamPageSize, amount, true, true);
return task;
}

MAMTask MAMManager::getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives, int amount)
MAMTask *MAMManager::getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives, int amount)
{
MAMTask task = new MAMTask(d->client->rootTask());
auto task = new MAMTask(d->client->rootTask());

task.get(j, QString(), toID, allowMUCArchives, d->mamPageSize, amount, true, true);
task->get(j, QString(), toID, allowMUCArchives, d->mamPageSize, amount, true, true);
return task;
}
18 changes: 9 additions & 9 deletions src/xmpp/xmpp-im/xmpp_mammanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class MAMManager : public QObject {
bool backwards = true);
~MAMManager();

MAMTask getFullArchive(const Jid &j, const bool allowMUCArchives = true);
MAMTask getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID,
const bool allowMUCArchives = true);
MAMTask getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to,
const bool allowMUCArchives = true);
MAMTask getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives = true,
int amount = 100);
MAMTask getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives = true,
int amount = 100);
MAMTask *getFullArchive(const Jid &j, const bool allowMUCArchives = true);
MAMTask *getArchiveByIDRange(const Jid &j, const QString &fromID, const QString &toID,
const bool allowMUCArchives = true);
MAMTask *getArchiveByTimeRange(const Jid &j, const QDateTime &from, const QDateTime &to,
const bool allowMUCArchives = true);
MAMTask *getLatestMessagesFromArchive(const Jid &j, const QString &fromID, const bool allowMUCArchives = true,
int amount = 100);
MAMTask *getMessagesBeforeID(const Jid &j, const QString &toID, const bool allowMUCArchives = true,
int amount = 100);

private:
class Private;
Expand Down
2 changes: 1 addition & 1 deletion src/xmpp/xmpp-im/xmpp_mamtask.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Jid;
class MAMTask : public Task {
Q_OBJECT
public:
MAMTask(Task *);
explicit MAMTask(Task *);
MAMTask(const MAMTask &x);
~MAMTask();

Expand Down

0 comments on commit 35cd90c

Please sign in to comment.