FIX: Force enable user PM emails option when user posts to a group by email.

This commit is contained in:
Penar Musaraj
2018-10-01 14:01:24 -04:00
committed by Guo Xiang Tan
parent d9bea66365
commit da9eee5262
3 changed files with 24 additions and 0 deletions

View File

@@ -609,6 +609,11 @@ module Email
end
def create_group_post(group, user, body, elided, hidden_reason_id)
# ensure user PM emails are enabled (since user is posting via email)
if !user.staged && !user.user_option.email_private_messages
user.user_option.update!(email_private_messages: true)
end
message_ids = Email::Receiver.extract_reply_message_ids(@mail, max_message_id_count: 5)
post_ids = []