the person praying is not completely distracted. Thus, the view that has ultimately appeared stronger to me is that the mosque greeting prayer is an emphatically recommended sunnah, not an obligation.
Some scholars have said: The mosque greeting prayer is recommended for everyone who enters a mosque, except the Sacred Mosque, whose greeting is circumambulation. However, this is not unrestricted. Rather, we say: The Sacred Mosque is an exception for one who enters in order to perform circumambulation, for circumambulation suffices him in place of the two rak'ahs. This is because when the Prophet ﷺ entered the Sacred Mosque for the circumambulation of umrah or Hajj, he did not pray two rak'ahs. But whoever enters to pray, listen to knowledge, recite the Quran, or the like, then the Sacred Mosque is like all other mosques: its greeting is two rak'ahs, due to the general wording of the Prophet’s ﷺ statement: “When one of you enters the mosque, he should not sit down until he has prayed two rak'ahs.” (1)
It is not permissible to speak while the imam is delivering the sermon, except for him or for someone whom he addresses for a need …
His statement, “It is not permissible to speak while the imam is delivering the sermon, except for him or for someone whom he addresses”: When it is said, “It is not permissible,” the scholars understand this to mean that it is forbidden. Accordingly, speaking while the imam is delivering the sermon is forbidden.
The author’s statement, “while the imam is delivering the sermon,” is a circumstantial clause, as previously mentioned in his statement, “whoever enters while the imam is delivering the sermon.”
His statement, “while the imam is delivering the sermon”: The more precise wording would be, “while the preacher is delivering the sermon,” because someone other than the imam may deliver the sermon. The imam may not be skilled at delivering sermons, so one person may deliver the sermon while another leads the prayer. This is what the author, may Allah have mercy on him, intended, but he mentioned the imam because that is the usual case.