diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java index bd04fdee3..e503d54f7 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncThread.java @@ -7,6 +7,7 @@ import java.util.Queue; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.utility.Pair; +import com.todoroo.astrid.actfm.sync.messages.BriefMe; import com.todoroo.astrid.actfm.sync.messages.ChangesHappened; import com.todoroo.astrid.actfm.sync.messages.ClientToServerMessage; import com.todoroo.astrid.dao.TagDataDao; @@ -80,7 +81,8 @@ public class ActFmSyncThread { } if (messages.isEmpty() && timeForBackgroundSync()) { - // Add BriefMe messages + messages.add(getBriefMe(Task.class)); + messages.add(getBriefMe(TagData.class)); } if (!messages.isEmpty()) { @@ -104,6 +106,12 @@ public class ActFmSyncThread { return null; } + private BriefMe getBriefMe(Class cls) { + // TODO: compute last pushed at value for model class + long pushedAt = 0; + return new BriefMe(cls, null, pushedAt); + } + private boolean timeForBackgroundSync() { return true; } diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/BriefMe.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/BriefMe.java index a806dbef2..32e5f12f1 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/BriefMe.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/BriefMe.java @@ -9,6 +9,10 @@ public class BriefMe extends ClientToServerMessage modelClass, String uuid, long pushedAt) { + super(modelClass, uuid, pushedAt); + } + @Override public void sendMessage() { // Send message diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java index 09e73fa6e..d03501e75 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/messages/ClientToServerMessage.java @@ -1,5 +1,6 @@ package com.todoroo.astrid.actfm.sync.messages; +import com.todoroo.andlib.data.AbstractModel; import com.todoroo.astrid.dao.RemoteModelDao; import com.todoroo.astrid.data.RemoteModel; @@ -10,6 +11,13 @@ public abstract class ClientToServerMessage { protected final String uuid; protected final long pushedAt; + public ClientToServerMessage(Class modelClass, String uuid, long pushedAt) { + this.modelClass = modelClass; + this.uuid = uuid; + this.pushedAt = pushedAt; + this.id = AbstractModel.NO_ID; + } + public ClientToServerMessage(long id, Class modelClass, RemoteModelDao modelDao) { this.id = id; this.modelClass = modelClass;