Bug 1340947 - Part 4: Use for-of when iterating over fixIterator in mail/components/im/. r=jorgk

--HG--
extra : rebase_source : 955f24fd6312f7c11dd8d3bef7550a8efda3e060
This commit is contained in:
Tooru Fujisawa 2017-02-20 12:58:22 +09:00
Родитель 0c035e1e34
Коммит 26a32f0053
7 изменённых файлов: 9 добавлений и 9 удалений

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

@ -8,7 +8,7 @@ Components.utils.import("resource:///modules/imServices.jsm");
var addBuddy = {
onload: function ab_onload() {
let accountList = document.getElementById("accountlist");
for (let acc in fixIterator(Services.accounts.getAccounts())) {
for (let acc of fixIterator(Services.accounts.getAccounts())) {
if (!acc.connected)
continue;
let proto = acc.protocol;

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

@ -792,7 +792,7 @@ var chatHandler = {
let connected = false;
let hasAccount = false;
let canJoinChat = false;
for (let account in fixIterator(imServices.accounts.getAccounts())) {
for (let account of fixIterator(imServices.accounts.getAccounts())) {
hasAccount = true;
if (account.connected) {
connected = true;

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

@ -293,7 +293,7 @@ var gAccountManager = {
let server = null;
let imAccountId = this.accountList.selectedItem.account.numericId;
let mgr = MailServices.accounts;
for (let account in fixIterator(mgr.accounts, Ci.nsIMsgAccount)) {
for (let account of fixIterator(mgr.accounts, Ci.nsIMsgAccount)) {
let incomingServer = account.incomingServer;
if (!incomingServer || incomingServer.type != "im")
continue;

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

@ -1407,7 +1407,7 @@
// Populate the nicklist
this.buddies = new Map();
let nicks = fixIterator(this.conv.getParticipants());
for (let n in nicks)
for (let n of nicks)
this.addBuddy(n);
this.updateParticipantCount();
}

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

@ -12,7 +12,7 @@ var autoJoinPref = "autoJoin";
var joinChat = {
onload: function jc_onload() {
var accountList = document.getElementById("accountlist");
for (let acc in fixIterator(Services.accounts.getAccounts())) {
for (let acc of fixIterator(Services.accounts.getAccounts())) {
if (!acc.connected || !acc.canJoinChat)
continue;
var proto = acc.protocol;
@ -45,7 +45,7 @@ var joinChat = {
!(protoId == "prpl-irc" || protoId == "prpl-jabber" ||
protoId == "prpl-gtalk");
for (let field in fixIterator(acc.getChatRoomFields())) {
for (let field of fixIterator(acc.getChatRoomFields())) {
let row = document.createElement("row");
let label = document.createElement("label");

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

@ -41,10 +41,10 @@ var ChatCore = {
// the user has used an older version of Thunderbird on a
// profile with IM accounts. See bug 736035.
let accountsById = {};
for (let account in fixIterator(Services.accounts.getAccounts()))
for (let account of fixIterator(Services.accounts.getAccounts()))
accountsById[account.numericId] = account;
let mgr = MailServices.accounts;
for (let account in fixIterator(mgr.accounts, Components.interfaces.nsIMsgAccount)) {
for (let account of fixIterator(mgr.accounts, Components.interfaces.nsIMsgAccount)) {
let incomingServer = account.incomingServer;
if (!incomingServer || incomingServer.type != "im")
continue;

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

@ -69,7 +69,7 @@ GlodaIMConversation.prototype = {
// Find the nsIIncomingServer for the current imIAccount.
let mgr = MailServices.accounts;
for (let account in fixIterator(mgr.accounts, Ci.nsIMsgAccount)) {
for (let account of fixIterator(mgr.accounts, Ci.nsIMsgAccount)) {
let incomingServer = account.incomingServer;
if (!incomingServer || incomingServer.type != "im")
continue;