Al-Muhajir b. Qunfudh said that he came upon the Prophet when he was passing water and saluted him, but he did not respond to the salutation till he had performed ablution. He then made his excuse to him saying, “I dislike mentioning God's name except when I am in a state of purity.”
Abu Dawud transmitted it. Nasa’i transmitted it up to “till he had performed ablution” and said, “then when he had performed ablution he responded to it.”
I accompanied Ibn ‘Umar who wanted to relieve himself. After doing so, in the course of his talk that day he said that a man going along a street met God’s messenger when he came out of the privy, or had passed water, and saluted him without receiving any response. Then when the man was almost going out of sight in the street God’s messenger struck his hands on a wall, wiped his face with them, struck once more and wiped his forearms, then responded to the man’s salutation, saying, “The only thing which prevented me from responding to your salutation was that I was not in a state of purity.”
‘Abdallah b. Abu Bakr b. Muhammad b. ‘Amr b. Hazm said that the letter sent by God's messenger to ‘Amr b. Hazm contained the words, “Only one who is pure must touch the Qur’an.”