mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-30 12:32:17 -05:00
Use PgpKeyHelper.splitUserId in EncryptAsymmetricFragment
This commit is contained in:
parent
8ce837dbe4
commit
49bf040dae
@ -190,21 +190,20 @@ public class EncryptAsymmetricFragment extends Fragment {
|
|||||||
mMainUserId.setText("");
|
mMainUserId.setText("");
|
||||||
mMainUserIdRest.setText("");
|
mMainUserIdRest.setText("");
|
||||||
} else {
|
} else {
|
||||||
String uid = getResources().getString(R.string.user_id_no_name);
|
|
||||||
String uidExtra = "";
|
|
||||||
// See if we can get a user_id from a unified query
|
// See if we can get a user_id from a unified query
|
||||||
String user_id = (String) ProviderHelper.getUnifiedData(
|
String userIdResult = (String) ProviderHelper.getUnifiedData(
|
||||||
getActivity(), mSecretKeyId, KeyRings.USER_ID, ProviderHelper.FIELD_TYPE_STRING);
|
getActivity(), mSecretKeyId, KeyRings.USER_ID, ProviderHelper.FIELD_TYPE_STRING);
|
||||||
if(user_id != null) {
|
String[] userId = PgpKeyHelper.splitUserId(userIdResult);
|
||||||
String chunks[] = user_id.split(" <", 2);
|
if (userId[0] != null) {
|
||||||
uid = chunks[0];
|
mMainUserId.setText(userId[0]);
|
||||||
if (chunks.length > 1) {
|
} else {
|
||||||
uidExtra = "<" + chunks[1];
|
mMainUserId.setText(getResources().getString(R.string.user_id_no_name));
|
||||||
}
|
}
|
||||||
|
if (userId[1] != null) {
|
||||||
|
mMainUserIdRest.setText(userId[1]);
|
||||||
|
} else {
|
||||||
|
mMainUserIdRest.setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
mMainUserId.setText(uid);
|
|
||||||
mMainUserIdRest.setText(uidExtra);
|
|
||||||
mSign.setChecked(true);
|
mSign.setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user