He heard the Prophet ﷺ, or he said that the Prophet ﷺ said about the Ansar, "Only a believer loves them, and only a hypocrite hates them. Whoever loves them, Allah loves him, and whoever hates them, Allah hates him."I asked him, "Did you yourself hear this from al-Bara?"He replied, "Yes, from me directly."
حدثنا بندار حدثنا محمد بن جعفر حدثنا شعبة عن عدي بن ثابت
أنه سمع النبي ﷺ أو قال قال النبي ﷺ في الأنصار لا يحبهم إلا مؤمن ولا يبغضهم إلا منافق من أحبهم فأحبه الله ومن أبغضهم فأبغضه الله فقلت له أنت سمعته من البراء فقال إياي
Agreed upon. Bukhari transmitted it in "Virtues of the Ansar," chapter on loving the Ansar being part of faith, hadith no. 3783, and Muslim, hadith no. 75, from the hadith of Shubah through the same chain. See the previous hadith.