Ejemplo n.º 1
0
func onFriendRequest(t *golibtox.Tox, publicKey []byte, data []byte, length uint16) {
	name, _ := t.GetSelfName()
	fmt.Printf("[%s] New friend request from %s\n", name, hex.EncodeToString(publicKey))

	// Auto-accept friend request
	t.AddFriendNorequest(publicKey)
}
Ejemplo n.º 2
0
func onFriendRequest(t *golibtox.Tox, publicKey []byte, data []byte, length uint16) {
	fmt.Printf("New friend request from %s\n", hex.EncodeToString(publicKey))
	fmt.Printf("With message: %v\n", string(data))
	// Auto-accept friend request
	t.AddFriendNorequest(publicKey)
}