Don't push things to google tasks that aren't assigned to you

pull/14/head
Sam Bosley 13 years ago
parent a19f797d42
commit 54d0390dd8

@ -1017,6 +1017,8 @@ public final class ActFmSyncService {
remote.setFlag(Task.REMINDER_FLAGS, Task.NOTIFY_AFTER_DEADLINE, false);
remote.putTransitory(SyncFlags.ACTFM_SUPPRESS_SYNC, true);
if (remote.getValue(Task.USER_ID) != Task.USER_ID_SELF)
remote.putTransitory(SyncFlags.GTASKS_SUPPRESS_SYNC, true);
taskService.save(remote);
ids.add(remote.getId());
metadataService.synchronizeMetadata(remote.getId(), metadata, MetadataCriteria.withKey(TagService.KEY));

@ -107,6 +107,9 @@ public final class GtasksSyncService {
return;
Task toPush = taskDao.fetch(model.getId(), TASK_PROPERTIES);
if (toPush.getValue(Task.USER_ID) != Task.USER_ID_SELF)
return;
operationQueue.offer(new TaskPushOp(toPush));
}
});

@ -143,10 +143,11 @@ public class GtasksSyncV2Provider extends SyncV2Provider {
private synchronized void pushUpdated(GtasksInvoker invoker, SyncResultCallback callback) {
TodorooCursor<Task> queued = taskService.query(Query.select(Task.PROPERTIES).
join(Join.left(Metadata.TABLE, Task.ID.eq(Metadata.TASK))).where(
Criterion.and(Task.USER_ID.eq(Task.USER_ID_SELF),
Criterion.or(
Criterion.and(MetadataCriteria.withKey(GtasksMetadata.METADATA_KEY),
Task.MODIFICATION_DATE.gt(GtasksMetadata.LAST_SYNC)),
Metadata.KEY.isNull())));
Metadata.KEY.isNull()))));
callback.incrementMax(queued.getCount() * 10);
try {
Task task = new Task();

Loading…
Cancel
Save