I would like to add a new participant(not current_user
) to one of my conversations.
I created a conversation with
receipt = user1.send_message([user2, user3], 'body', 'subject'])
user2.reply_to_conversation(receipt.conversation, 'body')
I would like as a user3
to add new user4
to the one of his conversations.
Something like this.
user3.invite_to_conversation(receipt.conversation)
receipt.conversation.participants => [user1, user2, user3, user4]
I wasn't able to find a helpfull method in documentation and source code.
Documentation: https://github.com/mailboxer/mailboxer
I just found a method in source code, which does the job.
conversation.add_participant(user4)