Removed bulletin wording from send.py.
This commit is contained in:
@@ -59,23 +59,19 @@ async def send_message(
|
|||||||
users_dict = root.get('users', {})
|
users_dict = root.get('users', {})
|
||||||
|
|
||||||
# Prepare recipients
|
# Prepare recipients
|
||||||
to_list = payload.to
|
to_list = [c.upper() for c in payload.to]
|
||||||
to_tuple = tuple(to_list)
|
is_to_all = "ALL" in to_list
|
||||||
if "ALL" in to_list:
|
|
||||||
to_tuple = ("ALL",)
|
|
||||||
|
|
||||||
is_bulletin = "ALL" in to_list
|
if is_to_all:
|
||||||
|
# Deliver to all registered users
|
||||||
if is_bulletin:
|
|
||||||
# Bulletin: deliver to all registered users
|
|
||||||
valid_recipients = list(users_dict.keys())
|
valid_recipients = list(users_dict.keys())
|
||||||
failed_recipients = []
|
failed_recipients = []
|
||||||
else:
|
else:
|
||||||
# Private message: validate each recipient exists
|
# Private message validation
|
||||||
valid_recipients = []
|
valid_recipients = []
|
||||||
failed_recipients = []
|
failed_recipients = []
|
||||||
for recip in to_list:
|
for recip in to_list:
|
||||||
if users_dict.get(recip):
|
if recip in users_dict:
|
||||||
valid_recipients.append(recip)
|
valid_recipients.append(recip)
|
||||||
else:
|
else:
|
||||||
failed_recipients.append(recip)
|
failed_recipients.append(recip)
|
||||||
|
|||||||
Reference in New Issue
Block a user