Looking at JdbcPersistenceManager.java on GIT : Openfire/JdbcPersistenceManager.java at master · igniterealtime/Openfire · GitHub
This is the SQL generated to retrieve message from one to one :
SELECT DISTINCT ofMessageArchive.fromJID, ofMessageArchive.toJID, ofMessageArchive.sentDate, ofMessageArchive.stanza, ofMessageArchive.messageID,
ofConParticipant.bareJID, ofMessageArchive.conversationID FROM ofMessageArchive
INNER JOIN ofConParticipant ON ofMessageArchive.conversationID = ofConParticipant.conversationID
WHERE (ofMessageArchive.stanza IS NOT NULL OR ofMessageArchive.body IS NOT NULL)
AND ofMessageArchive.toJID IS NOT NULL
AND ofConParticipant.bareJID = 'john@aragon'
AND (ofMessageArchive.toJID = 'aliced@aragon' OR ofMessageArchive.fromJID = 'aliced@aragon')
At this point, since ofConfParticipant also contains conversations from rooms, you do get messages from rooms when requesting history for 1 to 1
Shouldn’t it prevent this and ignore messages from rooms, adding :
INNER JOIN ofConversation ON ofConversation.conversationID = ofMessageArchive.conversationID
AND ofConversation.room IS NULL
I can’t believe something that big didn’t cause trouble for anyone. Is OpenFire even used to create chatroom and/or retrieve history from groupchat and one to one? Or is OpenFire dead like this forum?
EDIT : It uses the same SQL request for groupchat and chat -.-
A user archive is anticipated to provide the user with the ability to access their prior conversations. To this end, a server SHOULD include in a user archive all of the messages a user sends or receives of type ‘normal’ or ‘chat’ that contain a element. A server SHOULD also include messages of type ‘groupchat’ that have a , but where such history is accessible through another method (e.g. through an archive on the MUC JID)