001/**
002 *
003 * Copyright 2017 Paul Schaub
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.omemo.internal;
018
019import org.jivesoftware.smack.packet.Message;
020
021/**
022 * Class that bundles a decrypted message together with the original message and some information about the encryption.
023 *
024 * @author Paul Schaub
025 */
026public class ClearTextMessage {
027    private final String body;
028    private final Message encryptedMessage;
029    private final OmemoMessageInformation messageInformation;
030
031    public ClearTextMessage(String message, Message original, OmemoMessageInformation messageInfo) {
032        this.body = message;
033        this.encryptedMessage = original;
034        this.messageInformation = messageInfo;
035    }
036
037    /**
038     * Return the body of the decrypted message.
039     *
040     * @return plaintext body
041     */
042    public String getBody() {
043        return body;
044    }
045
046    /**
047     * Return the original Message object.
048     *
049     * @return original message
050     */
051    public Message getOriginalMessage() {
052        return encryptedMessage;
053    }
054
055    /**
056     * Return the OmemoMessageInformation.
057     *
058     * @return omemoMessageInformation
059     */
060    public OmemoMessageInformation getMessageInformation() {
061        return messageInformation;
062    }
063}