summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-09 22:00:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-09 22:00:39 +0300
commit810944bb10a541b1e047555b9bd965dccfccd5b1 (patch)
treeb3fd7c32aeb0d9b30143f91188f6fdc2419d873e /src
parentfebc07d9130541053e61a3080e8f0dd9fa6699b2 (diff)
fixes #1256 completely
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/proto_opts.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp
index 87032ad73f..15349f6595 100644
--- a/src/mir_app/src/proto_opts.cpp
+++ b/src/mir_app/src/proto_opts.cpp
@@ -82,6 +82,15 @@ MIR_APP_DLL(PROTOACCOUNT*) Proto_CreateAccount(const char *pszInternal, const ch
db_set_s(0, pa->szModuleName, "AM_BaseProto", pszBaseProto);
accounts.insert(pa);
+ if (ActivateAccount(pa)) {
+ if (bModulesLoadedFired)
+ pa->ppro->OnEvent(EV_PROTO_ONLOAD, 0, 0);
+ if (!db_get_b(0, "CList", "MoveProtoMenus", true))
+ pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0);
+ }
+
+ WriteDbAccounts();
+ NotifyEventHooks(hAccListChanged, PRAC_ADDED, (LPARAM)pa);
return pa;
}
@@ -898,17 +907,13 @@ void CAccountFormDlg::OnOk(CCtrlButton*)
rtrim(buf);
m_pa = Proto_CreateAccount(buf, szBaseProto, tszAccName);
- if (ActivateAccount(m_pa)) {
- if (bModulesLoadedFired)
- m_pa->ppro->OnEvent(EV_PROTO_ONLOAD, 0, 0);
- if (!db_get_b(0, "CList", "MoveProtoMenus", true))
- m_pa->ppro->OnEvent(EV_PROTO_ONMENU, 0, 0);
- }
}
- else replaceStrW(m_pa->tszAccountName, tszAccName);
+ else {
+ replaceStrW(m_pa->tszAccountName, tszAccName);
- WriteDbAccounts();
- NotifyEventHooks(hAccListChanged, m_action, (LPARAM)m_pa);
+ WriteDbAccounts();
+ NotifyEventHooks(hAccListChanged, m_action, (LPARAM)m_pa);
+ }
m_pParent->Refresh();
EndModal(IDOK);