Single function to add peers

A single function that can handle peer addition in both cases
i) Added using smartphone
ii) Added directly through "add a friend" page