summaryrefslogtreecommitdiff
path: root/src/mir_app/src/proto_opts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mir_app/src/proto_opts.cpp')
-rw-r--r--src/mir_app/src/proto_opts.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp
index c4d88b9466..f761bc4859 100644
--- a/src/mir_app/src/proto_opts.cpp
+++ b/src/mir_app/src/proto_opts.cpp
@@ -85,15 +85,6 @@ 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;
}
@@ -215,13 +206,17 @@ public:
rtrim(buf);
m_pa = Proto_CreateAccount(buf, szBaseProto, tszAccName);
+ if (Proto_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);
SendMessage(GetParent(m_hwnd), WM_MY_REFRESH, 0, 0);
EndModal(IDOK);
@@ -551,7 +546,7 @@ public:
pa->bIsEnabled = !pa->bIsEnabled;
if (pa->bIsEnabled) {
- if (ActivateAccount(pa)) {
+ if (Proto_ActivateAccount(pa)) {
if (bModulesLoadedFired)
pa->ppro->OnEvent(EV_PROTO_ONLOAD, 0, 0);
if (!db_get_b(0, "CList", "MoveProtoMenus", TRUE))