MESSENGER-4390 fix message forwarding and disable permalinks for messages in private rooms

This commit is contained in:
JanNiklas Grabowski
2023-06-22 10:33:41 +02:00
parent c9296cc3a9
commit 9e381a804f
+5 -7
View File
@@ -4132,9 +4132,7 @@ static CGSize kThreadListBarButtonItemImageSize;
if (selectedEvent.sentState == MXEventSentStateSent &&
!selectedEvent.isTimelinePollEvent &&
// Forwarding of live-location shares still to be implemented
selectedEvent.eventType != MXEventTypeBeaconInfo &&
// bwi #4390: remove forwarding action if room is private
![self.roomDataSource.room.summary.joinRule isEqualToString: kMXRoomJoinRuleInvite])
selectedEvent.eventType != MXEventTypeBeaconInfo)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeForward
action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
@@ -4186,9 +4184,7 @@ static CGSize kThreadListBarButtonItemImageSize;
if (selectedEvent.sentState == MXEventSentStateSent && (attachment.type == MXKAttachmentTypeFile ||
attachment.type == MXKAttachmentTypeImage ||
attachment.type == MXKAttachmentTypeVideo ||
attachment.type == MXKAttachmentTypeVoiceMessage) &&
// bwi #4390: remove forwarding action if room is private
![self.roomDataSource.room.summary.joinRule isEqualToString: kMXRoomJoinRuleInvite]) {
attachment.type == MXKAttachmentTypeVoiceMessage)) {
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeForward
action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
style:UIAlertActionStyleDefault
@@ -4346,7 +4342,9 @@ static CGSize kThreadListBarButtonItemImageSize;
}
}
if (BWIBuildSettings.shared.messageDetailsAllowPermalink && !(self.roomDataSource.room.isDirect || self.roomDataSource.room.isPersonalNotesRoom || self.roomDataSource.room.summary.membership == MXMembershipInvite))
if (BWIBuildSettings.shared.messageDetailsAllowPermalink && !(self.roomDataSource.room.isDirect || self.roomDataSource.room.isPersonalNotesRoom ||
// bwi #4390: remove permalink action if room is private
[self.roomDataSource.room.summary.joinRule isEqualToString: kMXRoomJoinRuleInvite]))
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypePermalink
action:[UIAlertAction actionWithTitle:[BWIL10n roomEventActionPermalink]