These are chat archives for mailboxer/mailboxer

9th
Sep 2014
James Peerless
@jamespeerless
Sep 09 2014 02:49
Hey-- I'm trying to see if a user already has a conversation with a certain person so I can reply to that thread instead of creating a new conversation. Original idea was to loop through receipts_for(current_user) and try to find one where the message recipient or sender is the current target recipient and reply to that one? Is there a better way to do this?
James Peerless
@jamespeerless
Sep 09 2014 02:56
actually, im just finding a current_conversation by iterating over current_user.mailbox.conversations and finding the one (if it exists) with a participant who is the target recipient.. pretty straight forward
Alex Sears
@searsaw
Sep 09 2014 12:26
@jamespeerless check out the reply method on the messageable model https://github.com/mailboxer/mailboxer/blob/master/lib/mailboxer/models/messageable.rb
Alex Sears
@searsaw
Sep 09 2014 13:19
@jamespeerless I missunderstood your question. As far as I can see, the way your are doing it is probably the best way for now.