Ignore:
Timestamp:
02/03/20 14:12:59 (4 years ago)
Author:
bnemhaus
Message:

The HetrogeneousEncryptionLabels frame property is now set automatically when the owner of the frame is saving out an encrypted frame.
Also fixed some issues setting frame properties on load. For example, when loading a frame, the FrameEncryptionLabel should be set regardless of if you have permission to set the label.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/encryption/io/EncryptedExpWriter.java

    r1506 r1508  
    3535import org.expeditee.items.Line;
    3636import org.expeditee.items.Text;
     37import org.expeditee.settings.UserSettings;
    3738import org.expeditee.settings.identity.secrets.KeyList;
    3839import org.expeditee.stats.SessionStats;
     
    5051        protected static final String TERMINATOR_WITH_CONTINUATION = TERMINATOR + "...";
    5152
     53        /**
     54         * @return the labelnone
     55         */
     56        public static String getLabelNone() {
     57                return labelNone;
     58        }
     59       
    5260        public EncryptedExpWriter(String encryptionLabel) {
    5361                label = encryptionLabel;
     
    93101                if (_writer == null) { return; }
    94102               
     103                if (UserSettings.UserName.get().equals(frame.getOwner())) {
     104                        updateHetrogeneousOwnerLabels(frame);
     105                }
    95106                preOutputFrame();
    96107                writeHeader(frame);
     
    261272        }
    262273       
     274        private void updateHetrogeneousOwnerLabels(Frame toUpdate) {
     275                toUpdate.clearHetrogeneousFrameOwnerLabels();
     276                Text[] userLabels = KeyList.UserLabels.get();
     277                for (Text userLabel: userLabels) {
     278                        toUpdate.addToHetrogeneousFrameOwnerLabels(userLabel.getText());
     279                }               
     280        }
     281       
    263282        private static byte[] EncryptSymmetric(byte[] toEncrypt, SecretKey key) {
    264283                try {
     
    276295                }
    277296        }
    278 
    279         /**
    280          * @return the labelnone
    281          */
    282         public static String getLabelNone() {
    283                 return labelNone;
    284         }
    285297}
Note: See TracChangeset for help on using the changeset viewer.