This is not a mosque. This is a Tuareg-like fortress that was conquered, it's inhabitants sold as slaves by the muslims.