Permalink
Browse files

Make account list use lists not dicts

  • Loading branch information...
1 parent e1d90f5 commit 44fa7dba0d9e07867db813812dd3be72f291a908 @wjt committed Apr 1, 2012
Showing with 21 additions and 24 deletions.
  1. +21 −24 extension.js
View
@@ -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() {
@@ -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.

0 comments on commit 44fa7db

Please sign in to comment.