Whenever food was brought to the Messenger of Allah ﷺ, he would ask about it, "Is it a gift or charity?"If it was said to be charity, he would tell his companions, "Eat," but he himself would not eat. If it was said to be a gift, he ﷺ would extend his hand and eat with them.
كان رسول الله ﷺ إذا أتي بطعام سأل عنه أهدية أم صدقة فإن قيل صدقة قال لأصحابه: كلوا. ولم يأكل وإن قيل هدية ضرب بيده ﷺ فأكل معهم.
Bukhari related it in the Book of Gifts (2576) from Ibrahim bin Munzir, who said, Maen narrated to us, who said, Ibrahim bin Tahman narrated to me, from Muhammad bin Ziyad, from Abu Hurairah, and he related it.Muslim related it in the Book of Zakat (1077) through another route from Muhammad bin Ziyad, in a shortened form.His statement, "when food was brought to him," means from someone other than his own household, he would ask about it, as in the narration of Imam Ahmad (8014) through the route of Hammad bin Salama, from Muhammad bin Ziyad.