element-hq / element-hq/element-ios
Updating the RoomDataSource to exclude some message bubbles from rendering still leaves blank space
- Dominant language
- Swift
- Stars
- 1.8k
- Forks
- 544
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
I am working on a functionality to remove some messages from the data source or not render some messages based on event ids. First of all i cant find the point at which messages are added to the table datasource.
```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
...
NSArray *DeletedEventsOfRoom = [[NSUserDefaults standardUserDefaults] objectForKey:@"DeletedEventsOfRoom"];
if(DeletedEventsOfRoom){
NSArray *bubbleEvents = roomBubbleCellData.events;
for(MXEvent *tempEvent in bubbleEvents){
if([DeletedEventsOfRoom containsObject:tempEvent.eventId]){
UITableViewCell *cell = [UITableViewCell new];
cell.hidden = YES;
return cell;
}
}
}
...
```
This hides the bubble but keeps the empty space of the bubble. Can anyone tell me from where can I just remove those messages from the room data source instead of hiding them from the UI.
### Outcome
I am working on a functionality to remove some messages from the data source or not render some messages based on event ids. First of all i cant find the point at which messages are added to the table datasource.
This hides the bubble but keeps the empty space of the bubble. Can anyone tell me from where can I just remove those messages from the room data source instead of hiding them from the UI.
### Your phone model
_No response_
### Operating system version
_No response_
### Application version
_No response_
### Homeserver
_No response_
### Will you send logs?
No
Contributor guide
Research direction
Start at tableView:cellForRowAtIndexPath: and inspect how roomBubbleCellData.events is populated for the room table data source. Trace the message collection from that entry point and determine where event IDs could be excluded before rendering; done means excluded messages no longer leave blank table space.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100