mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Audio Timeline Item support (#612)
* audio timeline item support * improved the code to reduce cognitive complexity * no need anymore for this swiftlint disabling of a rule * pr comments
This commit is contained in:
@@ -53,3 +53,9 @@ extension VideoMessageContent: CustomStringConvertible {
|
||||
String(describing: Self.self)
|
||||
}
|
||||
}
|
||||
|
||||
extension AudioMessageContent: CustomStringConvertible {
|
||||
public var description: String {
|
||||
String(describing: Self.self)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,3 +149,16 @@ extension MessageTimelineItem where Content == MatrixRustSDK.FileMessageContent
|
||||
return .init(source: src)
|
||||
}
|
||||
}
|
||||
|
||||
extension MatrixRustSDK.AudioMessageContent: MessageContentProtocol { }
|
||||
|
||||
/// A timeline item that represents an `m.room.message` event with a `msgtype` of `m.audio`.
|
||||
extension MessageTimelineItem where Content == MatrixRustSDK.AudioMessageContent {
|
||||
var source: MediaSourceProxy {
|
||||
.init(source: content.source)
|
||||
}
|
||||
|
||||
var duration: UInt64 {
|
||||
content.info?.duration ?? 0
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user