Closed cisiqo closed 1 year ago
Hello,
I don't fully understand what you are trying to do with that patch, is the idea here to prevent storing those mucsub presences in offline storage, or the other way, always storing them?
After analyzing that patch this should prevent those event from being stored, so i guess that what you are trying to do here. I guess this makes sense for presences, we probably don't want to pollute offline storage with those, but that check is to relax for this i think, we should check explictly if that is mucsub presence (i see some worth in storing other events like subscription or affiliation change, and even more if those are completly different event produced by clients).
So i would preffer to add misc:get_mucsub_event_type()
(that should be direct copy of misc:is_mucsub_message
, but make it return Node
or false
, instead of true
and false
), and use that to just check for NS_MUCSUB_NODES_PRESENCE and filtering it out.
According to the previous logic, the presence message should not save the offline message.
If the store_empty_body
is true
, the presence message will be saved;
If the store_empty_body
is false
, an error will be reported here;
If the store_empty_body
is empty_chat_state
, then the presence will not be saved.
I modified it because I thought there was a flaw in the logic here.
Of course, if you understand the defects here, your modifications will definitely make the program clearer. Thanks.
Someone presence one muc room, the subscriber may received this message:
When the message need to store offline while the option
store_empty_body
wasfalse
, it must throw exception.