MCPcopy Create free account
hub / github.com/chatmail/core / ac_incoming_message

Method ac_incoming_message

python/tests/stress_test_db.py:104–124  ·  view source on GitHub ↗
(self, message)

Source from the content-addressed store, hash-verified

102
103 @deltachat.account_hookimpl
104 def ac_incoming_message(self, message):
105 if self.current_sent >= self.num_send:
106 self.report_func(self, ReportType.exit)
107 return
108 message.create_chat()
109 message.mark_seen()
110 self.log(f"incoming message: {message}")
111
112 self.current_sent += 1
113 # we are still alive, let's send a reply
114 if self.num_bigfiles and self.current_sent % (self.num_send / self.num_bigfiles) == 0:
115 message.chat.send_text(f"send big file as reply to: {message.text}")
116 msg = message.chat.send_file(self.account.bigfile)
117 else:
118 msg = message.chat.send_text(f"got message id {message.id}, small text reply")
119 assert msg.text
120 self.log(f"message-sent: {msg}")
121 self.report_func(self, ReportType.message_echo)
122 if self.current_sent >= self.num_send:
123 self.report_func(self, ReportType.exit)
124 return
125
126 @deltachat.account_hookimpl
127 def ac_process_ffi_event(self, ffi_event):

Callers

nothing calls this directly

Calls 5

logMethod · 0.95
create_chatMethod · 0.45
mark_seenMethod · 0.45
send_textMethod · 0.45
send_fileMethod · 0.45

Tested by

no test coverage detected