@@ -266,47 +266,46 @@ - (void)fetchEncryptionTrustedLevel
266
266
267
267
- (BOOL )shouldQueueEventForProcessing : (MXEvent *)event roomState : (MXRoomState *)roomState direction : (MXTimelineDirection)direction
268
268
{
269
- // Tchap: Disable Threads
270
- // if (self.threadId)
271
- // {
272
- // // if in a thread, ignore non-root event or events from other threads
273
- // if (![event.eventId isEqualToString:self.threadId] && ![event.threadId isEqualToString:self.threadId])
274
- // {
275
- // // Ignore the event
276
- // return NO;
277
- // }
278
- // // also ignore events related to un-threaded or events from other threads
279
- // if (!event.isInThread && event.relatesTo.eventId)
280
- // {
281
- // MXEvent *relatedEvent = [self.mxSession.store eventWithEventId:event.relatesTo.eventId
282
- // inRoom:event.roomId];
283
- // if (![relatedEvent.threadId isEqualToString:self.threadId])
284
- // {
285
- // // ignore the event
286
- // return NO;
287
- // }
288
- // }
289
- // }
290
- // else if (RiotSettings.shared.enableThreads)
291
- // {
292
- // // if not in a thread, ignore all threaded events
293
- // if (event.isInThread)
294
- // {
295
- // // ignore the event
296
- // return NO;
297
- // }
298
- // // also ignore events related to threaded events
299
- // if (event.relatesTo.eventId)
300
- // {
301
- // MXEvent *relatedEvent = [self.mxSession.store eventWithEventId:event.relatesTo.eventId
302
- // inRoom:event.roomId];
303
- // if (relatedEvent.isInThread)
304
- // {
305
- // // ignore the event
306
- // return NO;
307
- // }
308
- // }
309
- // }
269
+ if (self.threadId )
270
+ {
271
+ // if in a thread, ignore non-root event or events from other threads
272
+ if (![event.eventId isEqualToString: self .threadId] && ![event.threadId isEqualToString: self .threadId])
273
+ {
274
+ // Ignore the event
275
+ return NO ;
276
+ }
277
+ // also ignore events related to un-threaded or events from other threads
278
+ if (!event.isInThread && event.relatesTo .eventId )
279
+ {
280
+ MXEvent *relatedEvent = [self .mxSession.store eventWithEventId: event.relatesTo.eventId
281
+ inRoom: event.roomId];
282
+ if (![relatedEvent.threadId isEqualToString: self .threadId])
283
+ {
284
+ // ignore the event
285
+ return NO ;
286
+ }
287
+ }
288
+ }
289
+ else if (RiotSettings.shared .enableThreads )
290
+ {
291
+ // if not in a thread, ignore all threaded events
292
+ if (event.isInThread )
293
+ {
294
+ // ignore the event
295
+ return NO ;
296
+ }
297
+ // also ignore events related to threaded events
298
+ if (event.relatesTo .eventId )
299
+ {
300
+ MXEvent *relatedEvent = [self .mxSession.store eventWithEventId: event.relatesTo.eventId
301
+ inRoom: event.roomId];
302
+ if (relatedEvent.isInThread )
303
+ {
304
+ // ignore the event
305
+ return NO ;
306
+ }
307
+ }
308
+ }
310
309
311
310
return [super shouldQueueEventForProcessing: event roomState: roomState direction: direction];
312
311
}
@@ -478,26 +477,25 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
478
477
cellData: cellData contentViewPositionY: bottomPositionY upperDecorationView: urlPreviewView];
479
478
}
480
479
481
- // Tchap: Disable Threads
482
- // ThreadSummaryView *threadSummaryView;
483
- //
484
- // // display thread summary view if the component has a thread in the room timeline
485
- // if (RiotSettings.shared.enableThreads && component.thread && !self.threadId)
486
- // {
487
- // threadSummaryView = [[ThreadSummaryView alloc] initWithThread:component.thread
488
- // session:self.mxSession];
489
- // threadSummaryView.delegate = self;
490
- // threadSummaryView.tag = index;
491
- //
492
- // [temporaryViews addObject:threadSummaryView];
493
- // UIView *upperDecorationView = reactionsView ?: urlPreviewView;
494
- //
495
- // [cellDecorator addThreadSummaryView:threadSummaryView
496
- // toCell:bubbleCell
497
- // cellData:cellData
498
- // contentViewPositionY:bottomPositionY
499
- // upperDecorationView:upperDecorationView];
500
- // }
480
+ ThreadSummaryView *threadSummaryView;
481
+
482
+ // display thread summary view if the component has a thread in the room timeline
483
+ if (RiotSettings.shared .enableThreads && component.thread && !self.threadId )
484
+ {
485
+ threadSummaryView = [[ThreadSummaryView alloc ] initWithThread: component.thread
486
+ session: self .mxSession];
487
+ threadSummaryView.delegate = self;
488
+ threadSummaryView.tag = index;
489
+
490
+ [temporaryViews addObject: threadSummaryView];
491
+ UIView *upperDecorationView = reactionsView ?: urlPreviewView;
492
+
493
+ [cellDecorator addThreadSummaryView: threadSummaryView
494
+ toCell: bubbleCell
495
+ cellData: cellData
496
+ contentViewPositionY: bottomPositionY
497
+ upperDecorationView: upperDecorationView];
498
+ }
501
499
502
500
MXKReceiptSendersContainer* avatarsContainer;
503
501
@@ -1213,12 +1211,11 @@ - (void)didCloseURLPreviewView:(URLPreviewView *)previewView for:(NSString *)eve
1213
1211
1214
1212
#pragma mark - ThreadSummaryViewDelegate
1215
1213
1216
- // Tchap: Disable Threads
1217
- // - (void)threadSummaryViewTapped:(ThreadSummaryView *)summaryView
1218
- // {
1219
- // [self.roomDataSourceDelegate roomDataSource:self
1220
- // didTapThread:summaryView.thread];
1221
- // }
1214
+ - (void )threadSummaryViewTapped : (ThreadSummaryView *)summaryView
1215
+ {
1216
+ [self .roomDataSourceDelegate roomDataSource: self
1217
+ didTapThread: summaryView.thread];
1218
+ }
1222
1219
1223
1220
#pragma mark - Location sharing
1224
1221
0 commit comments