Associating with one who is defiled, and what is permitted - Section 2 Mishkat al-Masabih 460
Translation
‘Ali said, “The Prophet used to come out of the privy, recite the Qur’an to us and eat meat with us, nothing restraining him from the Qur’an but seminal defilement.” Abu Dawud and Nasa’i transmitted it, and Ibn Majah transmitted something similar.