listener: Adapt decoding behavior depending on the object type
This fixes issues regarding origin/origin_visit