It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever is given a gift while other people are with him, they too are partners in that gift."
Ahmad bin Yusuf narrated it from Abd al-Razzaq as a statement of Ibn Abbas (mawquf), not attributed to the Prophet (marfu'), and that is more correct.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الهبات / 12037