mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2024-12-15 18:29:36 +01:00
27 lines
643 B
Swift
27 lines
643 B
Swift
//
|
|
// MastodonEmojiContainer.swift
|
|
// MastodonEmojiContainer
|
|
//
|
|
// Created by Cirno MainasuK on 2021-9-3.
|
|
// Copyright © 2021 Twidere. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import MastodonSDK
|
|
import CoreDataStack
|
|
|
|
public protocol MastodonEmojiContainer {
|
|
var emojis: [Mastodon.Entity.Emoji]? { get }
|
|
}
|
|
|
|
extension MastodonEmojiContainer {
|
|
public var mastodonEmojis: [MastodonEmoji] {
|
|
return emojis.flatMap { emojis in
|
|
emojis.map { MastodonEmoji(emoji: $0) }
|
|
} ?? []
|
|
}
|
|
}
|
|
|
|
extension Mastodon.Entity.Account: MastodonEmojiContainer { }
|
|
extension Mastodon.Entity.Status: MastodonEmojiContainer { }
|