RoomVC: Show contextual menu on single tap.

This commit is contained in:
SBiOSoftWhare 2019-05-22 16:37:06 +02:00
parent 4bde8a435b
commit 6ce4a826be

View file

@ -2013,6 +2013,15 @@
// Handle here user actions on bubbles for Vector app // Handle here user actions on bubbles for Vector app
if (customizedRoomDataSource) if (customizedRoomDataSource)
{ {
id<MXKRoomBubbleCellDataStoring> bubbleData;
if ([cell isKindOfClass:[MXKRoomBubbleTableViewCell class]])
{
MXKRoomBubbleTableViewCell *roomBubbleTableViewCell = (MXKRoomBubbleTableViewCell*)cell;
bubbleData = roomBubbleTableViewCell.bubbleData;
}
if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnAvatarView]) if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnAvatarView])
{ {
selectedRoomMember = [self.roomDataSource.roomState.members memberWithUserId:userInfo[kMXKRoomBubbleCellUserIdKey]]; selectedRoomMember = [self.roomDataSource.roomState.members memberWithUserId:userInfo[kMXKRoomBubbleCellUserIdKey]];
@ -2056,8 +2065,15 @@
} }
else else
{ {
// Highlight this event in displayed message // Show contextual menu on single tap if bubble is not collapsed
[self selectEventWithId:tappedEvent.eventId]; if (bubbleData.collapsed)
{
[self selectEventWithId:tappedEvent.eventId];
}
else
{
[self showContextualMenuForEvent:tappedEvent cell:cell animated:YES];
}
} }
} }
} }
@ -2132,7 +2148,11 @@
else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellLongPressOnEvent]) else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellLongPressOnEvent])
{ {
MXEvent *tappedEvent = userInfo[kMXKRoomBubbleCellEventKey]; MXEvent *tappedEvent = userInfo[kMXKRoomBubbleCellEventKey];
[self handleLongPressFromCell:cell withTappedEvent:tappedEvent];
if (!bubbleData.collapsed)
{
[self handleLongPressFromCell:cell withTappedEvent:tappedEvent];
}
} }
else else
{ {