diff options
author | Damian Minkov <damencho@jitsi.org> | 2013-06-21 13:13:05 +0300 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2013-06-21 13:15:11 +0300 |
commit | c56b57040fd1c389dd2b689bec39212361ff4ce1 (patch) | |
tree | ff60dcc0587cf8c2326ef0306df837ffeb55feb7 | |
parent | fd979ca5b944808a8af4c72c3a87552ffeda0aee (diff) | |
download | jitsi-c56b57040fd1c389dd2b689bec39212361ff4ce1.zip jitsi-c56b57040fd1c389dd2b689bec39212361ff4ce1.tar.gz jitsi-c56b57040fd1c389dd2b689bec39212361ff4ce1.tar.bz2 |
Searches for display name no longer match part of number, now searching for exact match.
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/call/CallManager.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java index f271a61..ca0e95a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java @@ -10,6 +10,7 @@ import java.awt.*; import java.text.*; import java.util.*; import java.util.List; +import java.util.regex.*; import javax.swing.*; @@ -3684,12 +3685,29 @@ public class CallManager = new Vector<ResolveAddressToDisplayNameContactQueryListener> (1, 1); + // will strip the @server-address part, as the regular expression + // will match it + int index = peerAddress.indexOf("@"); + String peerUserID = + (index > -1) ? peerAddress.substring(0, index) : peerAddress; + + // searches for the whole number/username or with the @serverpart + Pattern p = Pattern.compile( + "^(" + peerUserID + "|" + peerUserID + "@.*)$"); + // Queries all available resolvers for(ContactSourceService contactSourceService: GuiActivator.getContactSources()) { + if(!(contactSourceService + instanceof ExtendedContactSourceService)) + continue; + + // use the pattern method of (ExtendedContactSourceService) ContactQuery query - = contactSourceService.queryContactSource(peerAddress, 1); + = ((ExtendedContactSourceService)contactSourceService) + .queryContactSource(p); + resolvers.add( new ResolveAddressToDisplayNameContactQueryListener( query)); |