@staticmethod
def mimetype_to_msgtype(mimetype):
    """Turn a mimetype into a matrix message type."""
    if mimetype.startswith('image'):
        return 'm.image'
    elif mimetype.startswith('video'):
        return 'm.video'
    elif mimetype.startswith('audio'):
        return 'm.audio'
    return 'm.file'
