Merge commit '2e9bb7067e9f1596f29b986729822184145906db' into feature/4068_merge_foss_1_9_15

# Conflicts:
#	Config/AppVersion.xcconfig
#	Podfile.lock
#	Riot/Assets/de.lproj/Localizable.strings
#	Riot/Modules/Room/RoomViewController.m
#	RiotNSE/NotificationService.swift
#	fastlane/Fastfile
This commit is contained in:
Frank Rotermund
2023-01-16 12:11:51 +01:00
144 changed files with 2870 additions and 431 deletions
@@ -16,3 +16,4 @@
#import "MXKImageView.h"
#import "MXKRoomBubbleCellData.h"
#import "UserIndicatorCancel.h"
#import "VoiceBroadcastInfo.h"
@@ -1916,8 +1916,15 @@ static NSArray<NSNumber*> *initialSyncSilentErrorsHTTPStatusCodes;
MXRoomSummary *summary = room.summary;
if (summary)
{
NSString *eventId = summary.lastMessage.eventId;
if (!eventId)
{
MXLogFailure(@"[MXKAccount] onDateTimeFormatUpdate: Missing event id");
continue;
}
dispatch_group_enter(dispatchGroup);
[summary.mxSession eventWithEventId:summary.lastMessage.eventId
[summary.mxSession eventWithEventId:eventId
inRoom:summary.roomId
success:^(MXEvent *event) {
@@ -148,6 +148,8 @@ static NSString *const kMXAppGroupID = @"group.org.matrix";
kMXEventTypeStringKeyVerificationDone,
kMXEventTypeStringPollStart,
kMXEventTypeStringPollStartMSC3381,
kMXEventTypeStringPollEnd,
kMXEventTypeStringPollEndMSC3381,
kMXEventTypeStringBeaconInfo,
kMXEventTypeStringBeaconInfoMSC3672
].mutableCopy;
@@ -181,6 +183,8 @@ static NSString *const kMXAppGroupID = @"group.org.matrix";
kMXEventTypeStringKeyVerificationDone,
kMXEventTypeStringPollStart,
kMXEventTypeStringPollStartMSC3381,
kMXEventTypeStringPollEnd,
kMXEventTypeStringPollEndMSC3381,
kMXEventTypeStringBeaconInfo,
kMXEventTypeStringBeaconInfoMSC3672
].mutableCopy;
@@ -2881,10 +2881,21 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
return NO;
}
if (event.eventType == MXEventTypePollStart) {
if (event.isTimelinePollEvent) {
return YES;
}
// Specific case for voice broadcast event
if (event.eventType == MXEventTypeCustom &&
[event.type isEqualToString:VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType]) {
// Ensures that we only support reactions for a start event
VoiceBroadcastInfo* voiceBroadcastInfo = [VoiceBroadcastInfo modelFromJSON: event.content];
if ([VoiceBroadcastInfo isStartedFor: voiceBroadcastInfo.state]) {
return YES;
}
}
BOOL isRoomMessage = (event.eventType == MXEventTypeRoomMessage);
if (!isRoomMessage) {
@@ -1606,6 +1606,23 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
}
break;
}
case MXEventTypePollEnd:
{
if (event.isEditEvent)
{
return nil;
}
MXEvent* pollStartedEvent = [self->mxSession.store eventWithEventId:event.relatesTo.eventId inRoom:event.roomId];
if (pollStartedEvent) {
displayText = [MXEventContentPollStart modelFromJSON:pollStartedEvent.content].question;
} else {
displayText = [VectorL10n pollTimelineEndedText];
}
break;
}
case MXEventTypePollStart:
{
if (event.isEditEvent)
@@ -1983,8 +2000,8 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
}
// Replace <mx-reply><blockquote><a href=\"__permalink__\">In reply to</a>
// By <mx-reply><blockquote><a href=\"#\">['In reply to' from resources]</a>
// To disable the link and to localize the "In reply to" string
// By <mx-reply><blockquote><a href=\"__permalink__\">['In reply to' from resources]</a>
// To localize the "In reply to" string
// This link is the first <a> HTML node of the html string
if (inReplyToTextRange.location != NSNotFound)
@@ -1992,11 +2009,6 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
html = [html stringByReplacingCharactersInRange:inReplyToTextRange withString:[VectorL10n noticeInReplyTo]];
}
if (inReplyToLinkRange.location != NSNotFound)
{
html = [html stringByReplacingCharactersInRange:inReplyToLinkRange withString:@"#"];
}
return html;
}