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

[Conference Logger, OMEMO] Logging in OMEMO-encrypted conferences not working correctly #93

Closed
kssytsrk opened this issue Aug 8, 2021 · 4 comments · Fixed by #94
Closed

Comments

@kssytsrk
Copy link
Contributor

kssytsrk commented Aug 8, 2021

The Conference Logger plugin does not seem to work with an OMEMO-encrypted MUC/groupchat. It does log messages, but is unable to decrypt them (they decrypted fine when I received them):
psipluslogging

AFAIK Profanity and Gaijim don't support logs of OMEMO-encrypted MUCs either (or at least not out-of-the-box), but the Conversations client for Android does. Are there perhaps any workarounds for this problem (aside from copy+paste by hand)? If not, in theory, could an "OMEMO conference logger" plugin be written? I might try to implement that, but would appreciate it if someone who is familiar with Psi's codebase/api provided some pointers.

@Ri0n
Copy link
Member

Ri0n commented Aug 8, 2021

Hi @kssytsrk,
Thanks for the report. I believe we won't be able to fix any soon just because of lack of spare time of developers. But I think it has to be quite easy to extend the current OMEMO plugin with logging functionality. maybe even reuse some logging interfaces from other plugins from OMEMO plugin.
You help would be highly appreciated.

CC @stigger

@kssytsrk
Copy link
Contributor Author

kssytsrk commented Aug 9, 2021

Thank you for the reply! I think I'm almost done with it, but I've noticed that the QDomElement &message passed to the OMEMOPlugin::encryptMessageElement function has the attribute of "from" (that is, message.attribute("from")) set to an empty string.

Is this expected behavior? I've been trying to call my logger function from OMEMOPlugin::encryptMessageElement before encrypting the message and I need the "from" attribute to extract the MUC's name (that is, where that message is going to be sent). There might be some other way, but that is how it was implemented in the Conference Logger plugin...

@Ri0n
Copy link
Member

Ri0n commented Aug 9, 2021

Basically when you join a muc, the server associates your full account jid (account@server/resource) with your muc jid ([email protected]/nickname) and for consequent outgoing messages the "from" attribute in not needed because the server knows everything coming from account@server/resource to the muc [email protected] is in fact coming from [email protected]/nickname.

So to have your muc jid you can go next ways:

  1. extract it from the muc dialog (or at least extract nickname. but IIRC full jid should be available too via plugins API)
  2. track presences to the muc to remember own muc jid.
  3. if you need just the "[email protected]" part then it won't be available in the "from" attribute of an outgoing message. and you rather need to take it from the "to" attribute.

to summarize for messages we have...
client -> server

  • from - account@server/resource (most like the attribute will be omitted because of server association)
  • to - [email protected] (and for presences we also have /nickname)

server -> client

  • from - [email protected]/someone_else_nickname
  • to - account@server/resource (but technically doesn't really matter. It's fine to not have this attr at all)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants