mirror of
https://github.com/mastodon/mastodon-ios
synced 2025-04-11 22:58:02 +02:00
32 lines
730 B
Swift
32 lines
730 B
Swift
//
|
|
// MastodonEmoji.swift
|
|
//
|
|
//
|
|
// Created by MainasuK on 2022-4-14.
|
|
//
|
|
|
|
import Foundation
|
|
import CoreDataStack
|
|
import MastodonMeta
|
|
import MastodonSDK
|
|
|
|
extension Collection where Element == MastodonEmoji {
|
|
public var asDictionary: MastodonContent.Emojis {
|
|
var dictionary: MastodonContent.Emojis = [:]
|
|
for emoji in self {
|
|
dictionary[emoji.code] = emoji.url
|
|
}
|
|
return dictionary
|
|
}
|
|
}
|
|
|
|
extension Collection where Element == Mastodon.Entity.Emoji {
|
|
public var asDictionary: MastodonContent.Emojis {
|
|
var dictionary: MastodonContent.Emojis = [:]
|
|
for emoji in self {
|
|
dictionary[emoji.shortcode] = emoji.url
|
|
}
|
|
return dictionary
|
|
}
|
|
}
|