Skip to content

Commit

Permalink
Make account list use lists not dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
wjt committed Apr 1, 2012
1 parent e1d90f5 commit 44fa7db
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,27 @@ const PanelMenu = imports.ui.panelMenu;
const PopupMenu = imports.ui.popupMenu;
const Panel = imports.ui.panel;

/* The values are string->bool dicts rather than arrays because I don't know
* offhand how to check if a string is in an array.
*/
const Accounts = {
"Me": {
"salut/local_2dxmpp/account0": true,
"gabble/jabber/will_40willthompson_2eco_2euk0": true
},
"Collabora": {
"gabble/jabber/will_2ethompson_40collabora_2eco_2euk0": true,
"idle/irc/wjt0": true
},
"SIP": {
"sofiasip/sip/_31002739_40sipgate_2eco_2euk0": true,
"sofiasip/sip/will_2ethompson_40voip_2ecollabora_2eco_2euk0": true
},
"Musicians": {
"gabble/jabber/t_2dpain_40test_2ecollabora_2eco_2euk0": true,
"gabble/jabber/lady_2dgaga_40test_2ecollabora_2eco_2euk0": true
},
"WE ARE SEX BOB-OMB!\nONE TWO THREE FOUR": {
"gabble/jabber/scott_40sp_2elit0": true,
"gabble/jabber/ramona_40sp_2elit0": true
},
"Me": [
"salut/local_2dxmpp/account0",
"gabble/jabber/will_40willthompson_2eco_2euk0",
],
"Collabora": [
"gabble/jabber/will_2ethompson_40collabora_2eco_2euk0",
"idle/irc/wjt0",
],
"SIP": [
"sofiasip/sip/_31002739_40sipgate_2eco_2euk0",
"sofiasip/sip/will_2ethompson_40voip_2ecollabora_2eco_2euk0",
],
"Musicians": [
"gabble/jabber/t_2dpain_40test_2ecollabora_2eco_2euk0",
"gabble/jabber/lady_2dgaga_40test_2ecollabora_2eco_2euk0",
],
"WE ARE SEX BOB-OMB!\nONE TWO THREE FOUR": [
"gabble/jabber/scott_40sp_2elit0",
"gabble/jabber/ramona_40sp_2elit0",
],
};

function AccountGroupSection() {
Expand Down Expand Up @@ -75,7 +72,7 @@ AccountGroupSection.prototype = {

for (let i = 0; i < accounts.length; i++) {
let account = accounts[i];
if (account.get_path_suffix() in this._accountIDs) {
if (this._accountIDs.indexOf(account.get_path_suffix()) >= 0) {
this._accounts.push(account);
/* If any account in this group is enabled, show the whole
* group as enabled.
Expand Down

0 comments on commit 44fa7db

Please sign in to comment.