-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flescio/7253 add mar kas unread option for rooms #1696
Flescio/7253 add mar kas unread option for rooms #1696
Conversation
As discussed elsewhere I would suggest two improvements:
|
Codecov ReportBase: 37.51% // Head: 17.40% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #1696 +/- ##
============================================
- Coverage 37.51% 17.40% -20.11%
============================================
Files 609 610 +1
Lines 95165 95430 +265
Branches 41297 40200 -1097
============================================
- Hits 35701 16613 -19088
- Misses 58423 78310 +19887
+ Partials 1041 507 -534
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left just a few comments regarding style, naming and consistency, but the overal change looks good to me
It will set the entire room as unread. | ||
This is only local since it's not possible to remove from the server the read events. | ||
*/ | ||
-(void)setUnread; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to align with the MXStore
api, either having set/resetUnread
or set/resetUnreadMarker
everywhere
MatrixSDK/Data/MXRoom.m
Outdated
- (void)setUnread | ||
{ | ||
[mxSession.store setUnreadMarkerForRoom:self.roomId]; | ||
[mxSession.store commit]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably won't be an issue in practice (store
is always MXFileStore
), but commit
is marked as optional
on the protocol, so should be surrounded with if ([mxSession.store respondsToSelector:@selector(commit)])
for safety as is done elsewhere in that file
@@ -998,6 +1000,36 @@ - (RoomThreadedReceiptsStore*)getOrCreateRoomThreadedReceiptsStore:(NSString*)ro | |||
return threadedStore; | |||
} | |||
|
|||
- (void)setUnreadMarkerForRoom:(nonnull NSString*)roomId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these 2 methods just call super
there is no need to override them, and can be safely deleted.
MatrixSDK/MXSession.h
Outdated
/** | ||
it will return if the room is marked unread by the user | ||
*/ | ||
- (BOOL) isRoomMarkedAsUnread:(NSString*)roomId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove space (BOOL) isRoom...
=> (BOOL)isRoom...
for consistency
@@ -879,6 +880,101 @@ - (void)testUpgrade | |||
}]; | |||
} | |||
|
|||
- (void)testMarkUnread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to include tests for this 👍
Needed for element-hq/element-ios#7253