mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2025-01-09 17:33:47 +00:00
notify other devices of new handles
This commit is contained in:
parent
5938ee0a15
commit
bacefed8b8
1 changed files with 7 additions and 2 deletions
9
demo.py
9
demo.py
|
@ -131,6 +131,13 @@ async def main(args: argparse.Namespace):
|
|||
if "mailto:" in str(user.handles[n]):
|
||||
email_addr = user.handles[n]
|
||||
|
||||
# Set up a temporary iMessage user to send notifications
|
||||
im = imessage.iMessageUser(conn, email_user)
|
||||
im.current_handle = email_addr # HACK: See above
|
||||
|
||||
# Notify other devices on the account that new handles are available
|
||||
await im._send_raw(130, [im.current_handle], "com.apple.madrid")
|
||||
|
||||
expiration = expiration_identifier(users)
|
||||
|
||||
# Save the config to disk
|
||||
|
@ -138,8 +145,6 @@ async def main(args: argparse.Namespace):
|
|||
|
||||
# Send the notification iMessage (if enabled)
|
||||
if args.reg_notify:
|
||||
im = imessage.iMessageUser(conn, email_user)
|
||||
im.current_handle = email_addr # HACK: See above
|
||||
await im.send(imessage.iMessage.create(im, expire_msg(expiration), [email_addr]))
|
||||
|
||||
return expiration
|
||||
|
|
Loading…
Reference in a new issue