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

Inbox's unread messages count not manages XEP-0422 (Message Fastening) #4037

Open
ZXDMNicola opened this issue Jun 13, 2023 · 4 comments
Open

Comments

@ZXDMNicola
Copy link

As described in the document https://xmpp.org/extensions/xep-0422.html, message fastening is used to attach additional information to existing messages, such as deletion, editing, reactions, and more.

Description:

The current implementation of MongooseIM's inbox feature does not properly handle the impact of XEP-0422 (Message Fastening) on the unread count. As a result, when a user receives a message fastening, the unread count is inaccurately increased.

Steps to Reproduce:

  • Send a message with another user
  • Fasten the message using XEP-0422
  • Check the unread count for the receiver's inbox

Expected Behavior:

The unread count for the user's inbox should not be affected by message fastenings. Receiving a message fastening should not increase the unread count.

Actual Behavior:

When an user receives a message fastening the unread count for the user's inbox is increased, indicating an incorrect number of unread messages.

@ZXDMNicola ZXDMNicola changed the title Inbox's unread message count not manages XEP-0422 (Message Fastening) Inbox's unread messages count not manages XEP-0422 (Message Fastening) Jun 13, 2023
@DenysGonchar
Copy link
Collaborator

currently MongooseIM doesn't support XEP-0422 Message Fastening you can find a list of supported XEPs here

@ZXDMNicola
Copy link
Author

Hi @DenysGonchar, thanks for the quick response!
I see that XEP-0422 is not present in the list of supported XEPs, but XEP-0424 Message Retraction is supported and is an implementation of XEP-0422 Message Fastening.

In fact if I use message retraction MongooseIM replaces my previous message with a tombstone, but also increases the unread message counter of the inbox like described above, so the issue is pretty the same.

@arcusfelis
Copy link
Contributor

We really just call set_inbox_incr_unread for everything that reaches user_send_message hook which is not a chat market.

Actually, fastening could be even trickier. Because for example, a liked message could reorder the inbox ordering, but would not update the total number of unread messages (i.e. insagram logic).

So, probably we would need to use message hints and hints for not-increment and for not-set-last-message. And the best part is what to put as a last message when someone likes a message :) (could be someone liked a message or could be an actual last message).

@DenysGonchar
Copy link
Collaborator

I would say that there are 2 approaches that can be used to count unread messages:

  • first one - treating it as a number of messages to fetch from MAM.
  • second one - logical representation of unread messages in a conversation.
    We are currently trying to follow the first approach, and for now we don't have any plans to change it. If you want, you can make additional filtering in handle_incoming_message functions in mod_inbox_one2one, mod_inbox_muclight, mod_inbox_muc modules.

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

3 participants