Riyad as-Salihin 832
The Book of the Etiquette of Sleeping, Lying and Sitting etc
Etiquette of Attending company and sitting with Companions
Abu Barzah (May Allah be pleased with him) reported: Towards the end of his life, Messenger of Allah (ﷺ) would supplicate before leaving an assembly thus: "Subhanaka Allahumma wa bihamdika, ash-hadu an la ilaha illa Anta, astaghfiruka wa atubu ilaika (O Allah, You are free from every imperfection; all praise is for You. I testify that there is no true god except You, I ask Your forgiveness and turn to You in repentance).'' A man once said to him: "O Messenger of Allah! You have spoken such words as you have never uttered before.'' He said, "It is an expiation of that which goes on in the assembly.'' [Abu Dawud and Al-Hakim].