Sayyiduna Jabir (may Allah be pleased with him) narrates that any one of us used to walk through the mosque in a state of major ritual impurity (janabah).
Hadith Referenceصحيح ابن خزيمه / جماع أبواب الأفعال المباحة فى المسجد غير الصلاة وذكر الله / 1331