deltachat-core-rust icon indicating copy to clipboard operation
deltachat-core-rust copied to clipboard

api: cffi: add `dc_event_get_json` which gives the jsonrpc representation of an event

Open Simon-Laux opened this issue 11 months ago • 4 comments

This has the advantage that fields are named/labled and there can be potentially more than 2 (data1 & data2) fields on the events.

This removes the need for the (potentialy confusing) overloading data1 with dc_event_get_data1_str to add more information to events. And also allows gradual/partial moving to the jsonrpc api, when needed or wanted.

Context/intention: seems logical and was easy to add, no personal grand plan behind it, just wanted to make life easier for UI devs.

Disclaimer: haven't tested it yet, but should work as it is really simple.

Simon-Laux avatar Dec 10 '24 00:12 Simon-Laux

needs to be conditional on the jsonrpc feature flag. But I also ask myself if we still need the jsonrpc feature flag at all?

edit: I made https://github.com/deltachat/deltachat-core-rust/pull/6417

Simon-Laux avatar Jan 08 '25 05:01 Simon-Laux

are there no tests against the jsonrpc API in the core? Adding such a method without a test that becomes part of CI feels brittle.

hpk42 avatar Jan 13 '25 16:01 hpk42

We kind of want to deprecate legacy Python bindings at some point, and it is the only part that tests CFFI.

What we really need is some UI to use this API instead of the old API. I'm also fine with merging this as is if it makes experimenting with this easier, if it's broken it is not a problem, but we need iOS or Android or DeltaTouch to use it eventually.

link2xt avatar Jan 13 '25 16:01 link2xt

but we need iOS or Android or DeltaTouch to use it eventually

for Android/iOS, there is no need nor plans just now. but on the next event added, it may become handy - so, not sure if it makes sense to merge this PR, usually, we do not do that without UI counterpart. i would be fine to put it to resurrection and revive it, it if gets needed

r10s avatar Jan 13 '25 17:01 r10s

Ok let's put it to project resurrection, we know it exists and can be used when new events have more than 2 fields.

Simon-Laux avatar Oct 02 '25 15:10 Simon-Laux