mirror of https://github.com/tasks/tasks
Implemented UserMigrated message, update all reference to local user id to be a string
parent
fb8905f469
commit
330edc80b0
@ -0,0 +1,24 @@
|
|||||||
|
package com.todoroo.astrid.actfm.sync.messages;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import com.todoroo.andlib.utility.Preferences;
|
||||||
|
import com.todoroo.astrid.actfm.sync.ActFmPreferenceService;
|
||||||
|
import com.todoroo.astrid.data.RemoteModel;
|
||||||
|
|
||||||
|
public class UserMigrated extends ServerToClientMessage {
|
||||||
|
|
||||||
|
public UserMigrated(JSONObject json) {
|
||||||
|
super(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processMessage(String serverTime) {
|
||||||
|
String newUuid = json.optString("new_user_id"); //$NON-NLS-1$
|
||||||
|
if (RemoteModel.isValidUuid(newUuid)) {
|
||||||
|
Preferences.setString(ActFmPreferenceService.PREF_USER_ID, newUuid);
|
||||||
|
new ConvertSelfUserIdsToZero();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue