The Messenger of Allah ﷺ said regarding spitting in the mosque, and he mentioned something similar.
حدثنا أبو كامل حدثنا يزيد يعني ابن زريع عن سعيد عن قتادة
قال رسول الله ﷺ النخاعة في المسجد فذكر مثله
No references are available.
[Sahih] Ahmad reported it (3/109) from the hadith of Saeed bin Abu Aruba through this same chain, and the preceding hadith is a corroborating witness for it. This hadith also has other routes found in Ahmad (3/277) and Abdul-Razzaq, no. 1697, and others besides them.