Sayyiduna Abu Hurayrah (may Allah be pleased with him) says that while the Prophet (peace and blessings be upon him) was delivering the Friday sermon, Sayyiduna Abu Dharr (may Allah be pleased with him) said to Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him): When was this surah revealed? He did not answer him. When he had completed the prayer, he said: You will not get the reward of the prayer; only idle talk will be credited to your account. Sayyiduna Abu Dharr (may Allah be pleased with him) mentioned this to the Prophet (peace and blessings be upon him), and he (peace and blessings be upon him) said: "Ubayy bin Ka'b has spoken the truth."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الجمعة / 5833