Incorrect handling of carbons
Alex Matthews provided a fix for this problem. I tested it on two different devices and now the message comes to the correct tab and not to everyone
@@ -535,17 +535,27 @@ public class ChatRoomImpl extends ChatRoom {
if ( forwardedStanza.getBody() != null )
{
if ( carbon.getDirection() == CarbonExtension.Direction.received )
+ {
+ if ((forwardedStanza.getFrom().equals(getJid()) && privateChat) || //private chat from MUC, match the full JID
+ (forwardedStanza.getFrom().asBareJid().equals(getJid().asBareJid()) && !privateChat)) //person to person chat, match bare jids
{
// This is a stanza that we received from someone on one of our other clients.
setParticipantJID(forwardedStanza.getFrom());
insertMessage( forwardedStanza );
}
+
+ }
else
+ {
+ if ((forwardedStanza.getTo().equals(getJid()) && privateChat) || //private chat from MUC, match full JID
+ (forwardedStanza.getTo().asBareJid().equals(getJid().asBareJid()) && !privateChat)) //person to person chat, match bare jids
{
// This is a stanza that one of our own clients sent.
setParticipantJID(forwardedStanza.getTo());
displaySendMessage( forwardedStanza );
}
+
+ }
showTyping( false );
}
}
