Mustadrak al-Hakim 309
Abū al-ʿAbbās Muḥammad b. Yaʿqūb > Muḥammad b. ʿAbdullāh b. ʿAbd al-Ḥakam > Ibn Wahb > Abū Ṣakhr > Saʿīd al-Maqburī > Abū Hurayrah
"From the Prophet ﷺ, he said: 'Whoever comes to our mosque to learn or teach, then he is like a Mujahid in the way of Allah. And whoever comes for other than this, he is like a person who sees something he likes but does not possess it. Perhaps he will say: 'He sees those who are praying but he is not one of them, and he sees those who are remembering Allah but he is not one of them.' This hadith was narrated by Abu Sa'd and it is on their conditions (referring to the narrators) and I do not know any faults in it." – Sound Chain per Bukhārī and Muslim
حَدَّثَنَا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ أَنْبَأَ مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ عَبْدِ الْحَكَمِ أَنْبَأَ ابْنُ وَهْبٍ أَخْبَرَنَا أَبُو صَخْرٍ عَنْ سَعِيدٍ الْمَقْبُرِيِّ عَنْ أَبِي هُرَيْرَةَ
عَنِ النَّبِيِّ ﷺ قَالَ مَنْ جَاءَ مَسْجِدَنَا هَذَا يَتَعَلَّمُ خَيْرًا أَوْ يُعَلِّمُهُ فَهُوَ كَالْمُجَاهِدِ فِي سَبِيلِ اللَّهِ وَمَنْ جَاءَ بِغَيْرِ هَذَا كَانَ كَالرَّجُلِ يَرَى الشَّيْءَ يُعْجِبُهُ وَلَيْسَ لَهُ وَرُبَّمَا قَالَ يَرَى الْمُصَلِّينَ وَلَيْسَ مِنْهُمْ وَيَرَى الذَّاكِرِينَ وَلَيْسَ مِنْهُمْ تابعه حيوة عن أبي صخر وهو على شرطهما ولا أعلم له علة – على شرط البخاري ومسلم