-
Notifications
You must be signed in to change notification settings - Fork 0
Sending Messages
pdxwebdev edited this page Jul 8, 2012
·
7 revisions
I’ve repeated the code from previous code for simplicity
from yadapy.sqlite.nodesqlite import Node
from yadapy.nodecommunicator import NodeCommunicator
node1 = Node({}, {"name" : "my new node"}, location="/my.db")
nc1 = NodeCommunicator(node1)
nc1.requestFriend("host:port")
This is the command you can use to broadcast a message to all of your friends.
To send a message to a specific friend, you’ll need to provide the public key of that friend instead of nc1.node.getFriendPublicKeysArray() which gives a list of all friend public keys.
nc1.sendMessage(nc1.node.getFriendPublicKeysArray(), "subject", "message")