while muhammad was traveling towards medina, he came across taif and preached there where polytheists threw stones, causing muhammad to bleed and almost collapse. after reaching medina with abu bakr, the medinan muslims helped muhammad and made a mosque there.