The cache size did not include the media one (it was only the Matrix SDK one)

This commit is contained in:
ylecollen
2015-01-09 17:14:09 +01:00
parent 25d36367de
commit 4ec4be80e3
5 changed files with 54 additions and 2 deletions
+10 -1
View File
@@ -22,6 +22,8 @@
#import "MXFileStore.h"
#import "MXTools.h"
#import "MediaManager.h"
NSString *const kMatrixHandlerUnsupportedMessagePrefix = @"UNSUPPORTED MSG: ";
static MatrixHandler *sharedHandler = nil;
@@ -280,6 +282,9 @@ static MatrixHandler *sharedHandler = nil;
[[AppDelegate theDelegate].masterTabBarController popRoomViewControllerAnimated:NO];
if (clearCache) {
// clear the media cache
[MediaManager clearCache];
[_mxFileStore deleteAllData];
}
@@ -787,7 +792,7 @@ static MatrixHandler *sharedHandler = nil;
return nil;
}
-(NSUInteger) MXCacheSize {
- (NSUInteger) MXCacheSize {
if (self.mxFileStore) {
return self.mxFileStore.diskUsage;
@@ -796,6 +801,10 @@ static MatrixHandler *sharedHandler = nil;
return 0;
}
- (NSUInteger) cachesSize {
return self.MXCacheSize + [MediaManager cacheSize];
}
- (CGFloat)getPowerLevel:(MXRoomMember *)roomMember inRoom:(MXRoom *)room {
CGFloat powerLevel = 0;