Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
suyuti:2662a
Request/Fix translation

  

السيوطي:٢٦٦٢a

"إذَا مررْتَ بالمجلِس فسلِّم عَلَى أهْله، فإِنْ يكونُوا في خيرٍ كُنْتَ شريكَهُمْ، وإنْ يَكُونوا في غيرِ ذلكَ كانَ لكَ أجرٌ".  

[طب] الطبرانى في الكبير عن معاوية بن قرةَ عن أبيه

See similar narrations below:

Collected by Ṭabarānī
tabarani:16172ʿAlī b. ʿAbd al-ʿAzīz > ʿUmar b. Yazīd al-Shaybānī > Ḥammād b. ʿAbd al-Raḥman al-Mālikī > Muʿāwiyah b. Qurrah

[Machine] "My father said, 'When you pass by a gathering, greet its occupants, for if they are in a state of goodness, you will share in their reward. But if they are not, you will be rewarded for your own actions.' This is what I heard the Messenger of Allah ﷺ say."  

الطبراني:١٦١٧٢حَدَّثَنَا عَلِيُّ بْنُ عَبْدِ الْعَزِيزِ ثنا عُمَرُ بْنُ يَزِيدَ الشَّيْبَانِيُّ ثنا حَمَّادُ بْنُ عَبْدِ الرَّحْمَنِ الْمَالِكِيُّ عَنْ مُعَاوِيَةَ بْنِ قُرَّةَ قَالَ قَالَ

أَبِي «إِذَا مَرَرْتَ بِالْمَجْلِسِ فَسَلِّمْ عَلَى أَهْلِهِ فَإِنْ يَكُونُوا فِي خَيْرٍ فَأَنْتَ شَرِيكُهُمْ وَإِنْ يَكُونُوا فِي غَيْرِ ذَلِكَ كَانَ لَكَ أَجْرٌ هَكَذَا سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ»