With a general message sending function, it will need to accept
Message to send
End point
Peer(s) that the message was received from
Will need to track whether message has already been sent and where it has been sent to (or received from). Perhaps, use a message digest.
With a general message sending function, it will need to accept