otrv4 / OTRv4-over-IRC

OTRv4 over IRC. This is a mirror of https://bugs.otr.im/otrv4/otrv4-over-irc
2 stars 0 forks source link

Encapsulate more than just PRIVMSG #2

Open SoniEx2 opened 2 years ago

SoniEx2 commented 2 years ago

Currently, OTR only consistently encapsulates PRIVMSG. It should be possible to additionally convey NOTICE and TAGMSG over the encrypted channel.

For example, some messages look like this with current OTR:

@+example-client-tag=example-value PRIVMSG foo :?OTR:...
@+example-client-tag=example-value NOTICE foo :not usually encrypted
@+example-client-tag=example-value TAGMSG foo

but should ideally look like this with OTRv4:

PRIVMSG foo :?OTR:...
PRIVMSG foo :?OTR:...
PRIVMSG foo :?OTR:...

with the contents of the client-only tag, as well as the message type, encapsulated into the encrypted channel.


References:

SoniEx2 commented 2 years ago

One option would be to use a TLV for NOTICEs and TAGMSGs and another TLV for client-only tags. This seems reasonable, and send some text like "Your OTR plugin does not support this message. Please update your OTR plugin." in the main stream when the NOTICE/TAGMSG TLV is used.

So these:

@+example-client-tag=example-value PRIVMSG foo :some text
@+example-client-tag=example-value NOTICE foo :some other text
@+example-client-tag=example-value TAGMSG foo

would become something like this when OTR-encrypted:

{"message": "some text", "TLVs": {"message-tags": "+example-client-tag=example-value"}}

{"message": "Your OTR plugin does not support this message. Please update your OTR plugin.", "TLVs": {"message-ext": "NOTICE some other text", "message-tags": "+example-client-tag=example-value"}}

{"message": "Your OTR plugin does not support this message. Please update your OTR plugin.", "TLVs": {"message-ext": "TAGMSG", "message-tags": "+example-client-tag=example-value"}}