зеркало из https://github.com/nextcloud/desktop.git
Merge pull request #859 from nextcloud/fix/788/no_activity_flood
Do not fetch activities if they are not enabled
This commit is contained in:
Коммит
1afaa22ddb
|
@ -291,18 +291,28 @@ void ActivityListModel::combineActivityLists()
|
|||
endInsertRows();
|
||||
}
|
||||
|
||||
bool ActivityListModel::canFetchActivities() const {
|
||||
return _accountState->isConnected() && _accountState->account()->capabilities().hasActivities();
|
||||
}
|
||||
|
||||
void ActivityListModel::fetchMore(const QModelIndex &)
|
||||
{
|
||||
if (_accountState->isConnected()) {
|
||||
_activityLists = ActivityList();
|
||||
if (canFetchActivities()) {
|
||||
startFetchJob();
|
||||
} else {
|
||||
combineActivityLists();
|
||||
}
|
||||
}
|
||||
|
||||
void ActivityListModel::slotRefreshActivity()
|
||||
{
|
||||
_activityLists.clear();
|
||||
if (canFetchActivities()) {
|
||||
startFetchJob();
|
||||
} else {
|
||||
combineActivityLists();
|
||||
}
|
||||
}
|
||||
|
||||
void ActivityListModel::slotRemoveAccount()
|
||||
|
|
|
@ -67,6 +67,7 @@ signals:
|
|||
private:
|
||||
void startFetchJob();
|
||||
void combineActivityLists();
|
||||
bool canFetchActivities() const;
|
||||
|
||||
ActivityList _activityLists;
|
||||
ActivityList _syncFileItemLists;
|
||||
|
|
|
@ -103,6 +103,10 @@ bool Capabilities::isValid() const
|
|||
return !_capabilities.isEmpty();
|
||||
}
|
||||
|
||||
bool Capabilities::hasActivities() const {
|
||||
return _capabilities.contains("activity");
|
||||
}
|
||||
|
||||
QList<QByteArray> Capabilities::supportedChecksumTypes() const
|
||||
{
|
||||
QList<QByteArray> list;
|
||||
|
|
|
@ -59,6 +59,9 @@ public:
|
|||
/// returns true if the capabilities are loaded already.
|
||||
bool isValid() const;
|
||||
|
||||
/// return true if the activity app is enabled
|
||||
bool hasActivities() const;
|
||||
|
||||
/**
|
||||
* Returns the checksum types the server understands.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче