-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor theTimelineItemIdentifier
handling
#3418
Conversation
Generated by 🚫 Danger Swift against d357fd9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Would be nice to have our own EventOrTransactionID
enum so we have ID
everywhere instead of Id
but no need right now.
@@ -283,9 +284,14 @@ extension FormatType { | |||
} | |||
|
|||
enum ComposerMode: Equatable { | |||
enum EditSource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could call this EditActionSource
if you think it makes the timeline
case clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ComposerMode.EditActionSource
is clear enough
|
||
extension RoomTimelineControllerProtocol { | ||
func sendMessage(_ message: String, | ||
html: String?, | ||
intentionalMentions: IntentionalMentions) async { | ||
await sendMessage(message, | ||
html: html, | ||
inReplyTo: nil, | ||
intentionalMentions: intentionalMentions) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what was wrong with this, seems like a reasonable thing to use when you don't want to reply?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found them extra to be honest. On the highest level they're both called from the same place and each variant evetually trickles down into the same timeline one.
|
||
extension TimelineProxyProtocol { | ||
func sendMessage(_ message: String, | ||
html: String?, | ||
intentionalMentions: IntentionalMentions) async -> Result<Void, TimelineProxyError> { | ||
await sendMessage(message, | ||
html: html, | ||
inReplyTo: nil, | ||
intentionalMentions: intentionalMentions) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
if case let .event(eventTimelineItem) = item { | ||
switch eventTimelineItem.id { | ||
case .event(_, let identifier): | ||
if identifier == eventOrTransactionID { | ||
return eventTimelineItem.item | ||
} | ||
default: | ||
break | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be slightly cleaner:
if case let .event(eventTimelineItem) = item { | |
switch eventTimelineItem.id { | |
case .event(_, let identifier): | |
if identifier == eventOrTransactionID { | |
return eventTimelineItem.item | |
} | |
default: | |
break | |
} | |
} | |
if case let .event(eventTimelineItem) = item, | |
case let .event(_, identifier) = eventTimelineItem.id, | |
identifier == eventOrTransactionID { | |
return eventTimelineItem.item | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup yup, nice, thank you!
return SeparatorRoomTimelineItem(id: .init(uniqueID: dateString), text: dateString) | ||
return SeparatorRoomTimelineItem(id: .virtual(uniqueID: uniqueID), text: dateString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just want to highlight that this changed from dateString
to uniqueID
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did yes, but I think that's correct as the uniqueID
is what rust actually uses for that timeline item, no?
68527d7
to
290db72
Compare
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
…al `EventOrTransactionId`s and be explicit when setting composer modes from the draft service.
290db72
to
d357fd9
Compare
Quality Gate passedIssues Measures |
EventOrTransactionId
s and be explicit when setting composer modes from the draft service.