diff options
Diffstat (limited to 'protocols/MRA/src')
-rw-r--r-- | protocols/MRA/src/MraChat.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 6 |
2 files changed, 4 insertions, 10 deletions
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp index ac645e11a7..27573e70eb 100644 --- a/protocols/MRA/src/MraChat.cpp +++ b/protocols/MRA/src/MraChat.cpp @@ -65,17 +65,15 @@ INT_PTR CMraProto::MraChatSessionNew(HANDLE hContact) void CMraProto::MraChatSessionDestroy(HANDLE hContact)
{
- if ( !bChatExists)
+ if (!bChatExists || hContact == NULL)
return;
GCDEST gcd = { m_szModuleName, NULL, GC_EVENT_CONTROL };
GCEVENT gce = { sizeof(gce), &gcd };
CMStringW wszEMail;
- if (hContact) {
- mraGetStringW(hContact, "e-mail", wszEMail);
- gcd.ptszID = (LPWSTR)wszEMail.c_str();
- }
+ mraGetStringW(hContact, "e-mail", wszEMail);
+ gcd.ptszID = (LPWSTR)wszEMail.c_str();
CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index e050882e99..4cab8e9a78 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -60,8 +60,6 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : m_iXStatus = getByte(DBSETTING_XSTATUSID, MRA_MIR_XSTATUS_NONE);
if ( !IsXStatusValid(m_iXStatus))
m_iXStatus = MRA_MIR_XSTATUS_NONE;
-
- bChatExists = MraChatRegister();
}
CMraProto::~CMraProto()
@@ -115,9 +113,7 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM) db_set_resident(m_szModuleName, DBSETTING_BLOGSTATUSMUSIC);
// destroy all chat sessions
- if (bChatExists)
- MraChatSessionDestroy(NULL);
-
+ bChatExists = MraChatRegister();
return 0;
}
|