refine handling of accepted contacts in example

This commit is contained in:
holger krekel
2020-03-06 19:11:21 +01:00
parent a1d5120e58
commit d4e1c1b109
6 changed files with 36 additions and 6 deletions

View File

@@ -11,10 +11,11 @@ class EchoPlugin:
if message.text.strip() == "/quit":
message.account.shutdown()
else:
ch = message.get_sender_chat()
# unconditionally accept the chat
message.accept_sender_contact()
addr = message.get_sender_contact().addr
text = message.text
ch.send_text("echoing from {}:\n{}".format(addr, text))
message.chat.send_text("echoing from {}:\n{}".format(addr, text))
@deltachat.hookspec.account_hookimpl
def process_message_delivered(self, message):