Sayyiduna Abu al-Darda' (may Allah be pleased with him) narrates: One day the Prophet (peace and blessings be upon him) was seated on the pulpit delivering a sermon to the people, and he recited a verse. Sayyiduna Ubayy bin Ka'b was beside me, and I said to him: "O Sayyiduna Ubayy, when was this verse revealed?" But he did not speak to me. Then I asked him again, and again he did not speak to me, until, when the Prophet (peace and blessings be upon him) came down from the pulpit, Sayyiduna Ubayy said: "The only share you have from this Friday of yours is your idle talk." When the Prophet (peace and blessings be upon him) had finished the prayer, I went to him and told him. I said: "O Messenger of Allah! You recited a verse, and Sayyiduna Ubayy bin Ka'b was beside me. I asked him when this verse was revealed, but he did not talk to me, until, when you came down from the pulpit, Sayyiduna Ubayy claimed that my only share from this Friday is the idle talk I engaged in." The Prophet (peace and blessings be upon him) said: "Ubayy spoke the truth. When you hear your imam speaking, remain silent until he finishes."
Ahmad and al-Tabarani in al-Mu'jam al-Kabir recorded it; the narrators of Ahmad have been declared trustworthy.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 3124