Open
Description
Implementation for the interface in KTp/Logger/scrollback-manager can be as trivial as:
diff --git a/KTp/Logger/scrollback-manager.cpp b/KTp/Logger/scrollback-manager.cpp
index d9680ae..8f3ab43 100644
--- a/KTp/Logger/scrollback-manager.cpp
+++ b/KTp/Logger/scrollback-manager.cpp
@@ -105,11 +105,15 @@ void ScrollbackManager::fetchHistory(int n)
{
if (n > 0 && !d->account.isNull() && !d->textChannel.isNull()) {
if (d->contactEntity.isValid()) {
- KTp::LogManager *manager = KTp::LogManager::instance();
- KTp::PendingLoggerDates *dates = manager->queryDates(d->account, d->contactEntity);
- connect(dates, SIGNAL(finished(KTp::PendingLoggerOperation*)),
- this, SLOT(onDatesFinished(KTp::PendingLoggerOperation*)));
- return;
+ if (d->textChannel->hasArchiveInterface()) {
+ d->textChannel->getMessages();
+ } else {
+ KTp::LogManager *manager = KTp::LogManager::instance();
+ KTp::PendingLoggerDates *dates = manager->queryDates(d->account, d->contactEntity);
+ connect(dates, SIGNAL(finished(KTp::PendingLoggerOperation*)),
+ this, SLOT(onDatesFinished(KTp::PendingLoggerOperation*)));
+ return;
+ }
}
}
But, it would be much better to implement a proper plugin with KTp::AbstractLoggerPlugin inheritance.
Metadata
Metadata
Assignees
Labels
No labels