Hagia sophia was mosque from last 600 yrs , before that it was cathedral of orthodox cristians but not only religious site but centre of political hegemony and so many false beliefs were linked as supposedly constantine emperor was believed to return from heavens as a savior and so many like that so inorder to break resistance and all false beliefs sultan muhammad fateh turn it into mosque .
80 yrs before turned into museum by ataturk and now again turn into mosque by judicial verdict .
Almost 600 yrs before , with the fall of granada , thousands of mosques in spain were turned into churches and are still churches to this date .
You have twisted and misquoted the hadith .Dont spread false information .
Before fateh e Makkah , 100s of idols were in
and around kaba and for idol worshipers it was there main temple , now tell me if any hindu stand and claim that kaba was there Mandir 1500 yrs before and they have right on it . Would you say same what you have said now .