public fun Attachment.giphyInfo(field: GiphyInfoType): GiphyInfo? { val giphyInfoMap =(extraData[ModelType.attach_giphy] as? Map<String, Any>?)?.get(field.value) as? Map<String, String>? return giphyInfoMap?.let { map -> GiphyInfo( url = map["url"] ?: "", width = getGiphySize(map, "width", Utils.dpToPx(GIPHY_INFO_DEFAULT_WIDTH_DP)), height = getGiphySize(map, "height", Utils.dpToPx(GIPHY_INFO_DEFAULT_HEIGHT_DP)) ) } }
Returns an object containing extra information about the Giphy image based on its type.