refine member-added and member-removed plugin hooks to signal the sender (who added/removed a contact )

add ac_chat_modified hook event
add account.get_contact_by_addr (thanks @r10s)
This commit is contained in:
holger krekel
2020-04-17 21:32:27 +02:00
parent a87a2d0b71
commit 9eda710538
7 changed files with 133 additions and 76 deletions

View File

@@ -53,11 +53,15 @@ class PerAccount:
""" Called when an outgoing message has been delivered to SMTP. """
@account_hookspec
def ac_member_added(self, chat, contact):
""" Called for each contact added to a chat. """
def ac_chat_modified(self, chat):
""" Chat was created or modified regarding membership, avatar, title. """
@account_hookspec
def ac_member_removed(self, chat, contact):
def ac_member_added(self, chat, contact, sender):
""" Called for each contact added to an accepted chat. """
@account_hookspec
def ac_member_removed(self, chat, contact, sender):
""" Called for each contact removed from a chat. """