powered by Jive Software

Monitoring plugin: getConversationKey() is case sensitive


In the monitoring plugin, the getConversationKey() method returns a key based on the bare JID of two users. However, the same JID can have different capitalization, depending on whether it’s the first or second JID, I noticed. A possible cause I can think of is that I have a certain capitalization of a contact in my roster and the server of my contact sends my Openfire server a different capitalization than in my roster.

However it may be, I propose that the JID is first toLowerCase()'d:

ConversationManager.java- String getConversationKey(JID jid1, JID jid2) {

ConversationManager.java- StringBuilder builder = new StringBuilder();

ConversationManager.java- if (jid1.compareTo(jid2) < 0) {

ConversationManager.java: builder.append(jid1.toBareJID().toLowerCase()).append("_").append(jid2.toBareJI D().toLowerCase());

ConversationManager.java- }

ConversationManager.java- else {

ConversationManager.java: builder.append(jid2.toBareJID().toLowerCase()).append("_").append(jid1.toBareJI D().toLowerCase());

ConversationManager.java- }

ConversationManager.java- return builder.toString();

ConversationManager.java- }

Of course tracking the origin of the different capitalization is an option as well.

This issue causes that a conversation between me and that contact is split up into two conversations: one with my messages and one with his.