Hi everybody,
I have created a plugin for seamonkey to search emails by Gloda.
main part of my code is the following.
let query=Gloda.newQuery(Gloda.NOUN_MESSAGE);
query.bodyMatches(searchKeyword);
query.getCollection({
onQueryCompleted: function _onQueryCompleted(msg_coll) {
let msg;
try{
while(msg=msg_coll.items.pop())
ExpressionSearchResult.messages.push(msg);
var searchResult = ExpressionSearchResult.messages;
for (i=0;i<searchResult.length;i++) {
var dbView = GetDBView();
var indices = GetSelectedIndices(dbView);
var ioService =
Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
let messageUri =
ioService.newURI(searchResult[i].folderMessageURI, null, null);
dbView.loadMessageByUrl(searchResult[i].folderMessageURI);
dbView.selectMsgByKey(searchResult[i].messageKey);
window.openDialog(
"chrome://messenger/content/messageWindow.xul",
"_blank","all,chrome,dialog=no,status,toolbar", messageUri, null, dbView );
}
} catch (e) {
ExpressionSearchLog.logException(e);
}
}
});
the founded email is shown in a the message window, but replay button
does not work, because in following code in mailWindowOverlay.js
function ComposeMsgByType(aCompType, aEvent, aFormat)
{
var format = aFormat || ((aEvent && aEvent.shiftKey) ?
msgComposeFormat.OppositeOfDefault : msgComposeFormat.Default);
ComposeMessage(aCompType,
format,
GetFirstSelectedMsgFolder(),
gFolderDisplay ? gFolderDisplay.selectedMessageUris : null);
}
gFolderDisplay.selectedMessageUris returns null.
folderDisplay.js
get selectedMessageUris()
{
if (!gDBView)
return null;
var messageArray = gDBView.getURIsForSelection({});
return messageArray.length ? messageArray : null;
},
because gDBView.getURIsForSelection returns null.
it is natural because I do not select an email from email list window.
how can I bypass it and solve this problem?
Thanks in advance,
Farshad
_______________________________________________
support-seamonkey mailing list
support-seamonkey@lists.mozilla.org
https://lists.mozilla.org/listinfo/support-seamonkey