In the previous post a predefined node could initiate the chat and also that a node could not send more than one message one after the other, after sending a message it has to receive a message and then only it can send a new message.
In the new code any of the nodes can initiate the chat and also one node can send messages more than once.This is achieved by the fact that in the loop function we constantly keep on looking for serial input and any payload. Suppose a payload is available then only the transmission function is activated otherwise we never enter the transmission function. This makes the same code to work for both the nodes.
You can get the code and edit/fork/clone to suit your needs at my Github repository
You can input a message larger than 31 bytes and see what happens. Even those messages are transmitted. I experimented with very large messages and found out that although the radio does not get stuck anywhere but some part of the messages especially towards the ends and beginning get lost.