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

prof_post_chat_message_display plugin hook for chat history messages is never invoked #2011

Open
ventosus opened this issue Jan 17, 2025 · 2 comments

Comments

@ventosus
Copy link
Contributor

The prof_post_chat_message_display hook is never invoked on the plugin side for chat history messages, only the prof_pre_chat_message_displayhook seems to be invoked.

debug

In the plugin hooks I just put this:

char msg [128];
snprintf(msg, sizeof(msg), "[%s] %s %s %s", __func__, barejid, resource, message);
prof_cons_show(msg);

log

14:42:33 ! [prof_pre_chat_message_display] peer@domain1 (null) ping
14:42:33 ! [prof_pre_chat_message_display] me@domain2 (null) pong
14:42:33 ! [prof_on_chat_win_focus] peer@domain1

version

$ profanity --version 2>&1 | sed -e 's/^/    /g'
Profanity, version 0.14.0
Copyright (C) 2012 - 2019 James Booth <[email protected]>.
Copyright (C) 2019 - 2023 Michael Vetter <[email protected]>.
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Build information:
XMPP library: libstrophe
Desktop notification support: Enabled
OTR support: Enabled (libotr 4.1.1)
PGP support: Enabled (libgpgme 1.24.1)
OMEMO support: Enabled
C plugins: Enabled
Python plugins: Enabled (3.13.1)
GTK icons/clipboard: Disabled
GDK Pixbuf: Enabled
@jubalh
Copy link
Member

jubalh commented Jan 17, 2025

What do you mean by chat history messages?
The limited history sent by the MUC? Or do you mean messages retrieved via MAM?
MAM support isn't finished yet. Is named experimental in the documentation. And is being worked on here #1862

@ventosus
Copy link
Contributor Author

What do you mean by chat history messages?

The limited history sent by the MUC?

No, messages from the SQLite log database.

ventosus added a commit to ventosus/profanity that referenced this issue Jan 26, 2025
Currently all messages are injected only with the
`pre_chat_message_display` hook which is not consistent how received and
sent chat messages receive the plugin.

We should discriminate between received and sent messages. Sent messages
should be injected with the `pre_chat_message_send` hook instead of the
`pre_chat_message_display` hook.

We should also call `post` hooks for both the received and the sent messages.

Fixes: profanity-im#2011
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

No branches or pull requests

2 participants