OTR plugin changes content of <body> element
When I send a command from Gajim to [[http://projectmaxs.org|MAXS]], then the first attempt will fail. It seems the OTR plugin adds extra whitespace to the body element. As soon as I disable the OTR plugin, the behavior can no longer be observed.
If I send for example the ls
command
[11:03:43] flo: ls ✓
[11:03:44] My Droid: No such file or directory: /storage/emulated/0/MAXS/
Then the resulting message
stanza will contain extra whitespace after the actual entered text:
\<message xmlns="jabber:client" to="xxx@geekplace.eu" type="chat" id="1250">
\<body>ls \</body>
\<request xmlns="urn:xmpp:receipts" />
\<thread>MGTPNXjwxEGoAcKebuDStVSRQORvXBad\</thread>
\</message>
Now, if I do the same just a few seconds later, then the whitespace will be gone
[11:03:53] flo: ls ✓
[11:03:53] My Droid: Content of /storage/emulated/0/MAXS
/storage/emulated/0/MAXS/foo.pdf 22.7 KiB
23246
\<message xmlns="jabber:client" to="xxx@geekplace.eu/MAXS" type="chat" id="1251">
\<body>ls\</body>
\<request xmlns="urn:xmpp:receipts" />
\<thread>MGTPNXjwxEGoAcKebuDStVSRQORvXBad\</thread>
\</message>
I'm not sure why the whitespace is added, I can only assume that it's part of the OTR specification and related to negotiation. If this is in fact the case, then the OTR XMPP protocol seems to be poorly designed. Instead of modifying the body element, an extra message extension should be used, which would be transparent for entities not supporting it.
Is there a OTR XMPP specification somewhere? How do e.g. Gajim's OTR plugin and ChatSecure agree on a protocol? Is there a way to prevent the OTR plugin from adding extra whitespace without disabling it?