Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e5e18f2 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Update collection properties (name, color) on every sync

parent 062bfc60
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -8,10 +8,14 @@

package at.bitfire.davdroid;

import android.util.Log;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DAVUtils {
	private static final String TAG = "davdroid.DAVutils";

	public static int CalDAVtoARGBColor(String davColor) {
		int color = 0xFFC3EA6E;		// fallback: "DAVdroid green"
		if (davColor != null) {
@@ -21,8 +25,10 @@ public class DAVUtils {
				int color_rgb = Integer.parseInt(m.group(1), 16);
				int color_alpha = m.group(2) != null ? (Integer.parseInt(m.group(2), 16) & 0xFF) : 0xFF;
				color = (color_alpha << 24) | color_rgb;
			}
			} else
				Log.w(TAG, "Couldn't parse color " + davColor + ", using DAVdroid green");
		}
		return color;
	}

}
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import at.bitfire.davdroid.webdav.DavFilter;
import at.bitfire.davdroid.webdav.DavMultiget;
import at.bitfire.davdroid.webdav.DavProp;

public class CalDavCalendar extends RemoteCollection<Event> {
public class CalDavCalendar extends WebDavCollection<Event> {
	private final static String TAG = "davdroid.CalDAVCalendar";

	public CalDavCalendar(CloseableHttpClient httpClient, String baseURL, String user, String password, boolean preemptiveAuth) throws URISyntaxException {
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import at.bitfire.davdroid.webdav.DavFilter;
import at.bitfire.davdroid.webdav.DavMultiget;
import at.bitfire.davdroid.webdav.DavProp;

public class CalDavTaskList extends RemoteCollection<Task> {
public class CalDavTaskList extends WebDavCollection<Task> {
	private final static String TAG = "davdroid.CalDAVTaskList";

	public CalDavTaskList(CloseableHttpClient httpClient, String baseURL, String user, String password, boolean preemptiveAuth) throws URISyntaxException {
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ import at.bitfire.davdroid.syncadapter.AccountSettings;
import at.bitfire.davdroid.webdav.DavMultiget;
import ezvcard.VCardVersion;

public class CardDavAddressBook extends RemoteCollection<Contact> {
public class CardDavAddressBook extends WebDavCollection<Contact> {
	AccountSettings accountSettings;

	@Override
+6 −0
Original line number Diff line number Diff line
@@ -124,6 +124,12 @@ public class LocalAddressBook extends LocalCollection<Contact> {
		accountSettings.setAddressBookCTag(cTag);
	}

	@Override
	public void updateMetaData(String displayName, String color)
	{
		// address books don't have a display name or color in Android
	}

	
	/* create/update/delete */
	
Loading