1
0
mirror of https://github.com/etesync/android synced 2025-05-20 15:58:52 +00:00

Bug fixes

* fix a bug in handling TXT records (hopefully fixes #383)
* fix invalid translation strings
This commit is contained in:
rfc2822 2014-11-29 22:52:51 +01:00
parent e98f0bd1ed
commit bc8d63f233
2 changed files with 7 additions and 4 deletions

View File

@ -111,7 +111,7 @@
<string name="setup_add_account">Afegir compte</string> <string name="setup_add_account">Afegir compte</string>
<string name="setup_querying_server">Contactant servidor. Espereu sisuplau.</string> <string name="setup_querying_server">Contactant servidor. Espereu sisuplau.</string>
<string name="setup_what_to_sync">Quines col·leccions s'han de sincronitzar?</string> <string name="setup_what_to_sync">Quines col·leccions s\'han de sincronitzar?</string>
<string name="setup_address_books">Llibretes de contactes</string> <string name="setup_address_books">Llibretes de contactes</string>
<string name="setup_address_book">Llibreta de contactes</string> <string name="setup_address_book">Llibreta de contactes</string>
<string name="setup_calendars">Calendaris</string> <string name="setup_calendars">Calendaris</string>
@ -136,7 +136,7 @@
<string name="settings_network_logging">Registra el tràfic de xarxa</string> <string name="settings_network_logging">Registra el tràfic de xarxa</string>
<string name="settings_network_logging_enabled">Tot el tràfic de xarxa es reigstra (mode depuració)</string> <string name="settings_network_logging_enabled">Tot el tràfic de xarxa es reigstra (mode depuració)</string>
<string name="settings_network_logging_disabled">No es registra el tràfic de xarxa</string> <string name="settings_network_logging_disabled">No es registra el tràfic de xarxa</string>
<string name="settings_report_an_issue">Informa d'un error</string> <string name="settings_report_an_issue">Informa d\'un error</string>
</resources> </resources>

View File

@ -202,12 +202,14 @@ public class DavResourceFinder implements Closeable {
records = new Lookup(name, Type.TXT).run(); records = new Lookup(name, Type.TXT).run();
if (records != null && records.length >= 1) { if (records != null && records.length >= 1) {
TXTRecord txt = (TXTRecord)records[0]; TXTRecord txt = (TXTRecord)records[0];
for (String segment : (String[])txt.getStrings().toArray()) for (Object o : txt.getStrings().toArray()) {
String segment = (String)o;
if (segment.startsWith("path=")) { if (segment.startsWith("path=")) {
path = segment.substring(5); path = segment.substring(5);
Log.d(TAG, "Found initial context path for " + serviceName + " at " + domain + " -> " + path); Log.d(TAG, "Found initial context path for " + serviceName + " at " + domain + " -> " + path);
break; break;
} }
}
} }
} }
} catch (TextParseException e) { } catch (TextParseException e) {
@ -228,13 +230,14 @@ public class DavResourceFinder implements Closeable {
* @param resource Location that will be queried * @param resource Location that will be queried
* @param serviceName Well-known service name ("carddav", "caldav") * @param serviceName Well-known service name ("carddav", "caldav")
* @return WebDavResource of current-user-principal for the given service, or null if it can't be found * @return WebDavResource of current-user-principal for the given service, or null if it can't be found
*
* TODO: If a TXT record is given, always use it instead of trying .well-known first
*/ */
WebDavResource getCurrentUserPrincipal(ServerInfo serverInfo, String serviceName) throws URISyntaxException, IOException, NotAuthorizedException { WebDavResource getCurrentUserPrincipal(ServerInfo serverInfo, String serviceName) throws URISyntaxException, IOException, NotAuthorizedException {
URL initialURL = getInitialContextURL(serverInfo, serviceName); URL initialURL = getInitialContextURL(serverInfo, serviceName);
if (initialURL != null) { if (initialURL != null) {
// determine base URL (host name and initial context path) // determine base URL (host name and initial context path)
WebDavResource base = new WebDavResource(httpClient, WebDavResource base = new WebDavResource(httpClient,
//new URI(URIUtils.ensureTrailingSlash(serverInfo.getBaseURI())),
initialURL, initialURL,
serverInfo.getUserName(), serverInfo.getPassword(), serverInfo.isAuthPreemptive()); serverInfo.getUserName(), serverInfo.getPassword(), serverInfo.isAuthPreemptive());