简体   繁体   English

如何将新参与者添加到邮箱中的现有对话中?

[英]How to add a new participant to existing conversation in mailboxer?

I would like to add a new participant(not current_user ) to one of my conversations.我想在我的一个对话中添加一个新参与者(不是current_user )。

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.我想作为user3 3 将新user4添加到他的一个对话中。 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文档: https://github.com/mailboxer/mailboxer

I just found a method in source code , which does the job.我刚刚在源代码中找到了一个方法,它可以完成这项工作。

conversation.add_participant(user4)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM