var channelHandler = {
getAccounts: function ch_getAccounts() getIter(Services.accounts.getAccounts()),
joinChannel: function ch_joinChannel(aChannel) {
let account = null;
window.alert(1);
for (let acc in channelHandler.getAccounts()) {
window.alert("21");
if (!acc.connected || !acc.canJoinChat)
continue;
account = acc;
break;
}
window.alert("2");
if (account) {
window.alert("3");
let values = account.getChatRoomDefaultFieldValues();
window.alert("4");
values.setValue("channel", aChannel);
window.alert("5");
account.joinChat(values);
window.alert("6");
}
}
};




Mibbit.com Pasted on 2012-05-17 07:09:39