Fixes an NPE thrown when an URL without a scheme is clicked in the chat window. Patch contributed by Tom Denham.

Also removes a print mistakenly committed in r10051
cusax-fix
Boris Grozev 13 years ago
parent e21c425aac
commit f0a2931a2c

@ -64,7 +64,6 @@ public DesktopSharingButton(Call call, boolean fullScreen, boolean selected)
OperationSetDesktopSharingServer desktopSharing
= call.getProtocolProvider().getOperationSet(
OperationSetDesktopSharingServer.class);
System.err.println("DOHH"+desktopSharing);
if (desktopSharing == null)
{

@ -77,7 +77,7 @@ public class ChatConversationPanel
/**
* List for observing text messages.
*/
private Set<ChatLinkClickedListener> chatLinkClickedListeners =
private Set<ChatLinkClickedListener> chatLinkClickedListeners =
new HashSet<ChatLinkClickedListener>();
/**
@ -647,7 +647,7 @@ public void run()
/**
* Replaces the contents of the message with ID of the corrected message
* specified in chatMessage, with this message.
*
*
* @param chatMessage A <tt>ChatMessage</tt> that contains all the required
* information to correct the old message.
*/
@ -822,7 +822,7 @@ private void finishMessageAdd(String message, String contentType)
* Formats the given message. Processes the messages and replaces links to
* video/image sources with their previews or any other substitution. Spawns
* a separate thread for replacement.
*
*
* @param elem the element in the HTML Document.
* @param chatString the message.
*/
@ -1096,7 +1096,7 @@ private String formatMessage(String message,
* such and <code>&lt;PLAINTEXT&gt;</code>. The two procedures are carried
* out in one call in order to not break URLs which contain special HTML
* characters such as &amp;.
*
*
* @param message The source message string.
* @param processHTMLChars <tt>true</tt> to escape the special HTML chars;
* otherwise, <tt>false</tt>
@ -1260,7 +1260,7 @@ else if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0
logger.error("Invalid URL", e1);
return;
}
if(uri.getScheme().equals("jitsi"))
if("jitsi".equals(uri.getScheme()))
{
for(ChatLinkClickedListener l:chatLinkClickedListeners)
{
@ -1540,9 +1540,9 @@ private class MyTextPane
extends JTextPane
{
/**
* Returns the string to be used as the tooltip for <i>event</i>.
* Returns the string to be used as the tooltip for <i>event</i>.
*
* @param event the <tt>MouseEvent</tt>
* @param event the <tt>MouseEvent</tt>
* @return the string to be used as the tooltip for <i>event</i>.
*/
@Override
@ -1557,7 +1557,7 @@ public String getToolTipText(MouseEvent event)
/**
* Adds a custom component at the end of the conversation.
*
*
* @param component the component to add at the end of the conversation.
*/
public void addComponent(ChatConversationComponent component)
@ -1608,7 +1608,7 @@ public void addComponent(ChatConversationComponent component)
/**
* Registers a new link click listener.
*
*
* @param listener the object that should be notified when an internal
* link was clicked.
*/
@ -1620,7 +1620,7 @@ public void addChatLinkClickedListener(ChatLinkClickedListener listener)
/**
* Remove a registered link click listener.
*
*
* @param listener a registered click listener to remove
*/
public void removeChatLinkClickedListener(ChatLinkClickedListener listener)
@ -1643,7 +1643,7 @@ public void loadSkin()
/**
* Highlights the string in multi user chat.
*
*
* @param message the message to process
* @param contentType the content type of the message
* @param keyWord the keyword to highlight
@ -1859,7 +1859,7 @@ public void dispose()
}
/**
*
*
* @param attribute
* @param matchStrings
* @return
@ -1873,7 +1873,7 @@ private Element findElement(HTML.Attribute attribute,
}
/**
*
*
* @param attribute
* @param matchStrings
* @return
@ -1884,7 +1884,7 @@ private Element findFirstElement(String name)
}
/**
*
*
* @param element
* @param attrName
* @param matchStrings
@ -1917,7 +1917,7 @@ private Element findFirstElement( Element element,
}
/**
*
*
* @param element
* @param attrName
* @param matchStrings
@ -1944,7 +1944,7 @@ private Element findFirstElement( Element element,
}
/**
*
*
* @param elementId
* @param message
* @return
@ -1966,4 +1966,4 @@ private String getElementContent(String elementId, String message)
return null;
}
}
}

Loading…
Cancel
Save