Use createFromRowID instead of createFromID for IDs that are not coming from the XML itself.

cusax-fix
Yana Stamcheva 19 years ago
parent 245305cb52
commit 5259e3d048

@ -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);

@ -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

@ -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
{

Loading…
Cancel
Save