The Messenger of Allah ﷺ said, "Whoever is in the mosque when the call to prayer is given, then leaves not for a genuine need and without intending to return, is a hypocrite."
حدثنا حرملة بن يحيى حدثنا عبد الله بن وهب قال أنبأنا عبد الجبار بن عمر عن ابن أبي فروة عن محمد بن يوسف مولى عثمان بن عفان عن أبيه
قال رسول الله ﷺ من أدركه الأذان في المسجد ثم خرج لم يخرج لحاجة وهو لا يريد الرجعة فهو منافق
No references are available.
[Daif] Ibn Abu Farwa was mentioned previously, no. 345. Abdul-Jabbar is daif, as noted in Taqrib, no. 3854, and elsewhere. Part of the hadith has supporting witnesses in Tabarani's Awsat, 4/501–502, and Bayhaqi, 3/56, and others, Targhib*, 1/189, where it is stated that its narrators are ones relied upon in the Sahih.