mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 19:22:14 -05:00
pass through original primary ID
This commit is contained in:
parent
4923c9b8e3
commit
140646fa12
@ -597,6 +597,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
|||||||
saveParams.oldPassPhrase = mCurrentPassphrase;
|
saveParams.oldPassPhrase = mCurrentPassphrase;
|
||||||
saveParams.newKeys = toPrimitiveArray(mKeysView.getNewKeysArray());
|
saveParams.newKeys = toPrimitiveArray(mKeysView.getNewKeysArray());
|
||||||
saveParams.keys = getKeys(mKeysView);
|
saveParams.keys = getKeys(mKeysView);
|
||||||
|
saveParams.originalPrimaryID = mUserIdsView.getOriginalPrimaryID();
|
||||||
|
|
||||||
|
|
||||||
// fill values for this action
|
// fill values for this action
|
||||||
|
@ -198,6 +198,21 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOriginalPrimaryID()
|
||||||
|
{ //NB: this will have to change when we change how Primary IDs are chosen, and so we need to be
|
||||||
|
// careful about where Master key capabilities are stored... multiple primaries and
|
||||||
|
// revoked ones make this harder than the simple case we are continuing to assume here
|
||||||
|
for (int i = 0; i < mEditors.getChildCount(); ++i) {
|
||||||
|
Editor editor = (Editor) mEditors.getChildAt(i);
|
||||||
|
if (mType == Id.type.user_id) {
|
||||||
|
if(((UserIdEditor)editor).getIsOriginallyMainUserID()) {
|
||||||
|
return ((UserIdEditor)editor).getOriginalID();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public ArrayList<String> getOriginalIDs()
|
public ArrayList<String> getOriginalIDs()
|
||||||
{
|
{
|
||||||
ArrayList<String> orig = new ArrayList<String>();
|
ArrayList<String> orig = new ArrayList<String>();
|
||||||
|
@ -229,6 +229,11 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getIsOriginallyMainUserID()
|
||||||
|
{
|
||||||
|
return mOriginallyMainUserID;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean primarySwapped()
|
public boolean primarySwapped()
|
||||||
{
|
{
|
||||||
return (mOriginallyMainUserID != isMainUserId());
|
return (mOriginallyMainUserID != isMainUserId());
|
||||||
|
Loading…
Reference in New Issue
Block a user