Fixes a problem causing inaccurate result on contact search in the contact list.

Fixes wrong behavior in contact list - when one clicks with the right mouse button, after she has clicked the left mouse button, the chat window was opened together with the right button menu, while the right behavior would be to have just the right button menu opened.
cusax-fix
Yana Stamcheva 15 years ago
parent f5c6840d78
commit aeeadd21f8

@ -261,6 +261,18 @@ else if (query instanceof MetaContactQuery)
}
}
/**
* Verifies if the given query is contained in this filter query.
*
* @param query the query we're looking for
* @return <tt>true</tt> if the given <tt>query</tt> is contained in this
* filter query, <tt>false</tt> - otherwise
*/
public boolean containsQuery(Object query)
{
return filterQueries.contains(query);
}
public void contactReceived(ContactReceivedEvent event) {}
public void metaContactReceived(MetaContactQueryEvent event) {}

@ -823,11 +823,13 @@ private void addContact(final ContactQuery query,
{
public void run()
{
// If in the meantime the corresponding query was canceled
// we don't proceed with adding.
// If in the meantime the filter has changed we don't
// add the contact.
if (query != null
&& query.getStatus() != ContactQuery.QUERY_CANCELED)
&& currentFilterQuery.containsQuery(query))
{
addContact(contact, group, isSorted);
}
}
});
return;
@ -1365,16 +1367,12 @@ public void mousePressed(MouseEvent e)
if (!(lastComponent instanceof TreeNode))
return;
// Open message window, right button menu when mouse is pressed.
// Open right button menu when right mouse is pressed.
if (lastComponent instanceof ContactNode)
{
UIContact uiContact
= ((ContactNode) lastComponent).getContactDescriptor();
fireContactListEvent(
uiContact,
ContactListEvent.CONTACT_CLICKED, e.getClickCount());
if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0
|| (e.isControlDown() && !e.isMetaDown()))
{
@ -1388,10 +1386,6 @@ else if (lastComponent instanceof GroupNode)
UIGroup uiGroup
= ((GroupNode) lastComponent).getGroupDescriptor();
fireContactListEvent(
uiGroup,
ContactListEvent.GROUP_CLICKED, e.getClickCount());
if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0
|| (e.isControlDown() && !e.isMetaDown()))
{

Loading…
Cancel
Save