The Messenger of Allah ﷺ prayed in the mosque, then noticed some phlegm on the wall facing the qiblah. When he finished his prayer, he said, "When one of you prays in the mosque, he is in private conversation with his Lord, and Allah is facing him directly. So none of you should spit toward the qiblah or to his right."Then he called for a stick and scraped it off, then called for some perfume and dabbed the spot with it.
حدثنا عبد الرزاق أخبرنا ابن أبي رواد عن نافع
صلى رسول الله ﷺ في المسجد فرأى في القبلة نخامة فلما قضى صلاته قال إن أحدكم إذا صلى في المسجد فإنه يناجي ربه وإن الله تبارك وتعالى يستقبله بوجهه فلا يتنخمن أحدكم في القبلة ولا عن يمينه ثم دعا بعود فحكه ثم دعا بخلوق فخضبه
Its isnad is sahih, and it is a longer version of 4684. See also 4509, 4841, and 4877.