use of com.reucon.openfire.plugin.archive.model.ArchivedMessage.Direction in project Openfire by igniterealtime.
the class JdbcPersistenceManager method extractMessage.
private ArchivedMessage extractMessage(ResultSet rs) throws SQLException {
final ArchivedMessage message;
Date time = millisToDate(rs.getLong("sentDate"));
Direction direction = getDirection(rs);
String type = null;
String subject = null;
String body = rs.getString("body");
String bareJid = rs.getString("bareJID");
JID withJid = null;
if (Direction.from == direction) {
withJid = new JID(rs.getString("fromJID"));
}
message = new ArchivedMessage(time, direction, null, withJid);
// message.setId(id);
// message.setSubject(subject);
message.setBody(body);
return message;
}
use of com.reucon.openfire.plugin.archive.model.ArchivedMessage.Direction in project Openfire by igniterealtime.
the class JdbcPersistenceManager method getDirection.
private Direction getDirection(ResultSet rs) throws SQLException {
Direction direction = null;
String bareJid = rs.getString("bareJID");
String fromJid = rs.getString("fromJID");
String toJid = rs.getString("toJID");
if (bareJid != null && fromJid != null && toJid != null) {
if (bareJid.equals(fromJid)) {
/*
* if message from me to withJid then it is to the withJid participant
*/
direction = Direction.to;
} else {
/*
* if message to me from withJid then it is from the withJid participant
*/
direction = Direction.from;
}
}
return direction;
}
Aggregations