In the Name of Allah, the Most Gracious, the Most Merciful.
As-salāmu ‘alaykum wa-rahmatullāhi wa-barakātuh.
In principle, A should not have entertained any direct discussion with B’s husband, when B herself was present. B’s husband should have communicated to A through his wife, B.
Just as B’s husband was wrong for his rude conduct, likewise A has erred in violating the laws of Hijab, by communicating with B directly.
And Allah Ta’āla Knows Best
Mufti Saeed Ahmed Golaub
Islamic Solutions
Jamaica