You are correct. Mosques are there for prayer and worship. However, Mosques also used to and still act as places for the community members to meet and exchange ideas/news etc - As Aisha Taweela says.

It is important that adults control children in any house of worship..