Bug 1069845 - Viewing logs from faceted search results is broken. r=aleth

This commit is contained in:
Nihanth Subramanya 2015-02-21 05:36:06 +05:30
Родитель 7151c78191
Коммит 8e54ce1626
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -602,7 +602,7 @@ var chatHandler = {
this.observedContact = null;
let path = "logs/" + item.log.path;
path = OS.Path.join(OS.Constants.Path.profileDir, path.split("/"));
path = OS.Path.join(OS.Constants.Path.profileDir, ...path.split("/"));
imServices.logs.getLogFromFile(path, true).then(aLog => {
aLog.getConversation().then(aConv => {
this._showLog(aConv, path, item.searchTerm || undefined);

Просмотреть файл

@ -465,6 +465,8 @@ var GlodaIMIndexer = {
if (!logConv)
return Gloda.kWorkDone;
let fileName = OS.Path.basename(aLogPath);
let content = logConv.getMessages()
// Some messages returned, e.g. sessionstart messages,
// may have the noLog flag set. Ignore these.
@ -483,12 +485,14 @@ var GlodaIMIndexer = {
glodaConv._content = content;
}
else {
glodaConv = new GlodaIMConversation(logConv.title, log.time, log.path, content);
// Get the path of the file relative to the logs directory - the last 4
// components of the path.
let relativePath = OS.Path.split(aLogPath).components.slice(-4).join("/");
glodaConv = new GlodaIMConversation(logConv.title, log.time, relativePath, content);
if (aGlodaConv)
aGlodaConv.value = glodaConv;
}
let fileName = OS.Path.basename(aLogPath);
let isNew = !Object.prototype.hasOwnProperty.call(aCache, fileName);
let rv = aCallbackHandle.pushAndGo(
Gloda.grokNounItem(glodaConv, {}, true, isNew, aCallbackHandle));