Files
VOREStation/code/modules/tgs/v5/serializers.dm
T
Selis 355c8ca5f0 DMAPI Update (#17935)
* DMAPI Update

* Fix

* More changes

* InitTgs

* .

* css

* urg

* fix that

* some linux fixes

* .

* .

* .

* update

* .

* pref fixing

* .

* those are already sent

* .

* .

* .

* fully off

* fix that

* New classes & Format

* make this nicer

* CSS Edits

* .

* eh use switch

* .

* Update client procs.dm

* Hard restart counter

* Improved Staffwho style

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-07-02 22:21:14 +02:00

60 lines
1.6 KiB
Plaintext

/datum/tgs_message_content/proc/_interop_serialize()
return list("text" = text, "embed" = embed ? embed._interop_serialize() : null)
/datum/tgs_chat_embed/proc/_interop_serialize()
CRASH("Base /proc/interop_serialize called on [type]!")
/datum/tgs_chat_embed/structure/_interop_serialize()
var/list/serialized_fields
if(istype(fields, /list))
serialized_fields = list()
for(var/datum/tgs_chat_embed/field/field as anything in fields)
serialized_fields += list(field._interop_serialize())
return list(
"title" = title,
"description" = description,
"url" = url,
"timestamp" = timestamp,
"colour" = colour,
"image" = src.image ? src.image._interop_serialize() : null,
"thumbnail" = thumbnail ? thumbnail._interop_serialize() : null,
"video" = video ? video._interop_serialize() : null,
"footer" = footer ? footer._interop_serialize() : null,
"provider" = provider ? provider._interop_serialize() : null,
"author" = author ? author._interop_serialize() : null,
"fields" = serialized_fields
)
/datum/tgs_chat_embed/media/_interop_serialize()
return list(
"url" = url,
"width" = width,
"height" = height,
"proxyUrl" = proxy_url
)
/datum/tgs_chat_embed/provider/_interop_serialize()
return list(
"url" = url,
"name" = name
)
/datum/tgs_chat_embed/provider/author/_interop_serialize()
. = ..()
.["iconUrl"] = icon_url
.["proxyIconUrl"] = proxy_icon_url
/datum/tgs_chat_embed/footer/_interop_serialize()
return list(
"text" = text,
"iconUrl" = icon_url,
"proxyIconUrl" = proxy_icon_url
)
/datum/tgs_chat_embed/field/_interop_serialize()
return list(
"name" = name,
"value" = value,
"isInline" = is_inline
)