Mosques and places of Prayer - Section 2 Mishkat al-Masabih 733

Arabic hadith text
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ:" إِذَا رَأَيْتُمْ مَنْ يَبِيعُ أَوْ يَبْتَاعُ فِي الْمَسْجِدِ فَقُولُوا: لَا أَرْبَحَ اللَّهُ تِجَارَتَكَ. وَإِذَا رَأَيْتُمْ مَنْ يَنْشُدُ فِيهِ ضَالَّةً فَقُولُوا: لَا رَدَّ اللَّهُ عَلَيْكَ ". رَوَاهُ التِّرْمِذِيُّ وَالدَّارِمِيُّ
Translation
Abu Huraira reported God’s Messenger as saying

When you see anyone buying or selling in a mosque, say, “May God not make your trading profitable!” And when you see anyone calling out in it about something lost, say, “May God not restore it to you.” Tirmidhi and Darimi transmitted it.