Abu Qays narrates: Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) entered the mosque on Friday wearing clean, fine white clothes. He looked at a place where there was room and sat down there; he did not step over anyone's neck. Then the imam came out, and at that moment two men were talking. He picked up some pebbles and threw them at the two of them. They looked at Sayyiduna Abdullah and fell silent. When the imam came down from the pulpit, Sayyiduna Abdullah (may Allah be pleased with him) said: "Do you two not know that you were in a state of prayer?"
Al-Tabarani recorded it in al-Mu'jam al-Kabir; its chain contains a narrator whose biography I have not found.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 3133