Add context menu item

This commit is contained in:
ismailgulek
2021-11-03 13:36:18 +03:00
parent 43f1ea73c5
commit f3923d89b1
10 changed files with 56 additions and 3 deletions
+19
View File
@@ -5922,6 +5922,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
return @[
[self copyMenuItemWithEvent:event andCell:cell],
[self replyMenuItemWithEvent:event],
[self replyInThreadMenuItemWithEvent:event],
[self editMenuItemWithEvent:event],
[self moreMenuItemWithEvent:event andCell:cell]
];
@@ -5931,6 +5932,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
return @[
[self copyMenuItemWithEvent:event andCell:cell],
[self replyMenuItemWithEvent:event],
[self replyInThreadMenuItemWithEvent:event],
[self editMenuItemWithEvent:event]
];
}
@@ -6232,6 +6234,23 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
return replyMenuItem;
}
- (RoomContextualMenuItem *)replyInThreadMenuItemWithEvent:(MXEvent*)event
{
MXWeakify(self);
RoomContextualMenuItem *item = [[RoomContextualMenuItem alloc] initWithMenuAction:RoomContextualMenuActionReplyInThread];
item.isEnabled = [self.roomDataSource canReplyToEventWithId:event.eventId] && !self.voiceMessageController.isRecordingAudio;
item.action = ^{
MXStrongifyAndReturnIfNil(self);
[self hideContextualMenuAnimated:YES cancelEventSelection:NO completion:nil];
// TODO: Implement starting a thread
};
return item;
}
- (RoomContextualMenuItem *)moreMenuItemWithEvent:(MXEvent*)event andCell:(id<MXKCellRendering>)cell
{
MXWeakify(self);