@ -415,7 +415,7 @@ public class EditPeopleControlSet extends PopupControlSet {
private int findAssignedIndex ( Task t , ArrayList < AssignedToUser > . . . userLists ) {
private int findAssignedIndex ( Task t , ArrayList < AssignedToUser > . . . userLists ) {
String assignedStr = t . getValue ( Task . USER ) ;
String assignedStr = t . getValue ( Task . USER ) ;
long assignedId = - 2 ;
long assignedId = - 2 ;
String assignedEmail = t . getValue ( Task . USER_ EMAIL ) ;
String assignedEmail = t . getValue ( Task . USER_ ID ) ;
try {
try {
JSONObject assigned = new JSONObject ( assignedStr ) ;
JSONObject assigned = new JSONObject ( assignedStr ) ;
assignedId = assigned . optLong ( "id" , - 2 ) ;
assignedId = assigned . optLong ( "id" , - 2 ) ;
@ -668,21 +668,20 @@ public class EditPeopleControlSet extends PopupControlSet {
} catch ( JSONException e ) {
} catch ( JSONException e ) {
// sad times
// sad times
taskUserId = task . getValue ( Task . USER_ID ) ;
taskUserId = task . getValue ( Task . USER_ID ) ;
if ( Task . USER_ID_EMAIL. equals ( taskUserId ) )
if ( Task . userIdIsEmail ( taskUserId ) )
taskUserEmail = task . getValue ( Task . USER_EMAIL ) ;
taskUserEmail = task UserId ;
}
}
String userId = Long . toString ( userJson . optLong ( "id" , - 2 ) ) ;
String userId = Long . toString ( userJson . optLong ( "id" , - 2 ) ) ;
String userEmail = userJson . optString ( "email" ) ;
String userEmail = userJson . optString ( "email" ) ;
boolean match = ( userId . equals ( taskUserId ) & & ! Task . USER_ID_EMAIL . equals ( userId ) ) ;
boolean match = userId . equals ( taskUserId ) ;
match = match | | ( userEmail . equals ( taskUserEmail ) & & ! TextUtils . isEmpty ( userEmail ) ) ;
match = match | | ( userEmail . equals ( taskUserEmail ) & & ! TextUtils . isEmpty ( userEmail ) ) ;
dirty = match ? dirty : true ;
dirty = match ? dirty : true ;
task . setValue ( Task . USER_ID , Long . toString ( userJson . optLong ( "id" , - 2 ) ) ) ;
String willAssignToId = Long . toString ( userJson . optLong ( "id" , - 2 ) ) ;
task . setValue ( Task . USER_ID , willAssignToId ) ;
if ( Task . USER_ID_EMAIL . equals ( task . getValue ( Task . USER_ID ) ) )
if ( Task . USER_ID_EMAIL . equals ( task . getValue ( Task . USER_ID ) ) )
task . setValue ( Task . USER_EMAIL , userEmail ) ;
task . setValue ( Task . USER_ID , userEmail ) ;
else
task . setValue ( Task . USER_EMAIL , "" ) ;
task . setValue ( Task . USER , "" ) ;
task . setValue ( Task . USER , "" ) ;
}
}