diff options
Diffstat (limited to 'src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsSourceService.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsSourceService.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsSourceService.java b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsSourceService.java index 1a71e82..518d5e2 100644 --- a/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsSourceService.java +++ b/src/net/java/sip/communicator/impl/googlecontacts/GoogleContactsSourceService.java @@ -60,6 +60,12 @@ public class GoogleContactsSourceService private AccountSettingsForm settings = null; /** + * If the account has been created using GoogleTalk wizard or via + * external Google Contacts. + */ + private boolean googleTalk = false; + + /** * Constructor. * * @param login login @@ -97,6 +103,29 @@ public class GoogleContactsSourceService } /** + * Set whether or not the account has been created via GoogleTalk wizard or + * external Google contacts. + * + * @param googleTalk value to set + */ + public void setGoogleTalk(boolean googleTalk) + { + this.googleTalk = googleTalk; + } + + /** + * Returns whether or not the account has been created via GoogleTalk + * wizard or via external Google Contacts. + * + * @return true if account has been created via GoogleTalk wizard or via + * external Google Contacts. + */ + public boolean isGoogleTalk() + { + return googleTalk; + } + + /** * Queries this search source for the given <tt>searchPattern</tt>. * * @param queryPattern the pattern to search for @@ -174,6 +203,12 @@ public class GoogleContactsSourceService return null; } + // To detect that account is a google ones, we try the following: + // - lookup in SRV and see if it is google.com; + // - if the account has been created with GoogleTalk form; + // - if it is an "external" google contact. + + // SRV checks for(SRVRecord srv : srvRecords) { if(srv.getTarget().endsWith("google.com") || @@ -184,6 +219,12 @@ public class GoogleContactsSourceService } } + // GoogleTalk based account or external Google Contacts ? + if(!isGoogleAppsOrGmail) + { + isGoogleAppsOrGmail = googleTalk; + } + if(isGoogleAppsOrGmail) { if(cnx == null) |