All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
The handshake of these two people in front of someone who is praying so that their hands meet each other in front of his Qiblah is considered to be equivalent to them passing in front of him. They are sinful for doing this.
Ad-Dusooqi the Maaliki said, "As such, sinful is the one who exchanges something by his hand with another person in front of the one who is praying. The same is said of the one who speaks from one side of the one who is praying to someone on his other side."
Allah knows best.