summaryrefslogtreecommitdiff
path: root/plugins/Nudge/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-04-09 21:04:12 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-04-09 21:04:12 +0000
commit57c3fea94d824bdcad55626b0a352aad8ffa8cfd (patch)
treef6749a0954962d7ee8120a381580159adb080626 /plugins/Nudge/src
parent22d948a4cd28ccf08008db597e4f7470c3a57219 (diff)
Nudge:
- Minor optimisation git-svn-id: http://svn.miranda-ng.org/main/trunk@12719 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Nudge/src')
-rw-r--r--plugins/Nudge/src/main.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp
index a4c3b2143b..a9fa60ccf9 100644
--- a/plugins/Nudge/src/main.cpp
+++ b/plugins/Nudge/src/main.cpp
@@ -31,15 +31,19 @@ PLUGININFOEX pluginInfo = {
INT_PTR NudgeShowMenu(WPARAM wParam, LPARAM lParam)
{
- bool bEnabled = false;
-
- for (int i = 0; i < arNudges.getCount(); i++) {
- CNudgeElement &p = arNudges[i];
- if (!strcmp((char*)wParam, p.ProtocolName)) {
- bEnabled = GlobalNudge.useByProtocol ? p.enabled : DefaultNudge.enabled;
- break;
+ bool bEnabled;
+ if (GlobalNudge.useByProtocol) {
+ bEnabled = false;
+ for (int i = 0; i < arNudges.getCount(); i++) {
+ CNudgeElement &p = arNudges[i];
+ if (!strcmp((char*)wParam, p.ProtocolName)) {
+ bEnabled = p.enabled;
+ break;
+ }
}
}
+ else
+ bEnabled = DefaultNudge.enabled;
Menu_ShowItem(g_hContactMenu, bEnabled && lParam != 0);
return 0;