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

Improving ImMessage class #345

AmarOk1412 opened this issue Nov 6, 2018 · 0 comments


None yet
2 participants
Copy link

commented Nov 6, 2018


As discussed during our last discussion I try to do a bridge between an app which uses channel and replies to a my client. One problem I see is that our current ImMessage only contains few entries. See

class OPENDHT_PUBLIC ImMessage : public SignedValue<ImMessage>

Note: the TrustRequest use another type.

I think it would be great to be able to put some datas attached to this ImMessage like a channel, a reply-id, a sub-author (difficult to explain here, but it's just an example), etc.

I have some implementations ideas, but still not sure what we want for OpenDHT.

  1. Implement a new child for SignedValue<ImMessage> maybe a sub ImMessage with the entry I want to attach. I don't know what will be problematic.
  2. Add a map<string,string> representing flags keys and values directly into ImMessage (and merge datatype + msg into these map). Not sure if msgpack accepts to serialize a map, I need to try.
  3. Stay with the actual ImMessage like I do for my actual special messages and use a custom datatype instead of text/plain and a custom message structure (for example a JSON object). The drawback here is I will break the compability with actual Ring clients (not a really big deal for my use-case, it's for a bot, but it would be great).

I think the 1 will be great for my project, but the 2 can be cool for Ring too. The 3 looks like a workaround for me. What do you think?

@AmarOk1412 AmarOk1412 added the question label Nov 6, 2018

AmarOk1412 added a commit to AmarOk1412/opendht that referenced this issue Nov 22, 2018

default_types: add metadatas map into ImMessage
Give the ability to store more datas into an ImMessage

Issue: savoirfairelinux#345

aberaud added a commit that referenced this issue May 3, 2019

default_types: add metadatas map into ImMessage
Give the ability to store more datas into an ImMessage

Issue: #345

@aberaud aberaud closed this May 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.