Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions mail_gateway/models/mail_gateway_abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,26 @@ def _get_author(self, gateway, update):

def _get_channel_vals(self, gateway, token, update):
author = self._get_author(gateway, update)
member_pids = set(gateway.member_ids.mapped("partner_id").ids)
members = [
Command.create({"partner_id": partner.id, "unpin_dt": False})
for partner in gateway.member_ids.partner_id
Command.create({"partner_id": partner_id, "unpin_dt": False})
for partner_id in member_pids
]
if author:
if author and author._name == "res.partner" and author.id not in member_pids:
members.append(
Command.create(
{
"partner_id": author._name == "res.partner" and author.id,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing the part that checks the model?

"guest_id": author._name == "mail.guest" and author.id,
"partner_id": author.id,
"guest_id": False,
}
)
)
elif author and author._name == "mail.guest":
members.append(
Command.create(
{
"partner_id": False,
"guest_id": author.id,
}
)
)
Expand Down
Loading