How to detect if Logged in User is following any searched users

I’m showing a Follow button on the profile page of searched user, how am i get to know that the searched used is following the logged in user or not? on that basis i need to show and hide that button?
Please suggest some approach?

@kmayatwal From the issue you’ve encountered, we recommend that after searching, you click on the user first and then use the connection status to check. You can find information about connection status at this link: Get Connection Status and Connection Counter.