Reference for Berakhot 124:4
רב ספרא על לבית הכסא אתא רבי אבא נחר ליה אבבא אמר ליה ליעול מר בתר דנפק אמר ליה עד השתא לא עיילת לשעיר וגמרת לך מילי דשעיר לאו הכי תנן מדורה היתה שם ובית הכסא של כבוד וזה היה כבודו מצאו נעול בידוע שיש שם אדם מצאו פתוח בידוע שאין שם אדם אלמא לאו אורח ארעא הוא
Rab Safra entered a privy. R. Abba came and emitted a sound at the door. Rab Safra said to him, "Let the master enter." After leaving, R. Abba said to him, "So far thou hast not brought in the demon ; but thou hast received the tradition about the demon. Have we not learnt thus in the Mishnah : There was an open fire-place there [in the Temple-court], and a splendid privy ; and this was its splendid feature : if it was found locked, it was known that somebody was in there, but if it was found open, it was known that it was vacant. Hence infer that it is not proper [to speak in a privy]!