element-hq / element-ios

A glossy Matrix collaboration client for iOS
https://element.io
GNU Affero General Public License v3.0
1.73k stars 492 forks source link

Updating the RoomDataSource to exclude some message bubbles from rendering still leaves blank space #7661

Open vishu1034 opened 1 year ago

vishu1034 commented 1 year ago

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<MXEvent *> *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