Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] option to send message receipt by application only #2324

Open
ehmry opened this issue Jun 28, 2022 · 3 comments
Open

[Feature request] option to send message receipt by application only #2324

ehmry opened this issue Jun 28, 2022 · 3 comments
Milestone

Comments

@ehmry
Copy link

ehmry commented Jun 28, 2022

Currently an application cannot control when read receipts are sent back to a friend.

This is a problem if a client crashes after a read receipt is sent back but before some messages are saved to the client history. It also prevents Toxcore from reliably implementing componentized clients that isolate the core from history and frontend, because if the core receives messages while the the history component is not active, the messages would be dropped but the sender would still see a confirmation. I have a minimalist client that I am working on that has this problem.

The solution to me would be to add a message callback type that receives a message id:

typedef void tox_friend_message_pending_cb(Tox *tox, uint32_t friend_number, Tox_Message_Type type, uint32_t message_id, const uint8_t *message, size_t length, void *user_data);

And a procedure to confirm the message when the application has processed it. This could be called during the message callback or at a later time.

void tox_friend_message_confirm(Tox *tox, uint32_t friend_number, uint32_t message_id, Tox_err_message_confirm *error);

The read receipt behavior could be selected by which friend message callback type was set, or as an option to tox_new.

I'm willing to implement this if the proposal is acceptable.

@ehmry
Copy link
Author

ehmry commented Jun 28, 2022

I still don't fully understand "read receipts" but from what I know now this would require a higher-level ack in the protocol.

@zoff99
Copy link

zoff99 commented Jun 29, 2022

the name "read receipt" is a misnomer.
https://github.com/TokTok/c-toxcore/blob/master/toxcore/tox.h#L1825
it actually means that the message callback was called on the receivers toxcore and the callback returned.
so the name should be more like "message received" rather than "message read"

this still causes issues since most modern clients do things asynchronously.

there is a fix for this issue for 1:1 text messaging called msgV3
you can see the patch here:

https://github.com/zoff99/toxcore_custom_diffs/blob/master/0003_zoff_tc___message_v3_addon.diff

a detailed documentation is not currently available.

@zoff99
Copy link

zoff99 commented Nov 3, 2022

Antidote and TRIfA are using that fix (msgV3) already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants