I heard the Messenger of Allah (May peace be upon him) as saying; if anyone hears a man crying out in the mosque about something he has lost, he should say: May Allah not restore it to you, for the mosque were not built for this.
سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ مَنْ سَمِعَ رَجُلاً يَنْشُدُ ضَالَّةً فِي الْمَسْجِدِ فَلْيَقُلْ لاَ أَدَّاهَا اللَّهُ إِلَيْكَ فَإِنَّ الْمَسَاجِدَ لَمْ تُبْنَ لِهَذَا