mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Add CustomStringConvertible conformances to timeline item contents
This commit is contained in:
@@ -8,9 +8,22 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
nonisolated enum TimelineEventContent: Hashable {
|
nonisolated enum TimelineEventContent: Hashable, CustomStringConvertible {
|
||||||
case message(EventBasedMessageTimelineItemContentType)
|
case message(EventBasedMessageTimelineItemContentType)
|
||||||
case poll(question: String)
|
case poll(question: String)
|
||||||
case liveLocation
|
case liveLocation
|
||||||
case redacted
|
case redacted
|
||||||
|
|
||||||
|
var description: String {
|
||||||
|
switch self {
|
||||||
|
case .message(let eventBasedMessageTimelineItemContentType):
|
||||||
|
eventBasedMessageTimelineItemContentType.description
|
||||||
|
case .poll:
|
||||||
|
"poll"
|
||||||
|
case .liveLocation:
|
||||||
|
"liveLocation"
|
||||||
|
case .redacted:
|
||||||
|
"redacted"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-1
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
nonisolated enum EventBasedMessageTimelineItemContentType: Hashable {
|
nonisolated enum EventBasedMessageTimelineItemContentType: Hashable, CustomStringConvertible {
|
||||||
case audio(AudioRoomTimelineItemContent)
|
case audio(AudioRoomTimelineItemContent)
|
||||||
case emote(EmoteRoomTimelineItemContent)
|
case emote(EmoteRoomTimelineItemContent)
|
||||||
case file(FileRoomTimelineItemContent)
|
case file(FileRoomTimelineItemContent)
|
||||||
@@ -19,6 +19,31 @@ nonisolated enum EventBasedMessageTimelineItemContentType: Hashable {
|
|||||||
case location(LocationRoomTimelineItemContent)
|
case location(LocationRoomTimelineItemContent)
|
||||||
case voice(AudioRoomTimelineItemContent)
|
case voice(AudioRoomTimelineItemContent)
|
||||||
case gallery(GalleryRoomTimelineItemContent)
|
case gallery(GalleryRoomTimelineItemContent)
|
||||||
|
|
||||||
|
var description: String {
|
||||||
|
switch self {
|
||||||
|
case .audio:
|
||||||
|
"audio"
|
||||||
|
case .emote:
|
||||||
|
"emote"
|
||||||
|
case .file:
|
||||||
|
"file"
|
||||||
|
case .image:
|
||||||
|
"image"
|
||||||
|
case .notice:
|
||||||
|
"notice"
|
||||||
|
case .text:
|
||||||
|
"text"
|
||||||
|
case .video:
|
||||||
|
"video"
|
||||||
|
case .location:
|
||||||
|
"location"
|
||||||
|
case .voice:
|
||||||
|
"voice"
|
||||||
|
case .gallery:
|
||||||
|
"gallery"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nonisolated protocol EventBasedMessageTimelineItemProtocol: EventBasedTimelineItemProtocol {
|
nonisolated protocol EventBasedMessageTimelineItemProtocol: EventBasedTimelineItemProtocol {
|
||||||
|
|||||||
Reference in New Issue
Block a user