@@ -2079,15 +2079,35 @@ void FolderMan::slotSetupPushNotifications(const Folder::Map &folderMap)
2079
2079
2080
2080
void FolderMan::slotProcessFilesPushNotification (Account *account)
2081
2081
{
2082
- qCInfo (lcFolderMan) << " Got files push notification for account" << account;
2082
+ qCDebug (lcFolderMan) << " received notify_file push notification account= " << account-> displayName () ;
2083
2083
2084
2084
for (auto folder : std::as_const (_folderMap)) {
2085
2085
// Just run on the folders that belong to this account
2086
2086
if (folder->accountState ()->account () != account) {
2087
2087
continue ;
2088
2088
}
2089
2089
2090
- qCInfo (lcFolderMan) << " Schedule folder" << folder << " for sync" ;
2090
+ qCInfo (lcFolderMan).nospace () << " scheduling sync account=" << account->displayName () << " folder=" << folder->alias () << " reason=notify_file" ;
2091
+ scheduleFolder (folder);
2092
+ }
2093
+ }
2094
+
2095
+ void FolderMan::slotProcessFileIdsPushNotification (Account *account, const QList<qint64> &fileIds)
2096
+ {
2097
+ qCDebug (lcFolderMan).nospace () << " received notify_file_id push notification account=" << account->displayName () << " fileIds=" << fileIds;
2098
+
2099
+ for (auto folder : std::as_const (_folderMap)) {
2100
+ // Just run on the folders that belong to this account
2101
+ if (folder->accountState ()->account () != account) {
2102
+ continue ;
2103
+ }
2104
+
2105
+ if (!folder->hasFileIds (fileIds)) {
2106
+ qCDebug (lcFolderMan).nospace () << " no matching file ids, ignoring account=" << account->displayName () << " folder=" << folder->alias ();
2107
+ continue ;
2108
+ }
2109
+
2110
+ qCInfo (lcFolderMan).nospace () << " scheduling sync account=" << account->displayName () << " folder=" << folder->alias () << " reason=notify_file_id" ;
2091
2111
scheduleFolder (folder);
2092
2112
}
2093
2113
}
@@ -2099,6 +2119,7 @@ void FolderMan::slotConnectToPushNotifications(const AccountPtr &account)
2099
2119
if (pushNotificationsFilesReady (account)) {
2100
2120
qCInfo (lcFolderMan) << " Push notifications ready" ;
2101
2121
connect (pushNotifications, &PushNotifications::filesChanged, this , &FolderMan::slotProcessFilesPushNotification, Qt::UniqueConnection);
2122
+ connect (pushNotifications, &PushNotifications::fileIdsChanged, this , &FolderMan::slotProcessFileIdsPushNotification, Qt::UniqueConnection);
2102
2123
}
2103
2124
}
2104
2125
0 commit comments