Answered by Shaykh Amjad Rasheed
What is the ruling of speaking beside the sink in a bathroom if one is far from the toilet?
Outside the Bathroom
If one is outside the room where one relieves oneself (even if close to it), it is not disliked to utter anything.
Inside the Bathroom
If one is inside the room where one relieves oneself (even if far from the actual toilet), it is disliked to utter the Qur’an, any invocation (dhikr), or any name that is worthy of respect (such as the names of angels and prophets). As for worldly talk (kalam al-nas), according to Ibn Hajar, it is not disliked in this case, but according to other Imams of our school, it is disliked.
While Relieving Oneself
If one is actually engaged in the process of relieving oneself, it is disliked for one to utter anything, whether invocation (dhikr) or anything else.
Amjad Rasheed
Amman, Jordan
(Translated by Hamza Karamali)