Syncing tasks should now correctly save shared_with

pull/14/head
Sam Bosley 12 years ago
parent 962f782517
commit 7bda5dcf72

@ -398,6 +398,25 @@ public final class ActFmSyncService {
}
}
if (values.containsKey(Task.SHARED_WITH.name)) {
try {
JSONObject sharedWith = new JSONObject(task.getValue(Task.SHARED_WITH));
if (sharedWith.has("p")) {
JSONArray people = sharedWith.getJSONArray("p");
for (int i = 0; i < people.length(); i++) {
params.add("share_with[]"); params.add(people.getString(i));
}
if (sharedWith.has("message")) {
String message = sharedWith.getString("message");
if (!TextUtils.isEmpty(message))
params.add("message"); params.add(message);
}
}
} catch (JSONException e) {
Log.e("Error parsing shared_with", task.getValue(Task.SHARED_WITH), e);
}
}
if(Flags.checkAndClear(Flags.TAGS_CHANGED) || newlyCreated) {
TodorooCursor<Metadata> cursor = TagService.getInstance().getTags(task.getId(), false);
try {

@ -17,6 +17,7 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -236,6 +237,10 @@ public class PeopleContainer extends LinearLayout {
if(peopleList.length() > 0)
sharedWith.put("p", peopleList);
EditText message = (EditText) findViewById(R.id.message);
if (message.getText().length() > 0)
sharedWith.put("message", message.getText().toString());
return sharedWith;
}

Loading…
Cancel
Save