-
Notifications
You must be signed in to change notification settings - Fork 291
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
Implement client capability packet #513
Comments
Ok. My suggestion. As you know (may be), the first packet that one peer sends to another (or receives from another) is PACKET_ID_ONLINE. This packet is 1 byte length (including packet id). My suggestion is to send capabilities of client in this packet. Moreover, Isotoxin already doing this. Unfortunately, the current core ignores this package if its size is not 1 byte. That is why, Isotoxin sends this packet twice: 1 byte length for compatibility and full length with capability information. What about capability format? It is just simple string with format: key:value\n Current Isotoxin's capability string: If you do not mind such a method, I can do PR. |
Good idea, I only see a problem when we get a lot of capabilities, the packet size might be a limit. This can probably be circumvented by sending more packets, but needs some thought. |
/**
* We assume every bool to be false if not specified.
**/
struct Tox_Client_Capabilities {
/**
* The client name, lower case alphanumeric, no spaces. Dash allowed.
*/
const char *client_name;
/**
* The client version, using Semantic Versioning. ie. `0.1.7`, `3.8.0-beta`, etc.
*/
const char *client_version;
/**
* True if the client supports ToxMe/ToxDNS/QNL lookups.
*/
bool supports_lookup;
/**
* True if the client supports ToxID sharing.
* @see Antox and Toxygen
*/
bool supports_id_sharing;
/**
* True if the client supports ToxIdenticons.
* @see Ricin
*/
bool supports_tox_identicons;
/**
* True if the client supports BBCode rendering.
*/
bool supports_bbcode;
/**
* True if the client supports Markdown rendering.
*/
bool supports_markdown;
/**
* True if the client supports audio calls.
*/
bool supports_audio;
/**
* True if the client supports video calls.
*/
bool supports_video;
/**
* True if the client supports file transfers.
*/
bool supports_files;
/**
* True if the client supports inline images transfers.
*/
bool supports_inline_images;
/**
* True if the client supports avatars.
*/
bool supports_avatars;
/**
* True if the client supports message splitting.
*/
bool supports_messages_split;
/**
* True if the client supports whateveryouwantoaddtothatlist.
*/
bool supports_whatever;
} |
Bad idea. What if I come up with a new unique feature? Should I first make PR to the core to expand this structure? No! Only a set of strings with gradual standardization. Otherwise it will not work. |
So please use a standard format. JSON, Yaml, TOML, whatever you want but something standard. :) |
I would prefer format be an implementation details. It would be nice if toxcore would be able to parse it and provide some key/value-like API (e.g. |
I agree with @dvor toxcore shouldn't need to parse the keys and values, this way clients can implement own stuff. My proposal for this kind of packet:
The Header will be something like number of segments as uint16 and segment number as uint16. Allowed chars for the key will be |
Current core accepts only 1-byte length PACKET_ID_ONLINE. pros:
cons:
|
Continuation of this thread #428 (comment) here to avoid spamming the original issue.
The text was updated successfully, but these errors were encountered: