- /* Play a sound (if configured) and make the LED blink */
- if (changed & TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS)
- modest_platform_on_new_headers_received (NULL, FALSE);
-
- /* Check header removed (hide marked as DELETED headers) */
- if (changed & TNY_FOLDER_CHANGE_CHANGED_EXPUNGED_HEADERS) {
- modest_header_view_refilter (MODEST_HEADER_VIEW(priv->header_view));
+ if (change != NULL) {
+ TnyFolderChangeChanged changed;
+
+ changed = tny_folder_change_get_changed (change);
+ /* If something changes */
+ if ((changed) & TNY_FOLDER_CHANGE_CHANGED_ALL_COUNT)
+ folder_empty = (tny_folder_change_get_new_all_count (change) == 0);
+ else
+ folder_empty = (tny_folder_get_all_count (TNY_FOLDER (folder)) == 0);
+
+ /* Play a sound (if configured) and make the LED blink */
+ if (changed & TNY_FOLDER_CHANGE_CHANGED_ADDED_HEADERS) {
+ modest_platform_on_new_headers_received (NULL, FALSE);
+ }
+
+ /* Checks header removed (hide marked as DELETED headers) */
+ if (changed & TNY_FOLDER_CHANGE_CHANGED_EXPUNGED_HEADERS) {
+ modest_header_view_refilter (MODEST_HEADER_VIEW(priv->header_view));
+ }