[sip-comm-dev] Re: svn commit: r5055 - trunk/src/net/java/sip/communicator: impl/gui/main/chat impl/protocol/jabber util


#1

Hi Damencho,

I believe we cannot close the issue yet. History for Gibberish protocol still shows HTML tags. I don't know about other protocols.

Cheers,
Martin

damencho@dev.java.net wrote:

···

Author: damencho
Date: 2009-02-23 11:49:42+0000
New Revision: 5055

Modified:
   trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
   trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java
   trunk/src/net/java/sip/communicator/util/ImageUtils.java

Log:
Fix issue #481(inconsistent history in chat window) caused by body end tag in jabber messages preventing javax.swing.text.html.HTMLDocument from rendering the rest of the messages. Add a check in ImageUtils for unknown or broken images causing NPE.

Modified: trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&r1=5054&r2=5055

--- trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java (original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java 2009-02-23 11:49:42+0000
@@ -415,14 +415,13 @@
                                 String escapedMessageID)
     {
         Iterator<EventObject> iterator = historyList.iterator();
- String historyString = "";
          String messageType;
          while (iterator.hasNext())
         {
             Object o = iterator.next();
-
+ String historyString = "";
              if(o instanceof MessageDeliveredEvent)
             {
@@ -437,7 +436,7 @@
                 else
                     messageType = Constants.HISTORY_OUTGOING_MESSAGE;
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -460,7 +459,7 @@
                     else
                         messageType = Constants.HISTORY_INCOMING_MESSAGE;
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                                 evt.getSourceContact().getDisplayName(),
                                 evt.getTimestamp(),
                                 messageType,
@@ -476,7 +475,7 @@
                 ProtocolProviderService protocolProvider = evt
                     .getSourceChatRoom().getParentProvider();
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -492,7 +491,7 @@
                 if(!evt.getMessage().getMessageUID()
                         .equals(escapedMessageID))
                 {
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             evt.getSourceChatRoomMember().getName(),
                             evt.getTimestamp(),
                             Constants.HISTORY_INCOMING_MESSAGE,
@@ -500,9 +499,10 @@
                             evt.getMessage().getContentType());
                 }
             }
+
+ conversationPanel.appendMessageToEnd(historyString);
         }
- conversationPanel.insertMessageAfterStart(historyString);
          getChatWindow().getMainToolBar()
             .changeHistoryButtonsState(this);

Modified: trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&r1=5054&r2=5055

--- trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java (original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java 2009-02-23 11:49:42+0000
@@ -346,8 +346,20 @@
                 }
                  if (messageBuff.length() > 0)
+ {
+ // we remove body tags around message cause their
+ // end body tag is breaking
+ // the visualization as html in the UI
+ String receivedMessage =
+ messageBuff.toString()
+ // removes body start tag
+ .replaceAll("\\<[bB][oO][dD][yY].*?>","")
+ // removes body end tag
+ .replaceAll("\\</[bB][oO][dD][yY].*?>","");
+
                     newMessage =
- createMessage(messageBuff.toString(), HTML_MIME_TYPE);
+ createMessage(receivedMessage, HTML_MIME_TYPE);
+ }
             }
              Contact sourceContact =

Modified: trunk/src/net/java/sip/communicator/util/ImageUtils.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/util/ImageUtils.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/util/ImageUtils.java&p2=trunk/src/net/java/sip/communicator/util/ImageUtils.java&r1=5054&r2=5055

--- trunk/src/net/java/sip/communicator/util/ImageUtils.java (original)
+++ trunk/src/net/java/sip/communicator/util/ImageUtils.java 2009-02-23 11:49:42+0000
@@ -127,7 +127,10 @@
             InputStream in = new ByteArrayInputStream(imageBytes);
             BufferedImage image = ImageIO.read(in);
- imageIcon = getScaledRoundedIcon(image, width, height);
+ if(image != null)
+ imageIcon = getScaledRoundedIcon(image, width, height);
+ else
+ logger.trace("Unknown image format or error reading image");
         }
         catch (Exception e)
         {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Hi,

what do you mean by showing html tags ? How can I reproduce it ?
The problem I fixed is that when opening a chat windows you have to see 10 messages of history
and sometimes they are less than expected - "inconsistent history in chat window". It has nothing to do
with showing html tags.

Cheers
damencho

Martin André wrote:

···

Hi Damencho,

I believe we cannot close the issue yet. History for Gibberish protocol still shows HTML tags. I don't know about other protocols.

Cheers,
Martin

damencho@dev.java.net wrote:

Author: damencho
Date: 2009-02-23 11:49:42+0000
New Revision: 5055

Modified:
   trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
   trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java

   trunk/src/net/java/sip/communicator/util/ImageUtils.java

Log:
Fix issue #481(inconsistent history in chat window) caused by body end tag in jabber messages preventing javax.swing.text.html.HTMLDocument from rendering the rest of the messages. Add a check in ImageUtils for unknown or broken images causing NPE.
Modified: trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&r1=5054&r2=5055

==============================================================================

--- trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java (original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java 2009-02-23 11:49:42+0000
@@ -415,14 +415,13 @@
                                 String escapedMessageID)
     {
         Iterator<EventObject> iterator = historyList.iterator();
- String historyString = "";
          String messageType;
          while (iterator.hasNext())
         {
             Object o = iterator.next();
-
+ String historyString = "";
              if(o instanceof MessageDeliveredEvent)
             {
@@ -437,7 +436,7 @@
                 else
                     messageType = Constants.HISTORY_OUTGOING_MESSAGE;
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -460,7 +459,7 @@
                     else
                         messageType = Constants.HISTORY_INCOMING_MESSAGE;
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                                 evt.getSourceContact().getDisplayName(),
                                 evt.getTimestamp(),
                                 messageType,
@@ -476,7 +475,7 @@
                 ProtocolProviderService protocolProvider = evt
                     .getSourceChatRoom().getParentProvider();
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -492,7 +491,7 @@
                 if(!evt.getMessage().getMessageUID()
                         .equals(escapedMessageID))
                 {
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             evt.getSourceChatRoomMember().getName(),
                             evt.getTimestamp(),
                             Constants.HISTORY_INCOMING_MESSAGE,
@@ -500,9 +499,10 @@
                             evt.getMessage().getContentType());
                 }
             }
+
+ conversationPanel.appendMessageToEnd(historyString);
         }
- conversationPanel.insertMessageAfterStart(historyString);
          getChatWindow().getMainToolBar()
             .changeHistoryButtonsState(this);

Modified: trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java

Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&r1=5054&r2=5055

==============================================================================

--- trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java (original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java 2009-02-23 11:49:42+0000
@@ -346,8 +346,20 @@
                 }
                  if (messageBuff.length() > 0)
+ {
+ // we remove body tags around message cause their
+ // end body tag is breaking
+ // the visualization as html in the UI
+ String receivedMessage =
+ messageBuff.toString()
+ // removes body start tag
+ .replaceAll("\\<[bB][oO][dD][yY].*?>","")
+ // removes body end tag
+ .replaceAll("\\</[bB][oO][dD][yY].*?>","");
+
                     newMessage =
- createMessage(messageBuff.toString(), HTML_MIME_TYPE);
+ createMessage(receivedMessage, HTML_MIME_TYPE);
+ }
             }
              Contact sourceContact =

Modified: trunk/src/net/java/sip/communicator/util/ImageUtils.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/util/ImageUtils.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/util/ImageUtils.java&p2=trunk/src/net/java/sip/communicator/util/ImageUtils.java&r1=5054&r2=5055

==============================================================================

--- trunk/src/net/java/sip/communicator/util/ImageUtils.java (original)
+++ trunk/src/net/java/sip/communicator/util/ImageUtils.java 2009-02-23 11:49:42+0000
@@ -127,7 +127,10 @@
             InputStream in = new ByteArrayInputStream(imageBytes);
             BufferedImage image = ImageIO.read(in);
- imageIcon = getScaledRoundedIcon(image, width, height);
+ if(image != null)
+ imageIcon = getScaledRoundedIcon(image, width, height);
+ else
+ logger.trace("Unknown image format or error reading image");
         }
         catch (Exception e)
         {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Damian,

Create a Guibberish account, and send formated text, for example bold. You'll receive you own message, except that it is not formated but shows HTML tags.
Reading the title of the issue you fixed, and your commit description, I though this was related (HTML is not processed). Obviously, this is a new one.

Martin

Damian Minkov wrote:

···

Hi,

what do you mean by showing html tags ? How can I reproduce it ?
The problem I fixed is that when opening a chat windows you have to see 10 messages of history
and sometimes they are less than expected - "inconsistent history in chat window". It has nothing to do
with showing html tags.

Cheers
damencho

Martin André wrote:

Hi Damencho,

I believe we cannot close the issue yet. History for Gibberish protocol still shows HTML tags. I don't know about other protocols.

Cheers,
Martin

damencho@dev.java.net wrote:

Author: damencho
Date: 2009-02-23 11:49:42+0000
New Revision: 5055

Modified:
   trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
   trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java

   trunk/src/net/java/sip/communicator/util/ImageUtils.java

Log:
Fix issue #481(inconsistent history in chat window) caused by body end tag in jabber messages preventing javax.swing.text.html.HTMLDocument from rendering the rest of the messages. Add a check in ImageUtils for unknown or broken images causing NPE.
Modified: trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&r1=5054&r2=5055

==============================================================================

--- trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java (original)
+++ trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java 2009-02-23 11:49:42+0000
@@ -415,14 +415,13 @@
                                 String escapedMessageID)
     {
         Iterator<EventObject> iterator = historyList.iterator();
- String historyString = "";
          String messageType;
          while (iterator.hasNext())
         {
             Object o = iterator.next();
-
+ String historyString = "";
              if(o instanceof MessageDeliveredEvent)
             {
@@ -437,7 +436,7 @@
                 else
                     messageType = Constants.HISTORY_OUTGOING_MESSAGE;
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -460,7 +459,7 @@
                     else
                         messageType = Constants.HISTORY_INCOMING_MESSAGE;
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                                 evt.getSourceContact().getDisplayName(),
                                 evt.getTimestamp(),
                                 messageType,
@@ -476,7 +475,7 @@
                 ProtocolProviderService protocolProvider = evt
                     .getSourceChatRoom().getParentProvider();
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -492,7 +491,7 @@
                 if(!evt.getMessage().getMessageUID()
                         .equals(escapedMessageID))
                 {
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             evt.getSourceChatRoomMember().getName(),
                             evt.getTimestamp(),
                             Constants.HISTORY_INCOMING_MESSAGE,
@@ -500,9 +499,10 @@
                             evt.getMessage().getContentType());
                 }
             }
+
+ conversationPanel.appendMessageToEnd(historyString);
         }
- conversationPanel.insertMessageAfterStart(historyString);
          getChatWindow().getMainToolBar()
             .changeHistoryButtonsState(this);

Modified: trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java

Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&r1=5054&r2=5055

==============================================================================

--- trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java (original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java 2009-02-23 11:49:42+0000
@@ -346,8 +346,20 @@
                 }
                  if (messageBuff.length() > 0)
+ {
+ // we remove body tags around message cause their
+ // end body tag is breaking
+ // the visualization as html in the UI
+ String receivedMessage =
+ messageBuff.toString()
+ // removes body start tag
+ .replaceAll("\\<[bB][oO][dD][yY].*?>","")
+ // removes body end tag
+ .replaceAll("\\</[bB][oO][dD][yY].*?>","");
+
                     newMessage =
- createMessage(messageBuff.toString(), HTML_MIME_TYPE);
+ createMessage(receivedMessage, HTML_MIME_TYPE);
+ }
             }
              Contact sourceContact =

Modified: trunk/src/net/java/sip/communicator/util/ImageUtils.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/util/ImageUtils.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/util/ImageUtils.java&p2=trunk/src/net/java/sip/communicator/util/ImageUtils.java&r1=5054&r2=5055

==============================================================================

--- trunk/src/net/java/sip/communicator/util/ImageUtils.java (original)
+++ trunk/src/net/java/sip/communicator/util/ImageUtils.java 2009-02-23 11:49:42+0000
@@ -127,7 +127,10 @@
             InputStream in = new ByteArrayInputStream(imageBytes);
             BufferedImage image = ImageIO.read(in);
- imageIcon = getScaledRoundedIcon(image, width, height);
+ if(image != null)
+ imageIcon = getScaledRoundedIcon(image, width, height);
+ else
+ logger.trace("Unknown image format or error reading image");
         }
         catch (Exception e)
         {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: commits-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hey Martin,

Do you have this with any other protocol?

It is quite possible that this is Gibberish specific in which we'll
probably keep it for some other time.

Cheers
Emil

Martin André wrote:

···

Hi Damian,

Create a Guibberish account, and send formated text, for example bold.
You'll receive you own message, except that it is not formated but shows
HTML tags.
Reading the title of the issue you fixed, and your commit description, I
though this was related (HTML is not processed). Obviously, this is a
new one.

Martin

Damian Minkov wrote:

Hi,

what do you mean by showing html tags ? How can I reproduce it ?
The problem I fixed is that when opening a chat windows you have to see
10 messages of history
and sometimes they are less than expected - "inconsistent history in
chat window". It has nothing to do
with showing html tags.

Cheers
damencho

Martin André wrote:

Hi Damencho,

I believe we cannot close the issue yet. History for Gibberish
protocol still shows HTML tags. I don't know about other protocols.

Cheers,
Martin

damencho@dev.java.net wrote:

Author: damencho
Date: 2009-02-23 11:49:42+0000
New Revision: 5055

Modified:
   trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
   
trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java

   trunk/src/net/java/sip/communicator/util/ImageUtils.java

Log:
Fix issue #481(inconsistent history in chat window) caused by body
end tag in jabber messages preventing
javax.swing.text.html.HTMLDocument from rendering the rest of the
messages. Add a check in ImageUtils for unknown or broken images
causing NPE.
Modified:
trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
Url:
https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&p2=trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java&r1=5054&r2=5055

==============================================================================

---
trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
(original)
+++
trunk/src/net/java/sip/communicator/impl/gui/main/chat/ChatPanel.java
2009-02-23 11:49:42+0000
@@ -415,14 +415,13 @@
                                 String escapedMessageID)
     {
         Iterator<EventObject> iterator = historyList.iterator();
- String historyString = "";

         String messageType;

         while (iterator.hasNext())
         {
             Object o = iterator.next();
-
+ String historyString = "";

             if(o instanceof MessageDeliveredEvent)
             {
@@ -437,7 +436,7 @@
                 else
                     messageType = Constants.HISTORY_OUTGOING_MESSAGE;

- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -460,7 +459,7 @@
                     else
                         messageType =
Constants.HISTORY_INCOMING_MESSAGE;

- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                                 
evt.getSourceContact().getDisplayName(),
                                 evt.getTimestamp(),
                                 messageType,
@@ -476,7 +475,7 @@
                 ProtocolProviderService protocolProvider = evt
                     .getSourceChatRoom().getParentProvider();

- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             GuiActivator.getUIService().getMainFrame()
                                 .getAccount(protocolProvider),
                             evt.getTimestamp(),
@@ -492,7 +491,7 @@
                 if(!evt.getMessage().getMessageUID()
                         .equals(escapedMessageID))
                 {
- historyString += processHistoryMessage(
+ historyString = processHistoryMessage(
                             evt.getSourceChatRoomMember().getName(),
                             evt.getTimestamp(),
                             Constants.HISTORY_INCOMING_MESSAGE,
@@ -500,9 +499,10 @@
                             evt.getMessage().getContentType());
                 }
             }
+
+ conversationPanel.appendMessageToEnd(historyString);
         }

- conversationPanel.insertMessageAfterStart(historyString);

         getChatWindow().getMainToolBar()
             .changeHistoryButtonsState(this);

Modified:
trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java

Url:
https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java&r1=5054&r2=5055

==============================================================================

---
trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java
(original)
+++
trunk/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicInstantMessagingJabberImpl.java
2009-02-23 11:49:42+0000
@@ -346,8 +346,20 @@
                 }

                 if (messageBuff.length() > 0)
+ {
+ // we remove body tags around message cause their
+ // end body tag is breaking
+ // the visualization as html in the UI
+ String receivedMessage =
+ messageBuff.toString()
+ // removes body start tag
+ .replaceAll("\\<[bB][oO][dD][yY].*?>","")
+ // removes body end tag
+ .replaceAll("\\</[bB][oO][dD][yY].*?>","");
+
                     newMessage =
- createMessage(messageBuff.toString(),
HTML_MIME_TYPE);
+ createMessage(receivedMessage, HTML_MIME_TYPE);
+ }
             }

             Contact sourceContact =

Modified: trunk/src/net/java/sip/communicator/util/ImageUtils.java
Url:
https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/util/ImageUtils.java?view=diff&rev=5055&p1=trunk/src/net/java/sip/communicator/util/ImageUtils.java&p2=trunk/src/net/java/sip/communicator/util/ImageUtils.java&r1=5054&r2=5055

==============================================================================

--- trunk/src/net/java/sip/communicator/util/ImageUtils.java
(original)
+++ trunk/src/net/java/sip/communicator/util/ImageUtils.java
2009-02-23 11:49:42+0000
@@ -127,7 +127,10 @@
             InputStream in = new ByteArrayInputStream(imageBytes);
             BufferedImage image = ImageIO.read(in);

- imageIcon = getScaledRoundedIcon(image, width, height);
+ if(image != null)
+ imageIcon = getScaledRoundedIcon(image, width, height);
+ else
+ logger.trace("Unknown image format or error reading
image");
         }
         catch (Exception e)
         {

---------------------------------------------------------------------
To unsubscribe, e-mail:
commits-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail:
commits-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net