The Prophet of Allah ﷺ said, "There is a kind of jealousy that Allah loves and a kind that Allah detests. As for the jealousy Allah loves, it is jealousy when there is genuine cause for suspicion. As for the jealousy Allah detests, it is jealousy without any cause for suspicion.And there is a kind of pride that Allah detests and a kind that Allah loves. As for the pride Allah loves, it is a man's display of pride in himself during battle and his display of pride when giving charity. As for the pride Allah detests, it is his pride in wrongdoing."Musa added, "And in boasting."
حدثنا مسلم بن إبراهيم وموسى بن إسمعيل المعنى واحد قالا حدثنا أبان قال حدثنا يحيى عن محمد بن إبراهيم عن ابن جابر بن عتيك
أن نبي الله ﷺ كان يقول من الغيرة ما يحب الله ومنها ما يبغض الله فأما التي يحبها الله فالغيرة في الريبة وأما الغيرة التي يبغضها الله فالغيرة في غير ريبة وإن من الخيلاء ما يبغض الله ومنها ما يحب الله فأما الخيلاء التي يحب الله فاختيال الرجل نفسه عند القتال واختياله عند الصدقة وأما التي يبغض الله فاختياله في البغي قال موسى والفخر
[Hasan] Reported by Nasai, zakat, chapter on pride in charity, no. 2559, from the hadith of Yahya bin Abu Kathir through this route, and he explicitly stated that he heard it directly. Ibn Hibban graded it sahih (Mawarid): 313, 1666, as did the Hafiz in al-Isabah: 1/215. It has corroborating narrations in Ibn Majah: 1996 and Ibn Khuzayma, no. 2478, and others.