File tree Expand file tree Collapse file tree 2 files changed +26
-21
lines changed
Riot/Modules/MatrixKit/Utils/EventFormatter Expand file tree Collapse file tree 2 files changed +26
-21
lines changed Original file line number Diff line number Diff line change @@ -833,35 +833,39 @@ - (NSAttributedString *)attributedStringFromEvent:(MXEvent*)event
833
833
NSString *creatorId;
834
834
MXJSONModelSetString (creatorId, event.content [@" creator" ]);
835
835
836
- if (creatorId)
836
+ if (! creatorId)
837
837
{
838
- if ([creatorId isEqualToString: mxSession.myUserId])
838
+ // Room version 11 removes `creator` in favour of `sender`.
839
+ // https://github.com/matrix-org/matrix-spec-proposals/pull/2175
840
+ creatorId = event.sender ;
841
+ }
842
+
843
+ if ([creatorId isEqualToString: mxSession.myUserId])
844
+ {
845
+ if (isRoomDirect)
839
846
{
840
- if (isRoomDirect)
841
- {
842
- displayText = [VectorL10n noticeRoomCreatedByYouForDm ];
843
- }
844
- else
845
- {
846
- displayText = [VectorL10n noticeRoomCreatedByYou ];
847
- }
847
+ displayText = [VectorL10n noticeRoomCreatedByYouForDm ];
848
848
}
849
849
else
850
850
{
851
- if (isRoomDirect)
852
- {
853
- displayText = [VectorL10n noticeRoomCreatedForDm: (roomState ? [roomState.members memberName: creatorId] : creatorId)];
854
- }
855
- else
856
- {
857
- displayText = [VectorL10n noticeRoomCreated: (roomState ? [roomState.members memberName: creatorId] : creatorId)];
858
- }
851
+ displayText = [VectorL10n noticeRoomCreatedByYou ];
859
852
}
860
- // Append redacted info if any
861
- if (redactedInfo)
853
+ }
854
+ else
855
+ {
856
+ if (isRoomDirect)
862
857
{
863
- displayText = [NSString stringWithFormat: @" %@ %@ " , displayText, redactedInfo ];
858
+ displayText = [VectorL10n noticeRoomCreatedForDm: (roomState ? [roomState.members memberName: creatorId] : creatorId) ];
864
859
}
860
+ else
861
+ {
862
+ displayText = [VectorL10n noticeRoomCreated: (roomState ? [roomState.members memberName: creatorId] : creatorId)];
863
+ }
864
+ }
865
+ // Append redacted info if any
866
+ if (redactedInfo)
867
+ {
868
+ displayText = [NSString stringWithFormat: @" %@ %@ " , displayText, redactedInfo];
865
869
}
866
870
break ;
867
871
}
Original file line number Diff line number Diff line change
1
+ Fix a crash when opening v11 rooms.
You can’t perform that action at this time.
0 commit comments