Being able to merge them even if they aren’t both visible in the same page of your feed or even just efficiently looking up cross-posts would probably need server assistance. Ideally it could be done in a way that a client could choose to or not to merge them.