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

Method _process_event

python/src/deltachat/events.py:264–283  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

262 self._process_event(event)
263
264 def _process_event(self, event) -> None:
265 evt = lib.dc_event_get_id(event)
266 data1 = lib.dc_event_get_data1_int(event)
267 # the following code relates to the deltachat/_build.py's helper
268 # function which provides us signature info of an event call
269 evt_name = get_dc_event_name(evt)
270 if lib.dc_event_has_string_data(evt):
271 data2 = from_optional_dc_charpointer(lib.dc_event_get_data2_str(event))
272 else:
273 data2 = lib.dc_event_get_data2_int(event)
274
275 lib.dc_event_unref(event)
276 ffi_event = FFIEvent(name=evt_name, data1=data1, data2=data2)
277 with self.swallow_and_log_exception(f"ac_process_ffi_event {ffi_event}"):
278 self.account._pm.hook.ac_process_ffi_event(account=self, ffi_event=ffi_event)
279 for name, kwargs in self._map_ffi_event(ffi_event):
280 hook = getattr(self.account._pm.hook, name)
281 info = f"call {name} kwargs={kwargs} failed"
282 with self.swallow_and_log_exception(info):
283 hook(**kwargs)
284
285 @contextmanager
286 def swallow_and_log_exception(self, info):

Callers 1

runMethod · 0.95

Calls 6

_map_ffi_eventMethod · 0.95
get_dc_event_nameFunction · 0.85
FFIEventClass · 0.85
ac_process_ffi_eventMethod · 0.45

Tested by

no test coverage detected