Skip to content

Commit

Permalink
add support for reactions on VB (#7179)
Browse files Browse the repository at this point in the history
  • Loading branch information
nimau committed Jan 6, 2023
1 parent daea28b commit 48cdd5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,11 @@ - (BOOL)canPerformActionOnEvent:(MXEvent*)event
return YES;
}

// Specific case for voice broadcast event
if (event.eventType == MXEventTypeCustom && [event.type isEqualToString:VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType]) {
return YES;
}

BOOL isRoomMessage = (event.eventType == MXEventTypeRoomMessage);

if (!isRoomMessage) {
Expand Down
6 changes: 4 additions & 2 deletions Riot/Modules/Room/CellData/RoomBubbleCellData.m
Original file line number Diff line number Diff line change
Expand Up @@ -634,9 +634,11 @@ - (NSInteger)firstVisibleComponentIndex
{
__block NSInteger firstVisibleComponentIndex = NSNotFound;

BOOL isPoll = (self.events.firstObject.eventType == MXEventTypePollStart);
MXEvent *firstEvent = self.events.firstObject;
BOOL isPoll = (firstEvent.eventType == MXEventTypePollStart);
BOOL isVoiceBroadcast = (firstEvent.eventType == MXEventTypeCustom && [firstEvent.type isEqualToString: VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType]);

if ((isPoll || self.attachment) && self.bubbleComponents.count)
if ((isPoll || self.attachment || isVoiceBroadcast) && self.bubbleComponents.count)
{
firstVisibleComponentIndex = 0;
}
Expand Down
1 change: 1 addition & 0 deletions changelog.d/7179.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Voice Broadcast: allow to react on Voice Broadcast.

0 comments on commit 48cdd5f

Please sign in to comment.