Skip to content

Commit

Permalink
Monitor Mudim 0.9
Browse files Browse the repository at this point in the history
Fixes #149.
  • Loading branch information
1ec5 committed Dec 28, 2015
1 parent 86ce453 commit 7fd7c3a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion content/addonsOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ function MudimMonitor() {
.getService(Ci.nsIPrefService).getBranch("extensions.avim.");
const mudimPrefs = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getBranch("chimmudim.");
const mudimPrefs2 = Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService).getBranch("mudimffxextensions.mudim.");
const avimEnabledId = "enabled";
const mudimMethodId = "settings.method";

Expand Down Expand Up @@ -49,8 +51,10 @@ function MudimMonitor() {
this.registerPrefs = function() {
avimPrefs.QueryInterface(Ci.nsIPrefBranch2);
mudimPrefs.QueryInterface(Ci.nsIPrefBranch2);
mudimPrefs2.QueryInterface(Ci.nsIPrefBranch2);
avimPrefs.addObserver(avimEnabledId, this, false);
mudimPrefs.addObserver(mudimMethodId, this, false);
mudimPrefs2.addObserver(mudimMethodId, this, false);
this.getPrefs();
};

Expand All @@ -60,6 +64,7 @@ function MudimMonitor() {
this.unregisterPrefs = function() {
avimPrefs.removeObserver(avimEnabledId, this);
mudimPrefs.removeObserver(mudimMethodId, this);
mudimPrefs2.removeObserver(mudimMethodId, this);
};

/**
Expand All @@ -70,7 +75,8 @@ function MudimMonitor() {
*/
this.conflicts = function() {
return avimPrefs.getBoolPref(avimEnabledId) && this.mudim &&
this.mudim.enabled && mudimPrefs.getIntPref(mudimMethodId);
this.mudim.enabled && (mudimPrefs.getIntPref(mudimMethodId) ||
mudimPrefs2.getIntPref(mudimMethodId));
};

/**
Expand All @@ -94,6 +100,8 @@ function MudimMonitor() {
}
catch (e) {}
}
mudimPrefs.setIntPref(mudimMethodId, 0);
mudimPrefs2.setIntPref(mudimMethodId, 0);
};

function getNotificationBox() {
Expand Down

0 comments on commit 7fd7c3a

Please sign in to comment.