use of com.xabber.xmpp.archive.From in project xabber-android by redsolution.
the class ChatStorage method addItem.
public void addItem(AbstractChat abstractChat, Chat chat, AbstractMessage message, long offset) {
boolean incoming = message instanceof From;
if (message.getUtc() == null)
timestamp = new Date(timestamp.getTime() + message.getSecs() * 1000);
else
timestamp = message.getUtc();
String body = message.getBody();
net.java.otr4j.io.messages.AbstractMessage otrMessage;
try {
otrMessage = SerializationUtils.toMessage(body);
} catch (IOException e) {
return;
}
if (otrMessage != null) {
if (otrMessage.messageType != net.java.otr4j.io.messages.AbstractMessage.MESSAGE_PLAINTEXT)
return;
body = ((PlainTextMessage) otrMessage).cleanText;
}
MessageItem messageItem = new MessageItem(abstractChat, chat.getStartString(), Jid.getResource(chat.getWith()), body, null, new Date(timestamp.getTime() - offset), null, incoming, true, true, false, true, false, false);
items.add(messageItem);
}
Aggregations