diff -r 7c332c71ff22 instantbird/app/profile/all-instantbird.js --- a/instantbird/app/profile/all-instantbird.js Sat Aug 20 00:04:41 2011 +0200 +++ b/instantbird/app/profile/all-instantbird.js Wed Aug 24 02:08:26 2011 +0200 @@ -46,6 +46,7 @@ pref("messenger.conversations.openInTabs", true); pref("messenger.conversations.useSeparateWindowsForMUCs", false); +pref("messenger.conversations.alwaysClose", true); pref("messenger.conversations.selections.magicCopyEnabled", true); pref("messenger.conversations.selections.ellipsis", "chrome://instantbird/locale/instantbird.properties"); diff -r 7c332c71ff22 instantbird/content/blist.css --- a/instantbird/content/blist.css Sat Aug 20 00:04:41 2011 +0200 +++ b/instantbird/content/blist.css Wed Aug 24 02:08:26 2011 +0200 @@ -147,3 +147,16 @@ contact[cansend][selected] .startChatBubble { display: -moz-box; } + +conv { + -moz-binding: url("chrome://instantbird/content/conv.xml#conv"); + -moz-box-align: center; +} + +.convUnreadCount[value="0"] { + display: none; +} + +#buddyListMsg[listedConvCount="0"] > .listboxHeader { + display: none; +} diff -r 7c332c71ff22 instantbird/content/blist.js --- a/instantbird/content/blist.js Sat Aug 20 00:04:41 2011 +0200 +++ b/instantbird/content/blist.js Wed Aug 24 02:08:26 2011 +0200 @@ -40,9 +40,11 @@ const events = ["contact-availability-changed", "contact-added", "contact-tag-added", + "showing-ui-conversation", "status-changed", "tag-hidden", "tag-shown", + "ui-conversation-hidden", "user-display-name-changed", "user-icon-changed", "purple-quit"]; @@ -350,6 +352,20 @@ return; } + if (aTopic == "ui-conversation-hidden") { + let convElt = document.createElement("conv"); + this.convBox.appendChild(convElt); + convElt.build(aSubject); + this._updateListConvCount(); + return; + } + else if (aTopic == "showing-ui-conversation") { + if (this.convBox.listedConvs.hasOwnProperty(aSubject.id)) + this.convBox.listedConvs[aSubject.id].removeNode(); + this._updateListConvCount(); + return; + } + // aSubject is an imIContact if (aSubject.online || this._showOffline) { aSubject.getTags().forEach(function (aTag) { @@ -361,6 +377,11 @@ } }, + _updateListConvCount: function() { + let count = Object.keys(this.convBox.listedConvs).length; + this.convBox.parentNode.setAttribute("listedConvCount", count); + }, + displayUserIcon: function bl_displayUserIcon() { let icon = Services.core.getUserIcon(); document.getElementById("userIcon").src = icon ? icon.spec : ""; @@ -641,6 +662,21 @@ buddyList.showOtherContacts(); blistBox.focus(); + buddyList.convBox = document.getElementById("convlistbox"); + buddyList.convBox.listedConvs = {}; + let convs = Services.conversations.getUIConversations(); + if (convs.hasMoreElements()) { + if (!("Conversations" in window)) + Components.utils.import("resource:///modules/imWindows.jsm"); + for (let conv in getIter(convs)) { + if (Conversations.isUIConversationDisplayed(conv)) { + let convElt = document.createElement("conv"); + buddyList.convBox.appendChild(convElt); + convElt.build(conv); + } + } + buddyList._updateListConvCount(); + } prefBranch.addObserver(showOfflineBuddiesPref, buddyList, false); addObservers(buddyList, events); diff -r 7c332c71ff22 instantbird/content/blist.xul --- a/instantbird/content/blist.xul Sat Aug 20 00:04:41 2011 +0200 +++ b/instantbird/content/blist.xul Wed Aug 24 02:08:26 2011 +0200 @@ -168,7 +168,10 @@ - + +