[sip-comm-dev] Possible bug in ChatConversationPanel.java


#1

Hello,
While trying to find out why nicely formatted HTML came out pretty
messed up in the chat window, I came across the fact that the
processLinks(String message, String contentType) method in the
ChatConversationPanel class tries to replace links (http://stuff and
www.stuff ) even in messages that are explicitly marked up as being
"text/html"
As a matter of fact, all it does in case it detects "text/html" as the
content type is to set the enclosing tags for the message to be
returned to "".
Now, I don't know if that's the intended behaviour, but it sure gave
me some headaches :slight_smile: . I made a little hack in order to eliminate this
bug, but once again, I'm not sure if that really is a bug (or maybe is
it a feature? :slight_smile: ) A patch file is attached to fix that bug, if people
with deeper knowledge of SC internals agree it is a bug (I'm
addressing here Yana especially as she wrote the class). The patch
simply makes the method return the original message in case its
content type is "text/html".

Have a nice day,
Mihai

ChatConversationPanel.java.patch (850 Bytes)


#2

Hey Mihai,

very nice catch! Thanks!

I'll have to fix this also in some other methods, so I'll make it globally in the formatMessage method instead of making it in processLinks. I'll commit this later today.

Sorry for the 'headache' :slight_smile:

Yana

Mihai Balan wrote:

···

Hello,
While trying to find out why nicely formatted HTML came out pretty
messed up in the chat window, I came across the fact that the
processLinks(String message, String contentType) method in the
ChatConversationPanel class tries to replace links (http://stuff and
www.stuff ) even in messages that are explicitly marked up as being
"text/html"
As a matter of fact, all it does in case it detects "text/html" as the
content type is to set the enclosing tags for the message to be
returned to "".
Now, I don't know if that's the intended behaviour, but it sure gave
me some headaches :slight_smile: . I made a little hack in order to eliminate this
bug, but once again, I'm not sure if that really is a bug (or maybe is
it a feature? :slight_smile: ) A patch file is attached to fix that bug, if people
with deeper knowledge of SC internals agree it is a bug (I'm
addressing here Yana especially as she wrote the class). The patch
simply makes the method return the original message in case its
content type is "text/html".

Have a nice day,
Mihai

------------------------------------------------------------------------

---------------------------------------------------------------------
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 Yana,

Hey Mihai,

very nice catch! Thanks!

I'll have to fix this also in some other methods, so I'll make it
globally in the formatMessage method instead of making it in
processLinks. I'll commit this later today.

Sorry for the 'headache' :slight_smile:

No problem, I'm glad it helped (and I wasn't wrong :D).

Yana

Mihai

···

On 7/9/07, Yana Stamcheva <yana@sip-communicator.org> wrote:

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