From 5259e3d048407a5ca9798e82a314c316481c9c64 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Wed, 3 Oct 2007 15:38:38 +0000 Subject: [PATCH] Use createFromRowID instead of createFromID for IDs that are not coming from the XML itself. --- .../sip/communicator/impl/history/HistoryImpl.java | 8 ++++---- .../communicator/impl/history/HistoryServiceImpl.java | 8 ++++---- .../impl/msghistory/MessageHistoryServiceImpl.java | 11 +++++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/net/java/sip/communicator/impl/history/HistoryImpl.java b/src/net/java/sip/communicator/impl/history/HistoryImpl.java index eaa70d179..4cd77b9c1 100644 --- a/src/net/java/sip/communicator/impl/history/HistoryImpl.java +++ b/src/net/java/sip/communicator/impl/history/HistoryImpl.java @@ -9,13 +9,13 @@ import java.io.*; import java.security.*; import java.util.*; -import javax.xml.parsers.*; -import org.w3c.dom.*; import net.java.sip.communicator.service.history.*; import net.java.sip.communicator.service.history.records.*; import net.java.sip.communicator.util.*; -import net.java.sip.communicator.util.xml.XMLUtils; +import net.java.sip.communicator.util.xml.*; + +import org.w3c.dom.*; /** * @author Alexander Pelov @@ -227,7 +227,7 @@ protected Document getDocumentForFile(String filename) // throw new RuntimeException("Error occured while " // + "parsing XML document.", e); // log.error("Error occured while parsing XML document.", e); - log.error("Error occured while parsing XML document."); + log.error("Error occured while parsing XML document.", e); // will try to fix the xml file retVal = getFixedDocument(file); diff --git a/src/net/java/sip/communicator/impl/history/HistoryServiceImpl.java b/src/net/java/sip/communicator/impl/history/HistoryServiceImpl.java index ea0b97592..8a6c4e4d0 100644 --- a/src/net/java/sip/communicator/impl/history/HistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/history/HistoryServiceImpl.java @@ -191,8 +191,8 @@ protected DocumentBuilder getDocumentBuilder() } /** - * Parse documets. Synchronized to avoid exception - * when concurently parsing with same DocumentBuilder + * Parse documents. Synchronized to avoid exception + * when concurrently parsing with same DocumentBuilder * @param file File the file to parse * @return Document the result document * @throws SAXException exception @@ -205,8 +205,8 @@ protected synchronized Document parse(File file) } /** - * Parse documets. Synchronized to avoid exception - * when concurently parsing with same DocumentBuilder + * Parse documents. Synchronized to avoid exception + * when concurrently parsing with same DocumentBuilder * @param in ByteArrayInputStream the stream to parse * @return Document the result document * @throws SAXException exception diff --git a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java index 6315578d6..e9bfccb30 100644 --- a/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/msghistory/MessageHistoryServiceImpl.java @@ -411,8 +411,10 @@ private History getHistory(Contact localContact, Contact remoteContact) String remoteId = remoteContact == null ? "default" : remoteContact .getAddress(); - HistoryID historyId = HistoryID.createFromID(new String[] { "messages", - localId, remoteId }); + HistoryID historyId = HistoryID.createFromRawID( + new String[] { "messages", + localId, + remoteId }); if (this.historyService.isHistoryExisting(historyId)) { @@ -473,7 +475,7 @@ private History getHistoryForMultiChat( String localId = localContact == null ? "default" : localContact .getAddress(); - HistoryID historyId = HistoryID.createFromID( + HistoryID historyId = HistoryID.createFromRawID( new String[] { "messages", localId, account, @@ -967,7 +969,8 @@ public void localUserPresenceChanged(LocalUserChatRoomPresenceChangeEvent evt) if(evt.getEventType() == LocalUserChatRoomPresenceChangeEvent.LOCAL_USER_JOINED) { - evt.getChatRoom().addMessageListener(this); + if (!evt.getChatRoom().isSystem()) + evt.getChatRoom().addMessageListener(this); } else {