Commit 0c02018c authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed error loading room history using MS-SQL. JM-299


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/branches/jive_messenger_2_1_branch@1472 b35dd754-fafc-0310-a699-88a17e54d16e
parent 54e95f9f
......@@ -199,12 +199,16 @@ public class MUCPersistenceManager {
pstmt.setLong(2, room.getID());
rs = pstmt.executeQuery();
while (rs.next()) {
String senderJID = rs.getString(1);
String nickname = rs.getString(2);
Date sentDate = new Date(Long.parseLong(rs.getString(3).trim()));
String subject = rs.getString(4);
String body = rs.getString(5);
// Recreate the history only for the rooms that have the conversation logging
// enabled
if (room.isLogEnabled()) {
room.getRoomHistory().addOldMessage(rs.getString(1), rs.getString(2), sentDate,
rs.getString(4), rs.getString(5));
room.getRoomHistory().addOldMessage(senderJID, nickname, sentDate, subject,
body);
}
}
rs.close();
......@@ -466,13 +470,17 @@ public class MUCPersistenceManager {
if (room == null) {
continue;
}
String senderJID = rs.getString(2);
String nickname = rs.getString(3);
Date sentDate = new Date(Long.parseLong(rs.getString(4).trim()));
String subject = rs.getString(5);
String body = rs.getString(6);
try {
// Recreate the history only for the rooms that have the conversation logging
// enabled
if (room.isLogEnabled()) {
room.getRoomHistory().addOldMessage(rs.getString(2), rs.getString(3),
sentDate, rs.getString(5), rs.getString(6));
room.getRoomHistory().addOldMessage(senderJID, nickname, sentDate, subject,
body);
}
}
catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment