tox icon indicating copy to clipboard operation
tox copied to clipboard

[Question] Can I send friend request with a message?

Open FrontMage opened this issue 4 years ago • 2 comments

I looked up the documentation, the add_friend accepts only one param which is the public key of the friend, but the C binding lib can add friend with a message, so I wonder if there is a way to achieve this.

I noticed that there is a FriendRequests struct, but it seems never used in the code.

Thanks for the help!

FrontMage avatar Jul 04 '20 03:07 FrontMage

Currently we have only low level api. add_friend means we add it to friends list only but don't send friend request. Therefore it doesn't contain message parameter.

kurnevsky avatar Jul 07 '20 14:07 kurnevsky

Currently we have only low level api. add_friend means we add it to friends list only but don't send friend request. Therefore it doesn't contain message parameter.

Thanks for the reply. I wonder if I can use something like send_lossless to fire a request with a message, I tried to modify the echo.rs example, but it turns out I needed friends to be accepted to use send_lossless. Then I dived into the code, found out that the dht server maintains all close by node information, but I can't seem to connect to a friend node no matter how. The code clearly says it can punch UDP holes if there are no other relays, I kind got stuck here.

Can you make an example about how to send friend request? Much appreciated!

FrontMage avatar Jul 07 '20 15:07 FrontMage