Skip to content

Protocol Extension Library #1222

@sphaerophoria

Description

@sphaerophoria

Hey toxcore devs.

I've been toying recently with the idea of a couple protocol extensions. For example in qTox I'd like the ability to properly show code blocks, or share custom smileys with a friend, or be able to pack multiple messages together into one.

All of these things currently I cannot do without hooking into the custom packet type, but that got me thinking that it would be quite hard to coordinate with other clients and could ruin the experience when interacting with other clients.

I was thinking that a decent solution to this would be to have a way of telling a friend which extensions you support and doing some form of client negotiation, to accomplish this I wanted to write a simple library (API design is not very flushed out yet due to my uncertainty that it would be accepted by the community). This library would wrap the custom packet type and have a slimmed down api along the lines of

typedef void(extension_callback_fn)(int friend_id, char data);
int register_extension(char* extension_uuid, extension_callback_fn);
int send_extension_data(char* extension_uuid, int friend_id, char* extension_data);
int check_friend_extension(char* extension_uuid, int friend_id);

Would this type of library be against the tox way? If I started then implementing extensions on top of this library would I be stepping on anyone's toes?

Thanks for the feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priorityquestionQuestions

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions