mirror of
https://github.com/chatmail/core.git
synced 2026-04-19 14:36:29 +03:00
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:
@@ -22,14 +22,16 @@ class GroupTrackingPlugin:
|
||||
print("*** ac_configure_completed:", success)
|
||||
|
||||
@account_hookimpl
|
||||
def ac_member_added(self, chat, contact):
|
||||
print("*** ac_member_added", contact.addr, "from", chat)
|
||||
def ac_member_added(self, chat, contact, sender):
|
||||
print("*** ac_member_added {} to chat {} from {}".format(
|
||||
contact.addr, chat.id, sender.addr))
|
||||
for member in chat.get_contacts():
|
||||
print("chat member: {}".format(member.addr))
|
||||
|
||||
@account_hookimpl
|
||||
def ac_member_removed(self, chat, contact):
|
||||
print("*** ac_member_removed", contact.addr, "from", chat)
|
||||
def ac_member_removed(self, chat, contact, sender):
|
||||
print("*** ac_member_removed {} from chat {} by {}".format(
|
||||
contact.addr, chat.id, sender.addr))
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
|
||||
Reference in New Issue
Block a user