Gathering in the mosque, and eating and chatting there, during the days of Eid
Question

We have the habit in the mosque, every time Eid al-Fitr or Eid al-Adha comes around, whereby the men gather in the mosque to drink tea and eat sweets, along with what accompanies that of chatting about different topics. What is the ruling on that?
Praise be to Allah.Firstly:
It is prescribed for the Muslims to express joy on the festivals prescribed in Islam, and to gather for that purpose, and there is no reason why that should not be in the mosque.
Al-Bukhaari (5236) and Muslim (892) narrated that ‘Aa’ishah (may Allah be pleased with her) said: I remember the Prophet (blessings and peace of Allah be upon him) screening me with his upper garment whilst I was watching the Abyssinians playing in the mosque, until I was the one who had had enough. So you should understand the fondness that young girls have for amusement.
According to another report narrated by al-Bukhaari (950) and Muslim (892), that was on the Day of Eid, when the black men were playing with shields and spears.
There is also nothing wrong with that gathering being accompanied by some appropriate food and drink.
Az-Zarkashi (may Allah have mercy on him) said:
It is permissible to eat bread, fruit, melon and so on in the mosque. Ibn Maajah narrated that ‘Abdullah ibn al-Haarith ibn Jaz’ az-Zubaydi said: At the time of the Messenger of Allah (blessings and peace of Allah be upon him) we used to eat bread and meat in the mosque.
Narrated by Ibn Maajah in his Sunan (3300); classed as saheeh by al-Albaani.
But something should be spread on the floor and precautions should be taken to avoid contaminating the mosque, lest any food be spilled and attract vermin.
This is so long as the food does not have any unpleasant smell. If that is the case – such as garlic, onions, leeks and the like – then it is makrooh to eat it in the mosque, and the one who has eaten it should not be allowed to enter the mosque until the smell has gone. End quote.
I‘laam as-Saajid bi Ahkaam al-Masaajid (329)
Shaykh Ibn Baaz (may Allah have mercy on him) said:
There is nothing wrong with sleeping or eating in the mosque, for those who are observing i‘tikaaf and others, because of the hadiths and reports that speak of that, and because of what is proven about the story of ahl as-suffah (poor Sahaabah who lived in the mosque), so long as care is taken to keep the mosque clean and avoid anything that may make it dirty, such as leaving leftover food lying about and so on, because of the hadith according to which the Prophet (blessings and peace of Allah be upon him) said: “The rewards of my ummah were shown to me, even (the reward for) dirt that a man removes from the mosque.” Narrated by Abu Dawood and at-Tirmidhi; classed as saheeh by Ibn Khuzaymah. And because of the hadith of ‘Aa’ishah (may Allah be pleased with her), according to which the Prophet (blessings and peace of Allah be upon him) ordered that mosques be built in the quarters and that they be cleaned and perfumed. Narrated by the five, apart from an-Nasaa’i; its isnaad is jayyid. The word translated here as quarters refers to neighbourhoods and where tribes reside in cities. End quote.
Secondly:
It is permissible to engage in permitted kinds of talk in the mosque, even if that has to do with worldly matters, so long as it will not disturb worshippers.
Muslim narrated in his Saheeh (670) from Jaabir ibn Samurah (may Allah be pleased with him) that the Prophet (blessings and peace of Allah be upon him) would not get up from the place in which he had prayed Fajr until the sun had risen, and when the sun had risen he would get up. They used to chat and talk about matters of the Jaahiliyah, and they would laugh but he smiled.
An-Nawawi (may Allah have mercy on him) said:
it is permissible to engage in permitted kinds of talk in the mosque, and to talk about worldly matters and other permissible topics, even if that leads to laughter and the like, so long as it is permissible, because of the hadith of Jaabir ibn Samurah. End quote.
Al-Majmoo‘ Sharh al-Muhadhdhab (2/177)
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
Talking in the mosque may be divided into two categories:
1. That which disturbs those who are praying, reading Qur’an or studying. This is not permissible, and no one has the right to do that which will disturb those who are praying, reading Qur’an or studying.
2. That which does not disturb anyone. So long as it is about good things then it is good. If it is about worldly matters, then some of it may not be allowed and some of it may be permissible. That which is not allowed includes buying, selling, and hiring. It is not permissible to buy and sell in the mosque, or to hire someone or be hired in the mosque, or to make announcements asking about something one has lost, because the Messenger (blessings and peace of Allah be upon him) said: “If you hear someone making announcements (in the mosque) about something he has lost, then say: ‘May Allah not restore it to you, for the mosques were not built for this purpose.’”
That which is permissible includes people talking about worldly matters in a truthful manner in which there is nothing haraam.
Fataawa Noor ‘ala ad-Darb.
With regard to the hadith, “Talking in the mosque consumes good deeds as fire consumes wood,” it has no basis from the Prophet (blessings and peace of Allah be upon him).
See: as-Silsilah ad-Da‘eefah by Shaykh al-Albaani (may Allah have mercy on him), no. 4
Conclusion:
There is nothing wrong with you gathering in the mosque, but you should take care not to let the mosque be contaminated with any food or drink, and also take care to avoid disturbing those who are praying, reading Qur’an and doing other acts of worship, if there is anyone doing these things at the time when you gather.
And Allah knows best.