# Path: chat/asset.py
# def sign_asset_url(name):
#     signer = get_signer()
#     return signer.sign(name)


from skygear.encoding import serialize_record as skyserialize
from .asset import sign_asset_url



def serialize_record(record):
    r = skyserialize(record)
    if 'attachment' in r:

# Path: chat/asset.py
# def sign_asset_url(name):
#     signer = get_signer()
#     return signer.sign(name)


# Path: chat/encoding.py
from skygear.encoding import serialize_record as skyserialize
from .asset import sign_asset_url




def serialize_record(record):
    r = skyserialize(record)
    if 'attachment' in r:

        r['attachment']['$url'] = sign_asset_url(r['attachment']['$name'])